From 51a2568bc1e71978c2887d9167292b1a7395ee73 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 16 May 2025 17:17:21 +0200 Subject: [PATCH 001/213] #125 Initial commit for MediumImplementation in ThermoSysPro --- .../SimpleExamples/TestAirHumidity.mo | 55 -- .../Fluid/Examples/SimpleExamples/TestBend.mo | 49 -- .../SimpleExamples/TestBoilerSystem.mo | 69 -- .../TestCHPEngineBarkantineSystem.mo | 49 -- .../SimpleExamples/TestCentrifugalPump1.mo | 86 --- .../Examples/SimpleExamples/TestCheckValve.mo | 101 --- .../SimpleExamples/TestCombustionTurbine.mo | 66 -- .../Examples/SimpleExamples/TestCompressor.mo | 61 -- .../Examples/SimpleExamples/TestDiaphragm.mo | 50 -- .../TestDiffusion_DynamicOnePhaseFlowPipe.mo | 140 ---- ...TestDiffusion_DynamicPlateHeatExchanger.mo | 62 -- .../TestDiffusion_DynamicTwoPhaseFlowPipe.mo | 187 ----- .../SimpleExamples/TestDiffusion_VolumeA.mo | 71 -- .../SimpleExamples/TestDynamicCheckValve.mo | 58 -- .../SimpleExamples/TestDynamicCondenser.mo | 119 --- .../SimpleExamples/TestDynamicDrum.mo | 183 ----- .../SimpleExamples/TestDynamicDrum_CC.mo | 190 ----- ...DynamicFlueGasesMultiFluidHeatExchanger.mo | 89 --- .../TestDynamicMultiFluidHeatExchanger.mo | 85 -- ...TestDynamicMultiFluidHeatExchangerShell.mo | 87 --- .../TestDynamicOnePhaseFlowPipe.mo | 62 -- .../TestDynamicOnePhaseFlowShell.mo | 80 -- .../TestDynamicPlateHeatExchanger.mo | 89 --- .../SimpleExamples/TestDynamicReliefValve.mo | 103 --- .../TestDynamicTwoPhaseFlowPipe.mo | 120 --- .../TestDynamicTwoPhaseFlowRiser.mo | 79 -- .../SimpleExamples/TestDynamicWaterHeating.mo | 306 -------- .../TestDynamicWaterHeatingOnePipe.mo | 298 ------- ...ynamicWaterSteamMultiFluidHeatExchanger.mo | 84 -- .../TestFixedPowerHeatExchanger.mo | 53 -- .../SimpleExamples/TestFossilFuelBoiler.mo | 82 -- .../SimpleExamples/TestFresnelField.mo | 172 ----- .../SimpleExamples/TestGTCombustionChamber.mo | 83 -- .../Examples/SimpleExamples/TestGasTurbine.mo | 105 --- .../SimpleExamples/TestGenericCombustion.mo | 86 --- .../SimpleExamples/TestGenericCombustion1D.mo | 144 ---- .../SimpleExamples/TestGridFurnace.mo | 90 --- .../SimpleExamples/TestHeatPumpCompressor.mo | 53 -- .../SimpleExamples/TestIdealCheckValve.mo | 111 --- .../SimpleExamples/TestIdealSwitchValve.mo | 65 -- .../TestInternalCombustionEngine.mo | 113 --- .../TestInvSingularPressureLoss.mo | 38 - .../Examples/SimpleExamples/TestJunctions1.mo | 115 --- .../Examples/SimpleExamples/TestJunctions2.mo | 131 ---- .../Examples/SimpleExamples/TestJunctions3.mo | 121 --- .../Examples/SimpleExamples/TestJunctions4.mo | 59 -- .../SimpleExamples/TestLoopBreaker.mo | 73 -- .../SimpleExamples/TestMassFlowMultiplier.mo | 47 -- .../SimpleExamples/TestNTUWaterHeater0.mo | 105 --- .../SimpleExamples/TestPostCombustionGas.mo | 93 --- .../SimpleExamples/TestPressurizer.mo | 149 ---- .../Fluid/Examples/SimpleExamples/TestRefP.mo | 62 -- .../Examples/SimpleExamples/TestRefP1.mo | 56 -- .../Examples/SimpleExamples/TestSensors.mo | 61 -- .../TestSimpleDynamicCondenser.mo | 122 --- .../TestSimpleDynamicCondenser1.mo | 95 --- ...TestSimpleEvaporatorWaterSteamFlueGases.mo | 71 -- .../TestSimpleStaticCondenser.mo | 53 -- .../TestSingularPressureLoss.mo | 51 -- .../SimpleExamples/TestStaticAerocondenser.mo | 97 --- .../TestStaticCentrifugalPump1.mo | 52 -- .../SimpleExamples/TestStaticCondenser.mo | 123 --- .../SimpleExamples/TestStaticCondenserHEI.mo | 126 --- .../SimpleExamples/TestStaticDrum1.mo | 92 --- .../SimpleExamples/TestStaticDrum2.mo | 77 -- .../TestStaticExchangerDTorWorEff.mo | 63 -- .../SimpleExamples/TestStaticExchangerKS.mo | 53 -- .../Examples/SimpleExamples/TestStaticFan.mo | 223 ------ .../TestStaticPlateHeatExchanger.mo | 55 -- .../TestStaticWallFlueGasesExchanger.mo | 68 -- .../SimpleExamples/TestSteamDryer1.mo | 62 -- .../SimpleExamples/TestSteamDryer2.mo | 62 -- .../SimpleExamples/TestSteamEngine.mo | 51 -- .../TestSteamExtractionSplitter.mo | 61 -- .../SimpleExamples/TestStodolaTurbine1.mo | 92 --- .../SimpleExamples/TestStodolaTurbine2.mo | 53 -- .../SimpleExamples/TestSwitchValve.mo | 67 -- .../Fluid/Examples/SimpleExamples/TestTank.mo | 67 -- .../SimpleExamples/TestTankHorizontal.mo | 69 -- .../SimpleExamples/TestThreeWayValve.mo | 64 -- .../SimpleExamples/TestTwoPhaseCavity.mo | 116 --- .../TestTwoPhaseCavityOnePipe.mo | 122 --- .../SimpleExamples/TestTwoPhaseVolume.mo | 116 --- .../Examples/SimpleExamples/TestVolumeA.mo | 112 --- .../Examples/SimpleExamples/TestVolumeA1.mo | 78 -- .../Examples/SimpleExamples/TestVolumeI.mo | 111 --- .../Examples/SimpleExamples/package.order | 86 --- .../Fluid/Interfaces/Connectors/FluidInlet.mo | 17 +- .../Interfaces/Connectors/FluidOutlet.mo | 17 +- .../DryAirIdealGas/DryAirIdealGas.mo | 2 +- .../Properties/FlueGases/FlueGases_h.mo | 2 +- .../Properties/FlueGases/FlueGases_h_Ps.mo | 2 +- .../Properties/FlueGases/FlueGases_s.mo | 2 +- ThermoSysPro/Properties/FlueGases/XSat.mo | 2 +- ThermoSysPro/Properties/Fluid/Density_Ph.mo | 2 +- .../Properties/Fluid/Density_derh_Ph.mo | 2 +- .../Properties/Fluid/Density_derp_Ph.mo | 2 +- .../Properties/Fluid/DynamicViscosity_Ph.mo | 2 +- ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo | 2 +- .../Properties/Fluid/Reynolds_PhvD.mo | 2 +- .../Fluid/SpecificHeatCapacityCp_PT.mo | 2 +- .../Fluid/SpecificHeatCapacityCp_Ph.mo | 2 +- .../SpecificInternalEnergy_Ph_DO_NOT_USE.mo | 2 +- .../Properties/Fluid/Temperature_Ph.mo | 2 +- .../Fluid/ThermalConductivity_Ph.mo | 2 +- .../Properties/Fluid/derDensity_derP_derh.mo | 2 +- .../Fluid/derDensity_derh_derP_derh.mo | 2 +- .../Fluid/derDynamicViscosity_derP_derh.mo | 2 +- .../derDynamicViscosity_derP_derh_old.mo | 2 +- .../Fluid/derDynamicViscosity_derT_derrho.mo | 2 +- .../Fluid/derSpecificEnthalpy_derP_derT.mo | 2 +- .../Fluid/derTemperature_derP_derh.mo | 2 +- .../Fluid/derderDensity_derderP_derderh.mo | 2 +- .../derderDensity_derh_derderP_derderh.mo | 2 +- .../derderTemperature_derderP_derderh.mo | 2 +- .../Media/PartialSubCMedium/C_BiPhase.mo | 6 + .../HomogeneousPhasesSeparation.mo | 18 + .../Media/PartialSubCMedium/noSaS.mo | 6 + .../Media/PartialSubCMedium/package.mo | 5 + .../Media/PartialSubCMedium/package.order | 6 + .../partialPhasesSeparation.mo | 64 ++ .../Media/PartialSubCMedium/partialSaS.mo | 5 + .../PartialThermoSysProMedium/package.mo | 5 + .../PartialThermoSysProMedium/package.order | 0 .../package.mo | 5 + .../package.order | 0 .../Properties/Media/WaterSteam/package.mo | 730 ++++++++++++++++++ .../Properties/Media/WaterSteam/package.order | 53 ++ ThermoSysPro/Properties/Media/package.mo | 115 +++ ThermoSysPro/Properties/Media/package.order | 4 + .../MoltenSalt/DynamicViscosity_T.mo | 2 +- .../MoltenSalt/ThermalConductivity_T.mo | 2 +- .../ThermoPropertiesFunction_T_2.mo | 2 +- .../Oil_TherminolVP1/TherminolVP1_Data.mo | 2 +- .../WaterSolution/MassFraction_eq_PT.mo | 2 +- .../WaterSolution/Pressure_eq_TX.mo | 2 +- .../Properties/WaterSteam/BaseIF97.mo | 2 +- ThermoSysPro/Properties/WaterSteam/Common.mo | 2 +- .../Properties/WaterSteam/IF97_packages.mo | 4 +- .../SimpleWater/SpecificEnthalpy_PT_der.mo | 2 +- .../SimpleWater/Water_Ph_der.mo | 2 +- ThermoSysPro/Properties/package.order | 1 + 142 files changed, 1075 insertions(+), 8213 deletions(-) delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/package.order create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo create mode 100644 ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo create mode 100644 ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.order create mode 100644 ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo create mode 100644 ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.order create mode 100644 ThermoSysPro/Properties/Media/WaterSteam/package.mo create mode 100644 ThermoSysPro/Properties/Media/WaterSteam/package.order create mode 100644 ThermoSysPro/Properties/Media/package.mo create mode 100644 ThermoSysPro/Properties/Media/package.order diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo deleted file mode 100644 index 8798a071..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo +++ /dev/null @@ -1,55 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestAirHumidity - - ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity(hum0=0.9, - ppvap0(start=2085.0), - rho_air(start=1.14), - rho_vap(start=0.015)) - annotation (Placement(transformation(extent={{-10,0},{10,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss(K=1.e-5, rho(start=1.17)) - annotation (Placement(transformation(extent={{40,0},{ - 60,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases - annotation (Placement(transformation(extent={{80,0},{100,20}},rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ( - option_temperature=true, - Xco2=0, - Xh2o=0.0132625, - Xo2=0.217282, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=100000, - T0=293) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, - rotation=0))); - -equation - connect(airHumidity.C2, singularPressureLoss.C1) - annotation (Line(points={{10,10},{40,10}}, color={0,0,0})); - connect(singularPressureLoss.C2, sinkFlueGases.C) - annotation (Line(points={{60,10},{80,10}}, color={0,0,0})); - connect(sourceFlueGasesPQ.C, airHumidity.C1) - annotation (Line(points={{-60,10},{-10,10}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestAirHumidity; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo deleted file mode 100644 index ed5108df..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo +++ /dev/null @@ -1,49 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestBend - - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement(transformation(extent={{-100,26},{-80,46}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1 - annotation (Placement(transformation( - extent={{60,0},{80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.Bend Bend annotation (Placement( - transformation(extent={{-20,26},{0,46}}, rotation=0))); -equation - connect(Bend.C2, SinkP1.C) - annotation (Line(points={{-10,26},{-10,10},{60,10}}, color={0,0,255})); - connect(SourceP1.C, Bend.C1) - annotation (Line(points={{-80,36},{-20,36}}, color={0,0,255})); - annotation (experiment(StopTime=1000), - Window( - x=0.45, - y=0.01, - width=0.35, - height=0.49), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestBend; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo deleted file mode 100644 index 25ed08f0..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo +++ /dev/null @@ -1,69 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestBoilerSystem - import ThermoSysPro; - ThermoSysPro.Fluid.Boilers.BoilerSystem BoilerSystem( - Wloss=0, - Ke=1.e6, - Tsf=386.16) - annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( - Xco2=0, - Xh2o=0.01, - Q0=27., - Xo2=0.233, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - T0=298.16, - option_temperature=true) - annotation (Placement(transformation(extent={{-102,-92},{-63,-55}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation( - extent={{-56,51},{-98,90}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - Q0=24., - h0=600e3, - P0=14000000) - annotation (Placement(transformation(extent={{105,-88},{69,-54}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation( - extent={{70,53},{106,89}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3) - annotation (Placement(transformation(extent={{60,-77},{52,-65}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3) - annotation (Placement(transformation(extent={{53,65},{61,77}}, rotation=0))); -equation - connect(singularPressureLoss1.C2, sink.C) - annotation (Line(points={{61,71},{70,71}}, color={0,0,255})); - connect(BoilerSystem.OutletWaterSteam, singularPressureLoss1.C1) annotation ( - Line(points={{38.5714,51},{38.5714,71},{53,71}}, color={0,0,0})); - connect(BoilerSystem.InletWaterSteam, singularPressureLoss.C2) annotation ( - Line(points={{38.5714,-51},{38.5714,-71},{52,-71}}, color={0,0,0})); - connect(singularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{60,-71}, - {66,-71},{66,-71},{69,-71}}, color={0,0,0})); - connect(sinkP.C, BoilerSystem.OutletFlueGases) annotation (Line(points={{-56, - 70.5},{-38.5714,70.5},{-38.5714,51}}, color={0,0,0})); - connect(sourceQ.C, BoilerSystem.InletFlueGases) annotation (Line(points={{-63, - -73.5},{-38.5714,-73.5},{-38.5714,-51}}, color={0,0,0})); - annotation ( Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestBoilerSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo deleted file mode 100644 index def6128b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo +++ /dev/null @@ -1,49 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestCHPEngineBarkantineSystem - - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{60,20},{80,40}}, rotation=0))); - Machines.CHPEngineBarkantineSystem CHPBarkantine annotation (Placement( - transformation(extent={{-40,0},{20,60}}, rotation=0))); -equation - connect(SourceP1.C, CHPBarkantine.inletWaterSteam) annotation (Line(points={{ - -80,30},{-50,30},{-50,45},{-40,45}}, color={0,0,0})); - connect(CHPBarkantine.outletWaterSteam, PuitsP1.C) - annotation (Line(points={{20,45},{30,45},{30,30},{60,30}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Window( - x=0.45, - y=0.01, - width=0.35, - height=0.49), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestCHPEngineBarkantineSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo deleted file mode 100644 index 7d3302cc..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo +++ /dev/null @@ -1,86 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestCentrifugalPump1 - - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( - mode_car=1, - mode_car_hn=1, - mode_car_Cr=1, - dynamic_mech_equation=false) - annotation (Placement(transformation(extent={{-20,20},{0, - 40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=0) - annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink - annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe( - Starttime=10, - Duration=100, - Initialvalue=1400, - Finalvalue=0) annotation (Placement(transformation(extent={{-100,-20},{-80, - 0}}, rotation=0))); - ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity - sourceAngularVelocity annotation (Placement(transformation(extent={{-60,-20}, - {-40,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ1( Q0=0) - annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation= - 0))); - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump1( - mode_car=1, - mode_car_hn=1, - mode_car_Cr=1) annotation (Placement(transformation(extent={{-20,-60},{0, - -40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink1 - annotation (Placement(transformation(extent={{40,-60},{60,-40}}, rotation=0))); -equation - connect(sourcePQ.C, centrifugalPump.C1) - annotation (Line(points={{-60,30},{-20,30}}, color={0,0,255})); - connect(centrifugalPump.C2, sink.C) - annotation (Line(points={{0,30},{40,30}}, color={0,0,255})); - connect(sourceAngularVelocity.M, centrifugalPump.M) - annotation (Line(points={{-39,-10},{-10,-10},{-10,19}})); - connect(sourcePQ1.C, centrifugalPump1.C1) - annotation (Line(points={{-60,-50},{-20,-50}}, color={0,0,255})); - connect(centrifugalPump1.C2, sink1.C) - annotation (Line(points={{0,-50},{40,-50}}, color={0,0,255})); - connect(rampe.y, sourceAngularVelocity.IAngularVelocity) - annotation (Line(points={{-79,-10},{-55,-10}})); - annotation (experiment(StopTime=1000), - Diagram(graphics={ - Text( - extent={{-100,100},{-60,80}}, - lineColor={0,0,255}, - textString= - "w=1 ==> w=0"), - Text( - extent={{-100,80},{-60,60}}, - lineColor={0,0,255}, - textString= - "q=0"), - Text( - extent={{-100,60},{-60,40}}, - lineColor={0,0,255}, - textString= - "theta=0 ==> theta=-180")}), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestCentrifugalPump1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo deleted file mode 100644 index f6c47b31..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo +++ /dev/null @@ -1,101 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestCheckValve - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation(extent= - {{-104,20},{-84,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP( - P0=6e5) annotation (Placement(transformation( - extent={{84,20},{104,40}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump1 - annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump2 - annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumeD annotation (Placement( - transformation(extent={{-50,20},{-30,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve1 - annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve2 - annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC annotation (Placement( - transformation(extent={{30,20},{50,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP - annotation (Placement(transformation( - extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 - annotation (Placement(transformation( - extent={{60,20},{80,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 - annotation (Placement(transformation( - extent={{-60,-80},{-40,-60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( - P0=6e5) annotation (Placement(transformation( - extent={{20,-80},{40,-60}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse( - amplitude=6e5, - width=50, - period=100, - offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80, - -60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3 - annotation (Placement(transformation(extent={{-20,-80},{0,-60}}, rotation=0))); -equation - connect(staticCentrifugalPump1.C2, checkValve1.C1) annotation (Line(points={{-10,70}, - {9,70}}, color={0,0,255})); - connect(staticCentrifugalPump2.C2, checkValve2.C1) annotation (Line(points={{ - -10,-10},{0,-10},{0,-10},{7,-10}}, color={0,0,255})); - connect(perteDP1.C2, puitsP.C) - annotation (Line(points={{80,30},{84,30}}, color={0,0,255})); - connect(sourceP.C, perteDP.C1) - annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255})); - connect(sourceP1.C, checkValve3.C1) - annotation (Line(points={{-40,-70},{-21,-70}}, color={0,0,255})); - connect(checkValve3.C2, puitsP1.C) - annotation (Line(points={{1,-70},{20,-70}}, color={0,0,255})); - connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55, - -70}})); - connect(volumeD.Cs1, staticCentrifugalPump1.C1) - annotation (Line(points={{-40,40},{-40,70},{-30,70}}, color={0,0,0})); - connect(volumeD.Cs2, staticCentrifugalPump2.C1) - annotation (Line(points={{-40,20},{-40,-10},{-30,-10}}, color={0,0,0})); - connect(checkValve1.C2, volumeC.Ce2) - annotation (Line(points={{31,70},{40,70},{40,40}}, color={0,0,0})); - connect(checkValve2.C2, volumeC.Ce3) - annotation (Line(points={{29,-10},{40,-10},{40,20}}, color={0,0,0})); - connect(volumeC.Cs, perteDP1.C1) - annotation (Line(points={{50,30},{60,30}}, color={0,0,0})); - connect(perteDP.C2, volumeD.Ce) - annotation (Line(points={{-60,30},{-50,30}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2})), - Window( - x=0.28, - y=0.03, - width=0.5, - height=0.6), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo deleted file mode 100644 index 3472fb86..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo +++ /dev/null @@ -1,66 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestCombustionTurbine - parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency"; - parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate"; - - ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine( - tau_n=0.065, - is_eff_n=is_eff_n1, - Qred=Qred1, - Pe(fixed=true, start=1500000), - Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{ - -42,-42},{36,42}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1( - Xso2=0, - Q0=430, - Xco2=0.06, - Xh2o=0.06, - Xo2=0.14, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - T0=1500, - option_temperature=true) - annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1e5) - annotation (Placement(transformation( - origin={94,0}, - extent={{10,-10},{-10,10}}, - rotation=180))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8) - annotation (Placement(transformation(extent={{-100,-42},{-80,-22}}, - rotation=0))); -equation - connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line( - points={{-86,0},{-42,0}}, - color={0,0,0}, - thickness=1)); - connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line( - points={{36,0},{84,0}}, - color={0,0,0}, - thickness=1)); - connect(Wc1.y, CombustionTurbine.CompressorPower) - annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}})); - annotation (Diagram(graphics), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestCombustionTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo deleted file mode 100644 index 79b7b6f8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo +++ /dev/null @@ -1,61 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestCompressor - parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency"; - - ThermoSysPro.Fluid.Machines.Compressor Compressor( - Ps(fixed=false), - tau_n=16, - is_eff_n=is_eff_n1, - Pe(fixed=false, start=100000), - Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{ - -52,-52},{48,52}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( - Xso2=0, - Xco2=0.0, - Xh2o=0.003, - Xo2=0.23, - Q0=420, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=100000, - T0=288, - option_temperature=true) - annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=15.8e5) - annotation (Placement(transformation( - origin={96,0}, - extent={{10,-10},{-10,10}}, - rotation=180))); -equation - connect(SourceQ1.C, Compressor.Ce) annotation (Line( - points={{-84,0},{-39.5,0}}, - color={0,0,0}, - thickness=1)); - connect(Compressor.Cs, SinkP1.C) annotation (Line( - points={{35.5,0},{86,0}}, - color={0,0,0}, - thickness=1)); - annotation (Diagram(graphics), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo deleted file mode 100644 index 94163735..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo +++ /dev/null @@ -1,50 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDiaphragm - - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{44,-10},{64,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0))); -equation - connect(Diaphragm.C2, PuitsP1.C) - annotation (Line(points={{10,0},{44,0}}, color={0,0,255})); - connect(SourceP1.C, Diaphragm.C1) - annotation (Line(points={{-44,0},{-10,0}}, color={0,0,255})); - annotation (experiment(StopTime=1000), - Window( - x=0.45, - y=0.01, - width=0.35, - height=0.49), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDiaphragm; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo deleted file mode 100644 index f7e59a50..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo +++ /dev/null @@ -1,140 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDiffusion_DynamicOnePhaseFlowPipe - - HeatExchangers.DynamicOnePhaseFlowPipe - dynamicOnePhaseFlowPipe(L=20, - Q(start={5.492026593727256E-28,5.492026607285849E-28,5.492026607285849E-28, - 5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28, - 5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28, - 5.492026607285849E-28,5.492026607285849E-28}), - h(start={84011.8111671368,96057.08454715868,107718.52365349933, - 119295.22918923412,130792.44987567255,142215.00322033433, - 153567.34130353143,164853.6027022597,176077.65400298327, - 187243.1234252416,198353.42841254506,209411.79856705698}), - continuous_flow_reversal=true, - inertia=false, - dynamic_mass_balance=false, - advection=true, - dynamic_energy_balance=false, - diffusion=true, - P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983, - 99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000, - 100000,100000,100000})) - annotation (Placement(transformation(extent={{-10,30}, - {10,50}}, rotation=0))); - BoundaryConditions.SourceP sourceP( - continuous_flow_reversal=true, - diffusion=true, - P0=100000, - T0=293.15) - annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0))); - - BoundaryConditions.SinkP sinkP(diffusion=true, - T0=323.15) - annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource( - option_temperature=2, - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - W0={0,0,0,0,0,0,0,0,0,0}) - annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0))); - PressureLosses.SwitchValve switchValve(Qmin=0) - annotation (Placement(transformation(extent={{-40,36},{-20,56}}))); - InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime=1) - annotation (Placement(transformation(extent={{-74,66},{-66,74}}))); - InstrumentationAndControl.Blocks.Logique.NONL nONL - annotation (Placement(transformation(extent={{-54,66},{-46,74}}))); - HeatExchangers.DynamicOnePhaseFlowPipe - dynamicOnePhaseFlowPipe1( - L=20, - Q(start={4.9243335191367076E-05,4.924351014778949E-05,4.924351014778949E-05, - 4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05, - 4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05, - 4.924351014778949E-05,4.924351014778949E-05}), - h(start={84011.8111671368,95792.53373784182,107482.21110144592, - 119086.65906940492,130611.17116650468,142060.60442474802, - 153439.44619534744,164751.8668430315,176001.7618457063, - 187192.78587129858,198328.3807233511,209411.79856705698}), - continuous_flow_reversal=true, - inertia=false, - dynamic_mass_balance=false, - advection=true, - dynamic_energy_balance=false, - diffusion=true, - P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983, - 99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000, - 100000,100000,100000})) - annotation (Placement(transformation(extent={{-10,-70}, - {10,-50}}, rotation=0))); - BoundaryConditions.SourceQ sourceP1( - continuous_flow_reversal=true, - diffusion=true, - Q0=0, - T0=293.15, - option_temperature=true) - annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, - rotation=0))); - BoundaryConditions.SinkP sinkP1( - diffusion=true, - T0=323.15) - annotation (Placement(transformation(extent={{30,-70},{50,-50}}, - rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource1( - option_temperature=2, - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - W0={0,0,0,0,0,0,0,0,0,0}) - annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, - rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1( - Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,-50},{10,-30}}, - rotation=0))); -equation - connect(dynamicOnePhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40}, - {30,40}}, color={0,0,255})); - connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2}, - {0,62}}, color={191,95,0})); - connect(sourceP.C, switchValve.C1) - annotation (Line(points={{-60,40},{-40,40}}, color={0,0,0})); - connect(switchValve.C2,dynamicOnePhaseFlowPipe. C1) - annotation (Line(points={{-20,40},{-10,40}}, color={0,0,0})); - connect(echelon.yL, nONL.uL) - annotation (Line(points={{-65.6,70},{-54.4,70}}, color={0,0,255})); - connect(nONL.yL, switchValve.Ouv) annotation (Line(points={{-45.6,70},{-30,70}, - {-30,53.2}}, color={0,0,255})); - connect(heatExchangerWall.WT1,dynamicOnePhaseFlowPipe. CTh) - annotation (Line(points={{0,58},{0,43}}, color={0,0,0})); - connect(dynamicOnePhaseFlowPipe1.C2, sinkP1.C) - annotation (Line(points={{10,-60},{30,-60}}, color={0,0,255})); - connect(heatSource1.C, heatExchangerWall1.WT2) - annotation (Line(points={{0,-29.8},{0,-38}}, color={191,95,0})); - connect(heatExchangerWall1.WT1,dynamicOnePhaseFlowPipe1. CTh) - annotation (Line(points={{0,-42},{0,-57}}, color={0,0,0})); - connect(sourceP1.C,dynamicOnePhaseFlowPipe1. C1) - annotation (Line(points={{-60,-60},{-10,-60}}, color={0,0,0})); - annotation (experiment(StopTime=10), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDiffusion_DynamicOnePhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo deleted file mode 100644 index 84f4f856..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo +++ /dev/null @@ -1,62 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDiffusion_DynamicPlateHeatExchanger - - ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger - echangeurAPlaques1D( - region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - steady_state=true, - Ns=10, - dynamic_energy_balance=false, - diffusion=true, - continuous_flow_reversal=true) - annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0))); - - BoundaryConditions.SourcePQ sourceP( - option_temperature=true, - diffusion=true, - Q0=0, - T0=340) - annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - BoundaryConditions.SourcePQ sourceP1 - annotation (Placement( - transformation(extent={{-60,20},{-40,40}}, rotation=0))); - BoundaryConditions.Sink puitsP(option_temperature=true, - diffusion=true) annotation (Placement(transformation( - extent={{40,40},{60,60}}, rotation=0))); - BoundaryConditions.Sink puitsP1(diffusion=true, h0=200000) - annotation (Placement(transformation( - extent={{20,20},{40,40}}, rotation=0))); -equation - connect(sourceP.C, echangeurAPlaques1D.Ec) - annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255})); - connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30}, - {-15,30},{-15,44}}, color={0,0,255})); - connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20, - 50},{20,50},{40,50}}, color={0,0,255})); - connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{ - -6,44},{-6,30},{20,30}}, color={0,0,255})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDiffusion_DynamicPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo deleted file mode 100644 index 6ca89991..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo +++ /dev/null @@ -1,187 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDiffusion_DynamicTwoPhaseFlowPipe - - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe - dynamicTwoPhaseFlowPipe(L=20, - Q(start={5.492026593727256E-28,5.492026607285849E-28,5.492026607285849E-28, - 5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28, - 5.492026607285849E-28,5.492026607285849E-28,5.492026607285849E-28, - 5.492026607285849E-28,5.492026607285849E-28}), - h(start={84011.8111671368,96057.08454715868,107718.52365349933, - 119295.22918923412,130792.44987567255,142215.00322033433, - 153567.34130353143,164853.6027022597,176077.65400298327, - 187243.1234252416,198353.42841254506,209411.79856705698}), - continuous_flow_reversal=true, - inertia=false, - dynamic_mass_balance=false, - advection=true, - dynamic_energy_balance=false, - cpl2(start={4183.826265167646,4182.239614474996,4181.0130500668565, - 4180.0726819587735,4179.380584625066,4178.908955510578, - 4178.63729871947,4178.550389628282,4178.636803895239, - 4178.887855575399,4179.29683238825}), - cpv2(start={2049.2168798430116,2046.3449415228738,2043.4582034172774, - 2040.5558258112756,2037.636860922887,2034.7002308786582, - 2031.744699351002,2028.7688344361377,2025.770959168656, - 2022.7490841743909,2019.518356822069}), - kl2(start={0.5995743350581909,0.5995743350579683,0.5995743350571023, - 0.5995743350562764,0.5995743350555206,0.5995743350548642, - 0.5995743350543319,0.5995743350539415,0.5995743350536991, - 0.599574335053346,0.5995743403506435}), - kv2(start={0.024965829345847085,0.024990303852044017,0.025018417766029456, - 0.02505065954620164,0.025087620205457677,0.025130023834108832, - 0.025178770324693366,0.02523499664554269,0.025300167212669696, - 0.02537621164077076,0.0254715737844706}), - diffusion=true, - pro2(T(start={294.61264959452353,297.4461204783121,300.22404336919567, - 302.982702661547,305.7232156830587,308.44660714369365, - 311.15382285197893,313.8457405734291,316.5231787363566, - 319.18690350188376,321.8376345796106}), d(start={997.892715521068, - 997.2253707910008,996.4959923473901,995.7017938222477, - 994.8471177790162,993.9357736693299,992.9711212203756, - 991.9561376232762,990.8934721677539,989.7854910510117, - 988.6343144234495})), - P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983,99999.999999985, - 99999.999999988,99999.99999999,99999.999999992,100000,100000,100000,100000})) - annotation (Placement(transformation(extent={{-10,30}, - {10,50}}, rotation=0))); - BoundaryConditions.SourceP sourceP( - continuous_flow_reversal=true, - diffusion=true, - P0=100000, - T0=293.15) - annotation (Placement(transformation(extent={{-80,30},{-60,50}}, rotation=0))); - - BoundaryConditions.SinkP sinkP(diffusion=true, - T0=323.15) - annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource( - option_temperature=2, - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - W0={0,0,0,0,0,0,0,0,0,0}) - annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0))); - PressureLosses.SwitchValve switchValve(Qmin=0) - annotation (Placement(transformation(extent={{-40,36},{-20,56}}))); - InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime=1) - annotation (Placement(transformation(extent={{-74,66},{-66,74}}))); - InstrumentationAndControl.Blocks.Logique.NONL nONL - annotation (Placement(transformation(extent={{-54,66},{-46,74}}))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe - dynamicTwoPhaseFlowPipe1( - L=20, - Q(start={4.9243335191367076E-05,4.924351014778949E-05,4.924351014778949E-05, - 4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05, - 4.924351014778949E-05,4.924351014778949E-05,4.924351014778949E-05, - 4.924351014778949E-05,4.924351014778949E-05}), - h(start={84011.8111671368,95792.53373784182,107482.21110144592, - 119086.65906940492,130611.17116650468,142060.60442474802, - 153439.44619534744,164751.8668430315,176001.7618457063, - 187192.78587129858,198328.3807233511,209411.79856705698}), - continuous_flow_reversal=true, - inertia=false, - dynamic_mass_balance=false, - advection=true, - cpl2(start={4183.8461052314415,4182.2694439224715,4181.033777873867, - 4180.086463719214,4179.389099400846,4178.913555072556, - 4178.639109839789,4178.550383980675,4178.6358456341095, - 4178.886733579299,4179.2962820044995}), - cpv2(start={2049.2168798430116,2046.3449415228738,2043.4582034172774, - 2040.5558258112756,2037.636860922887,2034.7002308786582, - 2031.744699351002,2028.7688344361377,2025.770959168656, - 2022.7490841743909,2019.518356822069}), - kl2(start={0.5995743350581909,0.5995743350579683,0.5995743350571023, - 0.5995743350562764,0.5995743350555206,0.5995743350548642, - 0.5995743350543319,0.5995743350539415,0.5995743350536991, - 0.599574335053346,0.5995743403506435}), - kv2(start={0.024965829345847085,0.024990303852044017,0.025018417766029456, - 0.02505065954620164,0.025087620205457677,0.025130023834108832, - 0.025178770324693366,0.02523499664554269,0.025300167212669696, - 0.02537621164077076,0.0254715737844706}), - diffusion=true, - pro2(T(start={294.58103295016184,297.3862511962513,300.1708576823335, - 302.9360907339107,305.6830771234792,308.4128498965468, - 311.12636229776916,313.82449878754863,316.50808386868016, - 319.1778892498971,321.83463973606456}), d(start={997.8997091804818, - 997.2402860410343,996.5106311231898,995.7157728656836, - 994.8600940026633,993.9474377103298,992.9811922410435, - 991.9643590731059,990.8996082946633,989.7893240021328, - 988.6356418174122})), - dynamic_energy_balance=false, - P(start={99999.999999976,99999.999999978,99999.999999981,99999.999999983, - 99999.999999985,99999.999999988,99999.99999999,99999.999999992,100000, - 100000,100000,100000})) - annotation (Placement(transformation(extent={{-10,-70}, - {10,-50}}, rotation=0))); - BoundaryConditions.SourceQ sourceP1( - continuous_flow_reversal=true, - diffusion=true, - Q0=0, - T0=293.15, - option_temperature=true) - annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, - rotation=0))); - BoundaryConditions.SinkP sinkP1( - diffusion=true, - T0=323.15) - annotation (Placement(transformation(extent={{30,-70},{50,-50}}, - rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource1( - option_temperature=2, - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - W0={0,0,0,0,0,0,0,0,0,0}) - annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, - rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1( - Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,-50},{10,-30}}, - rotation=0))); -equation - connect(dynamicTwoPhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40}, - {30,40}}, color={0,0,255})); - connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2}, - {0,62}}, color={191,95,0})); - connect(sourceP.C, switchValve.C1) - annotation (Line(points={{-60,40},{-40,40}}, color={0,0,0})); - connect(switchValve.C2, dynamicTwoPhaseFlowPipe.C1) - annotation (Line(points={{-20,40},{-10,40}}, color={0,0,0})); - connect(echelon.yL, nONL.uL) - annotation (Line(points={{-65.6,70},{-54.4,70}}, color={0,0,255})); - connect(nONL.yL, switchValve.Ouv) annotation (Line(points={{-45.6,70},{-30,70}, - {-30,53.2}}, color={0,0,255})); - connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) - annotation (Line(points={{0,58},{0,43}}, color={0,0,0})); - connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) - annotation (Line(points={{10,-60},{30,-60}}, color={0,0,255})); - connect(heatSource1.C, heatExchangerWall1.WT2) - annotation (Line(points={{0,-29.8},{0,-38}}, color={191,95,0})); - connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh) - annotation (Line(points={{0,-42},{0,-57}}, color={0,0,0})); - connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) - annotation (Line(points={{-60,-60},{-10,-60}}, color={0,0,0})); - annotation (experiment(StopTime=10), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDiffusion_DynamicTwoPhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo deleted file mode 100644 index a417bca8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo +++ /dev/null @@ -1,71 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDiffusion_VolumeA - - BoundaryConditions.SourcePQ sourcePQ1( - C(h_vol_2(start=63269.22110794237)), - Q(start=0), - continuous_flow_reversal=false, - Q0=0, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam, - option_temperature=true, - T0=293.15, - diffusion=true) - annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); - - BoundaryConditions.Sink sink1( - option_temperature=true, - T0=333.15, - diffusion=true) - annotation (Placement(transformation(extent={{80,-10},{100,10}}))); - PressureLosses.SwitchValve switchValve(Qmin=0) - annotation (Placement(transformation(extent={{-60,-4},{-40,16}}))); - InstrumentationAndControl.Blocks.Logique.Constante constante(K=true) - annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); - Volumes.VolumeA volumeA( - continuous_flow_reversal=false, - diffusion=true, - dynamic_energy_balance=false, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - - PressureLosses.SwitchValve switchValve1(Qmin=0, k=2000) - annotation (Placement(transformation(extent={{40,-4},{60,16}}))); - InstrumentationAndControl.Blocks.Logique.Constante constante1(K=true) - annotation (Placement(transformation(extent={{20,20},{40,40}}))); -equation - connect(constante.yL, switchValve.Ouv) - annotation (Line(points={{-59,30},{-50,30},{-50,13.2}}, color={0,0,255})); - connect(sourcePQ1.C, switchValve.C1) - annotation (Line(points={{-80,0},{-60,0}}, color={0,0,0})); - connect(volumeA.Cs1, switchValve1.C1) - annotation (Line(points={{10,0},{40,0}}, color={0,0,0})); - connect(switchValve1.C2,sink1. C) - annotation (Line(points={{60,0},{80,0}}, color={0,0,0})); - connect(constante1.yL, switchValve1.Ouv) - annotation (Line(points={{41,30},{50,30},{50,13.2}}, color={0,0,255})); - connect(switchValve.C2, volumeA.Ce1) - annotation (Line(points={{-40,0},{-10,0}}, color={0,0,0})); - annotation (Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - experiment(StopTime=12), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDiffusion_VolumeA; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo deleted file mode 100644 index 2a6c5e8b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo +++ /dev/null @@ -1,58 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicCheckValve - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 - annotation (Placement(transformation( - extent={{-38,-10},{-18,10}},rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( - P0=6e5) annotation (Placement(transformation( - extent={{42,-10},{62,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J=10) - annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0))); - InstrumentationAndControl.Blocks.Sources.Sinusoide pulse( - period=100, - amplitude=3e5, - offset=6e5) annotation (Placement(transformation(extent={{-78,-10},{-58,10}}, - rotation=0))); -equation - connect(sourceP1.C, checkValve.C1) - annotation (Line(points={{-18,0},{2,0}}, color={0,0,255})); - connect(checkValve.C2, puitsP1.C) annotation (Line(points={{22,0},{32,0},{42, - 0}}, color={0,0,255})); - connect(sourceP1.IPressure, pulse.y) - annotation (Line(points={{-33,0},{-57,0}}, color={28,108,200})); - annotation ( - Diagram(graphics, - coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2})), - Window( - x=0.28, - y=0.03, - width=0.5, - height=0.6), - experiment(StopTime=300), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo deleted file mode 100644 index 28f75489..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo +++ /dev/null @@ -1,119 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicCondenser - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start= - 355000.00000015664), Q(fixed = false), hn(fixed = false, start= - 71.08245675235786), p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"), - a1(start=-88.67, fixed=false), - C2(h(start=195297.69906611618), h_vol_1(start=195297.69906611618)), - Qv(start=0.009081311621074862), - h(start=193554.9971298399), - C1(P(start=10000.0))) annotation ( - Placement(visible = true, transformation(origin={-10,-60}, extent={{10,-10}, - {-10,10}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false), - xm(fixed=false, start=0.9856238368898451), - proe(x(start=1, fixed=true)), - Ce(h_vol_2(start=3128840.013040668), h(start=3128840.0130323363)), - pros(d(start=0.07018147245152216))) annotation ( - Placement(visible = true, transformation(origin={-10,60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser Condenseur( - dynamic_energy_balance=true, - Rv=20, - steady_state=false) annotation ( - Placement(visible = true, transformation(origin={40.5,-1}, extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation ( - Placement(visible = true, transformation(origin={91,-1}, extent = {{-11, -12}, {11, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( h0 = 113e3, - option_temperature=true, - Q0=100) annotation ( - Placement(visible = true, transformation(origin={-10,-1}, extent = {{-10, -9}, {10, 9}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeATh - volumeA( - P(start=70e5), - h(start=2.e6), - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-70,10},{-50,-10}}))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource - heatSource(W0(start={2e6}, each fixed=false), - option_temperature=2) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-88,12}))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table=[0, - 0.0001; 22,0.0001; 24,2.02; 25,100; 26,150; 28,300; 29.7,590; 30.2,600; - 30.5,590; 31,570; 35,250; 40,100; 45,15; 47,0.000001; 200,0.000001; - 1000,0.000001]) - annotation (Placement(transformation(extent={{-56,34},{-44,46}}, - rotation=0))); - BoundaryConditions.SourceQ Source_Vsup1( - h0=2759.6e3, Q0=1) - annotation ( Placement(transformation( - extent={{-40,10},{-20,30}}, rotation=0))); - PressureLosses.SingularPressureLoss - PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01)) - annotation (Placement(transformation(extent={{0,10},{ - 20,30}}, rotation=0))); -equation - connect(staticCentrifugalPump.C2,volumeA. Ce2) - annotation (Line(points={{-20,-60},{-60,-60},{-60,-10}}, color={28,108,200})); - connect(volumeA.Cs2,stodolaTurbine. Ce) - annotation (Line(points={{-60,10},{-60,60},{-20.1,60}}, color={28,108,200})); - connect(heatSource.C[1],volumeA. Cth) annotation (Line(points={{-78.2,12},{-64, - 12},{-64,0},{-60,0}}, color={0,0,0})); - connect(sourcePCaloporteur.C, Condenseur.Ce1) annotation (Line(points={{0,-1},{ - 2,-1},{2,-1.16},{20,-1.16}}, color={0,0,0})); - connect(Condenseur.Ce2, puitsPCaloporteur.C) annotation (Line(points={{60.795, - -1.16},{66.3975,-1.16},{66.3975,-1},{80,-1}}, color={0,0,0})); - connect(Condenseur.C2ex, staticCentrifugalPump.C1) - annotation (Line(points={{40.5,-17},{40.5,-60},{0,-60}}, color={0,0,0})); - connect(stodolaTurbine.Cs, Condenseur.C1vap) - annotation (Line(points={{0.1,60},{40.5,60},{40.5,15}}, color={0,0,0})); - connect(Vapeur_GCT1.y, Source_Vsup1.IMassFlow) - annotation (Line(points={{-43.4,40},{-30,40},{-30,25}}, color={0,0,255})); - connect(Source_Vsup1.C, PressureLoss_VapeurIn_in4.C1) - annotation (Line(points={{-20,20},{0,20}}, color={0,0,0})); - connect(PressureLoss_VapeurIn_in4.C2, Condenseur.C2vap) annotation (Line( - points={{20,20},{32.505,20},{32.505,13.72}}, color={0,0,0})); - annotation ( - Diagram(graphics={ - Text( - extent={{-94,34},{-64,24}}, - lineColor={28,108,200}, - textString="W: free"), - Text( - extent={{-26,-38},{8,-48}}, - lineColor={28,108,200}, - textString="a1: free"), - Text( - extent={{-28,94},{8,84}}, - lineColor={28,108,200}, - textString="Pe: fixed"), - Text( - extent={{-28,84},{10,72}}, - lineColor={28,108,200}, - textString="proe.x: fixed")}), - Documentation(info=" - -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - experiment(StopTime=10000)); -end TestDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo deleted file mode 100644 index 71794c51..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo +++ /dev/null @@ -1,183 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicDrum - parameter Units.SI.MassFlowRate Qin(fixed=false, start=80) "Mass flow rate"; - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670) - "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed=false,start=0.085) - "Friction pressure loss coefficient (active if lambda_fixed=true)"; - - Volumes.DynamicDrum Drum( - Vv(start=39), - Vertical=false, - hl(start=1454177.7248984643), - hv(start=2670002.8920646077), - xv(start=0.01), - rhol(start=670), - rhov(start=78), - zl(fixed=true, start=1.05), - wsftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam, - Cm(diff_res_1(start=8476939.240220599)), - steady_state=true, - dynamic_energy_balance=false, - P0=13000000, - diffusion=true, - P(start=13000000, fixed=true), - Pfond(start=13006991.905108), - Tp(start=590.93934457637)) - annotation (Placement(transformation(extent={{-61,18},{1, - 80}}, rotation=0))); - - PressureLosses.ControlValve feedwaterValve( - Cv(start=335), - C1( - h_vol_1(start=1400e3), - h(start=1400e3), - P(start=13300000), - Q(start=79.5)), - Q(start=79.5), - rho(start=888), - h(start=1400000), - Cvmax=CvmaxWater, - Pm(start=13100000)) - annotation (Placement(transformation(extent={{-120,76},{ - -100,96}}, rotation=0))); - PressureLosses.ControlValve steamValve( - Cvmax(fixed=true) = 50000, - Cv(start=25000), - Q(start=79.5), - rho(start=78.5), - h(start=2657930), - Pm(start=12998726.577779422)) - annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon(k(fixed=true) = 0.5) - annotation (Placement(transformation(extent={{-160,122},{-140,142}}, - rotation=0))); - HeatExchangers.DynamicTwoPhaseFlowPipe - TubeEcranBoucleEvaporatoire( - T0=fill(400, 10), - heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}), - advection=false, - z2=10, - simplified_dynamic_energy_balance=false, - D=0.03, - ntubes=1400, - h(start={1454177.75,1531100.8018215413,1608023.8787446183,1684946.955667695, - 1761870.032590772,1838793.109513849,1915716.186436926, - 1992639.2633600028,2069562.3402830793,2146485.4172061565, - 2223408.4941292335,1454177.75}), - L=20, - Q(start=fill(130, 11)), - dynamic_mass_balance=false, - inertia=false, - dynamic_energy_balance=false, - diffusion=true, - P(start={13032002.884172,13025908.565037,13020089.245351,13015847.070697, - 13012648.443752,13010064.118918,13007881.468256,13005979.718403, - 13004283.685995,13002743.397189,13001323.948575,13000000})) - annotation (Placement(transformation( - origin={6,-26}, - extent={{-10,10},{10,-10}}, - rotation=90))); - Thermal.BoundaryConditions.HeatSource - SourceC3( - option_temperature=2, - W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7}, - T0={290,290,290,290,290,290,290,290,290,290}) - annotation (Placement(transformation( - origin={36,-26}, - extent={{-10,-10},{10,10}}, - rotation=270))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20, - D=0.03, - ntubes=1400, - dynamic_energy_balance=false) - annotation (Placement(transformation( - origin={18,-26}, - extent={{-10,-10},{10,10}}, - rotation=90))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe( - L=20, - z1=20, - Q(fixed=true, start=130), - lambda=LambdaPipe) - annotation (Placement(transformation( - origin={-66,-26}, - extent={{10,-10},{-10,10}}, - rotation=90))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon1(k(fixed=true) = 0.5) - annotation (Placement(transformation(extent={{0,122},{20,142}}, rotation=0))); - BoundaryConditions.SourceP sourceP(h0=1400000, - P0(fixed=true) = 13200000, - option_temperature=false) - annotation (Placement(transformation(extent={{-200,70},{-180,90}}, - rotation=0))); - BoundaryConditions.SinkQ sinkQ(Q0=75) - annotation (Placement(transformation(extent={{120,70},{140,90}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - SteamMassFlowRate(k=Qin) - annotation (Placement(transformation(extent={{100,122},{120,142}}, rotation= - 0))); -equation - connect(Drum.Cv,steamValve. C1) - annotation (Line(points={{1,80},{40,80}}, color={0,0,255})); - connect(feedwaterValve.C2, Drum.Ce1) - annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255})); - connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{ - -66,18},{-66,-16}}, color={0,0,255})); - connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26}, - {26.2,-26}}, color={191,95,0})); - connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2) - annotation (Line(points={{1,18},{6,18},{6,-16}})); - connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line( - points={{9,-26},{16,-26}}, color={191,95,0})); - connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv) - annotation (Line(points={{-139,132},{-110,132},{-110,97}}, smooth=Smooth.None)); - connect(sourceP.C,feedwaterValve. C1) annotation (Line( - points={{-180,80},{-120,80}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(steamValve.C2, sinkQ.C) annotation (Line( - points={{60,80},{120,80}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2) - annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}})); - connect(ConsigneNiveauBallon1.y,steamValve. Ouv) - annotation (Line(points={{21,132},{50,132},{50,97}}, smooth=Smooth.None)); - connect(SteamMassFlowRate.y, sinkQ.IMassFlow) - annotation (Line(points={{121,132},{130,132},{130,85}})); - annotation (experiment(StopTime=1000), - Window( - x=0.43, - y=0, - width=0.57, - height=0.63), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-100},{140,200}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicDrum; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo deleted file mode 100644 index 72c9c76b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo +++ /dev/null @@ -1,190 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicDrum_CC - import ThermoSysPro; - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670) - "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed=false,start=0.085) - "Friction pressure loss coefficient (active if lambda_fixed=true)"; - - ThermoSysPro.Fluid.Volumes.DynamicDrum Drum( - Vv(start=39), - Vertical=false, - hl(start=1454400), - hv(start=2.658e6), - xv(start=0.01), - rhol(start=670), - rhov(start=78), - zl(fixed=true, start=1.05), - wsftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam, - P0=13000000, - P(start=13000000, fixed=false), - Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,18},{1, - 80}}, rotation=0))); - - ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve( - Cv(start=335), - Q(start=79.5), - rho(start=888), - h(start=1400000), - C1( - h_vol_1(start=1400e3), - h(start=1400e3), - Q(start=79.5), - P(start=13300000)), - Cvmax=CvmaxWater, - Pm(start=13100000)) - annotation (Placement(transformation(extent={{-120,76},{ - -100,96}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( - Cv(start=25000), - Q(start=79.5), - rho(start=78.5), - h(start=2657930), - Cvmax=10000, - Pm(start=12900000)) - annotation (Placement(transformation(extent={{40,76},{60,96}}, rotation=0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe - TubeEcranBoucleEvaporatoire( - T0=fill(400, 10), - heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}), - advection=false, - z2=10, - simplified_dynamic_energy_balance=false, - P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000, - 13002000,13001000,13000000,12999990}), - D=0.03, - ntubes=1400, - h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3, - 1900e3,1950e3}), - L=20, - Q(start=fill(130, 11))) - annotation (Placement(transformation( - origin={6,-26}, - extent={{-10,10},{10,-10}}, - rotation=90))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3( - option_temperature=2, - W0={1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7,1e7}, - T0={290,290,290,290,290,290,290,290,290,290}) - annotation (Placement(transformation( - origin={36,-26}, - extent={{-10,-10},{10,10}}, - rotation=270))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, L=20, - D=0.03, - ntubes=1400) - annotation (Placement(transformation( - origin={18,-26}, - extent={{-10,-10},{10,10}}, - rotation=90))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( - L=20, - z1=20, - C1(P(start=130e5)), - Q(fixed=true, start=130), - lambda=LambdaPipe) - annotation (Placement(transformation( - origin={-66,-26}, - extent={{10,-10},{-10,10}}, - rotation=90))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceQ(h0=1400000, - option_temperature=false, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam, - P0=13300000) - annotation (Placement(transformation(extent={{-196,70},{-176,90}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( - option_temperature=false, - h0=2.650e6, - P0=12700000) - annotation (Placement(transformation(extent={{115,70},{135,90}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k=0.5) - annotation (Placement(transformation(extent={{20,102},{40,121}}, rotation=0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table=[0, - 128e5; 100,128e5; 110,124e5; 200,124e5; 400,128e5; 2000,128e5; 2010, - 131e5; 2090,131e5; 2300,128e5; 3000,128e5]) - annotation (Placement(transformation(extent={{96,99},{120,123}}, rotation= - 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau( - add(k1=-1, k2=+1), - Ti=50, - pIsat( - ureset0=0.5, - Limiteur1(u(signal(start=0.5))), - Ti=2000)) annotation (Placement(transformation(extent={{-56,106},{-84,132}}, - rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante Level(k=1.05) annotation ( - Placement(transformation(extent={{-21,102},{-40,121}}, rotation=0))); -equation - connect(Drum.Cv, SteamValve.C1) - annotation (Line(points={{1,80},{40,80}}, color={0,0,255})); - connect(FeedwaterValve.C2, Drum.Ce1) - annotation (Line(points={{-100,80},{-61,80}}, color={0,0,255})); - connect(Drum.Cd, lumpedStraightPipe.C1) annotation (Line(points={{-61,18},{ - -66,18},{-66,-16}}, color={0,0,255})); - connect(heatExchangerWall.WT1, SourceC3.C) annotation (Line(points={{20,-26}, - {26.2,-26}}, color={191,95,0})); - connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2) - annotation (Line(points={{1,18},{6,18},{6,-16}})); - connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation (Line( - points={{9,-26},{16,-26}}, color={191,95,0})); - connect(sourceQ.C, FeedwaterValve.C1) annotation (Line( - points={{-176,80},{-120,80}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(SteamValve.C2,sinkP. C) annotation (Line( - points={{60,80},{115,80}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2) - annotation (Line(points={{6,-36},{6,-68},{-66,-68},{-66,-36}})); - connect(SteamValve_O.y, SteamValve.Ouv) - annotation (Line(points={{41,111.5},{50,111.5},{50,97}}, color={0,0,255})); - connect(Steam_Pressure.y, sinkP.IPressure) annotation (Line(points={{121.2, - 111},{130,111},{130,80}}, color={0,0,255})); - connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line( - points={{-40.95,111.5},{-44,111.5},{-44,111.2},{-55.3,111.2}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - - connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line( - points={{4.1,49},{10,49},{10,130.7},{-55.3,130.7}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation (Line( - points={{-84.7,107.3},{-110,107.3},{-110,97}}, color={0,0,255})); - annotation (experiment(StopTime=3000), - Window( - x=0.43, - y=0, - width=0.57, - height=0.63), - Diagram(graphics, - coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-100},{140,200}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicDrum_CC; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo deleted file mode 100644 index 3bc15a51..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo +++ /dev/null @@ -1,89 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicFlueGasesMultiFluidHeatExchanger - - BoundaryConditions.SourceP sourceP(C(h_vol_2(start= - 71016.12237181065)), - option_temperature=true, - P0=10000000, - Q(start=190407.49090838886)) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - BoundaryConditions.SinkP sinkP(C(h_vol_1(start= - 71016.1223718086))) - annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); - HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger( - steady_state=true, - Cfg1(h_vol_2(start=1999458.3239137873)), - Cfg2(h_vol_1(start=1997835.1051783948)), - ExchangerFlueGasesMetal( - P(start={5000000.0,5000000.0,5000000.0,5000000.0,5000000.0,5000000.0}), - Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343, - 2702.7912398488343,2702.7912398488343}), - Tp(start={293.20684981473266,293.655268073503,294.1038710234491, - 294.55265602776745}), - h(start={2000000.0,1999458.375,1998916.9494222174,1998375.8765143699, - 1997835.125,100000.0}), - rho2(start={9.227614370571606,9.229671002969678,9.231727464730685, - 9.23378375498367,9.235839872860517})), - TwoPhaseFlowPipe( - P(start={10000000.0,8023904.042494878,6045867.025005122, - 4065878.0712931687,2083926.1359166082,100000.0}), - Q(start={3482.228448926616,3482.228448926616,3482.228448926616, - 3482.228448926616,3482.228448926616}), - h(start={80196.484375,80197.90894929563,80199.3305700632, - 80200.75139888813,80202.17143579095,70825.8984375})), - ExchangerWall(Tp(start={291.91912560937857,292.368260847782, - 292.81758075140095,293.26708268122}), Tp1(start={ - 290.60590026437563,291.055766680952,291.5058177362657, - 291.9560507892685})), - Ns=4, - inertia=false, - Ntubes=100, - diffusion=true, - dynamic_energy_balance=true) - annotation (Placement(transformation(extent={{-20,20},{0,40}}))); - BoundaryConditions.SourcePQ sourceP1( - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - h0=2e6, - P0=5000000, - Q0=500, - T0=1273.15) - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90, - origin={-10,70}))); - - BoundaryConditions.Sink sinkP1 - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=90, - origin={-10,-10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1) - annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C) - annotation (Line(points={{0,30},{20,30}}, color={0,0,0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1) - annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C) - annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicFlueGasesMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo deleted file mode 100644 index b4a5492d..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo +++ /dev/null @@ -1,85 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicMultiFluidHeatExchanger - - BoundaryConditions.SourceQ sourceP(C(h_vol_2(start= - 71016.12237181065)), - Q0=10, - option_temperature=true) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start= - 71016.1223718086))) - annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); - HeatExchangers.DynamicMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger( - steady_state=true, - diffusion=true, - dynamic_energy_balance=false, - Cfg1(h_vol_2(start=71016.12237181155)), - Cfg2(h_vol_1(start=71016.12237181314)), - DynamicOnePhaseFlowPipe_1( - P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701, - 140001.5973181204,100000.0}), - Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343, - 2702.7912398488343,2702.7912398488343}), - h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125, - 70825.8984375})), - DynamicOnePhaseFlowPipe_2( - P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214, - 140001.59819646296,100000.0}), - Q(start={3482.228448926616,3482.228448926616,3482.228448926616, - 3482.228448926616,3482.228448926616}), - Tp(start={290.0310327031831,290.04018142634584,290.0493302229013, - 290.05847909283045}), - h(start={71016.125,71016.125,71016.12237181216,71016.12237181274, - 71016.125,70825.8984375})), - ExchangerWall(Tp(start={290.03103270324897,290.0401814264445, - 290.0493302229999,290.05847909289605}), Tp1(start={ - 290.03103270331616,290.04018142654525,290.0493302231005, - 290.0584790929629})), - Ntubes=10, - Ns=4, - inertia=false) - annotation (Placement(transformation(extent={{-20,20},{0,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=5000000, - T0=1273.15) - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90, - origin={-10,70}))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=90, - origin={-10,-10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1) - annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C) - annotation (Line(points={{0,30},{20,30}}, color={0,0,0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1) - annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C) - annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo deleted file mode 100644 index 36781c7f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo +++ /dev/null @@ -1,87 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicMultiFluidHeatExchangerShell - - BoundaryConditions.SourceQ sourceP(C(h_vol_2(start= - 71016.12237181065)), - Q0=10, - option_temperature=true) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start= - 71016.1223718086))) - annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); - HeatExchangers.DynamicMultiFluidHeatExchangerShell dynamicMultiFluidHeatExchangerShell( - Cfg1(h_vol_2(start=71016.12237181155)), - Cfg2(h_vol_1(start=71016.12237181314)), - DynamicOnePhaseFlowPipe( - P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701, - 140001.5973181204,100000.0}), - Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343, - 2702.7912398488343,2702.7912398488343}), - h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125, - 70825.8984375})), - dynamicOnePhaseFlowShell( - P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214, - 140001.59819646296,100000.0}), - Q(start={3482.228448926616,3482.228448926616,3482.228448926616, - 3482.228448926616,3482.228448926616}), - Tp(start={290.0310327031831,290.04018142634584,290.0493302229013, - 290.05847909283045}), - h(start={71016.125,71016.125,71016.12237181216,71016.12237181274, - 71016.125,70825.8984375})), - ExchangerWall(Tp(start={290.03103270324897,290.0401814264445, - 290.0493302229999,290.05847909289605}), Tp1(start={ - 290.03103270331616,290.04018142654525,290.0493302231005, - 290.0584790929629})), - Ntubes=10, - Ns=4, - region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - Dext=0.01, - inertia=false, - dynamic_energy_balance=false, - diffusion=true) - annotation (Placement(transformation(extent={{-20,20},{0,40}}))); - - BoundaryConditions.SourceP sourceP1( - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=5000000, - T0=1273.15) - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90, - origin={-10,70}))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=90, - origin={-10,-10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchangerShell.Cws1) - annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchangerShell.Cws2, sinkP.C) - annotation (Line(points={{0,30},{20,30}}, color={0,0,0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchangerShell.Cfg1) - annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchangerShell.Cfg2, sinkP1.C) - annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicMultiFluidHeatExchangerShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo deleted file mode 100644 index 73556af2..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo +++ /dev/null @@ -1,62 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicOnePhaseFlowPipe - - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe - dynamicOnePhaseFlowPipe( - Q(start={536.5750641592207,536.5750641592207,536.5750641592207, - 536.5750641592207,536.5750641592207,536.5750641592207, - 536.5750641592207,536.5750641592207,536.5750641592207, - 536.5750641592207,536.5750641592207}), - h(start={71016.12237181116,74743.46665892199,78470.81094603281, - 82198.15523314364,85925.49952025448,89652.84380736532, - 93380.18809447614,97107.53238158698,100834.8766686978, - 104562.22095580865,108289.56524291947,70825.9016030344}), - P(start={300000,281833.41863537,263664.30473175,245492.47958308, - 227317.76827098,209139.99948382,190959.00534677,172774.621262, - 154586.68575823,136395.04034906,118199.5293995,100000})) - annotation (Placement(transformation(extent={{-20, - 20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP - annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - option_temperature=2, - W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) - annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) - annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0))); -equation - connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40, - 30},{-20,30}}, color={0,0,255})); - connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30}, - {20,30}}, color={0,0,255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10, - 60.2},{-10,52}}, color={191,95,0})); - connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) - annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0})); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicOnePhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo deleted file mode 100644 index b34b26b2..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo +++ /dev/null @@ -1,80 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicOnePhaseFlowShell - - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell - dynamicOnePhaseFlowPipeShell( - Q(start={30,30,30,30,30,30,30,30,30,30,30}), - Ds=1, - ntubes=520, - L=12, - P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000, - 1973000,1965000,1955000,1950000})) annotation (Placement( - transformation(extent={{-48,-36},{48,36}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false, P0(fixed= - false) = 1900000) - annotation (Placement(transformation(extent={{74,-15},{102,15}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - h0=600e3, - P0=2000000, - Q(start=500, fixed=true)) - annotation (Placement(transformation(extent={{-103,-15},{-75,15}}, - rotation=0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( - lambda=10, - Ns=10, - cpw=460, - rhow=7900, - D=0.017, - e=0.002, - ntubes=520, - L=12) annotation (Placement(transformation(extent={{-54,30},{54,58}}, - rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - option_temperature=2, - W0={-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6,-2e6}, - T0={300,300,300,300,300,300,300,300,300,300}) - annotation (Placement(transformation(extent={{-12,76},{12,98}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe( - Initialvalue=20e5, - Starttime=300, - Duration=600, - Finalvalue=19.8e5) - annotation (Placement(transformation(extent={{-100,32},{ - -80,52}}, rotation=0))); -equation - connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1) - annotation (Line(points={{-75,0},{-48,0}}, color={0,0,255})); - connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C) - annotation (Line(points={{48,0},{74,0}}, color={0,0,255})); - connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh) - annotation (Line(points={{0,41.2},{0,10.8}}, color={191,95,0})); - connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0, - 76.22},{0,46.8}}, color={191,95,0})); - connect(rampe.y, sourceP.IPressure) - annotation (Line(points={{-79,42},{-70,42},{-70,24},{-98,24},{-98,0},{-96,0}})); - annotation (Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicOnePhaseFlowShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo deleted file mode 100644 index 42f8e5ea..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo +++ /dev/null @@ -1,89 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicPlateHeatExchanger - - ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger - echangeurAPlaques1D( - region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - steady_state=true, - Ns=10, - dynamic_energy_balance=false, - diffusion=true, - continuous_flow_reversal=true) - annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0))); - - BoundaryConditions.SourcePQ sourceP( - option_temperature=true, - diffusion=true, - T0=340) - annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - BoundaryConditions.SourcePQ sourceP1 - annotation (Placement( - transformation(extent={{-60,20},{-40,40}}, rotation=0))); - BoundaryConditions.Sink puitsP(option_temperature=true, - diffusion=true) annotation (Placement(transformation( - extent={{40,40},{60,60}}, rotation=0))); - BoundaryConditions.Sink puitsP1 - annotation (Placement(transformation( - extent={{20,20},{40,40}}, rotation=0))); - HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c= - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) - annotation (Placement(transformation(extent={{-20,-40},{0,-20}}, rotation=0))); - BoundaryConditions.SourcePQ sourceP2(T0=340, - option_temperature=true) - annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}, - rotation=0))); - BoundaryConditions.SourcePQ sourceP3 - annotation (Placement( - transformation(extent={{-60,-60},{-40,-40}}, - rotation=0))); - BoundaryConditions.Sink puitsP2 - annotation (Placement(transformation( - extent={{40,-40},{60,-20}}, - rotation=0))); - BoundaryConditions.Sink puitsP3 - annotation (Placement(transformation( - extent={{20,-60},{40,-40}}, - rotation=0))); -equation - connect(sourceP.C, echangeurAPlaques1D.Ec) - annotation (Line(points={{-60,50},{-20,50}}, color={0,0,255})); - connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation (Line(points={{-40,30}, - {-15,30},{-15,44}}, color={0,0,255})); - connect(echangeurAPlaques1D.Sc, puitsP.C) annotation (Line(points={{0,50},{20, - 50},{20,50},{40,50}}, color={0,0,255})); - connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation (Line(points={{-5,44},{ - -6,44},{-6,30},{20,30}}, color={0,0,255})); - connect(sourceP2.C, echangeurAPlaques.Ec) - annotation (Line(points={{-60,-30},{-20,-30}}, color={0,0,255})); - connect(sourceP3.C, echangeurAPlaques.Ef) - annotation (Line(points={{-40,-50},{-15,-50},{-15,-36}}, color={0,0,255})); - connect(echangeurAPlaques.Sc, puitsP2.C) annotation (Line(points={{0,-29.8},{20, - -29.8},{20,-30},{40,-30}}, color={0,0,255})); - connect(echangeurAPlaques.Sf, puitsP3.C) annotation (Line(points={{-5,-36},{-6, - -36},{-6,-50},{20,-50}}, color={0,0,255})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo deleted file mode 100644 index a650c999..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo +++ /dev/null @@ -1,103 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicReliefValve - import ThermoSysPro; - parameter ThermoSysPro.Units.SI.AbsolutePressure Pinitial=18e5 - "Initial pressure"; - parameter ThermoSysPro.Units.SI.AbsolutePressure Pfinal=Pinitial - "Final pressure"; - parameter ThermoSysPro.Units.SI.AbsolutePressure Pmax=21e5 "Maximum pressure"; - - ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve reliefValve( - mech_steady_state=false, - caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351; - 0.7,8625; 0.8,8818; 0.9,8958; 1,9063], - Cvmax=9063, - Q(start=0), - Pm(start=Pinitial), - Pout=sinkP.P0, - mode_caract=2, - A2=1.1*reliefValve.A1, - A1=1.3*Modelica.Constants.pi*pipe.D^2/4, - m=50, - Cd=0.44, - Popen=2000000, - z_max=0.05) - annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe( - Q(start=0), - Pm(start=Pinitial), - L=2, - D=0.2) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP - annotation (Placement(transformation(extent={{80,0},{ - 100,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); - InstrumentationAndControl.Blocks.Sources.Rampe ramp1( - Duration=200, - Finalvalue=Pmax, - Initialvalue=Pinitial) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - InstrumentationAndControl.Blocks.Sources.Rampe ramp2( - Duration=200, - Starttime=300, - Finalvalue=Pmax - Pfinal) - annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); - InstrumentationAndControl.Blocks.Math.Add add(k2=-1) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}))); - ThermoSysPro.Fluid.PressureLosses.Bend bend(R0=0.2, D=pipe.D) - annotation (Placement(transformation(extent={{0,-20},{20,-40}}))); - ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(Ouv=1, D=0.5) - annotation (Placement(transformation(extent={{40,0},{60,20}}))); -equation - connect(sourceP.C, pipe.C1) - annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255})); - connect(ramp1.y, add.u1) annotation (Line(points={{-79,50},{-70,50},{-70,36},{ - -61,36}}, color={0,0,255})); - connect(ramp2.y, add.u2) annotation (Line(points={{-79,10},{-70,10},{-70,24},{ - -61,24}}, color={0,0,255})); - connect(add.y, sourceP.IPressure) annotation (Line(points={{-39,30},{-20,30},{ - -20,-10},{-90,-10},{-90,-30},{-75,-30}}, - color={0,0,255})); - connect(pipe.C2, bend.C1) - annotation (Line(points={{-20,-30},{0,-30}}, color={0,0,255})); - connect(bend.C2,reliefValve. C1) - annotation (Line(points={{10,-20},{10,0.2}},color={0,0,255})); - connect(reliefValve.C2, diaphragm.C1) - annotation (Line(points={{20,10},{40,10}}, color={0,0,255})); - connect(diaphragm.C2,sinkP. C) - annotation (Line(points={{60,10},{80,10}}, color={0,0,255})); - annotation ( - Diagram(coordinateSystem( - preserveAspectRatio=false, initialScale=0.1)), - Window( - x=0.1, - y=0.08, - width=0.5, - height=0.6), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}, - coordinateSystem(preserveAspectRatio=false, initialScale=0.1)), - experiment(StopTime=600, Interval=1), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicReliefValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo deleted file mode 100644 index e5e3e0e4..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo +++ /dev/null @@ -1,120 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicTwoPhaseFlowPipe - - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe - dynamicTwoPhaseFlowPipe(L=20, advection=false, - Q(start={378.2555714391421,378.2555714391421,378.2555714391421, - 378.2555714391421,378.2555714391421,378.2555714391421, - 378.2555714391421,378.2555714391421,378.2555714391421, - 378.2555714391421,378.2555714391421}), - h(start={71016.12237181116,89522.1287033792,108028.13503495205, - 126534.14136650086,145040.14769798872,163546.15402957145, - 182052.16036112772,200558.16669267463,219064.17302421754, - 237570.17935577242,256076.18568728055,70825.9016030344}), - dynamic_energy_balance=false, - diffusion=true, - P(start={300000,281934.94102069,263857.29519348,245762.87920492, - 227647.89301968,209508.84324089,191342.485106,173145.77779074, - 154915.84935981,136649.96881108,118345.52340716,100000})) - annotation (Placement(transformation(extent={{-10,30}, - {10,50}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation(extent={{-50,30},{-30,50}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP - annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource( - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - option_temperature=2, - W0={7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6,7e6}) - annotation (Placement(transformation(extent={{-10,70},{10,90}},rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,50},{10,70}},rotation=0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1( - L=10, - D=0.03, - dpfCorr(fixed=false, - start=0.23963336533422905)= - 1, - inertia=true, - P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919, - 1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109, - 1995640.0182728,1994163.0145856,1992283.4952231,1990000})) - annotation (Placement(transformation(extent={{-40,-90}, - {40,-32}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - C(Q(fixed=true, start=1)), - option_temperature=false, - h0=800e3, - P0=2000000) - annotation (Placement(transformation(extent={{-90,-70},{-70,-50}},rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( - option_temperature=false, - h0=2000e3, - P0=1990000) - annotation (Placement(transformation(extent={{70,-70},{90,-50}},rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource1( - option_temperature=2, - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4}) - annotation (Placement(transformation(extent={{-10,-11},{10,9}}, rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1( Ns=10, - L=10, - lambda=10, - cpw=460, - rhow=7900, - e=0.005, - D=0.03) - annotation (Placement(transformation(extent={{-40,-70},{40,10}},rotation=0))); - InstrumentationAndControl.Blocks.Sources.Rampe rampe( - Initialvalue=20e5, - Starttime=300, - Duration=600, - Finalvalue=19.8e5) - annotation (Placement(transformation(extent={{-74,-46},{-86, - -35}}, - rotation=0))); -equation - connect(sourceP.C,dynamicTwoPhaseFlowPipe. C1) annotation (Line(points={{-30,40}, - {-10,40}}, color={0,0,255})); - connect(dynamicTwoPhaseFlowPipe.C2,sinkP. C) annotation (Line(points={{10,40}, - {30,40}}, color={0,0,255})); - connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,70.2}, - {0,62}}, color={191,95,0})); - connect(heatExchangerWall.WT1,dynamicTwoPhaseFlowPipe. CTh) - annotation (Line(points={{0,58},{0,43}}, color={191,95,0})); - connect(sourceP1.C,dynamicTwoPhaseFlowPipe1. C1) annotation (Line(points={{-70,-60}, - {-42,-60},{-42,-61},{-40,-61}}, color={0, - 0,255})); - connect(dynamicTwoPhaseFlowPipe1.C2,sinkP1. C) annotation (Line(points={{40,-61}, - {40,-60},{70,-60}}, color={0,0,255})); - connect(heatSource1.C,heatExchangerWall1. WT2) - annotation (Line(points={{0,-10.8},{0,-22}}, color={191,95,0})); - connect(heatExchangerWall1.WT1,dynamicTwoPhaseFlowPipe1. CTh) - annotation (Line(points={{0,-38},{0,-52.3}}, color={191,95,0})); - connect(rampe.y,sourceP1. IPressure) - annotation (Line(points={{-86.6,-40.5},{-92,-40.5},{-92,-60},{-85,-60}})); - annotation (experiment(StopTime=1000), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicTwoPhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo deleted file mode 100644 index 236edda9..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo +++ /dev/null @@ -1,79 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicTwoPhaseFlowRiser - - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser( - L=20, - inertia=false, - advection=false, - dynamic_energy_balance=true, - Q(start={0.7975821689256883,0.7975821689256898,0.7975821689256883, - 0.7975821689256885,0.7975821689256883,0.797582168925689, - 0.7975821689256886,0.7975821689256887,0.7975821689256888, - 0.7975821689256888,0.7975821689256886}), - h(start={71016.12237181116,196401.3226637204,196412.6067675415, - 196423.89087136256,196435.17497518365,196446.45907900474, - 196457.7431828258,196469.0272866469,196480.31139046798, - 196491.59549428907,196502.87959811013,70825.9016030344}), - diffusion=true, - P(start={300000,281879.25838975,263692.15565175,245504.87004838, - 227317.40156239,209129.75017657,190941.91587368,172753.89863649, - 154565.69844777,136377.31529027,118188.74914676,100000})) annotation ( - Placement(transformation(extent={{-10,30},{10,48}}, rotation=0))); - BoundaryConditions.SourceP sourcePQ(ftype= - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteamSimple) - annotation (Placement(transformation(extent={{-50,30},{-30,50}}, rotation=0))); - BoundaryConditions.SinkP sinkP - annotation (Placement(transformation(extent={{30,30},{50,50}}, rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource( - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - option_temperature=2, - W0={0,0,0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}) - annotation (Placement(transformation(extent={{-10,80},{10,100}}, - rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,60},{10,80}},rotation=0))); - Thermal.BoundaryConditions.HeatSource heatSource1( - T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, - option_temperature=2, - W0={0,0,0,0,0,0,0,0,0,0}) - annotation (Placement(transformation(extent={{-10,0},{10,-20}},rotation=0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,20},{10,0}}, rotation=0))); -equation - connect(sourcePQ.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-30, - 40},{-20,40},{-20,39.9},{-10,39.9}}, color={0,0,255})); - connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{10, - 39.9},{20,39.9},{20,40},{30,40}}, color={0,0,255})); - connect(heatSource.C,heatExchangerWall. WT2) annotation (Line(points={{0,80.2}, - {0,72}}, color={191,95,0})); - connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowRiser.CTh1) - annotation (Line(points={{0,68},{0,45.3}}, color={0,0,0})); - connect(dynamicTwoPhaseFlowRiser.CTh2, heatExchangerWall1.WT1) - annotation (Line(points={{0,34.5},{0,12}}, color={0,0,0})); - connect(heatExchangerWall1.WT2, heatSource1.C) - annotation (Line(points={{0,8},{0,-0.2}}, color={0,0,0})); - annotation (experiment(StopTime=1000), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicTwoPhaseFlowRiser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo deleted file mode 100644 index a185b333..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo +++ /dev/null @@ -1,306 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicWaterHeating - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297) - "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed=false,start=0.003003) - "Friction pressure loss coefficient (active if lambda_fixed=true)"; - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - h0=2750.e3, - P0=40e5) - annotation (Placement(transformation(extent={{-192,110},{-150,150}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( - option_temperature=false, P0(fixed=true) = 10e5) - annotation (Placement(transformation(extent={{124,-202},{160,-162}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( - mode_caract=0, - Cvmax=CvmaxWater, - Q(fixed=false, start=38.0656), - Pm(start=24.771e5), - h(start=906345), - C1(h_vol_1(start=906345), h(start=906345)), - Cv(start=34.26, fixed=false)) - annotation (Placement(transformation(extent={{88,-186}, - {108,-166}}, rotation=0))); - - ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( - ec=2e-3, - Ns=10, - Rv=1.2, - Lc=2.5, - PasL=0.028, - PasT=0.024, - ntubes3=1500, - Dc=0.018, - ntubes1=400, - ntubes2=400, - L1=11, - L2=11, - L3=22, - pipe_1( - z2=0.4, - Tp(start={500,501,502,503,504,505,506,507,508,510}), - h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, - 965e3,980e3}), - hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, - 965e3}), - Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4, - 202.4}), - P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5, - 222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5})), - pipe_2( - z2=0.4, - Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), - h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, - 1070e3,1080e3,1080e3}), - hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, - 1070e3,1080e3}), - Q(start={57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57,57.57, - 57.57}), - P(start={222.600e5,222.590e5,222.580e5,222.570e5,222.560e5,222.550e5, - 222.540e5,222.530e5,222.520e5,222.51e5,222.50e5,222.48e5})), - C2ex(P(start=3900000)), - Wall_1( - Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), - Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), - Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), - Wall_2( - Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), - Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), - Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), - Wall_3( - Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516, - 516.4,517,517.4,518,518.4,519,519.4}), - Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4, - 516,516.4,517,517.4,518,518.4,519,519.4}), - Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4, - 516,516.4,517,517.4,518,518.4,519,519.4})), - volumeC(h(start=1082.65e3), P(start=222.48e5)), - volumeD1(h(start=953939), P(start=222.48e5)), - volumeD(h(start=812750), P(start=222.72e5)), - WaterHeating( - steady_state=true, - Vertical=false, - step_square=true, - Kvl=1, - Klp=1500, - Kvp=1200, - Kpa=0.2, - V=70, - Mp=50000, - zl(fixed=true, start=0.5), - P(fixed=true, start=39.5e5), - Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)), - hv(start=1463490), - hl(start=906345), - Pfond(start=39.542e5), - Tp1(start={500,501,502,503,504,505,506,507,508,510}), - Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), - Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4, - 516,516.4,517,517.4,518,518.4,519,519.4}), - Tp(start=509)), - pipe_3( - z2=1, - Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516, - 516.4,517,517.4,518,518.4,519,519.4}), - h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, - 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, - 1080e3,1080e3}), - hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, - 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, - 1080e3}), - Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4, - 202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}), - P(start={222.700e5,222.690e5,222.680e5,222.670e5,222.660e5,222.650e5, - 222.640e5,222.630e5,222.620e5,222.610e5,222.600e5,222.590e5, - 222.580e5,222.570e5,222.560e5,222.550e5,222.540e5,222.530e5, - 222.520e5,222.51e5,222.50e5,222.48e5})), - P0c=4000000) annotation (Placement(transformation(extent={{-58,-90},{162,96}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 - annotation (Placement(transformation(extent={{-150,22},{-192,66}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterIn( K=35, Q(fixed=false, - start=250), - Pm(start=227e5)) annotation (Placement(transformation(extent={{-99, - -48},{-79,-28}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterOut( K=30, Q(fixed=false, - start=250), - Pm(start=222.48e5), - C2(h_vol_1(start=1082650), h(start=1082650))) - annotation (Placement(transformation(extent={{ - -80,34},{-100,54}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - option_temperature=true, - P0=220e5, - h0=900e3, - T0=482.87) - annotation (Placement(transformation(extent={{-192,-60},{-150,-16}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol_1(start= - 1082.65e3), h(start=1082.65e3))) - annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation= - 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA( - Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872, - 50]) annotation (Placement(transformation(extent={{-195,78},{-175, - 98}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50) - annotation (Placement(transformation(extent={{135, - -152},{113,-130}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol_1( - start=2750.e3), h(start=2750.e3))) - annotation (Placement(transformation(extent={{-100,122},{-84,138}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossPurge( K=1e-3, - T(fixed=false, start=461.56), - Q(fixed=false, start=35), - Pm(start=3900000), - C2(h_vol_1(start=906340), h(start=906340))) - annotation (Placement(transformation( - origin={54,-138}, - extent={{-10,-10},{10,10}}, - rotation=270))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps - Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5]) - annotation (Placement(transformation(extent={{162,-178},{182, - -158}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( - Q(fixed=false, start=35), - L=10, - D=0.1, - lambda=LambdaPipe, - Pm(start=40.34e5), - C1(h_vol_1(start=2750e3), h(start=2750e3))) - annotation (Placement(transformation(extent={{-48,162}, - {30,98}}, rotation=0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table= - [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5]) - annotation (Placement(transformation(extent={{-195,160},{ - -175,180}}, rotation=0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2( - Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000, - 216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5]) - annotation (Placement(transformation(extent={{-195,-8},{-175, - 12}}, rotation=0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table= - [0,462; 448,462; 1155,420.0; 2000,420.0]) - annotation (Placement(transformation(extent={{-196,-84},{ - -176,-64}}, rotation=0))); -equation - connect(ControlValve_eau.C2, Puit_condenseur1.C) - annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255})); - connect(Puit_condenseur2.C,refQ. C2) annotation (Line( - points={{-150,44},{-135,44}}, - color={255,0,0}, - thickness=0.5)); - connect(refQ.C1, singularPressureLossWaterOut.C2) - annotation (Line( - points={{-115,44},{-100,44}}, - color={255,0,0}, - thickness=0.5)); - connect(sourceP1.C, singularPressureLossWaterIn.C1) - annotation (Line( - points={{-150,-38},{-99,-38}}, - color={0,0,255}, - thickness=0.5)); - connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2) - annotation (Line( - points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}}, - color={255,0,0}, - thickness=0.5)); - connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1) - annotation (Line( - points={{-79,-38},{-58,-38},{-58,-38.85}}, - color={0,0,255}, - thickness=0.5)); - connect(sourceP.C, checkValve.C1) annotation (Line( - points={{-150,130},{-100,130}}, - color={127,0,0}, - thickness=1)); - connect(singularPressureLossPurge.C1, WaterHeating.C2ex) - annotation (Line(points={{54,-128},{54,-90},{52,-90}})); - connect(Pression_purge.y, Puit_condenseur1.IPressure) - annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}})); - connect(checkValve.C2, PressureLoss_Steam.C1) annotation (Line( - points={{-84,130},{-48,130}}, - color={127,0,0}, - thickness=1)); - connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line( - points={{52,96},{52,130},{30,130}}, - color={127,0,0}, - thickness=1)); - connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line( - points={{54,-148},{54,-182},{88,-182}}, color={0,0,255})); - connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{ - -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}})); - connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174, - 2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}})); - connect(Debit_eauA.y, refQ.IMassFlow) - annotation (Line(points={{-174,88},{-125,88},{-125,55}})); - connect(Level.y, ControlValve_eau.Ouv) - annotation (Line(points={{111.9,-141},{98,-141},{98,-165}})); - connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature) - annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}, color={0,0,255})); - annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}), - graphics={ - Text( - extent={{-124,206},{130,146}}, - lineColor={0,0,255}, - textString= - "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"), - Text( - extent={{-74,-190},{118,-222}}, - lineColor={0,0,255}, - textString= - "COP0l_coef_h =false , T_Dp_purge=true"), - Text( - extent={{-186,-198},{-84,-212}}, - lineColor={0,0,255}, - textString= - "Qvap=true ==> Erreur"), - Text( - extent={{16,170},{130,156}}, - lineColor={0,0,255}, - textString= - "checkValve Qmin =0.5"), - Text( - extent={{-136,168},{-18,154}}, - lineColor={0,0,255}, - textString="With guess values")}), - experiment(StopTime=1000, Tolerance=1e-004), - experimentSetupOutput, - Icon(graphics={ - Rectangle( - lineColor={128,128,128}, - extent={{-220,-240},{220,240}}, - radius=25.0), - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicWaterHeating; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo deleted file mode 100644 index 9d9573f8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo +++ /dev/null @@ -1,298 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicWaterHeatingOnePipe - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=68.5297) - "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed=false,start=0.003003) - "Friction pressure loss coefficient (active if lambda_fixed=true)"; - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - h0=2750.e3, - P0=40e5) - annotation (Placement(transformation(extent={{-192,110},{-150,150}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( - option_temperature=false, P0(fixed=true) = 10e5) - annotation (Placement(transformation(extent={{124,-202},{160,-162}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( - mode_caract=0, - Cvmax=CvmaxWater, - Q(fixed=false, start=38.0656), - Pm(start=24.771e5), - h(start=906345), - C1(h_vol_1(start=906345), h(start=906345)), - Cv(start=34.26, fixed=false)) - annotation (Placement(transformation(extent={{88,-186}, - {108,-166}}, rotation=0))); - - ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeaterOnePipe WaterHeating( - ec=2e-3, - Ns=10, - Rv=1.2, - Lc=2.5, - PasL=0.028, - PasT=0.024, - ntubes3=1500, - Dc=0.018, - ntubes1=400, - ntubes2=400, - L1=11, - L2=11, - L3=22, - C2ex(P(start=3953920.2674434385)), - Wall_3( - Tp(start={497.4216192636609,502.69423468274414,506.9759296757205, - 510.4223715331536,513.1750788320363,515.3580718035844, - 517.0775540203194,518.4230303861297,519.4690257033071, - 520.2769753151857,520.8970764101637,521.3700027404278, - 521.7284442755915,521.9984626845046,522.2006676867453, - 522.3512258466948,522.4627164232634,522.5440949624972, - 522.5983494885799,522.6391412946117}), - Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4, - 516,516.4,517,517.4,518,518.4,519,519.4}), - Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4, - 516,516.4,517,517.4,518,518.4,519,519.4})), - volumeC(h(start=1083284.4675828198), P(start=22239324.06759518)), - volumeD(h(start=812750.3853612987), P(start=222.72e5)), - WaterHeating( - steady_state=true, - Vertical=false, - step_square=true, - Kvl=1, - Klp=1500, - Kvp=1200, - Kpa=0.2, - V=70, - Mp=50000, - zl(fixed=true, start=0.5), - P(fixed=true, start=39.5e5), - Cv(Q(fixed=false, start=35), P(fixed=false, start=39.5e5)), - hv(start=1431115.3931413875), - hl(start=1083784.8007690564), - Pfond(start=39.542e5), - Tp1(start={500,501,502,503,504,505,506,507,508,510}), - Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), - Tp3(start={502.0668232342926,506.5603551100769,510.17517354535573, - 513.0552006761686,515.3300849797615,517.1125155075463, - 518.4982207642074,519.5672140241339,520.3855368446975, - 521.0071208743625,521.475583235511,521.8258726586643, - 522.0857355520467,522.276996946816,522.4166635499804, - 522.5178617542946,522.5906259809204,522.6416937796047, - 522.6717272169116,522.6943081560064}), - Tp(start=522.7203786935834)), - pipe_3( - z2=1, - Tp(start={492.2865845099074,498.42043682971996,503.43932965553495, - 507.5119139438755,510.7928300582301,513.4186242679523, - 515.5070797958261,517.1581940553467,518.4558696409629, - 519.4698368458761,520.2575667844292,520.866061927203, - 521.3334770960658,521.6905573412918,521.9618953291181, - 522.1670184035046,522.3213189657012,522.4362044759667, - 522.5172341741693,522.5781571584042}), - h(start={812750.375,863278.0600600096,905331.3426571415,940130.751800155, - 968769.0495620216,992209.8823638612,1011293.6430149649, - 1026746.7829727756,1039192.5095809929,1049161.7546575891, - 1057103.8294379094,1063396.4712379558,1068355.1441001317, - 1072241.5390561111,1075271.2636377309,1077620.734010462, - 1079433.2969658624,1080824.6185597836,1081886.238523024, - 1082684.3963576336,1083284.4675828198,1083284.5}), - hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, - 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, - 1080e3}), - Q(start={202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4, - 202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4,202.4}), - P(start={22269346.0,22267948.39153832,22266544.294239394, - 22265134.171108145,22263718.740660597,22262298.715698708, - 22260874.773397826,22259447.536273584,22258017.56171816, - 22256585.338030815,22255151.28511641,22253715.75831186, - 22252279.054104224,22250841.416797128,22249403.045444023, - 22247964.100585815,22246524.71050402,22245084.976831134, - 22243644.979685582,22242204.783200525,22240764.436308913,22239324.0})), - P0c=4000000) annotation (Placement(transformation(extent={{-58,-90},{162,96}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 - annotation (Placement(transformation(extent={{-150,22},{-192,66}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterIn( K=35, Q(fixed=false, - start=250), - Pm(start=22270672.891128033)) - annotation (Placement(transformation(extent={{-99, - -48},{-79,-28}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterOut( K=30, Q(fixed=false, - start=250), - Pm(start=22238086.493105933), - C2(h_vol_1(start=1082650), h(start=1082650))) - annotation (Placement(transformation(extent={{ - -80,34},{-100,54}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - option_temperature=true, - P0=220e5, - h0=900e3, - T0=482.87) - annotation (Placement(transformation(extent={{-192,-60},{-150,-16}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53, C1(h_vol_1(start= - 1082.65e3), h(start=1082.65e3))) - annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation= - 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA( - Table=[0,260; 378,260; 390,238; 438,275; 507,135; 936,65; 1404,50; 1872, - 50]) annotation (Placement(transformation(extent={{-195,78},{-175, - 98}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.50) - annotation (Placement(transformation(extent={{135, - -152},{113,-130}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin=0.5, C2(h_vol_1( - start=2750.e3), h(start=2750.e3))) - annotation (Placement(transformation(extent={{-100,122},{-84,138}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossPurge( K=1e-3, - T(fixed=false, start=461.56), - Q(fixed=false, start=35), - Pm(start=3953920.266328794), - C2(h_vol_1(start=906340), h(start=906340))) - annotation (Placement(transformation( - origin={54,-138}, - extent={{-10,-10},{10,10}}, - rotation=270))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps - Pression_purge(Table=[0,10e5; 378,10e5; 418,7e5; 1145,3.9e5; 2000,3.9e5]) - annotation (Placement(transformation(extent={{162,-178},{182, - -158}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( - Q(fixed=false, start=35), - L=10, - D=0.1, - lambda=LambdaPipe, - Pm(start=40.34e5), - C1(h_vol_1(start=2750e3), h(start=2750e3))) - annotation (Placement(transformation(extent={{-48,162}, - {30,98}}, rotation=0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table= - [0,41.19e5; 378,41.19e5; 418,21.e5; 1145,5.e5; 2000,5.e5]) - annotation (Placement(transformation(extent={{-195,160},{ - -175,180}}, rotation=0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2( - Table=[0,222.72e5; 378,222.72e5; 438,230e5; 597,217e5; 1000, - 216e5; 1533,214e5; 1863,213.5e5; 2340,213e5; 2500,213e5]) - annotation (Placement(transformation(extent={{-195,-8},{-175, - 12}}, rotation=0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table= - [0,462; 448,462; 1155,420.0; 2000,420.0]) - annotation (Placement(transformation(extent={{-196,-84},{ - -176,-64}}, rotation=0))); -equation - connect(ControlValve_eau.C2, Puit_condenseur1.C) - annotation (Line(points={{108,-182},{124,-182}}, color={0,0,255})); - connect(Puit_condenseur2.C,refQ. C2) annotation (Line( - points={{-150,44},{-135,44}}, - color={255,0,0}, - thickness=0.5)); - connect(refQ.C1, singularPressureLossWaterOut.C2) - annotation (Line( - points={{-115,44},{-100,44}}, - color={255,0,0}, - thickness=0.5)); - connect(sourceP1.C, singularPressureLossWaterIn.C1) - annotation (Line( - points={{-150,-38},{-99,-38}}, - color={0,0,255}, - thickness=0.5)); - connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2) - annotation (Line( - points={{-80,44},{-64,44},{-64,43.92},{-58,43.92}}, - color={255,0,0}, - thickness=0.5)); - connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1) - annotation (Line( - points={{-79,-38},{-58,-38},{-58,-38.85}}, - color={0,0,255}, - thickness=0.5)); - connect(sourceP.C, checkValve.C1) annotation (Line( - points={{-150,130},{-100,130}}, - color={127,0,0}, - thickness=1)); - connect(singularPressureLossPurge.C1, WaterHeating.C2ex) - annotation (Line(points={{54,-128},{54,-90},{52,-90}})); - connect(Pression_purge.y, Puit_condenseur1.IPressure) - annotation (Line(points={{183,-168},{196,-168},{196,-182},{151,-182}})); - connect(checkValve.C2, PressureLoss_Steam.C1) annotation (Line( - points={{-84,130},{-48,130}}, - color={127,0,0}, - thickness=1)); - connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation (Line( - points={{52,96},{52,130},{30,130}}, - color={127,0,0}, - thickness=1)); - connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation (Line( - points={{54,-148},{54,-182},{88,-182}}, color={0,0,255})); - connect(Pression_Turbine1.y, sourceP.IPressure) annotation (Line(points={{ - -174,170},{-174,152},{-190,152},{-190,130},{-181.5,130}})); - connect(Pression_eauA2.y, sourceP1.IPressure) annotation (Line(points={{-174, - 2},{-174,-10},{-194,-10},{-194,-38},{-181.5,-38}})); - connect(Debit_eauA.y, refQ.IMassFlow) - annotation (Line(points={{-174,88},{-125,88},{-125,55}})); - connect(Level.y, ControlValve_eau.Ouv) - annotation (Line(points={{111.9,-141},{98,-141},{98,-165}})); - connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature) - annotation (Line(points={{-175,-74},{-171,-74},{-171,-49}}, color={0,0,255})); - annotation (Diagram(coordinateSystem(extent={{-200,-200},{200,200}}), - graphics={ - Text( - extent={{-124,206},{130,146}}, - lineColor={0,0,255}, - textString= - "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"), - Text( - extent={{-74,-190},{118,-222}}, - lineColor={0,0,255}, - textString= - "COP0l_coef_h =false , T_Dp_purge=true"), - Text( - extent={{-186,-198},{-84,-212}}, - lineColor={0,0,255}, - textString= - "Qvap=true ==> Erreur"), - Text( - extent={{16,170},{130,156}}, - lineColor={0,0,255}, - textString= - "checkValve Qmin =0.5"), - Text( - extent={{-136,168},{-18,154}}, - lineColor={0,0,255}, - textString="With guess values")}), - experiment(StopTime=1000, Tolerance=1e-004), - experimentSetupOutput, - Icon(graphics={ - Rectangle( - lineColor={128,128,128}, - extent={{-220,-240},{220,240}}, - radius=25.0), - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicWaterHeatingOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo deleted file mode 100644 index 2ec43ae6..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo +++ /dev/null @@ -1,84 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestDynamicWaterSteamMultiFluidHeatExchanger - - BoundaryConditions.SourceQ sourceP(C(h_vol_2(start= - 71016.12237181065)), - Q0=10, - option_temperature=true) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start= - 71016.1223718086))) - annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); - HeatExchangers.DynamicWaterSteamMultiFluidsHeatExchanger dynamicMultiFluidHeatExchanger( - steady_state=true, - Cfg1(h_vol_2(start=71016.12237181155)), - Cfg2(h_vol_1(start=71016.12237181314)), - ExchangerMultiFluids( - P(start={300000.0,260001.59713260198,220002.3957916478,180002.39588440701, - 140001.5973181204,100000.0}), - Q(start={2702.7912398488343,2702.7912398488343,2702.7912398488343, - 2702.7912398488343,2702.7912398488343}), - h(start={71016.125,71016.125,71016.12237180988,71016.1223718091,71016.125, - 70825.8984375})), - TwoPhaseFlowPipe( - P(start={300000.0,260001.59801114563,220002.39710936273,180002.3972020214, - 140001.59819646296,100000.0}), - Q(start={3482.228448926616,3482.228448926616,3482.228448926616, - 3482.228448926616,3482.228448926616}), - h(start={71016.125,71016.125,71016.12237181216,71016.12237181274, - 71016.125,70825.8984375})), - ExchangerWall(Tp(start={290.03103270324897,290.0401814264445, - 290.0493302229999,290.05847909289605}), Tp1(start={ - 290.03103270331616,290.04018142654525,290.0493302231005, - 290.0584790929629})), - Ntubes=10, - Ns=4, - diffusion=true, - dynamic_mass_balance=true, - dynamic_energy_balance=false, - inertia=false) - annotation (Placement(transformation(extent={{-20,20},{0,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=5000000, - T0=1273.15) - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=90, - origin={-10,70}))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=90, - origin={-10,-10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1) - annotation (Line(points={{-40,30},{-20,30}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C) - annotation (Line(points={{0,30},{20,30}}, color={0,0,0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1) - annotation (Line(points={{-10,60},{-10,35}}, color={0,0,0})); - connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C) - annotation (Line(points={{-10,25},{-10,0}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestDynamicWaterSteamMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo deleted file mode 100644 index cb583f64..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo +++ /dev/null @@ -1,53 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestFixedPowerHeatExchanger - - ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger - plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - DW=1.e6) annotation (Placement(transformation(extent={{-20,40},{0,60}}, - rotation=0))); - BoundaryConditions.SourcePQ sourceP2(T0=340, - option_temperature=true) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - BoundaryConditions.SourcePQ sourceP3(option_temperature= - true) - annotation (Placement(transformation(extent={{-60,40},{-40,60}}, rotation=0))); - BoundaryConditions.Sink puitsP2 - annotation (Placement(transformation( - extent={{20,20},{40,40}}, rotation=0))); - BoundaryConditions.Sink puitsP3 - annotation (Placement(transformation( - extent={{20,40},{40,60}}, rotation=0))); -equation - connect(sourceP3.C, plateHeatExchanger.Ef) - annotation (Line(points={{-40,50},{-20,50}}, color={0,0,0})); - connect(plateHeatExchanger.Sf, puitsP3.C) annotation (Line(points={{-0.2,50.1}, - {9.9,50.1},{9.9,50},{20,50}}, color={0,0,0})); - connect(plateHeatExchanger.Sc, puitsP2.C) annotation (Line(points={{-4.2,44}, - {-4,44},{-4,30},{20,30}}, color={0,0,0})); - connect(plateHeatExchanger.Ec, sourceP2.C) annotation (Line(points={{-15.8,44}, - {-16,44},{-16,30},{-40,30}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestFixedPowerHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo deleted file mode 100644 index 95d64b9f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo +++ /dev/null @@ -1,82 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestFossilFuelBoiler - import ThermoSysPro; - ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler( - Wloss=0, - Ke=1.e6, - Tsf=386.16) - annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( - T0=338.16, - Cp=1282, - Xh=0.24403, - Xc=0.75323, - Q0=1.45) annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( - Xco2=0, - Xh2o=0.01, - Q0=27., - Xo2=0.233, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - T0=298.16, - option_temperature=true) - annotation (Placement(transformation(extent={{-110,-50},{-71,-13}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation( - extent={{68,-51},{110,-12}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - Q0=24., - h0=600e3, - P0=14000000) - annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation( - extent={{74,13},{110,49}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3) - annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3) - annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0))); -equation - connect(sourceQ.C, FossilFuelBoiler.Cair) annotation (Line( - points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}}, - color={0,0,0}, - thickness=1)); - connect(FossilFuelBoiler.Cfg, sinkP.C) annotation (Line( - points={{45,-31.62},{62,-31.62},{62,-31.5},{68,-31.5}}, - color={0,0,0}, - thickness=1)); - connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel) annotation (Line(points={ - {0,-59.5},{0,-40.8}}, color={0,0,0})); - connect(sourcePQ.C, singularPressureLoss.C1) - annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255})); - connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation (Line( - points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255})); - connect(singularPressureLoss1.C2, sink.C) - annotation (Line(points={{65,31},{74,31}}, color={0,0,255})); - connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation (Line( - points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255})); - annotation ( Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestFossilFuelBoiler; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo deleted file mode 100644 index 17a20108..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo +++ /dev/null @@ -1,172 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestFresnelField - parameter Integer Nt=3 "Number of trains"; -public - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( - ntubes=1, - steady_state=true, - D=0.07, - e=0.004, - Ns=30, - T0=500, - lambda=20, - cpw=500, - rhow=8000, - Tp(start={628.0843201819387,627.9310075597404,627.8220175907211, - 627.7368992018166,627.6679716601412,627.6112649113921, - 627.5643995456558,627.5258238160011,627.4944728950805, - 627.4695948757801,627.4506537300122,627.4372716636091, - 627.4291939746797,627.426267226699,627.428426585461,627.4356896138493, - 627.4481553612113,627.4660085346942,627.4895290639054, - 627.5191082002851,627.5552734790091,627.5987264837852, - 627.6504001032708,627.7115474128314,627.7838847016081, - 627.8698331666657,627.9729350144038,629.4253815385038, - 633.135688507217,636.2622387488283}), - Tp1(start={610.2709965207655,610.0984334604643,609.9757644369477, - 609.8799665740102,609.8023932206363,609.7385750723525, - 609.6858335131916,609.6424216866362,609.6071408778737, - 609.5791446660139,609.5578296140685,609.5427704711935, - 609.533680491646,609.5303869740989,609.5328169418054,609.540990157294, - 609.5550181389947,609.5751088339957,609.6015773714007, - 609.6348642175905,609.6755632868924,609.7244644309128, - 609.7826179283193,609.8514345863706,609.9328467812495, - 610.0295806069864,610.1456244663702,611.7808730290952, - 615.9622431406954,619.4903247027197}), - Tp2(start={644.9596553467713,644.824579502235,644.7285482944553, - 644.6535470354397,644.592810046145,644.5428402353538, - 644.5015416419557,644.4675473586904,644.4399193877858, - 644.4179953736024,644.4013031238645,644.3895098327511, - 644.3823911261306,644.3798118348441,644.3817148399042,644.38811560583, - 644.3991013774125,644.4148348525065,644.4355626048274, - 644.4616292617266,644.4934994867675,644.531791236838, - 644.5773261834961,644.6312079828199,644.6949482231629, - 644.7706792525222,644.8615205623447,646.1407907783827, - 649.404839172216,652.1510013554424}), - L=1e4/11.46) - annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3) - annotation (Placement(transformation(extent={{-101,-55},{-81,-35}}, - rotation=0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe - dynamicTwoPhaseFlowPipe( - ntubes=1, - steady_state=true, - rugosrel=0.00005, - dpfCorr=1, - Ns=30, - P(start={12512365.778485337,12512269.4730028,12512159.010926897, - 12512028.619141866,12511878.28140543,12511707.984695798, - 12511517.718132183,12511307.472416837,12511077.239500606, - 12510827.012364838,12510556.784871727,12510266.551658653, - 12509956.30806284,12509626.050068311,12509275.774270097, - 12508905.477852736,12508515.15858121,12508104.814803492, - 12507674.445464557,12507224.050132478,12506753.629037917, - 12506263.183129327,12505752.714147368,12505222.224723859, - 12504671.718513375,12504101.200370008,12503510.676589508, - 12502896.415784404,12502231.48634808,12501522.52554151, - 12500776.553197166,12500000.0}), - h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266, - 1645211.676359884,1681572.2077847784,1717947.2125321354, - 1754334.1766730088,1790730.9833788855,1827135.788296852, - 1863546.9394607474,1899962.9220483964,1936382.3178860326, - 1972803.7739566958,2009225.9764870608,2045647.6282789519, - 2082067.4276265746,2118484.0474634594,2154896.1134394333, - 2191302.179544121,2227700.6996020116,2264089.9923674623, - 2300468.196934767,2336833.213464297,2373182.6211112435, - 2409513.559261445,2445822.5467506223,2482105.1942732874, - 2518015.7979130256,2552967.680496474,2587102.355161259, - 82548.43470391157}), - D=0.07, - inertia=false, - L=1e4/11.46) annotation (Placement(transformation(extent={{-36, - -67},{36,-20}}, rotation=0))); - ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N( - Ns=30, - T(start=fill(500, 30)), - F12=0.6366, - A=1e4, - T0=303) - annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( - h0=2000e3, P0=125e5) annotation (Placement(transformation(extent={{80,-54}, - {100,-34}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI( - Starttime=100, - Initialvalue=100, - Duration=3600, - Finalvalue=900) annotation (Placement(transformation(extent={{72,39},{58,53}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles( - Starttime=100, - Initialvalue=45, - Finalvalue=45, - Duration=3600) annotation (Placement(transformation(extent={{-26,77},{-12, - 90}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q( - Starttime=100, - Duration=3600, - Initialvalue=2, - Finalvalue=3) annotation (Placement(transformation(extent={{7,-6.5},{-7, - 6.5}}, rotation=90, - origin={-90,-9.5}))); - Junctions.MassFlowMultiplier massFlowMultiplier1(alpha=1/Nt) - annotation (Placement(transformation(extent={{-70,-54},{-50,-34}}))); - Junctions.MassFlowMultiplier massFlowMultiplier2(alpha=Nt) - annotation (Placement(transformation(extent={{52,-54},{72,-34}}))); -equation - connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2) - annotation (Line(points={{0,1.6},{0,-15.6}}, color={191,95,0})); - connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line( - points={{0,-22.4},{0,-36.45}}, color={191,95,0})); - connect(champThermosolaireLFR_N.SunDNI, DNI.y) - annotation (Line(points={{44,45.6},{51,45.6},{51,46},{57.3,46}})); - connect(champThermosolaireLFR_N.SunA, Angles.y) - annotation (Line(points={{36.8,58.8},{36.8,84},{28,84},{28,83.5},{-11.3, - 83.5}})); - connect(sourceP.C, massFlowMultiplier1.Ce) annotation (Line(points={{-81,-45}, - {-76.5,-45},{-76.5,-44},{-70,-44}}, color={0,0,0})); - connect(massFlowMultiplier1.Cs, dynamicTwoPhaseFlowPipe.C1) annotation (Line( - points={{-50,-44},{-44,-44},{-44,-43.5},{-36,-43.5}}, color={0,0,0})); - connect(dynamicTwoPhaseFlowPipe.C2, massFlowMultiplier2.Ce) annotation (Line( - points={{36,-43.5},{47,-43.5},{47,-44},{52,-44}}, color={0,0,0})); - connect(massFlowMultiplier2.Cs, sinkP.C) - annotation (Line(points={{72,-44},{80,-44}}, color={0,0,0})); - connect(Q.y, sourceP.IMassFlow) annotation (Line(points={{-90,-17.2},{-91, - -17.2},{-91,-40}}, color={0,0,255})); - connect(Angles.y, champThermosolaireLFR_N.SunG) annotation (Line(points={{ - -11.3,83.5},{27.2,83.5},{27.2,58.8}}, color={0,0,255})); - annotation ( - Documentation(revisions=" -

Author

- -", info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - experiment(StopTime=5000), - Diagram(graphics={Text( - extent={{-36,-64},{54,-82}}, - lineColor={28,108,200}, - textString="Fresnel field with Nt=%Nt trains")})); -end TestFresnelField; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo deleted file mode 100644 index c0db0246..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo +++ /dev/null @@ -1,83 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestGTCombustionChamber - import ThermoSysPro; - - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 - annotation (Placement(transformation( - origin={149,-2}, - extent={{23,-24},{-23,24}}, - rotation=180))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P( - fixed=true, start=14.1e5)), kcham(fixed=false, start=1)) annotation ( - Placement(transformation(extent={{-67,-68},{67,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2( - Q0=0, - P0=15e5, - h0=300e3) - annotation (Placement(transformation(extent={{-112,48},{-72,88}}, - rotation=0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2( - Hum=0, - Xo=0, - Xn=0, - Xs=0, - rho=0.838, - Xc=0.755, - Xh=0.245, - Cp=2255, - T0=410, - Q0=9.30, - LHV=47500e3) annotation (Placement(transformation(extent={{-107,-93},{-71,-57}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2( - Xso2=0, - Xco2=0.0, - Xo2=0.23, - Xh2o=0.01, - P0=15e5, - Q0=415, - T0=680, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=true) - annotation (Placement(transformation(extent={{-174,-26},{-128,22}}, - rotation=0))); - -equation - connect(GTCombustionChamber2.Cws, sourcePQ2.C) - annotation (Line(points={{-40.2,57.4},{-40.2,68},{-72,68}})); - connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation (Line( - points={{0,-61.4},{0,-75},{-71,-75}}, color={0,0,0})); - connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation (Line( - points={{60.3,-2},{126,-2}}, - color={0,0,0}, - thickness=1)); - connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation (Line( - points={{-128,-2},{-60.3,-2}}, - color={0,0,0}, - thickness=1)); - annotation (Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-200},{200,200}}, - initialScale=0.1)), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestGTCombustionChamber; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo deleted file mode 100644 index fc8a96bb..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo +++ /dev/null @@ -1,105 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestGasTurbine - - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - P0=1.013e5, - Q0=600, - T0=29.4 + 273.16, - option_temperature=true, - Xco2=0, - Xh2o=0, - Xo2=0.20994, - Xso2=0, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); - - BoundaryConditions.SinkP sink - annotation (Placement(transformation(extent={{60,-10},{80,10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante humidity(k=0.93) - annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe fuel( - Starttime=200, - Duration=800, - Initialvalue=13.507, - Finalvalue=8.756) - annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe air( - Starttime=200, - Duration=800, - Initialvalue=592.7, - Finalvalue=415.70) - annotation (Placement(transformation(extent={{-98,0},{-78,20}}))); - Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( - Q0=13.4368286133, - T0=185 + 273.16, - LHV=46989e3, - Cp=2255, - Xc=0.755, - Xh=0.245, - rho=0.838) annotation (Placement(transformation(extent={{-20,40},{0,60}}))); - BoundaryConditions.SourcePQ water(Q0=0) - annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); - Machines.GasTurbine gasTurbine( - comp_tau_n=14.0178, - comp_eff_n=0.87004, - exp_tau_n=0.06458, - exp_eff_n=0.89045, - TurbQred=0.0175634, - Kcham=2.02088, - Wpth=1e6, - Compresseur( - Ps(start=1404200.0), - Te(start=302.56000000000006), - Tis(start=630.0), - Ts(start=729.0)), - TurbineAgaz(Tis(start=847.0)), - chambreCombustionTAC( - Psf(start=1310000.0), - Tea(start=729.0), - Tsf(start=1532.57)), - xAIR( - ppvap0(start=4104.0), - rho_air(start=1.0836), - rho_vap(start=0.029))) - annotation (Placement(transformation(extent={{-30,-28},{30,28}}))); -equation - connect(air.y, sourcePQ.IMassFlow) - annotation (Line(points={{-77,10},{-60,10},{-60,5}}, color={0,0,255})); - connect(humidity.y, gasTurbine.Huminide) annotation (Line(points={{-79,40},{ - -60,40},{-60,16.8},{-31.2,16.8}},color={0,0,255})); - connect(fuel.y, fuelSourcePQ.IMassFlow) - annotation (Line(points={{-19,70},{-10,70},{-10,55}}, - color={0,0,255})); - connect(sourcePQ.C, gasTurbine.Entree_air) annotation (Line(points={{-50,0},{ - -32,0},{-32,3.55271e-015},{-30,3.55271e-015}}, color={0,0,0})); - connect(fuelSourcePQ.C, gasTurbine.Entree_combustible) - annotation (Line(points={{0,50},{18,50},{18,28}}, color={0,0,0})); - connect(water.C, gasTurbine.Entree_eau_combustion) - annotation (Line(points={{-40,50},{-18,50},{-18,28}}, color={0,0,0})); - connect(gasTurbine.Sortie_fumees, sink.C) - annotation (Line(points={{30,3.55271e-015},{46,3.55271e-015},{46,0},{60,0}}, - color={0,0,0})); - annotation ( Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - experiment(StopTime=1200)); -end TestGasTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo deleted file mode 100644 index b5802c7d..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo +++ /dev/null @@ -1,86 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestGenericCombustion - - ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion genericCombustionCCS( - kcham=0.1, - Acham=275, - Xbf=0, - ImbCV=0.05, - ImbBF=0.0, - Psf(start=113275)) annotation (Placement(transformation(extent={{-32,-56},{ - 92,72}}, - rotation=0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( - Xn=0.0208, - Xashes=0.136, - Cp=1200, - rho=1100, - LHV=29245e3, - Xc=0.719, - Xh=0.0414, - Xo=0.086, - Xs=0.0044, - Vol=0.286, - Q0=57.20, - T0=358.15, - Hum=0.08) annotation (Placement(transformation(extent={{24,-95},{58,-57}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000) - annotation (Placement(transformation(extent={{-83,-3},{-47,31}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( - Xso2=0, - Q0=609.29, - Xh2o=0.01, - Xo2=0.230, - Xco2=0, - P0=191000, - T0=524.89, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=true) - annotation (Placement(transformation(extent={{-54,-94},{-10,-54}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation( - extent={{30,70},{74,112}},rotation=0))); -equation - connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel) annotation (Line(points={{58,-76}, - {73.4,-76},{73.4,-49.6}}, color={0,0,0})); - connect(SourcePQ_Water.C, genericCombustionCCS.Cws) annotation (Line(points={{-47,14}, - {-36,14},{-36,14.4},{-25.8,14.4}}, color={0,0,0})); - connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line( - points={{11.4,-49.6},{11.4,-74},{-10,-74}}, - color={0,0,0}, - thickness=1)); - connect(genericCombustionCCS.Cfg, sink.C) annotation (Line( - points={{11.4,65.6},{11.4,91},{30,91}}, - color={0,0,0}, - thickness=1)); - annotation ( Documentation(revisions=" -

Author

- -", info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})})); -end TestGenericCombustion; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo deleted file mode 100644 index 3407226d..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo +++ /dev/null @@ -1,144 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestGenericCombustion1D - - parameter Integer NCEL = 7; - - ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS( - NCEL=7, - Qm(fixed=false), - Qsf(fixed=false), - kcham(fixed=true) = 0.1, - Acham=275, - Xbf=0, - ImbCV=0.05, - EPSPAR=0.7, - Kec=8.8, - SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56}, - ImbBF=0.0, - Psf(start=113275)) annotation (Placement(transformation(extent={{-62,-56},{62, - 72}}, rotation=0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( - Xn=0.0208, - Xashes=0.136, - Cp=1200, - rho=1100, - LHV=29245e3, - Xc=0.719, - Xh=0.0414, - Xo=0.086, - Xs=0.0044, - Vol=0.286, - Q0=57.20, - T0=358.15, - Hum=0.08) annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( - Xso2=0, - Q0=609.29, - Xh2o=0.01, - Xo2=0.230, - Xco2=0, - P0=191000, - T0=524.89, - option_temperature=true, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation( - extent={{0,70},{44,112}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000) - annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation= - 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe PipeWaterSteam( - Ns=7, - z2=56, - rugosrel=5e-5, - ntubes=403, - L=58, - D=0.0327, - C2(Q(fixed=false, start=486.69), P( - fixed=false, - start=1.96318e+07, - displayUnit="Pa")), - dpfCorr=3.5) - annotation (Placement(transformation( - origin={91,8}, - extent={{49,16},{-49,-16}}, - rotation=270))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall paroiEcrans( - Ns=7, - lambda=40, - steady_state=true, - ntubes=403, - L=58, - D=0.0327, - e=0.001) - annotation (Placement(transformation( - origin={73,7.5}, - extent={{51.5,-15},{-51.5,15}}, - rotation=270))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam2( - option_temperature=false, - Q(start=486.69, fixed=true), - h0=2.5e+06, - P0(fixed=false) = 19621600) - annotation (Placement(transformation( - origin={90,90.5}, - extent={{14.5,-15},{-14.5,15}}, - rotation=270))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceEcrans( - h0=1.292e+06, - option_temperature=false, - P0=20112000) - annotation (Placement(transformation( - origin={91,-81}, - extent={{15,-15},{-15,15}}, - rotation=270))); -equation - connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel) - annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0})); - connect(genericCombustionCCS.Cfg, sink.C) annotation (Line( - points={{0,65.6},{0,91},{0,91}}, - color={0,0,0}, - thickness=1)); - connect(genericCombustionCCS.Ca, sourceAir.C) annotation (Line( - points={{0,-49.6},{0,-78}}, - color={0,0,0}, - thickness=1)); - connect(SourcePQ_Water.C, genericCombustionCCS.Cws) - annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255})); - connect(genericCombustionCCS.Cth,paroiEcrans. WT2) annotation (Line(points={{55.8,8}, - {68,8},{68,7.5},{76,7.5}}, color={191,95,0})); - connect(paroiEcrans.WT1,PipeWaterSteam. CTh) annotation (Line(points={{70,7.5}, - {71,7.5},{71,8},{86.2,8}}, color={191,95,0})); - connect(sourceEcrans.C,PipeWaterSteam. C1) - annotation (Line(points={{91,-66},{91,-41}}, color={0,0,255})); - connect(PipeWaterSteam.C2,sinkWaterSteam2. C) annotation (Line(points={{91,57}, - {91,76},{90,76}}, color={0,0,255})); - annotation ( Documentation(revisions=" -

Author

- -", info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})})); -end TestGenericCombustion1D; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo deleted file mode 100644 index 082d7f17..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo +++ /dev/null @@ -1,90 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestGridFurnace - import ThermoSysPro; - - parameter Integer NCEL = 7; - - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( - Xn=0.0208, - Xashes=0.136, - Cp=1200, - rho=1100, - LHV=29245e3, - Xc=0.719, - Xh=0.0414, - Xo=0.086, - Xs=0.0044, - Vol=0.286, - Q0=57.20, - T0=358.15, - Hum=0.08) annotation (Placement(transformation(extent={{-106,-23},{-72,15}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( - Xso2=0, - Xh2o=0.01, - Xo2=0.230, - Xco2=0, - T0=300, - Q0=10, - P0=1.9e5, - option_temperature=true, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-74,-80},{-30,-40}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature=true) - annotation (Placement(transformation( - extent={{28,50},{72,92}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(P0=1.e5, Q0=1) - annotation (Placement(transformation(extent={{89,13},{53,47}}, rotation= - 0))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.GridFurnace gridFurnace - annotation (Placement(transformation(extent={{-40,-40},{40,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceAir1( - Xso2=0, - Xh2o=0.01, - Xo2=0.230, - Xco2=0, - option_temperature=true, - T0=300, - Q0=10, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-90,4},{-46,44}}, rotation=0))); -equation - connect(fuelSourcePQ.C, gridFurnace.Com) - annotation (Line(points={{-72,-4},{-36,-4}}, color={0,0,0})); - connect(gridFurnace.Cfg, sink.C) - annotation (Line(points={{0,36},{0,71},{28,71}}, color={0,0,0})); - connect(SourcePQ_Water.C, gridFurnace.port_eau_refroid) - annotation (Line(points={{53,30},{32,30},{32,12}}, color={0,0,0})); - connect(sourceAir1.C, gridFurnace.Ca2) - annotation (Line(points={{-46,24},{-20,24}}, color={0,0,0})); - connect(sourceAir.C, gridFurnace.Ca1) - annotation (Line(points={{-30,-60},{0,-60},{0,-36}}, color={0,0,0})); - annotation ( Documentation(revisions=" -

Author

- -", info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})})); -end TestGridFurnace; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo deleted file mode 100644 index b1db3c7a..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo +++ /dev/null @@ -1,53 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestHeatPumpCompressor - ThermoSysPro.Fluid.Machines.HeatPumpCompressor Compressor( - Pe(fixed=false, start=100000), - Ts(fixed=false, start=680)) annotation (Placement(transformation(extent={{ - -52,-52},{48,52}}, rotation=0))); - BoundaryConditions.SourceQ SourceQ1( - Xso2=0, - Xco2=0.0, - Xh2o=0.003, - Xo2=0.23, - Q0=420, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.C3H3F5, - h0=3.e4, - T0=288, - option_temperature=false) - annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1580000, - option_temperature=false) - annotation (Placement(transformation( - origin={96,0}, - extent={{10,-10},{-10,10}}, - rotation=180))); -equation - connect(SourceQ1.C, Compressor.C1) - annotation (Line(points={{-84,0},{-52,0}}, color={0,0,0})); - connect(SinkP1.C, Compressor.C2) - annotation (Line(points={{86,0},{48,0}}, color={0,0,0})); - annotation ( Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestHeatPumpCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo deleted file mode 100644 index 1ecc9dbf..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo +++ /dev/null @@ -1,111 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestIdealCheckValve - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 - annotation (Placement(transformation( - extent={{-60,-80},{-40,-60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( - P0=6e5) annotation (Placement(transformation( - extent={{80,-80},{100,-60}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse( - amplitude=6e5, - width=50, - period=100, - offset=3e5) annotation (Placement(transformation(extent={{-100,-80},{-80, - -60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve3 - annotation (Placement(transformation(extent={{10,-80},{30,-60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 - annotation (Placement(transformation( - extent={{-30,-80},{-10,-60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP3 - annotation (Placement(transformation( - extent={{50,-80},{70,-60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation(extent= - {{-104,20},{-84,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP( - P0=6e5) annotation (Placement(transformation( - extent={{84,20},{104,40}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump1 - annotation (Placement(transformation(extent={{-30,60},{-10,80}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump2 - annotation (Placement(transformation(extent={{-30,-20},{-10,0}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumeD annotation (Placement( - transformation(extent={{-50,20},{-30,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve1 - annotation (Placement(transformation(extent={{10,60},{30,80}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve2 - annotation (Placement(transformation(extent={{8,-20},{28,0}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC annotation (Placement( - transformation(extent={{30,20},{50,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP - annotation (Placement(transformation( - extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 - annotation (Placement(transformation( - extent={{60,20},{80,40}}, rotation=0))); -equation - connect(sourceP1.C, perteDP2.C1) - annotation (Line(points={{-40,-70},{-30,-70}}, color={0,0,255})); - connect(perteDP2.C2, idealCheckValve3.C1) - annotation (Line(points={{-10,-70},{10,-70}}, color={0,0,255})); - connect(idealCheckValve3.C2, perteDP3.C1) - annotation (Line(points={{30,-70},{50,-70}}, color={0,0,255})); - connect(perteDP3.C2, puitsP1.C) - annotation (Line(points={{70,-70},{80,-70}}, color={0,0,255})); - connect(pulse.y, sourceP1.IPressure) annotation (Line(points={{-79,-70},{-55, - -70}})); - connect(staticCentrifugalPump1.C2,idealCheckValve1. C1) annotation (Line( - points={{-10,70},{-2,70},{-2,70},{10,70}}, color={0,0,255})); - connect(staticCentrifugalPump2.C2,idealCheckValve2. C1) annotation (Line( - points={{-10,-10},{0,-10},{0,-10},{8,-10}}, color={0,0,255})); - connect(perteDP1.C2,puitsP. C) - annotation (Line(points={{80,30},{84,30}}, color={0,0,255})); - connect(sourceP.C,perteDP. C1) - annotation (Line(points={{-84,30},{-80,30}}, color={0,0,255})); - connect(perteDP.C2, volumeD.Ce) - annotation (Line(points={{-60,30},{-50,30}}, color={0,0,0})); - connect(volumeD.Cs1, staticCentrifugalPump1.C1) - annotation (Line(points={{-40,40},{-40,70},{-30,70}}, color={0,0,0})); - connect(volumeD.Cs2, staticCentrifugalPump2.C1) - annotation (Line(points={{-40,20},{-40,-10},{-30,-10}}, color={0,0,0})); - connect(idealCheckValve1.C2, volumeC.Ce2) - annotation (Line(points={{30,70},{40,70},{40,40}}, color={0,0,0})); - connect(volumeC.Cs, perteDP1.C1) - annotation (Line(points={{50,30},{60,30}}, color={0,0,0})); - connect(idealCheckValve2.C2, volumeC.Ce3) - annotation (Line(points={{28,-10},{40,-10},{40,20}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2})), - Window( - x=0.28, - y=0.03, - width=0.5, - height=0.6), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestIdealCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo deleted file mode 100644 index a751ce0e..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo +++ /dev/null @@ -1,65 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestIdealSwitchValve - - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{60,20},{80,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve SwitchValve - annotation (Placement(transformation( - extent={{-20,26},{0,46}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse( - width=10, period=20) - annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 - annotation (Placement(transformation( - extent={{-60,20},{-40,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 - annotation (Placement(transformation( - extent={{20,20},{40,40}}, rotation=0))); -equation - connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,70},{-10,70}, - {-10,43}})); - connect(SourceP1.C, perteDP2.C1) annotation (Line(points={{-80,30},{-60,30}}, - color={0,0,255})); - connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-40,30},{-30, - 30},{-30,30},{-20,30}}, color={0,0,255})); - connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{0,30},{20,30}}, - color={0,0,255})); - connect(perteDP1.C2, PuitsP1.C) annotation (Line(points={{40,30},{60,30}}, - color={0,0,255})); - annotation (experiment(StopTime=100), - Window( - x=0.45, - y=0.01, - width=0.35, - height=0.49), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestIdealSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo deleted file mode 100644 index cb736e23..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo +++ /dev/null @@ -1,113 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestInternalCombustionEngine - import ThermoSysPro; - - parameter Integer NCEL = 7; - - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( - Hum=0, - Xh=0.25, - Xs=0, - Xashes=0, - Xc=0.75, - Xo=0, - Xn=0, - Q0=0.0676, - rho=0.744, - LHV=50e6, - T0(displayUnit="K") = 299, - P0=210300, - Vol=100) annotation (Placement(transformation(extent={{-106,-81},{-72,-43}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( - Xso2=0, - Xco2=0, - Xh2o=0.005, - Xo2=0.23, - Q0=1.9627, - T0=30 + 273.16, - option_temperature=true, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=191000) - annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature=true) - annotation (Placement(transformation( - extent={{0,44},{44,86}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water( - Q0=15.3, - h0=334.41e3, - P0=410000) - annotation (Placement(transformation(extent={{-107,-19},{-71,15}},rotation= - 0))); - ThermoSysPro.Fluid.Machines.InternalCombustionEngine alternatingEngine( - mechanical_efficiency_type=2, - Rmeca_nom=0.41, - Coef_Rm_a=-5.4727e-9, - Coef_Rm_b=4.9359e-5, - Coef_Rm_c=0.30814, - Xpth=0.05, - MMg=20, - DPe=1, - RV=6.45, - Kc=1.28, - Kd=1.33, - Wmeca(start=1400e3), - Welec(start=1358e3), - Wcomb(start=3.4942e6), - exc(start=1.8), - Gamma=1.2085, - Tsf(start=1088.15)) - annotation (Placement(transformation(extent={{-44,-46},{44,42}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Sink_Water1 annotation (Placement( - transformation(extent={{75,-19},{111,15}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss - annotation (Placement(transformation(extent={{-63,-8},{-51,4}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 - annotation (Placement(transformation(extent={{51,-9},{65,5}}))); -equation - connect(alternatingEngine.Cair, sourceAir.C) annotation (Line( - points={{0,-41.6},{0,-62},{73,-62}}, - color={0,0,0}, - thickness=1)); - connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation (Line(points={{-30.8, - -41.6},{-30.8,-62},{-72,-62}}, color={0,0,0})); - connect(SourcePQ_Water.C, singularPressureLoss.C1) - annotation (Line(points={{-71,-2},{-63,-2}}, - color={0,0,255})); - connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation (Line( - points={{-39.6,-2},{-51,-2}}, color={0,0,255})); - connect(alternatingEngine.Cws2, singularPressureLoss1.C1) - annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255})); - connect(Sink_Water1.C, singularPressureLoss1.C2) - annotation (Line(points={{75,-2},{75,-2},{65,-2}}, color={0,0,255})); - connect(alternatingEngine.Cfg, sink.C) annotation (Line( - points={{0,37.6},{0,65},{0,65}}, - color={0,0,0}, - thickness=1)); - annotation ( Documentation(revisions=" -

Author

- -", info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})})); -end TestInternalCombustionEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo deleted file mode 100644 index f889cea8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo +++ /dev/null @@ -1,38 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestInvSingularPressureLoss - - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ - annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkQ - annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss - invSingularPressureLoss annotation (Placement(transformation(extent={{-20,0}, - {0,20}}, rotation=0))); -equation - connect(sourcePQ.C, invSingularPressureLoss.C1) annotation (Line(points={{-60, - 10},{-20,10}}, color={0,0,255})); - connect(invSingularPressureLoss.C2, sinkQ.C) annotation (Line(points={{0,10}, - {40,10}}, color={0,0,255})); -annotation(experiment(StopTime=1000), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestInvSingularPressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo deleted file mode 100644 index 987f9475..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo +++ /dev/null @@ -1,115 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestJunctions1 - - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2 - annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=200) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss annotation (Placement(transformation(extent={{-60,40}, - {-40,60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP - annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 - annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{40,80}, - {60,100}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2 annotation (Placement(transformation(extent={{40,0},{ - 60,20}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k= - 0.5) annotation (Placement(transformation(extent={{-40,60},{-20,80}}, - rotation=0))); - ThermoSysPro.Fluid.Junctions.Splitter3 splitter3 - annotation (Placement(transformation(extent={{-20,-60},{0,-40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0=400) - annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3 annotation (Placement(transformation(extent={{-60,-60}, - {-40,-40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 - annotation (Placement(transformation(extent={{80,-20},{100,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3 - annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4 annotation (Placement(transformation(extent={{40,-20}, - {60,0}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5 annotation (Placement(transformation(extent={{40,-100}, - {60,-80}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k= - 0) annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4 - annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation= - 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k= - 0) annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss6 annotation (Placement(transformation(extent={{40,-60}, - {60,-40}}, - rotation=0))); -equation - connect(sourceP.C, singularPressureLoss.C1) - annotation (Line(points={{-80,50},{-60,50}}, color={0,0,255})); - connect(singularPressureLoss.C2, splitter2.Ce) - annotation (Line(points={{-40,50},{-20,50}}, color={0,0,255})); - connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6, - 60},{-6,90},{40,90}}, color={0,0,255})); - connect(singularPressureLoss1.C2, sinkP.C) - annotation (Line(points={{60,90},{80,90}}, color={0,0,255})); - connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6, - 40},{-6,10},{40,10}}, color={0,0,255})); - connect(singularPressureLoss2.C2, sinkP1.C) - annotation (Line(points={{60,10},{80,10}}, color={0,0,255})); - connect(constante.y, splitter2.Ialpha1) - annotation (Line(points={{-19,70},{-14,70},{-14,56},{-9,56}})); - connect(sourceP1.C, singularPressureLoss3.C1) - annotation (Line(points={{-80,-50},{-60,-50}}, color={0,0,255})); - connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-40, - -50},{-19.8,-50}}, color={0,0,255})); - connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-6, - -40},{-6,-10},{40,-10}}, color={0,0,255})); - connect(singularPressureLoss4.C2, sinkP2.C) - annotation (Line(points={{60,-10},{80,-10}}, color={0,0,255})); - connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-6, - -60},{-6,-90},{40,-90}}, color={0,0,255})); - connect(singularPressureLoss5.C2, sinkP3.C) - annotation (Line(points={{60,-90},{80,-90}}, color={0,0,255})); - connect(constante1.y, splitter3.Ialpha1) - annotation (Line(points={{-19,-30},{-14,-30},{-14,-44},{-9,-44}})); - connect(splitter3.Ialpha2, constante2.y) - annotation (Line(points={{-9,-56},{-14,-56},{-14,-70},{-19,-70}})); - connect(splitter3.Cs3, singularPressureLoss6.C1) - annotation (Line(points={{0,-50},{40,-50}}, color={0,0,0})); - connect(singularPressureLoss6.C2, sinkP4.C) - annotation (Line(points={{60,-50},{80,-50}}, color={0,0,0})); - annotation (experiment(StopTime=10), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestJunctions1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo deleted file mode 100644 index c7162a60..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo +++ /dev/null @@ -1,131 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestJunctions2 - - ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1 - annotation (Placement(transformation(extent={{0,60},{20,80}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss annotation (Placement(transformation(extent={{40,60},{ - 60,80}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{-40,80}, - {-20,100}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2 annotation (Placement(transformation(extent={{-40,40}, - {-20,60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP - annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 - annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP - annotation (Placement(transformation(extent={{80,60},{100,80}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) - annotation (Placement(transformation(extent={{-40,60},{-20,80}}, - rotation=0))); - ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2 - annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3 annotation (Placement(transformation(extent={{40,-60}, - {60,-40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4 annotation (Placement(transformation(extent={{-40,-40}, - {-20,-20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5 annotation (Placement(transformation(extent={{-40,-80}, - {-20,-60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2 - annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 - annotation (Placement(transformation(extent={{-80,-80},{-60,-60}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1 - annotation (Placement(transformation(extent={{80,-60},{100,-40}}, rotation= - 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k= - 0.5) annotation (Placement(transformation(extent={{-40,-20},{-20,0}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ - annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss6 annotation (Placement(transformation(extent={{-40,-60}, - {-20,-40}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha= - 2) annotation (Placement(transformation(extent={{0,20},{20,40}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ1 - annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss7 annotation (Placement(transformation(extent={{-40,20}, - {-20,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss8 annotation (Placement(transformation(extent={{40,20}, - {60,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2 - annotation (Placement(transformation(extent={{80,20},{100,40}}, rotation=0))); -equation - connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-20, - 90},{6,90},{6,80}}, color={0,0,255})); - connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-20, - 50},{6,50},{6,60}}, color={0,0,255})); - connect(mixer2_1.Cs, singularPressureLoss.C1) - annotation (Line(points={{20,70},{40,70}}, color={0,0,255})); - connect(sourceP.C, singularPressureLoss1.C1) - annotation (Line(points={{-60,90},{-40,90}}, color={0,0,255})); - connect(sourceP1.C, singularPressureLoss2.C1) - annotation (Line(points={{-60,50},{-40,50}}, color={0,0,255})); - connect(singularPressureLoss.C2, sinkP.C) - annotation (Line(points={{60,70},{80,70}}, color={0,0,255})); - connect(constante.y, mixer2_1.Ialpha1) - annotation (Line(points={{-19,70},{-8,70},{-8,76},{3,76}})); - connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-20, - -30},{6,-30},{6,-40}}, color={0,0,255})); - connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation (Line(points={{-20, - -70},{6,-70},{6,-60}}, color={0,0,255})); - connect(mixer2_2.Cs, singularPressureLoss3.C1) - annotation (Line(points={{20,-50},{40,-50}}, color={0,0,255})); - connect(sourceP2.C, singularPressureLoss4.C1) - annotation (Line(points={{-60,-30},{-40,-30}}, color={0,0,255})); - connect(sourceP3.C, singularPressureLoss5.C1) - annotation (Line(points={{-60,-70},{-40,-70}}, color={0,0,255})); - connect(singularPressureLoss3.C2, sinkP1.C) - annotation (Line(points={{60,-50},{80,-50}}, color={0,0,255})); - connect(sourceQ.C, singularPressureLoss6.C1) - annotation (Line(points={{-60,-50},{-40,-50}}, color={0,0,255})); - connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation (Line(points={{-20,-50}, - {-10,-50},{0,-50}}, color={0,0,255})); - connect(constante1.y, mixer2_2.Ialpha1) - annotation (Line(points={{-19,-10},{-8,-10},{-8,-44},{3,-44}})); - connect(sourceQ1.C, singularPressureLoss7.C1) - annotation (Line(points={{-60,30},{-40,30}}, color={0,0,255})); - connect(singularPressureLoss7.C2, massFlowMultiplier.Ce) - annotation (Line(points={{-20,30},{0,30}}, color={0,0,255})); - connect(massFlowMultiplier.Cs, singularPressureLoss8.C1) - annotation (Line(points={{20,30},{40,30}}, color={0,0,255})); - connect(singularPressureLoss8.C2, sinkP2.C) - annotation (Line(points={{60,30},{80,30}}, color={0,0,255})); - annotation (experiment(StopTime=10), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestJunctions2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo deleted file mode 100644 index 7bb8c86c..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo +++ /dev/null @@ -1,121 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestJunctions3 - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation( - extent={{-104,0},{-84,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( P0=2e5, Q(start= - 323.48244470861454)) - annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( - C2(h_vol_1(start=70977.89042837733)), - Pm(start=120690.8728732298), - C1( - h_vol_1(start=71016.12237181116), - Xco2(start=4.2755644765396636E-32), - Xso2(start=2.0610804919205873E-32), - h_vol_2(start=70977.89042837733), - Xh2o(start=1.4925957069001078E-32), - Xo2(start=1.8180778675015506E-31))) - annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve valve2(C1(h_vol_1(start= - 70921.01678153824), - Xco2(start=7.395570986446986E-32), - Xh2o(start=1.9721522630525295E-31), - Xo2(start=1.9721522630525295E-31), - Xso2(start=6.998299036616324E-32)), - Pm(start=118970.64778985853)) - annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve valve3(Q(start= - 804.6933031325926), Pm(start=108776.21727782265), - C1( - Xco2(start=3.4137108264263755E-31), - Xo2(start=1.9413373839423337E-31), - Xso2(start=1.7792131856876708E-31), - Xh2o(start=2.3303752327085554E-31))) - annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2 - annotation (Placement(transformation( - extent={{82,-30},{102,-10}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2( - Duration=1, - Initialvalue=1, - Finalvalue=0.05) - annotation (Placement(transformation(extent={{32,20},{52,40}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3( - Initialvalue=1, - Starttime=2, - Finalvalue=0.001) - annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4( - Initialvalue=1, - Starttime=1, - Finalvalue=0.001) - annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe1 - annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe2 - annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation= - 0))); - ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume - annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1 - annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2 - annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation= - 0))); -equation - connect(valve3.C2, puitsP2.C) annotation (Line(points={{70,-20},{82, - -20}}, color={0,0,255})); - connect(rampe2.y, valve3.Ouv) - annotation (Line(points={{53,30},{60,30},{60,-3}})); - connect(rampe3.y, valve1.Ouv) annotation (Line(points={{-9,40},{0,40}, - {0,27}})); - connect(rampe4.y, valve2.Ouv) annotation (Line(points={{-9,-20},{0, - -20},{0,-33}})); - connect(sourceP.C, pipe1.C1) - annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255})); - connect(sourceP1.C, pipe2.C1) - annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255})); - connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10}, - {-50,14},{-40.2,14}}, color={0,0,255})); - connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}}, - color={0,0,255})); - connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50, - -20}}, color={0,0,255})); - connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10}, - {33,-9.8}}, color={0,0,255})); - connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33, - -50},{33,-29.9}}, color={0,0,255})); - connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50, - -50},{-50,-46},{-40.2,-46}}, color={0,0,255})); - connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10, - -50}}, color={0,0,255})); - annotation (experiment(StopTime=10), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestJunctions3; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo deleted file mode 100644 index 510707f9..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo +++ /dev/null @@ -1,59 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestJunctions4 - - ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(Tmax=308) - annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss annotation (Placement(transformation(extent={{-60,20}, - {-40,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{20,20}, - {40,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2 annotation (Placement(transformation(extent={{-60,-20}, - {-40,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP - annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(T0=310) - annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.Source source(h0=30000) - annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation= - 0))); -equation - connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points= - {{-40,30},{-30,30},{-30,36},{-20,36}}, color={0,0,255})); - connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line( - points={{0,36},{10,36},{10,30},{20,30}}, color={0,0,255})); - connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line( - points={{-40,-10},{-9.9,-10},{-9.9,20}}, color={0,0,255})); - connect(singularPressureLoss1.C2, sinkP.C) - annotation (Line(points={{40,30},{60,30}}, color={0,0,255})); - connect(sourceP.C, singularPressureLoss.C1) - annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255})); - connect(source.C, singularPressureLoss2.C1) - annotation (Line(points={{-80,-10},{-60,-10}}, color={0,0,255})); - annotation (experiment(StopTime=10), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestJunctions4; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo deleted file mode 100644 index 813d3b01..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo +++ /dev/null @@ -1,73 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestLoopBreaker - - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ - annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 - annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 - annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1 annotation (Placement( - transformation(extent={{-56,0},{-36,20}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1 annotation (Placement(transformation( - extent={{40,0},{60,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation( - extent={{80,0},{100,20}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) - annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP - annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); -equation - connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( - points={{-80,10},{-56,10}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line( - points={{-42,20},{-42,30},{-20,30}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line( - points={{-42,0},{-42,-10},{-20,-10}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(mixer2_1.Ce1, singularPressureLoss1.C2) - annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None)); - connect(mixer2_1.Cs, sink.C) annotation (Line( - points={{60,10},{80,10}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(constante.y, splitter2_1.Ialpha1) - annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth= - Smooth.None)); - connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line( - points={{0,-10},{10,-10}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line( - points={{30,-10},{46,-10},{46,0}}, - color={0,0,255}, - smooth=Smooth.None)); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestLoopBreaker; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo deleted file mode 100644 index 8a7fd8ea..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo +++ /dev/null @@ -1,47 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestMassFlowMultiplier - - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ - annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink - annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss annotation (Placement(transformation(extent={{-60,0},{ - -40,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{20,0},{ - 40,20}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier - annotation (Placement(transformation(extent={{-20,0},{0,20}}, rotation=0))); -equation - connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-80,10}, - {-60,10}}, color={0,0,255})); - connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{40,10},{ - 60,10}}, color={0,0,255})); - connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line( - points={{-40,10},{-20,10}}, color={0,0,255})); - connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line( - points={{0,10},{20,10}}, color={0,0,255})); -annotation(experiment(StopTime=1000), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestMassFlowMultiplier; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo deleted file mode 100644 index e2232d2f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo +++ /dev/null @@ -1,105 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestNTUWaterHeater0 - - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_condenseur( - P0=80.0e5, - Q0=1780, - h0=872.0e3) - annotation (Placement(transformation(extent={{-182,-10},{-162,10}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur(C(h(start= - 980281.0129225359))) - annotation (Placement(transformation(extent={{152,-10},{172,10}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - P0=27.e5, - h0=2.6e6, - C(h_vol_2(start=883556.9736276601)), - Q(start=112.29047515166533)) - annotation (Placement(transformation(extent={{-182,90},{-162,110}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2(K=1e-4, C2(P(start=7999999.633732218))) - annotation (Placement(transformation(extent={{-106, - -10},{-86,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=1e-4) - annotation (Placement(transformation(extent={{-106,90}, - {-86,110}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 - annotation (Placement(transformation(extent={{152,-106},{172,-86}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4(K=1e-4, - C1(P(start=7618062.482445708)), - rho(start=834.862478836879)) - annotation (Placement(transformation(extent={{92,-10}, - {112,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5(K=1e-4, rho(start=857.3159873035071)) - annotation (Placement(transformation(extent={{34,-106}, - {54,-86}}, rotation=0))); - - ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating( - lambdaE=102.5, - SCondDes=6314, - KCond=5024, - SPurge=656, - KPurge=1767, - HeiF(start=878162.3337936474), - HDesF(start=980281.0129225359), - Hep(start=981240.7187349163), - Ee(h_vol_2(start=880000), Q(start=1800), h(start=880000), P(start=80e5)), - Ev(h_vol_1(start=3500000), P(start=27e5)), - Ep(Q(start=10)), - Se(P(start=80e5)), - SDes(start=1E-09), - continuous_flow_reversal=true) - annotation (Placement(transformation(extent={{-44,-52}, - {64,54}}, rotation=0))); -equation - connect(Source_condenseur.C, singularPressureLoss2.C1) - annotation (Line(points={{-162,0},{-106,0}}, color={0,0,255})); - connect(sourceP.C, singularPressureLoss3.C1) - annotation (Line(points={{-162,100},{-106,100}}, - color={0,0,255})); - connect(singularPressureLoss4.C2, Puit_condenseur.C) - annotation (Line(points={{112,0},{152,0}}, color={0,0,255})); - connect(singularPressureLoss5.C2, Puit_condenseur1.C) - annotation (Line(points={{54,-96},{152,-96}}, color={0,0,255})); - connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation (Line(points={{-86,100}, - {42.4,100},{42.4,19.02}}, color={0,0,255})); - connect(nTUWaterHeating.Se, singularPressureLoss4.C1) - annotation (Line(points={{64,1},{68,1},{68,0},{92,0}}, - color={0,0,255})); - connect(singularPressureLoss2.C2, nTUWaterHeating.Ee) - annotation (Line(points={{-86,0},{-44,0},{-44,1}}, - color={0,0,255})); - connect(singularPressureLoss5.C1, nTUWaterHeating.Sp) - annotation (Line(points={{34,-96},{-18,-96},{-18,-16.49},{-22.4,-16.49}})); - annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200, - -200},{200,200}})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestNTUWaterHeater0; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo deleted file mode 100644 index 7eb31034..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo +++ /dev/null @@ -1,93 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestPostCombustionGas - import ThermoSysPro; - - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 - annotation (Placement(transformation( - origin={151,-6}, - extent={{23,-24},{-23,24}}, - rotation=180))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2( - Xso2=0, - Xco2=0.0, - Xo2=0.23, - Xh2o=0.01, - P0=15e5, - Q0=415, - T0=680, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=true) - annotation (Placement(transformation(extent={{-174,-30},{-128,18}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePQ2( - h0=300e3, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - Q0=10) - annotation (Placement(transformation(extent={{-172,68},{-132,108}}, - rotation=0))); - - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2( - Hum=0, - Xo=0, - Xn=0, - Xs=0, - rho=0.838, - Xc=0.755, - Xh=0.245, - Cp=2255, - T0=410, - Q0=9.30, - LHV=47500e3) annotation (Placement(transformation(extent={{-107,-109},{-71, - -73}}, - rotation=0))); - - ThermoSysPro.Fluid.Combustion.CombustionChambers.PostCombustionGas - postCombustionGas - annotation (Placement(transformation(extent={{-52,-74},{74,50}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss - annotation (Placement(transformation(extent={{-100,78},{-80,98}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 - annotation (Placement(transformation(extent={{-102,-16},{-82,4}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 - annotation (Placement(transformation(extent={{90,-16},{110,4}}))); -equation - connect(sourceCombustible2.C, postCombustionGas.Cfuel) annotation (Line( - points={{-71,-91},{-7.9,-91},{-7.9,-67.8}}, color={0,0,0})); - connect(sourcePQ2.C, singularPressureLoss.C1) - annotation (Line(points={{-132,88},{-100,88}}, color={0,0,0})); - connect(singularPressureLoss.C2, postCombustionGas.Ca) annotation (Line( - points={{-80,88},{-20.5,88},{-20.5,43.8}}, color={0,0,0})); - connect(Source_Fumees2.C, singularPressureLoss1.C1) - annotation (Line(points={{-128,-6},{-102,-6}}, color={0,0,0})); - connect(singularPressureLoss1.C2, postCombustionGas.Cfg1) annotation (Line( - points={{-82,-6},{-64,-6},{-64,-5.8},{-45.7,-5.8}}, color={0,0,0})); - connect(postCombustionGas.Cfg2, singularPressureLoss2.C1) annotation (Line( - points={{67.7,-5.8},{79.85,-5.8},{79.85,-6},{90,-6}}, color={0,0,0})); - connect(singularPressureLoss2.C2, Puits_Fumees2.C) - annotation (Line(points={{110,-6},{128,-6}}, color={0,0,0})); - annotation (Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-200},{200,200}}, - initialScale=0.1)), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestPostCombustionGas; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo deleted file mode 100644 index b4b47281..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo +++ /dev/null @@ -1,149 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestPressurizer - - parameter Units.SI.Power Wch(fixed=false) = 0.29e6 - "Power released by the electrical heaters"; - parameter Real OUVfeedwaterValve( fixed=false)=0.01 - "OUV feed water valve"; - - ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve( - Cv(start=100), - C1( - P(start=160e5), - h_vol_1(start=1270e3), - Q(start=0.3), - h(start=1270e3)), - Q(fixed=false, start=0.32), - Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{ - -90,150}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( - Cv(start=25000), - Cvmax(fixed=true) = 5000, - Pm(start=15500000)) - annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k= - OUVfeedwaterValve) - annotation (Placement(transformation(extent={{-140,176},{-120,196}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( - L=1, - D=1, - z1=1, - z2=0, - C1(P(start=160e5)), - C2(P(start=160e5)), - Q(fixed=false, start=0)) - annotation (Placement(transformation( - origin={-30,-42}, - extent={{10,-10},{-10,10}}, - rotation=90))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed= - true) = 0.5) annotation (Placement(transformation(extent={{0,176},{20, - 196}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - h0=1270e3, - P0=160e5) - annotation (Placement(transformation(extent={{-168,124},{-148,144}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6) - annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation= - 0))); - ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( - Zm=10.15, - Klv=0.5e6, - cpp=600, - hl(start=1629887.98290107), - hv(start=2596216.59571565), - Zl(start=5.5900717167325), - Yw0=60, - V=61.12, - Rp=1.27, - Ae=96.23, - Klp=1780, - Kvp=7500, - Mp=107e3, - Kpa=5.63, - Ccond=0.02, - Cevap=0.05, - Yw(start=32.92), - y(start=0.3292, fixed=true), - P0=15500000, - P(start=15500000, fixed=true), - Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92, - -12},{32,118}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( Q0=0, h0=1600000) - annotation (Placement(transformation(extent={{-30,-76},{-10,-56}}, - rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1( - option_temperature=2, - T0={310}, - W0={Wch}) - annotation (Placement(transformation( - origin={-133,32}, - extent={{-17,17},{17,-17}}, - rotation=270))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2( - T0={310}, - W0={0.286e6}, - option_temperature=1) - annotation (Placement(transformation( - origin={-133,55}, - extent={{-17,17},{17,-17}}, - rotation=270))); -equation - connect(sourceP.C, FeedwaterValve.C1) annotation (Line(points={{-148,134},{ - -110,134}}, color={0,0,255})); - connect(SteamValve.C2, sinkQ.C) annotation (Line(points={{78,134},{106,134}}, - color={0,0,255})); - connect(OuvSteamrValve.y, SteamValve.Ouv) - annotation (Line(points={{21,186},{68,186},{68,151}})); - connect(FeedwaterValve.C2, pressurizer.Cas) annotation (Line(points={{-90,134}, - {-30,134},{-30,118}}, color={0,0,255})); - connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{32,116.7},{ - 32,134},{58,134}}, color={0,0,255})); - connect(sinkQ1.C, lumpedStraightPipe.C2) - annotation (Line(points={{-30,-66},{-30,-52}})); - connect(lumpedStraightPipe.C1, pressurizer.Cex) - annotation (Line(points={{-30,-32},{-30,-12}})); - connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-116.34,55}, - {-103.17,55},{-103.17,54.3},{-85.8,54.3}}, color={191,95,0})); - connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-116.34,32}, - {-73.17,32},{-73.17,32.2},{-30,32.2}}, color={191,95,0})); - connect(OuvFeedwaterValve1.y, FeedwaterValve.Ouv) annotation (Line(points={{ - -119,186},{-100,186},{-100,151}}, color={0,0,255})); - annotation ( - Window( - x=0.43, - y=0, - width=0.57, - height=0.63), - Diagram(graphics, - coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-100},{140,200}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - experiment(StopTime=1000)); -end TestPressurizer; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo deleted file mode 100644 index fe67477b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo +++ /dev/null @@ -1,62 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestRefP - - ThermoSysPro.Fluid.BoundaryConditions.RefP refP - annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante( - k=2.e5) - annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation= - 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump - annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ - annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH - annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.RefT refT - annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe - annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0))); - Volumes.VolumeA volumeA(dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); -equation - connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color= - {0,0,255})); - connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color= - {0,0,255})); - connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60, - 70},{-60,34},{-80,34},{-80,21}})); - connect(pump.C2, loopBreakerQ.C1) - annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); - connect(loopBreakerQ.C2, loopBreakerH.C1) - annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); - connect(loopBreakerH.C2, lumpedStraightPipe.C1) - annotation (Line(points={{50,10},{60,10}}, color={0,0,255})); - connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{80,10}, - {100,10},{100,-20},{10,-20}}, color={0,0,0})); - connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{ - -100,10},{-90,10}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestRefP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo deleted file mode 100644 index 7a704094..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo +++ /dev/null @@ -1,56 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestRefP1 - - ThermoSysPro.Fluid.BoundaryConditions.RefP refP - annotation (Placement(transformation(extent={{-70,0},{-50,20}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante( - k=2.e5) - annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation= - 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump - annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe - annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); - BoundaryConditions.Source source - annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); - BoundaryConditions.Sink sink - annotation (Placement(transformation(extent={{80,0},{100,20}}))); - BoundaryConditions.RefQ refQ - annotation (Placement(transformation(extent={{-40,0},{-20,20}}))); -equation - connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60, - 70},{-60,21}})); - connect(source.C, refP.C1) - annotation (Line(points={{-80,10},{-70,10}}, color={0,0,0})); - connect(lumpedStraightPipe.C2, sink.C) - annotation (Line(points={{60,10},{80,10}}, color={0,0,0})); - connect(pump.C2, lumpedStraightPipe.C1) - annotation (Line(points={{20,10},{40,10}}, color={0,0,0})); - connect(refP.C2, refQ.C1) - annotation (Line(points={{-50,10},{-40,10}}, color={0,0,0})); - connect(pump.C1, refQ.C2) - annotation (Line(points={{0,10},{-20,10}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestRefP1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo deleted file mode 100644 index 520cba18..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo +++ /dev/null @@ -1,61 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSensors - - ThermoSysPro.Fluid.Sensors.SensorH specificEnthalpySensor - annotation (Placement(transformation(extent={{-60,8},{-40,28}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorQ massFlowSensor - annotation (Placement(transformation(extent={{-20,8},{0,28}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorQv volumetricFlowSensor - annotation (Placement(transformation(extent={{20,8},{40,28}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorP pressureSensor - annotation (Placement(transformation(extent={{-60,-32},{-40,-12}}, rotation= - 0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor - annotation (Placement(transformation(extent={{-20,-32},{0,-12}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP - annotation (Placement(transformation( - extent={{60,-40},{80,-20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation( - extent={{-100,0},{-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP - annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0))); -equation - connect(sourceP.C, specificEnthalpySensor.C1) - annotation (Line(points={{-80,10},{-60,10}}, color={0,0,255})); - connect(specificEnthalpySensor.C2, massFlowSensor.C1) - annotation (Line(points={{-39.8,10},{-20,10}}, color={0,0,255})); - connect(massFlowSensor.C2, volumetricFlowSensor.C1) - annotation (Line(points={{0.2,10},{20,10}}, color={0,0,255})); - connect(volumetricFlowSensor.C2, pressureSensor.C1) annotation (Line(points={ - {40.2,10},{60,10},{60,0},{-80,0},{-80,-30},{-60,-30}}, color={0,0,255})); - connect(pressureSensor.C2, temperatureSensor.C1) annotation (Line(points={{ - -39.8,-30},{-20,-30}}, color={0,0,255})); - connect(temperatureSensor.C2, perteDP.C1) - annotation (Line(points={{0.2,-30},{20,-30}}, color={0,0,255})); - connect(perteDP.C2, puitsP.C) - annotation (Line(points={{40,-30},{60,-30}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSensors; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo deleted file mode 100644 index c9877780..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo +++ /dev/null @@ -1,122 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSimpleDynamicCondenser - -parameter Real L1 = 425 "Longueur de la première chaine de capteurs"; -parameter Integer Ns1 = 80 - "Nombre de mailles de la première chaine de capteurs"; - -parameter Real L2 = 75 "Longueur de la deuxième chaine de capteurs"; -parameter Integer Ns2 = 1 "Nombre de mailles de la deuxième chaine de capteurs"; - - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( - P0=1e5, - option_temperature=false) annotation (Placement(transformation(extent={{48,30}, - {88,70}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe( K=1e-6, Q(start= - 0.598447), - C1(P(start=9035.18437098087)), - rho(start=990.6632738884383)) - annotation (Placement(transformation( - origin={-90,-38}, - extent={{-10,-10},{10,10}}, - rotation=180))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( - option_temperature=false, - h0=2401e3, - P0=15050) annotation (Placement(transformation(extent={{-207, - 148},{-183,170}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( - h0=191812, Q0(start=192, fixed=false)) - annotation (Placement(transformation(extent={{-184, - -52},{-208,-24}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3) - annotation (Placement(transformation(extent={{-212,30}, - {-172,68}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe1( K=1e-6, rho( - start=995.5397398431962)) - annotation (Placement(transformation( - origin={36,50}, - extent={{6,-10},{-6,10}}, - rotation=180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe2( K=1e-6, rho( - start=996.552939890412)) - annotation (Placement(transformation( - origin={-154,49}, - extent={{6,-10},{-6,10}}, - rotation=180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true)) - annotation (Placement(transformation( - origin={-120,159}, - extent={{10,-10},{-10,10}}, - rotation=180))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( D=0.018, - V=1000, - A=100, - lambda=0.01, - ntubes=28700, - yNiveau(signal(fixed=false, start=1.5)), - Vf0=0.15, - Vl(start=500, fixed=true), - P(fixed=false, start=9035.18437098087), - hl(start=183576.8570917718), - hv(start=187278.68509678004), - proe(d(start=996.0593559031695))) - annotation (Placement(transformation(extent={{-118,6},{1, - 116}}, rotation=0))); -equation - - connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line( - points={{-172,49},{-160,49}}, color={0,0,255})); - connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line( - points={{42,50},{48,50}}, color={0,0,255})); - connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line( - points={{-183,159},{-130,159}}, color={0,0,255})); - connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) - annotation (Line(points={{-184,-38},{-100,-38}})); - connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{ - -148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255})); - connect(PerteChargeCondPompe.C1, Condenseur.Cl) - annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}})); - connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{ - -110,159},{-58.5,159},{-58.5,116}}, color={0,0,255})); - connect(PerteChargeCondPompe1.C1, Condenseur.Cse) - annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}})); - annotation ( - Window( - x=0.43, - y=0, - width=0.57, - height=0.63), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-250,-60},{130,180}}, - grid={2,2}, - initialScale=0.1)), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - experiment(StopTime=1000)); -end TestSimpleDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo deleted file mode 100644 index 2a3bb2db..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo +++ /dev/null @@ -1,95 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSimpleDynamicCondenser1 - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start= - 355000.00000015664), Q(fixed = false), hn(fixed = false, start= - 71.08245675235786), p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"), - a1(start=-88.67, fixed=false), - C2(h(start=195297.69906611618), h_vol_1(start=195297.69906611618)), - Qv(start=0.009081311621074862), - h(start=193554.9971298399), - C1(P(start=10000.0))) annotation ( - Placement(visible = true, transformation(origin={-10,-60}, extent={{10,-10}, - {-10,10}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false), - xm(fixed=false, start=0.9856238368898451), - proe(x(start=1, fixed=true)), - Ce(h_vol_2(start=3128840.013040668), h(start=3128840.0130323363)), - pros(d(start=0.07018147245152216))) annotation ( - Placement(visible = true, transformation(origin={-10,60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 100, D = 0.018, - dynamic_energy_balance=true, - P(fixed=false, start=10000), - P0(displayUnit="Pa") = 1000, V = 1000, continuous_flow_reversal = true, lambda = 0.01, ntubes = 28700, rhol(displayUnit = "kg/m3"), rhom(displayUnit = "kg/m3"), rhov(displayUnit = "kg/m3"), yNiveau(signal(fixed = false, start = 1.5)), - steady_state=false, - proe(d(start=0.7468807684211932))) annotation ( - Placement(visible = true, transformation(origin={40.5,-1}, extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation ( - Placement(visible = true, transformation(origin={85,-1}, extent = {{-11, -12}, {11, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0 = 5, h0 = 113e3) annotation ( - Placement(visible = true, transformation(origin={-24,-1}, extent = {{-10, -9}, {10, 9}}, rotation = 0))); - Volumes.VolumeATh volumeA( - P(start=70e5), - h(start=2.e6), - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-70,10},{-50,-10}}))); - Thermal.BoundaryConditions.HeatSource heatSource(W0(start={2e6}, each fixed=false), - option_temperature=2) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-88,12}))); -equation - connect(Condenseur.Cv,stodolaTurbine. Cs) annotation ( - Line(points={{40.5,15},{40.5,60},{0.1,60}}, color = {0, 0, 255})); - connect(Condenseur.Cse,puitsPCaloporteur. C) annotation ( - Line(points={{61,-4.2},{62,-4.2},{62,-1},{74,-1}}, - color = {0, 0, 255})); - connect(sourcePCaloporteur.C,Condenseur. Cee) annotation ( - Line(points={{-14,-1},{-9,-1},{-9,-4.52},{20,-4.52}}, color = {0, 0, 255})); - connect(Condenseur.Cl, staticCentrifugalPump.C1) annotation (Line(points={{40.91, - -17},{40,-17},{40,-60},{0,-60}}, color={28,108,200})); - connect(staticCentrifugalPump.C2, volumeA.Ce2) - annotation (Line(points={{-20,-60},{-60,-60},{-60,-10}}, color={28,108,200})); - connect(volumeA.Cs2, stodolaTurbine.Ce) - annotation (Line(points={{-60,10},{-60,60},{-20.1,60}}, color={28,108,200})); - connect(heatSource.C[1], volumeA.Cth) annotation (Line(points={{-78.2,12},{-64, - 12},{-64,0},{-60,0}}, color={0,0,0})); - annotation ( Diagram(graphics={ - Text( - extent={{-94,34},{-64,24}}, - lineColor={28,108,200}, - textString="W: free"), - Text( - extent={{-26,-38},{8,-48}}, - lineColor={28,108,200}, - textString="a1: free"), - Text( - extent={{-28,94},{8,84}}, - lineColor={28,108,200}, - textString="Pe: fixed"), - Text( - extent={{-28,84},{10,72}}, - lineColor={28,108,200}, - textString="proe.x: fixed")}), Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - experiment(StopTime=1000, __Dymola_Algorithm="Dassl")); -end TestSimpleDynamicCondenser1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo deleted file mode 100644 index a2f4c5bf..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo +++ /dev/null @@ -1,71 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSimpleEvaporatorWaterSteamFlueGases - - ThermoSysPro.Fluid.BoundaryConditions.Sink puits_Eau - annotation (Placement(transformation( - extent={{64,-17},{84,3}}, rotation=0))); - - ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases - EchangeurEfficacite(Kdpf=1, Kdpe=1) - annotation (Placement(transformation(extent={{-44,-35},{44,21}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source_Eau( - Q0=38.92/3.6, - h0=1242080, - P0=6527000) - annotation (Placement(transformation(extent={{-84,-17},{-64,3}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees( - Xso2=0, - Q0=86.7429, - Xco2=0.04725, - Xh2o=0.051874, - Xo2=0.15011, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=101000, - T0=750.54, - option_temperature=true) - annotation (Placement(transformation(extent={{-34,45},{0,75}}, rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees - annotation (Placement(transformation( - origin={16,-70}, - extent={{16,-15},{-16,15}}, - rotation=180))); -equation - connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation (Line( - points={{0,60},{0,18.2}}, - color={0,0,0}, - thickness=1)); - connect(EchangeurEfficacite.Cfg2, Puits_Fumees.C) annotation (Line( - points={{0,-32.2},{0,-70},{0,-70}}, - color={0,0,0}, - thickness=1)); - connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation (Line(points={{44, - -7},{54,-7},{54,-7},{64,-7}}, color={0,0,255})); - connect(EchangeurEfficacite.Cws1, source_Eau.C) - annotation (Line(points={{-44,-7},{-54,-7},{-54,-7},{-64,-7}})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSimpleEvaporatorWaterSteamFlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo deleted file mode 100644 index ef928dcd..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo +++ /dev/null @@ -1,53 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSimpleStaticCondenser - - ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser - simpleStaticCondenser( - Ec(h(start=532983.7176868258)), - Ef(h(start=71016.12237181116)), - Qc(start=1049.6385508765125), - Qf(start=4469.84281279143), - Sf(h(start=64330.208038325145))) - annotation (Placement(transformation(extent={{-20,20}, - {0,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(T0=400) - annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP - annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 - annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); -equation - connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30}, - {-20,30}}, color={0,0,255})); - connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40, - -10},{-16,-10},{-16,20}}, color={0,0,255})); - connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9}, - {10,29.9},{10,30},{20,30}}, color={0,0,255})); - connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20}, - {-4,-10},{20,-10}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSimpleStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo deleted file mode 100644 index f24da7e9..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo +++ /dev/null @@ -1,51 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSingularPressureLoss - - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{60,20},{80,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss( fluid=1) - annotation (Placement(transformation( - extent={{-20,20},{0,40}}, rotation=0))); -equation - connect(singularPressureLoss.C2, PuitsP1.C) - annotation (Line(points={{0,30},{60,30}}, color={0,0,255})); - connect(SourceP1.C, singularPressureLoss.C1) - annotation (Line(points={{-80,30},{-20,30}}, color={0,0,255})); - annotation (experiment(StopTime=1000), - Window( - x=0.45, - y=0.01, - width=0.35, - height=0.49), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSingularPressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo deleted file mode 100644 index 079db785..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo +++ /dev/null @@ -1,97 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticAerocondenser - - parameter Units.SI.AbsolutePressure Pin_1=20000 - "Flow pressure at inlet 1 (sourceP)"; - parameter Units.SI.AbsolutePressure Pin_2=20000 - "Flow pressure at inlet 3 (sourceP2)"; - - BoundaryConditions.SourcePQ Source_condenseur( - Q0(fixed=true) = 4000, - h0=15e3, - option_temperature=true, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=100000, - T0=287.15) - annotation (Placement(transformation(extent={{190,-90},{170,-70}}, - rotation=0))); - - BoundaryConditions.Sink Puit_condenseur - annotation (Placement(transformation(extent={{170,90},{190,110}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - h0=2.5817e6, - C(Q(fixed=false, start=100)), - P0=Pin_1) - annotation (Placement(transformation(extent={{-100,90},{-80,110}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( - option_temperature=false, - h0=2.5055e6, - C(Q(fixed=false, start=1e-5)), - P0=Pin_2) annotation (Placement(transformation(extent={{-182, - -40},{-162,-20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1(K=10) - annotation (Placement(transformation(extent={{-120,-40}, - {-100,-20}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=10) - annotation (Placement(transformation(extent={{-38,90}, - {-18,110}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 - annotation (Placement(transformation(extent={{-100,-90},{-120,-70}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5(K=1e-4) - annotation (Placement(transformation(extent={{-40,-90}, - {-60,-70}},rotation=0))); - - Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser - annotation (Placement(transformation(extent={{-64,-44},{66,70}}))); -equation - connect(sourceP2.C, singularPressureLoss1.C1) - annotation (Line(points={{-162,-30},{-120,-30}}, - color={0,0,255})); - connect(sourceP.C, singularPressureLoss3.C1) - annotation (Line(points={{-80,100},{-38,100}}, color={0,0,255})); - connect(singularPressureLoss1.C2, staticAerocondenser.Cw) annotation (Line( - points={{-100,-30},{-70,-30},{-70,-29.75},{-58.5833,-29.75}},color={0,0, - 0})); - connect(singularPressureLoss3.C2, staticAerocondenser.Cws1) - annotation (Line(points={{-18,100},{1,100},{1,65.25}}, color={0,0,0})); - connect(Puit_condenseur1.C, singularPressureLoss5.C2) - annotation (Line(points={{-100,-80},{-60,-80}},color={0,0,0})); - connect(singularPressureLoss5.C1, staticAerocondenser.Cws2) - annotation (Line(points={{-40,-80},{1,-80},{1,-39.25}}, color={0,0,0})); - connect(Source_condenseur.C, staticAerocondenser.Cair1) annotation (Line( - points={{170,-80},{60.5833,-80},{60.5833,-38.775}}, color={0,0,0})); - connect(Puit_condenseur.C, staticAerocondenser.Cair2) annotation (Line(points={{170,100}, - {60.5833,100},{60.5833,65.25}}, color={0,0,0})); - annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200, - -200},{200,200}})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticAerocondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo deleted file mode 100644 index 7f098428..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo +++ /dev/null @@ -1,52 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticCentrifugalPump1 - - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1( - fixed_rot_or_power=2, MPower=0.15e6) - annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP - annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=600000) - annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0))); -equation - connect(sourceP.C, StaticCentrifugalPump1.C1) annotation (Line( - points={{-60,30},{-20,30}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(StaticCentrifugalPump1.C2, sinkP.C) annotation (Line( - points={{0,30},{40,30}}, - color={0,0,255}, - smooth=Smooth.None)); - annotation (experiment(StopTime=1000), - Window( - x=0.32, - y=0.02, - width=0.39, - height=0.47), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticCentrifugalPump1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo deleted file mode 100644 index 70340b52..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo +++ /dev/null @@ -1,123 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticCondenser - - parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) - "Flow pressure at inlet 1 (sourceP)"; - parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000) - "Flow pressure at inlet 2 (sourceP1)"; - parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) - "Flow pressure at inlet 3 (sourceP2)"; - - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur( - h0=60e3, Q0(fixed=true) = 4000) - annotation (Placement(transformation(extent={{-180,0},{-160,20}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur - annotation (Placement(transformation(extent={{160,0},{180,20}}, - rotation=0))); - ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur( - CPCE=0, - KCO=100, - QC0=200, - z=5, - SCO=15e3, - Qee(start=4000, fixed=false), - Pcond(fixed=false, start=2154.77)) annotation (Placement(transformation( - extent={{-20,-16},{72,82}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - h0=2.5817e6, - C(Q(fixed=true, start=100)), - P0=Pin_1) - annotation (Placement(transformation(extent={{-100,140},{-80,160}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - option_temperature=false, - h0=2.5481e6, - C(Q(fixed=true, start=1e-5)), - P0=Pin_2) annotation (Placement(transformation(extent={ - {-182,80},{-162,100}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( - option_temperature=false, - h0=2.5055e6, - C(Q(fixed=true, start=1e-5)), - P0=Pin_3) annotation (Placement(transformation(extent= - {{-180,40},{-160,60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss(K=10) - annotation (Placement(transformation(extent={{-100,80}, - {-80,100}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1(K=10) - annotation (Placement(transformation(extent={{-100,40}, - {-80,60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2(K=1e-4) - annotation (Placement(transformation(extent={{-100,0}, - {-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=10) - annotation (Placement(transformation(extent={{-40,140}, - {-20,160}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 - annotation (Placement(transformation(extent={{100,-100},{120,-80}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4(K=1e-4) - annotation (Placement(transformation(extent={{100,0}, - {120,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5(K=1e-4) - annotation (Placement(transformation(extent={{40,-100}, - {60,-80}}, rotation=0))); - -equation - connect(sourceP1.C, singularPressureLoss.C1) - annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255})); - connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{ - -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255})); - connect(sourceP2.C, singularPressureLoss1.C1) - annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255})); - connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{ - -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255})); - connect(Source_condenseur.C, singularPressureLoss2.C1) - annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255})); - connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{ - -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255})); - connect(sourceP.C, singularPressureLoss3.C1) - annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255})); - connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{ - -20,150},{26,150},{26,82.49}}, color={0,0,255})); - connect(singularPressureLoss4.C2, Puit_condenseur.C) - annotation (Line(points={{120,10},{160,10}}, color={0,0,255})); - connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{ - 72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255})); - connect(singularPressureLoss5.C2, Puit_condenseur1.C) - annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255})); - connect(singularPressureLoss5.C1, condenseur.Cex) - annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16}})); - annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200, - -200},{200,200}})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo deleted file mode 100644 index a2628b2f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo +++ /dev/null @@ -1,126 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticCondenserHEI - - parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start= - 179979.0023433965) "Flow pressure at inlet 1 (sourceP)"; - parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start= - 4691.365030963762) "Flow pressure at inlet 2 (sourceP1)"; - parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start= - 4691.365030911197) "Flow pressure at inlet 3 (sourceP2)"; - - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur( - h0=60e3, Q0(fixed=true) = 4000) - annotation (Placement(transformation(extent={{-180,0},{-160,20}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(C(h(start= - 121216.39257552983))) - annotation (Placement(transformation(extent={{160,0},{180,20}}, - rotation=0))); - ThermoSysPro.Fluid.HeatExchangers.StaticCondenserHEI condenseur( - Kf=0, - z1c=5, - Cee( - Q( start=4000, fixed=false)), - Pcond(fixed=false, start=2154.77), - DPf(start=-7.816453667652961E-26), - Wcut_off(start=116804805.25936648), - procs(d(start=9.50351941496327))) annotation (Placement(transformation( - extent={{-20,-16},{72,82}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - option_temperature=false, - h0=2.5817e6, - C(Q(fixed=true, start=100)), - P0=Pin_1) - annotation (Placement(transformation(extent={{-100,140},{-80,160}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - option_temperature=false, - h0=2.5481e6, - C(Q(fixed=true, start=1e-5)), - P0=Pin_2) annotation (Placement(transformation(extent={ - {-182,80},{-162,100}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( - option_temperature=false, - h0=2.5055e6, - C(Q(fixed=true, start=1e-5)), - P0=Pin_3) annotation (Placement(transformation(extent= - {{-180,40},{-160,60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss(K=10) - annotation (Placement(transformation(extent={{-100,80}, - {-80,100}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1(K=10) - annotation (Placement(transformation(extent={{-100,40}, - {-80,60}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2(K=1e-4, rho(start=999.2051327991054)) - annotation (Placement(transformation(extent={{-100,0}, - {-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=10) - annotation (Placement(transformation(extent={{-40,140}, - {-20,160}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 - annotation (Placement(transformation(extent={{100,-100},{120,-80}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4(K=1e-4, rho(start=995.9727926518547)) - annotation (Placement(transformation(extent={{100,0}, - {120,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5(K=1e-4, rho(start=9.502298036944223)) - annotation (Placement(transformation(extent={{40,-100}, - {60,-80}}, rotation=0))); - -equation - connect(sourceP1.C, singularPressureLoss.C1) - annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255})); - connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{ - -80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255})); - connect(sourceP2.C, singularPressureLoss1.C1) - annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255})); - connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{ - -80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255})); - connect(Source_condenseur.C, singularPressureLoss2.C1) - annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255})); - connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{ - -80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255})); - connect(sourceP.C, singularPressureLoss3.C1) - annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255})); - connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{ - -20,150},{26,150},{26,82.49}}, color={0,0,255})); - connect(singularPressureLoss4.C2, Puit_condenseur.C) - annotation (Line(points={{120,10},{160,10}}, color={0,0,255})); - connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{ - 72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255})); - connect(singularPressureLoss5.C2, Puit_condenseur1.C) - annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255})); - connect(singularPressureLoss5.C1, condenseur.Cex) - annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16}})); - annotation (experiment(StopTime=1000), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false, extent={{-200, - -200},{200,200}})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticCondenserHEI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo deleted file mode 100644 index b125b099..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo +++ /dev/null @@ -1,92 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticDrum1 - - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 - annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI1(K=1e-4) - annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI2(K=1e-4) - annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0=10) - annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT - annotation (Placement(transformation(extent={{40,-82},{60,-62}}, rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - option_temperature=2, - W0={2.4e8}, - T0={290}) annotation (Placement(transformation(extent={{-80,20},{-60,40}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI3(K=1e-4) - annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); - BoundaryConditions.PlugB sinkP2 - annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT1 - annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.RefP refP(P0=3e5) - annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=100) - annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation= - 0))); - BoundaryConditions.PlugA sourcePlug(C(h(fixed=true))) - annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation= - 0))); - BoundaryConditions.RefXgas refXgas - annotation (Placement(transformation(extent={{8,-90},{28,-70}}))); -equation - connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) - annotation (Line( - points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255})); - connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20, - 0},{40,0}}, color={0,0,255})); - connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{60.2, - -80},{80,-80},{80,-60},{-80,-60},{-80,-40}}, color={0,0,255})); - connect(heatSource.C[1], StaticDrumTh1.Cth) - annotation (Line(points={{-70,20.2},{ - -70,10},{-44,10}}, color={191,95,0})); - connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) - annotation (Line( - points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); - connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) - annotation (Line( - points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); - connect(singularPressureLossVALI3.C2, sensorT1.C1) - annotation (Line(points={{0,60},{20,60}}, color={0,0,255})); - connect(sensorT1.C2, sinkP2.C) - annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255})); - connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}}, - color={0,0,255})); - connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}}, - color={0,0,255})); - connect(refP.C2, refXgas.C1) - annotation (Line(points={{-6,-80},{8,-80}}, color={0,0,0})); - connect(refXgas.C2, sensorT.C1) - annotation (Line(points={{28,-80},{40,-80}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticDrum1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo deleted file mode 100644 index f235cd28..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo +++ /dev/null @@ -1,77 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticDrum2 - - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 - annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI1(K=1e-4) - annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI2(K=1e-4) - annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0=10) - annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT - annotation (Placement(transformation(extent={{-40,-82},{-20,-62}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(P0=100e5) - annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation= - 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource - annotation (Placement(transformation(extent= - {{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI3(K=1e-4) - annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 - annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT1 - annotation (Placement(transformation(extent={{20,58},{40,78}}, rotation=0))); -equation - connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) - annotation (Line( - points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255})); - connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20, - 0},{40,0}}, color={0,0,255})); - connect(sensorT.C2, singularPressureLossVALI2.C1) annotation (Line(points={{ - -19.8,-80},{-10,-80},{-10,-54},{-80,-54},{-80,-40}}, color={0,0,255})); - connect(sourcePQ.C, sensorT.C1) annotation (Line(points={{-70,-80},{-40,-80}}, - color={0,0,255})); - connect(heatSource.C[1], StaticDrumTh1.Cth) - annotation (Line(points={{-70,20.2},{ - -70,10},{-44,10}}, color={191,95,0})); - connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) - annotation (Line( - points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); - connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) - annotation (Line( - points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); - connect(singularPressureLossVALI3.C2, sensorT1.C1) - annotation (Line(points={{0,60},{20,60}}, color={0,0,255})); - connect(sensorT1.C2, sinkP2.C) - annotation (Line(points={{40.2,60},{60,60}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticDrum2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo deleted file mode 100644 index a60588e8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo +++ /dev/null @@ -1,63 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticExchangerDTorWorEff - - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF( - C(P(start=219.E5)), - Q0=481.07, - h0=1067.9E3) - annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF( - P0=217.68E5) - annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC( - C(P(start=24E5)), - Q0=23.377, - h0=3420.3E3) - annotation (Placement(transformation( - origin={-30,30}, - extent={{10,-10},{-10,10}}, - rotation=180))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC( - P0=24.13E5) - annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); - ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff - exchangerWaterSteamDTorWorEFF( - EffEch=1, - Kf=597.832, - Ec(P(start=23e5)), - Ef(P(start=219E5)), - exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20}, - {0,0}}, rotation=0))); -equation - connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef) - annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); - connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line( - points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); - connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line( - points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); - connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line( - points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticExchangerDTorWorEff; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo deleted file mode 100644 index a36c0d45..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo +++ /dev/null @@ -1,53 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticExchangerKS - - ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS - plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) - annotation (Placement(transformation(extent={{-20,34},{20,66}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( - T0=340) - annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 - annotation (Placement(transformation(extent={{-80,60},{-60,80}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2 - annotation (Placement(transformation( - extent={{60,20},{80,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 - annotation (Placement(transformation( - extent={{60,60},{80,80}}, rotation=0))); -equation - connect(sourceP2.C, plateHeatExchanger.Ec) - annotation (Line(points={{-60,30},{-40,30},{-40,45.2},{-20,45.2}}, - color={0,0,255})); - connect(sourceP3.C, plateHeatExchanger.Ef) annotation (Line(points={{-60,70}, - {-40,70},{-40,54.8},{-20,54.8}}, color={0,0,0})); - connect(plateHeatExchanger.Sc, puitsP2.C) annotation (Line(points={{20,45.2}, - {26,45.2},{26,46},{40,46},{40,30},{60,30}}, color={0,0,0})); - connect(plateHeatExchanger.Sf, puitsP3.C) annotation (Line(points={{20,54.8}, - {40,54.8},{40,70},{60,70}}, color={0,0,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticExchangerKS; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo deleted file mode 100644 index 23c3c502..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo +++ /dev/null @@ -1,223 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticFan - - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees( - Xso2=0, - Xco2=0.0, - Xh2o=0.006, - Xo2=0.23, - Q0=4, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - P0=130000, - T0=300, - option_temperature=true) - annotation (Placement(transformation(extent={{-210,-24},{-164,24}}, - rotation=0))); - - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees - annotation (Placement(transformation( - origin={182,0}, - extent={{10,-10},{-10,10}}, - rotation=180))); - ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger(ftype= - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - option_temperature=2, W0={1e4}) - annotation (Placement(transformation(extent={{-48, - 90},{-28,110}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossFlueGases( Q(fixed=false, start=10), K=10) - annotation (Placement(transformation(extent={ - {12,50},{32,70}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossFlueGases1( Q(fixed=false, start= - 11), K=0.01) annotation (Placement(transformation(extent={ - {-108,50},{-88,70}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe( - Starttime=50, - Duration=50, - Initialvalue=1e4, - Finalvalue=2e5) annotation (Placement(transformation(extent={{0,100},{-20, - 120}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticFan staticFan( - VRotn=2700, - rm=1, - a2=0, - b1=-1.315, - b2=2.4593, - VRot=2700, - a1=-263.145, - a3=500, - Q(start=2), - Qv(start=1.4), - rho(start=1.4)) - annotation (Placement(transformation(extent={{52,50},{72,70}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve - singularPressureLossFlueGases2( Q(fixed=false, start=10)) - annotation (Placement(transformation(extent={ - {92,50},{112,70}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger1(ftype= - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation= - 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( - option_temperature=2, W0={1e4}) - annotation (Placement(transformation(extent={{-48, - -90},{-28,-110}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossFlueGases3( Q(fixed=false, start=10), K=10) - annotation (Placement(transformation(extent={ - {12,-70},{32,-50}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossFlueGases4( Q(fixed=false, start= - 11), K=0.01) annotation (Placement(transformation(extent={ - {-108,-70},{-88,-50}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1( - Starttime=50, - Duration=50, - Initialvalue=1e4, - Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20, - -100}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticFan staticFan1( - VRotn=2700, - rm=1, - b2=2.4593, - b1=-1.315, - VRot=2700, - a1=-263.145, - a2=0, - a3=500, - Q(start=2), - Qv(start=1.4), - rho(start=1.4)) - annotation (Placement(transformation(extent={{52,-70},{72,-50}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve - singularPressureLossFlueGases5( Q(fixed=false, start=10)) - annotation (Placement(transformation(extent={ - {92,-70},{112,-50}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Mixer2 mixerFlueGases2_1(ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation= - 0))); - ThermoSysPro.Fluid.Volumes.VolumeDTh volume2S( - dynamic_composition_balance=true, ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-148,-10},{-128,10}}, - rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor - annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor1 - annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation= - 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin( - Starttime=50, - Duration=50, - Initialvalue=4, - Finalvalue=1) annotation (Placement(transformation(extent={{-200,40},{ - -180,60}}, rotation=0))); -equation - connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line( - points={{32,60},{52,60}}, - color={0,0,0}, - thickness=1)); - connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line( - points={{72,60},{91,60}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line( - points={{32,-60},{52,-60}}, - color={0,0,0}, - thickness=1)); - connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line( - points={{72,-60},{91,-60}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line( - points={{113,60},{138,60},{138,10}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line( - points={{113,-60},{138,-60},{138,-10}}, - color={0,0,0}, - thickness=1)); - connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line( - points={{-7.8,-60},{12,-60}}, - color={0,0,0}, - thickness=1)); - connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line( - points={{-7.8,60},{12,60}}, - color={0,0,0}, - thickness=1)); - connect(Source_Fumees.C, volume2S.Ce) annotation (Line( - points={{-164,0},{-148,0}}, - color={0,0,0}, - thickness=1)); - connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line( - points={{-138,10},{-138,60},{-108,60}}, - color={0,0,0}, - thickness=1)); - connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line( - points={{-138,-10},{-138,-60},{-108,-60}}, - color={0,0,0}, - thickness=1)); - connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38, - 90.2},{-58,60}}, color={191,95,0})); - connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{ - -38,-90.2},{-58,-60}}, color={191,95,0})); - connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line( - points={{152,0},{162,0},{162,-1.20011e-015},{172,-1.20011e-015}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (Line( - points={{-88,60},{-68,60}}, - color={0,0,0}, - thickness=1, - smooth=Smooth.None)); - connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line( - points={{-48,60},{-28,60}}, - color={0,0,0}, - thickness=1, - smooth=Smooth.None)); - connect(Qin.y, Source_Fumees.IMassFlow) - annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}})); - connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation ( - Line( - points={{-88,-60},{-68,-60}}, - color={0,0,0}, - thickness=1)); - connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation (Line( - points={{-48,-60},{-38,-60},{-28,-60}}, - color={0,0,0}, - thickness=1)); - connect(rampe.y, heatSource.ISignal) - annotation (Line(points={{-21,110},{-38,110},{-38,105}}, color={0,0,255})); - connect(rampe1.y, heatSource1.ISignal) annotation (Line(points={{-21,-110},{ - -38,-110},{-38,-105}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-150},{200,150}}, - initialScale=0.1)), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticFan; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo deleted file mode 100644 index 1deede17..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo +++ /dev/null @@ -1,55 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticPlateHeatExchanger - - ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger - plateHeatExchanger(region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) - annotation (Placement(transformation(extent={{-20,44},{0,64}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( - T0=340) - annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 - annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2 - annotation (Placement(transformation( - extent={{40,44},{60,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 - annotation (Placement(transformation( - extent={{20,24},{40,44}}, rotation=0))); -equation - connect(sourceP2.C, plateHeatExchanger.Ec) - annotation (Line(points={{-60,54},{-20,54}}, color={0,0,255})); - connect(sourceP3.C, plateHeatExchanger.Ef) - annotation (Line(points={{-40,34},{ - -15,34},{-15,48}}, color={0,0,255})); - connect(plateHeatExchanger.Sc, puitsP2.C) - annotation (Line(points={{0,54.2},{ - 20,54.2},{20,54},{40,54}}, color={0,0,255})); - connect(plateHeatExchanger.Sf, puitsP3.C) - annotation (Line(points={{-5,48},{-6, - 48},{-6,34},{20,34}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo deleted file mode 100644 index 8f971ba9..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo +++ /dev/null @@ -1,68 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStaticWallFlueGasesExchanger - - HeatExchangers.StaticWallFlueGasesExchanger - dynamicOnePhaseFlowPipe( - Q(start={536.5750641592207,536.5750641592207,536.5750641592207, - 536.5750641592207,536.5750641592207,536.5750641592207, - 536.5750641592207,536.5750641592207,536.5750641592207, - 536.5750641592207,536.5750641592207}), - h(start={71016.12237181116,74743.46665892199,78470.81094603281, - 82198.15523314364,85925.49952025448,89652.84380736532, - 93380.18809447614,97107.53238158698,100834.8766686978, - 104562.22095580865,108289.56524291947,70825.9016030344}), - p_rho=998, - P(start={300000,281833.41863537,263664.30473175,245492.47958308, - 227317.76827098,209139.99948382,190959.00534677,172774.621262, - 154586.68575823,136395.04034906,118199.5293995,100000})) - annotation (Placement(transformation(extent={{-20, - 20},{0,40}}, rotation=0))); - BoundaryConditions.SourcePQ sourceP( - option_temperature=true, - Q0=1, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - BoundaryConditions.Sink sinkP - annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - T0={273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,273 + 400,273 + 400, - 273 + 400,273 + 400,273 + 400}, - option_temperature=2, - W0={6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4,6e4}) - annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10, - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-20,40},{0,60}}, rotation=0))); -equation - connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-40, - 30},{-20,30}}, color={0,0,255})); - connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{0,30}, - {20,30}}, color={0,0,255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{-10, - 60.2},{-10,52}}, color={191,95,0})); - connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) - annotation (Line(points={{-10,48},{-10,33}}, color={191,95,0})); - annotation (experiment(StopTime=1000), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStaticWallFlueGasesExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo deleted file mode 100644 index 22da154a..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo +++ /dev/null @@ -1,62 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSteamDryer1 - - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer( - eta=1, - h(start=3e6), - P(start=10000000)) - annotation (Placement(transformation(extent={{-20,20},{0,40}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0=3000000) - annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20}, - {-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=100e5) - annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{20,20}, - {40,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=2.e-3) - annotation (Placement(transformation(extent={{0,-20}, - {20,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink - annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0))); -equation - connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-80,30}, - {-60,30}}, color={0,0,255})); - connect(singularPressureLoss1.C2,sinkP. C) - annotation (Line(points={{40,30},{60,30}}, color={0,0,255})); - connect(singularPressureLoss3.C2,sink. C) - annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255})); - connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{ - -40,30},{-30,30},{-30,34},{-19.9,34}}, color={0,0,255})); - connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{ - -0.1,34},{10,34},{10,30},{20,30}}, color={0,0,255})); - connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{ - -9.9,20},{-10,20},{-10,-10},{0,-10}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSteamDryer1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo deleted file mode 100644 index 00593ee7..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo +++ /dev/null @@ -1,62 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSteamDryer2 - - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta=0.9, P(start= - 10000000)) annotation (Placement(transformation(extent={{-10,-8},{10, - 12}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0= - 2400000) - annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4}, - {-30,16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP - annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4}, - {50,16}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=1.e-4) - annotation (Placement(transformation(extent={{30,-44}, - {50,-24}}, - rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink - annotation (Placement(transformation(extent={{70,-44},{90,-24}}, - rotation=0))); -equation - connect(sourceQ.C,singularPressureLoss2. C1) annotation (Line(points={{-70,6}, - {-50,6}}, color={0,0,255})); - connect(singularPressureLoss1.C2,sinkP. C) - annotation (Line(points={{50,6},{70,6}}, color={0,0,255})); - connect(singularPressureLoss3.C2,sink. C) - annotation (Line(points={{50,-34},{70,-34}}, color={0,0,255})); - connect(singularPressureLoss2.C2, steamDryer.Cev) annotation (Line(points={{-30,6}, - {-20,6},{-9.9,6}}, color={0,0,255})); - connect(steamDryer.Csv, singularPressureLoss1.C1) annotation (Line(points={{9.9,6}, - {20,6},{30,6}}, color={0,0,255})); - connect(steamDryer.Csl, singularPressureLoss3.C1) annotation (Line(points={{0.1,-8}, - {0,-8},{0,-34},{30,-34}}, color={0,0,255})); - annotation (experiment(StopTime=10), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSteamDryer2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo deleted file mode 100644 index 92d0af3c..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo +++ /dev/null @@ -1,51 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSteamEngine - - ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1 - annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=100000) - annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - h0=3.e6, - option_temperature=false, - P0=16e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, - rotation=0))); -equation - connect(sourceP.C, steamEngine1.C1) - annotation (Line(points={{-80,70},{-57,70}}, color={0,0,255})); - connect(steamEngine1.C2, puitsP.C) - annotation (Line(points={{-43,70},{-31.5,70},{-31.5,70},{-20,70}}, color={0, - 0,255})); - annotation (experiment(StopTime=1000), - Window( - x=0.32, - y=0.02, - width=0.39, - height=0.47), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSteamEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo deleted file mode 100644 index a80faebc..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo +++ /dev/null @@ -1,61 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSteamExtractionSplitter - - ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter - steamExtractionSplitter(alpha=0.9) - annotation (Placement(transformation(extent={{-20, - 20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0=2600000) - annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2 annotation (Placement(transformation(extent={{-60,20}, - {-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0=100e5) - annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{20,20}, - {40,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=2.e-3) - annotation (Placement(transformation(extent={{0,-20}, - {20,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(Q0=10) - annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0))); -equation - connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30}, - {-60,30}}, color={0,0,255})); - connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line( - points={{-40,30},{-20.3,30}}, color={0,0,255})); - connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line( - points={{0.3,30},{20,30}}, color={0,0,255})); - connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line( - points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255})); - connect(singularPressureLoss1.C2, sinkP.C) - annotation (Line(points={{40,30},{60,30}}, color={0,0,255})); - connect(singularPressureLoss3.C2, sink.C) - annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Diagram(graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSteamExtractionSplitter; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo deleted file mode 100644 index e1c0bdb3..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo +++ /dev/null @@ -1,92 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStodolaTurbine1 - parameter Units.SI.AbsolutePressure PoutPump(fixed=false, start=13e5) - "Flow pressure at the outlet of the pump"; - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(pros1(x(start= - 1)), Hrs(start=2931e3), - pros(d(start=19.715136086827403)), - Ce(h(start=3000000.0)), - proe(T(start=613.0), x(start=1.0))) - annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=45e5, - C(h_vol_1(start=75002))) - annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - h0=3.e6, - option_temperature=false, - P0=6500000, - region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2) - annotation (Placement(transformation(extent={{-100,60},{-80,80}}, - rotation=0))); - ThermoSysPro.Fluid.Machines.CentrifugalPump - DynamicCentrifugalPump1( - Q(fixed=true, start=50), - Qv(start=23.0), - Pm(start=1158163.6), - h(start=3041170.0441966015), - C1(P(start=10e5)), - C2(P(start=3.e6), h(start=3082340.088393203)), - hn(start=7119.0), - w_a(start=20.0)) - annotation (Placement(transformation(extent={{20,-40},{40,-20}}, rotation=0))); - ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1 - annotation (Placement(transformation(extent={{-20,-90},{0,-70}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0=13e5) - annotation (Placement(transformation(extent={{60,-40},{80,-20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - h0=3.e6, - option_temperature=false, - P0=1000000, - region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2) - annotation (Placement(transformation(extent={{-20,-40},{0,-20}}, - rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante Pout(k=PoutPump) - annotation (Placement(transformation(extent={{56,-12},{68,0}}, rotation=0))); -equation - connect(Shaft1.C2, DynamicCentrifugalPump1.M) - annotation (Line(points={{1,-80},{30,-80},{30,-41}})); - connect(stodolaTurbine.M, Shaft1.C1) - annotation (Line(points={{-50,60},{-50,-80},{-21,-80}})); - connect(sourceP1.C, DynamicCentrifugalPump1.C1) - annotation (Line(points={{0,-30},{20,-30}}, color={0,0,255})); - connect(DynamicCentrifugalPump1.C2, puitsP1.C) annotation (Line(points={{40,-30}, - {50,-30},{50,-30},{60,-30}}, color={0,0,255})); - connect(sourceP.C, stodolaTurbine.Ce) - annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255})); - connect(stodolaTurbine.Cs, puitsP.C) - annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255})); - connect(Pout.y, puitsP1.IPressure) - annotation (Line(points={{68.6,-6},{88,-6},{88,-30},{75,-30}})); - annotation (experiment(StopTime=1000), - Window( - x=0.32, - y=0.02, - width=0.39, - height=0.47), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStodolaTurbine1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo deleted file mode 100644 index 79bba323..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo +++ /dev/null @@ -1,53 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestStodolaTurbine2 - - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Ce(h(start= - 3000000.0))) - annotation (Placement(transformation(extent={{-60,60},{-40,80}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=5000) - annotation (Placement(transformation(extent={{-20,60},{0,80}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - h0=3.e6, - option_temperature=false, - P0=300000, - region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2) - annotation (Placement(transformation(extent={{-100,60},{-80,80}}, - rotation=0))); -equation - connect(sourceP.C, stodolaTurbine.Ce) - annotation (Line(points={{-80,70},{-60.1,70}}, color={0,0,255})); - connect(stodolaTurbine.Cs, puitsP.C) - annotation (Line(points={{-39.9,70},{-20,70}}, color={0,0,255})); - annotation (experiment(StopTime=1000), - Window( - x=0.32, - y=0.02, - width=0.39, - height=0.47), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestStodolaTurbine2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo deleted file mode 100644 index d36a372d..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo +++ /dev/null @@ -1,67 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestSwitchValve - - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement(transformation(extent={{-100,-10},{-80,10}},rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{80,-10},{100,10}}, - rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve - annotation (Placement(transformation( - extent={{-10,-4},{10,16}},rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse( - width=10, period=20) - annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 - annotation (Placement(transformation( - extent={{-60,-10},{-39,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 - annotation (Placement(transformation( - extent={{40,-10},{60,10}},rotation=0))); -equation - connect(pulse.yL, SwitchValve.Ouv) annotation (Line(points={{-39,60},{0,60},{ - 0,13.2}})); - connect(SourceP1.C, perteDP2.C1) - annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); - connect(perteDP2.C2, SwitchValve.C1) annotation (Line(points={{-39,0},{-10,0}}, - color={0,0,255})); - connect(SwitchValve.C2, perteDP1.C1) annotation (Line(points={{10,0},{40,0}}, - color={0,0,255})); - connect(perteDP1.C2, PuitsP1.C) - annotation (Line(points={{60,0},{80,0}}, color={0,0,255})); - annotation (experiment(StopTime=100), - Window( - x=0.45, - y=0.01, - width=0.35, - height=0.49), - Diagram(graphics, - coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo deleted file mode 100644 index 75adcf07..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo +++ /dev/null @@ -1,67 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestTank - - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start= - 400000.0)), Q(start=600.0)) - annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start= - 200000.0), Q(start=0.0)) - annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement( - transformation(extent={{-90,-4},{-70,16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{70,-50},{90,-30}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed=false, start=5), Cs1(Q(start= - 0.0)), - steady_state=true) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 - annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 - annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 - annotation (Placement(transformation( - extent={{70,-4},{90,16}}, rotation=0))); -equation - connect(PerteDP1.C2, PuitsP1.C) - annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); - connect(SourceP1.C, VanneReglante1.C1) - annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); - connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-6},{20,-6},{20, - -40},{30,-40}}, color={0,0,255})); - connect(Rampe1.y, VanneReglante1.Ouv) - annotation (Line(points={{-69,40},{-40,40},{-40,23}})); - connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6}, - {-10,6}}, color={0,0,255})); - connect(Tank1.Cs1, PerteDP2.C1) - annotation (Line(points={{10.2,6},{20,6},{30,6}}, color={0,0,255})); - connect(PerteDP2.C2, PuitsP2.C) - annotation (Line(points={{50,6},{50,6},{70,6}}, color={0,0,255})); - annotation (experiment(StopTime=20), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestTank; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo deleted file mode 100644 index 67788b89..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo +++ /dev/null @@ -1,69 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestTankHorizontal - - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start= - 400000.0)), Q(start=600.0)) - annotation (Placement(transformation(extent={{32,-20},{52,0}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start= - 200000.0), Q(start=0.0)) - annotation (Placement(transformation(extent={{-50,6},{-30,26}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement( - transformation(extent={{-90,0},{-70,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{70,-20},{90,0}}, rotation=0))); - Volumes.TankHorizontal Tank1(z(fixed=false, start=5), Cs1(Q(start= - 0.0)), - diffusion=true, - dynamic_mass_balance=true) - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 - annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation= - 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 - annotation (Placement(transformation(extent={{32,0},{52,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 - annotation (Placement(transformation( - extent={{70,0},{90,20}}, rotation=0))); -equation - connect(PerteDP1.C2, PuitsP1.C) - annotation (Line(points={{52,-10},{70,-10}}, color={0,0,255})); - connect(SourceP1.C, VanneReglante1.C1) - annotation (Line(points={{-70,10},{-50,10}}, color={0,0,255})); - connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{20,-10},{32,-10}}, - color={0,0,255})); - connect(Rampe1.y, VanneReglante1.Ouv) - annotation (Line(points={{-69,40},{-40,40},{-40,27}})); - connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,10},{-20, - 10}}, color={0,0,255})); - connect(Tank1.Cs1, PerteDP2.C1) - annotation (Line(points={{20.4,9.8},{20.4,10},{32,10}}, - color={0,0,255})); - connect(PerteDP2.C2, PuitsP2.C) - annotation (Line(points={{52,10},{70,10}}, color={0,0,255})); - annotation (experiment(StopTime=20), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestTankHorizontal; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo deleted file mode 100644 index f473116f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo +++ /dev/null @@ -1,64 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestThreeWayValve - - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 - annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation= - 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 - annotation (Placement(transformation( - extent={{70,-10},{90,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( - C2(Q(start=-7.902947109890763E-33)), - C3(Q(start=2716.4138702433384)), - Valve1(Pm(start=200000.0)), - VolumeA1(h(start=71016.12237181117))) - annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 - annotation (Placement(transformation( - extent={{70,-50},{90,-30}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe - annotation (Placement(transformation( - extent={{-50,30},{-30,50}}, rotation=0))); -equation - connect(rampe.y, threeWayValve.Ouv) - annotation (Line(points={{-29,40},{0,40},{0,15}})); - connect(SourceP1.C, threeWayValve.C1) - annotation (Line(points={{-70,0},{-10,0}}, color={0,0,0})); - connect(threeWayValve.C2, PuitsP1.C) - annotation (Line(points={{10,0},{70,0}}, color={0,0,0})); - connect(threeWayValve.C3, PuitsP2.C) - annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={0,0,0})); - annotation (experiment(StopTime=5), - Window( - x=0.45, - y=0.01, - width=0.35, - height=0.49), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-100,-100},{100,100}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestThreeWayValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo deleted file mode 100644 index 094b27d6..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo +++ /dev/null @@ -1,116 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestTwoPhaseCavity - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670 - "Maximum CV (active if mode_caract=0)"; - PressureLosses.ControlValve feedwaterValve( - Cv(start=335), - C1( - h_vol_1(start=1400e3), - h(start=1400e3), - P(start=13300000), - h_vol_2(start=1975433.4222685455)), - rho(start=888), - h(start=1400000), - Cvmax=CvmaxWater, - Q(start=10), - Pm(start=13200000.029884)) - annotation (Placement(transformation(extent={{-98,96},{-78, - 116}}, rotation=0))); - PressureLosses.ControlValve steamValve( - Cv(start=25000), - Q(start=0.0), - rho(start=78.5), - h(start=2657930), - C1(h_vol_2(start=2655313.7785675577)), - Cvmax(fixed=false), - Pm(start=12998726.577779)) - annotation (Placement(transformation(extent={{-60,136},{-40,156}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon(k=0.5) - annotation (Placement(transformation(extent={{-138,120},{-118,140}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon1(k=0.5) - annotation (Placement(transformation(extent={{-100,160},{-80,180}}, - rotation=0))); - BoundaryConditions.SourceP sourceP(h0=1400000, - option_temperature=false, - P0=13200000) - annotation (Placement(transformation(extent={{-138,90},{-118,110}}, - rotation=0))); - BoundaryConditions.SinkP sinkQ(P0=13200000, Q(start= - 51.00572315373906)) - annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0))); - Volumes.TwoPhaseCavity twoPhaseVolume( - Vv(start=0.5, fixed=true), - diffusion=true, - dynamic_energy_balance=false, - P0=13200000, - Pfond(start=13200000)) - annotation (Placement(transformation(extent={{-60,20},{20,100}}))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-20,-10}))); - BoundaryConditions.SourceP sourceP1( - P0(fixed=true) = 13200000, - option_temperature=false, - h0=2600000) - annotation (Placement(transformation(extent={{-100,130},{-80,150}}, - rotation=0))); -equation - connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv) - annotation (Line(points={{-117,130},{-88,130},{-88,117}}, smooth=Smooth.None)); - connect(sourceP.C,feedwaterValve. C1) annotation (Line( - points={{-118,100},{-98,100}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(ConsigneNiveauBallon1.y,steamValve. Ouv) - annotation (Line(points={{-79,170},{-50,170},{-50,157}}, - smooth=Smooth.None)); - connect(lumpedStraightPipe.C2, sinkQ.C) - annotation (Line(points={{-20,-20},{-20,-50},{0,-50}}, color={0,0,0})); - connect(sourceP1.C, steamValve.C1) - annotation (Line(points={{-80,140},{-60,140}}, color={0,0,0})); - connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation (Line(points={{ - -19.5556,30.6667},{-19.5556,15.3333},{-20,15.3333},{-20,0}}, color={0, - 0,0})); - connect(steamValve.C2, twoPhaseVolume.Cv) annotation (Line(points={{-40,140}, - {-19.5556,140},{-19.5556,89.3333}}, color={0,0,0})); - connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation (Line(points={{-78,100}, - {-35.5556,100},{-35.5556,89.3333}}, color={0,0,0})); - annotation (experiment(__Dymola_Algorithm="Dassl"), - Window( - x=0.43, - y=0, - width=0.57, - height=0.63), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-100},{140,200}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestTwoPhaseCavity; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo deleted file mode 100644 index a70d61b5..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo +++ /dev/null @@ -1,122 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestTwoPhaseCavityOnePipe - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670 - "Maximum CV (active if mode_caract=0)"; - PressureLosses.ControlValve feedwaterValve( - Cv(start=335), - C1( - h_vol_1(start=1400e3), - h(start=1400e3), - P(start=13300000), - h_vol_2(start=1399988.8233534198)), - rho(start=888), - h(start=1400000), - Cvmax=CvmaxWater, - Q(start=58.005768798668484), - Pm(start=13146647.912081594)) - annotation (Placement(transformation(extent={{-98,96},{-78, - 116}}, rotation=0))); - PressureLosses.ControlValve steamValve( - Cv(start=25000), - Q(start=6.303270420619601E-10), - rho(start=78.5), - h(start=2657930), - C1(h_vol_2(start=2658519.5634182408)), - Cvmax(fixed=false), - Pm(start=12998726.577779)) - annotation (Placement(transformation(extent={{-60,136},{-40,156}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon(k=0.5) - annotation (Placement(transformation(extent={{-138,120},{-118,140}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon1(k=0.5) - annotation (Placement(transformation(extent={{-100,160},{-80,180}}, - rotation=0))); - BoundaryConditions.SourceP sourceP(h0=1400000, - option_temperature=false, - P0=13200000) - annotation (Placement(transformation(extent={{-138,90},{-118,110}}, - rotation=0))); - BoundaryConditions.SinkP sinkQ(P0=13200000, Q(start= - 51.00572315373906)) - annotation (Placement(transformation(extent={{0,-60},{20,-40}}, rotation=0))); - Volumes.TwoPhaseCavityOnePipe - twoPhaseVolume( - Vv(start=0.5, fixed=true), - diffusion=true, - hl(start=1400000.0), - hv(start=2410000.0), - Cal_hcond=false, - dynamic_energy_balance=false, - P0=13200000, - Pfond(start=13203663.545897305), - Tp(start=583.6846968972088), - hvIn(start=2400966.7047930923)) - annotation (Placement(transformation(extent={{-60,20},{20,100}}))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-20,-10}))); - BoundaryConditions.SourceP sourceP1( - P0(fixed=true) = 13200000, - option_temperature=false, - h0=2600000) - annotation (Placement(transformation(extent={{-100,130},{-80,150}}, - rotation=0))); -equation - connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv) - annotation (Line(points={{-117,130},{-88,130},{-88,117}}, smooth=Smooth.None)); - connect(sourceP.C,feedwaterValve. C1) annotation (Line( - points={{-118,100},{-98,100}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(ConsigneNiveauBallon1.y,steamValve. Ouv) - annotation (Line(points={{-79,170},{-50,170},{-50,157}}, - smooth=Smooth.None)); - connect(lumpedStraightPipe.C2, sinkQ.C) - annotation (Line(points={{-20,-20},{-20,-50},{0,-50}}, color={0,0,0})); - connect(sourceP1.C, steamValve.C1) - annotation (Line(points={{-80,140},{-60,140}}, color={0,0,0})); - connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation (Line(points={{-20, - 30.6667},{-20,15.3333},{-20,15.3333},{-20,0}}, color={0, - 0,0})); - connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation (Line(points={{-78,100}, - {-50.6286,100},{-50.6286,81.0667}}, color={0,0,0})); - connect(steamValve.C2, twoPhaseVolume.CvBP) annotation (Line(points={{-40,140}, - {-20.2286,140},{-20.2286,89.3333}}, color={0,0,0})); - annotation (experiment(__Dymola_Algorithm="Dassl"), - Window( - x=0.43, - y=0, - width=0.57, - height=0.63), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-100},{140,200}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestTwoPhaseCavityOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo deleted file mode 100644 index 15f1f896..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo +++ /dev/null @@ -1,116 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestTwoPhaseVolume - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater=670 - "Maximum CV (active if mode_caract=0)"; - PressureLosses.ControlValve feedwaterValve( - Cv(start=335), - C1( - h_vol_1(start=1400e3), - h(start=1400e3), - P(start=13300000), - h_vol_2(start=1975433.4222685455)), - rho(start=888), - h(start=1400000), - Cvmax=CvmaxWater, - Q(start=10), - Pm(start=13200000.029884)) - annotation (Placement(transformation(extent={{-120,76},{ - -100,96}}, rotation=0))); - PressureLosses.ControlValve steamValve( - Cv(start=25000), - Q(start=0.0), - rho(start=78.5), - h(start=2657930), - C1(h_vol_2(start=2655313.7785675577)), - Cvmax(fixed=false), - Pm(start=12998726.577779)) - annotation (Placement(transformation(extent={{-120,136},{-100,156}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon(k=0.5) - annotation (Placement(transformation(extent={{-160,100},{-140,120}}, - rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante - ConsigneNiveauBallon1(k=0.5) - annotation (Placement(transformation(extent={{-160,160},{-140,180}}, - rotation=0))); - BoundaryConditions.SourceP sourceP(h0=1400000, - option_temperature=false, - P0=13200000) - annotation (Placement(transformation(extent={{-200,70},{-180,90}}, - rotation=0))); - BoundaryConditions.SinkP sinkQ(P0=13200000, Q(start= - 51.00572315373906)) - annotation (Placement(transformation(extent={{-38,-40},{-18,-20}}, - rotation=0))); - Volumes.TwoPhaseVolume twoPhaseVolume(diffusion=true, - steady_state=true, - Vv(start=0.5, fixed=true), - dynamic_energy_balance=true, - P0=13200000, - Pfond(start=13200000)) - annotation (Placement(transformation(extent={{-80,50},{-20,110}}))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-50,10}))); - BoundaryConditions.SourceP sourceP1( - P0(fixed=true) = 13200000, - option_temperature=false, - h0=2600000) - annotation (Placement(transformation(extent={{-200,130},{-180,150}}, - rotation=0))); -equation - connect(ConsigneNiveauBallon.y,feedwaterValve. Ouv) - annotation (Line(points={{-139,110},{-110,110},{-110,97}}, smooth=Smooth.None)); - connect(sourceP.C,feedwaterValve. C1) annotation (Line( - points={{-180,80},{-120,80}}, - color={0,0,255}, - smooth=Smooth.None)); - connect(ConsigneNiveauBallon1.y,steamValve. Ouv) - annotation (Line(points={{-139,170},{-110,170},{-110,157}}, - smooth=Smooth.None)); - connect(feedwaterValve.C2, twoPhaseVolume.Ce) - annotation (Line(points={{-100,80},{-80,80}}, color={0,0,0})); - connect(lumpedStraightPipe.C2, sinkQ.C) - annotation (Line(points={{-50,0},{-50,-30},{-38,-30}}, color={0,0,0})); - connect(sourceP1.C, steamValve.C1) - annotation (Line(points={{-180,140},{-120,140}}, color={0,0,0})); - connect(steamValve.C2, twoPhaseVolume.Cv) - annotation (Line(points={{-100,140},{-50,140},{-50,110}}, color={0,0,0})); - connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) - annotation (Line(points={{-50,50},{-50,20}}, color={0,0,0})); - annotation (experiment(__Dymola_Algorithm="Dassl"), - Window( - x=0.43, - y=0, - width=0.57, - height=0.63), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-100},{140,200}}, - grid={2,2})), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestTwoPhaseVolume; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo deleted file mode 100644 index e7d070a4..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo +++ /dev/null @@ -1,112 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestVolumeA - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - continuous_flow_reversal=true, - T0=288.15, - diffusion=true, - C(h_vol_2(start=63269.22110794238))) - annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( - Q(start=356.3142593657128), - P0=300000, - T0=369.15, - diffusion=true) - annotation (Placement(transformation(extent={{80,-10},{100,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeA volumeA( - dynamic_composition_balance=false, - steady_state=true, - V=1.e-6, - Ce2(Q(start=-4.6367791499652465E-36)), - continuous_flow_reversal=true, - dynamic_mass_balance=false, - dynamic_energy_balance=false, - diffusion=true, - P(start=200002.5108577)) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - - InstrumentationAndControl.Blocks.Sources.Rampe rampe( - Duration=10, - Initialvalue=1e5, - Finalvalue=5e5) - annotation (Placement(transformation(extent={{60,-40},{80,-20}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff( - start=4.4340701734837724E-07)) - annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3( - gamma_diff(start=4.4336099270975624E-07)) - annotation (Placement(transformation(extent={{50,-10},{70,10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia= - false) - annotation (Placement(transformation(extent={{-70,40},{-50,60}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( - continuous_flow_reversal=false, - T0=288.15, - diffusion=true) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - - PressureLosses.ControlValve controlValve1(Pm(start=201722.05301761828)) - annotation (Placement(transformation(extent={{-40,-4},{-20,16}}))); - PressureLosses.ControlValve controlValve2(C2(Q(start=0)), Pm(start= - 250001.25542885027)) - annotation (Placement(transformation(extent={{-40,46},{-20,66}}))); - PressureLosses.ControlValve controlValve3(Pm(start=198282.96276544)) - annotation (Placement(transformation(extent={{20,-4},{40,16}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante1(k=1) - annotation (Placement(transformation(extent={{-56,24},{-44,36}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) - annotation (Placement(transformation(extent={{-56,74},{-44,86}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante3 - annotation (Placement(transformation(extent={{4,22},{16,34}}))); -equation - connect(rampe.y, sinkP.IPressure) annotation (Line(points={{81,-30},{100,-30}, - {100,0},{95,0}}, color={0,0,255})); - connect(sourceP1.C, lumpedStraightPipe1.C1) - annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0})); - connect(lumpedStraightPipe3.C2, sinkP.C) - annotation (Line(points={{70,0},{80,0}}, color={0,0,0})); - connect(sourceP2.C, lumpedStraightPipe2.C1) - annotation (Line(points={{-80,50},{-70,50}}, color={0,0,0})); - connect(lumpedStraightPipe1.C2, controlValve1.C1) - annotation (Line(points={{-50,0},{-40,0}}, color={0,0,0})); - connect(lumpedStraightPipe2.C2, controlValve2.C1) - annotation (Line(points={{-50,50},{-40,50}}, color={0,0,0})); - connect(controlValve2.C2, volumeA.Ce2) - annotation (Line(points={{-20,50},{0,50},{0,10}}, color={0,0,0})); - connect(volumeA.Cs1, controlValve3.C1) - annotation (Line(points={{10,0},{20,0}}, color={0,0,0})); - connect(controlValve3.C2, lumpedStraightPipe3.C1) - annotation (Line(points={{40,0},{50,0}}, color={0,0,0})); - connect(constante1.y, controlValve1.Ouv) - annotation (Line(points={{-43.4,30},{-30,30},{-30,17}}, color={0,0,255})); - connect(constante2.y, controlValve2.Ouv) - annotation (Line(points={{-43.4,80},{-30,80},{-30,67}}, color={0,0,255})); - connect(constante3.y, controlValve3.Ouv) - annotation (Line(points={{16.6,28},{30,28},{30,17}}, color={0,0,255})); - connect(volumeA.Ce1, controlValve1.C2) - annotation (Line(points={{-10,0},{-20,0}}, color={0,0,255})); - annotation (Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - experiment(StopTime=12), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestVolumeA; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo deleted file mode 100644 index 94c923e8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo +++ /dev/null @@ -1,78 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestVolumeA1 - - ThermoSysPro.Fluid.Volumes.VolumeA volumeA(ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - Ce2(Q(start=5381683.17323685)), - Cs1(Q(start=5381683.173236847)), - Cs2(Q(start=5381683.173236847)), - Xo2(start=0.22), - h(start=999999.9999999997), - dynamic_energy_balance=false) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(rho(start= - 164.8075648419657)) - annotation (Placement(transformation(extent={{-60,20},{-40,40}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 - annotation (Placement(transformation(extent={{-60,-40},{-40,-20}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 - annotation (Placement(transformation(extent={{40,20},{60,40}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 - annotation (Placement(transformation(extent={{40,-40},{60,-20}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=false, - h0=1e6, - P0=600e5) - annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - T0=1000, - option_temperature=false, - h0=1e6, - P0=600e5) - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false) - annotation (Placement(transformation(extent={{80,20},{100,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(option_temperature=false) - annotation (Placement(transformation(extent={{80,-40},{100,-20}}))); -equation - connect(singularPressureLoss.C2, volumeA.Ce2) - annotation (Line(points={{-40,30},{0,30},{0,10}}, color={0,0,0})); - connect(singularPressureLoss1.C2, volumeA.Ce1) annotation (Line(points={{-40, - -30},{-20,-30},{-20,0},{-10,0}}, color={0,0,0})); - connect(volumeA.Cs1, singularPressureLoss2.C1) annotation (Line(points={{10,0}, - {10,0},{20,0},{20,30},{40,30},{40,30}}, color={0,0,0})); - connect(volumeA.Cs2, singularPressureLoss3.C1) annotation (Line(points={{0, - -10},{0,-10},{0,-30},{40,-30},{40,-30}}, color={0,0,0})); - connect(sourceP.C, singularPressureLoss.C1) - annotation (Line(points={{-80,30},{-60,30}}, color={0,0,0})); - connect(sourceP1.C, singularPressureLoss1.C1) - annotation (Line(points={{-80,-30},{-60,-30}}, color={0,0,0})); - connect(singularPressureLoss2.C2, sinkP.C) - annotation (Line(points={{60,30},{70,30},{70,30},{80,30}}, color={0,0,0})); - connect(singularPressureLoss3.C2, sinkP1.C) annotation (Line(points={{60,-30}, - {70,-30},{70,-30},{80,-30}}, color={0,0,0})); - annotation (Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-"), Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})})); -end TestVolumeA1; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo deleted file mode 100644 index 8b52572c..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo +++ /dev/null @@ -1,111 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -model TestVolumeI - - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - continuous_flow_reversal=true, - T0=288.15, - diffusion=true) - annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); - - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( - Q(start=356.3142593657128), - P0=300000, - T0=369.15, - diffusion=true) - annotation (Placement(transformation(extent={{80,-10},{100,10}}))); - Volumes.VolumeI volumeA( - dynamic_composition_balance=false, - steady_state=true, - V=1.e-6, - Ce2(Q(start=-1.2064107019298721E-33)), - continuous_flow_reversal=true, - dynamic_mass_balance=false, - diffusion=false, - dynamic_energy_balance=true, - P(start=200002.5108577), - h(start=63269.22110794238)) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - - InstrumentationAndControl.Blocks.Sources.Rampe rampe( - Duration=10, - Initialvalue=1e5, - Finalvalue=5e5) - annotation (Placement(transformation(extent={{60,-40},{80,-20}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff( - start=4.4340701734837724E-07)) - annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3 - annotation (Placement(transformation(extent={{50,-10},{70,10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia= - false) - annotation (Placement(transformation(extent={{-70,40},{-50,60}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( - continuous_flow_reversal=false, - T0=288.15, - diffusion=true) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - - PressureLosses.ControlValve controlValve1(Pm(start=201722.05301761828)) - annotation (Placement(transformation(extent={{-40,-4},{-20,16}}))); - PressureLosses.ControlValve controlValve2(C2(Q(start=0)), Pm(start= - 250001.25542885027)) - annotation (Placement(transformation(extent={{-40,46},{-20,66}}))); - PressureLosses.ControlValve controlValve3(Pm(start=198282.96276544)) - annotation (Placement(transformation(extent={{20,-4},{40,16}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante1(k=1) - annotation (Placement(transformation(extent={{-56,24},{-44,36}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) - annotation (Placement(transformation(extent={{-56,74},{-44,86}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante3 - annotation (Placement(transformation(extent={{4,22},{16,34}}))); -equation - connect(rampe.y, sinkP.IPressure) annotation (Line(points={{81,-30},{100,-30}, - {100,0},{95,0}}, color={0,0,255})); - connect(sourceP1.C, lumpedStraightPipe1.C1) - annotation (Line(points={{-80,0},{-70,0}}, color={0,0,0})); - connect(lumpedStraightPipe3.C2, sinkP.C) - annotation (Line(points={{70,0},{80,0}}, color={0,0,0})); - connect(sourceP2.C, lumpedStraightPipe2.C1) - annotation (Line(points={{-80,50},{-70,50}}, color={0,0,0})); - connect(lumpedStraightPipe1.C2, controlValve1.C1) - annotation (Line(points={{-50,0},{-40,0}}, color={0,0,0})); - connect(lumpedStraightPipe2.C2, controlValve2.C1) - annotation (Line(points={{-50,50},{-40,50}}, color={0,0,0})); - connect(controlValve3.C2, lumpedStraightPipe3.C1) - annotation (Line(points={{40,0},{50,0}}, color={0,0,0})); - connect(constante1.y, controlValve1.Ouv) - annotation (Line(points={{-43.4,30},{-30,30},{-30,17}}, color={0,0,255})); - connect(constante2.y, controlValve2.Ouv) - annotation (Line(points={{-43.4,80},{-30,80},{-30,67}}, color={0,0,255})); - connect(constante3.y, controlValve3.Ouv) - annotation (Line(points={{16.6,28},{30,28},{30,17}}, color={0,0,255})); - connect(controlValve1.C2, volumeA.Ce2) - annotation (Line(points={{-20,0},{-10,0}}, color={0,0,0})); - connect(controlValve2.C2, volumeA.Ce1) annotation (Line(points={{-20,50},{-14, - 50},{-14,8},{-10,8}}, color={0,0,0})); - connect(volumeA.Cs2, controlValve3.C1) - annotation (Line(points={{10,0},{20,0}}, color={0,0,0})); - annotation (Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - experiment(StopTime=12), - Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); -end TestVolumeI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order index f1d67d76..e69de29b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order @@ -1,86 +0,0 @@ -TestAirHumidity -TestBend -TestBoilerSystem -TestCentrifugalPump1 -TestCheckValve -TestCHPEngineBarkantineSystem -TestCombustionTurbine -TestCompressor -TestDiaphragm -TestDiffusion_DynamicOnePhaseFlowPipe -TestDiffusion_DynamicPlateHeatExchanger -TestDiffusion_DynamicTwoPhaseFlowPipe -TestDiffusion_VolumeA -TestDynamicCheckValve -TestDynamicCondenser -TestDynamicDrum -TestDynamicDrum_CC -TestDynamicFlueGasesMultiFluidHeatExchanger -TestDynamicMultiFluidHeatExchanger -TestDynamicMultiFluidHeatExchangerShell -TestDynamicOnePhaseFlowPipe -TestDynamicOnePhaseFlowShell -TestDynamicPlateHeatExchanger -TestDynamicReliefValve -TestDynamicTwoPhaseFlowPipe -TestDynamicTwoPhaseFlowRiser -TestDynamicWaterHeating -TestDynamicWaterHeatingOnePipe -TestDynamicWaterSteamMultiFluidHeatExchanger -TestFixedPowerHeatExchanger -TestFossilFuelBoiler -TestFresnelField -TestGasTurbine -TestGenericCombustion -TestGenericCombustion1D -TestGridFurnace -TestGTCombustionChamber -TestHeatPumpCompressor -TestIdealCheckValve -TestIdealSwitchValve -TestInternalCombustionEngine -TestInvSingularPressureLoss -TestJunctions1 -TestJunctions2 -TestJunctions3 -TestJunctions4 -TestLoopBreaker -TestMassFlowMultiplier -TestNTUWaterHeater0 -TestPostCombustionGas -TestPressurizer -TestRefP -TestRefP1 -TestSensors -TestSimpleDynamicCondenser -TestSimpleDynamicCondenser1 -TestSimpleEvaporatorWaterSteamFlueGases -TestSimpleStaticCondenser -TestSingularPressureLoss -TestStaticAerocondenser -TestStaticCentrifugalPump1 -TestStaticCondenser -TestStaticCondenserHEI -TestStaticDrum1 -TestStaticDrum2 -TestStaticExchangerDTorWorEff -TestStaticExchangerKS -TestStaticFan -TestStaticPlateHeatExchanger -TestStaticWallFlueGasesExchanger -TestSteamDryer1 -TestSteamDryer2 -TestSteamEngine -TestSteamExtractionSplitter -TestStodolaTurbine1 -TestStodolaTurbine2 -TestSwitchValve -TestTank -TestTankHorizontal -TestThreeWayValve -TestTwoPhaseCavity -TestTwoPhaseCavityOnePipe -TestTwoPhaseVolume -TestVolumeA -TestVolumeA1 -TestVolumeI diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo index 0b4a67c1..f88c9d63 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo @@ -1,5 +1,8 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidInlet "Fluid inlet connector" + replaceable package Medium = + ThermoSysPro.Properties.Media.WaterSteam constrainedby Modelica.Media.Interfaces.PartialMedium + "Medium model" annotation (choicesAllMatching=true, Dialog(group="Medium")); Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start=500) "Mass flow rate of the fluid crossing the boundary of the control volume"; @@ -9,16 +12,10 @@ connector FluidInlet "Fluid inlet connector" "Fluid specific enthalpy in the control volume 1"; Units.SI.SpecificEnthalpy h_vol_2(start=1.e5) "Fluid specific enthalpy in the control volume 2"; - input ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype - "Fluid type"; - ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01) - "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xh2o - "H2O mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2) - "O2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xso2(start=0) - "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + Medium.ExtraProperty SubC[Medium.nC] + "Properties c_i/m of the fluid crossing the boundary of the control volume"; + Medium.MassFraction Xi[Medium.nXi] + "Independent mixture mass fractions m_i/m of the fluid crossing the boundary of the control volume"; input Real diff_res_1(start=1e4) "Diffusion resistance from control volume 1"; output Real diff_res_2(start=1e4) diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo index 3579500b..52c98b76 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo @@ -1,5 +1,8 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidOutlet "Fluid outlet connector" + replaceable package Medium = + ThermoSysPro.Properties.Media.WaterSteam constrainedby Modelica.Media.Interfaces.PartialMedium + "Medium model" annotation (choicesAllMatching=true, Dialog(group="Medium")); Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start=500) "Mass flow rate of the fluid crossing the boundary of the control volume"; @@ -9,16 +12,10 @@ connector FluidOutlet "Fluid outlet connector" "Fluid specific enthalpy in the control volume 1"; Units.SI.SpecificEnthalpy h_vol_2(start=1.e5) "Fluid specific enthalpy in the control volume 2"; - output ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype - "Fluid type"; - ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01) - "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xh2o - "H2O mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2) - "O2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xso2(start=0) - "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + Medium.ExtraProperty SubC[Medium.nC] + "Properties c_i/m of the fluid crossing the boundary of the control volume"; + Medium.MassFraction Xi[Medium.nXi] + "Independent mixture mass fractions m_i/m of the fluid crossing the boundary of the control volume"; output Real diff_res_1(start=1e4) "Diffusion resistance from control volume 1"; input Real diff_res_2(start=1e4) diff --git a/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo b/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo index b9a2d5d5..df6d9698 100644 --- a/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo +++ b/ThermoSysPro/Properties/DryAirIdealGas/DryAirIdealGas.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.DryAirIdealGas; +within ThermoSysPro.Properties.DryAirIdealGas; record DryAirIdealGas "Data for Dry Air Ideal Gas from STEPHANIE Library" // STEPHANIE Dry Air Ideal Gas // "Air Data Package - valid temperature ranges 200K - 1000K and 1000K - 6000K. Source: NASA/TP-2002-211556 Coefficients for Calculating Thermodynamic Properties" diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo index ab362f41..fe208445 100644 --- a/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo +++ b/ThermoSysPro/Properties/FlueGases/FlueGases_h.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.FlueGases; +within ThermoSysPro.Properties.FlueGases; function FlueGases_h "Specific enthalpy" input Units.SI.AbsolutePressure PMF "Flue gases average pressure"; input Units.SI.Temperature TMF "Flue gases average temperature"; diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo index 83a4f173..848f5202 100644 --- a/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo +++ b/ThermoSysPro/Properties/FlueGases/FlueGases_h_Ps.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.FlueGases; +within ThermoSysPro.Properties.FlueGases; function FlueGases_h_Ps "Specific enthalpy" //extends ThermoSysPro.Properties.FlueGases.unSafeForJacobian; diff --git a/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo b/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo index aa770442..a41aee8f 100644 --- a/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo +++ b/ThermoSysPro/Properties/FlueGases/FlueGases_s.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.FlueGases; +within ThermoSysPro.Properties.FlueGases; function FlueGases_s "Specific entropy" input Units.SI.AbsolutePressure PMF "Flue gases average pressure"; input Units.SI.Temperature TMF "Flue gases average temperature"; diff --git a/ThermoSysPro/Properties/FlueGases/XSat.mo b/ThermoSysPro/Properties/FlueGases/XSat.mo index 246d2fa0..21b62c16 100644 --- a/ThermoSysPro/Properties/FlueGases/XSat.mo +++ b/ThermoSysPro/Properties/FlueGases/XSat.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.FlueGases; +within ThermoSysPro.Properties.FlueGases; function XSat //--------------------------------------------------------------------------- // Fonction de l'humidité absolue a saturation xs(T) diff --git a/ThermoSysPro/Properties/Fluid/Density_Ph.mo b/ThermoSysPro/Properties/Fluid/Density_Ph.mo index b2b77157..2a12405d 100644 --- a/ThermoSysPro/Properties/Fluid/Density_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/Density_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function Density_Ph "Density computation for all fluids (inputs: P, h, fluid)" input Units.SI.AbsolutePressure P "Pressure (Pa)"; diff --git a/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo b/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo index 11771944..4a316c65 100644 --- a/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/Density_derh_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function Density_derh_Ph "Density derivative w.r.t enthalpy computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo b/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo index b19bb8ca..c2d198ff 100644 --- a/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/Density_derp_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function Density_derp_Ph "Density derivative w.r.t pressure computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo b/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo index a4ef447c..c2184494 100644 --- a/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/DynamicViscosity_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function DynamicViscosity_Ph "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo b/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo index d43990ff..7126474f 100644 --- a/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/Prandtl_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function Prandtl_Ph "Prandtl number computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo b/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo index 28b8bb19..767f4126 100644 --- a/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo +++ b/ThermoSysPro/Properties/Fluid/Reynolds_PhvD.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function Reynolds_PhvD "Reynolds number computation for all fluids (inputs: P, h, fluid, v, D)" diff --git a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo index c7b8766a..62998709 100644 --- a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo +++ b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_PT.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function SpecificHeatCapacityCp_PT "Specific Heat Capacity at constant P computation for all fluids (inputs: P, T, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo index 456a9cfa..ff6dbf2f 100644 --- a/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/SpecificHeatCapacityCp_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function SpecificHeatCapacityCp_Ph "Specific Heat Capacity at constant P computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo b/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo index c75fcaf6..0c8d9f29 100644 --- a/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo +++ b/ThermoSysPro/Properties/Fluid/SpecificInternalEnergy_Ph_DO_NOT_USE.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function SpecificInternalEnergy_Ph_DO_NOT_USE "Specific Internal Energy computation for all fluids (inputs: P, h, fluid). DO NOT USE (does not work with use-case 'DistributedVolumePartialModel'. Use u = h - P/rho instead)" diff --git a/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo b/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo index 1eb75751..67957b28 100644 --- a/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/Temperature_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function Temperature_Ph "Temperature computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo b/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo index 2eb74379..fdefea13 100644 --- a/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo +++ b/ThermoSysPro/Properties/Fluid/ThermalConductivity_Ph.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function ThermalConductivity_Ph "Thermal Conductivity computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo index b81c30cc..13873391 100644 --- a/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo +++ b/ThermoSysPro/Properties/Fluid/derDensity_derP_derh.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derDensity_derP_derh "der(Density) computation for all fluids (inputs: P, h, der(P), der(h), fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo index 1d1bb632..c6d2a49e 100644 --- a/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo +++ b/ThermoSysPro/Properties/Fluid/derDensity_derh_derP_derh.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derDensity_derh_derP_derh "der(Density derivative w.r.t enthalpy) computation for all fluids (inputs: P, h, der(P), der(h), fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo index 03dc4510..85def033 100644 --- a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo +++ b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derDynamicViscosity_derP_derh "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo index 8fb979e2..6ef1228d 100644 --- a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo +++ b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derP_derh_old.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derDynamicViscosity_derP_derh_old "Dynamic Viscosity computation for all fluids (inputs: P, h, fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo index fc3d1e1f..8e767e34 100644 --- a/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo +++ b/ThermoSysPro/Properties/Fluid/derDynamicViscosity_derT_derrho.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derDynamicViscosity_derT_derrho "Dynamic Viscosity computation for all fluids" diff --git a/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo b/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo index e04c7924..f0fbb8af 100644 --- a/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo +++ b/ThermoSysPro/Properties/Fluid/derSpecificEnthalpy_derP_derT.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derSpecificEnthalpy_derP_derT "der(Specific enthalpy) computation for all fluids (inputs: P, h, der(P), der(T), fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo b/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo index 03c1dfad..5b19641a 100644 --- a/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo +++ b/ThermoSysPro/Properties/Fluid/derTemperature_derP_derh.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derTemperature_derP_derh "der(Temperature) computation for all fluids (inputs: P, h, fluid, der(P), der(h))" diff --git a/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo b/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo index 5182f596..f37df39e 100644 --- a/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo +++ b/ThermoSysPro/Properties/Fluid/derderDensity_derderP_derderh.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derderDensity_derderP_derderh "der(der(Density)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo b/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo index 17554e9b..53e0a91a 100644 --- a/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo +++ b/ThermoSysPro/Properties/Fluid/derderDensity_derh_derderP_derderh.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derderDensity_derh_derderP_derderh "der(der(Density derivative w.r.t enthalpy)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)" diff --git a/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo b/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo index 278bf515..efdabaca 100644 --- a/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo +++ b/ThermoSysPro/Properties/Fluid/derderTemperature_derderP_derderh.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Fluid; +within ThermoSysPro.Properties.Fluid; function derderTemperature_derderP_derderh "der(der(Temperature)) computation for all fluids (inputs: P, h, der(P), der(h), der(der(P)), der(der(h)), fluid)" diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo new file mode 100644 index 00000000..e117fa5c --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo @@ -0,0 +1,6 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +record C_BiPhase + Real Cl[nSubC]; + Real Cg[nSubC]; + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end C_BiPhase; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo new file mode 100644 index 00000000..7aebdec9 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +function HomogeneousPhasesSeparation + extends partialPhasesSeparation; +// input Real x(min=0, max=1) "Title"; + +algorithm + // HomogeneousSubstance + C_record.Cl := SubC; + C_record.Cg := SubC; + +// // Non-volatile +// C_record.Cl := SubC / (1-x); +// C_record.Cg := fill(0,size(SubC,1)); + +// // Fully-volatile +// C_record.Cl := fill(0,size(SubC,1)); +// C_record.Cg := SubC / x; +end HomogeneousPhasesSeparation; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo new file mode 100644 index 00000000..e00d5bc8 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo @@ -0,0 +1,6 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +function noSaS + extends partialSaS; +algorithm + C := fill(0,nSubC); +end noSaS; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo new file mode 100644 index 00000000..133f5bc5 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Properties.Media; +partial package PartialSubCMedium + constant Integer nSubC; + +end PartialSubCMedium; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order new file mode 100644 index 00000000..d5bff50f --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order @@ -0,0 +1,6 @@ +nSubC +partialPhasesSeparation +HomogeneousPhasesSeparation +C_BiPhase +partialSaS +noSaS diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo new file mode 100644 index 00000000..4f208f63 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo @@ -0,0 +1,64 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +partial function partialPhasesSeparation + input Real SubC[:] "Total Species Concentrations"; + output C_BiPhase C_record; + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Ellipse( + extent={{-60,60},{60,-60}}, + lineColor={0,0,255}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Polygon( + points={{60,0},{58,14},{54,26},{48,36},{38,46},{26,54},{14,58},{0,60}, + {0,0},{60,0}}, + fillColor={170,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Polygon( + points={{-60,0},{-58,14},{-54,26},{-48,36},{-38,46},{-26,54},{-14,58}, + {0,60},{0,0},{-60,0}}, + fillColor={170,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Ellipse( + extent={{-42,28},{-26,12}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-18,48},{-6,36}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-4,24},{16,4}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{26,34},{42,18}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{24,-12},{40,-28}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-40,-22},{-24,-38}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{10,-36},{22,-48}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-20,-4},{2,-26}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem( + preserveAspectRatio=false))); +end partialPhasesSeparation; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo new file mode 100644 index 00000000..69547374 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +partial function partialSaS + input Real SubC[:] "Total Species Concentrations"; + output Real C[size(SubC,1)]; +end partialSaS; diff --git a/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo b/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo new file mode 100644 index 00000000..5f292163 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Properties.Media; +partial package PartialThermoSysProMedium + extends Modelica.Media.Interfaces.PartialMedium; + extends PartialSubCMedium(nSubC=nC); +end PartialThermoSysProMedium; diff --git a/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.order b/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo b/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo new file mode 100644 index 00000000..eb2a9267 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Properties.Media; +partial package PartialTwoPhaseThermoSysProMedium + extends Modelica.Media.Interfaces.PartialTwoPhaseMedium; + extends PartialSubCMedium(nSubC=nC); +end PartialTwoPhaseThermoSysProMedium; diff --git a/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.order b/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Properties/Media/WaterSteam/package.mo b/ThermoSysPro/Properties/Media/WaterSteam/package.mo new file mode 100644 index 00000000..b47b1c4c --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteam/package.mo @@ -0,0 +1,730 @@ +within ThermoSysPro.Properties.Media; +package WaterSteam "1 - Water/steam properties library (IAPWS-IF97)" + + extends PartialTwoPhaseThermoSysProMedium( + mediumName="WaterIF97", + substanceNames={"water"}, + singleState=false, + SpecificEnthalpy(start=1.0e5, nominal=5.0e5), + Density(start=150, nominal=500), + AbsolutePressure( + start=50e5, + nominal=10e5, + min=611.657, + max=100e6), + Temperature( + start=500, + nominal=500, + min=273.15, + max=2273.15), + smoothModel=false, + onePhase=false, + fluidConstants=Modelica.Media.Water.waterConstants, + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + redeclare record extends SaturationProperties + end SaturationProperties; + + redeclare record extends ThermodynamicState "Thermodynamic state" + SpecificEnthalpy h "Specific enthalpy"; + Density d "Density"; + Temperature T "Temperature"; + AbsolutePressure p "Pressure"; + end ThermodynamicState; + constant Integer Region = 0 "IF97 region. 0:automatic"; + + redeclare replaceable model extends BaseProperties( + h(stateSelect= StateSelect.prefer), + d(stateSelect= StateSelect.default), + T(stateSelect= StateSelect.default), + p(stateSelect= StateSelect.prefer)) + "Base properties of waterBase properties (p, d, T, h, u, R_s, MM and, if applicable, X and Xi) of a medium" + Integer phase( + min=0, + max=2, + start=1, + fixed=false) "2 for two-phase, 1 for one-phase, 0 if not known"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + equation + pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(p, h, Region); + MM = fluidConstants[1].molarMass; + R_s = Modelica.Constants.R/fluidConstants[1].molarMass; + + phase = if ((h < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p)) + or (h > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p)) + or (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)) then 1 else 2; + + sat = setSat_p(state.p); + state = setState_ph(p, h, phase); + + d=pro.d; + T=pro.T; + u = pro.u; + end BaseProperties; + + redeclare function density_ph + "Computes density as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + p, + h, + region); + d := pro.d; + annotation (Inline=true); + end density_ph; + + redeclare function temperature_ph + "Computes temperature as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + p, + h, + region); + T := pro.T; + annotation (Inline=true); + end temperature_ph; + + redeclare function extends setState_phX + "Return thermodynamic state of water as function of p, h, and optional region" + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + algorithm + state := ThermodynamicState( + d=density_ph( + p, + h, + region=Region), + T=temperature_ph( + p, + h, + region=Region), + phase=if region == 0 then 0 else if region==4 then 2 else 1, + h=h, + p=p); + annotation (Inline=true); + end setState_phX; + + redeclare function temperature_ps + "Compute temperature from pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + T := pro.T; + annotation (Inline=true); + end temperature_ps; + + redeclare function density_ps + "Computes density as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + d := pro.d; + annotation (Inline=true); + end density_ps; + + redeclare function specificEnthalpy_pT + "Computes specific enthalpy as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output SpecificEnthalpy h "Specific enthalpy"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT + pro; + algorithm + + pro := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_PT(p, T, region); + h := pro.h; + annotation (Inline=true); + end specificEnthalpy_pT; + + redeclare function specificEnthalpy_ps + "Computes specific enthalpy as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output SpecificEnthalpy h "Specific enthalpy"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + h := pro.h; + annotation (Inline=true); + end specificEnthalpy_ps; + + redeclare function density_pT + "Computes density as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT + pro; + algorithm + + pro := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_PT(p, T, region); + d := pro.d; + + annotation (Inline=true); + end density_pT; + + redeclare function extends dewEnthalpy "Dew curve specific enthalpy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + hv := vsat.h; + annotation (Inline=true); + end dewEnthalpy; + + redeclare function extends dewDensity "Dew curve specific density of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + dv := vsat.rho; + annotation (Inline=true); + end dewDensity; + + redeclare function extends setDewState + "Set the thermodynamic state on the dew line" + algorithm + state := ThermodynamicState( + phase=phase, + p=sat.psat, + T=sat.Tsat, + h=dewEnthalpy(sat), + d=dewDensity(sat)); + + annotation (Inline=true); + end setDewState; + + redeclare function extends bubbleEnthalpy + "Boiling curve specific enthalpy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + hl := lsat.h; + annotation (Inline=true); + end bubbleEnthalpy; + + redeclare function extends bubbleDensity + "Boiling curve specific density of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + dl := lsat.rho; + annotation (Inline=true); + end bubbleDensity; + + redeclare function extends setBubbleState + "Set the thermodynamic state on the bubble line" + algorithm + state := ThermodynamicState( + phase=phase, + p=sat.psat, + T=sat.Tsat, + h=bubbleEnthalpy(sat), + d=bubbleDensity(sat)); + annotation (Inline=true); + end setBubbleState; + + redeclare function extends dynamicViscosity "Dynamic viscosity of water" + algorithm + + // Water/Steam /// FONCTIONNE EN DIPHASIQUE ??? + // if fluid==1 then + eta := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=state.d,T=state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + "Thermal conductivity of water" + input Integer region=Region; + algorithm + lambda := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=state.d,T=state.T,P=state.p,region=region); + + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends surfaceTension + "Surface tension in two phase region of water" + algorithm + sigma := ThermoSysPro.Properties.WaterSteam.IF97.SurfaceTension_T(sat.Tsat); + annotation (Inline=true); + end surfaceTension; + + redeclare function extends pressure "Return pressure of ideal gas" + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature "Return temperature of ideal gas" + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density "Return density of ideal gas" + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy "Return specific enthalpy" + extends Modelica.Icons.Function; + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + "Return specific internal energy" + extends Modelica.Icons.Function; + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy "Specific entropy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + s := pro.s; + + annotation (Inline=true); + end specificEntropy; + + redeclare function extends specificGibbsEnergy "Return specific Gibbs energy" + extends Modelica.Icons.Function; + algorithm + g := state.h - state.T*specificEntropy(state); + annotation (Inline=true); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + "Return specific Helmholtz energy" + extends Modelica.Icons.Function; + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + annotation (Inline=true); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + "Specific heat capacity at constant pressure of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + cp := pro.cp; + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + "Specific heat capacity at constant volume of water" + algorithm + cv := Modelica.Media.Water.IF97_Utilities.cv_ph( + state.p, + state.h, + state.phase, + Region); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends velocityOfSound + "Return velocity of sound as a function of the thermodynamic state record" + algorithm + a := ThermoSysPro.Properties.WaterSteam.IF97_Utilities.AnalyticDerivatives.velocityOfSound_pT(state.p,state.T,Region); + annotation (Inline=true); + end velocityOfSound; + + redeclare function extends isentropicEnthalpy "Compute h(s,p)" + algorithm + // h_is := Modelica.Media.Water.IF97_Utilities.isentropicEnthalpy(p_downstream, specificEntropy(refState), 0); + h_is := ThermoSysPro.Properties.WaterSteam.IF97_Utilities.AnalyticDerivatives.dynamicIsentropicEnthalpy(p_downstream, specificEntropy(refState), refState.d, refState.T, refState.phase); + annotation (Inline=true); + end isentropicEnthalpy; + + redeclare function extends density_derh_p + "Density derivative by specific enthalpy" + + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + ddhp:=pro.ddhp; + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h "Density derivative by pressure" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + ddph:=pro.ddph; + annotation (Inline=true); + end density_derp_h; + // redeclare function extends density_derT_p + // "Density derivative by temperature" + // algorithm + // ddTp := IF97_Utilities.ddTp(state.p, state.h, state.phase); + // end density_derT_p; + // + // redeclare function extends density_derp_T + // "Density derivative by pressure" + // algorithm + // ddpT := IF97_Utilities.ddpT(state.p, state.h, state.phase); + // end density_derp_T; + + redeclare function extends bubbleEntropy + "Boiling curve specific entropy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + sat.psat, + lsat.h, + Region); + sl:=pro.s; + annotation (Inline=true); + end bubbleEntropy; + + redeclare function extends dewEntropy "Dew curve specific entropy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + sat.psat, + vsat.h, + Region); + sv := pro.s; + annotation (Inline=true); + end dewEntropy; + + redeclare function extends saturationTemperature + "Saturation temperature of water" + algorithm + T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(p); + annotation (Inline=true); + end saturationTemperature; + + redeclare function extends saturationTemperature_derp + "Derivative of saturation temperature w.r.t. pressure" + algorithm + dTp := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dtsatofp(p); + annotation (Inline=true); + end saturationTemperature_derp; + + redeclare function extends saturationPressure "Saturation pressure of water" + algorithm + p := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T); + annotation (Inline=true); + end saturationPressure; + + redeclare function extends dBubbleDensity_dPressure + "Bubble point density derivative" + // algorithm + // ddldp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.drhol_dp(sat.psat); + annotation (Inline=true); + end dBubbleDensity_dPressure; + + redeclare function extends dDewDensity_dPressure + "Dew point density derivative" + // algorithm + // ddvdp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.drhov_dp(sat.psat); + annotation (Inline=true); + end dDewDensity_dPressure; + + redeclare function extends dBubbleEnthalpy_dPressure + "Bubble point specific enthalpy derivative" + // algorithm + // dhldp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dhl_dp(sat.psat); + annotation (Inline=true); + end dBubbleEnthalpy_dPressure; + + redeclare function extends dDewEnthalpy_dPressure + "Dew point specific enthalpy derivative" + // algorithm + // dhvdp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dhv_dp(sat.psat); + annotation (Inline=true); + end dDewEnthalpy_dPressure; + + redeclare function extends setState_psX + "Return thermodynamic state of water as function of p, s, and optional region" + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + state := ThermodynamicState( + d=pro.d, + T=pro.T, + phase=if region == 0 then 0 else if region==4 then 2 else 1, + h=pro.h, + p=p); + annotation (Inline=true); + end setState_psX; + + redeclare function extends setState_pTX + "Return thermodynamic state of water as function of p, T, and optional region" + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_PT( + p, + T, + region); + state := ThermodynamicState( + d=pro.d, + T=T, + phase=1, + h=pro.h, + p=p); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setSmoothState + "Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b" + import Modelica.Media.Common.smoothStep; + algorithm + state := ThermodynamicState( + p=smoothStep( + x, + state_a.p, + state_b.p, + x_small), + h=smoothStep( + x, + state_a.h, + state_b.h, + x_small), + d=density_ph(smoothStep( + x, + state_a.p, + state_b.p, + x_small), smoothStep( + x, + state_a.h, + state_b.h, + x_small)), + T=temperature_ph(smoothStep( + x, + state_a.p, + state_b.p, + x_small), smoothStep( + x, + state_a.h, + state_b.h, + x_small)), + phase=0); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends setState_dTX + "Return thermodynamic state of water as function of d, T, and optional region" + // input Integer region=Region + // "If 0, region is unknown, otherwise known and this input"; + // algorithm + // state := ThermodynamicState( + // d=d, + // T=T, + // phase=if region == 0 then 0 else if + // region == 4 then 2 else 1, + // h=specificEnthalpy_dT( + // d, + // T, + // region=region), + // p=pressure_dT( + // d, + // T, + // region=region)); + // annotation (Inline=true); + end setState_dTX; + + redeclare function extends specificEnthalpy_dT + "Computes specific enthalpy as a function of density and temperature" + // extends Modelica.Icons.Function; + // input Density d "Density"; + // input Temperature T "Temperature"; + // input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + // input Integer region=Region + // "If 0, region is unknown, otherwise known and this input"; + // output SpecificEnthalpy h "Specific enthalpy"; + // algorithm + // h := Modelica.Media.Water.IF97_Utilities.h_dT( + // d, + // T, + // phase, + // region); + // annotation (Inline=true); + + end specificEnthalpy_dT; + + redeclare function extends pressure_dT + "Computes pressure as a function of density and temperature" + // extends Modelica.Icons.Function; + // input Density d "Density"; + // input Temperature T "Temperature"; + // input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + // input Integer region=Region + // "If 0, region is unknown, otherwise known and this input"; + // output AbsolutePressure p "Pressure"; + // algorithm + // p := Modelica.Media.Water.IF97_Utilities.p_dT( + // d, + // T, + // phase, + // region); + // annotation (Inline=true); + + end pressure_dT; + + redeclare function extends isentropicExponent "Return isentropic exponent" + // algorithm + // gamma := if dT_explicit then Modelica.Media.Water.IF97_Utilities.isentropicExponent_dT( + // state.d, + // state.T, + // state.phase, + // Region) else if pT_explicit then Modelica.Media.Water.IF97_Utilities.isentropicExponent_pT( + // state.p, + // state.T, + // Region) else Modelica.Media.Water.IF97_Utilities.isentropicExponent_ph( + // state.p, + // state.h, + // state.phase, + // Region); + // annotation (Inline=true); + end isentropicExponent; + + redeclare function extends isothermalCompressibility + "Isothermal compressibility of water" + // algorithm + // // assert(state.phase <> 2, "Isothermal compressibility can not be computed with 2-phase inputs!"); + // kappa := if dT_explicit then Modelica.Media.Water.IF97_Utilities.kappa_dT( + // state.d, + // state.T, + // state.phase, + // Region) else if pT_explicit then Modelica.Media.Water.IF97_Utilities.kappa_pT( + // state.p, + // state.T, + // Region) else Modelica.Media.Water.IF97_Utilities.kappa_ph( + // state.p, + // state.h, + // state.phase, + // Region); + // annotation (Inline=true); + end isothermalCompressibility; + + redeclare function extends isobaricExpansionCoefficient + "Isobaric expansion coefficient of water" + // algorithm + // // assert(state.phase <> 2, "The isobaric expansion coefficient can not be computed with 2-phase inputs!"); + // beta := if dT_explicit then Modelica.Media.Water.IF97_Utilities.beta_dT( + // state.d, + // state.T, + // state.phase, + // Region) else if pT_explicit then Modelica.Media.Water.IF97_Utilities.beta_pT( + // state.p, + // state.T, + // Region) else Modelica.Media.Water.IF97_Utilities.beta_ph( + // state.p, + // state.h, + // state.phase, + // Region); + // annotation (Inline=true); + end isobaricExpansionCoefficient; +end WaterSteam; diff --git a/ThermoSysPro/Properties/Media/WaterSteam/package.order b/ThermoSysPro/Properties/Media/WaterSteam/package.order new file mode 100644 index 00000000..0b73fe30 --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteam/package.order @@ -0,0 +1,53 @@ +SaturationProperties +ThermodynamicState +Region +BaseProperties +density_ph +temperature_ph +setState_phX +temperature_ps +density_ps +specificEnthalpy_pT +specificEnthalpy_ps +density_pT +dewEnthalpy +dewDensity +setDewState +bubbleEnthalpy +bubbleDensity +setBubbleState +dynamicViscosity +thermalConductivity +surfaceTension +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +velocityOfSound +isentropicEnthalpy +density_derh_p +density_derp_h +bubbleEntropy +dewEntropy +saturationTemperature +saturationTemperature_derp +saturationPressure +dBubbleDensity_dPressure +dDewDensity_dPressure +dBubbleEnthalpy_dPressure +dDewEnthalpy_dPressure +setState_psX +setState_pTX +setSmoothState +setState_dTX +specificEnthalpy_dT +pressure_dT +isentropicExponent +isothermalCompressibility +isobaricExpansionCoefficient diff --git a/ThermoSysPro/Properties/Media/package.mo b/ThermoSysPro/Properties/Media/package.mo new file mode 100644 index 00000000..921e6fe5 --- /dev/null +++ b/ThermoSysPro/Properties/Media/package.mo @@ -0,0 +1,115 @@ +within ThermoSysPro.Properties; +package Media + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Media; diff --git a/ThermoSysPro/Properties/Media/package.order b/ThermoSysPro/Properties/Media/package.order new file mode 100644 index 00000000..e9f32b99 --- /dev/null +++ b/ThermoSysPro/Properties/Media/package.order @@ -0,0 +1,4 @@ +PartialSubCMedium +PartialThermoSysProMedium +PartialTwoPhaseThermoSysProMedium +WaterSteam diff --git a/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo b/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo index 9ffc3a67..6d167cde 100644 --- a/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo +++ b/ThermoSysPro/Properties/MoltenSalt/DynamicViscosity_T.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.MoltenSalt; +within ThermoSysPro.Properties.MoltenSalt; function DynamicViscosity_T "Dynamic Viscosity computation for Salt (input T)" input Units.SI.Temperature T "Temperature (K)"; diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo b/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo index 2adc751b..278c4a3c 100644 --- a/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo +++ b/ThermoSysPro/Properties/MoltenSalt/ThermalConductivity_T.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.MoltenSalt; +within ThermoSysPro.Properties.MoltenSalt; function ThermalConductivity_T "Thermal Conductivity computation for Salt (input T)" diff --git a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo index df9e3978..d35e8c21 100644 --- a/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo +++ b/ThermoSysPro/Properties/MoltenSalt/ThermoPropertiesFunction_T_2.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.MoltenSalt; +within ThermoSysPro.Properties.MoltenSalt; function ThermoPropertiesFunction_T_2 "ThermoPropertiesFunction of Solt: KNO3-NaNO3 " input Units.SI.Temperature T diff --git a/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo b/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo index e63ad72c..e49a13a4 100644 --- a/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo +++ b/ThermoSysPro/Properties/Oil_TherminolVP1/TherminolVP1_Data.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.Oil_TherminolVP1; +within ThermoSysPro.Properties.Oil_TherminolVP1; record TherminolVP1_Data "Data for Oil from STEPHANIE Library" // STEPHANIE TherminolVP1 diff --git a/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo b/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo index 29e697e3..40ffcb0e 100644 --- a/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo +++ b/ThermoSysPro/Properties/WaterSolution/MassFraction_eq_PT.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.WaterSolution; +within ThermoSysPro.Properties.WaterSolution; function MassFraction_eq_PT "Equilibrium mass fraction of the H2O/LiBr solution as a function of T et Xh2o" input Units.SI.AbsolutePressure P "Pressure"; diff --git a/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo b/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo index 896332c2..263d7a1d 100644 --- a/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo +++ b/ThermoSysPro/Properties/WaterSolution/Pressure_eq_TX.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.WaterSolution; +within ThermoSysPro.Properties.WaterSolution; function Pressure_eq_TX "Equilibrium pressure of the H2O/LiBr solution as a funciton of T and Xh2o" input Units.SI.Temperature T "Temperature"; diff --git a/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo b/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo index 7e9b0de0..da9703e4 100644 --- a/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo +++ b/ThermoSysPro/Properties/WaterSteam/BaseIF97.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.WaterSteam; +within ThermoSysPro.Properties.WaterSteam; package BaseIF97 "Modelica Physical Property Model: the new industrial formulation IAPWS-IF97" diff --git a/ThermoSysPro/Properties/WaterSteam/Common.mo b/ThermoSysPro/Properties/WaterSteam/Common.mo index 2484169b..344df89d 100644 --- a/ThermoSysPro/Properties/WaterSteam/Common.mo +++ b/ThermoSysPro/Properties/WaterSteam/Common.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.WaterSteam; +within ThermoSysPro.Properties.WaterSteam; package Common import ThermoSysPro.Units.SI; diff --git a/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo b/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo index db33afc2..8efbcf66 100644 --- a/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo +++ b/ThermoSysPro/Properties/WaterSteam/IF97_packages.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.WaterSteam; +within ThermoSysPro.Properties.WaterSteam; package IF97_packages package IF97_wAJ @@ -2975,7 +2975,7 @@ package IF97_packages end if; Util.Streams.print("end IF97_spline;",fileName); status := true; - annotation (); + annotation(); end dumpOneSpline; package Modelica_Interpolation diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo index 95fa3ae3..741fe13a 100644 --- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo +++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/SpecificEnthalpy_PT_der.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater; +within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater; function SpecificEnthalpy_PT_der input Units.SI.AbsolutePressure p "pressure"; input Units.SI.Temperature T "Temperature"; diff --git a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo index 7a4bd342..1788ea8e 100644 --- a/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo +++ b/ThermoSysPro/Properties/WaterSteamSimple/SimpleWater/Water_Ph_der.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater; +within ThermoSysPro.Properties.WaterSteamSimple.SimpleWater; function Water_Ph_der "Derivative function of Water_Ph" input Units.SI.AbsolutePressure p "Pressure"; input Units.SI.SpecificEnthalpy h "Specific enthalpy"; diff --git a/ThermoSysPro/Properties/package.order b/ThermoSysPro/Properties/package.order index 46af4f53..9ac6910e 100644 --- a/ThermoSysPro/Properties/package.order +++ b/ThermoSysPro/Properties/package.order @@ -10,3 +10,4 @@ WaterSolution SolarSalt ModelicaMediaFlueGases Common +Media From 81201fc0c264fda7bb765b4720ac1ef80ae9870c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 16 May 2025 17:30:41 +0200 Subject: [PATCH 002/213] #125 Organize architecture for Fluid/Example/SimpleExamples for new fluid examples --- .gitignore | 2 +- .../ConcentratedSolarPowerPlant_PTSC.mo | 2 +- .../CombinedCycle_Load_100_50.mo | 4 +- .../Fluid/Examples/Control/MassFlowControl.mo | 2 +- .../Examples/Control/Pump_VelocityControl.mo | 2 +- .../Examples/Control/TemperatureControl.mo | 2 +- .../SimpleExamples/Boilers/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Boilers/package.order | 0 .../BoundaryConditions/package.mo | 116 ++++++++++++++++++ .../BoundaryConditions/package.order | 0 .../SimpleExamples/Combustion/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Combustion/package.order | 0 .../SimpleExamples/Examples/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Examples/package.order | 0 .../SimpleExamples/HeatExchangers/package.mo | 116 ++++++++++++++++++ .../HeatExchangers/package.order | 0 .../SimpleExamples/Interfaces/package.order | 0 .../SimpleExamples/Junctions/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Junctions/package.order | 0 .../SimpleExamples/LoopBreakers/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/LoopBreakers/package.order | 0 .../SimpleExamples/Machines/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Machines/package.order | 0 .../SimpleExamples/PressureLosses/package.mo | 116 ++++++++++++++++++ .../PressureLosses/package.order | 0 .../SimpleExamples/Sensors/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Sensors/package.order | 0 .../SimpleExamples/Volumes/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Volumes/package.order | 0 .../Fluid/Examples/SimpleExamples/package.mo | 22 +--- .../Examples/SimpleExamples/package.order | 11 ++ 31 files changed, 1300 insertions(+), 23 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Interfaces/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order diff --git a/.gitignore b/.gitignore index 3f0d8671..e5321807 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,4 @@ status* *.mof *.c buildlog.txt - +*.bak-mo diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo index 5bb5b9dc..9e28186c 100644 --- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo +++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Fluid.Examples.Book.PowerPlants; +within ThermoSysPro.Fluid.Examples.Book.PowerPlants; model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plant with PTSC" parameter Real L1 = 500 "Longueur de la première chaine de capteurs"; diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo index ebf7222d..386da98d 100644 --- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo +++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo @@ -946,8 +946,8 @@ model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 10 extent={{20,-20},{-20,20}}, rotation=90))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5, C(h_vol_1 - (start=329093.3007791504))) + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0=1.013e5, C(h_vol_1( + start=329093.3007791504))) annotation (Placement(transformation( origin={722,-50}, extent={{10,-10},{-10,10}}, diff --git a/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo b/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo index 39040c01..0e447c9b 100644 --- a/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo +++ b/ThermoSysPro/Fluid/Examples/Control/MassFlowControl.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Fluid.Examples.Control; +within ThermoSysPro.Fluid.Examples.Control; model MassFlowControl "Pump_MassFlowControl" parameter Real k=1 "Gain"; parameter Real Ti=1 "Time constant (s)"; diff --git a/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo b/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo index 74066be1..4fb4d413 100644 --- a/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo +++ b/ThermoSysPro/Fluid/Examples/Control/Pump_VelocityControl.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Fluid.Examples.Control; +within ThermoSysPro.Fluid.Examples.Control; model Pump_VelocityControl "Drum level control" parameter Real k=1 "Gain"; parameter Real Ti=1 "Time constant (s)"; diff --git a/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo b/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo index 21ee184c..ba32fc4a 100644 --- a/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo +++ b/ThermoSysPro/Fluid/Examples/Control/TemperatureControl.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Fluid.Examples.Control; +within ThermoSysPro.Fluid.Examples.Control; model TemperatureControl "Temperature_Control" parameter Real k=1 "Gain"; parameter Real Ti=1 "Time constant (s)"; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo new file mode 100644 index 00000000..57e2eaa8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Boilers + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Boilers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo new file mode 100644 index 00000000..2950299c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package BoundaryConditions + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end BoundaryConditions; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo new file mode 100644 index 00000000..38ce2164 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Combustion + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Combustion; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo new file mode 100644 index 00000000..d4ba3cbb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Examples + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Examples; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo new file mode 100644 index 00000000..8a9e5e13 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package HeatExchangers + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end HeatExchangers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Interfaces/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Interfaces/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo new file mode 100644 index 00000000..92e0061d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Junctions + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Junctions; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo new file mode 100644 index 00000000..b905e02d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package LoopBreakers + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end LoopBreakers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo new file mode 100644 index 00000000..5a53e2bf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Machines + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Machines; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo new file mode 100644 index 00000000..877bf752 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package PressureLosses + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end PressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo new file mode 100644 index 00000000..1493b189 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Sensors + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Sensors; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo new file mode 100644 index 00000000..b6942729 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Volumes + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Volumes; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo index 1a2191ef..bb934deb 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.mo @@ -1,7 +1,6 @@ within ThermoSysPro.Fluid.Examples; package SimpleExamples - -annotation (Icon(graphics={ + annotation (Icon(graphics={ Text( extent={{-102,0},{24,-26}}, lineColor={242,148,0}, @@ -13,21 +12,17 @@ annotation (Icon(graphics={ textString= "SysPro"), Polygon( - points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8}, - {52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{ - -62,2}}, + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, lineColor={46,170,220}, fillColor={46,170,220}, fillPattern=FillPattern.Solid), Polygon( - points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{ - -42,22},{-42,30},{-44,38}}, + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, lineColor={46,170,220}, fillColor={46,170,220}, fillPattern=FillPattern.Solid), Polygon( - points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12}, - {-26,12},{-28,12},{-26,20}}, + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, lineColor={46,170,220}, fillColor={46,170,220}, fillPattern=FillPattern.Solid), @@ -87,9 +82,7 @@ annotation (Icon(graphics={ fillColor={46,170,220}, fillPattern=FillPattern.Solid), Polygon( - points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6}, - {52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62, - 2}}, + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, lineColor={242,148,0}, fillColor={242,148,0}, fillPattern=FillPattern.Solid), @@ -118,8 +111,5 @@ annotation (Icon(graphics={ Line( points={{80,80},{100,100}}, color={0,0,255}, - smooth=Smooth.None)}), Documentation(info=" -

Copyright © EDF 2002 - 2024

-

ThermoSysPro Version 4.1

-")); + smooth=Smooth.None)})); end SimpleExamples; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order index e69de29b..37aecad4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order @@ -0,0 +1,11 @@ +Boilers +BoundaryConditions +Combustion +HeatExchangers +Junctions +LoopBreakers +Machines +PressureLosses +Sensors +Volumes +Examples From aeb77048209bd5ca4752c108e6f4422163289544 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 20 May 2025 17:21:15 +0200 Subject: [PATCH 003/213] #125 SubC name in connectors description --- .../SimpleExamples/Examples/package.mo | 116 ------------------ .../Examples/SimpleExamples/package.order | 1 - .../Fluid/Interfaces/Connectors/FluidInlet.mo | 4 +- .../Interfaces/Connectors/FluidOutlet.mo | 4 +- 4 files changed, 4 insertions(+), 121 deletions(-) delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo deleted file mode 100644 index d4ba3cbb..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Examples/package.mo +++ /dev/null @@ -1,116 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; -package Examples - - annotation (Icon(graphics={ - Text( - extent={{-102,0},{24,-26}}, - lineColor={242,148,0}, - textString= - "Thermo"), - Text( - extent={{-4,8},{68,-34}}, - lineColor={46,170,220}, - textString= - "SysPro"), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,30},{-6,26}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,36},{-6,32}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,42},{-6,38}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,48},{-6,44}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,32},{-2,28}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,38},{-2,34}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,44},{-2,40}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,50},{-2,46}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Line( - points={{22,12},{22,14},{22,16},{24,14},{20,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{26,12},{26,14},{26,16},{28,14},{24,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{30,10},{30,12},{30,14},{32,12},{28,16}}, - color={46,170,220}, - thickness=0.5), - Polygon( - points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), - Line( - points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{80,80},{100,100}}, - color={0,0,255}, - smooth=Smooth.None)})); -end Examples; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order index 37aecad4..4d0be736 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order @@ -8,4 +8,3 @@ Machines PressureLosses Sensors Volumes -Examples diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo index f88c9d63..12cef6b9 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidInlet "Fluid inlet connector" replaceable package Medium = - ThermoSysPro.Properties.Media.WaterSteam constrainedby Modelica.Media.Interfaces.PartialMedium + ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(group="Medium")); Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start=500) @@ -13,7 +13,7 @@ connector FluidInlet "Fluid inlet connector" Units.SI.SpecificEnthalpy h_vol_2(start=1.e5) "Fluid specific enthalpy in the control volume 2"; Medium.ExtraProperty SubC[Medium.nC] - "Properties c_i/m of the fluid crossing the boundary of the control volume"; + "Substances concentration (ppm) of the fluid crossing the boundary of the control volume"; Medium.MassFraction Xi[Medium.nXi] "Independent mixture mass fractions m_i/m of the fluid crossing the boundary of the control volume"; input Real diff_res_1(start=1e4) diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo index 52c98b76..2f5dd7d3 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidOutlet "Fluid outlet connector" replaceable package Medium = - ThermoSysPro.Properties.Media.WaterSteam constrainedby Modelica.Media.Interfaces.PartialMedium + ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(group="Medium")); Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start=500) @@ -13,7 +13,7 @@ connector FluidOutlet "Fluid outlet connector" Units.SI.SpecificEnthalpy h_vol_2(start=1.e5) "Fluid specific enthalpy in the control volume 2"; Medium.ExtraProperty SubC[Medium.nC] - "Properties c_i/m of the fluid crossing the boundary of the control volume"; + "Substances concentration (ppm) of the fluid crossing the boundary of the control volume"; Medium.MassFraction Xi[Medium.nXi] "Independent mixture mass fractions m_i/m of the fluid crossing the boundary of the control volume"; output Real diff_res_1(start=1e4) From 80e58c474f4b2c75e033cc606b86d74ac2050e94 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 21 May 2025 19:22:04 +0200 Subject: [PATCH 004/213] #125 Added h_offset to a FlueGases media --- .../Properties/Media/FlueGases/package.mo | 24 +++++++++++++++++++ .../Properties/Media/FlueGases/package.order | 1 + ThermoSysPro/Properties/Media/package.order | 1 + 3 files changed, 26 insertions(+) create mode 100644 ThermoSysPro/Properties/Media/FlueGases/package.mo create mode 100644 ThermoSysPro/Properties/Media/FlueGases/package.order diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.mo b/ThermoSysPro/Properties/Media/FlueGases/package.mo new file mode 100644 index 00000000..98475975 --- /dev/null +++ b/ThermoSysPro/Properties/Media/FlueGases/package.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Properties.Media; +package FlueGases "Flue gases library inherited from Modelica.Media" + import Modelica.Media.Interfaces.Choices.ReferenceEnthalpy; + + extends PartialSubCMedium(nSubC=nC); + extends Modelica.Media.IdealGases.Common.MixtureGasNasa( + mediumName="MediaMonomeld", + data={Modelica.Media.IdealGases.Common.SingleGasesData.N2,Modelica.Media.IdealGases.Common.SingleGasesData.O2, + Modelica.Media.IdealGases.Common.SingleGasesData.H2O,Modelica.Media.IdealGases.Common.SingleGasesData.CO2, + Modelica.Media.IdealGases.Common.SingleGasesData.SO2}, + fluidConstants={Modelica.Media.IdealGases.Common.FluidData.N2,Modelica.Media.IdealGases.Common.FluidData.O2, + Modelica.Media.IdealGases.Common.FluidData.H2O,Modelica.Media.IdealGases.Common.FluidData.CO2, + Modelica.Media.IdealGases.Common.FluidData.SO2}, + substanceNames={"Nitrogen","Oxygen","Water","Carbondioxide","Sulfurdioxide"}, + reference_X={0.768,0.232,0.0,0.0,0.0}, + referenceChoice=ReferenceEnthalpy.UserDefined, + h_offset=hr); + + constant Units.SI.SpecificEnthalpy hr=2501569 "ThermoSysPro Water/steam reference specific enthalpy at 0.01°C"; + + annotation (Documentation(info=" + +")); +end FlueGases; diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.order b/ThermoSysPro/Properties/Media/FlueGases/package.order new file mode 100644 index 00000000..fcb5e9c6 --- /dev/null +++ b/ThermoSysPro/Properties/Media/FlueGases/package.order @@ -0,0 +1 @@ +hr diff --git a/ThermoSysPro/Properties/Media/package.order b/ThermoSysPro/Properties/Media/package.order index e9f32b99..8d9e6275 100644 --- a/ThermoSysPro/Properties/Media/package.order +++ b/ThermoSysPro/Properties/Media/package.order @@ -2,3 +2,4 @@ PartialSubCMedium PartialThermoSysProMedium PartialTwoPhaseThermoSysProMedium WaterSteam +FlueGases From d6f15cbdc0edd7dec7f3542bc1add57876a1b03d Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 22 May 2025 11:32:05 +0200 Subject: [PATCH 005/213] #125 modification of h_offset to be equal to old FlueGases implementation --- ThermoSysPro/Properties/Media/FlueGases/package.mo | 3 ++- ThermoSysPro/Properties/Media/FlueGases/package.order | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.mo b/ThermoSysPro/Properties/Media/FlueGases/package.mo index 98475975..11e4197f 100644 --- a/ThermoSysPro/Properties/Media/FlueGases/package.mo +++ b/ThermoSysPro/Properties/Media/FlueGases/package.mo @@ -14,9 +14,10 @@ package FlueGases "Flue gases library inherited from Modelica.Media" substanceNames={"Nitrogen","Oxygen","Water","Carbondioxide","Sulfurdioxide"}, reference_X={0.768,0.232,0.0,0.0,0.0}, referenceChoice=ReferenceEnthalpy.UserDefined, - h_offset=hr); + h_offset = hr - hr_FlueGases + Modelica.Media.IdealGases.Common.SingleGasesData.H2O.H0); constant Units.SI.SpecificEnthalpy hr=2501569 "ThermoSysPro Water/steam reference specific enthalpy at 0.01°C"; + constant Units.SI.SpecificEnthalpy hr_FlueGases=503298 "FlueGases reference specific enthalpy, computed from ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) at (0.006112 bars, 0.01°C)"; annotation (Documentation(info=" diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.order b/ThermoSysPro/Properties/Media/FlueGases/package.order index fcb5e9c6..9965a189 100644 --- a/ThermoSysPro/Properties/Media/FlueGases/package.order +++ b/ThermoSysPro/Properties/Media/FlueGases/package.order @@ -1 +1,2 @@ hr +hr_FlueGases From 9a4c1d653616e81959222e5c9e9190a81e1f2e7c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 22 May 2025 15:16:03 +0200 Subject: [PATCH 006/213] #125 SourcePQ PipePressureLoss and Sink with examples --- ThermoSysPro/Fluid/BoundaryConditions/Sink.mo | 50 +++--------- .../Fluid/BoundaryConditions/SourcePQ.mo | 79 +++++-------------- .../PressureLosses/TestPipePressureLoss.mo | 13 +++ .../TestPipePressureLoss_FlueGases.mo | 20 +++++ .../TestPipePressureLoss_Traces.mo | 14 ++++ .../PressureLosses/package.order | 3 + .../Fluid/Interfaces/Connectors/FluidInlet.mo | 2 +- .../Interfaces/Connectors/FluidOutlet.mo | 2 +- .../Fluid/PressureLosses/PipePressureLoss.mo | 29 +++---- ThermoSysPro/UsersGuide.mo | 24 ++++++ 10 files changed, 119 insertions(+), 117 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo index dd6fc780..f2e804a2 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo @@ -1,43 +1,23 @@ within ThermoSysPro.Fluid.BoundaryConditions; model Sink "MultiFluids sink" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface; - extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.Temperature T0=290 - "Source temperature (active if option_temperature=true)" - annotation (Evaluate=true, Dialog(enable=option_temperature)); - parameter Units.SI.SpecificEnthalpy h0=100000 - "Source specific enthalpy (active if option_temperature=false)" - annotation (Evaluate=true, Dialog(enable=not option_temperature)); - parameter Boolean option_temperature=false - "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean diffusion=false - "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + extends ThermoSysPro.Fluid.Interfaces.IconColors; -protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - Real Xco2(start=0.01) - "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o - "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start=0.2) - "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start=0) - "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" @@ -54,12 +34,8 @@ equation C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; + X = C.Xi; + SubC = C.SubC; /* Specific enthalpy or temperature */ if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then @@ -72,10 +48,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation ( diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo index 40e3e63b..29d16491 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo @@ -1,53 +1,22 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SourcePQ "MultiFluids source with fixed pressure and mass flow rate" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - - parameter Units.SI.AbsolutePressure P0=300000 - "Fluid pressure (active if IPressure connector is not connected)"; - parameter Units.SI.MassFlowRate Q0=100 - "Mass flow (active if IMassFlow connector is not connected)"; - parameter Units.SI.Temperature T0=290 - "Source temperature (active if option_temperature=true)" - annotation (Evaluate=true, Dialog(enable=option_temperature)); - parameter Units.SI.SpecificEnthalpy h0=100000 - "Source specific enthalpy (active if option_temperature=false)" - annotation (Evaluate=true, Dialog(enable=not option_temperature)); - parameter Boolean option_temperature=false - "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean continuous_flow_reversal=false - "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion=false - "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco2= 0.01 "CO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2= 0.22 "O2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.AbsolutePressure P0=300000 "Fluid pressure (active if IPressure connector is not connected)"; + parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2= 0 "SO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - -protected - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + group="Medium")); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; @@ -72,7 +41,7 @@ public origin={0,-50}, extent={{10,-10},{-10,10}}, rotation=270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -83,19 +52,9 @@ equation C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; + C.SubC=SubC0; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; + C.Xi = X0[1:Medium.nXi]; /* Mass flow */ if (cardinality(IMassFlow) == 0) then @@ -122,10 +81,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo new file mode 100644 index 00000000..59b00b69 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestPipePressureLoss + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestPipePressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo new file mode 100644 index 00000000..728fb69a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestPipePressureLoss_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestPipePressureLoss_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo new file mode 100644 index 00000000..baebf5cd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestPipePressureLoss_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestPipePressureLoss_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e69de29b..eb3436e6 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -0,0 +1,3 @@ +TestPipePressureLoss +TestPipePressureLoss_FlueGases +TestPipePressureLoss_Traces diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo index 12cef6b9..cf97ea60 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo @@ -2,7 +2,7 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidInlet "Fluid inlet connector" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium - "Medium model" annotation (choicesAllMatching=true, Dialog(group="Medium")); + "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid",group="Medium")); Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start=500) "Mass flow rate of the fluid crossing the boundary of the control volume"; diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo index 2f5dd7d3..913ee8dd 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo @@ -2,7 +2,7 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidOutlet "Fluid outlet connector" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium - "Medium model" annotation (choicesAllMatching=true, Dialog(group="Medium")); + "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid",group="Medium")); Units.SI.Pressure P(start=1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start=500) "Mass flow rate of the fluid crossing the boundary of the control volume"; diff --git a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo index 6623b609..c9d337fd 100644 --- a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.PressureLosses; model PipePressureLoss "Pipe generic pressure loss" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real K=10 "Friction pressure loss coefficient"; parameter Units.SI.Position z1=0 "Inlet altitude"; parameter Units.SI.Position z2=0 "Outlet altitude"; @@ -10,11 +11,8 @@ model PipePressureLoss "Pipe generic pressure loss" "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; public @@ -26,13 +24,12 @@ public Units.SI.Temperature T(start=290) "Fluid temperature"; Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure"; Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -48,19 +45,15 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; + X = C1.Xi; deltaP = C1.P - C2.P; - ftype = C1.ftype; - /* Pressure loss */ deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho; deltaPg = rho*g*(z2 - z1); @@ -69,12 +62,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( diff --git a/ThermoSysPro/UsersGuide.mo b/ThermoSysPro/UsersGuide.mo index 304dda34..380d583d 100644 --- a/ThermoSysPro/UsersGuide.mo +++ b/ThermoSysPro/UsersGuide.mo @@ -1268,6 +1268,30 @@ action. This section shall survive the termination of this License.

extent={{-12.5,-12.5},{12.5,12.5}})})); end ThermoSysProDocumentation; + + package Icons + + partial model Example + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100,-100},{100,100}}, + radius=25.0), + Polygon( + origin={8,14}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), Diagram(coordinateSystem(preserveAspectRatio=false))); + end Example; + end Icons; annotation (DocumentationClass=true, Documentation(info="

Users Guide of the ThermoSysPro Library

ThermoSysPro is a library for the modelling and simulation of power plants and energy systems. It is developed with the Modelica language from the Modelica Association. It provides components in various disciplines related to the modelling of power plants and energy systems.

From a58f96fd055b013aa2d912cb5784653e64f0fd2a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 22 May 2025 16:39:19 +0200 Subject: [PATCH 007/213] #125 SourceQ and VolumeC --- .../Fluid/BoundaryConditions/SourceQ.mo | 63 ++----- .../PressureLosses/TestVolumeC.mo | 15 ++ .../PressureLosses/TestVolumeC_FlueGases.mo | 25 +++ .../PressureLosses/TestVolumeC_Traces.mo | 17 ++ .../PressureLosses/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeC.mo | 176 ++++++------------ 6 files changed, 130 insertions(+), 169 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_Traces.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo index 1443d760..6ef3492e 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo @@ -1,11 +1,9 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SourceQ "Multi-fluid source with fixed mass flow rate" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; parameter Units.SI.Temperature T0=290 @@ -20,32 +18,12 @@ model SourceQ "Multi-fluid source with fixed mass flow rate" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco2= 0.01 "CO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2= 0.22 "O2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2= 0 "SO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - -protected - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + group="Medium")); public Units.SI.MassFlowRate Q "Fluid mass flow rate"; @@ -54,17 +32,12 @@ public Units.SI.Temperature T(start=300) "Fluid temperature"; public - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow - "Fixed mass flow rate" - annotation (Placement(transformation( + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation (Placement(transformation( origin={0,50}, extent={{-10,-10},{10,10}}, rotation=270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement( - transformation(extent={{90,-10},{110,10}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature - "Fixed specific enthalpy or temperature according to option_temperature" - annotation (Placement(transformation( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation (Placement(transformation( origin={0,-50}, extent={{10,-10},{-10,10}}, rotation=270))); @@ -77,19 +50,9 @@ equation C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; + C.SubC=SubC0; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; + C.Xi = X0[1:Medium.nXi]; /* Mass flow rate */ if (cardinality(IMassFlow) == 0) then @@ -109,10 +72,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC.mo new file mode 100644 index 00000000..32a60055 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC.mo @@ -0,0 +1,15 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestVolumeC + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeC; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_FlueGases.mo new file mode 100644 index 00000000..1b40a056 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_FlueGases.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestVolumeC_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeC_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_Traces.mo new file mode 100644 index 00000000..c455a404 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_Traces.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestVolumeC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1}) + annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index eb3436e6..52916924 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -1,3 +1,6 @@ TestPipePressureLoss TestPipePressureLoss_FlueGases TestPipePressureLoss_Traces +TestVolumeC +TestVolumeC_FlueGases +TestVolumeC_Traces diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo index 8f999f96..c67202f8 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo @@ -1,11 +1,10 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model VolumeC "Mixing volume with 3 inlets and 1 outlet" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS (SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; parameter Units.SI.Volume V=1 @@ -29,42 +28,17 @@ model VolumeC "Mixing volume with 3 inlets and 1 outlet" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( + "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; + constant Boolean isCompressible = Medium.isCompressible; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature T "Fluid temperature"; @@ -77,15 +51,12 @@ public "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Boundary trace substances"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Boundary trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -100,15 +71,15 @@ public Real re3 "Value of r(Q/gamma) for inlet e3"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0), iconTransformation(extent={{-110,-10},{-90,10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0), iconTransformation(extent={{-10,90},{10,110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{ 10,-90}}))); initial equation @@ -128,19 +99,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -150,16 +113,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeC: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -167,11 +120,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -180,11 +130,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then @@ -193,11 +140,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Cs) == 0) then @@ -211,7 +155,7 @@ equation BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -222,13 +166,13 @@ equation P = Cs.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o *hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -240,36 +184,28 @@ equation Cs.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q - Cs.Xi*Cs.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC - Cs.Q*Cs.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs.ftype = ftype; + Cs.SubC = SubC; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + Cs.Xi = X; /* Flow reversal */ if continuous_flow_reversal then @@ -325,19 +261,21 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( From 518792661be75fea3f6798d9d5f337e81341509a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 22 May 2025 16:39:38 +0200 Subject: [PATCH 008/213] #125 SourceQ and VolumeC --- ThermoSysPro/Properties/Media/FlueGases/package.mo | 2 +- ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo | 1 + ThermoSysPro/Properties/Media/PartialSubCMedium/package.order | 1 + ThermoSysPro/Properties/Media/WaterSteam/package.mo | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.mo b/ThermoSysPro/Properties/Media/FlueGases/package.mo index 11e4197f..514261ef 100644 --- a/ThermoSysPro/Properties/Media/FlueGases/package.mo +++ b/ThermoSysPro/Properties/Media/FlueGases/package.mo @@ -2,7 +2,7 @@ within ThermoSysPro.Properties.Media; package FlueGases "Flue gases library inherited from Modelica.Media" import Modelica.Media.Interfaces.Choices.ReferenceEnthalpy; - extends PartialSubCMedium(nSubC=nC); + extends PartialSubCMedium(nSubC=nC,isCompressible=true); extends Modelica.Media.IdealGases.Common.MixtureGasNasa( mediumName="MediaMonomeld", data={Modelica.Media.IdealGases.Common.SingleGasesData.N2,Modelica.Media.IdealGases.Common.SingleGasesData.O2, diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo index 133f5bc5..c689fdcb 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo @@ -1,5 +1,6 @@ within ThermoSysPro.Properties.Media; partial package PartialSubCMedium constant Integer nSubC; + constant Boolean isCompressible; end PartialSubCMedium; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order index d5bff50f..62ead749 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order @@ -1,4 +1,5 @@ nSubC +isCompressible partialPhasesSeparation HomogeneousPhasesSeparation C_BiPhase diff --git a/ThermoSysPro/Properties/Media/WaterSteam/package.mo b/ThermoSysPro/Properties/Media/WaterSteam/package.mo index b47b1c4c..12e82bc9 100644 --- a/ThermoSysPro/Properties/Media/WaterSteam/package.mo +++ b/ThermoSysPro/Properties/Media/WaterSteam/package.mo @@ -2,6 +2,7 @@ within ThermoSysPro.Properties.Media; package WaterSteam "1 - Water/steam properties library (IAPWS-IF97)" extends PartialTwoPhaseThermoSysProMedium( + isCompressible=true, mediumName="WaterIF97", substanceNames={"water"}, singleState=false, From b71ba451aaa87a75764b2336e413b7f485bf6156 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 22 May 2025 16:49:00 +0200 Subject: [PATCH 009/213] #125 VolumeC examples moved to the correct folder --- .../Fluid/Examples/SimpleExamples/PressureLosses/package.order | 3 --- .../SimpleExamples/{PressureLosses => Volumes}/TestVolumeC.mo | 2 +- .../{PressureLosses => Volumes}/TestVolumeC_FlueGases.mo | 2 +- .../{PressureLosses => Volumes}/TestVolumeC_Traces.mo | 2 +- .../Fluid/Examples/SimpleExamples/Volumes/package.order | 3 +++ 5 files changed, 6 insertions(+), 6 deletions(-) rename ThermoSysPro/Fluid/Examples/SimpleExamples/{PressureLosses => Volumes}/TestVolumeC.mo (94%) rename ThermoSysPro/Fluid/Examples/SimpleExamples/{PressureLosses => Volumes}/TestVolumeC_FlueGases.mo (95%) rename ThermoSysPro/Fluid/Examples/SimpleExamples/{PressureLosses => Volumes}/TestVolumeC_Traces.mo (95%) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index 52916924..eb3436e6 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -1,6 +1,3 @@ TestPipePressureLoss TestPipePressureLoss_FlueGases TestPipePressureLoss_Traces -TestVolumeC -TestVolumeC_FlueGases -TestVolumeC_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo similarity index 94% rename from ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC.mo rename to ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo index 32a60055..31eb2b99 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeC extends ThermoSysPro.UsersGuide.Icons.Example; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo similarity index 95% rename from ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_FlueGases.mo rename to ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo index 1b40a056..0c4f3674 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeC_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo similarity index 95% rename from ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_Traces.mo rename to ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo index c455a404..457a8afe 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestVolumeC_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo @@ -1,4 +1,4 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeC_Traces extends ThermoSysPro.UsersGuide.Icons.Example; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index e69de29b..f5870693 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -0,0 +1,3 @@ +TestVolumeC +TestVolumeC_FlueGases +TestVolumeC_Traces From 4fd0c0a1b0aef1628f1eca7d4b37c66d41ed7865 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 22 May 2025 16:55:21 +0200 Subject: [PATCH 010/213] #125 VolumeC FlueGases with startValue for OpenModelica --- .../Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo index 0c4f3674..fe58ef01 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo @@ -12,7 +12,7 @@ model TestVolumeC_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, T0=573.15, From 408236adb6c0b799cab588235ec23a6485f8cdf0 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 22 May 2025 17:11:18 +0200 Subject: [PATCH 011/213] #125 SaS in VolumeC defined from Properties so that no Warnings --- ThermoSysPro/Fluid/Volumes/VolumeC.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo index c67202f8..ff559ee6 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo @@ -4,7 +4,7 @@ model VolumeC "Mixing volume with 3 inlets and 1 outlet" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function SaS = Medium.noSaS (SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = ThermoSysPro.Properties.Media.PartialSubCMedium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; parameter Units.SI.Volume V=1 From ab9b85a7d4e7f1820645a58c6efe8d38e72e1ff4 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 23 May 2025 09:11:08 +0200 Subject: [PATCH 012/213] #125 Modified TSP version to 5.0 --- ThermoSysPro/package.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/package.mo b/ThermoSysPro/package.mo index 3c7dee3b..42837b37 100644 --- a/ThermoSysPro/package.mo +++ b/ThermoSysPro/package.mo @@ -126,5 +126,5 @@ annotation (

Copyright © EDF 2002 - 2024

ThermoSysPro version 4.1

"), - version="4.1"); + version="5.0"); end ThermoSysPro; From 6b678e5844e5f1d086103c28667a933ce37fb3f9 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 23 May 2025 10:12:07 +0200 Subject: [PATCH 013/213] #125 Dryer --- .../SimpleExamples/Junctions/TestDryer.mo | 16 +++ .../Junctions/TestDryer_Traces.mo | 16 +++ .../SimpleExamples/Junctions/package.order | 2 + .../PhasesSeparation.mo | 18 +++ .../WaterSteam_NonVolatileTrace/package.mo | 5 + .../WaterSteam_NonVolatileTrace/package.order | 1 + .../Examples/SimpleExamples/Media/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Media/package.order | 1 + .../Examples/SimpleExamples/package.order | 1 + ThermoSysPro/Fluid/Junctions/SteamDryer.mo | 76 +++++------- ThermoSysPro/Fluid/Volumes/VolumeC.mo | 4 +- 11 files changed, 206 insertions(+), 50 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo new file mode 100644 index 00000000..ed49127a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); +equation + connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); + connect(sink.C, steamDryer.Csv) annotation (Line(points={{30,0},{9.9,0}}, color={0,0,0})); + connect(steamDryer.Csl, sink_cond.C) annotation (Line(points={{0.1,-14},{0.1,-30},{30,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDryer; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo new file mode 100644 index 00000000..72b8fd1f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6, + SubC0={1}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare replaceable package Medium = Medium, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamDryer.xe)) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); +equation + connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); + connect(sink.C, steamDryer.Csv) annotation (Line(points={{30,0},{9.9,0}}, color={0,0,0})); + connect(steamDryer.Csl, sink_cond.C) annotation (Line(points={{0.1,-14},{0.1,-30},{30,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDryer_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index e69de29b..0779eefb 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -0,0 +1,2 @@ +TestDryer +TestDryer_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo new file mode 100644 index 00000000..d1d7026a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; +function PhasesSeparation + extends partialPhasesSeparation; + input Real x(min=0, max=1) "Title"; + +algorithm + // // HomogeneousSubstance + // C_record.Cl := SubC; + // C_record.Cg := SubC; + + // Non-volatile + C_record.Cl := SubC/(1 - x); + C_record.Cg := fill(0, size(SubC, 1)); + + // // Fully-volatile + // C_record.Cl := fill(0,size(SubC,1)); + // C_record.Cg := SubC / x; +end PhasesSeparation; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo new file mode 100644 index 00000000..09644f8a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +package WaterSteam_NonVolatileTrace + extends Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + +end WaterSteam_NonVolatileTrace; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order new file mode 100644 index 00000000..11ebc226 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order @@ -0,0 +1 @@ +PhasesSeparation diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo new file mode 100644 index 00000000..92af1d3a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Media + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Media; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order new file mode 100644 index 00000000..cc36f421 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order @@ -0,0 +1 @@ +WaterSteam_NonVolatileTrace diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order index 4d0be736..6f19330f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order @@ -8,3 +8,4 @@ Machines PressureLosses Sensors Volumes +Media diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo index b6956a1a..4bd0555c 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo @@ -1,33 +1,32 @@ within ThermoSysPro.Fluid.Junctions; model SteamDryer "Steam dryer" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = ThermoSysPro.Properties.Media.PartialSubCMedium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = ThermoSysPro.Properties.Media.PartialSubCMedium.HomogeneousPhasesSeparation(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); parameter Real eta=1 "Steam dryer efficiency (0 <= eta <= 1)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer fluid=Integer(ftype) "Fluid number"; + Medium.C_BiPhase C_record; public Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; + Units.SI.Density rho(start=1.0) "Fluid density at inlet"; Real xe(start=1.0) "Vapor mass fraction at the inlet"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Units.SI.Power Jev "Thermal power diffusion from inlet ev"; Units.SI.Power Jsv "Thermal power diffusion from outlet sv"; Units.SI.Power Jsl "Thermal power diffusion from outlet sl"; @@ -40,31 +39,16 @@ public Real rsl "Value of r(Q/gamma) for outlet sl"; public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev annotation (Placement( + Medium.SaturationProperties sat; + Medium.ThermodynamicState state_e; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-109,30},{-89,50}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csv annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csv(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{89,30},{109,50}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1 - annotation (Placement(transformation(extent={{-100,-98},{-80,-78}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1 - annotation (Placement(transformation(extent={{-76,-98},{-56,-78}}, rotation= - 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csl annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csl(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cev.ftype; - fluids[3] = Csv.ftype; - fluids[4] = Csl.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "SteamDryer: fluids mixing in volume are not compatible with each other"); /* Check that eta is between 0 and 1 */ assert((eta >= 0) and (eta <= 1), "SteamDryer - Parameter eta should be >= 0 and <= 1"); @@ -84,26 +68,21 @@ equation Cev.h_vol_2 = h; Csv.h_vol_1 = h; - Csl.h_vol_1 = noEvent(if (xe > 0) then lsat1.h else Cev.h); + Csl.h_vol_1 = noEvent(if (xe > 0) then Medium.bubbleEnthalpy(sat) else Cev.h); /* Fluid composition balance equations*/ - 0 = Cev.Xco2*Cev.Q - Csv.Xco2*Csv.Q - Csl.Xco2*Csl.Q; - 0 = Cev.Xh2o*Cev.Q - Csv.Xh2o*Csv.Q - Csl.Xh2o*Csl.Q; - 0 = Cev.Xo2*Cev.Q - Csv.Xo2*Csv.Q - Csl.Xo2*Csl.Q; - 0 = Cev.Xso2*Cev.Q - Csv.Xso2*Csv.Q - Csl.Xso2*Csl.Q; + Cev.Xi*Cev.Q = Csv.Xi*Csv.Q + Csl.Xi*Csl.Q; + + Csv.Xi = X; + Csl.Xi = X; - Csv.ftype = ftype; - Csl.ftype = ftype; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + Csv.SubC = C_record.Cg; - Csv.Xco2 = Xco2; - Csv.Xh2o = Xh2o; - Csv.Xo2 = Xo2; - Csv.Xso2 = Xso2; + Csv.Q*Csv.SubC + Csl.Q*Csl.SubC = Cev.Q*Cev.SubC + SubCSaS * Cev.Q; - Csl.Xco2 = Xco2; - Csl.Xh2o = Xh2o; - Csl.Xo2 = Xo2; - Csl.Xso2 = Xso2; + SubCSaS = SaS(); /* Flow reversal */ if continuous_flow_reversal then @@ -152,13 +131,14 @@ equation Csl.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - proe = ThermoSysPro.Properties.Fluid.Ph(Cev.P, Cev.h, mode_e, fluid); + state_e=Medium.setState_phX(p=Cev.P, h=Cev.h, X=Cev.Xi, region=mode_e); + rho = state_e.d; /* Vapor mass fraction at the inlet */ - xe = proe.x; + xe=Medium.vapourQuality(state_e); /* Fluid thermodynamic properties at the saturation point */ - (lsat1,vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Cev.P, fluid); + sat = Medium.setSat_p(Cev.P); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo index ff559ee6..1de3a36a 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo @@ -52,9 +52,9 @@ public Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; - Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Boundary trace substances"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; - Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Boundary trace substances"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; From 06cb25922bf7d9cef91d921e03c8f0beea017f0e Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 23 May 2025 10:53:15 +0200 Subject: [PATCH 014/213] #125 no more replaceable in redeclaration example so that no warnings, and no partial lookup for OpenModelica --- .../Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo | 2 +- .../Examples/SimpleExamples/Junctions/TestDryer_Traces.mo | 2 +- .../Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo | 2 +- .../Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo | 2 +- .../Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo | 2 +- ThermoSysPro/Fluid/Junctions/SteamDryer.mo | 4 ++-- ThermoSysPro/Fluid/Volumes/VolumeC.mo | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo index ed49127a..6bb1a642 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo @@ -6,7 +6,7 @@ model TestDryer ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); equation connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo index 72b8fd1f..a78582a8 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo @@ -6,7 +6,7 @@ model TestDryer_Traces ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6, SubC0={1}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare replaceable package Medium = Medium, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamDryer.xe)) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamDryer.xe)) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); equation connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo index 31eb2b99..60ba1d38 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo @@ -5,7 +5,7 @@ model TestVolumeC replaceable package Medium = Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); equation connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo index fe58ef01..e17f46c6 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo @@ -12,7 +12,7 @@ model TestVolumeC_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, T0=573.15, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo index 457a8afe..77037832 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo @@ -6,7 +6,7 @@ model TestVolumeC_Traces ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); equation diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo index 4bd0555c..a0363f2d 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo @@ -5,8 +5,8 @@ model SteamDryer "Steam dryer" import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function SaS = ThermoSysPro.Properties.Media.PartialSubCMedium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = ThermoSysPro.Properties.Media.PartialSubCMedium.HomogeneousPhasesSeparation(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); parameter Real eta=1 "Steam dryer efficiency (0 <= eta <= 1)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo index 1de3a36a..5d9b59ac 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo @@ -4,7 +4,7 @@ model VolumeC "Mixing volume with 3 inlets and 1 outlet" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function SaS = ThermoSysPro.Properties.Media.PartialSubCMedium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; parameter Units.SI.Volume V=1 From 5f858097556a9062e583e6519007e83b0ed3be89 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Fri, 23 May 2025 11:51:43 +0200 Subject: [PATCH 015/213] #125 SingularPressureLoss --- .../TestSingularPressureLoss.mo | 22 ++++++++++++++ .../TestSingularPressureLoss_Traces.mo | 22 ++++++++++++++ ...stSingularPressureLoss_Traces_FlueGases.mo | 24 +++++++++++++++ .../PressureLosses/package.order | 3 ++ .../PressureLosses/SingularPressureLoss.mo | 30 +++++++++---------- 5 files changed, 85 insertions(+), 16 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo new file mode 100644 index 00000000..2b78a5a7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSingularPressureLoss + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(singularPressureLoss.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(singularPressureLoss.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestSingularPressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo new file mode 100644 index 00000000..c67d6dd3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSingularPressureLoss_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={10,20,30}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(singularPressureLoss.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(singularPressureLoss.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestSingularPressureLoss_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo new file mode 100644 index 00000000..a13b12e3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSingularPressureLoss_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, option_temperature=true) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={10,20,30}, + X0={0.1,0.2,0.3,0.2,0.2}, + option_temperature=true) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(singularPressureLoss.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(singularPressureLoss.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestSingularPressureLoss_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index eb3436e6..21b7a582 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -1,3 +1,6 @@ TestPipePressureLoss TestPipePressureLoss_FlueGases TestPipePressureLoss_Traces +TestSingularPressureLoss +TestSingularPressureLoss_Traces +TestSingularPressureLoss_Traces_FlueGases diff --git a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo index e055743c..c9f6a9b7 100644 --- a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo @@ -1,17 +1,15 @@ within ThermoSysPro.Fluid.PressureLosses; model SingularPressureLoss "Singular pressure loss" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real K=1.e-4 "Pressure loss coefficient"; parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; public @@ -21,13 +19,14 @@ public Units.SI.Temperature T(start=290) "Fluid temperature"; Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure"; Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); + equation C1.Q = C2.Q; @@ -42,18 +41,17 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; + - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; /* Pressure loss */ deltaP = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho; @@ -61,12 +59,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( From 0ebe873bcb9c6dc06080da1aaa9b8ccce76eeade Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Fri, 23 May 2025 13:15:44 +0200 Subject: [PATCH 016/213] #125-SingularPressureLoss added color extend for OM compatibility --- ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo index c9f6a9b7..583f3511 100644 --- a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo @@ -1,6 +1,6 @@ within ThermoSysPro.Fluid.PressureLosses; model SingularPressureLoss "Singular pressure loss" - +extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real K=1.e-4 "Pressure loss coefficient"; From f8be2834afcc4776561074fbd47b110cf7dc57ff Mon Sep 17 00:00:00 2001 From: HOCINE-RASTIC Sarah Date: Wed, 28 May 2025 12:05:15 +0200 Subject: [PATCH 017/213] #125 VolumeA --- .../SimpleExamples/Volumes/TestVolumeA.mo | 19 ++ .../Volumes/TestVolumeA_FlueGases.mo | 26 +++ .../Volumes/TestVolumeA_Traces.mo | 26 +++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeA.mo | 178 ++++++------------ 5 files changed, 133 insertions(+), 119 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo new file mode 100644 index 00000000..13e231d2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeA + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeA.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeA; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo new file mode 100644 index 00000000..fe764acd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeA_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeA.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeA_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo new file mode 100644 index 00000000..35f5de29 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeA_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30, + 30}}, color={0,0,0})); + connect(volumeA.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeA_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index f5870693..f71ca450 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -1,3 +1,6 @@ TestVolumeC TestVolumeC_FlueGases TestVolumeC_Traces +TestVolumeA +TestVolumeA_FlueGases +TestVolumeA_Traces diff --git a/ThermoSysPro/Fluid/Volumes/VolumeA.mo b/ThermoSysPro/Fluid/Volumes/VolumeA.mo index 4677b61e..fad042ec 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeA.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeA.mo @@ -1,10 +1,10 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model VolumeA "Mixing volume with 2 inlets and 2 outlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; @@ -29,42 +29,19 @@ model VolumeA "Mixing volume with 2 inlets and 2 outlets" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0=1.e-4 + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature T "Fluid temperature"; @@ -77,15 +54,12 @@ public "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -101,14 +75,14 @@ public Real rs2 "Value of r(Q/gamma) for outlet s2"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0), iconTransformation(extent={{-10,90},{10,110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then @@ -127,19 +101,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -149,16 +115,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeA: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -166,11 +122,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -179,11 +132,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -204,7 +154,7 @@ equation BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -215,13 +165,13 @@ equation P = Cs2.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -233,42 +183,30 @@ equation Cs2.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; + Cs1.Xi = X; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + Cs2.Xi = X; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -325,20 +263,22 @@ equation Cs2.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + if isCompressible and dynamic_mass_balance then + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( From 1145b4e5281d5930f7c673ca33ca1da87b96395b Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 15:30:04 +0200 Subject: [PATCH 018/213] #125 StodolaTurbine --- .../Machines/TestStodolaTurbine.mo | 22 +++++++ .../SimpleExamples/Machines/package.order | 1 + ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 59 ++++++++----------- 3 files changed, 48 insertions(+), 34 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo new file mode 100644 index 00000000..4d29ef69 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStodolaTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Cst=400000) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + P0=4500000, + Q0=1800, + T0=573.15, + option_temperature=true) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink + annotation (Placement(transformation(extent={{26,-10},{46,10}}))); +equation + connect(sourcePQ.C, stodolaTurbine.Ce) + annotation (Line(points={{-30,0},{-10.1,0}}, color={0,0,0})); + connect(stodolaTurbine.Cs, sink.C) + annotation (Line(points={{10.1,0},{26,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestStodolaTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index e69de29b..4bf87c1a 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -0,0 +1 @@ +TestStodolaTurbine diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index 486fc51b..0d8405f8 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -1,6 +1,8 @@ within ThermoSysPro.Fluid.Machines; model StodolaTurbine "Multistage turbine group using Stodola's ellipse" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; +extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter Real Cst=1.e7 "Stodola's ellipse coefficient"; @@ -27,6 +29,7 @@ model StodolaTurbine "Multistage turbine group using Stodola's ellipse" parameter IF97Region region_s=IF97Region.All_regions "IF97 region after expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter IF97Region region_ps=IF97Region.All_regions "IF97 region after isentropic expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + protected parameter Integer mode_e=Integer(region_e) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Integer mode_s=Integer(region_s) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; @@ -52,23 +55,17 @@ public Units.SI.Velocity Vs "Fluid velocity at the outlet"; Units.SI.Density rhos(start=200) "Fluid density at the outlet"; Real xm(start=1.0,min=0) "Average vapor mass fraction"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); - Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation( + Medium.ThermodynamicState state_e; + Medium.ThermodynamicState state_s1; + Medium.ThermodynamicState state_s; + Medium.ThermodynamicState state_ps; + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-111,-10},{-91,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{91,-10},{111,10}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M annotation (Placement(transformation( origin={0,-100}, @@ -79,11 +76,7 @@ public origin={110,-90}, extent={{10,-10},{-10,10}}, rotation=180))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros1 - annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0))); equation - /* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "StodolaTurbine: the fluid type must be water/steam"); if (cardinality(M) == 0) then M.Ctr = 0; @@ -103,18 +96,16 @@ equation Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - Ce.ftype = Cs.ftype; - Ce.Xco2 = Cs.Xco2; - Ce.Xh2o = Cs.Xh2o; - Ce.Xo2 = Cs.Xo2; - Ce.Xso2 = Cs.Xso2; + /* Fluid composition balance equations*/ + Ce.Xi = Cs.Xi; + X = Ce.Xi; + Q = Ce.Q; Pe = Ce.P; Ps = Cs.P; - ftype = Ce.ftype; /* Isentropic efficiency */ eta_is = if (Q < Qmax) then (max(eta_is_min,(a*(Q/Qmax)^2 + b*(Q/Qmax) + c))) else eta_is_nom; @@ -124,14 +115,14 @@ equation if noEvent((Pe > pcrit) or (Te > Tcrit)) then xm = 1; else - xm = (proe.x + pros1.x)/2.0; + xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s1))/2.0; end if; /* Stodola's ellipse law */ if noEvent((Pe > pcrit) or (Te > Tcrit)) then Q = sqrt((Pe^2 - Ps^2)/(Cst*Te)); else - Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*proe.x)); + Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*Medium.vapourQuality(state_e))); end if; /* Fluid specific enthalpy after the expansion */ @@ -146,22 +137,22 @@ equation MechPower.signal = W; /* Fluid thermodynamic properties before the expansion */ - proe = ThermoSysPro.Properties.Fluid.Ph(Pe, Ce.h, mode_e, fluid); + state_e=Medium.setState_phX(p=Pe, h=Ce.h, X=Ce.Xi, region=mode_e); - Te = proe.T; + Te = state_e.T; /* Fluid thermodynamic properties after the expansion */ - pros1 = ThermoSysPro.Properties.Fluid.Ph(Ps, Hrs, mode_s, fluid); + state_s1 = Medium.setState_phX(p=Ps, h=Hrs, X=Cs.Xi, region=mode_s); // X=Cs.Xi ????????????????? Hrs.Xi ?? /* Fluid thermodynamic properties at the outlet of the nozzle */ - pros = ThermoSysPro.Properties.Fluid.Ph(Ps, Cs.h, mode_s, fluid); + state_s = Medium.setState_phX(p=Ps, h=Cs.h, X=Cs.Xi, region=mode_s); - Ts = pros.T; - rhos = pros.d; + Ts = state_s.T; + rhos = state_s.d; /* Fluid thermodynamic properties after the isentropic expansion */ - props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_ps, fluid); - His = props.h; + state_ps = Medium.setState_psX(p=Ps, s=Medium.specificEntropy(state_e), X=Cs.Xi, region=mode_ps); // X=Cs.Xi ????????????????????? + His = state_ps.h; annotation ( Diagram(coordinateSystem( From ee4063ca622bcf4d04279ce47613f5f15b5d4df2 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 15:58:54 +0200 Subject: [PATCH 019/213] #125 SourceP --- .../Fluid/BoundaryConditions/SourceP.mo | 65 +++++-------------- 1 file changed, 18 insertions(+), 47 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo index a9a3641d..8156d294 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SourceP "Multi-fluid source with fixed pressure" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure P0=300000 "Source pressure"; parameter Units.SI.Temperature T0=290 @@ -19,32 +18,13 @@ model SourceP "Multi-fluid source with fixed pressure" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco2=0.01 "CO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2=0.22 "O2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2=0 "SO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - -protected - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + group="Medium")); public Units.SI.MassFlowRate Q "Fluid mass flow rate"; @@ -53,12 +33,12 @@ public Units.SI.Temperature T(start=300) "Fluid temperature"; ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure - "Fixed pressure" - annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation= - 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement( - transformation(extent={{90,-10},{110,10}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature + "Fixed pressure" annotation (Placement(transformation(extent={{-60,-10},{-40, + 10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package + Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110, + 10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation (Placement(transformation( origin={0,-50}, @@ -73,19 +53,10 @@ equation C.diff_res_1 = 0; C.diff_on_1 = diffusion; - C.ftype = ftype; + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; if (cardinality(IPressure) == 0) then IPressure.signal = P0; @@ -104,10 +75,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ From dcd8c526c4f1551209893c88ba126a6d69edfc0a Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 16:26:57 +0200 Subject: [PATCH 020/213] #125 SinkQ --- .../Fluid/BoundaryConditions/SinkQ.mo | 45 +++++++------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo index a9a8fc5f..a484d188 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SinkQ "Multi-fluids sink with fixed mass flow rate" + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; parameter Units.SI.Temperature T0=290 @@ -16,39 +16,27 @@ model SinkQ "Multi-fluids sink with fixed mass flow rate" "true:temperature fixed - false:specific enthalpy fixed"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - -protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - Real Xco2(start=0.01) - "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o - "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start=0.2) - "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start=0) - "SO2 mass fraction of the fluid crossing the boundary of the control volume"; public - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow - "Fixed mass flow rate" - annotation (Placement(transformation( + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation (Placement(transformation( origin={0,50}, extent={{-10,-10},{10,10}}, rotation=270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature - "Fixed specific enthalpy or temperature according to option_temperature" - annotation (Placement(transformation( + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation (Placement(transformation( origin={0,-50}, extent={{10,-10},{-10,10}}, rotation=270))); @@ -61,12 +49,9 @@ equation C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; + C.SubC=SubC0; - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; + C.Xi = X0[1:Medium.nXi]; /* Mass flow */ if (cardinality(IMassFlow) == 0) then @@ -86,10 +71,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; annotation ( From a61aa089f513b2667b310e294eb58073cbac09e4 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 16:32:29 +0200 Subject: [PATCH 021/213] #125 SinQ correction --- .../Fluid/BoundaryConditions/SinkQ.mo | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo index a484d188..fc18d9f9 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo @@ -16,18 +16,16 @@ model SinkQ "Multi-fluids sink with fixed mass flow rate" "true:temperature fixed - false:specific enthalpy fixed"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( - tab="Fluid", - group="Medium")); - parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( - tab="Fluid", - group="Medium")); + public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + public ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation (Placement(transformation( @@ -49,9 +47,10 @@ equation C.diff_res_2 = 0; C.diff_on_2 = diffusion; - C.SubC=SubC0; + X = C.Xi; + SubC = C.SubC; + - C.Xi = X0[1:Medium.nXi]; /* Mass flow */ if (cardinality(IMassFlow) == 0) then @@ -71,10 +70,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = Medium.temperature_phX(p=P, h=h, X=X0); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation ( From 2e5559d7737c8ba9d2fd593337f4cdc0342f7c29 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 16:47:33 +0200 Subject: [PATCH 022/213] #125 StodolaTurbine added SubC --- ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 1 + 1 file changed, 1 insertion(+) diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index 0d8405f8..63e6186b 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -101,6 +101,7 @@ equation Ce.Xi = Cs.Xi; X = Ce.Xi; + Ce.SubC = Cs.SubC; Q = Ce.Q; Pe = Ce.P; From 533944ab31eeaaf052df771cf13f3814f41baf3a Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 17:05:05 +0200 Subject: [PATCH 023/213] #125 SinkP --- .../Fluid/BoundaryConditions/SinkP.mo | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo index 5a7507e2..69898d68 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo @@ -1,11 +1,9 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SinkP "Multi-fluid sink with fixed pressure" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure"; parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" @@ -17,26 +15,16 @@ model SinkP "Multi-fluid sink with fixed pressure" "true:temperature fixed - false:specific enthalpy fixed"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; -protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2(start=0.01) - "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xh2o - "H2O mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xo2(start=0.2) - "O2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xso2(start=0) - "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + public ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure "Fixed pressure" @@ -44,7 +32,7 @@ public origin={50,0}, extent={{-10,-10},{10,10}}, rotation=180))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" @@ -61,12 +49,8 @@ equation C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; + X = C.Xi; + SubC = C.SubC; if (cardinality(IPressure) == 0) then IPressure.signal = P0; @@ -85,10 +69,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation ( From 3b5140dade765783b10d2e48c870f74701c799d4 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 17:18:24 +0200 Subject: [PATCH 024/213] #125 SinkPQ --- .../Fluid/BoundaryConditions/SinkPQ.mo | 67 ++++++------------- 1 file changed, 20 insertions(+), 47 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo index 8b874a0a..070d0124 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo @@ -1,61 +1,38 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SinkPQ "MultiFluids sink with fixed pressure and mass flow rate" - extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.AbsolutePressure P0=100000 - "Fluid pressure (active if IPressure connector is not connected)"; - parameter Units.SI.MassFlowRate Q0=100 - "Mass flow (active if IMassFlow connector is not connected)"; - parameter Units.SI.Temperature T0=290 - "Source temperature (active if option_temperature=true)" - annotation (Evaluate=true, Dialog(enable=option_temperature)); - parameter Units.SI.SpecificEnthalpy h0=100000 - "Source specific enthalpy (active if option_temperature=false)" - annotation (Evaluate=true, Dialog(enable=not option_temperature)); - parameter Boolean option_temperature=false - "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean diffusion=false - "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + extends ThermoSysPro.Fluid.Interfaces.IconColors; -protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", + group="Medium")); + parameter Units.SI.AbsolutePressure P0=100000 "Fluid pressure (active if IPressure connector is not connected)"; + parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - Real Xco2(start=0.01) - "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o - "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start=0.2) - "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start=0) - "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + public - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow - "Fixed mass flow rate" - annotation (Placement(transformation( + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation (Placement(transformation( origin={0,50}, extent={{-10,-10},{10,10}}, rotation=270))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure - "Fixed pressure" - annotation (Placement(transformation( + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure "Fixed pressure" annotation (Placement(transformation( origin={50,0}, extent={{-10,-10},{10,10}}, rotation=180))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature - "Fixed specific enthalpy or temperature according to option_temperature" + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation (Placement(transformation( origin={0,-50}, extent={{10,-10},{-10,10}}, @@ -69,12 +46,8 @@ equation C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; + X = C.Xi; + SubC = C.SubC; /* Mass flow */ if (cardinality(IMassFlow) == 0) then @@ -101,10 +74,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation ( From 00551385f42eff89b31f2d864bb0aad8246f19d0 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 5 Jun 2025 17:35:35 +0200 Subject: [PATCH 025/213] #125 Source --- .../Fluid/BoundaryConditions/Source.mo | 71 +++++-------------- 1 file changed, 16 insertions(+), 55 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo index b28eb04f..16a1eea2 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo @@ -1,49 +1,20 @@ within ThermoSysPro.Fluid.BoundaryConditions; model Source "MultiFluids Source" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; - extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Temperature T0=290 - "Source temperature (active if option_temperature=true)" - annotation (Evaluate=true, Dialog(enable=option_temperature)); - parameter Units.SI.SpecificEnthalpy h0=100000 - "Source specific enthalpy (active if option_temperature=false)" - annotation (Evaluate=true, Dialog(enable=not option_temperature)); - parameter Boolean option_temperature=false - "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean continuous_flow_reversal=false - "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion=false - "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter ThermoSysPro.Units.SI.MassFraction Xco2= 0.01 "CO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o=if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), - tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2= 0.22 "O2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2= 0 "SO2 mass fraction" - annotation (Evaluate=true, Dialog( - enable=(ftype == FluidType.FlueGases), + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( tab="Fluid", - group="Composition values (active for flue gases only)")); - -protected - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + group="Medium")); public Units.SI.MassFlowRate Q "Fluid mass flow rate"; @@ -51,7 +22,7 @@ public Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; Units.SI.Temperature T(start=300) "Fluid temperature"; - Interfaces.Connectors.FluidOutlet C annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" @@ -68,19 +39,9 @@ equation C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; + C.SubC=SubC0; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; + C.Xi = X0[1:Medium.nXi]; /* Specific enthalpy or temperature */ if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then @@ -93,10 +54,10 @@ equation if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ From 2b30c3c0c38a033e9969dca890abd017dbd7fb4a Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Wed, 11 Jun 2025 10:55:53 +0200 Subject: [PATCH 026/213] #125 StodolaTurbine corrected example and added traces example --- .../Machines/TestStodolaTurbine.mo | 20 ++++++++---- .../Machines/TestStodolaTurbine_Traces.mo | 31 +++++++++++++++++++ .../SimpleExamples/Machines/package.order | 1 + 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo index 4d29ef69..b549ea80 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo @@ -2,15 +2,23 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; model TestStodolaTurbine extends ThermoSysPro.UsersGuide.Icons.Example; - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Cst=400000) +replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare replaceable package Medium = Medium, + Cst=4100, + Ps(start=5000), + rhos(start=1.22)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - P0=4500000, - Q0=1800, - T0=573.15, - option_temperature=true) + redeclare replaceable package Medium = Medium, + P0=300000, + Q0=200, + h0=3e6, + option_temperature=false) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{26,-10},{46,10}}))); equation connect(sourcePQ.C, stodolaTurbine.Ce) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo new file mode 100644 index 00000000..adcb506f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStodolaTurbine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + +replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3", "Trace4"}, C_nominal={0.1, 0.2, 0.3, 0.4}, C_default={0.2, 0.3, 0.4, 0.5}); + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare replaceable package Medium = Medium, + Cst=4100, + Ps(start=5000), + rhos(start=1.22)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=300000, + Q0=200, + h0=3e6, + SubC0={40,50,60,70}, + option_temperature=false) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{26,-10},{46,10}}))); +equation + connect(sourcePQ.C, stodolaTurbine.Ce) + annotation (Line(points={{-30,0},{-10.1,0}}, color={0,0,0})); + connect(stodolaTurbine.Cs, sink.C) + annotation (Line(points={{10.1,0},{26,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestStodolaTurbine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 4bf87c1a..7733024e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -1 +1,2 @@ TestStodolaTurbine +TestStodolaTurbine_Traces From f53c3f5d82df5fb21f52fcc70f810db3ea1cd6ac Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Wed, 11 Jun 2025 12:08:36 +0200 Subject: [PATCH 027/213] #125 ControlValve --- .../PressureLosses/TestControlValve.mo | 29 ++++++++++++++++ .../PressureLosses/TestControlValve_Traces.mo | 30 ++++++++++++++++ .../TestControlValve_Traces_FlueGases.mo | 34 +++++++++++++++++++ .../PressureLosses/package.order | 3 ++ .../Fluid/PressureLosses/ControlValve.mo | 26 +++++++------- 5 files changed, 109 insertions(+), 13 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo new file mode 100644 index 00000000..28e578c2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestControlValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve( + redeclare replaceable package Medium = Medium, caract=[0,0; 0.5,3000; 0.75, + 7000; 1,8000]) + annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, Q0=2580) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,0.9; + 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2]) + annotation (Placement(transformation(extent={{-30,34},{-10,54}}, rotation=0))); +equation + connect(controlValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(controlValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(Constante1.y, controlValve.Ouv) + annotation (Line(points={{-9,44},{0,44},{0,17}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestControlValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo new file mode 100644 index 00000000..f79d0787 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestControlValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2"}, C_nominal={0.1, 2}, C_default={0.2, 5}); + + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve( + redeclare replaceable package Medium = Medium, caract=[0,0; 0.5,3000; 0.75, + 7000; 1,8000]) + annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + SubC0={10,20}, Q0=2580) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,0.9; + 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2]) + annotation (Placement(transformation(extent={{-30,34},{-10,54}}, rotation=0))); +equation + connect(controlValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(controlValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(Constante1.y, controlValve.Ouv) + annotation (Line(points={{-9,44},{0,44},{0,17}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestControlValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo new file mode 100644 index 00000000..1e2d861d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestControlValve_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2"}, C_nominal={0.1, 2}, C_default={0.2, 5}); + + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve( + redeclare replaceable package Medium = Medium, + Cvmax=50000, caract=[0,0; 0.5,3000; 0.75, + 7000; 1,8000], + Pm(start=200000)) + annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, h0=2538785.2) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + h0=2538785.2, + SubC0={10,20}, X0={0.1,0.2,0.3,0.2,0.2}, + Q0=8) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,0.9; + 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2]) + annotation (Placement(transformation(extent={{-30,34},{-10,54}}, rotation=0))); +equation + connect(controlValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(controlValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(Constante1.y, controlValve.Ouv) + annotation (Line(points={{-9,44},{0,44},{0,17}}, color={0,0,255})); + annotation (experiment(StopTime=80), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestControlValve_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index 21b7a582..e89506ae 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -4,3 +4,6 @@ TestPipePressureLoss_Traces TestSingularPressureLoss TestSingularPressureLoss_Traces TestSingularPressureLoss_Traces_FlueGases +TestControlValve +TestControlValve_Traces +TestControlValve_Traces_FlueGases diff --git a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo index 503d318e..64511ae9 100644 --- a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo @@ -1,6 +1,7 @@ within ThermoSysPro.Fluid.PressureLosses; model ControlValve "Control valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; +extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 @@ -32,8 +33,7 @@ public Units.SI.Temperature T(start=290) "Fluid temperature"; Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv @@ -41,9 +41,9 @@ public origin={0,110}, extent={{-10,-10},{10,10}}, rotation=270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-70},{-90,-50}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-70},{110,-50}}, rotation=0))); equation @@ -59,18 +59,18 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + X = C1.Xi; + + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; + /* Pressure loss */ if (option_rho_water == 1) then @@ -99,12 +99,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( Icon(coordinateSystem( From cc7127fc9ccb6c4ece3fafcd59d29de34a0c6045 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Fri, 13 Jun 2025 16:49:07 +0200 Subject: [PATCH 028/213] #125 RefT --- ThermoSysPro/Fluid/BoundaryConditions/RefT.mo | 32 +++++++---------- .../BoundaryConditions/TestRefT.mo | 33 +++++++++++++++++ .../BoundaryConditions/TestRefT_Traces.mo | 35 +++++++++++++++++++ .../BoundaryConditions/package.order | 2 ++ 4 files changed, 83 insertions(+), 19 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo index a5795521..7aeecfc4 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo @@ -1,28 +1,24 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefT "Fixed temperature reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); -protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature - annotation (Placement(transformation( + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature annotation (Placement(transformation( origin={0,110}, extent={{-10,-10},{10,10}}, rotation=270))); @@ -45,21 +41,19 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; P = C1.P; h = C1.h; - ftype = C1.ftype; /* Computation of the fluid specific enthalpy */ - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, ITemperature.signal, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=ITemperature.signal, X=X); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo new file mode 100644 index 00000000..8e00782c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefT + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, h0=2600e3) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=120 + 273.15) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refT.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C, refT.C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refT.ITemperature) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefT; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo new file mode 100644 index 00000000..061c7084 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefT_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare replaceable package + Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package + Medium = Medium, h0=2600e3, SubC0={10,20,30}) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=120 + 273.15) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refT.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C, refT.C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refT.ITemperature) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefT_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index e69de29b..0f8ee6d3 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -0,0 +1,2 @@ +TestRefT +TestRefT_Traces From adb13a68eb52f3bc9e29a5821e0688ef8c9f4940 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 16 Jun 2025 11:08:38 +0200 Subject: [PATCH 029/213] #125 TwoPhase medium for StodaTurbine, constrainedby medium to subC medium --- ThermoSysPro/Fluid/BoundaryConditions/Sink.mo | 2 +- .../Fluid/BoundaryConditions/SourcePQ.mo | 2 +- .../Fluid/BoundaryConditions/SourceQ.mo | 2 +- .../Machines/TestStodolaTurbine.mo | 3 +-- ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 22 +++++++++---------- .../Fluid/PressureLosses/PipePressureLoss.mo | 2 +- .../PressureLosses/SingularPressureLoss.mo | 2 +- ThermoSysPro/Fluid/Volumes/VolumeC.mo | 2 +- 8 files changed, 18 insertions(+), 19 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo index f2e804a2..6fbe1d79 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo @@ -3,7 +3,7 @@ model Sink "MultiFluids sink" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo index 29d16491..3edfecd1 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo @@ -3,7 +3,7 @@ model SourcePQ "MultiFluids source with fixed pressure and mass flow rate" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure P0=300000 "Fluid pressure (active if IPressure connector is not connected)"; parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo index 6ef3492e..668bdaaf 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo @@ -3,7 +3,7 @@ model SourceQ "Multi-fluid source with fixed mass flow rate" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; parameter Units.SI.Temperature T0=290 diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo index b549ea80..ac7159d2 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo @@ -17,8 +17,7 @@ replaceable package Medium = Properties.Media.WaterSteam; h0=3e6, option_temperature=false) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{26,-10},{46,10}}))); equation connect(sourcePQ.C, stodolaTurbine.Ce) diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index 63e6186b..7173773a 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.Machines; model StodolaTurbine "Multistage turbine group using Stodola's ellipse" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; @@ -25,15 +25,15 @@ extends ThermoSysPro.Fluid.Interfaces.IconColors; "Constant coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)"; parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_e=IF97Region.All_regions "IF97 region before expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_s=IF97Region.All_regions "IF97 region after expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_ps=IF97Region.All_regions "IF97 region after isentropic expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter IF97Region region_e=IF97Region.All_regions "IF97 region before expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region_s=IF97Region.All_regions "IF97 region after expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region_ps=IF97Region.All_regions "IF97 region after isentropic expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected - parameter Integer mode_e=Integer(region_e) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_s=Integer(region_s) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_ps=Integer(region_ps) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Integer phase_e=if Integer(region_e) == 0 then 0 else if Integer(region_e)==4 then 2 else 1; + Integer phase_s=if Integer(region_s) == 0 then 0 else if Integer(region_s)==4 then 2 else 1; + Integer phase_ps=if Integer(region_ps) == 0 then 0 else if Integer(region_ps)==4 then 2 else 1; parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT "Critical pressure"; parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT @@ -138,21 +138,21 @@ equation MechPower.signal = W; /* Fluid thermodynamic properties before the expansion */ - state_e=Medium.setState_phX(p=Pe, h=Ce.h, X=Ce.Xi, region=mode_e); + state_e=Medium.setState_phX(p=Pe, h=Ce.h, phase=phase_e); Te = state_e.T; /* Fluid thermodynamic properties after the expansion */ - state_s1 = Medium.setState_phX(p=Ps, h=Hrs, X=Cs.Xi, region=mode_s); // X=Cs.Xi ????????????????? Hrs.Xi ?? + state_s1 = Medium.setState_phX(p=Ps, h=Hrs, phase=phase_s); /* Fluid thermodynamic properties at the outlet of the nozzle */ - state_s = Medium.setState_phX(p=Ps, h=Cs.h, X=Cs.Xi, region=mode_s); + state_s = Medium.setState_phX(p=Ps, h=Cs.h, phase=phase_s); Ts = state_s.T; rhos = state_s.d; /* Fluid thermodynamic properties after the isentropic expansion */ - state_ps = Medium.setState_psX(p=Ps, s=Medium.specificEntropy(state_e), X=Cs.Xi, region=mode_ps); // X=Cs.Xi ????????????????????? + state_ps = Medium.setState_ps(p=Ps, s=Medium.specificEntropy(state_e), phase=phase_ps); His = state_ps.h; annotation ( diff --git a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo index c9d337fd..d3c77c64 100644 --- a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo @@ -3,7 +3,7 @@ model PipePressureLoss "Pipe generic pressure loss" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real K=10 "Friction pressure loss coefficient"; parameter Units.SI.Position z1=0 "Inlet altitude"; parameter Units.SI.Position z2=0 "Outlet altitude"; diff --git a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo index 583f3511..5145c405 100644 --- a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.PressureLosses; model SingularPressureLoss "Singular pressure loss" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real K=1.e-4 "Pressure loss coefficient"; parameter Units.SI.MassFlowRate gamma_diff=1e-4 diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo index 5d9b59ac..3dd055f2 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo @@ -3,7 +3,7 @@ model VolumeC "Mixing volume with 3 inlets and 1 outlet" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; From 35afdf7eaab83a72a2bbeb766b1c2c7b89a12004 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Mon, 16 Jun 2025 11:15:46 +0200 Subject: [PATCH 030/213] #125 RefQ --- ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo | 17 ++++++---- .../BoundaryConditions/TestRefQ.mo | 34 +++++++++++++++++++ .../BoundaryConditions/TestRefQ_Traces.mo | 33 ++++++++++++++++++ .../TestRefQ_Traces_FlueGases.mo | 34 +++++++++++++++++++ .../BoundaryConditions/package.order | 3 ++ 5 files changed, 114 insertions(+), 7 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo index aaf16710..71610bac 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo @@ -1,16 +1,20 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefQ "Fixed mass flow reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.MassFlowRate Q0=10 "Fixed fluid mass flow"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow annotation (Placement(transformation( @@ -36,12 +40,11 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; P = C1.P; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo new file mode 100644 index 00000000..63865b8f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, h0=2600e3, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo new file mode 100644 index 00000000..4cda43cc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, h0=2600e3,SubC0={10,20,30}, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo new file mode 100644 index 00000000..3babe41f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=2600e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, + P0=2000000, h0=2600e3,SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index e69de29b..d52b6fae 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -0,0 +1,3 @@ +TestRefQ +TestRefQ_Traces +TestRefQ_Traces_FlueGases From 6f01879bfbab5edf610d8c386a86516fc0b97929 Mon Sep 17 00:00:00 2001 From: MAZURIE Baptiste Date: Mon, 16 Jun 2025 11:26:08 +0200 Subject: [PATCH 031/213] #125 changed constrainedby medium --- ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo | 2 +- ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo | 2 +- ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo | 2 +- ThermoSysPro/Fluid/BoundaryConditions/Source.mo | 2 +- ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo index 69898d68..b8b243b9 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo @@ -3,7 +3,7 @@ model SinkP "Multi-fluid sink with fixed pressure" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure"; parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo index 070d0124..278db1c1 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo @@ -3,7 +3,7 @@ model SinkPQ "MultiFluids sink with fixed pressure and mass flow rate" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure P0=100000 "Fluid pressure (active if IPressure connector is not connected)"; parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo index fc18d9f9..95c2cc38 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo @@ -3,7 +3,7 @@ model SinkQ "Multi-fluids sink with fixed mass flow rate" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; parameter Units.SI.Temperature T0=290 diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo index 16a1eea2..8369e9eb 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo @@ -3,7 +3,7 @@ model Source "MultiFluids Source" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo index 8156d294..27a26da6 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo @@ -3,7 +3,7 @@ model SourceP "Multi-fluid source with fixed pressure" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure P0=300000 "Source pressure"; parameter Units.SI.Temperature T0=290 From 474b69527ae6eaf4fa81a088e4be8e84789513da Mon Sep 17 00:00:00 2001 From: MAZURIE Baptiste Date: Mon, 16 Jun 2025 11:29:26 +0200 Subject: [PATCH 032/213] #125 Edit VolumeA to change the constrainedby medium --- ThermoSysPro/Fluid/Volumes/VolumeA.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/Volumes/VolumeA.mo b/ThermoSysPro/Fluid/Volumes/VolumeA.mo index fad042ec..6437f404 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeA.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeA.mo @@ -3,7 +3,7 @@ model VolumeA "Mixing volume with 2 inlets and 2 outlets" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true From 6a169be17102568b2827eff79c27818411420c40 Mon Sep 17 00:00:00 2001 From: MAZURIE Baptiste Date: Mon, 16 Jun 2025 11:33:32 +0200 Subject: [PATCH 033/213] #125 ControlValve changed constrainedby medium --- ThermoSysPro/Fluid/PressureLosses/ControlValve.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo index 64511ae9..a4df200d 100644 --- a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo @@ -1,7 +1,7 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ThermoSysPro.Fluid.PressureLosses; model ControlValve "Control valve" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 From dea30059a07e82de4dd04e8b4cfcf767c2c85186 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Mon, 16 Jun 2025 13:46:20 +0200 Subject: [PATCH 034/213] #125 RefQ - Removed useless X declaration and equation --- ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo | 3 --- 1 file changed, 3 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo index 71610bac..f6414019 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo @@ -10,7 +10,6 @@ public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); @@ -42,8 +41,6 @@ equation C1.Xi = C2.Xi; - X = C1.Xi; - C1.SubC = C2.SubC; Q = C1.Q; From caa3baf8d1e24233a62c169958cfa33ef7a23127 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Mon, 16 Jun 2025 14:16:37 +0200 Subject: [PATCH 035/213] #125 RefP --- ThermoSysPro/Fluid/BoundaryConditions/RefP.mo | 14 +++--- .../BoundaryConditions/TestRefP.mo | 36 +++++++++++++++ .../BoundaryConditions/TestRefP_Traces.mo | 34 ++++++++++++++ .../TestRefP_Traces_FlueGases.mo | 46 +++++++++++++++++++ .../BoundaryConditions/package.order | 3 ++ 5 files changed, 126 insertions(+), 7 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo index 7edad80f..2e4128c5 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo @@ -1,6 +1,8 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefP "Fixed pressure reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure"; public @@ -8,9 +10,9 @@ public Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure annotation (Placement(transformation( @@ -36,12 +38,10 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; Q = C1.Q; P = C1.P; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo new file mode 100644 index 00000000..60f4b2b6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo @@ -0,0 +1,36 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=633e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + T0=423.15, + option_temperature=true) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C,refP. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo new file mode 100644 index 00000000..1f0736bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=633e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + T0=423.15, + option_temperature=true, SubC0={10,20,30}) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C,refP. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo new file mode 100644 index 00000000..9aea64c1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare package Medium = + Medium, + T0=453.15, + h0=633193.1, + option_temperature=true) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + Q0=50, + T0=473.15, + h0=633193.1, + option_temperature=true, SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, + T(start=423.15)) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-38,-10},{-18,10}}))); +equation + connect(sinkP.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + connect(sourceQ.C, singularPressureLoss.C1) + annotation (Line(points={{-46,0},{-38,0}}, color={0,0,0})); + connect(singularPressureLoss.C2, refP.C1) + annotation (Line(points={{-18,0},{-10,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index e69de29b..e1e8d15c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -0,0 +1,3 @@ +TestRefP +TestRefP_Traces +TestRefP_Traces_FlueGases From c61aacbafd14a908b32f308516c25b806a850daf Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Mon, 16 Jun 2025 17:50:22 +0200 Subject: [PATCH 036/213] #125-LumpedStraightPipe --- .../PressureLosses/TestLumpedStraightPipe.mo | 24 ++++++++++++ .../TestLumpedStraightPipe_Traces.mo | 24 ++++++++++++ .../PressureLosses/package.order | 2 + .../PressureLosses/LumpedStraightPipe.mo | 39 +++++++++++-------- 4 files changed, 72 insertions(+), 17 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo new file mode 100644 index 00000000..9174faa2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{28,-10}, + {48,10}}))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(redeclare + replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); +equation + connect(sourcePQ.C, lumpedStraightPipe.C1) + annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sink.C, lumpedStraightPipe.C2) + annotation (Line(points={{28,0},{10,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo new file mode 100644 index 00000000..f782a09b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{28,-10}, + {48,10}}))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(redeclare + replaceable package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); +equation + connect(sourcePQ.C, lumpedStraightPipe.C1) + annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sink.C, lumpedStraightPipe.C2) + annotation (Line(points={{28,0},{10,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..8be16eb5 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,5 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestLumpedStraightPipe +TestLumpedStraightPipe_Traces diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index fb8f7fb1..f6b38ab1 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -1,7 +1,10 @@ within ThermoSysPro.Fluid.PressureLosses; model LumpedStraightPipe "Lumped straight pipe (circular duct)" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + + import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter Units.SI.Length L=10. "Pipe length"; @@ -19,7 +22,7 @@ model LumpedStraightPipe "Lumped straight pipe (circular duct)" "true: momentum balance equation with inertia - false: without inertia"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; @@ -47,13 +50,15 @@ public Units.SI.SpecificHeatCapacity cp(start=4200) "Fluid specific heat capacity"; Units.SI.ThermalConductivity k(start=0.05) "Fluid thermal conductivity"; Units.SI.MassFlowRate gamma_diff(start=1.e-4) "Diffusion conductance"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + Medium.ThermodynamicState state; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); initial equation if inertia then @@ -74,18 +79,15 @@ equation C2.diff_res_1 = C1.diff_res_1 + 1/gamma_diff; C1.diff_res_2 = C2.diff_res_2 + 1/gamma_diff; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; + X = C1.Xi; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; /* Diffusion resistance */ gamma_diff = A*k/cp/L; @@ -118,16 +120,19 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; + state=Medium.setState_phX(p=Pm, h=h, X=X, region=mode); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = state.d; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - k = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o,C1.Xo2, C1.Xso2); - cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = state.T; + mu = Medium.dynamicViscosity(state); + k = Medium.thermalConductivity(state); + cp = Medium.specificHeatCapacityCp(state); annotation ( Diagram(coordinateSystem( From 0d49afd1d1c3b55e9046559042965a1cbb8899af Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 10:39:03 +0200 Subject: [PATCH 037/213] staticcentrifugalpump --- .../Machines/TestStaticCentrifugalPump.mo | 20 ++++++ .../TestStaticCentrifugalPump_FlueGases.mo | 26 ++++++++ .../TestStaticCentrifugalPump_Traces.mo | 26 ++++++++ .../SimpleExamples/Machines/package.order | 3 + .../Fluid/Machines/StaticCentrifugalPump.mo | 64 +++++++++---------- 5 files changed, 107 insertions(+), 32 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo new file mode 100644 index 00000000..5da05aac --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo @@ -0,0 +1,20 @@ +within ; +model TestStaticCentrifugalPump + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + StaticCentrifugalPump staticCentrifugalPump( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestStaticCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo new file mode 100644 index 00000000..3d38a722 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo @@ -0,0 +1,26 @@ +within ; +model TestStaticCentrifugalPump_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + StaticCentrifugalPump staticCentrifugalPump( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10}, + {14,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) + annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) + annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestStaticCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo new file mode 100644 index 00000000..26d98475 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo @@ -0,0 +1,26 @@ +within ; +model TestStaticCentrifugalPump_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + StaticCentrifugalPump staticCentrifugalPump( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestStaticCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index e69de29b..243a92a6 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -0,0 +1,3 @@ +TestStaticCentrifugalPump +TestStaticCentrifugalPump_FlueGases +TestStaticCentrifugalPump_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo index 98dd3a47..6a8ad300 100644 --- a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo @@ -1,11 +1,11 @@ -within ThermoSysPro.Fluid.Machines; +within ; model StaticCentrifugalPump "Static centrifugal pump" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby + ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400 "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)"; - parameter Units.SI.Power MPower=0.1e6 + parameter ThermoSysPro.Units.SI.Power MPower=0.1e6 "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)"; parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400 "Nominal rotational speed"; @@ -15,11 +15,10 @@ model StaticCentrifugalPump "Static centrifugal pump" "1: fixed rotational speed - 2: fixed mechanical power"; parameter Boolean adiabatic_compression=false "true: compression at constant enthalpy - false: compression with varying enthalpy"; - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Real a1=-88.67 "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)"; @@ -36,33 +35,36 @@ model StaticCentrifugalPump "Static centrifugal pump" "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)"; protected - constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + constant ThermoSysPro.Units.SI.Acceleration g=Modelica.Constants.g_n + "Gravity constant"; parameter Real eps=1.e-6 "Small number"; parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings"; public Real rh "Hydraulic efficiency"; - Units.SI.Height hn(start=10) "Pump head"; + ThermoSysPro.Units.SI.Height hn(start=10) "Pump head"; Real R(start=VRot/VRotn) "Reduced rotational speed"; - Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; - Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; - Units.SI.Power Wh "Hydraulic power"; - Units.SI.Power Wm "Mechanical power"; + ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + ThermoSysPro.Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; + ThermoSysPro.Units.SI.Power Wh "Hydraulic power"; + ThermoSysPro.Units.SI.Power Wm "Mechanical power"; ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vr "Rotational speed"; - Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure variation between the outlet and the inlet"; - Units.SI.SpecificEnthalpy deltaH + ThermoSysPro.Units.SI.SpecificEnthalpy deltaH "Specific enthalpy variation between the outlet and the inlet"; - Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid average specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package + Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package + Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.InputReal rpm_or_mpower annotation (Placement(transformation( @@ -91,12 +93,11 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; deltaP = C2.P - C1.P; @@ -105,8 +106,6 @@ equation deltaP = rho*g*hn; Q = Qv*rho; - ftype = C1.ftype; - /* Fixed rotational speed or fixed mechanical power */ if (fixed_rot_or_power == 1) then Vr = rpm_or_mpower.signal; @@ -143,7 +142,7 @@ equation if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( Diagram(coordinateSystem( @@ -187,5 +186,6 @@ equation
  • Baligh El Hefni
  • "), - DymolaStoredErrors); + DymolaStoredErrors, + uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); end StaticCentrifugalPump; From 046a559f6d6eb9f66a5fb6c0db98cd2a9415e466 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 10:51:41 +0200 Subject: [PATCH 038/213] VolumeB --- .../SimpleExamples/Volumes/TestVolumeB.mo | 26 ++ .../Volumes/TestVolumeB_FlueGases.mo | 33 +++ .../Volumes/TestVolumeB_Traces.mo | 35 +++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeB.mo | 228 +++++++----------- 5 files changed, 185 insertions(+), 140 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo new file mode 100644 index 00000000..ef023186 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo @@ -0,0 +1,26 @@ +within ; +model TestVolumeB + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{20,28}, + {40,48}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=180, + origin={42,0}))); +equation + connect(sourcePQ.C,volumeB. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21, + 7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) + annotation (Line(points={{0,10},{0,38},{20,38}}, + color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeB; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo new file mode 100644 index 00000000..36c5da1e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo @@ -0,0 +1,33 @@ +within ; +model TestVolumeB_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,16}, + {46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=180, + origin={40,0}))); +equation + connect(sourcePQ.C,volumeB. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{23,0},{23, + 7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) + annotation (Line(points={{0,10},{0,26},{26,26}}, + color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeB_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo new file mode 100644 index 00000000..5e6e9e9e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo @@ -0,0 +1,35 @@ +within ; +model TestVolumeB_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{20,20}, + {40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + VolumeB volumeB(redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + SubC0={0.2}) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=180, + origin={40,0}))); +equation + connect(sourcePQ.C,volumeB. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{24,0},{24, + 7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) + annotation (Line(points={{0,10},{0,30},{20,30}}, + color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeB_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index f71ca450..acb69536 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -4,3 +4,6 @@ TestVolumeC_Traces TestVolumeA TestVolumeA_FlueGases TestVolumeA_Traces +TestVolumeB +TestVolumeB_FlueGases +TestVolumeB_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeB.mo b/ThermoSysPro/Fluid/Volumes/VolumeB.mo index 43daa6e0..e59027d0 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeB.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeB.mo @@ -1,25 +1,25 @@ -within ThermoSysPro.Fluid.Volumes; +within ; model VolumeB "Mixing volume with 2 inlets and 2 outlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V=1 + parameter ThermoSysPro.Units.SI.Volume V=1 "Volume (active if dynamic_energy_balance=true)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Boolean dynamic_mass_balance=false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0=1e5 + parameter ThermoSysPro.Units.SI.AbsolutePressure P0=1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0=1e5 + parameter ThermoSysPro.Units.SI.SpecificEnthalpy h0=1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -27,89 +27,70 @@ model VolumeB "Mixing volume with 2 inlets and 2 outlets" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0=1.e-4 + constant Boolean isCompressible = Medium.isCompressible; + parameter ThermoSysPro.Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public - Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - Units.SI.Density rho(start=998) "Fluid density"; - Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; - Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph + ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.MassFlowRate BQ + "Right hand side of the mass balance equation"; + ThermoSysPro.Units.SI.Power BH + "Right hand side of the energy balance equation"; + ThermoSysPro.Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp + ThermoSysPro.Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; - Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; - Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; - Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; - Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; - Units.SI.Power J "Total thermal power diffusion"; - Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1"; - Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2"; - Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1"; - Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2"; + ThermoSysPro.Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; + ThermoSysPro.Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; + ThermoSysPro.Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; + ThermoSysPro.Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; + ThermoSysPro.Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; + ThermoSysPro.Units.SI.Power J "Total thermal power diffusion"; + ThermoSysPro.Units.SI.MassFlowRate gamma_e1 + "Diffusion conductance for inlet e1"; + ThermoSysPro.Units.SI.MassFlowRate gamma_e2 + "Diffusion conductance for inlet e2"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s1 + "Diffusion conductance for outlet s1"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s2 + "Diffusion conductance for outlet s2"; Real re1 "Value of r(Q/gamma) for inlet e1"; Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0), iconTransformation(extent={{90,-10},{110,10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,90},{10,110}}, rotation=0), iconTransformation(extent={{-10,90},{10,110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then @@ -128,19 +109,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -150,16 +123,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeB: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -167,11 +130,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -180,11 +140,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -205,7 +162,7 @@ equation BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -216,13 +173,13 @@ equation P = Cs2.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -234,42 +191,30 @@ equation Cs2.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; + Cs1.Xi = X; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + Cs2.Xi = X; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -327,19 +272,21 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( @@ -395,5 +342,6 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -")); +"), + uses(ThermoSysPro(version="5.0"))); end VolumeB; From 07ddfe0c125efcb05aa4255f0c4d83c5046817bc Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 10:57:41 +0200 Subject: [PATCH 039/213] VolumeD --- .../SimpleExamples/Volumes/TestVolumeD.mo | 25 ++ .../Volumes/TestVolumeD_FlueGases.mo | 34 +++ .../Volumes/TestVolumeD_Traces.mo | 35 +++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeD.mo | 228 +++++++----------- 5 files changed, 184 insertions(+), 141 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo new file mode 100644 index 00000000..998e93ea --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo @@ -0,0 +1,25 @@ +within ; +model TestVolumeD + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + VolumeD volumeD(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); + SinkQ sinkQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{12,22}, + {32,42}}))); +equation + connect(sourcePQ.C, volumeD.Ce) + annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(volumeD.Cs3, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeD.Cs1, sinkQ.C) + annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeD; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo new file mode 100644 index 00000000..ac73a552 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo @@ -0,0 +1,34 @@ +within ; +model TestVolumeD_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,16}, + {46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + VolumeD volumeD(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + SinkQ sinkQ( redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={40,0}))); +equation + connect(volumeD.Cs1, sink.C) + annotation (Line(points={{0,10},{0,26},{26,26}}, + color={0,0,0})); + connect(sourcePQ.C, volumeD.Ce) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeD.Cs3, sinkQ.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeD_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo new file mode 100644 index 00000000..818c28dd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo @@ -0,0 +1,35 @@ +within ; +model TestVolumeD_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{20,20}, + {40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + VolumeD volumeD(redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, + {8,10}}))); + SinkQ sinkQ( redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={40,0}))); +equation + connect(volumeD.Cs1, sink.C) + annotation (Line(points={{-2,10},{-2,30},{20,30}}, + color={0,0,0})); + connect(sourcePQ.C, volumeD.Ce) + annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(volumeD.Cs3, sinkQ.C) + annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeD_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index f71ca450..54e962b7 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -4,3 +4,6 @@ TestVolumeC_Traces TestVolumeA TestVolumeA_FlueGases TestVolumeA_Traces +TestVolumeD +TestVolumeD_FlueGases +TestVolumeD_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeD.mo b/ThermoSysPro/Fluid/Volumes/VolumeD.mo index 181bd9be..5433f455 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeD.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeD.mo @@ -1,25 +1,25 @@ -within ThermoSysPro.Fluid.Volumes; +within ; model VolumeD "Mixing volume with 1 inlet and 3 outlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V=1 + parameter ThermoSysPro.Units.SI.Volume V=1 "Volume (active if dynamic_energy_balance=true)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Boolean dynamic_mass_balance=false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0=1e5 + parameter ThermoSysPro.Units.SI.AbsolutePressure P0=1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0=1e5 + parameter ThermoSysPro.Units.SI.SpecificEnthalpy h0=1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -27,87 +27,67 @@ model VolumeD "Mixing volume with 1 inlet and 3 outlets" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); + protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0=1.e-4 + constant Boolean isCompressible = Medium.isCompressible; + parameter ThermoSysPro.Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public - Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - Units.SI.Density rho(start=998) "Fluid density"; - Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; - Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph + ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.MassFlowRate BQ + "Right hand side of the mass balance equation"; + ThermoSysPro.Units.SI.Power BH + "Right hand side of the energy balance equation"; + ThermoSysPro.Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp + ThermoSysPro.Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; - Units.SI.Power Je "Thermal power diffusion from inlet e"; - Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; - Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; - Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; - Units.SI.Power J "Total thermal power diffusion"; - Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e"; - Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1"; - Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2"; - Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3"; + ThermoSysPro.Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; + ThermoSysPro.Units.SI.Power Je "Thermal power diffusion from inlet e"; + ThermoSysPro.Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; + ThermoSysPro.Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; + ThermoSysPro.Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; + ThermoSysPro.Units.SI.Power J "Total thermal power diffusion"; + ThermoSysPro.Units.SI.MassFlowRate gamma_e + "Diffusion conductance for inlet e"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s1 + "Diffusion conductance for outlet s1"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s2 + "Diffusion conductance for outlet s2"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s3 + "Diffusion conductance for outlet s3"; Real re "Value of r(Q/gamma) for inlet e"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; Real rs3 "Value of r(Q/gamma) for outlet s3"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,90},{10,110}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cs3 + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}))); initial equation if dynamic_energy_balance and dynamic_mass_balance then @@ -126,19 +106,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -148,16 +120,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - fluids[5] = Cs3.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeD: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; @@ -165,11 +127,8 @@ equation Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.Xi = Medium.X_default[1:Medium.nXi]; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -197,7 +156,7 @@ equation BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -208,13 +167,13 @@ equation P = Cs3.P; /* Energy balance equation */ - BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + J; + BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -226,48 +185,32 @@ equation Cs3.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q; - BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q; - BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q; - BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + /* Traces composition balance equations */ + BSubC = Ce.Q*Ce.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; + + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; /* Flow reversal */ if continuous_flow_reversal then @@ -327,19 +270,21 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( @@ -395,5 +340,6 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -")); +"), + uses(ThermoSysPro(version="5.0"))); end VolumeD; From 1eed3e04415229c99515b48dd37045403a27d2b5 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 11:26:48 +0200 Subject: [PATCH 040/213] VolumeI --- .../SimpleExamples/Volumes/TestVolumeI.mo | 30 ++ .../Volumes/TestVolumeI_FlueGases.mo | 40 +++ .../Volumes/TestVolumeI_Traces.mo | 42 +++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeI.mo | 302 +++++++----------- 5 files changed, 233 insertions(+), 184 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo new file mode 100644 index 00000000..1ebbb7b2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo @@ -0,0 +1,30 @@ +within ; +model TestVolumeI + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); + SinkQ sinkQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{12,22}, + {32,42}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-50,10}, + {-30,30}}))); +equation + connect(volumeI.Cs3, sink.C) + annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); + connect(volumeI.Cs1, sinkQ.C) + annotation (Line(points={{10,8},{10,32},{12,32}}, color={0,0,0})); + connect(sourcePQ.C, volumeI.Ce2) + annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) + annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo new file mode 100644 index 00000000..5e31755e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo @@ -0,0 +1,40 @@ +within ; +model TestVolumeI_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,-18}, + {46,2}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={-40,20}))); + SinkQ sinkQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{22,18}, + {42,38}}))); +equation + connect(sourcePQ.C, volumeI.Ce2) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) + annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(sinkQ.C, volumeI.Cs1) + annotation (Line(points={{22,28},{10,28},{10,8}}, color={0,0,0})); + connect(volumeI.Cs3, sink.C) + annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeI_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo new file mode 100644 index 00000000..1b8840c3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo @@ -0,0 +1,42 @@ +within ; +model TestVolumeI_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{20,20}, + {40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + VolumeI volumeI(redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, + {8,10}}))); + SinkQ sinkQ( redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={40,0}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18}, + {-36,38}}))); +equation + connect(volumeI.Cs1, sink.C) + annotation (Line(points={{8,8},{8,30},{20,30}}, + color={0,0,0})); + connect(volumeI.Cs3, sinkQ.C) + annotation (Line(points={{8,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeI.Ce2) + annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) + annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestVolumeI_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index f71ca450..866bee95 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -4,3 +4,6 @@ TestVolumeC_Traces TestVolumeA TestVolumeA_FlueGases TestVolumeA_Traces +TestVolumeI +TestVolumeI_FlueGases +TestVolumeI_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeI.mo b/ThermoSysPro/Fluid/Volumes/VolumeI.mo index 496d42db..acd70650 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeI.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeI.mo @@ -1,25 +1,24 @@ -within ThermoSysPro.Fluid.Volumes; +within ; model VolumeI "Mixing volume with 4 inlets and 4 outlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V=1 + parameter ThermoSysPro.Units.SI.Volume V=1 "Volume (active if dynamic_energy_balance=true)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Boolean dynamic_mass_balance=false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0=1e5 + parameter ThermoSysPro.Units.SI.AbsolutePressure P0=1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0=1e5 + parameter ThermoSysPro.Units.SI.SpecificEnthalpy h0=1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -27,82 +26,67 @@ model VolumeI "Mixing volume with 4 inlets and 4 outlets" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); + + protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0=1.e-4 + constant Boolean isCompressible = Medium.isCompressible; + parameter ThermoSysPro.Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public - Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - Units.SI.Density rho(start=998) "Fluid density"; - Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; - Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph + ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.MassFlowRate BQ + "Right hand side of the mass balance equation"; + ThermoSysPro.Units.SI.Power BH + "Right hand side of the energy balance equation"; + ThermoSysPro.Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp + ThermoSysPro.Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[9] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; - Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; - Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; - Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; - Units.SI.Power Je4 "Thermal power diffusion from inlet e4"; - Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; - Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; - Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; - Units.SI.Power Js4 "Thermal power diffusion from outlet s4"; - Units.SI.Power J "Total thermal power diffusion"; - Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1"; - Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2"; - Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3"; - Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4"; - Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1"; - Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2"; - Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3"; - Units.SI.MassFlowRate gamma_s4 "Diffusion conductance for outlet s4"; + ThermoSysPro.Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; + ThermoSysPro.Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; + ThermoSysPro.Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; + ThermoSysPro.Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; + ThermoSysPro.Units.SI.Power Je4 "Thermal power diffusion from inlet e4"; + ThermoSysPro.Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; + ThermoSysPro.Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; + ThermoSysPro.Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; + ThermoSysPro.Units.SI.Power Js4 "Thermal power diffusion from outlet s4"; + ThermoSysPro.Units.SI.Power J "Total thermal power diffusion"; + ThermoSysPro.Units.SI.MassFlowRate gamma_e1 + "Diffusion conductance for inlet e1"; + ThermoSysPro.Units.SI.MassFlowRate gamma_e2 + "Diffusion conductance for inlet e2"; + ThermoSysPro.Units.SI.MassFlowRate gamma_e3 + "Diffusion conductance for inlet e3"; + ThermoSysPro.Units.SI.MassFlowRate gamma_e4 + "Diffusion conductance for inlet e4"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s1 + "Diffusion conductance for outlet s1"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s2 + "Diffusion conductance for outlet s2"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s3 + "Diffusion conductance for outlet s3"; + ThermoSysPro.Units.SI.MassFlowRate gamma_s4 + "Diffusion conductance for outlet s4"; Real re1 "Value of r(Q/gamma) for inlet e1"; Real re2 "Value of r(Q/gamma) for inlet e2"; Real re3 "Value of r(Q/gamma) for inlet e3"; @@ -113,30 +97,31 @@ public Real rs4 "Value of r(Q/gamma) for outlet s4"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,70},{-90,90}}, rotation=0), iconTransformation(extent={{-110,70},{-90,90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0), iconTransformation(extent={{-110,-10},{-90,10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,70},{110,90}}, rotation=0), iconTransformation(extent={{90,70},{110,90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,-10},{110,10}}, rotation=0), iconTransformation(extent={{90,-10},{110,10}}))); - Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation( - extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90}, - {-90,-70}}))); - Interfaces.Connectors.FluidInlet Ce4 annotation (Placement(transformation( - extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{ - 10,-90}}))); - Interfaces.Connectors.FluidOutlet Cs3 annotation (Placement(transformation( - extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110, - -70}}))); - Interfaces.Connectors.FluidOutlet Cs4 annotation (Placement(transformation( - extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}), iconTransformation( + extent={{-110,-90},{-90,-70}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,-110},{10,-90}}), iconTransformation(extent= + {{-10,-110},{10,-90}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-90},{110,-70}}), iconTransformation( + extent={{90,-90},{110,-70}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs4(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,90},{10,110}}), iconTransformation( + extent={{-10,90},{10,110}}))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -154,19 +139,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -176,20 +153,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Ce4.ftype; - fluids[6] = Cs1.ftype; - fluids[7] = Cs2.ftype; - fluids[8] = Cs3.ftype; - fluids[9] = Cs4.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeI: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -197,11 +160,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -210,11 +170,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then @@ -223,11 +180,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Ce4) == 0) then @@ -236,11 +190,8 @@ equation Ce4.h_vol_1 = 1.e5; Ce4.diff_res_1 = 0; Ce4.diff_on_1 = false; - Ce4.ftype = ftype; - Ce4.Xco2 = 0; - Ce4.Xh2o = 0; - Ce4.Xo2 = 0; - Ce4.Xso2 = 0; + Ce4.Xi = Medium.X_default[1:Medium.nXi]; + Ce4.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -275,7 +226,7 @@ equation BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -290,13 +241,13 @@ equation P = Cs4.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -312,54 +263,34 @@ equation Cs4.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q - Cs4.Xi*Cs4.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs4.ftype = ftype; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + Ce4.Q*Ce4.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC - Cs4.Q*Cs4.SubC; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; + Cs4.SubC = SubC; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; + Cs4.Xi = X; - Cs4.Xco2 = Xco2; - Cs4.Xh2o = Xh2o; - Cs4.Xo2 = Xo2; - Cs4.Xso2 = Xso2; /* Flow reversal */ if continuous_flow_reversal then @@ -453,19 +384,21 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( @@ -557,5 +490,6 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -")); +"), + uses(ThermoSysPro(version="5.0"))); end VolumeI; From 97fd5470dbafc866a690244e2d5aba5d3344b302 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 11:41:28 +0200 Subject: [PATCH 041/213] Bend --- .../SimpleExamples/PressureLosses/TestBend.mo | 25 ++++++++ .../PressureLosses/TestBend_FlueGases.mo | 27 ++++++++ .../PressureLosses/TestBend_Traces.mo | 29 +++++++++ .../PressureLosses/package.order | 3 + ThermoSysPro/Fluid/PressureLosses/Bend.mo | 61 +++++++++---------- 5 files changed, 113 insertions(+), 32 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo new file mode 100644 index 00000000..b6202084 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo @@ -0,0 +1,25 @@ +within ; +model TestBend + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + Bend bend( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-22},{ + 1.77636e-15,-22},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestBend; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo new file mode 100644 index 00000000..3b8b4911 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo @@ -0,0 +1,27 @@ +within ; +model TestBend_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + Bend bend( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=270, + origin={0,-40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-30},{ + 1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestBend_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo new file mode 100644 index 00000000..472395e5 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo @@ -0,0 +1,29 @@ +within ; +model TestBend_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}); + Bend bend(redeclare + replaceable package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-23},{1.77636e-15, + -23},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestBend_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..45cdceb3 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestBend_FlueGases +TestBend_Traces +TestBend \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/Bend.mo b/ThermoSysPro/Fluid/PressureLosses/Bend.mo index 63df39db..ae391d93 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Bend.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Bend.mo @@ -1,25 +1,22 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model Bend "Bend" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Units.SI.Diameter D=0.2 "Pipe diameter"; - parameter Units.SI.Radius R0=0.2 "Pipe radius"; + parameter ThermoSysPro.Units.SI.Diameter D=0.2 "Pipe diameter"; + parameter ThermoSysPro.Units.SI.Radius R0=0.2 "Pipe radius"; parameter ThermoSysPro.Units.nonSI.Angle_deg delta=90 "Pipe angle"; parameter Real rugosrel=0 "Pipe roughness"; parameter Boolean K_A1_Tabule=true "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula"; parameter Boolean K_B1_Tabule=true "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula"; - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; public @@ -28,20 +25,20 @@ public Real khif "Friction pressure loss coefficient"; Real kdelta "Roughness factor for the singular pressure loss"; ThermoSysPro.Units.SI.PressureDifference deltaP "Presure loss"; - Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.ReynoldsNumber Re "Reynolds number"; - Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; + ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; + ThermoSysPro.Units.SI.ReynoldsNumber Re "Reynolds number"; + ThermoSysPro.Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; Real yA1 "Output of table A1"; Real yB1 "Output of table B1"; Real yC1 "Output of table C1"; Real lambda "Friction pressure loss coefficient"; - Units.SI.Density rho "Fluid density"; - Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; - Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure Pm "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + ThermoSysPro.Units.SI.Density rho "Fluid density"; + ThermoSysPro.Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; + ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure Pm "Fluid average pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + Medium.ThermodynamicState state; public ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TA1( @@ -54,9 +51,9 @@ public 8, 0.07; 10, 0.07; 15, 0.06; 20, 0.05; 25, 0.05; 30, 0.04; 35, 0.04; 40, 0.03; 45, 0.03; 50, 0.03]) annotation (Placement(transformation(extent= {{20,80},{40,100}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-10,-110},{10,-90}}, rotation=0))); equation @@ -72,19 +69,17 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + X = C1.Xi; + + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; C1.P - C2.P = deltaP; - ftype = C1.ftype; - /* Pressure loss */ deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho); @@ -135,15 +130,16 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid,mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + state=Medium.setState_phX(p=Pm, h=h, X=X); + mu = Medium.dynamicViscosity(state); annotation ( Diagram(coordinateSystem( @@ -226,5 +222,6 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -")); +"), + uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); end Bend; From dc8e84985eda447a3fad73e6f3ce02dfd6ef5a99 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 14:07:25 +0200 Subject: [PATCH 042/213] CheckValve --- .../PressureLosses/TestCheckValve.mo | 25 +++++++++ .../TestCheckValve_FlueGases.mo | 27 ++++++++++ .../PressureLosses/TestCheckValve_Traces.mo | 30 +++++++++++ .../PressureLosses/package.order | 3 ++ .../Fluid/PressureLosses/CheckValve.mo | 54 +++++++++---------- 5 files changed, 111 insertions(+), 28 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo new file mode 100644 index 00000000..e544c359 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo @@ -0,0 +1,25 @@ +within ; +model TestCheckValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + CheckValve checkValve( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(checkValve.C2, sink.C) + annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) + annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo new file mode 100644 index 00000000..6efa2a46 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo @@ -0,0 +1,27 @@ +within ; +model TestCheckValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + CheckValve checkValve( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={40,0}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(checkValve.C2, sink.C) + annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) + annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo new file mode 100644 index 00000000..b69800a3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo @@ -0,0 +1,30 @@ +within ; +model TestCheckValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}); + CheckValve checkValve( + redeclare + replaceable package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(checkValve.C2, sink.C) + annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) + annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..35fc069f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestCheckValve_FlueGases +TestCheckValve_Traces +TestCheckValve \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo index 1cd3ad57..0add4436 100644 --- a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo @@ -1,7 +1,6 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model CheckValve "Check valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10 "Pressure difference when the valve opens"; @@ -9,34 +8,34 @@ model CheckValve "Check valve" "Pressure difference when the valve closes"; parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000 "Pressure loss coefficient"; - parameter Units.SI.MassFlowRate Qmin=1.e-6 + parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; public Boolean ouvert(start=true, fixed=true) "Valve state"; discrete Boolean touvert(start=false, fixed=true); discrete Boolean tferme(start=false, fixed=true); - Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start=998) "Fluid density"; - Units.SI.Temperature T(start=290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-120,-10},{-100,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{100,-10},{120,10}}, rotation=0))); equation @@ -52,19 +51,17 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; - /* Pressure loss */ if ouvert then deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0; @@ -82,12 +79,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( Diagram(coordinateSystem( @@ -136,5 +133,6 @@ equation
  • Daniel Bouskela
  • "), - DymolaStoredErrors); + DymolaStoredErrors, + uses(ThermoSysPro(version="5.0"))); end CheckValve; From 52b91e87a7bec6334d39c66a56001ba163a1a8fc Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 14:13:57 +0200 Subject: [PATCH 043/213] Diaphragm --- .../PressureLosses/TestDiaphragm.mo | 19 ++++++ .../PressureLosses/TestDiaphragm_FlueGases.mo | 24 ++++++++ .../PressureLosses/TestDiaphragm_Traces.mo | 23 ++++++++ .../PressureLosses/package.order | 3 + .../Fluid/PressureLosses/Diaphragm.mo | 59 +++++++++---------- 5 files changed, 97 insertions(+), 31 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo new file mode 100644 index 00000000..7210150b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo @@ -0,0 +1,19 @@ +within ; +model TestDiaphragm + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + Diaphragm diaphragm( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(diaphragm.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDiaphragm; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo new file mode 100644 index 00000000..3f8b5717 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo @@ -0,0 +1,24 @@ +within ; +model TestDiaphragm_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + Diaphragm diaphragm( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(diaphragm.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDiaphragm_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo new file mode 100644 index 00000000..28493bad --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo @@ -0,0 +1,23 @@ +within ; +model TestDiaphragm_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + Diaphragm diaphragm( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(diaphragm.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDiaphragm_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..7734b975 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestDiaphragm_FlueGases +TestDiaphragm_Traces +TestDiaphragm \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo index c5562c1a..98ae7b33 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo @@ -1,39 +1,36 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model Diaphragm "Diaphragm" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real Ouv=0.5 "Diaphragm aperture"; - parameter Units.SI.Diameter D=0.2 "Diaphragm diameter"; - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.Diameter D=0.2 "Diaphragm diameter"; + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; public Real khi "Hydraulic pressure loss coefficient"; ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss"; - Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.ReynoldsNumber Re "Reynolds number"; - Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; - Units.SI.Density rho "Fluid density"; - Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; - Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure Pm "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; + ThermoSysPro.Units.SI.ReynoldsNumber Re "Reynolds number"; + ThermoSysPro.Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; + ThermoSysPro.Units.SI.Density rho "Fluid density"; + ThermoSysPro.Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; + ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure Pm "Fluid average pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + Medium.ThermodynamicState state; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -49,19 +46,17 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + X = C1.Xi; + + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; C1.P - C2.P = deltaP; - ftype = C1.ftype; - /* Pressure loss */ deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho); @@ -77,15 +72,16 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + state=Medium.setState_phX(p=Pm, h=h, X=X); + mu = Medium.dynamicViscosity(state); annotation ( Diagram(coordinateSystem( preserveAspectRatio=false, @@ -142,5 +138,6 @@ equation
    • Daniel Bouskela
    -")); +"), + uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); end Diaphragm; From f4f77c636def8b885297e6c0346f87e61931781a Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 14:23:37 +0200 Subject: [PATCH 044/213] DynamicCheckValve --- .../PressureLosses/TestDynamicCheckValve.mo | 20 +++++ .../TestDynamicCheckValve_FlueGases.mo | 25 ++++++ .../TestDynamicCheckValve_Traces.mo | 24 ++++++ .../PressureLosses/package.order | 3 + .../Fluid/PressureLosses/DynamicCheckValve.mo | 83 ++++++++++--------- 5 files changed, 114 insertions(+), 41 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo new file mode 100644 index 00000000..9ae856f0 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo @@ -0,0 +1,20 @@ +within ; +model TestDynamicCheckValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + DynamicCheckValve dynamicCheckValve( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(dynamicCheckValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDynamicCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo new file mode 100644 index 00000000..969a2303 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo @@ -0,0 +1,25 @@ +within ; +model TestDynamicCheckValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + DynamicCheckValve dynamicCheckValve( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(dynamicCheckValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDynamicCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo new file mode 100644 index 00000000..e004f96b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo @@ -0,0 +1,24 @@ +within ; +model TestDynamicCheckValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + DynamicCheckValve dynamicCheckValve( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(dynamicCheckValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDynamicCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..b6c50db3 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestDynamicCheckValve_FlueGases +TestDynamicCheckValve_Traces +TestDynamicCheckValve \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo index e149fdb8..8bfa927e 100644 --- a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo @@ -1,61 +1,63 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model DynamicCheckValve "Dynamic check valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum CV"; parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)"; - parameter Units.SI.MomentOfInertia J=1 "Flap moment of inertia"; + parameter ThermoSysPro.Units.SI.MomentOfInertia J=1 "Flap moment of inertia"; parameter Real Kf1=0 "Flap friction law coefficient #1"; parameter Real Kf2=100 "Flap friction law coefficient #2"; parameter Real n=5 "Flap friction law exponent"; - parameter Units.SI.Mass m=1 "Flap mass"; - parameter Units.SI.Area A=1 "Flap hydraulic area"; + parameter ThermoSysPro.Units.SI.Mass m=1 "Flap mass"; + parameter ThermoSysPro.Units.SI.Area A=1 "Flap hydraulic area"; parameter Integer mode_caract=0 "0:linear characteristics - 1:characteristics is given by caract[]" annotation(Evaluate=true); parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1))); parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0"; parameter Real Ouv0=0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if mech_steady_state=false)" annotation(Evaluate=true, Dialog(enable=not mech_steady_state)); - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter ThermoSysPro.Units.SI.Acceleration g=Modelica.Constants.g_n + "Gravity constant"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; - parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius"; - parameter Units.SI.Angle theta_min=0 "Minimum flap aperture angle"; - parameter Units.SI.Angle theta_max=pi/2 "Maximum flap aperture angle"; - parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + parameter ThermoSysPro.Units.SI.Radius r=sqrt(A/pi) "Flap radius"; + parameter ThermoSysPro.Units.SI.Angle theta_min=0 + "Minimum flap aperture angle"; + parameter ThermoSysPro.Units.SI.Angle theta_max=pi/2 + "Maximum flap aperture angle"; + parameter ThermoSysPro.Units.SI.Angle theta_m=(theta_min + theta_max)/2; public Boolean libre(start=true) "Indicator whether the flap is free to move in both directions"; - Units.SI.Torque Cp "Gravity torque"; - Units.SI.Torque Cf "Friction torque"; - Units.SI.Torque Ch "Hydraulic torque"; - Units.SI.Torque Ct "Total torque"; - Units.SI.Angle theta(start=theta_m) "Flap aperture angle"; - Units.SI.AngularVelocity omega "Flap angular speed"; - Units.SI.AngularAcceleration a "Flap angular acceleration"; + ThermoSysPro.Units.SI.Torque Cp "Gravity torque"; + ThermoSysPro.Units.SI.Torque Cf "Friction torque"; + ThermoSysPro.Units.SI.Torque Ch "Hydraulic torque"; + ThermoSysPro.Units.SI.Torque Ct "Total torque"; + ThermoSysPro.Units.SI.Angle theta(start=theta_m) "Flap aperture angle"; + ThermoSysPro.Units.SI.AngularVelocity omega "Flap angular speed"; + ThermoSysPro.Units.SI.AngularAcceleration a "Flap angular acceleration"; Real Ouv "Valve position"; ThermoSysPro.Units.xSI.Cv Cv(start=Cvmax) "Cv"; - Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start=998) "Fluid density"; - Units.SI.Temperature T(start=290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressrue"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressrue"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); initial equation if mech_steady_state then @@ -81,19 +83,17 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; - /* Flap angle */ Ouv = 1 - cos(theta); @@ -141,12 +141,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( Icon(coordinateSystem( @@ -198,5 +198,6 @@ equation
    • Daniel Bouskela
    -")); +"), + uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); end DynamicCheckValve; From 353b7c866b39f649dfb721321e7b694f62dc46dd Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 14:28:30 +0200 Subject: [PATCH 045/213] IdealCheckValve --- .../PressureLosses/TestIdealCheckValve.mo | 19 +++++++++++ .../TestIdealCheckValve_FlueGases.mo | 24 ++++++++++++++ .../TestIdealCheckValve_Traces.mo | 23 +++++++++++++ .../PressureLosses/package.order | 3 ++ .../Fluid/PressureLosses/IdealCheckValve.mo | 32 ++++++++++--------- 5 files changed, 86 insertions(+), 15 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo new file mode 100644 index 00000000..1d537646 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo @@ -0,0 +1,19 @@ +within ; +model TestIdealCheckValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + IdealCheckValve idealCheckValve( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(idealCheckValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestIdealCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo new file mode 100644 index 00000000..b7d4d979 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo @@ -0,0 +1,24 @@ +within ; +model TestIdealCheckValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + IdealCheckValve idealCheckValve( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(idealCheckValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestIdealCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo new file mode 100644 index 00000000..62621af3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo @@ -0,0 +1,23 @@ +within ; +model TestIdealCheckValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + IdealCheckValve idealCheckValve( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(idealCheckValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestIdealCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..1de9231e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestIdealCheckValve_FlueGases +TestIdealCheckValve_Traces +TestIdealCheckValve \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo index 136da561..c8dccfb9 100644 --- a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo @@ -1,27 +1,28 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model IdealCheckValve "Ideal check valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=0.01 "Pressure difference when the valve opens"; - parameter Units.SI.MassFlowRate Qmin=1.e-6 + parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow trhough the valve when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; public Boolean ouvert(start=true, fixed=true) "Valve state"; discrete Boolean touvert(start=false, fixed=true); discrete Boolean tferme(start=false, fixed=true); - Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure difference between the inlet and the outlet"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); equation @@ -37,12 +38,12 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + X = C1.Xi; + + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; @@ -112,5 +113,6 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -")); +"), + uses(ThermoSysPro(version="5.0"))); end IdealCheckValve; From b290da4e2c1af98b7edbea38afa502b8232b8f37 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 14:39:15 +0200 Subject: [PATCH 046/213] IdealSwitchValve --- .../PressureLosses/TestIdealSwitchValve.mo | 24 ++++++++++++ .../TestIdealSwitchValve_FlueGases.mo | 29 ++++++++++++++ .../TestIdealSwitchValve_Traces.mo | 28 ++++++++++++++ .../PressureLosses/package.order | 3 ++ .../Fluid/PressureLosses/IdealSwitchValve.mo | 38 ++++++++++--------- 5 files changed, 104 insertions(+), 18 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo new file mode 100644 index 00000000..10539b7b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo @@ -0,0 +1,24 @@ +within ; +model TestIdealSwitchValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + IdealSwitchValve idealSwitchValve(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, + {10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante + annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(idealSwitchValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) + annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestIdealSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo new file mode 100644 index 00000000..1a20b88d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo @@ -0,0 +1,29 @@ +within ; +model TestIdealSwitchValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + IdealSwitchValve idealSwitchValve(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, + {10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante + annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(idealSwitchValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) + annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestIdealSwitchValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo new file mode 100644 index 00000000..bf8f48b6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo @@ -0,0 +1,28 @@ +within ; +model TestIdealSwitchValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + IdealSwitchValve idealSwitchValve(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, + {10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante + annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(idealSwitchValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) + annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestIdealSwitchValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..6211fe31 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestIdealSwitchValve_FlueGases +TestIdealSwitchValve_Traces +TestIdealSwitchValve \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo index bc72ca5c..cc91b89c 100644 --- a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo @@ -1,29 +1,30 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model IdealSwitchValve "Ideal switch valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Units.SI.MassFlowRate Qmin=1.e-6 + parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; public - Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure difference between the inlet and the outlet"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv annotation (Placement(transformation( origin={0,70}, extent={{-10,-10},{10,10}}, rotation=270))); - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( - extent={{-110,-70},{-90,-50}}, rotation=0), iconTransformation(extent= - {{-110,-70},{-90,-50}}))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( - extent={{90,-70},{110,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-70},{-90,-50}}, rotation=0), + iconTransformation(extent={{-110,-70},{-90,-50}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-70},{110,-50}}, rotation=0))); equation C1.Q = C2.Q; @@ -38,12 +39,12 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + X = C1.Xi; + + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; @@ -112,5 +113,6 @@ equation
    • Daniel Bouskela
    -")); +"), + uses(ThermoSysPro(version="5.0"))); end IdealSwitchValve; From eff4e768c9738e45afe8eade1a9356f4c0459986 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 14:45:06 +0200 Subject: [PATCH 047/213] SwitchValve --- .../PressureLosses/TestSwitchValve.mo | 24 ++++++++ .../TestSwitchValve_FlueGases.mo | 29 ++++++++++ .../PressureLosses/TestSwitchValve_Traces.mo | 28 +++++++++ .../PressureLosses/package.order | 3 + .../Fluid/PressureLosses/SwitchValve.mo | 58 +++++++++---------- 5 files changed, 112 insertions(+), 30 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo new file mode 100644 index 00000000..ff63f24c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo @@ -0,0 +1,24 @@ +within ; +model TestSwitchValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + SwitchValve switchValve( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, + {10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante + annotation (Placement(transformation(extent={{-78,32},{-58,52}}))); +equation + connect(switchValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) + annotation (Line(points={{-57,42},{0,42},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo new file mode 100644 index 00000000..e5ef26f4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo @@ -0,0 +1,29 @@ +within ; +model TestSwitchValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + SwitchValve switchValve( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, + {10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante + annotation (Placement(transformation(extent={{-42,30},{-22,50}}))); +equation + connect(switchValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) + annotation (Line(points={{-21,40},{0,40},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestSwitchValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo new file mode 100644 index 00000000..964ac1b3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo @@ -0,0 +1,28 @@ +within ; +model TestSwitchValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + SwitchValve switchValve( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, + {10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante + annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(switchValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) + annotation (Line(points={{-19,40},{0,40},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestSwitchValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..2d04c15f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestSwitchValve_FlueGases +TestSwitchValve_Traces +TestSwitchValve \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo index 4b0a8924..df541f53 100644 --- a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo @@ -1,31 +1,30 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model SwitchValve "Switch valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000 "Pressure loss coefficient"; - parameter Units.SI.MassFlowRate Qmin=1.e-6 + parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; public - Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; + ThermoSysPro.Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start=998) "Fluid density"; - Units.SI.Temperature T(start=290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + public ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv @@ -33,11 +32,11 @@ public origin={0,72}, extent={{-10,-10},{10,10}}, rotation=270))); - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( - extent={{-110,-70},{-90,-50}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( - extent={{90,-70},{110,-50}}, rotation=0), iconTransformation(extent={ - {90,-70},{110,-50}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-70},{-90,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-70},{110,-50}}, rotation=0), + iconTransformation(extent={{90,-70},{110,-50}}))); equation C1.Q = C2.Q; @@ -52,19 +51,17 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; - /* Pressure loss */ if Ouv.signal then deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0; @@ -75,12 +72,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( @@ -137,5 +134,6 @@ equation
    • Daniel Bouskela
    -")); +"), + uses(ThermoSysPro(version="5.0"))); end SwitchValve; From 42bfdf6b12713cc33384c159a4617e3129dc5f56 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Thu, 19 Jun 2025 16:37:12 +0200 Subject: [PATCH 048/213] DynamicReliefValve --- .../PressureLosses/TestDynamicReliefValve.mo | 24 +++++ .../TestDynamicReliefValve_FlueGases.mo | 28 +++++ .../TestDynamicReliefValve_Traces.mo | 27 +++++ .../PressureLosses/package.order | 3 + .../PressureLosses/DynamicReliefValve.mo | 102 +++++++++--------- 5 files changed, 134 insertions(+), 50 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo new file mode 100644 index 00000000..e312d05f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo @@ -0,0 +1,24 @@ +within ; +model TestDynamicReliefValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + DynamicReliefValve dynamicReliefValve( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=90, + origin={0,-40}))); +equation + connect(dynamicReliefValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8}, + {0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDynamicReliefValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo new file mode 100644 index 00000000..52c9fea9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo @@ -0,0 +1,28 @@ +within ; +model TestDynamicReliefValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + DynamicReliefValve dynamicReliefValve( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=350000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=90, + origin={0,-40}))); +equation + connect(dynamicReliefValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8}, + {4.44089e-16,-9.8},{4.44089e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDynamicReliefValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo new file mode 100644 index 00000000..a2f9410b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo @@ -0,0 +1,27 @@ +within ; +model TestDynamicReliefValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + DynamicReliefValve dynamicReliefValve( + redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=90, + origin={0,-40}))); +equation + connect(dynamicReliefValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8}, + {0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + uses(ThermoSysPro(version="5.0"))); +end TestDynamicReliefValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e89506ae..03fce0b6 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,3 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestDynamicReliefValve_FlueGases +TestDynamicReliefValve_Traces +TestDynamicReliefValve \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo index 76f9bf60..5e4fd4e0 100644 --- a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo @@ -1,20 +1,22 @@ -within ThermoSysPro.Fluid.PressureLosses; +within ; model DynamicReliefValve "Dynamic relief valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Units.SI.AbsolutePressure Popen=3e5 "Pressure that opens the valve"; - parameter Units.SI.AbsolutePressure Pout=1e5 + parameter ThermoSysPro.Units.SI.AbsolutePressure Popen=3e5 + "Pressure that opens the valve"; + parameter ThermoSysPro.Units.SI.AbsolutePressure Pout=1e5 "Pressure at the valve outlet (for sizing)"; parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum Cv"; parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)"; - parameter Units.SI.Area A1=0.1 "Hydraulic area upstream the clapper"; - parameter Units.SI.Area A2=0.125 "Hydraulic area downstream the clapper"; - parameter Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2] + parameter ThermoSysPro.Units.SI.Area A1=0.1 + "Hydraulic area upstream the clapper"; + parameter ThermoSysPro.Units.SI.Area A2=0.125 + "Hydraulic area downstream the clapper"; + parameter ThermoSysPro.Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2] "Clapper area as a function of the clapper elevation"; parameter Real D=1 "Damping"; - parameter Units.SI.Mass m=1 "Valve mass"; - parameter Units.SI.Length z_max=0.1 "Maximum clapper elevation"; + parameter ThermoSysPro.Units.SI.Mass m=1 "Valve mass"; + parameter ThermoSysPro.Units.SI.Length z_max=0.1 "Maximum clapper elevation"; parameter Real Ke=62500 "Valve spring stiffness"; parameter Real Cd=0 "Drag coefficient of the clapper"; parameter Integer mode_caract=0 @@ -22,56 +24,56 @@ model DynamicReliefValve "Dynamic relief valve" parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1))); parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0" annotation(Evaluate=true); - parameter Units.SI.Length z0=0 + parameter ThermoSysPro.Units.SI.Length z0=0 "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if mech_steady_state=false)" annotation (Evaluate=true, Dialog(enable=not mech_steady_state)); - parameter Units.SI.MassFlowRate gamma_diff=1e-4 + parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant ThermoSysPro.Units.SI.Acceleration g=Modelica.Constants.g_n + "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - constant Units.SI.Density rho60F=998.98 "Water density at 60°F"; + constant ThermoSysPro.Units.SI.Density rho60F=998.98 "Water density at 60°F"; constant Real K=1.733e12 "Valve constant"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; - parameter Units.SI.Length z_min=0 "Minimum clapper elevation"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + parameter ThermoSysPro.Units.SI.Length z_min=0 "Minimum clapper elevation"; public Boolean clapper_is_free(start=true) "true if clapper is free to move in both directions, false otherwise"; - Units.SI.Force Fp "Gravity force"; - Units.SI.Force Fr "Spring force"; - Units.SI.Force Fd "Damping force"; - Units.SI.Force Fh "Hydraulic force"; - Units.SI.Force Fdyn "Dynamic pressure force"; - Units.SI.Force Ft "Total force"; - Units.SI.Length z(start=z_min) "Clapper elevation"; - Units.SI.Velocity v=der(z) "Clapper velocity"; - Units.SI.Acceleration a=der(v) "Clapper acceleration"; + ThermoSysPro.Units.SI.Force Fp "Gravity force"; + ThermoSysPro.Units.SI.Force Fr "Spring force"; + ThermoSysPro.Units.SI.Force Fd "Damping force"; + ThermoSysPro.Units.SI.Force Fh "Hydraulic force"; + ThermoSysPro.Units.SI.Force Fdyn "Dynamic pressure force"; + ThermoSysPro.Units.SI.Force Ft "Total force"; + ThermoSysPro.Units.SI.Length z(start=z_min) "Clapper elevation"; + ThermoSysPro.Units.SI.Velocity v=der(z) "Clapper velocity"; + ThermoSysPro.Units.SI.Acceleration a=der(v) "Clapper acceleration"; Real Ouv "Valve position"; - Units.SI.Area A "Hydraulic area upstream the clapper"; - Units.SI.Force Fr_min "Spring force when valve is closed"; + ThermoSysPro.Units.SI.Area A "Hydraulic area upstream the clapper"; + ThermoSysPro.Units.SI.Force Fr_min "Spring force when valve is closed"; ThermoSysPro.Units.xSI.Cv Cv "Cv"; - Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start=998) "Fluid density"; - Units.SI.Temperature T(start=290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper"; - Units.SI.Velocity vh "Fluid velocity through the valve"; - Units.SI.Energy Wdyn "Dissipated fluid kinetic energy"; + ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; + ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + ThermoSysPro.Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper"; + ThermoSysPro.Units.SI.Velocity vh "Fluid velocity through the valve"; + ThermoSysPro.Units.SI.Energy Wdyn "Dissipated fluid kinetic energy"; Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-10,-108},{10,-88}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0), iconTransformation(extent={{90,-10},{110,10}}))); initial equation @@ -98,18 +100,17 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + X = C1.Xi; + + + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; /* Hydraulic area upstream the clapper. It varies as a function of the valve elevation between A1 (valve closed) and A2 (valve open) with a hysteresis */ @@ -174,12 +175,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( Icon(coordinateSystem( @@ -233,5 +234,6 @@ equation
    • Daniel Bouskela
    -")); +"), + uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); end DynamicReliefValve; From e9e327e5baabee2f89670335dc3bcebfddd8b5de Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 10:35:10 +0200 Subject: [PATCH 049/213] #125 VolumeB reviewed --- .../SimpleExamples/Volumes/TestVolumeB.mo | 28 +++----- .../Volumes/TestVolumeB_FlueGases.mo | 37 +++++------ .../Volumes/TestVolumeB_Traces.mo | 36 ++++------- .../SimpleExamples/Volumes/package.order | 2 +- ThermoSysPro/Fluid/Volumes/VolumeB.mo | 64 ++++++++----------- 5 files changed, 68 insertions(+), 99 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo index ef023186..70a46a81 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo @@ -1,26 +1,18 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeB extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{20,28}, - {40,48}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,28},{40,48}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=180, origin={42,0}))); equation - connect(sourcePQ.C,volumeB. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21, - 7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); - connect(volumeB.Cs1, sink.C) - annotation (Line(points={{0,10},{0,38},{20,38}}, - color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21,7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,38},{20,38}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeB; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo index 36c5da1e..ceda5fee 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo @@ -1,33 +1,28 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeB_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{26,16}, - {46,36}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=180, origin={40,0}))); equation - connect(sourcePQ.C,volumeB. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{23,0},{23, - 7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); - connect(volumeB.Cs1, sink.C) - annotation (Line(points={{0,10},{0,26},{26,26}}, - color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{23,0},{23,7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeB_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo index 5e6e9e9e..1622f1d4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeB_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,30 +6,22 @@ model TestVolumeB_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{20,20}, - {40,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - VolumeB volumeB(redeclare package Medium = Medium, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeB volumeB( + redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, - SubC0={0.2}) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=180, origin={40,0}))); equation - connect(sourcePQ.C,volumeB. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{24,0},{24, - 7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); - connect(volumeB.Cs1, sink.C) - annotation (Line(points={{0,10},{0,30},{20,30}}, - color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{24,0},{24,7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,30},{20,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeB_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index acb69536..dc5b4044 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -6,4 +6,4 @@ TestVolumeA_FlueGases TestVolumeA_Traces TestVolumeB TestVolumeB_FlueGases -TestVolumeB_Traces \ No newline at end of file +TestVolumeB_Traces diff --git a/ThermoSysPro/Fluid/Volumes/VolumeB.mo b/ThermoSysPro/Fluid/Volumes/VolumeB.mo index e59027d0..43aecbf6 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeB.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeB.mo @@ -1,25 +1,25 @@ -within ; +within ThermoSysPro.Fluid.Volumes; model VolumeB "Mixing volume with 2 inlets and 2 outlets" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter ThermoSysPro.Units.SI.Volume V=1 + parameter Units.SI.Volume V=1 "Volume (active if dynamic_energy_balance=true)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Boolean dynamic_mass_balance=false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter ThermoSysPro.Units.SI.AbsolutePressure P0=1e5 + parameter Units.SI.AbsolutePressure P0=1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter ThermoSysPro.Units.SI.SpecificEnthalpy h0=1e5 + parameter Units.SI.SpecificEnthalpy h0=1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -27,11 +27,11 @@ model VolumeB "Mixing volume with 2 inlets and 2 outlets" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, @@ -40,42 +40,33 @@ model VolumeB "Mixing volume with 2 inlets and 2 outlets" protected constant Boolean isCompressible = Medium.isCompressible; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma0=1.e-4 + parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; public - ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) - "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.MassFlowRate BQ - "Right hand side of the mass balance equation"; - ThermoSysPro.Units.SI.Power BH - "Right hand side of the energy balance equation"; - ThermoSysPro.Units.SI.DerDensityByPressure ddph - "density derivative wrt pressure at constant specific enthalpy"; - ThermoSysPro.Units.SI.DerDensityByEnthalpy ddhp - "density derivative wrt specific enthalpy at constant pressure"; - ThermoSysPro.Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Units.SI.Temperature T "Fluid temperature"; + Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; + Units.SI.Power BH "Right hand side of the energy balance equation"; + Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Medium.ThermodynamicState state; - ThermoSysPro.Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; - ThermoSysPro.Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; - ThermoSysPro.Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; - ThermoSysPro.Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; - ThermoSysPro.Units.SI.Power J "Total thermal power diffusion"; - ThermoSysPro.Units.SI.MassFlowRate gamma_e1 - "Diffusion conductance for inlet e1"; - ThermoSysPro.Units.SI.MassFlowRate gamma_e2 - "Diffusion conductance for inlet e2"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s1 - "Diffusion conductance for outlet s1"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s2 - "Diffusion conductance for outlet s2"; + Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; + Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; + Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; + Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; + Units.SI.Power J "Total thermal power diffusion"; + Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1"; + Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2"; + Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1"; + Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2"; Real re1 "Value of r(Q/gamma) for inlet e1"; Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; @@ -342,6 +333,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - uses(ThermoSysPro(version="5.0"))); +")); end VolumeB; From 2d31b7006fbb739089d398f9388ec5e3b08a4a58 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Fri, 20 Jun 2025 10:52:10 +0200 Subject: [PATCH 050/213] corrections --- .../Machines/TestStaticCentrifugalPump.mo | 7 ++- .../TestStaticCentrifugalPump_FlueGases.mo | 7 ++- .../TestStaticCentrifugalPump_Traces.mo | 7 ++- .../Fluid/Machines/StaticCentrifugalPump.mo | 43 +++++++++---------- 4 files changed, 30 insertions(+), 34 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo index 5da05aac..eaf3a569 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo @@ -1,9 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; model TestStaticCentrifugalPump extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - StaticCentrifugalPump staticCentrifugalPump( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump( redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package @@ -15,6 +15,5 @@ equation annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestStaticCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo index 3d38a722..d461da0e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo @@ -1,9 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; model TestStaticCentrifugalPump_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - StaticCentrifugalPump staticCentrifugalPump( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump( redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10}, {14,10}}))); @@ -21,6 +21,5 @@ equation annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestStaticCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo index 26d98475..2f92f154 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; model TestStaticCentrifugalPump_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,7 +6,7 @@ model TestStaticCentrifugalPump_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - StaticCentrifugalPump staticCentrifugalPump( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump( redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, {10,10}}))); @@ -21,6 +21,5 @@ equation annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestStaticCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo index 6a8ad300..0506ea69 100644 --- a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo @@ -1,13 +1,13 @@ -within ; +within ThermoSysPro.Fluid.Machines; model StaticCentrifugalPump "Static centrifugal pump" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby - ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby + ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400 + parameter Units.nonSI.AngularVelocity_rpm VRot=1400 "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)"; - parameter ThermoSysPro.Units.SI.Power MPower=0.1e6 + parameter Units.SI.Power MPower=0.1e6 "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)"; - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400 + parameter Units.nonSI.AngularVelocity_rpm VRotn=1400 "Nominal rotational speed"; parameter Real rm=0.85 "Product of the pump mechanical and electrical efficiencies"; @@ -15,9 +15,9 @@ model StaticCentrifugalPump "Static centrifugal pump" "1: fixed rotational speed - 2: fixed mechanical power"; parameter Boolean adiabatic_compression=false "true: compression at constant enthalpy - false: compression with varying enthalpy"; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Real a1=-88.67 @@ -35,28 +35,28 @@ model StaticCentrifugalPump "Static centrifugal pump" "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)"; protected - constant ThermoSysPro.Units.SI.Acceleration g=Modelica.Constants.g_n + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; parameter Real eps=1.e-6 "Small number"; parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings"; public Real rh "Hydraulic efficiency"; - ThermoSysPro.Units.SI.Height hn(start=10) "Pump head"; + Units.SI.Height hn(start=10) "Pump head"; Real R(start=VRot/VRotn) "Reduced rotational speed"; - ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; - ThermoSysPro.Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; - ThermoSysPro.Units.SI.Power Wh "Hydraulic power"; - ThermoSysPro.Units.SI.Power Wm "Mechanical power"; - ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vr "Rotational speed"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.PressureDifference deltaP + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; + Units.SI.Power Wh "Hydraulic power"; + Units.SI.Power Wm "Mechanical power"; + Units.nonSI.AngularVelocity_rpm Vr "Rotational speed"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.PressureDifference deltaP "Pressure variation between the outlet and the inlet"; - ThermoSysPro.Units.SI.SpecificEnthalpy deltaH + Units.SI.SpecificEnthalpy deltaH "Specific enthalpy variation between the outlet and the inlet"; - ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; @@ -186,6 +186,5 @@ equation
  • Baligh El Hefni
  • "), - DymolaStoredErrors, - uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); + DymolaStoredErrors); end StaticCentrifugalPump; From f03e25488fe9ba31b482f1bb012d135f3219a610 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 11:06:16 +0200 Subject: [PATCH 051/213] #125 VolumeD reviewed + startValues for FlueGases examples --- .../Volumes/TestVolumeA_FlueGases.mo | 2 +- .../Volumes/TestVolumeB_FlueGases.mo | 2 +- .../SimpleExamples/Volumes/TestVolumeD.mo | 28 +++------ .../Volumes/TestVolumeD_FlueGases.mo | 38 +++++------- .../Volumes/TestVolumeD_Traces.mo | 36 +++++------ ThermoSysPro/Fluid/Volumes/VolumeD.mo | 62 ++++++++----------- 6 files changed, 68 insertions(+), 100 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo index fe764acd..a154a30d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo @@ -12,7 +12,7 @@ model TestVolumeA_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, T0=573.15, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo index ceda5fee..034bfd84 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo @@ -12,7 +12,7 @@ model TestVolumeB_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, T0=573.15, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo index 998e93ea..141159c5 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo @@ -1,25 +1,15 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeD extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - VolumeD volumeD(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, - {-32,10}}))); - SinkQ sinkQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{12,22}, - {32,42}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeD volumeD(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{12,22},{32,42}}))); equation - connect(sourcePQ.C, volumeD.Ce) - annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); - connect(volumeD.Cs3, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(volumeD.Cs1, sinkQ.C) - annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(volumeD.Cs3, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeD.Cs1, sinkQ.C) annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeD; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo index ac73a552..aad09e10 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo @@ -1,34 +1,28 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeD_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{26,16}, - {46,36}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - VolumeD volumeD(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - SinkQ sinkQ( redeclare replaceable - package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeD volumeD(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); equation - connect(volumeD.Cs1, sink.C) - annotation (Line(points={{0,10},{0,26},{26,26}}, - color={0,0,0})); - connect(sourcePQ.C, volumeD.Ce) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeD.Cs3, sinkQ.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(volumeD.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); + connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeD.Cs3, sinkQ.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeD_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo index 818c28dd..767e33ce 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeD_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,30 +6,22 @@ model TestVolumeD_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{20,20}, - {40,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - VolumeD volumeD(redeclare package Medium = Medium, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeD volumeD( + redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, - {8,10}}))); - SinkQ sinkQ( redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); equation - connect(volumeD.Cs1, sink.C) - annotation (Line(points={{-2,10},{-2,30},{20,30}}, - color={0,0,0})); - connect(sourcePQ.C, volumeD.Ce) - annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); - connect(volumeD.Cs3, sinkQ.C) - annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(volumeD.Cs1, sink.C) annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(volumeD.Cs3, sinkQ.C) annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeD_Traces; diff --git a/ThermoSysPro/Fluid/Volumes/VolumeD.mo b/ThermoSysPro/Fluid/Volumes/VolumeD.mo index 5433f455..97569fd9 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeD.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeD.mo @@ -1,25 +1,25 @@ -within ; +within ThermoSysPro.Fluid.Volumes; model VolumeD "Mixing volume with 1 inlet and 3 outlets" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter ThermoSysPro.Units.SI.Volume V=1 + parameter Units.SI.Volume V=1 "Volume (active if dynamic_energy_balance=true)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Boolean dynamic_mass_balance=false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter ThermoSysPro.Units.SI.AbsolutePressure P0=1e5 + parameter Units.SI.AbsolutePressure P0=1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter ThermoSysPro.Units.SI.SpecificEnthalpy h0=1e5 + parameter Units.SI.SpecificEnthalpy h0=1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -27,10 +27,10 @@ model VolumeD "Mixing volume with 1 inlet and 3 outlets" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", @@ -39,42 +39,35 @@ model VolumeD "Mixing volume with 1 inlet and 3 outlets" protected constant Boolean isCompressible = Medium.isCompressible; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma0=1.e-4 + parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; public - ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) - "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.MassFlowRate BQ - "Right hand side of the mass balance equation"; - ThermoSysPro.Units.SI.Power BH - "Right hand side of the energy balance equation"; - ThermoSysPro.Units.SI.DerDensityByPressure ddph + Units.SI.Temperature T "Fluid temperature"; + Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; + Units.SI.Power BH "Right hand side of the energy balance equation"; + Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - ThermoSysPro.Units.SI.DerDensityByEnthalpy ddhp + Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - ThermoSysPro.Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Medium.ThermodynamicState state; - ThermoSysPro.Units.SI.Power Je "Thermal power diffusion from inlet e"; - ThermoSysPro.Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; - ThermoSysPro.Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; - ThermoSysPro.Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; - ThermoSysPro.Units.SI.Power J "Total thermal power diffusion"; - ThermoSysPro.Units.SI.MassFlowRate gamma_e - "Diffusion conductance for inlet e"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s1 - "Diffusion conductance for outlet s1"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s2 - "Diffusion conductance for outlet s2"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s3 - "Diffusion conductance for outlet s3"; + Units.SI.Power Je "Thermal power diffusion from inlet e"; + Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; + Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; + Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; + Units.SI.Power J "Total thermal power diffusion"; + Units.SI.MassFlowRate gamma_e "Diffusion conductance for inlet e"; + Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1"; + Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2"; + Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3"; Real re "Value of r(Q/gamma) for inlet e"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; @@ -340,6 +333,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - uses(ThermoSysPro(version="5.0"))); +")); end VolumeD; From f6a02971e17778d2fb90d644e63f929d6f68e703 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Fri, 20 Jun 2025 11:12:55 +0200 Subject: [PATCH 052/213] corrections --- .../SimpleExamples/Volumes/TestVolumeI.mo | 12 +--- .../Volumes/TestVolumeI_FlueGases.mo | 14 +--- .../Volumes/TestVolumeI_Traces.mo | 14 +--- ThermoSysPro/Fluid/Volumes/VolumeI.mo | 69 +++++++++---------- 4 files changed, 43 insertions(+), 66 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo index 1ebbb7b2..36c1c6c2 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo @@ -1,30 +1,24 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeI extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, {-32,10}}))); - SinkQ sinkQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{12,22}, - {32,42}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,10}, {-30,30}}))); equation connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); - connect(volumeI.Cs1, sinkQ.C) - annotation (Line(points={{10,8},{10,32},{12,32}}, color={0,0,0})); connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo index 5e31755e..e27d1d74 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeI_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; @@ -13,7 +13,7 @@ model TestVolumeI_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, T0=573.15, @@ -21,20 +21,12 @@ model TestVolumeI_FlueGases {10,10}}, rotation=0, origin={-40,20}))); - SinkQ sinkQ( - redeclare replaceable package Medium = Medium, - T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{22,18}, - {42,38}}))); equation connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); - connect(sinkQ.C, volumeI.Cs1) - annotation (Line(points={{22,28},{10,28},{10,8}}, color={0,0,0})); connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeI_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo index 1b8840c3..b2402807 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeI_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -13,15 +13,10 @@ model TestVolumeI_Traces replaceable package Medium = Medium, Q0=100, SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - VolumeI volumeI(redeclare package Medium = Medium, + ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium, V=1, dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, {8,10}}))); - SinkQ sinkQ( redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, - rotation=0, - origin={40,0}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, Q0=100, @@ -31,12 +26,9 @@ equation connect(volumeI.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); - connect(volumeI.Cs3, sinkQ.C) - annotation (Line(points={{8,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeI_Traces; diff --git a/ThermoSysPro/Fluid/Volumes/VolumeI.mo b/ThermoSysPro/Fluid/Volumes/VolumeI.mo index acd70650..05901a4a 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeI.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeI.mo @@ -1,24 +1,24 @@ -within ; +within ThermoSysPro.Fluid.Volumes; model VolumeI "Mixing volume with 4 inlets and 4 outlets" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter ThermoSysPro.Units.SI.Volume V=1 + parameter Units.SI.Volume V=1 "Volume (active if dynamic_energy_balance=true)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Boolean dynamic_mass_balance=false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter ThermoSysPro.Units.SI.AbsolutePressure P0=1e5 + parameter Units.SI.AbsolutePressure P0=1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter ThermoSysPro.Units.SI.SpecificEnthalpy h0=1e5 + parameter Units.SI.SpecificEnthalpy h0=1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -26,7 +26,7 @@ model VolumeI "Mixing volume with 4 inlets and 4 outlets" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); @@ -39,53 +39,53 @@ model VolumeI "Mixing volume with 4 inlets and 4 outlets" protected constant Boolean isCompressible = Medium.isCompressible; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma0=1.e-4 + parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; public - ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.Temperature T "Fluid temperature"; + Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.MassFlowRate BQ + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; - ThermoSysPro.Units.SI.Power BH + Units.SI.Power BH "Right hand side of the energy balance equation"; - ThermoSysPro.Units.SI.DerDensityByPressure ddph + Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - ThermoSysPro.Units.SI.DerDensityByEnthalpy ddhp + Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - ThermoSysPro.Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Medium.ThermodynamicState state; - ThermoSysPro.Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; - ThermoSysPro.Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; - ThermoSysPro.Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; - ThermoSysPro.Units.SI.Power Je4 "Thermal power diffusion from inlet e4"; - ThermoSysPro.Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; - ThermoSysPro.Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; - ThermoSysPro.Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; - ThermoSysPro.Units.SI.Power Js4 "Thermal power diffusion from outlet s4"; - ThermoSysPro.Units.SI.Power J "Total thermal power diffusion"; - ThermoSysPro.Units.SI.MassFlowRate gamma_e1 + Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; + Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; + Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; + Units.SI.Power Je4 "Thermal power diffusion from inlet e4"; + Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; + Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; + Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; + Units.SI.Power Js4 "Thermal power diffusion from outlet s4"; + Units.SI.Power J "Total thermal power diffusion"; + Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1"; - ThermoSysPro.Units.SI.MassFlowRate gamma_e2 + Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2"; - ThermoSysPro.Units.SI.MassFlowRate gamma_e3 + Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3"; - ThermoSysPro.Units.SI.MassFlowRate gamma_e4 + Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s1 + Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s2 + Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s3 + Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3"; - ThermoSysPro.Units.SI.MassFlowRate gamma_s4 + Units.SI.MassFlowRate gamma_s4 "Diffusion conductance for outlet s4"; Real re1 "Value of r(Q/gamma) for inlet e1"; Real re2 "Value of r(Q/gamma) for inlet e2"; @@ -490,6 +490,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - uses(ThermoSysPro(version="5.0"))); +")); end VolumeI; From 74bebfaa867262cad44844617f6af987740ff6b5 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 11:14:42 +0200 Subject: [PATCH 053/213] #125 Bend reviewed --- .../SimpleExamples/PressureLosses/TestBend.mo | 25 ++++++------------ .../PressureLosses/TestBend_FlueGases.mo | 18 +++++-------- .../PressureLosses/TestBend_Traces.mo | 26 ++++++------------- .../PressureLosses/package.order | 2 +- ThermoSysPro/Fluid/PressureLosses/Bend.mo | 14 +++++----- 5 files changed, 32 insertions(+), 53 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo index b6202084..4609b989 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo @@ -1,25 +1,16 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestBend extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - Bend bend( - redeclare replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + ThermoSysPro.Fluid.PressureLosses.Bend bend(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=270, origin={0,-40}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-22},{ - 1.77636e-15,-22},{1.77636e-15,-30}}, color={0,0,0})); - connect(bend.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-22},{1.77636e-15,-22},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestBend; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo index 3b8b4911..dbb61f49 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo @@ -1,15 +1,14 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestBend_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - Bend bend( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.PressureLosses.Bend bend(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=270, origin={0,-40}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( @@ -18,10 +17,7 @@ model TestBend_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-30},{ - 1.77636e-15,-30}}, color={0,0,0})); - connect(bend.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-30},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestBend_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo index 472395e5..419b6238 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestBend_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,24 +6,14 @@ model TestBend_Traces extraPropertiesNames={"Trace1"}, C_nominal={0.1}, C_default={0.2}); - Bend bend(redeclare - replaceable package Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + ThermoSysPro.Fluid.PressureLosses.Bend bend(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=270, origin={0,-40}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-23},{1.77636e-15, - -23},{1.77636e-15,-30}}, color={0,0,0})); - connect(bend.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-23},{1.77636e-15,-23},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestBend_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index 45cdceb3..cf7de367 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,6 +7,6 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestBend TestBend_FlueGases TestBend_Traces -TestBend \ No newline at end of file diff --git a/ThermoSysPro/Fluid/PressureLosses/Bend.mo b/ThermoSysPro/Fluid/PressureLosses/Bend.mo index ae391d93..b6103fc3 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Bend.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Bend.mo @@ -1,6 +1,9 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model Bend "Bend" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.SI.Diameter D=0.2 "Pipe diameter"; parameter ThermoSysPro.Units.SI.Radius R0=0.2 "Pipe radius"; @@ -130,12 +133,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = Medium.temperature_phX(p=Pm, h=h, X=X); + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = Medium.density_phX(p=Pm, h=h, X=X); + rho = Medium.density(state); end if; state=Medium.setState_phX(p=Pm, h=h, X=X); @@ -222,6 +225,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); +")); end Bend; From e2e46ed9c5134a71fa6d418879391808dd1f4fc1 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 11:22:20 +0200 Subject: [PATCH 054/213] #125 Bend units modified --- ThermoSysPro/Fluid/PressureLosses/Bend.mo | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/Bend.mo b/ThermoSysPro/Fluid/PressureLosses/Bend.mo index b6103fc3..c1b5c962 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Bend.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Bend.mo @@ -5,17 +5,17 @@ model Bend "Bend" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter ThermoSysPro.Units.SI.Diameter D=0.2 "Pipe diameter"; - parameter ThermoSysPro.Units.SI.Radius R0=0.2 "Pipe radius"; - parameter ThermoSysPro.Units.nonSI.Angle_deg delta=90 "Pipe angle"; + parameter Units.SI.Diameter D=0.2 "Pipe diameter"; + parameter Units.SI.Radius R0=0.2 "Pipe radius"; + parameter Units.nonSI.Angle_deg delta=90 "Pipe angle"; parameter Real rugosrel=0 "Pipe roughness"; parameter Boolean K_A1_Tabule=true "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula"; parameter Boolean K_B1_Tabule=true "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula"; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected @@ -27,19 +27,19 @@ public Real khim "Singular pressure loss coefficient"; Real khif "Friction pressure loss coefficient"; Real kdelta "Roughness factor for the singular pressure loss"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Presure loss"; - ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; - ThermoSysPro.Units.SI.ReynoldsNumber Re "Reynolds number"; - ThermoSysPro.Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; + Units.SI.PressureDifference deltaP "Presure loss"; + Units.SI.MassFlowRate Q "Mass flow rate"; + Units.SI.ReynoldsNumber Re "Reynolds number"; + Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; Real yA1 "Output of table A1"; Real yB1 "Output of table B1"; Real yC1 "Output of table C1"; Real lambda "Friction pressure loss coefficient"; - ThermoSysPro.Units.SI.Density rho "Fluid density"; - ThermoSysPro.Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; - ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure Pm "Fluid average pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; + Units.SI.Density rho "Fluid density"; + Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; + Units.SI.Temperature T "Fluid temperature"; + Units.SI.AbsolutePressure Pm "Fluid average pressure"; + Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Medium.ThermodynamicState state; From 8b060a3525ee289af6ab8046aeb3628579a9910c Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Fri, 20 Jun 2025 11:23:39 +0200 Subject: [PATCH 055/213] corrections --- .../PressureLosses/TestCheckValve.mo | 7 ++--- .../TestCheckValve_FlueGases.mo | 7 ++--- .../PressureLosses/TestCheckValve_Traces.mo | 7 ++--- .../Fluid/PressureLosses/CheckValve.mo | 31 +++++++++---------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo index e544c359..86242b26 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo @@ -1,9 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestCheckValve extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - CheckValve checkValve( + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve( redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package @@ -20,6 +20,5 @@ equation connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + coordinateSystem(preserveAspectRatio=false))); end TestCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo index 6efa2a46..0058fa76 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo @@ -1,9 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestCheckValve_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - CheckValve checkValve( redeclare + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve( redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, @@ -22,6 +22,5 @@ equation annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo index b69800a3..03db4bd5 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestCheckValve_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,7 +6,7 @@ model TestCheckValve_Traces extraPropertiesNames={"Trace1"}, C_nominal={0.1}, C_default={0.2}); - CheckValve checkValve( + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve( redeclare replaceable package Medium = Medium) @@ -25,6 +25,5 @@ equation connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + coordinateSystem(preserveAspectRatio=false))); end TestCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo index 0add4436..49640464 100644 --- a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo @@ -1,18 +1,18 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model CheckValve "Check valve" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=10 + parameter Units.SI.PressureDifference dPOuvert=10 "Pressure difference when the valve opens"; - parameter ThermoSysPro.Units.SI.PressureDifference dPFerme=0 + parameter Units.SI.PressureDifference dPFerme=0 "Pressure difference when the valve closes"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000 + parameter Units.xSI.PressureLossCoefficient k=1000 "Pressure loss coefficient"; - parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 + parameter Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow when the valve is closed"; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected @@ -22,13 +22,13 @@ public Boolean ouvert(start=true, fixed=true) "Valve state"; discrete Boolean touvert(start=false, fixed=true); discrete Boolean tferme(start=false, fixed=true); - ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; @@ -133,6 +133,5 @@ equation
  • Daniel Bouskela
  • "), - DymolaStoredErrors, - uses(ThermoSysPro(version="5.0"))); + DymolaStoredErrors); end CheckValve; From 2aea315d622ab9c2b417feacfcbcc39c5c009392 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Fri, 20 Jun 2025 11:31:21 +0200 Subject: [PATCH 056/213] dernieres corrections --- ThermoSysPro/Fluid/Volumes/VolumeI.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/Volumes/VolumeI.mo b/ThermoSysPro/Fluid/Volumes/VolumeI.mo index 05901a4a..8335e4e8 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeI.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeI.mo @@ -29,7 +29,7 @@ model VolumeI "Mixing volume with 4 inlets and 4 outlets" parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", From 734be47eed3620c53f85921868af1c37a3b31f1a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 11:40:06 +0200 Subject: [PATCH 057/213] #125 Diaphragm reviewed --- .../PressureLosses/TestDiaphragm.mo | 20 ++++-------- .../PressureLosses/TestDiaphragm_FlueGases.mo | 14 +++----- .../PressureLosses/TestDiaphragm_Traces.mo | 21 ++++-------- .../Fluid/PressureLosses/Diaphragm.mo | 32 +++++++++---------- 4 files changed, 35 insertions(+), 52 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo index 7210150b..b063b2f6 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo @@ -1,19 +1,13 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDiaphragm extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - Diaphragm diaphragm( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(diaphragm.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(diaphragm.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(diaphragm.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDiaphragm; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo index 3f8b5717..c0891318 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo @@ -1,10 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDiaphragm_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - Diaphragm diaphragm( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -15,10 +14,7 @@ model TestDiaphragm_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(diaphragm.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(diaphragm.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(diaphragm.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDiaphragm_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo index 28493bad..f5acc6d4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDiaphragm_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,18 +6,11 @@ model TestDiaphragm_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - Diaphragm diaphragm( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(diaphragm.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(diaphragm.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(diaphragm.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDiaphragm_Traces; diff --git a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo index 98ae7b33..1445aed5 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo @@ -1,12 +1,12 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model Diaphragm "Diaphragm" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real Ouv=0.5 "Diaphragm aperture"; - parameter ThermoSysPro.Units.SI.Diameter D=0.2 "Diaphragm diameter"; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.Diameter D=0.2 "Diaphragm diameter"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected @@ -15,15 +15,15 @@ protected public Real khi "Hydraulic pressure loss coefficient"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss"; - ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; - ThermoSysPro.Units.SI.ReynoldsNumber Re "Reynolds number"; - ThermoSysPro.Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; - ThermoSysPro.Units.SI.Density rho "Fluid density"; - ThermoSysPro.Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; - ThermoSysPro.Units.SI.Temperature T "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure Pm "Fluid average pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; + Units.SI.PressureDifference deltaP "Pressure loss"; + Units.SI.MassFlowRate Q "Mass flow rate"; + Units.SI.ReynoldsNumber Re "Reynolds number"; + Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; + Units.SI.Density rho "Fluid density"; + Units.SI.DynamicViscosity mu "Fluid dynamic viscosity"; + Units.SI.Temperature T "Fluid temperature"; + Units.SI.AbsolutePressure Pm "Fluid average pressure"; + Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Medium.ThermodynamicState state; @@ -72,12 +72,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = Medium.temperature_phX(p=Pm, h=h, X=X); + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = Medium.density_phX(p=Pm, h=h, X=X); + rho = Medium.density(state); end if; state=Medium.setState_phX(p=Pm, h=h, X=X); From 40176082eda3c83f5e7c79e08141f566aa422db5 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 11:41:34 +0200 Subject: [PATCH 058/213] #125 Diaphragm reviewed, annotation --- ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo index 1445aed5..da5f2eac 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo @@ -138,6 +138,5 @@ equation
    • Daniel Bouskela
    -"), - uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); +")); end Diaphragm; From 523e3066fcfe86dfc2b2ec218cbcc9d021acfcbf Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 11:48:23 +0200 Subject: [PATCH 059/213] #125 IdealCheckValve reviewed --- .../PressureLosses/TestIdealCheckValve.mo | 20 ++++++--------- .../TestIdealCheckValve_FlueGases.mo | 14 ++++------- .../TestIdealCheckValve_Traces.mo | 21 ++++++---------- .../PressureLosses/package.order | 2 +- .../Fluid/PressureLosses/IdealCheckValve.mo | 25 ++++++++----------- 5 files changed, 31 insertions(+), 51 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo index 1d537646..3d97044e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo @@ -1,19 +1,13 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestIdealCheckValve extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - IdealCheckValve idealCheckValve( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(idealCheckValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(idealCheckValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(idealCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestIdealCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo index b7d4d979..5a01613a 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo @@ -1,10 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestIdealCheckValve_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - IdealCheckValve idealCheckValve( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -15,10 +14,7 @@ model TestIdealCheckValve_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(idealCheckValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(idealCheckValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(idealCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestIdealCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo index 62621af3..51cccd09 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestIdealCheckValve_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,18 +6,11 @@ model TestIdealCheckValve_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - IdealCheckValve idealCheckValve( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(idealCheckValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(idealCheckValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(idealCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestIdealCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index e3218bf8..7fae05e7 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -7,9 +7,9 @@ TestSingularPressureLoss_Traces_FlueGases TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestIdealCheckValve TestIdealCheckValve_FlueGases TestIdealCheckValve_Traces -TestIdealCheckValve TestDiaphragm TestDiaphragm_FlueGases TestDiaphragm_Traces diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo index c8dccfb9..69c2af26 100644 --- a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo @@ -1,24 +1,25 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model IdealCheckValve "Ideal check valve" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert=0.01 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.PressureDifference dPOuvert=0.01 "Pressure difference when the valve opens"; - parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 + parameter Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow trhough the valve when the valve is closed"; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; public Boolean ouvert(start=true, fixed=true) "Valve state"; discrete Boolean touvert(start=false, fixed=true); discrete Boolean tferme(start=false, fixed=true); - ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.MassFlowRate Q "Mass flow rate"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.PressureDifference deltaP + Units.SI.PressureDifference deltaP "Pressure difference between the inlet and the outlet"; - Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); @@ -40,9 +41,6 @@ equation C1.Xi = C2.Xi; - X = C1.Xi; - - C1.SubC = C2.SubC; Q = C1.Q; @@ -113,6 +111,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - uses(ThermoSysPro(version="5.0"))); +")); end IdealCheckValve; From dc02c5f78b8db42ed9c660dc15f3ad3706ca1f73 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 13:21:23 +0200 Subject: [PATCH 060/213] #125 DynamicReliefValve reviewed --- .../PressureLosses/TestDynamicReliefValve.mo | 27 +++---- .../TestDynamicReliefValve_FlueGases.mo | 19 ++--- .../TestDynamicReliefValve_Traces.mo | 27 +++---- .../PressureLosses/DynamicReliefValve.mo | 77 +++++++++---------- 4 files changed, 67 insertions(+), 83 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo index e312d05f..8c9e763f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo @@ -1,24 +1,19 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDynamicReliefValve extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - DynamicReliefValve dynamicReliefValve( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve dynamicReliefValve( + redeclare replaceable package Medium = Medium, + vh(start=0.91), + z(start=0.00389)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={0,-40}))); equation - connect(dynamicReliefValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8}, - {0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(dynamicReliefValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8},{0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicReliefValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo index 52c9fea9..da900f05 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo @@ -1,11 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDynamicReliefValve_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - DynamicReliefValve dynamicReliefValve( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve dynamicReliefValve(redeclare replaceable package Medium = Medium, vh(start=232)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -14,15 +12,12 @@ model TestDynamicReliefValve_FlueGases redeclare replaceable package Medium = Medium, P0=350000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={0,-40}))); equation - connect(dynamicReliefValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8}, - {4.44089e-16,-9.8},{4.44089e-16,-30}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(dynamicReliefValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8},{4.44089e-16,-9.8},{4.44089e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicReliefValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo index a2f9410b..94c22056 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDynamicReliefValve_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,22 +6,17 @@ model TestDynamicReliefValve_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - DynamicReliefValve dynamicReliefValve( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve dynamicReliefValve( + redeclare replaceable package Medium = Medium, + vh(start=0.91), + z(start=0.00389)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={0,-40}))); equation - connect(dynamicReliefValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8}, - {0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(dynamicReliefValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8},{0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicReliefValve_Traces; diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo index 5e4fd4e0..cac9ed40 100644 --- a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo @@ -1,22 +1,22 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model DynamicReliefValve "Dynamic relief valve" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter ThermoSysPro.Units.SI.AbsolutePressure Popen=3e5 + parameter Units.SI.AbsolutePressure Popen=3e5 "Pressure that opens the valve"; - parameter ThermoSysPro.Units.SI.AbsolutePressure Pout=1e5 + parameter Units.SI.AbsolutePressure Pout=1e5 "Pressure at the valve outlet (for sizing)"; - parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum Cv"; + parameter Units.xSI.Cv Cvmax=8005.42 "Maximum Cv"; parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)"; - parameter ThermoSysPro.Units.SI.Area A1=0.1 + parameter Units.SI.Area A1=0.1 "Hydraulic area upstream the clapper"; - parameter ThermoSysPro.Units.SI.Area A2=0.125 + parameter Units.SI.Area A2=0.125 "Hydraulic area downstream the clapper"; - parameter ThermoSysPro.Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2] + parameter Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2] "Clapper area as a function of the clapper elevation"; parameter Real D=1 "Damping"; - parameter ThermoSysPro.Units.SI.Mass m=1 "Valve mass"; - parameter ThermoSysPro.Units.SI.Length z_max=0.1 "Maximum clapper elevation"; + parameter Units.SI.Mass m=1 "Valve mass"; + parameter Units.SI.Length z_max=0.1 "Maximum clapper elevation"; parameter Real Ke=62500 "Valve spring stiffness"; parameter Real Cd=0 "Drag coefficient of the clapper"; parameter Integer mode_caract=0 @@ -24,49 +24,49 @@ model DynamicReliefValve "Dynamic relief valve" parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1))); parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0" annotation(Evaluate=true); - parameter ThermoSysPro.Units.SI.Length z0=0 + parameter Units.SI.Length z0=0 "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if mech_steady_state=false)" annotation (Evaluate=true, Dialog(enable=not mech_steady_state)); - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected - constant ThermoSysPro.Units.SI.Acceleration g=Modelica.Constants.g_n + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - constant ThermoSysPro.Units.SI.Density rho60F=998.98 "Water density at 60°F"; + constant Units.SI.Density rho60F=998.98 "Water density at 60°F"; constant Real K=1.733e12 "Valve constant"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; - parameter ThermoSysPro.Units.SI.Length z_min=0 "Minimum clapper elevation"; + parameter Units.SI.Length z_min=0 "Minimum clapper elevation"; public Boolean clapper_is_free(start=true) "true if clapper is free to move in both directions, false otherwise"; - ThermoSysPro.Units.SI.Force Fp "Gravity force"; - ThermoSysPro.Units.SI.Force Fr "Spring force"; - ThermoSysPro.Units.SI.Force Fd "Damping force"; - ThermoSysPro.Units.SI.Force Fh "Hydraulic force"; - ThermoSysPro.Units.SI.Force Fdyn "Dynamic pressure force"; - ThermoSysPro.Units.SI.Force Ft "Total force"; - ThermoSysPro.Units.SI.Length z(start=z_min) "Clapper elevation"; - ThermoSysPro.Units.SI.Velocity v=der(z) "Clapper velocity"; - ThermoSysPro.Units.SI.Acceleration a=der(v) "Clapper acceleration"; + Units.SI.Force Fp "Gravity force"; + Units.SI.Force Fr "Spring force"; + Units.SI.Force Fd "Damping force"; + Units.SI.Force Fh "Hydraulic force"; + Units.SI.Force Fdyn "Dynamic pressure force"; + Units.SI.Force Ft "Total force"; + Units.SI.Length z(start=z_min) "Clapper elevation"; + Units.SI.Velocity v=der(z) "Clapper velocity"; + Units.SI.Acceleration a=der(v) "Clapper acceleration"; Real Ouv "Valve position"; - ThermoSysPro.Units.SI.Area A "Hydraulic area upstream the clapper"; - ThermoSysPro.Units.SI.Force Fr_min "Spring force when valve is closed"; - ThermoSysPro.Units.xSI.Cv Cv "Cv"; - ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + Units.SI.Area A "Hydraulic area upstream the clapper"; + Units.SI.Force Fr_min "Spring force when valve is closed"; + Units.xSI.Cv Cv "Cv"; + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper"; - ThermoSysPro.Units.SI.Velocity vh "Fluid velocity through the valve"; - ThermoSysPro.Units.SI.Energy Wdyn "Dissipated fluid kinetic energy"; + Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper"; + Units.SI.Velocity vh "Fluid velocity through the valve"; + Units.SI.Energy Wdyn "Dissipated fluid kinetic energy"; Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; @@ -234,6 +234,5 @@ equation
    • Daniel Bouskela
    -"), - uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); +")); end DynamicReliefValve; From 8a91b6f81628ab31ebe1f3198cc54d993d190467 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 13:29:00 +0200 Subject: [PATCH 061/213] #125 SwitchValve reviewed --- .../PressureLosses/TestSwitchValve.mo | 27 ++++++----------- .../TestSwitchValve_FlueGases.mo | 21 +++++--------- .../PressureLosses/TestSwitchValve_Traces.mo | 28 ++++++------------ .../Fluid/PressureLosses/SwitchValve.mo | 29 ++++++++++--------- 4 files changed, 40 insertions(+), 65 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo index ff63f24c..448ce7a7 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo @@ -1,24 +1,15 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestSwitchValve extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - SwitchValve switchValve( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, - {10,16}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante - annotation (Placement(transformation(extent={{-78,32},{-58,52}}))); + ThermoSysPro.Fluid.PressureLosses.SwitchValve switchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-78,32},{-58,52}}))); equation - connect(switchValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(switchValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - connect(constante.yL, switchValve.Ouv) - annotation (Line(points={{-57,42},{0,42},{0,13.2}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(switchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) annotation (Line(points={{-57,42},{0,42},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo index e5ef26f4..16b7d843 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo @@ -1,11 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestSwitchValve_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - SwitchValve switchValve( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, - {10,16}}))); + ThermoSysPro.Fluid.PressureLosses.SwitchValve switchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -15,15 +13,10 @@ model TestSwitchValve_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante - annotation (Placement(transformation(extent={{-42,30},{-22,50}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-42,30},{-22,50}}))); equation - connect(switchValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(switchValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - connect(constante.yL, switchValve.Ouv) - annotation (Line(points={{-21,40},{0,40},{0,13.2}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(switchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) annotation (Line(points={{-21,40},{0,40},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestSwitchValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo index 964ac1b3..5238d3ce 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestSwitchValve_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,23 +6,13 @@ model TestSwitchValve_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - SwitchValve switchValve( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, - {10,16}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante - annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); + ThermoSysPro.Fluid.PressureLosses.SwitchValve switchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); equation - connect(switchValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(switchValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - connect(constante.yL, switchValve.Ouv) - annotation (Line(points={{-19,40},{0,40},{0,13.2}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(switchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestSwitchValve_Traces; diff --git a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo index df541f53..e4cdd416 100644 --- a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo @@ -1,27 +1,29 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model SwitchValve "Switch valve" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k=1000 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.xSI.PressureLossCoefficient k=1000 "Pressure loss coefficient"; - parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 + parameter Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow when the valve is closed"; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected parameter Real eps=1.e-3 "Small number for pressure loss equation"; public - ThermoSysPro.Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; @@ -134,6 +136,5 @@ equation
    • Daniel Bouskela
    -"), - uses(ThermoSysPro(version="5.0"))); +")); end SwitchValve; From 053e17bcbf729641d5fd463f725db3b92ff4d75c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 13:55:06 +0200 Subject: [PATCH 062/213] #125 IdealSwitchValve reviewed --- .../PressureLosses/TestIdealSwitchValve.mo | 27 ++++++------------ .../TestIdealSwitchValve_FlueGases.mo | 21 +++++--------- .../TestIdealSwitchValve_Traces.mo | 28 ++++++------------- .../Fluid/PressureLosses/IdealSwitchValve.mo | 20 ++++++------- 4 files changed, 35 insertions(+), 61 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo index 10539b7b..90644316 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo @@ -1,24 +1,15 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestIdealSwitchValve extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - IdealSwitchValve idealSwitchValve(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, - {10,16}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante - annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); + ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve idealSwitchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); equation - connect(idealSwitchValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(idealSwitchValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - connect(constante.yL, idealSwitchValve.Ouv) - annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(idealSwitchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestIdealSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo index 1a20b88d..f722152a 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo @@ -1,11 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestIdealSwitchValve_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - IdealSwitchValve idealSwitchValve(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, - {10,16}}))); + ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve idealSwitchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -15,15 +13,10 @@ model TestIdealSwitchValve_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante - annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); equation - connect(idealSwitchValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(idealSwitchValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - connect(constante.yL, idealSwitchValve.Ouv) - annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(idealSwitchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestIdealSwitchValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo index bf8f48b6..a9e66005 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestIdealSwitchValve_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,23 +6,13 @@ model TestIdealSwitchValve_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - IdealSwitchValve idealSwitchValve(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4}, - {10,16}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante - annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); + ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve idealSwitchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); equation - connect(idealSwitchValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(idealSwitchValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - connect(constante.yL, idealSwitchValve.Ouv) - annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(idealSwitchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestIdealSwitchValve_Traces; diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo index cc91b89c..935044d8 100644 --- a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo @@ -1,17 +1,19 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model IdealSwitchValve "Ideal switch valve" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter ThermoSysPro.Units.SI.MassFlowRate Qmin=1.e-6 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.MassFlowRate Qmin=1.e-6 "Mass flow when the valve is closed"; - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; public - ThermoSysPro.Units.SI.MassFlowRate Q "Mass flow rate"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.MassFlowRate Q "Mass flow rate"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.PressureDifference deltaP + Units.SI.PressureDifference deltaP "Pressure difference between the inlet and the outlet"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public @@ -43,7 +45,6 @@ equation X = C1.Xi; - C1.SubC = C2.SubC; Q = C1.Q; @@ -113,6 +114,5 @@ equation
    • Daniel Bouskela
    -"), - uses(ThermoSysPro(version="5.0"))); +")); end IdealSwitchValve; From 6ab1bb299f9ae7cc9a444a9064b1fe1448b2a37c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 14:01:21 +0200 Subject: [PATCH 063/213] #125 DynamicCheckValve reviewed --- .../PressureLosses/TestDynamicCheckValve.mo | 21 +++---- .../TestDynamicCheckValve_FlueGases.mo | 15 ++--- .../TestDynamicCheckValve_Traces.mo | 22 +++---- .../Fluid/PressureLosses/DynamicCheckValve.mo | 58 +++++++++---------- 4 files changed, 47 insertions(+), 69 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo index 9ae856f0..03404bbb 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo @@ -1,20 +1,13 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDynamicCheckValve extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - DynamicCheckValve dynamicCheckValve( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve dynamicCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(dynamicCheckValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(dynamicCheckValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(dynamicCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo index 969a2303..3e1b001a 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo @@ -1,11 +1,9 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDynamicCheckValve_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - DynamicCheckValve dynamicCheckValve( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve dynamicCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -16,10 +14,7 @@ model TestDynamicCheckValve_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(dynamicCheckValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(dynamicCheckValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(dynamicCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo index e004f96b..ea171e73 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo @@ -1,4 +1,4 @@ -within ; +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; model TestDynamicCheckValve_Traces extends ThermoSysPro.UsersGuide.Icons.Example; @@ -6,19 +6,11 @@ model TestDynamicCheckValve_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - DynamicCheckValve dynamicCheckValve( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve dynamicCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(dynamicCheckValve.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(dynamicCheckValve.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), - uses(ThermoSysPro(version="5.0"))); + connect(dynamicCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo index 8bfa927e..5be3ade9 100644 --- a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo @@ -1,56 +1,56 @@ -within ; +within ThermoSysPro.Fluid.PressureLosses; model DynamicCheckValve "Dynamic check valve" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum CV"; + parameter Units.xSI.Cv Cvmax=8005.42 "Maximum CV"; parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)"; - parameter ThermoSysPro.Units.SI.MomentOfInertia J=1 "Flap moment of inertia"; + parameter Units.SI.MomentOfInertia J=1 "Flap moment of inertia"; parameter Real Kf1=0 "Flap friction law coefficient #1"; parameter Real Kf2=100 "Flap friction law coefficient #2"; parameter Real n=5 "Flap friction law exponent"; - parameter ThermoSysPro.Units.SI.Mass m=1 "Flap mass"; - parameter ThermoSysPro.Units.SI.Area A=1 "Flap hydraulic area"; + parameter Units.SI.Mass m=1 "Flap mass"; + parameter Units.SI.Area A=1 "Flap hydraulic area"; parameter Integer mode_caract=0 "0:linear characteristics - 1:characteristics is given by caract[]" annotation(Evaluate=true); parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1))); parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0"; parameter Real Ouv0=0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if mech_steady_state=false)" annotation(Evaluate=true, Dialog(enable=not mech_steady_state)); - parameter ThermoSysPro.Units.SI.MassFlowRate gamma_diff=1e-4 + parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter ThermoSysPro.Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter ThermoSysPro.Units.SI.Acceleration g=Modelica.Constants.g_n + parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; - parameter ThermoSysPro.Units.SI.Radius r=sqrt(A/pi) "Flap radius"; - parameter ThermoSysPro.Units.SI.Angle theta_min=0 + parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius"; + parameter Units.SI.Angle theta_min=0 "Minimum flap aperture angle"; - parameter ThermoSysPro.Units.SI.Angle theta_max=pi/2 + parameter Units.SI.Angle theta_max=pi/2 "Maximum flap aperture angle"; - parameter ThermoSysPro.Units.SI.Angle theta_m=(theta_min + theta_max)/2; + parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2; public Boolean libre(start=true) "Indicator whether the flap is free to move in both directions"; - ThermoSysPro.Units.SI.Torque Cp "Gravity torque"; - ThermoSysPro.Units.SI.Torque Cf "Friction torque"; - ThermoSysPro.Units.SI.Torque Ch "Hydraulic torque"; - ThermoSysPro.Units.SI.Torque Ct "Total torque"; - ThermoSysPro.Units.SI.Angle theta(start=theta_m) "Flap aperture angle"; - ThermoSysPro.Units.SI.AngularVelocity omega "Flap angular speed"; - ThermoSysPro.Units.SI.AngularAcceleration a "Flap angular acceleration"; + Units.SI.Torque Cp "Gravity torque"; + Units.SI.Torque Cf "Friction torque"; + Units.SI.Torque Ch "Hydraulic torque"; + Units.SI.Torque Ct "Total torque"; + Units.SI.Angle theta(start=theta_m) "Flap aperture angle"; + Units.SI.AngularVelocity omega "Flap angular speed"; + Units.SI.AngularAcceleration a "Flap angular acceleration"; Real Ouv "Valve position"; - ThermoSysPro.Units.xSI.Cv Cv(start=Cvmax) "Cv"; - ThermoSysPro.Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - ThermoSysPro.Units.SI.Density rho(start=998) "Fluid density"; - ThermoSysPro.Units.SI.Temperature T(start=290) "Fluid temperature"; - ThermoSysPro.Units.SI.AbsolutePressure Pm(start=1.e5) + Units.xSI.Cv Cv(start=Cvmax) "Cv"; + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressrue"; - ThermoSysPro.Units.SI.SpecificEnthalpy h(start=100000) + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; @@ -87,7 +87,6 @@ equation X = C1.Xi; - C1.SubC = C2.SubC; Q = C1.Q; @@ -198,6 +197,5 @@ equation
    • Daniel Bouskela
    -"), - uses(ThermoSysPro(version="5.0"), Modelica(version="4.0.0"))); +")); end DynamicCheckValve; From ab78acb66b43c374c20db5eca4666a35992f4f31 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 14:09:09 +0200 Subject: [PATCH 064/213] #125 CheckValve reviewed --- .../PressureLosses/TestCheckValve.mo | 22 ++++++----------- .../TestCheckValve_FlueGases.mo | 13 ++++------ .../PressureLosses/TestCheckValve_Traces.mo | 24 ++++++------------- .../Fluid/PressureLosses/CheckValve.mo | 7 +++--- 4 files changed, 22 insertions(+), 44 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo index 86242b26..84c3160b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo @@ -3,22 +3,14 @@ model TestCheckValve extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve( - redeclare replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(checkValve.C2, sink.C) - annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); - connect(checkValve.C1, sourcePQ.C) - annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(checkValve.C2, sink.C) annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo index 0058fa76..ee165db7 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo @@ -3,13 +3,12 @@ model TestCheckValve_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( @@ -18,9 +17,7 @@ model TestCheckValve_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(checkValve.C2, sink.C) - annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); - connect(checkValve.C1, sourcePQ.C) - annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + connect(checkValve.C2, sink.C) annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo index 03db4bd5..0c99f89c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo @@ -6,24 +6,14 @@ model TestCheckValve_Traces extraPropertiesNames={"Trace1"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve( - redeclare - replaceable package Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(checkValve.C2, sink.C) - annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); - connect(checkValve.C1, sourcePQ.C) - annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(checkValve.C2, sink.C) annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo index 49640464..8c04953c 100644 --- a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo @@ -1,5 +1,7 @@ within ThermoSysPro.Fluid.PressureLosses; model CheckValve "Check valve" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.PressureDifference dPOuvert=10 @@ -32,7 +34,6 @@ public "Fluid specific enthalpy"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-120,-10},{-100,10}}, rotation=0))); ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( @@ -55,7 +56,6 @@ equation X = C1.Xi; - C1.SubC = C2.SubC; Q = C1.Q; @@ -132,6 +132,5 @@ equation
    • Daniel Bouskela
    -"), - DymolaStoredErrors); +")); end CheckValve; From b9af0181cfcfbaa4186ae0084f6e1bd1d4c328b8 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 14:17:27 +0200 Subject: [PATCH 065/213] #125 VolumeI reviewed --- .../SimpleExamples/Volumes/TestVolumeI.mo | 21 ++++-------- .../Volumes/TestVolumeI_FlueGases.mo | 32 ++++++++----------- .../Volumes/TestVolumeI_Traces.mo | 31 +++++++----------- ThermoSysPro/Fluid/Volumes/VolumeI.mo | 26 +++++---------- 4 files changed, 40 insertions(+), 70 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo index 36c1c6c2..4ffc4874 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo @@ -3,22 +3,13 @@ model TestVolumeI extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, - {-32,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-50,10}, - {-30,30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}}))); equation - connect(volumeI.Cs3, sink.C) - annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); - connect(sourcePQ.C, volumeI.Ce2) - annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); - connect(sourceQ.C, volumeI.Ce1) - annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo index e27d1d74..b8b11661 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo @@ -3,30 +3,26 @@ model TestVolumeI_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{26,-18}, - {46,2}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{26,-18},{46,2}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={-40,20}))); equation - connect(sourcePQ.C, volumeI.Ce2) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(sourceQ.C, volumeI.Ce1) - annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); - connect(volumeI.Cs3, sink.C) - annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); + connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeI_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo index b2402807..3ee353d0 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo @@ -6,29 +6,22 @@ model TestVolumeI_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{20,20}, - {40,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeI volumeI( + redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, - {8,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18}, - {-36,38}}))); + SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18},{-36,38}}))); equation - connect(volumeI.Cs1, sink.C) - annotation (Line(points={{8,8},{8,30},{20,30}}, - color={0,0,0})); - connect(sourcePQ.C, volumeI.Ce2) - annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); - connect(sourceQ.C, volumeI.Ce1) - annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); + connect(volumeI.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeI_Traces; diff --git a/ThermoSysPro/Fluid/Volumes/VolumeI.mo b/ThermoSysPro/Fluid/Volumes/VolumeI.mo index 8335e4e8..91d03dbf 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeI.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeI.mo @@ -35,8 +35,6 @@ model VolumeI "Mixing volume with 4 inlets and 4 outlets" tab="Fluid", group="Medium")); - - protected constant Boolean isCompressible = Medium.isCompressible; parameter Units.SI.MassFlowRate gamma0=1.e-4 @@ -71,22 +69,14 @@ public Units.SI.Power Js3 "Thermal power diffusion from outlet s3"; Units.SI.Power Js4 "Thermal power diffusion from outlet s4"; Units.SI.Power J "Total thermal power diffusion"; - Units.SI.MassFlowRate gamma_e1 - "Diffusion conductance for inlet e1"; - Units.SI.MassFlowRate gamma_e2 - "Diffusion conductance for inlet e2"; - Units.SI.MassFlowRate gamma_e3 - "Diffusion conductance for inlet e3"; - Units.SI.MassFlowRate gamma_e4 - "Diffusion conductance for inlet e4"; - Units.SI.MassFlowRate gamma_s1 - "Diffusion conductance for outlet s1"; - Units.SI.MassFlowRate gamma_s2 - "Diffusion conductance for outlet s2"; - Units.SI.MassFlowRate gamma_s3 - "Diffusion conductance for outlet s3"; - Units.SI.MassFlowRate gamma_s4 - "Diffusion conductance for outlet s4"; + Units.SI.MassFlowRate gamma_e1 "Diffusion conductance for inlet e1"; + Units.SI.MassFlowRate gamma_e2 "Diffusion conductance for inlet e2"; + Units.SI.MassFlowRate gamma_e3 "Diffusion conductance for inlet e3"; + Units.SI.MassFlowRate gamma_e4 "Diffusion conductance for inlet e4"; + Units.SI.MassFlowRate gamma_s1 "Diffusion conductance for outlet s1"; + Units.SI.MassFlowRate gamma_s2 "Diffusion conductance for outlet s2"; + Units.SI.MassFlowRate gamma_s3 "Diffusion conductance for outlet s3"; + Units.SI.MassFlowRate gamma_s4 "Diffusion conductance for outlet s4"; Real re1 "Value of r(Q/gamma) for inlet e1"; Real re2 "Value of r(Q/gamma) for inlet e2"; Real re3 "Value of r(Q/gamma) for inlet e3"; From d6b87efe1462c3be384df3e5feaf7d0f453833ec Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 14:38:36 +0200 Subject: [PATCH 066/213] #125 StaticCentrifugalPump reviewed --- .../Machines/TestStaticCentrifugalPump.mo | 16 +++++----------- .../TestStaticCentrifugalPump_FlueGases.mo | 11 +++-------- .../TestStaticCentrifugalPump_Traces.mo | 19 +++++-------------- .../Fluid/Machines/StaticCentrifugalPump.mo | 8 ++++---- 4 files changed, 17 insertions(+), 37 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo index eaf3a569..123ab095 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo @@ -3,17 +3,11 @@ model TestStaticCentrifugalPump extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(staticCentrifugalPump.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(staticCentrifugalPump.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestStaticCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo index d461da0e..3e2e9e02 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo @@ -3,10 +3,7 @@ model TestStaticCentrifugalPump_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10}, - {14,10}}))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -17,9 +14,7 @@ model TestStaticCentrifugalPump_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(staticCentrifugalPump.C2, sink.C) - annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); - connect(staticCentrifugalPump.C1, sourcePQ.C) - annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestStaticCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo index 2f92f154..9cc25305 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo @@ -6,20 +6,11 @@ model TestStaticCentrifugalPump_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump( - redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-52,-10}, - {-32,10}}))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); equation - connect(staticCentrifugalPump.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(staticCentrifugalPump.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestStaticCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo index 0506ea69..34e1803e 100644 --- a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo @@ -1,7 +1,8 @@ within ThermoSysPro.Fluid.Machines; model StaticCentrifugalPump "Static centrifugal pump" - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby - ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.nonSI.AngularVelocity_rpm VRot=1400 "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)"; @@ -185,6 +186,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - DymolaStoredErrors); +")); end StaticCentrifugalPump; From 62a177665346e3293a4cafc3c2cc450cfe93c273 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Jun 2025 16:58:15 +0200 Subject: [PATCH 067/213] #125 OnePhaseFlowPipe --- .../TestDynamicOnePhaseFlowPipe.mo | 28 ++++++++ .../TestDynamicOnePhaseFlowPipe_FlueGases.mo | 39 +++++++++++ .../TestDynamicOnePhaseFlowPipe_Traces.mo | 31 +++++++++ .../HeatExchangers/package.order | 3 + .../HeatExchangers/DynamicOnePhaseFlowPipe.mo | 65 +++++++++---------- .../Properties/Media/FlueGases/package.mo | 49 ++++++++++++++ .../Properties/Media/FlueGases/package.order | 2 + 7 files changed, 181 insertions(+), 36 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo new file mode 100644 index 00000000..d682e934 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}},rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo new file mode 100644 index 00000000..56268e48 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo @@ -0,0 +1,39 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + Ns=1, + Q(start={34.51316334625123,34.51316334625123}), + h(start={3077096.0822837264,3135044.986588299,3077096.0822837264}), + P(start={45e5,44.75e5,44.5e5}, displayUnit="bar")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + X0={0,0,1,0,0}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000.005}, + option_temperature=2, + W0={2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=1) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo new file mode 100644 index 00000000..09c998b9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index e69de29b..2cd052a4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -0,0 +1,3 @@ +TestDynamicOnePhaseFlowPipe +TestDynamicOnePhaseFlowPipe_Traces +TestDynamicOnePhaseFlowPipe_FlueGases diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo index 56cc2ce2..5451ccc9 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo @@ -1,9 +1,10 @@ -within ThermoSysPro.Fluid.HeatExchangers; +within ThermoSysPro.Fluid.HeatExchangers; model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe" extends ThermoSysPro.Fluid.Interfaces.IconColors; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=10. "Pipe length"; parameter Units.SI.Diameter D=0.2 "Internal pipe diameter"; parameter Real rugosrel=0.0007 "Pipe relative roughness"; @@ -122,12 +123,9 @@ public "Friction pressure loss coefficient in node i"; Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative srt. enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res[N] "Diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; @@ -147,9 +145,9 @@ public Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); @@ -162,7 +160,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P0, T0[i-1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(P0, T0[i-1], X); end for; else for i in 2:N loop @@ -212,19 +210,11 @@ equation C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; + C1.SubC = C2.SubC; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.Xi = C2.Xi; - ftype = C1.ftype; - - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; + X = C1.Xi; /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop @@ -318,14 +308,15 @@ equation end if; /* Fluid thermodynamic properties */ - ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - - rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=X); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); + + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + cp1[i] = Medium.specificHeatCapacityCp(state1[i]); + mu1[i] = Medium.dynamicViscosity(state1[i]); + k1[i] = Medium.thermalConductivity(state1[i]); end for; /* Momentum balance equations (hydraulic nodes) */ @@ -359,11 +350,13 @@ equation gamma[i] = if diffusion then 1/diff_res[i] else gamma0; /* Fluid thermodynamic properties */ - rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=X); + + rho2[i] = Medium.density(state2[i]); + T2[i] = Medium.temperature(state2[i]); + cp2[i] = Medium.specificHeatCapacityCp(state2[i]); + mu2[i] = Medium.dynamicViscosity(state2[i]); + k2[i] = Medium.thermalConductivity(state2[i]); end for; /* Fluid densities at the boundaries of the nodes */ @@ -371,8 +364,8 @@ equation rhoc[i] = rho1[i - 1]; end for; - rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1],h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rhoc[1] = Medium.density_phX(p=P[1],h=h[1],X=X); + rhoc[N + 1] = Medium.density_phX(p=P[N + 1],h=h[N + 1],X=X); W1t = sum(dW1); diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.mo b/ThermoSysPro/Properties/Media/FlueGases/package.mo index 514261ef..5deca97c 100644 --- a/ThermoSysPro/Properties/Media/FlueGases/package.mo +++ b/ThermoSysPro/Properties/Media/FlueGases/package.mo @@ -19,6 +19,55 @@ package FlueGases "Flue gases library inherited from Modelica.Media" constant Units.SI.SpecificEnthalpy hr=2501569 "ThermoSysPro Water/steam reference specific enthalpy at 0.01°C"; constant Units.SI.SpecificEnthalpy hr_FlueGases=503298 "FlueGases reference specific enthalpy, computed from ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) at (0.006112 bars, 0.01°C)"; + redeclare function extends density_derh_p "Density derivative by specific enthalpy" + + protected + Units.SI.SpecificEntropy s "Flue gases specific entropy"; + Units.SI.Density rho "Flue gaases density"; + Units.SI.SpecificHeatCapacity cp "Specific heat capacity"; + Units.SI.SpecificHeatCapacity R "gas constant"; + Units.SI.DerDensityByEnthalpy drhodh + "Derivative of the density wrt. the specific enthalpy at constant pressure"; + + algorithm + s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state); + rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state); + cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state); + R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state); + + drhodh := -rho*rho*R/(state.p*cp); + ddhp := drhodh; + + annotation ( + smoothOrder=2, + Icon(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2010

    + + +

    ThermoSysPro Version 2.0

    + +")); + + end density_derh_p; + + redeclare function extends density_derp_h "Density derivative by pressure" + protected + Units.SI.SpecificEntropy s "Flue gases specific entropy"; + Units.SI.Density rho "Flue gaases density"; + Units.SI.SpecificHeatCapacity cp "Specific heat capacity"; + Units.SI.SpecificHeatCapacity R "gas constant"; + Units.SI.DerDensityByPressure drhodp "Derivative of the density wrt. the pressure at constant specific enthalpy"; + algorithm + s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state); + rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state); + cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state); + R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state); + + drhodp := (rho*rho*R)/(state.p*cp)*(1/rho + state.T/state.p*(cp - R)); + ddph := drhodp; + annotation (Inline=true); + end density_derp_h; annotation (Documentation(info=" ")); diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.order b/ThermoSysPro/Properties/Media/FlueGases/package.order index 9965a189..24c2001d 100644 --- a/ThermoSysPro/Properties/Media/FlueGases/package.order +++ b/ThermoSysPro/Properties/Media/FlueGases/package.order @@ -1,2 +1,4 @@ hr hr_FlueGases +density_derh_p +density_derp_h From ba39415e35a1dc6ef5f977341374b2ef16e49ef9 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 10:32:27 +0200 Subject: [PATCH 068/213] VolumeATh --- .../SimpleExamples/Volumes/TestVolumeATh.mo | 23 +++ .../Volumes/TestVolumeATh_FlueGases.mo | 30 +++ .../Volumes/TestVolumeATh_Traces.mo | 29 +++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeATh.mo | 174 ++++++------------ 5 files changed, 141 insertions(+), 118 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo new file mode 100644 index 00000000..7fb15da1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeATh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh + volumeATh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeATh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeATh.Ce2, sourceQ.C) + annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeATh.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeATh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo new file mode 100644 index 00000000..804c4ea4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeATh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh + volumeATh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeATh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeATh.Ce2, sourceQ.C) + annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeATh.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeATh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo new file mode 100644 index 00000000..ea380925 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeATh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh + volumeATh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeATh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeATh.Ce2, sourceQ.C) + annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeATh.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeATh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 2437a0f0..6f328c14 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -13,3 +13,6 @@ TestVolumeB_Traces TestVolumeI TestVolumeI_FlueGases TestVolumeI_Traces +TestVolumeATh +TestVolumeATh_Traces +TestVolumeATh_FlueGases \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo index 87eb77cc..e703a0ee 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo @@ -1,10 +1,9 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model VolumeATh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; @@ -29,42 +28,18 @@ model VolumeATh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; + constant Boolean isCompressible = Medium.isCompressible; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature T "Fluid temperature"; @@ -77,15 +52,12 @@ public "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -101,14 +73,14 @@ public Real rs2 "Value of r(Q/gamma) for outlet s2"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0), iconTransformation(extent={{-10,90},{10,110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); public Thermal.Connectors.ThermalPort Cth @@ -131,19 +103,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -153,16 +117,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeAth: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -170,11 +124,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -183,11 +134,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -208,7 +156,7 @@ equation BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -219,13 +167,13 @@ equation P = Cs2.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -237,42 +185,30 @@ equation Cs2.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; + Cs1.Xi = X; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + Cs2.Xi = X; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -330,21 +266,23 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( From 11a76582aae77eedc6deeae3daa75c356ab2618b Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 11:07:10 +0200 Subject: [PATCH 069/213] VolumeBTh --- .../SimpleExamples/Volumes/TestVolumeBTh.mo | 29 +++ .../Volumes/TestVolumeBTh_FlueGases.mo | 36 ++++ .../Volumes/TestVolumeBTh_Traces.mo | 35 ++++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeBTh.mo | 174 ++++++------------ 5 files changed, 159 insertions(+), 118 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo new file mode 100644 index 00000000..866c9264 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeBTh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=90, + origin={0,38}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh + volumeBTh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=180, + origin={42,0}))); +equation + connect(sourcePQ.C, volumeBTh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21, + 7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,19},{ + -5.55112e-16,19},{-5.55112e-16,28}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeBTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo new file mode 100644 index 00000000..d48a565e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo @@ -0,0 +1,36 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeBTh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=90, + origin={0,40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh + volumeBTh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=180, + origin={40,0}))); +equation + connect(sourcePQ.C, volumeBTh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{25,0},{25, + 6.66134e-16},{30,6.66134e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,20},{ + -5.55112e-16,20},{-5.55112e-16,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeBTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo new file mode 100644 index 00000000..370c3b6c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeBTh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=90, + origin={0,36}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh + volumeBTh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + SubC0={0.2}) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=180, + origin={38,0}))); +equation + connect(sourcePQ.C, volumeBTh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{19,0},{19, + 7.21645e-16},{28,7.21645e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) + annotation (Line(points={{0,10},{0,26},{-6.66134e-16,26}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeBTh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 2437a0f0..32d66d74 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -13,3 +13,6 @@ TestVolumeB_Traces TestVolumeI TestVolumeI_FlueGases TestVolumeI_Traces +TestVolumeBTh +TestVolumeBTh_FlueGases +TestVolumeBTh_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo index 39abb217..6c7ed0f2 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo @@ -1,10 +1,9 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model VolumeBTh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; @@ -29,42 +28,18 @@ model VolumeBTh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; + constant Boolean isCompressible = Medium.isCompressible; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature T "Fluid temperature"; @@ -77,15 +52,12 @@ public "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -101,14 +73,14 @@ public Real rs2 "Value of r(Q/gamma) for outlet s2"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0), iconTransformation(extent={{90,-10},{110,10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,90},{10,110}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); public Thermal.Connectors.ThermalPort Cth @@ -131,19 +103,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -153,16 +117,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeBth: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -170,11 +124,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -183,11 +134,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -208,7 +156,7 @@ equation BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -219,13 +167,13 @@ equation P = Cs2.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -237,42 +185,30 @@ equation Cs2.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; + Cs1.Xi = X; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + Cs2.Xi = X; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -330,21 +266,23 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( From f6fd3324eb247d2350ed53fabf1a24658e2ac17c Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 11:35:53 +0200 Subject: [PATCH 070/213] VolumeCTh --- .../SimpleExamples/Volumes/TestVolumeCTh.mo | 23 +++ .../Volumes/TestVolumeCTh_FlueGases.mo | 30 +++ .../Volumes/TestVolumeCTh_Traces.mo | 25 +++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeCTh.mo | 176 ++++++------------ 5 files changed, 138 insertions(+), 119 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo new file mode 100644 index 00000000..3dd55013 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeCTh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh + volumeCTh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeCTh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) + annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) + annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeCTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo new file mode 100644 index 00000000..2d2b65e5 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeCTh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh + volumeCTh( + redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeCTh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) + annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) + annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeCTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo new file mode 100644 index 00000000..a6b7f274 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeCTh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.2}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh + volumeCTh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, SubC0={0.1}) + annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeCTh.Ce1) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) + annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) + annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeCTh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 2437a0f0..cdf8a9a3 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -13,3 +13,6 @@ TestVolumeB_Traces TestVolumeI TestVolumeI_FlueGases TestVolumeI_Traces +TestVolumeCTh +TestVolumeCTh_FlueGases +TestVolumeCTh_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo index 335ddb1a..46867e0b 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo @@ -1,10 +1,9 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model VolumeCTh "Mixing volume with 3 inlets, 1 outlet and 1 thermal input" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; @@ -29,42 +28,17 @@ model VolumeCTh "Mixing volume with 3 inlets, 1 outlet and 1 thermal input" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; + constant Boolean isCompressible = Medium.isCompressible; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature T "Fluid temperature"; @@ -77,15 +51,12 @@ public "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -100,15 +71,15 @@ public Real re3 "Value of r(Q/gamma) for inlet e3"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0), iconTransformation(extent={{-110,-10},{-90,10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0), iconTransformation(extent={{-10,90},{10,110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{ 10,-90}}))); public @@ -132,19 +103,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -154,16 +117,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeCTh: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -171,11 +124,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -184,11 +134,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then @@ -197,11 +144,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Cs) == 0) then @@ -215,7 +159,7 @@ equation BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -226,13 +170,13 @@ equation P = Cs.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o *hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + Cth.W + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + Cth.W + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -244,36 +188,28 @@ equation Cs.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q - Cs.Xi*Cs.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC - Cs.Q*Cs.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs.ftype = ftype; + Cs.SubC = SubC; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + Cs.Xi = X; /* Flow reversal */ if continuous_flow_reversal then @@ -329,21 +265,23 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( From 2e97e326482a507a86b08e71ab57489fd5852f33 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 14:44:56 +0200 Subject: [PATCH 071/213] VolumeDTh --- .../SimpleExamples/Volumes/TestVolumeDTh.mo | 27 +++ .../Volumes/TestVolumeDTh_FlueGases.mo | 34 ++++ .../Volumes/TestVolumeDTh_Traces.mo | 35 ++++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeDTh.mo | 173 ++++++------------ 5 files changed, 153 insertions(+), 119 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo new file mode 100644 index 00000000..ce8714ea --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeDTh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh + volumeDTh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{12,22}, + {32,42}}))); +equation + connect(sourcePQ.C, volumeDTh.Ce) + annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeDTh.Cs1, sinkQ.C) + annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeDTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo new file mode 100644 index 00000000..2085ae1b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeDTh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,16}, + {46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh + volumeDTh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={40,0}))); +equation + connect(volumeDTh.Cs1, sink.C) + annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); + connect(sourcePQ.C, volumeDTh.Ce) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sinkQ.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeDTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo new file mode 100644 index 00000000..5a61dd4e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeDTh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{20,20}, + {40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh + volumeDTh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, + {8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={40,0}))); +equation + connect(volumeDTh.Cs1, sink.C) + annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeDTh.Ce) + annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sinkQ.C) + annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeDTh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 2437a0f0..fc6a33ae 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -13,3 +13,6 @@ TestVolumeB_Traces TestVolumeI TestVolumeI_FlueGases TestVolumeI_Traces +TestVolumeDTh +TestVolumeDTh_FlueGases +TestVolumeDTh_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo index c8a846a8..39210ed0 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo @@ -1,10 +1,9 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model VolumeDTh "Mixing volume with 1 inlet, 3 outlets and 1 thermal input" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; @@ -29,42 +28,17 @@ model VolumeDTh "Mixing volume with 1 inlet, 3 outlets and 1 thermal input" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; + constant Boolean isCompressible = Medium.isCompressible; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature T "Fluid temperature"; @@ -77,15 +51,12 @@ public "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; @@ -101,13 +72,13 @@ public Real rs3 "Value of r(Q/gamma) for outlet s3"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,90},{10,110}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cs3 + Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}))); Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation( @@ -129,19 +100,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -151,16 +114,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - fluids[5] = Cs3.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeDTh: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; @@ -168,11 +121,8 @@ equation Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.Xi = Medium.X_default[1:Medium.nXi]; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -200,7 +150,7 @@ equation BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -211,13 +161,13 @@ equation P = Cs3.P; /* Energy balance equation */ - BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + Cth.W + J; + BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + Cth.W + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -229,48 +179,31 @@ equation Cs3.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q; - BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q; - BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q; - BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; + /* Traces composition balance equations */ + BSubC = Ce.Q*Ce.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; /* Flow reversal */ if continuous_flow_reversal then @@ -330,21 +263,23 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( From 17bcff9d50840723b1c13a758d190a432ee939c1 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 15:29:02 +0200 Subject: [PATCH 072/213] VolumeITh --- .../SimpleExamples/Volumes/TestVolumeITh.mo | 26 +++ .../Volumes/TestVolumeITh_FlueGases.mo | 34 +++ .../Volumes/TestVolumeITh_Traces.mo | 35 +++ .../SimpleExamples/Volumes/package.order | 3 + ThermoSysPro/Fluid/Volumes/VolumeITh.mo | 214 ++++++------------ 5 files changed, 165 insertions(+), 147 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo new file mode 100644 index 00000000..86bd3bb8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeITh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh + volumeITh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-50,10}, + {-30,30}}))); +equation + connect(volumeITh.Cs3, sink.C) + annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeITh.Ce2) + annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) + annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeITh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo new file mode 100644 index 00000000..9979e040 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeITh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,-18}, + {46,2}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh + volumeITh( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={-40,20}))); +equation + connect(sourcePQ.C, volumeITh.Ce2) + annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) + annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(volumeITh.Cs3, sink.C) + annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeITh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo new file mode 100644 index 00000000..446cf493 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeITh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{20,20}, + {40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh + volumeITh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, + {8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18}, + {-36,38}}))); +equation + connect(volumeITh.Cs1, sink.C) + annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeITh.Ce2) + annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) + annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeITh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 2437a0f0..a9d0a7ac 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -13,3 +13,6 @@ TestVolumeB_Traces TestVolumeI TestVolumeI_FlueGases TestVolumeI_Traces +TestVolumeITh +TestVolumeITh_FlueGases +TestVolumeITh_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo index 9f6c8292..af41005f 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo @@ -1,10 +1,9 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model VolumeITh "Mixing volume with 4 inlets, 4 outlets and 1 thermal input" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; @@ -29,42 +28,18 @@ model VolumeITh "Mixing volume with 4 inlets, 4 outlets and 1 thermal input" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); - - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); + protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; + constant Boolean isCompressible = Medium.isCompressible; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature T "Fluid temperature"; @@ -77,15 +52,12 @@ public "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[9] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -113,29 +85,29 @@ public Real rs4 "Value of r(Q/gamma) for outlet s4"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,70},{-90,90}}, rotation=0), iconTransformation(extent={{-110,70},{-90,90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0), iconTransformation(extent={{-110,-10},{-90,10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,70},{110,90}}, rotation=0), iconTransformation(extent={{90,70},{110,90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,-10},{110,10}}, rotation=0), iconTransformation(extent={{90,-10},{110,10}}))); - Interfaces.Connectors.FluidInlet Ce3 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90}, {-90,-70}}))); - Interfaces.Connectors.FluidInlet Ce4 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{ 10,-90}}))); - Interfaces.Connectors.FluidOutlet Cs3 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110, -70}}))); - Interfaces.Connectors.FluidOutlet Cs4 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cs4(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}}))); Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(extent={{-10, @@ -157,19 +129,11 @@ initial equation end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -179,20 +143,6 @@ equation assert(V > 0, "Volume non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Ce4.ftype; - fluids[6] = Cs1.ftype; - fluids[7] = Cs2.ftype; - fluids[8] = Cs3.ftype; - fluids[9] = Cs4.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "VolumeITh: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -200,11 +150,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -213,11 +160,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then @@ -226,11 +170,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Ce4) == 0) then @@ -239,11 +180,8 @@ equation Ce4.h_vol_1 = 1.e5; Ce4.diff_res_1 = 0; Ce4.diff_on_1 = false; - Ce4.ftype = ftype; - Ce4.Xco2 = 0; - Ce4.Xh2o = 0; - Ce4.Xo2 = 0; - Ce4.Xso2 = 0; + Ce4.Xi = Medium.X_default[1:Medium.nXi]; + Ce4.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -278,7 +216,7 @@ equation BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -293,13 +231,13 @@ equation P = Cs4.P; /* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + Cth.W + J; + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + Cth.W + J; if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -315,54 +253,34 @@ equation Cs4.h_vol_1 = h; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q; - - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q - Cs4.Xi*Cs4.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs4.ftype = ftype; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + Ce4.Q*Ce4.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC - Cs4.Q*Cs4.SubC; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; + Cs4.SubC = SubC; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; + Cs4.Xi = X; - Cs4.Xco2 = Xco2; - Cs4.Xh2o = Xh2o; - Cs4.Xo2 = Xo2; - Cs4.Xso2 = Xso2; /* Flow reversal */ if continuous_flow_reversal then @@ -456,21 +374,23 @@ equation /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation ( From c742d552482058221d1b471549861f4b15eec91e Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 15:33:45 +0200 Subject: [PATCH 073/213] corrections --- ThermoSysPro/Fluid/Volumes/VolumeCTh.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo index 46867e0b..40381358 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo @@ -134,8 +134,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce1.Xi = Medium.X_default[1:Medium.nXi]; - Ce1.SubC = Medium.C_default; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then From 6e5a97b47a0636033cd8a022935c4a83f6dd65b9 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 15:35:18 +0200 Subject: [PATCH 074/213] corrections --- ThermoSysPro/Fluid/Volumes/VolumeBTh.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo index 6c7ed0f2..b0658336 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo @@ -134,8 +134,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce1.Xi = Medium.X_default[1:Medium.nXi]; - Ce1.SubC = Medium.C_default; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then From 14625a96499152f19562b8c474c065ab44108edb Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Mon, 23 Jun 2025 15:36:32 +0200 Subject: [PATCH 075/213] corrections --- ThermoSysPro/Fluid/Volumes/VolumeATh.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo index e703a0ee..f453a3e5 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo @@ -134,8 +134,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce1.Xi = Medium.X_default[1:Medium.nXi]; - Ce1.SubC = Medium.C_default; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then From 75c9f9ff91e015b093491662a99c7edd1505c0c5 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Tue, 24 Jun 2025 11:44:24 +0200 Subject: [PATCH 076/213] CentrifugalPump --- .../Machines/TestCentrifugalPump.mo | 19 ++++++++++++++ .../Machines/TestCentrifugalPump_FlueGases.mo | 24 ++++++++++++++++++ .../Machines/TestCentrifugalPump_Traces.mo | 24 ++++++++++++++++++ .../SimpleExamples/Machines/package.order | 5 +++- .../Fluid/Machines/CentrifugalPump.mo | 25 +++++++------------ 5 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo new file mode 100644 index 00000000..c9b51c33 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(centrifugalPump.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo new file mode 100644 index 00000000..2ffecfaa --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10}, + {14,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(centrifugalPump.C2, sink.C) + annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) + annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo new file mode 100644 index 00000000..d8f87653 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-52,-10}, + {-32,10}}))); +equation + connect(centrifugalPump.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 243a92a6..e43cd82f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -1,3 +1,6 @@ TestStaticCentrifugalPump TestStaticCentrifugalPump_FlueGases -TestStaticCentrifugalPump_Traces \ No newline at end of file +TestStaticCentrifugalPump_Traces +TestCentrifugalPump +TestCentrifugalPump_FlueGases +TestCentrifugalPump_Traces \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo index c8543d12..68693e41 100644 --- a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo @@ -1,7 +1,6 @@ within ThermoSysPro.Fluid.Machines; model CentrifugalPump "Centrifugal pump" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N=1400 "Pump angular velocity in rpm (active if input M is not connected)"; @@ -19,7 +18,6 @@ model CentrifugalPump "Centrifugal pump" "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Integer mode_car=2 "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics"; @@ -68,7 +66,6 @@ model CentrifugalPump "Centrifugal pump" protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.AngularVelocity w_a_min=1.e-4 "Small angular velocity"; parameter Units.SI.VolumeFlowRate Qv_a_min=1.e-4 "Small volume flow rate"; parameter Real rh_min=0.05 "Minimum efficiency"; @@ -114,12 +111,11 @@ public Real beta=hn_coef[2] "Coef. beta of the characteristics for hn"; Real gamma=rh_coef[1] "Coef. gamma of the characteristics for rh"; Real delta=rh_coef[2] "Coef. delta of the characteristics for rh"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); ElectroMechanics.Connectors.MechanichalTorque M annotation (Placement(transformation( @@ -152,12 +148,11 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + X = C1.Xi; + + C1.SubC = C2.SubC; Q = C1.Q; deltaP = C2.P - C1.P; @@ -166,8 +161,6 @@ equation deltaP = rho*g*hn; Q = Qv*rho; - ftype = C1.ftype; - /* Energy balance equation */ if dynamic_energy_balance then V*rho*der(h) = -Q*deltaH + Wr; @@ -285,7 +278,7 @@ equation if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( Diagram(coordinateSystem( From 8102b726341811b1862b18e78f2427b1a5a1b61a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 24 Jun 2025 15:36:49 +0200 Subject: [PATCH 077/213] #125 VolumeAth with heatSource, not working with OM1.25 --- .../SimpleExamples/Volumes/TestVolumeATh.mo | 24 +++++------ .../Volumes/TestVolumeATh_FlueGases.mo | 40 ++++++++++--------- .../Volumes/TestVolumeATh_Traces.mo | 37 ++++++++--------- .../SimpleExamples/Volumes/package.order | 2 +- ThermoSysPro/Fluid/Volumes/VolumeATh.mo | 1 - 5 files changed, 48 insertions(+), 56 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo index 7fb15da1..6b2789bd 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo @@ -3,21 +3,15 @@ model TestVolumeATh extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeATh - volumeATh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); equation - connect(sourcePQ.C, volumeATh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeATh.Ce2, sourceQ.C) - annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); - connect(volumeATh.Cs1, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeATh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeATh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeATh.Cs1, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(heatSource.C[1], volumeATh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeATh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo index 804c4ea4..2f1a9e64 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo @@ -3,28 +3,30 @@ model TestVolumeATh_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeATh - volumeATh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0 = {573.15}) annotation( + Placement(transformation(extent = {{-10, -20}, {10, -40}}))); equation - connect(sourcePQ.C, volumeATh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeATh.Ce2, sourceQ.C) - annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); - connect(volumeATh.Cs1, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeATh.Ce1) annotation( + Line(points = {{-30, 0}, {-10, 0}}, color = {0, 0, 0})); + connect(volumeATh.Ce2, sourceQ.C) annotation( + Line(points = {{0, 10}, {0, 30}, {-30, 30}}, color = {0, 0, 0})); + connect(volumeATh.Cs1, sink.C) annotation( + Line(points = {{10, 0}, {30, 0}}, color = {0, 0, 0})); + connect(volumeATh.Cth, heatSource.C[1]) annotation( + Line(points = {{0, 0}, {0, -20.2}}, color = {0, 0, 0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); -end TestVolumeATh_FlueGases; +end TestVolumeATh_FlueGases; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo index ea380925..ecbf2734 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo @@ -2,28 +2,25 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeATh_Traces extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeATh - volumeATh( - redeclare package Medium = Medium, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh( + redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, - SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-20},{10,-40}}))); equation - connect(sourcePQ.C, volumeATh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeATh.Ce2, sourceQ.C) - annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); - connect(volumeATh.Cs1, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeATh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeATh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeATh.Cs1, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeATh.Cth, heatSource.C[1]) annotation (Line(points={{0,0},{0,-20.2}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeATh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 6f328c14..aca36855 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -15,4 +15,4 @@ TestVolumeI_FlueGases TestVolumeI_Traces TestVolumeATh TestVolumeATh_Traces -TestVolumeATh_FlueGases \ No newline at end of file +TestVolumeATh_FlueGases diff --git a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo index f453a3e5..f482ebd3 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo @@ -194,7 +194,6 @@ equation end if; Cs1.Xi = X; - Cs2.Xi = X; /* Traces composition balance equations */ From 8e00bd47ace758119a8c1e2f5764cab8459e2adb Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Tue, 24 Jun 2025 16:39:51 +0200 Subject: [PATCH 078/213] examples with heat source --- .../SimpleExamples/Volumes/TestVolumeBTh.mo | 28 +++++++++++-------- .../Volumes/TestVolumeBTh_FlueGases.mo | 7 ++++- .../Volumes/TestVolumeBTh_Traces.mo | 4 +++ 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo index 866c9264..40e46e26 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo @@ -4,26 +4,32 @@ model TestVolumeBTh replaceable package Medium = Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={0,38}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeBTh - volumeBTh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=180, origin={42,0}))); + Thermal.BoundaryConditions.HeatSource heatSource + annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); equation connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21, 7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); - connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,19},{ - -5.55112e-16,19},{-5.55112e-16,28}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,19},{-5.55112e-16, + 19},{-5.55112e-16,28}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) + annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); end TestVolumeBTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo index d48a565e..16d799e5 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo @@ -17,7 +17,8 @@ model TestVolumeBTh_FlueGases option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + redeclare package Medium = Medium, h( + start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, T0=573.15, @@ -25,6 +26,8 @@ model TestVolumeBTh_FlueGases {10,10}}, rotation=180, origin={40,0}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation ( + Placement(transformation(extent={{-10,-22},{10,-42}}))); equation connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); @@ -32,5 +35,7 @@ equation 6.66134e-16},{30,6.66134e-16}}, color={0,0,0})); connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,20},{ -5.55112e-16,20},{-5.55112e-16,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) + annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeBTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo index 370c3b6c..0a686479 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo @@ -24,6 +24,8 @@ model TestVolumeBTh_Traces {10,10}}, rotation=180, origin={38,0}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22}, + {10,-42}}))); equation connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); @@ -31,5 +33,7 @@ equation 7.21645e-16},{28,7.21645e-16}}, color={0,0,0})); connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{-6.66134e-16,26}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) + annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeBTh_Traces; From 8196f42f9d07adecca48bfb227094de044b52cba Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Tue, 24 Jun 2025 16:44:03 +0200 Subject: [PATCH 079/213] Examples with heat source --- .../Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo | 4 ++++ .../SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo | 4 ++++ .../Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo index 3dd55013..5c3cbd0d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo @@ -12,6 +12,8 @@ model TestVolumeCTh redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-26}, + {10,-46}}))); equation connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); @@ -19,5 +21,7 @@ equation annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) + annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeCTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo index 2d2b65e5..b36afc50 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo @@ -19,6 +19,8 @@ model TestVolumeCTh_FlueGases redeclare replaceable package Medium = Medium, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation ( + Placement(transformation(extent={{-10,-24},{10,-44}}))); equation connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); @@ -26,5 +28,7 @@ equation annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) + annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeCTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo index a6b7f274..3e3dbece 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo @@ -14,6 +14,8 @@ model TestVolumeCTh_Traces ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22}, + {10,-42}}))); equation connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); @@ -21,5 +23,7 @@ equation annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) + annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeCTh_Traces; From bc3bab0b82cc7799a2e56fc328ecead4f3bf8f10 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Wed, 25 Jun 2025 09:13:13 +0200 Subject: [PATCH 080/213] Examples with heat source --- .../SimpleExamples/Volumes/TestVolumeDTh.mo | 30 +++++++++------- .../Volumes/TestVolumeDTh_FlueGases.mo | 36 +++++++++++-------- .../Volumes/TestVolumeDTh_Traces.mo | 33 +++++++++-------- 3 files changed, 57 insertions(+), 42 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo index ce8714ea..9acf1edc 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo @@ -4,18 +4,19 @@ model TestVolumeDTh replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeDTh - volumeDTh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, - {-32,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( - redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{12,22}, - {32,42}}))); + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable + package Medium = Medium) + annotation (Placement(transformation(extent={{12,22},{32,42}}))); + Thermal.BoundaryConditions.HeatSource heatSource + annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); equation connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); @@ -23,5 +24,8 @@ equation annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); connect(volumeDTh.Cs1, sinkQ.C) annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(heatSource.C[1], volumeDTh.Cth) + annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); end TestVolumeDTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo index 2085ae1b..62a34f9d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo @@ -3,26 +3,29 @@ model TestVolumeDTh_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{26,16}, - {46,36}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + option_temperature=true) + annotation (Placement(transformation(extent={{26,16},{46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeDTh - volumeDTh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( redeclare replaceable - package Medium = Medium, + option_temperature=true) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = + Medium, h(start=2.83057e6)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) + annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); equation connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); @@ -30,5 +33,8 @@ equation annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(heatSource.C[1], volumeDTh.Cth) + annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); end TestVolumeDTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo index 5a61dd4e..2ab2cf68 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo @@ -7,23 +7,25 @@ model TestVolumeDTh_Traces C_nominal={0.1}, C_default={0.2}); ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{20,20}, - {40,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + Medium = Medium) + annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeDTh - volumeDTh( - redeclare package Medium = Medium, + SubC0={0.5}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh( + redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, - {8,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + dynamic_mass_balance=false) + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); + Thermal.BoundaryConditions.HeatSource heatSource + annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); equation connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0})); @@ -31,5 +33,8 @@ equation annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(heatSource.C[1], volumeDTh.Cth) + annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); end TestVolumeDTh_Traces; From 5270e5ce6e55bb8dc7491b60dc1fda34863bda20 Mon Sep 17 00:00:00 2001 From: LAMBLOT Simon Date: Wed, 25 Jun 2025 09:18:19 +0200 Subject: [PATCH 081/213] Examples with heat source --- .../SimpleExamples/Volumes/TestVolumeITh.mo | 27 ++++++++------ .../Volumes/TestVolumeITh_FlueGases.mo | 36 +++++++++++-------- .../Volumes/TestVolumeITh_Traces.mo | 33 +++++++++-------- 3 files changed, 56 insertions(+), 40 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo index 86bd3bb8..66cffddc 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo @@ -4,17 +4,19 @@ model TestVolumeITh replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeITh - volumeITh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( - redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10}, - {-32,10}}))); + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-50,10}, - {-30,30}}))); + package Medium = Medium) + annotation (Placement(transformation(extent={{-50,10},{-30,30}}))); + Thermal.BoundaryConditions.HeatSource heatSource + annotation (Placement(transformation(extent={{-10,-24},{10,-44}}))); equation connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); @@ -22,5 +24,8 @@ equation annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(heatSource.C[1], volumeITh.Cth) + annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); end TestVolumeITh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo index 9979e040..bcdea0f4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo @@ -3,26 +3,29 @@ model TestVolumeITh_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{26,-18}, - {46,2}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + option_temperature=true) + annotation (Placement(transformation(extent={{26,-18},{46,2}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeITh - volumeITh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, + option_temperature=true) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = + Medium, h(start=2.83057e6)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, origin={-40,20}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) + annotation (Placement(transformation(extent={{-10,-26},{10,-46}}))); equation connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); @@ -30,5 +33,8 @@ equation annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(heatSource.C[1], volumeITh.Cth) + annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); end TestVolumeITh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo index 446cf493..fed3dd5c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo @@ -7,23 +7,25 @@ model TestVolumeITh_Traces C_nominal={0.1}, C_default={0.2}); ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{20,20}, - {40,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + Medium = Medium) + annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeITh - volumeITh( - redeclare package Medium = Medium, + SubC0={0.5}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh( + redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10}, - {8,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + dynamic_mass_balance=false) + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18}, - {-36,38}}))); + SubC0={0.5}) + annotation (Placement(transformation(extent={{-56,18},{-36,38}}))); + Thermal.BoundaryConditions.HeatSource heatSource + annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); equation connect(volumeITh.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); @@ -31,5 +33,8 @@ equation annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(heatSource.C[1], volumeITh.Cth) + annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); end TestVolumeITh_Traces; From 7339f1031bfa799c69d6da56ae390c43e1e7a486 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 27 Jun 2025 11:55:24 +0200 Subject: [PATCH 082/213] #125 no more IF97 annotation --- .../TestDynamicOnePhaseFlowPipe_FlueGases.mo | 13 ++++++++----- .../TestDynamicOnePhaseFlowPipe_Traces.mo | 2 +- .../Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo | 2 -- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo index 56268e48..29f0ce1b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo @@ -10,9 +10,12 @@ model TestDynamicOnePhaseFlowPipe_FlueGases ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( redeclare package Medium = Medium, Ns=1, - Q(start={34.51316334625123,34.51316334625123}), + Q(start=fill(36, dynamicOnePhaseFlowPipe.Ns + 1)), h(start={3077096.0822837264,3135044.986588299,3077096.0822837264}), - P(start={45e5,44.75e5,44.5e5}, displayUnit="bar")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + P(start=linspace( + 45, + 44.5, + dynamicOnePhaseFlowPipe.Ns + 2))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( redeclare package Medium = Medium, P0=4500000, @@ -23,10 +26,10 @@ model TestDynamicOnePhaseFlowPipe_FlueGases P0=4450000, T0=573.15) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - T0={1000.005}, + T0=fill(726.855, dynamicOnePhaseFlowPipe.Ns), option_temperature=2, - W0={2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=1) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); + W0=fill(2e6/dynamicOnePhaseFlowPipe.Ns, dynamicOnePhaseFlowPipe.Ns)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=dynamicOnePhaseFlowPipe.Ns) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); equation connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo index 09c998b9..84ca3da5 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo @@ -12,7 +12,7 @@ model TestDynamicOnePhaseFlowPipe_Traces Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo index 5451ccc9..f17e6fc0 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo @@ -44,12 +44,10 @@ model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; parameter Units.SI.Area A=ntubes*pi*D^2/4 "Internal cross sectional pipe area"; From 900f9c49a1d2735d323b6580e4cba5b517270123 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 27 Jun 2025 12:18:54 +0200 Subject: [PATCH 083/213] #125 VolumeBth --- .../SimpleExamples/Volumes/TestVolumeBTh.mo | 32 +++++-------- .../Volumes/TestVolumeBTh_FlueGases.mo | 42 +++++++---------- .../Volumes/TestVolumeBTh_Traces.mo | 45 ++++++++----------- 3 files changed, 46 insertions(+), 73 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo index 40e46e26..927f3cd4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo @@ -3,33 +3,21 @@ model TestVolumeBTh extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={0,38}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={42,0}))); - Thermal.BoundaryConditions.HeatSource heatSource - annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); equation - connect(sourcePQ.C, volumeBTh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21, - 7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); - connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,19},{-5.55112e-16, - 19},{-5.55112e-16,28}}, color={0,0,0})); - connect(heatSource.C[1], volumeBTh.Cth) - annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21,7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,19},{-5.55112e-16,19},{-5.55112e-16,28}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeBTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo index 16d799e5..ae9b8890 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo @@ -3,39 +3,31 @@ model TestVolumeBTh_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={0,40}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeBTh - volumeBTh( - redeclare package Medium = Medium, h( - start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=180, origin={40,0}))); - Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation ( - Placement(transformation(extent={{-10,-22},{10,-42}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); equation - connect(sourcePQ.C, volumeBTh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{25,0},{25, - 6.66134e-16},{30,6.66134e-16}}, color={0,0,0})); - connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,20},{ - -5.55112e-16,20},{-5.55112e-16,30}}, color={0,0,0})); - connect(heatSource.C[1], volumeBTh.Cth) - annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{25,0},{25,6.66134e-16},{30,6.66134e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,20},{-5.55112e-16,20},{-5.55112e-16,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeBTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo index 0a686479..23543d62 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo @@ -2,38 +2,31 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeBTh_Traces extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={0,36}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeBTh - volumeBTh( - redeclare package Medium = Medium, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh( + redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, - SubC0={0.2}) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=180, origin={38,0}))); - Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22}, - {10,-42}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); equation - connect(sourcePQ.C, volumeBTh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{19,0},{19, - 7.21645e-16},{28,7.21645e-16}}, color={0,0,0})); - connect(volumeBTh.Cs1, sink.C) - annotation (Line(points={{0,10},{0,26},{-6.66134e-16,26}}, color={0,0,0})); - connect(heatSource.C[1], volumeBTh.Cth) - annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{19,0},{19,7.21645e-16},{28,7.21645e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{-6.66134e-16,26}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeBTh_Traces; From dde0c82cf5132e7bc5752e350c5f5f158f34581c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 27 Jun 2025 14:22:51 +0200 Subject: [PATCH 084/213] #125 IF97 imports --- ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo | 2 -- 1 file changed, 2 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo index f17e6fc0..17a39810 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo @@ -1,8 +1,6 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=10. "Pipe length"; From 4c05a6169be12968c38fcad4fc4b28f6fd367850 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 27 Jun 2025 15:08:30 +0200 Subject: [PATCH 085/213] #125 VolumeCth reviewed --- .../SimpleExamples/Volumes/TestVolumeCTh.mo | 28 +++++---------- .../Volumes/TestVolumeCTh_FlueGases.mo | 19 ++++------ .../Volumes/TestVolumeCTh_Traces.mo | 35 +++++++------------ 3 files changed, 28 insertions(+), 54 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo index 5c3cbd0d..ff030840 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo @@ -3,25 +3,15 @@ model TestVolumeCTh extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeCTh - volumeCTh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); - Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-26}, - {10,-46}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-26},{10,-46}}))); equation - connect(sourcePQ.C, volumeCTh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(sink.C, volumeCTh.Cs) - annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); - connect(volumeCTh.Ce2, sourceQ.C) - annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); - connect(heatSource.C[1], volumeCTh.Cth) - annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeCTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo index b36afc50..224fc061 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo @@ -12,23 +12,16 @@ model TestVolumeCTh_FlueGases P0=4500000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeCTh - volumeCTh( - redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); - Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation ( - Placement(transformation(extent={{-10,-24},{10,-44}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-24},{10,-44}}))); equation - connect(sourcePQ.C, volumeCTh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(sink.C, volumeCTh.Cs) - annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); - connect(volumeCTh.Ce2, sourceQ.C) - annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); - connect(heatSource.C[1], volumeCTh.Cth) - annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeCTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo index 3e3dbece..7b584788 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo @@ -2,28 +2,19 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; model TestVolumeCTh_Traces extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.2}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeCTh - volumeCTh( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium, SubC0={0.1}) - annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); - Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22}, - {10,-42}}))); + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); equation - connect(sourcePQ.C, volumeCTh.Ce1) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(sink.C, volumeCTh.Cs) - annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); - connect(volumeCTh.Ce2, sourceQ.C) - annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); - connect(heatSource.C[1], volumeCTh.Cth) - annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeCTh_Traces; From 79ec2fba930da6d558d1f2422d55e0b8cc98108f Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 27 Jun 2025 15:13:36 +0200 Subject: [PATCH 086/213] #125 VolumeDth reviewed --- .../SimpleExamples/Volumes/TestVolumeDTh.mo | 35 ++++++------------- .../Volumes/TestVolumeDTh_FlueGases.mo | 29 ++++++--------- .../Volumes/TestVolumeDTh_Traces.mo | 32 ++++++----------- 3 files changed, 32 insertions(+), 64 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo index 9acf1edc..7f9fc507 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo @@ -3,29 +3,16 @@ model TestVolumeDTh extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable - package Medium = Medium) - annotation (Placement(transformation(extent={{12,22},{32,42}}))); - Thermal.BoundaryConditions.HeatSource heatSource - annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{12,22},{32,42}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); equation - connect(sourcePQ.C, volumeDTh.Ce) - annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); - connect(volumeDTh.Cs3, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(volumeDTh.Cs1, sinkQ.C) - annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); - connect(heatSource.C[1], volumeDTh.Cth) - annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeDTh.Cs1, sinkQ.C) annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); + connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeDTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo index 62a34f9d..25920676 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo @@ -3,20 +3,17 @@ model TestVolumeDTh_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) - annotation (Placement(transformation(extent={{26,16},{46,36}}))); + option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = - Medium, h(start=2.83057e6)) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( redeclare replaceable package Medium = Medium, T0=573.15, @@ -24,17 +21,11 @@ model TestVolumeDTh_FlueGases extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); - Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) - annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); equation - connect(volumeDTh.Cs1, sink.C) - annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); - connect(sourcePQ.C, volumeDTh.Ce) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(volumeDTh.Cs3, sinkQ.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(heatSource.C[1], volumeDTh.Cth) - annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); + connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeDTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo index 2ab2cf68..bd6a3ae9 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo @@ -6,35 +6,25 @@ model TestVolumeDTh_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{20,20},{40,40}}))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh( redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) - annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation( + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={40,0}))); - Thermal.BoundaryConditions.HeatSource heatSource - annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); equation - connect(volumeDTh.Cs1, sink.C) - annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0})); - connect(sourcePQ.C, volumeDTh.Ce) - annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); - connect(volumeDTh.Cs3, sinkQ.C) - annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); - connect(heatSource.C[1], volumeDTh.Cth) - annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); + connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeDTh_Traces; From 6976352412c9e73ba828caca3349cee41894bf87 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 27 Jun 2025 15:19:15 +0200 Subject: [PATCH 087/213] #125 VolumeIth reviewed --- .../SimpleExamples/Volumes/TestVolumeITh.mo | 35 ++++++------------- .../Volumes/TestVolumeITh_FlueGases.mo | 29 ++++++--------- .../Volumes/TestVolumeITh_Traces.mo | 32 ++++++----------- 3 files changed, 32 insertions(+), 64 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo index 66cffddc..7bb2b515 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo @@ -3,29 +3,16 @@ model TestVolumeITh extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package Medium = Medium) - annotation (Placement(transformation(extent={{-50,10},{-30,30}}))); - Thermal.BoundaryConditions.HeatSource heatSource - annotation (Placement(transformation(extent={{-10,-24},{10,-44}}))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-24},{10,-44}}))); equation - connect(volumeITh.Cs3, sink.C) - annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); - connect(sourcePQ.C, volumeITh.Ce2) - annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); - connect(sourceQ.C, volumeITh.Ce1) - annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); - connect(heatSource.C[1], volumeITh.Cth) - annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeITh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo index bcdea0f4..dd23d458 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo @@ -3,20 +3,17 @@ model TestVolumeITh_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) - annotation (Placement(transformation(extent={{26,-18},{46,2}}))); + option_temperature=true) annotation (Placement(transformation(extent={{26,-18},{46,2}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = - Medium, h(start=2.83057e6)) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, T0=573.15, @@ -24,17 +21,11 @@ model TestVolumeITh_FlueGases extent={{-10,-10},{10,10}}, rotation=0, origin={-40,20}))); - Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) - annotation (Placement(transformation(extent={{-10,-26},{10,-46}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-26},{10,-46}}))); equation - connect(sourcePQ.C, volumeITh.Ce2) - annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); - connect(sourceQ.C, volumeITh.Ce1) - annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); - connect(volumeITh.Cs3, sink.C) - annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); - connect(heatSource.C[1], volumeITh.Cth) - annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); + connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeITh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo index fed3dd5c..9b182a61 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo @@ -6,35 +6,25 @@ model TestVolumeITh_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) - annotation (Placement(transformation(extent={{20,20},{40,40}}))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh( redeclare package Medium = Medium, V=1, - dynamic_mass_balance=false) - annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( redeclare replaceable package Medium = Medium, Q0=100, - SubC0={0.5}) - annotation (Placement(transformation(extent={{-56,18},{-36,38}}))); - Thermal.BoundaryConditions.HeatSource heatSource - annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); + SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18},{-36,38}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); equation - connect(volumeITh.Cs1, sink.C) - annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); - connect(sourcePQ.C, volumeITh.Ce2) - annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); - connect(sourceQ.C, volumeITh.Ce1) - annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); - connect(heatSource.C[1], volumeITh.Cth) - annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(volumeITh.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); + connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestVolumeITh_Traces; From 7d6286134d918d59e869b35e5cb17b4a3ca236af Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 27 Jun 2025 15:26:42 +0200 Subject: [PATCH 088/213] #125 CentrifugalPump reviewed --- .../Machines/TestCentrifugalPump.mo | 16 +++++----------- .../Machines/TestCentrifugalPump_FlueGases.mo | 10 +++------- .../Machines/TestCentrifugalPump_Traces.mo | 18 +++++------------- ThermoSysPro/Fluid/Machines/CentrifugalPump.mo | 5 +++-- 4 files changed, 16 insertions(+), 33 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo index c9b51c33..b306260b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo @@ -3,17 +3,11 @@ model TestCentrifugalPump extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(centrifugalPump.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(centrifugalPump.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo index 2ffecfaa..9fdeb876 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo @@ -3,9 +3,7 @@ model TestCentrifugalPump_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10}, - {14,10}}))); + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -16,9 +14,7 @@ model TestCentrifugalPump_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(centrifugalPump.C2, sink.C) - annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); - connect(centrifugalPump.C1, sourcePQ.C) - annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo index d8f87653..8387f4d8 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo @@ -6,19 +6,11 @@ model TestCentrifugalPump_Traces extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10}, - {10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={0.3}) - annotation (Placement(transformation(extent={{-52,-10}, - {-32,10}}))); + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); equation - connect(centrifugalPump.C2, sink.C) - annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(centrifugalPump.C1, sourcePQ.C) - annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo index 68693e41..2ee234f5 100644 --- a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo @@ -1,5 +1,7 @@ within ThermoSysPro.Fluid.Machines; model CentrifugalPump "Centrifugal pump" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N=1400 @@ -322,6 +324,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - DymolaStoredErrors); +")); end CentrifugalPump; From 9168f58de0c5b3f35dc42781fe7a09847a8ba3a0 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 2 Jul 2025 10:43:26 +0200 Subject: [PATCH 089/213] #125 StodolaTurbine no X in setStates --- ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index 7173773a..d27c4b51 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -138,15 +138,15 @@ equation MechPower.signal = W; /* Fluid thermodynamic properties before the expansion */ - state_e=Medium.setState_phX(p=Pe, h=Ce.h, phase=phase_e); + state_e=Medium.setState_ph(p=Pe, h=Ce.h, phase=phase_e); Te = state_e.T; /* Fluid thermodynamic properties after the expansion */ - state_s1 = Medium.setState_phX(p=Ps, h=Hrs, phase=phase_s); + state_s1 = Medium.setState_ph(p=Ps, h=Hrs, phase=phase_s); /* Fluid thermodynamic properties at the outlet of the nozzle */ - state_s = Medium.setState_phX(p=Ps, h=Cs.h, phase=phase_s); + state_s = Medium.setState_ph(p=Ps, h=Cs.h, phase=phase_s); Ts = state_s.T; rhos = state_s.d; From 9790eeba770487237e262245245374c42740c136 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 2 Jul 2025 11:53:24 +0200 Subject: [PATCH 090/213] #125 no more X declaration in StodolaTurbine --- ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 2 -- 1 file changed, 2 deletions(-) diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index d27c4b51..83348bfc 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -55,7 +55,6 @@ public Units.SI.Velocity Vs "Fluid velocity at the outlet"; Units.SI.Density rhos(start=200) "Fluid density at the outlet"; Real xm(start=1.0,min=0) "Average vapor mass fraction"; - Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public Medium.ThermodynamicState state_e; @@ -99,7 +98,6 @@ equation /* Fluid composition balance equations*/ Ce.Xi = Cs.Xi; - X = Ce.Xi; Ce.SubC = Cs.SubC; From 37c773ea3653ba8385141ed8a067f7d85d80a410 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Wed, 2 Jul 2025 12:17:49 +0200 Subject: [PATCH 091/213] Removed X balance equation --- ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 3 --- 1 file changed, 3 deletions(-) diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index 83348bfc..b9e93725 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -96,9 +96,6 @@ equation Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - /* Fluid composition balance equations*/ - Ce.Xi = Cs.Xi; - Ce.SubC = Cs.SubC; Q = Ce.Q; From b5dea3f9b27da19a9b139acd81e92f61fdb330be Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Wed, 2 Jul 2025 13:20:32 +0200 Subject: [PATCH 092/213] Included X balance equation for completeness (undid last commit) --- ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index b9e93725..fc9b6cb4 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -95,6 +95,9 @@ equation Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); + /* Fluid composition balance equations*/ + Ce.Xi = Cs.Xi; + Ce.SubC = Cs.SubC; From 00673bb9a44894614817e62505f3c3b4726d8e2e Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 2 Jul 2025 15:51:07 +0200 Subject: [PATCH 093/213] #125 Tank --- .../TestTank_withPipePressureLosses.mo | 61 ++++++ .../SimpleExamples/Volumes/package.order | 1 + ThermoSysPro/Fluid/Volumes/Tank.mo | 205 ++++++------------ 3 files changed, 130 insertions(+), 137 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo new file mode 100644 index 00000000..24010d0b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTank_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=5), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-6},{20,-6},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-10,6}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,6},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestTank_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 20c87bb5..a5fe85b1 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -28,3 +28,4 @@ TestVolumeDTh_Traces TestVolumeITh TestVolumeITh_FlueGases TestVolumeITh_Traces +TestTank_withPipePressureLosses diff --git a/ThermoSysPro/Fluid/Volumes/Tank.mo b/ThermoSysPro/Fluid/Volumes/Tank.mo index ee44c999..8f318a1f 100644 --- a/ThermoSysPro/Fluid/Volumes/Tank.mo +++ b/ThermoSysPro/Fluid/Volumes/Tank.mo @@ -1,13 +1,11 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model Tank "Open vertical tank" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.AbsolutePressure Patm=1.013e5 - "Pressure above the fluid level"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS (SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.AbsolutePressure Patm=1.013e5 "Pressure above the fluid level"; parameter Units.SI.Area A=1 "Tank cross sectional area"; parameter Units.SI.Position ze1=40 "Altitude of inlet 1"; parameter Units.SI.Position ze2=de2/2 "Altitude of inlet 2"; @@ -24,7 +22,7 @@ model Tank "Open vertical tank" parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; parameter Boolean dynamic_mass_balance=false - "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium.isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=false "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Units.SI.SpecificEnthalpy h0=1.e5 @@ -42,46 +40,22 @@ model Tank "Open vertical tank" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); + protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; parameter Real eps=1.e-0 "Small number for the square function"; parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level"; parameter Real pi=Modelica.Constants.pi; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Position z "Fluid level"; @@ -91,6 +65,10 @@ public Units.SI.Density rho(start=998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; ThermoSysPro.Units.SI.PressureDifference deltaP_e1 "Presure loss for e1"; ThermoSysPro.Units.SI.PressureDifference deltaP_e2 "Presure loss for e2"; ThermoSysPro.Units.SI.PressureDifference deltaP_s1 "Presure loss for s1"; @@ -105,15 +83,8 @@ public Units.SI.Angle theta_s2; Units.SI.DerDensityByPressure ddph "density derivative by pressure"; Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -132,16 +103,16 @@ public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation (Placement(transformation( extent={{100,10},{120,30}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,50},{-90,70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,-70},{110,-50}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-70},{-90,-50}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{92,50},{112,70}}, rotation=0))); initial equation if dynamic_energy_balance then @@ -158,19 +129,11 @@ initial equation z = z0; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0, Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; @@ -180,27 +143,14 @@ equation assert(A > 0, "Cross-sectional area is non-positive"); end if; - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "Tank: fluids mixing in volume are not compatible with each other"); - if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -209,11 +159,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -233,8 +180,8 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; - if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ; + if Medium.isCompressible and dynamic_energy_balance and dynamic_mass_balance then + A*(ddph*der(P) + ddhp*der(h))*z + A*rho*der(z) = BQ; else A*rho*der(z) = BQ; end if; @@ -272,17 +219,17 @@ equation deltaP_s2*omega_s2^2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho; /* Energy balance equation */ - BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J; + BH = Ce1.Q*((Ce1.h - h)) + Ce2.Q*((Ce2.h - h)) - Cs1.Q*((Cs1.h - h)) - Cs2.Q*((Cs2.h - h)) + Cth.W + J; if dynamic_energy_balance then if z > zmin then if dynamic_mass_balance then - A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH; + A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h)) = BH; else - A*z*rho*der(h - Xh2o*hr) = BH; + A*z*rho*der(h) = BH; end if; else - der(h - Xh2o*hr) = 0; + der(h) = 0; end if; else BH = 0; @@ -299,42 +246,29 @@ equation yLevel.signal = z; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - - if flue_gases then - if dynamic_composition_balance then - A*z*rho*der(Xco2) + Xco2*BQ = BXco2; - A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - A*z*rho*der(Xo2) + Xo2*BQ = BXo2; - A*z*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + A*z*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; + Cs1.Xi = X; + Cs2.Xi = X; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + SubCSaS = SaS(); + if dynamic_mass_balance then + A*z*rho*der(SubC) + SubC*BQ + A*z*rho*SubCSaS = BSubC; + else + A*z*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -393,42 +327,40 @@ equation /* Fluid thermodynamic properties */ P = Patm + rho*g*z/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + state = Medium.setState_phX( + p=P, + h=h, + X=X); + + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + rho = Medium.density(state); end if; if dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; + annotation ( Icon(coordinateSystem( preserveAspectRatio=false, extent={{-100,-100},{100,100}}, - grid={2,2}), graphics={ Rectangle(extent={{-100,100},{100,20}}), - Rectangle( + grid={2,2}), graphics={Rectangle(extent={{-100,100},{100,20}}), Rectangle( extent={{-100,20},{100,-100}}, lineColor={0,0,0}, - fillPattern=DynamicSelect(FillPattern.Solid, - if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder - else FillPattern.Solid), - fillColor= DynamicSelect({85,170,255}, - if dynamic_energy_balance then fill_color_dynamic - else if diffusion then fill_color_singular - else fill_color_static))}), + fillPattern=DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), + fillColor=DynamicSelect({85,170,255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static))}), Diagram(coordinateSystem( preserveAspectRatio=false, extent={{-100,-100},{100,100}}, - grid={2,2}), graphics={Rectangle(extent={{-100,100},{100,20}}, - lineColor={28,108,200}), - Rectangle( + grid={2,2}), graphics={Rectangle(extent={{-100,100},{100,20}}, lineColor={28,108,200}), Rectangle( extent={{-100,20},{100,-100}}, lineColor={0,0,0}, fillPattern=FillPattern.Solid, @@ -442,8 +374,7 @@ equation

    Copyright © EDF 2002 - 2024

    ThermoSysPro Version 4.1

    This component model is documented in Sect. 14.5 of the ThermoSysPro book. -", - revisions=" +", revisions="

    Author

    • Daniel Bouskela
    • From a86b257bd2855c72a0ddd7f9a1ecbc2b8a2094e6 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 2 Jul 2025 16:21:02 +0200 Subject: [PATCH 094/213] #125 Tank with traces example Open an issue regarding the possibility to add a subC0 in tanks and volumes --- .../TestTank_Traces_withPipePressureLosses.mo | 66 +++++++++++++++++++ .../SimpleExamples/Volumes/package.order | 1 + 2 files changed, 67 insertions(+) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo new file mode 100644 index 00000000..0107dd5f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo @@ -0,0 +1,66 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTank_Traces_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + SubC(start={0.9}), + z(fixed=false, start=5), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-6},{20,-6},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-10,6}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,6},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1 +")); +end TestTank_Traces_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index a5fe85b1..ef3c194c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -29,3 +29,4 @@ TestVolumeITh TestVolumeITh_FlueGases TestVolumeITh_Traces TestTank_withPipePressureLosses +TestTank_Traces_withPipePressureLosses From 20bd0f14c045d87130433a17c4a4f3cddb60d3bb Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 11:25:58 +0200 Subject: [PATCH 095/213] #125 Sensors --- .../SimpleExamples/Sensors/TestSensors.mo | 25 ++++++ .../Sensors/TestSensors_FlueGases.mo | 30 +++++++ .../Sensors/TestSensors_Traces.mo | 29 +++++++ .../SimpleExamples/Sensors/package.order | 3 + ThermoSysPro/Fluid/Sensors/SensorH.mo | 13 ++- ThermoSysPro/Fluid/Sensors/SensorP.mo | 13 ++- ThermoSysPro/Fluid/Sensors/SensorQ.mo | 13 ++- ThermoSysPro/Fluid/Sensors/SensorQv.mo | 23 ++---- ThermoSysPro/Fluid/Sensors/SensorSubC.mo | 81 +++++++++++++++++++ ThermoSysPro/Fluid/Sensors/SensorT.mo | 25 +++--- ThermoSysPro/Fluid/Sensors/SensorX.mo | 81 +++++++++++++++++++ ThermoSysPro/Fluid/Sensors/package.order | 2 + 12 files changed, 285 insertions(+), 53 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo create mode 100644 ThermoSysPro/Fluid/Sensors/SensorSubC.mo create mode 100644 ThermoSysPro/Fluid/Sensors/SensorX.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo new file mode 100644 index 00000000..c0f0702e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo new file mode 100644 index 00000000..2a5805a4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo new file mode 100644 index 00000000..c163eb70 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) + annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order index e69de29b..89cbb72b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order @@ -0,0 +1,3 @@ +TestSensors +TestSensors_FlueGases +TestSensors_Traces diff --git a/ThermoSysPro/Fluid/Sensors/SensorH.mo b/ThermoSysPro/Fluid/Sensors/SensorH.mo index d6fcfd4b..92c53c8f 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorH.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorH.mo @@ -1,15 +1,17 @@ within ThermoSysPro.Fluid.Sensors; model SensorH "Specific enthalpy sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation (Placement(transformation( origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -26,12 +28,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; /* Sensor signal */ Measure.signal = C1.h; diff --git a/ThermoSysPro/Fluid/Sensors/SensorP.mo b/ThermoSysPro/Fluid/Sensors/SensorP.mo index a173f50b..531cd540 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorP.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorP.mo @@ -1,15 +1,17 @@ within ThermoSysPro.Fluid.Sensors; model SensorP "Pressure sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation (Placement(transformation( origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -26,12 +28,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; /* Sensor signal */ Measure.signal = C1.P; diff --git a/ThermoSysPro/Fluid/Sensors/SensorQ.mo b/ThermoSysPro/Fluid/Sensors/SensorQ.mo index 2867db77..9deb22a2 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQ.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQ.mo @@ -1,15 +1,17 @@ within ThermoSysPro.Fluid.Sensors; model SensorQ "Mass flow sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation (Placement(transformation( origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -26,12 +28,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; /* Sensor signal */ Measure.signal = C1.Q; diff --git a/ThermoSysPro/Fluid/Sensors/SensorQv.mo b/ThermoSysPro/Fluid/Sensors/SensorQv.mo index 1f039216..2c9b2e9a 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQv.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQv.mo @@ -1,14 +1,12 @@ within ThermoSysPro.Fluid.Sensors; model SensorQv "Volumetric flow sensor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor"; public @@ -17,8 +15,6 @@ public Units.SI.AbsolutePressure Pm "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Density rho(start=998) "Fluid density"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -26,9 +22,9 @@ public origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -45,17 +41,12 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; - ftype = C1.ftype; - /* Sensor signal */ Qv = Q/rho; Measure.signal = Qv*facteur; @@ -63,7 +54,7 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; h = C1.h; - rho = ThermoSysPro.Properties.Fluid.Density_Ph(C1.P,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=C1.Xi); annotation ( Icon(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Sensors/SensorSubC.mo b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo new file mode 100644 index 00000000..8f4b21fe --- /dev/null +++ b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo @@ -0,0 +1,81 @@ +within ThermoSysPro.Fluid.Sensors; +model SensorSubC "SubC sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nC] Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); +equation + + C1.P = C2.P; + C1.Q = C2.Q; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ + Measure.signal = C1.SubC; + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "C")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "C")}), + Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1

      +", + revisions=" +

      Authors

      +
        +
      • Daniel Bouskela
      • +
      • Baligh El Hefni
      • +
      +")); +end SensorSubC; diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo index 5c4d341d..e9ec13d9 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorT.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo @@ -1,14 +1,12 @@ within ThermoSysPro.Fluid.Sensors; model SensorT "Temperature sensor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.MassFlowRate Qeps=1.e-3 "Minimum mass flow rate for continuous flow reversal"; @@ -17,8 +15,7 @@ public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -29,9 +26,9 @@ public extent={{-10,-10},{10,10}}, rotation=90, origin={0,102}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -48,16 +45,12 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; - - ftype = C1.ftype; + X = C1.Xi; /* Sensor signal */ Measure.signal = T; @@ -66,7 +59,7 @@ equation P = (C1.P + C2.P)/2; h = (C1.h + C2.h)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Sensors/SensorX.mo b/ThermoSysPro/Fluid/Sensors/SensorX.mo new file mode 100644 index 00000000..a6a72209 --- /dev/null +++ b/ThermoSysPro/Fluid/Sensors/SensorX.mo @@ -0,0 +1,81 @@ +within ThermoSysPro.Fluid.Sensors; +model SensorX "X sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nXi] Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); +equation + + C1.P = C2.P; + C1.Q = C2.Q; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ + Measure.signal = C1.Xi; + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "X")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "X")}), + Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1

      +", + revisions=" +

      Authors

      +
        +
      • Daniel Bouskela
      • +
      • Baligh El Hefni
      • +
      +")); +end SensorX; diff --git a/ThermoSysPro/Fluid/Sensors/package.order b/ThermoSysPro/Fluid/Sensors/package.order index f2873124..eefb8c73 100644 --- a/ThermoSysPro/Fluid/Sensors/package.order +++ b/ThermoSysPro/Fluid/Sensors/package.order @@ -3,3 +3,5 @@ SensorQ SensorQv SensorH SensorT +SensorSubC +SensorX From 50bb2e0eb1f028ab36f7671c2497571b5885cd19 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 11:49:36 +0200 Subject: [PATCH 096/213] #125 SensorT without X redeclaration --- ThermoSysPro/Fluid/Sensors/SensorT.mo | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo index e9ec13d9..307551eb 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorT.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo @@ -15,7 +15,6 @@ public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -50,7 +49,6 @@ equation C1.SubC = C2.SubC; Q = C1.Q; - X = C1.Xi; /* Sensor signal */ Measure.signal = T; @@ -59,7 +57,7 @@ equation P = (C1.P + C2.P)/2; h = (C1.h + C2.h)/2; - T = Medium.temperature_phX(p=P, h=h, X=X); + T = Medium.temperature_phX(p=P, h=h, X=C1.Xi); annotation ( Diagram(coordinateSystem( From 9b2d7a9fb7a1fe1ab3724354b6626792ad8e434e Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 3 Jul 2025 15:13:45 +0200 Subject: [PATCH 097/213] Simplified sensor T et Qv : removed unused variables, transformed facteur into parameter instead of variable --- ThermoSysPro/Fluid/Sensors/SensorQv.mo | 9 ++------- ThermoSysPro/Fluid/Sensors/SensorT.mo | 16 +--------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/ThermoSysPro/Fluid/Sensors/SensorQv.mo b/ThermoSysPro/Fluid/Sensors/SensorQv.mo index 2c9b2e9a..83b43337 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQv.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQv.mo @@ -6,14 +6,11 @@ model SensorQv "Volumetric flow sensor" parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; protected - constant Real pi=Modelica.Constants.pi "pi"; - Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor"; + parameter Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor"; public Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; - Units.SI.AbsolutePressure Pm "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Density rho(start=998) "Fluid density"; public @@ -52,9 +49,7 @@ equation Measure.signal = Qv*facteur; /* Fluid thermodynamic properties */ - Pm = (C1.P + C2.P)/2; - h = C1.h; - rho = Medium.density_phX(p=Pm, h=h, X=C1.Xi); + rho = Medium.density_phX(p=C1.P, h=C1.h, X=C1.Xi); annotation ( Icon(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo index 307551eb..2a6d4746 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorT.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo @@ -3,18 +3,9 @@ model SensorT "Temperature sensor" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - -protected - constant Real pi=Modelica.Constants.pi "pi"; - parameter Units.SI.MassFlowRate Qeps=1.e-3 - "Minimum mass flow rate for continuous flow reversal"; public - Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -48,16 +39,11 @@ equation C1.SubC = C2.SubC; - Q = C1.Q; - /* Sensor signal */ Measure.signal = T; /* Fluid thermodynamic properties */ - P = (C1.P + C2.P)/2; - h = (C1.h + C2.h)/2; - - T = Medium.temperature_phX(p=P, h=h, X=C1.Xi); + T = Medium.temperature_phX(p=C1.P, h=C1.h, X=C1.Xi); annotation ( Diagram(coordinateSystem( From 2544d6371c625b70110830bb64b3b716ee38cb99 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Fri, 13 Jun 2025 16:49:07 +0200 Subject: [PATCH 098/213] rebase conflict #125 RefT --- ThermoSysPro/Fluid/BoundaryConditions/RefT.mo | 32 +++++++---------- .../BoundaryConditions/TestRefT.mo | 33 +++++++++++++++++ .../BoundaryConditions/TestRefT_Traces.mo | 35 +++++++++++++++++++ .../BoundaryConditions/package.order | 3 ++ 4 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo index a5795521..7aeecfc4 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo @@ -1,28 +1,24 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefT "Fixed temperature reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); -protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature - annotation (Placement(transformation( + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature annotation (Placement(transformation( origin={0,110}, extent={{-10,-10},{10,10}}, rotation=270))); @@ -45,21 +41,19 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; P = C1.P; h = C1.h; - ftype = C1.ftype; /* Computation of the fluid specific enthalpy */ - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, ITemperature.signal, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=ITemperature.signal, X=X); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo new file mode 100644 index 00000000..8e00782c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefT + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, h0=2600e3) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=120 + 273.15) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refT.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C, refT.C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refT.ITemperature) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefT; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo new file mode 100644 index 00000000..061c7084 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefT_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare replaceable package + Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package + Medium = Medium, h0=2600e3, SubC0={10,20,30}) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=120 + 273.15) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refT.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C, refT.C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refT.ITemperature) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefT_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index c11cd786..8be81470 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -4,3 +4,6 @@ TestRefQ_Traces_FlueGases TestRefP TestRefP_Traces TestRefP_Traces_FlueGases +TestRefT +TestRefT_Traces + From a5a447924a0209774c0144bd2825ee0b589e5a34 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 15:39:13 +0200 Subject: [PATCH 099/213] #125 Splitter2 and Mixer2 --- .../SimpleExamples/Junctions/TestMixer2.mo | 26 +++++++++ .../Junctions/TestMixer2_FlueGases.mo | 36 +++++++++++++ .../Junctions/TestMixer2_Traces.mo | 29 ++++++++++ .../SimpleExamples/Junctions/TestSplitter2.mo | 26 +++++++++ .../Junctions/TestSplitter2_FlueGases.mo | 41 ++++++++++++++ .../Junctions/TestSplitter2_Traces.mo | 30 +++++++++++ .../SimpleExamples/Junctions/package.order | 6 +++ ThermoSysPro/Fluid/Junctions/Mixer2.mo | 45 ++++------------ ThermoSysPro/Fluid/Junctions/Splitter2.mo | 54 +++++-------------- 9 files changed, 217 insertions(+), 76 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo new file mode 100644 index 00000000..1c642156 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1 +")); +end TestMixer2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo new file mode 100644 index 00000000..51231454 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo @@ -0,0 +1,36 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium, h(start=2.83057e6)) + annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1 +")); +end TestMixer2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo new file mode 100644 index 00000000..7aabeb2c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1 +")); +end TestMixer2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo new file mode 100644 index 00000000..7558ca29 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(redeclare replaceable package Medium = Medium, Q0=200) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1 +")); +end TestSplitter2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo new file mode 100644 index 00000000..9443b946 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP( + redeclare replaceable package Medium = Medium, + Q0=200, + T0=573.15, + option_temperature=true, + SubC0={3}) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1 +")); +end TestSplitter2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo new file mode 100644 index 00000000..84f56024 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(redeclare replaceable package Medium = Medium, Q0=200, + SubC0={3}) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

      Copyright © EDF 2002 - 2024

      +

      ThermoSysPro Version 4.1 +")); +end TestSplitter2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 0779eefb..08496374 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -1,2 +1,8 @@ TestDryer TestDryer_Traces +TestSplitter2 +TestSplitter2_Traces +TestSplitter2_FlueGases +TestMixer2 +TestMixer2_Traces +TestMixer2_FlueGases diff --git a/ThermoSysPro/Fluid/Junctions/Mixer2.mo b/ThermoSysPro/Fluid/Junctions/Mixer2.mo index 206eeb5f..caeea6c0 100644 --- a/ThermoSysPro/Fluid/Junctions/Mixer2.mo +++ b/ThermoSysPro/Fluid/Junctions/Mixer2.mo @@ -1,32 +1,22 @@ within ThermoSysPro.Fluid.Junctions; model Mixer2 "Mixer with two inlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Real alpha1 "Extraction coefficient for inlet 1 (<=1)"; Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js "Thermal power diffusion from outlet s"; @@ -39,12 +29,11 @@ public Real rs "Value of r(Q/gamma) for outlet s"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-50,-110},{-30,-90}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); -public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-50,90},{-30,110}}, rotation=0))); InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for inlet 1 (<=1)" @@ -53,15 +42,6 @@ public annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "Mixer2: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.5; @@ -82,17 +62,12 @@ equation Cs.h_vol_1 = h; /* Fluid composition balance equations */ - 0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs.Xco2*Cs.Q; - 0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs.Xh2o*Cs.Q; - 0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs.Xo2*Cs.Q; - 0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs.Xso2*Cs.Q; + fill(0,Medium.nXi) = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs.Xi*Cs.Q; - Cs.ftype = ftype; + Cs.Xi = X; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + /* Traces composition balance equations */ + Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC = Cs.Q*Cs.SubC; /* Mass flow at the outlet */ if (cardinality(Ialpha1) <> 0) then @@ -147,7 +122,7 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Junctions/Splitter2.mo b/ThermoSysPro/Fluid/Junctions/Splitter2.mo index 94e4a836..6fb76fa9 100644 --- a/ThermoSysPro/Fluid/Junctions/Splitter2.mo +++ b/ThermoSysPro/Fluid/Junctions/Splitter2.mo @@ -1,32 +1,22 @@ within ThermoSysPro.Fluid.Junctions; model Splitter2 "Splitter with two outlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Real alpha1 "Extraction coefficient for outlet 1 (<=1)"; Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; @@ -39,11 +29,11 @@ public Real rs2 "Value of r(Q/gamma) for outlet s2"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{30,90},{50,110}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0))); InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for outlet 1 (<=1)" @@ -52,15 +42,6 @@ public annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "Splitter2: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.5; @@ -81,23 +62,15 @@ equation Cs2.h_vol_1 = h; /* Fluid composition balance equations */ - 0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - 0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - 0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - 0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; + fill(0,Medium.nXi) = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; - Cs1.ftype = ftype; - Cs2.ftype = ftype; + Cs1.Xi = X; + Cs2.Xi = X; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + /* Traces composition balance equations */ + Cs1.Q*Cs1.SubC + Cs2.Q*Cs2.SubC = Ce.Q*Ce.SubC; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + Cs2.SubC = Cs1.SubC; /* Mass flow at outlet 1 */ if (cardinality(Ialpha1) <> 0) then @@ -154,7 +127,7 @@ equation Cs2.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); annotation ( Diagram(coordinateSystem( @@ -203,6 +176,5 @@ equation

    • Baligh El Hefni
    • Daniel Bouskela
    -"), - DymolaStoredErrors); +")); end Splitter2; From 21d55fd63c13bec4e5acf73e1fa24eb23a32470a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 15:39:50 +0200 Subject: [PATCH 100/213] #125 LoopBreakers, P has its examples --- .../LoopBreakers/TestLoopBreakerP.mo | 43 +++++++++++ .../TestLoopBreakerP_FlueGases.mo | 50 +++++++++++++ .../LoopBreakers/TestLoopBreakerP_Traces.mo | 43 +++++++++++ .../LoopBreakers/TestLoopBreakerQH.mo | 26 +++++++ .../SimpleExamples/LoopBreakers/package.order | 4 ++ .../Fluid/LoopBreakers/LoopBreakerH.mo | 12 ++-- .../Fluid/LoopBreakers/LoopBreakerP.mo | 12 ++-- .../Fluid/LoopBreakers/LoopBreakerQ.mo | 12 ++-- .../Fluid/LoopBreakers/LoopBreakerSubC.mo | 72 +++++++++++++++++++ .../Fluid/LoopBreakers/LoopBreakerXgas.mo | 7 +- ThermoSysPro/Fluid/LoopBreakers/package.order | 1 + 11 files changed, 258 insertions(+), 24 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo create mode 100644 ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo new file mode 100644 index 00000000..76c078a7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); +equation + connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( + points={{-80,10},{-56,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line( + points={{-42,20},{-42,30},{-20,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line( + points={{-42,0},{-42,-10},{-20,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(mixer2_1.Ce1, singularPressureLoss1.C2) annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None)); + connect(mixer2_1.Cs, sink.C) annotation (Line( + points={{60,10},{80,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(constante.y, splitter2_1.Ialpha1) annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=Smooth.None)); + connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line( + points={{0,-10},{10,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line( + points={{30,-10},{46,-10},{46,0}}, + color={0,0,255}, + smooth=Smooth.None)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo new file mode 100644 index 00000000..23e929e3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo @@ -0,0 +1,50 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) + annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) + annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); +equation + connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( + points={{-80,10},{-56,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line( + points={{-42,20},{-42,30},{-20,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line( + points={{-42,0},{-42,-10},{-20,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(mixer2_1.Ce1, singularPressureLoss1.C2) annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None)); + connect(mixer2_1.Cs, sink.C) annotation (Line( + points={{60,10},{80,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(constante.y, splitter2_1.Ialpha1) annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=Smooth.None)); + connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line( + points={{0,-10},{10,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line( + points={{30,-10},{46,-10},{46,0}}, + color={0,0,255}, + smooth=Smooth.None)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo new file mode 100644 index 00000000..e81b1cbf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); +equation + connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( + points={{-80,10},{-56,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line( + points={{-42,20},{-42,30},{-20,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line( + points={{-42,0},{-42,-10},{-20,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(mixer2_1.Ce1, singularPressureLoss1.C2) annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None)); + connect(mixer2_1.Cs, sink.C) annotation (Line( + points={{60,10},{80,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(constante.y, splitter2_1.Ialpha1) annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=Smooth.None)); + connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line( + points={{0,-10},{10,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line( + points={{30,-10},{46,-10},{46,0}}, + color={0,0,255}, + smooth=Smooth.None)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo new file mode 100644 index 00000000..0e65f1ec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerQH + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(loopBreakerH.C2, lumpedStraightPipe.C1) annotation (Line(points={{50,10},{60,10}}, color={0,0,255})); + connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{80,10},{100,10},{100,-20},{10,-20}}, color={0,0,0})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerQH; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order index e69de29b..244c2ab3 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order @@ -0,0 +1,4 @@ +TestLoopBreakerP +TestLoopBreakerP_Traces +TestLoopBreakerP_FlueGases +TestLoopBreakerQH diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo index f52a5c93..2f2cb39f 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo @@ -1,10 +1,11 @@ within ThermoSysPro.Fluid.LoopBreakers; model LoopBreakerH "Specific enthalpy loop breaker" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -20,12 +21,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo index 48f3d3f7..acdd0a52 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo @@ -1,10 +1,11 @@ within ThermoSysPro.Fluid.LoopBreakers; model LoopBreakerP "Pressure loop breaker" +replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -20,12 +21,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo index 8b6bd98a..d2323c44 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo @@ -1,10 +1,11 @@ within ThermoSysPro.Fluid.LoopBreakers; model LoopBreakerQ "Mass flow loop breaker" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -20,12 +21,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo new file mode 100644 index 00000000..8925bb1a --- /dev/null +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo @@ -0,0 +1,72 @@ +within ThermoSysPro.Fluid.LoopBreakers; +model LoopBreakerSubC "Fluid Traces loop breaker" + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); +equation + + C1.Q = C2.Q; + C1.P = C2.P; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-38,38},{42,-42}}, + lineColor={0,0,255}, + textString="C"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-40,38},{40,-42}}, + lineColor={0,0,255}, + textString="C"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +", + revisions=" +

    Authors

    +
      +
    • Baligh El Hefni
    • +
    • Daniel Bouskela
    • +
    +")); +end LoopBreakerSubC; diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo index 38227283..f423b285 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo @@ -1,10 +1,11 @@ within ThermoSysPro.Fluid.LoopBreakers; model LoopBreakerXgas "Fluid composition loop breaker" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -21,7 +22,7 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.SubC = C2.SubC; annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/LoopBreakers/package.order b/ThermoSysPro/Fluid/LoopBreakers/package.order index 4b729fa7..82432aa5 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/package.order +++ b/ThermoSysPro/Fluid/LoopBreakers/package.order @@ -2,3 +2,4 @@ LoopBreakerH LoopBreakerP LoopBreakerQ LoopBreakerXgas +LoopBreakerSubC From 5cd46a00b673f0df01c03f208ebaa308f14498d1 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 16:40:57 +0200 Subject: [PATCH 101/213] #125 Refs and LoopBreakers --- .../Fluid/BoundaryConditions/RefSubC.mo | 95 +++++++++++++++++ .../Fluid/BoundaryConditions/RefXgas.mo | 100 ++---------------- .../Fluid/BoundaryConditions/package.order | 1 + .../TestRefP_Traces_FlueGases.mo | 46 -------- .../BoundaryConditions/TestRefSubC_Traces.mo | 29 +++++ .../BoundaryConditions/TestRefT.mo | 41 +++---- .../BoundaryConditions/TestRefT_Traces.mo | 35 ------ .../BoundaryConditions/TestRefX_FlueGases.mo | 28 +++++ .../BoundaryConditions/package.order | 5 +- .../LoopBreakers/TestLoopBreakerQH.mo | 4 +- .../TestLoopBreakerSubC_Traces.mo | 29 +++++ .../TestLoopBreakerX_FlueGases.mo | 28 +++++ .../SimpleExamples/LoopBreakers/package.order | 2 + 13 files changed, 241 insertions(+), 202 deletions(-) create mode 100644 ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo new file mode 100644 index 00000000..98cef4fa --- /dev/null +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo @@ -0,0 +1,95 @@ +within ThermoSysPro.Fluid.BoundaryConditions; +model RefSubC "Fixed SubC reference" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + + +public + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + +equation + C1.Q = C2.Q; + C1.P = C2.P; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + C1.SubC = SubC0; + + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={128,255,0}), + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "C")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor= {0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "C")}), + Window( + x=0.06, + y=0.08, + width=0.82, + height=0.65), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +", + revisions=" +

    Authors

    +
      +
    • Baligh El Hefni
    • +
    • Daniel Bouskela
    • +
    +")); +end RefSubC; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo index f7a9d6ad..b05ec942 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo @@ -2,57 +2,17 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefXgas "Fixed gas composition" extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter Real Xco2=0.05 "CO2 mass fraction at the outlet"; - parameter Real Xh2o=0.01 "H2O mass fraction at the outlet"; - parameter Real Xo2=0.1 "O2 mass fraction at the outlet"; - parameter Real Xso2=0 "SO2 mas fraction at the outlet"; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nXi] = Medium.X_default[1:Medium.nXi] "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); public - Units.SI.MassFlowRate Q "Fluid mass flow rate"; - Units.SI.AbsolutePressure P "Pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal IXco2 annotation (Placement( - transformation( - origin={-90,110}, - extent={{-10,-10},{10,10}}, - rotation=270))); - InstrumentationAndControl.Connectors.InputReal IXh2o annotation (Placement( - transformation( - origin={-30,110}, - extent={{-10,-10},{10,10}}, - rotation=270))); - InstrumentationAndControl.Connectors.InputReal IXo2 annotation (Placement( - transformation( - origin={30,110}, - extent={{-10,-10},{10,10}}, - rotation=270))); - InstrumentationAndControl.Connectors.InputReal IXso2 annotation (Placement( - transformation( - origin={90,110}, - extent={{-10,-10},{10,10}}, - rotation=270))); equation - if (cardinality(IXco2) == 0) then - IXco2.signal = Xco2; - end if; - - if (cardinality(IXh2o) == 0) then - IXh2o.signal = Xh2o; - end if; - - if (cardinality(IXo2) == 0) then - IXo2.signal = Xo2; - end if; - - if (cardinality(IXso2) == 0) then - IXso2.signal = Xso2; - end if; C1.Q = C2.Q; C1.P = C2.P; @@ -67,21 +27,10 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; - Q = C1.Q; - P = C1.P; - h = C1.h; - - C1.Xco2 = Xco2; - C1.Xso2 = Xso2; - C1.Xh2o = Xh2o; - C1.Xo2 = Xo2; + C1.Xi = X0; annotation ( Diagram(coordinateSystem( @@ -121,36 +70,7 @@ equation fillPattern=FillPattern.Solid, textString="X"), Line(points={{0,100},{0,40}}, color={0,0,255}), - Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), - Rectangle( - extent={{-100,100},{100,90}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Text( - extent={{-100,90},{-80,80}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.None, - textString="CO2"), - Text( - extent={{-40,90},{-20,80}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.None, - textString="H2O"), - Text( - extent={{20,90},{40,80}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.None, - textString="O2"), - Text( - extent={{80,90},{100,80}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.None, - textString="SO2")}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255})}), Window( x=0.06, y=0.08, diff --git a/ThermoSysPro/Fluid/BoundaryConditions/package.order b/ThermoSysPro/Fluid/BoundaryConditions/package.order index 6583266e..fe404a50 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/BoundaryConditions/package.order @@ -6,6 +6,7 @@ RefQ RefH RefT RefXgas +RefSubC SourceP SourceQ SourcePQ diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo deleted file mode 100644 index 9aea64c1..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo +++ /dev/null @@ -1,46 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; -model TestRefP_Traces_FlueGases - extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); - - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( - redeclare package Medium = - Medium, - T0=453.15, - h0=633193.1, - option_temperature=true) - annotation (Placement(transformation(extent={{66,-10},{86,10}}))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( - redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{32,-10},{52,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package - Medium = Medium, - Q0=50, - T0=473.15, - h0=633193.1, - option_temperature=true, SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, - T(start=423.15)) - annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) - annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( - redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-38,-10},{-18,10}}))); -equation - connect(sinkP.C, pipePressureLoss.C2) - annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); - connect(refP.C2, pipePressureLoss.C1) - annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); - - connect(constante.y, refP.IPressure) - annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); - connect(sourceQ.C, singularPressureLoss.C1) - annotation (Line(points={{-46,0},{-38,0}}, color={0,0,0})); - connect(singularPressureLoss.C2, refP.C1) - annotation (Line(points={{-18,0},{-10,0}}, color={0,0,0})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end TestRefP_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo new file mode 100644 index 00000000..a4200c97 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefSubC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefSubC refSubC(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{90,-30},{70,-10}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerSubC loopBreakerSubC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-30},{40,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerSubC.C2) annotation (Line(points={{10,-20},{40,-20}}, color={0,0,0})); + connect(loopBreakerSubC.C1, refSubC.C2) annotation (Line(points={{60,-20},{70,-20}}, color={0,0,0})); + connect(loopBreakerH.C2, refSubC.C1) annotation (Line(points={{50,10},{100,10},{100,-20},{90,-20}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefSubC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo index 8e00782c..b1530cbe 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo @@ -4,30 +4,21 @@ model TestRefT replaceable package Medium = Properties.Media.WaterSteam; - - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{66,-10},{86,10}}))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( - redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{32,-10},{52,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package - Medium = Medium, h0=2600e3) - annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=120 + 273.15) - annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); equation - connect(sink.C, pipePressureLoss.C2) - annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); - connect(refT.C2, pipePressureLoss.C1) - annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); - connect(sourceQ.C, refT.C1) - annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); - connect(constante.y, refT.ITemperature) - annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerH.C2) annotation (Line(points={{10,-20},{100,-20},{100,10},{50,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestRefT; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo deleted file mode 100644 index 061c7084..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT_Traces.mo +++ /dev/null @@ -1,35 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; -model TestRefT_Traces - extends ThermoSysPro.UsersGuide.Icons.Example; - - replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); - - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = - Medium) - annotation (Placement(transformation(extent={{66,-10},{86,10}}))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( - redeclare replaceable package Medium = Medium) - annotation (Placement(transformation(extent={{32,-10},{52,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare replaceable package - Medium = - Medium) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable - package - Medium = Medium, h0=2600e3, SubC0={10,20,30}) - annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=120 + 273.15) - annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); -equation - connect(sink.C, pipePressureLoss.C2) - annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); - connect(refT.C2, pipePressureLoss.C1) - annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); - connect(sourceQ.C, refT.C1) - annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); - connect(constante.y, refT.ITemperature) - annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end TestRefT_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo new file mode 100644 index 00000000..33881c78 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefX_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefXgas refXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{62,0},{82,20}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerXgas loopBreakerXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{64,-30},{44,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(refXgas.C1, loopBreakerH.C2) annotation (Line(points={{62,10},{50,10}}, color={0,0,0})); + connect(volumeA.Ce1, loopBreakerXgas.C2) annotation (Line(points={{10,-20},{44,-20}}, color={0,0,0})); + connect(loopBreakerXgas.C1, refXgas.C2) annotation (Line(points={{64,-20},{100,-20},{100,10},{82,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefX_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index 8be81470..873455cd 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -3,7 +3,6 @@ TestRefQ_Traces TestRefQ_Traces_FlueGases TestRefP TestRefP_Traces -TestRefP_Traces_FlueGases TestRefT -TestRefT_Traces - +TestRefSubC_Traces +TestRefX_FlueGases diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo index 0e65f1ec..c6bf70b7 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo @@ -10,7 +10,6 @@ model TestLoopBreakerQH ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,0},{80,20}}, rotation=0))); ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); equation connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); @@ -18,9 +17,8 @@ equation connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); - connect(loopBreakerH.C2, lumpedStraightPipe.C1) annotation (Line(points={{50,10},{60,10}}, color={0,0,255})); - connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation (Line(points={{80,10},{100,10},{100,-20},{10,-20}}, color={0,0,0})); connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + connect(volumeA.Ce1, loopBreakerH.C2) annotation (Line(points={{10,-20},{100,-20},{100,10},{50,10}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestLoopBreakerQH; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo new file mode 100644 index 00000000..9661a3bf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerSubC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefSubC refSubC(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{90,-30},{70,-10}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerSubC loopBreakerSubC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-30},{40,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerSubC.C2) annotation (Line(points={{10,-20},{40,-20}}, color={0,0,0})); + connect(loopBreakerSubC.C1, refSubC.C2) annotation (Line(points={{60,-20},{70,-20}}, color={0,0,0})); + connect(loopBreakerH.C2, refSubC.C1) annotation (Line(points={{50,10},{100,10},{100,-20},{90,-20}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerSubC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo new file mode 100644 index 00000000..c30188a1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerX_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefXgas refXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{62,0},{82,20}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerXgas loopBreakerXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{64,-30},{44,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(refXgas.C1, loopBreakerH.C2) annotation (Line(points={{62,10},{50,10}}, color={0,0,0})); + connect(volumeA.Ce1, loopBreakerXgas.C2) annotation (Line(points={{10,-20},{44,-20}}, color={0,0,0})); + connect(loopBreakerXgas.C1, refXgas.C2) annotation (Line(points={{64,-20},{100,-20},{100,10},{82,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerX_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order index 244c2ab3..0b1ec3d4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order @@ -2,3 +2,5 @@ TestLoopBreakerP TestLoopBreakerP_Traces TestLoopBreakerP_FlueGases TestLoopBreakerQH +TestLoopBreakerSubC_Traces +TestLoopBreakerX_FlueGases From 3c5cfc83d04f2b4b2646f536297a4762a5e94604 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 18:07:02 +0200 Subject: [PATCH 102/213] #125 An example from RefP had disappeared --- .../TestRefP_Traces_FlueGases.mo | 46 +++++++++++++++++++ .../BoundaryConditions/package.order | 1 + 2 files changed, 47 insertions(+) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo new file mode 100644 index 00000000..9aea64c1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare package Medium = + Medium, + T0=453.15, + h0=633193.1, + option_temperature=true) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + Q0=50, + T0=473.15, + h0=633193.1, + option_temperature=true, SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, + T(start=423.15)) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-38,-10},{-18,10}}))); +equation + connect(sinkP.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + connect(sourceQ.C, singularPressureLoss.C1) + annotation (Line(points={{-46,0},{-38,0}}, color={0,0,0})); + connect(singularPressureLoss.C2, refP.C1) + annotation (Line(points={{-18,0},{-10,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index 873455cd..3e1250f4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -3,6 +3,7 @@ TestRefQ_Traces TestRefQ_Traces_FlueGases TestRefP TestRefP_Traces +TestRefP_Traces_FlueGases TestRefT TestRefSubC_Traces TestRefX_FlueGases From fa6f8d529b8e6660b6ad2108708ebc777d5782e9 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 15:27:10 +0200 Subject: [PATCH 103/213] #125 LumpedStraightPipe for FlueGases --- .../TestLumpedStraightPipe_FlueGases.mo | 20 +++++++++++++++++++ .../PressureLosses/package.order | 3 ++- .../PressureLosses/LumpedStraightPipe.mo | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo new file mode 100644 index 00000000..887abd3c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index 752739f0..0b9b7187 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -9,6 +9,7 @@ TestControlValve_Traces TestControlValve_Traces_FlueGases TestLumpedStraightPipe TestLumpedStraightPipe_Traces +TestLumpedStraightPipe_FlueGases TestDynamicReliefValve TestDynamicReliefValve_FlueGases TestDynamicReliefValve_Traces @@ -32,4 +33,4 @@ TestDynamicCheckValve_FlueGases TestDynamicCheckValve_Traces TestCheckValve TestCheckValve_FlueGases -TestCheckValve_Traces \ No newline at end of file +TestCheckValve_Traces diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index f6b38ab1..fd4d20c3 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -120,12 +120,12 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - state=Medium.setState_phX(p=Pm, h=h, X=X, region=mode); + state=Medium.setState_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = state.d; + rho = Medium.density(state); end if; From 78c4152a73a501d1061d8b2ac99ee058a775d06a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 15:30:11 +0200 Subject: [PATCH 104/213] #125 LumpedStraightPipe no more region --- .../PressureLosses/TestLumpedStraightPipe_FlueGases.mo | 8 +++++--- ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo | 6 +----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo index 887abd3c..ef77553f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo @@ -3,7 +3,9 @@ model TestLumpedStraightPipe_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.FlueGases; - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe + lumpedStraightPipe( + redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare replaceable package Medium = Medium, T0=573.15, @@ -14,7 +16,7 @@ model TestLumpedStraightPipe_FlueGases T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); equation - connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); - connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestLumpedStraightPipe_FlueGases; diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index fd4d20c3..bef2fd57 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -1,11 +1,9 @@ within ThermoSysPro.Fluid.PressureLosses; model LumpedStraightPipe "Lumped straight pipe (circular duct)" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter Units.SI.Length L=10. "Pipe length"; parameter Units.SI.Diameter D=0.2 "Pipe internal hydraulic diameter"; @@ -22,12 +20,10 @@ model LumpedStraightPipe "Lumped straight pipe (circular duct)" "true: momentum balance equation with inertia - false: without inertia"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; parameter Units.SI.Area A=ntubes*pi*D^2/4 "Pipe cross-sectional area (circular duct is assumed)"; From 0360cc060f70da4d9f84785f17d4c9afd97239ca Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 20:45:50 +0200 Subject: [PATCH 105/213] #125 DeheaterMixer2 --- .../Junctions/TestDeheaterMixer2.mo | 46 ++++++++++++++++ .../Junctions/TestDeheaterMixer2_FlueGases.mo | 53 +++++++++++++++++++ .../Junctions/TestDeheaterMixer2_Traces.mo | 48 +++++++++++++++++ .../SimpleExamples/Junctions/package.order | 3 ++ .../Fluid/Junctions/DeheaterMixer2.mo | 49 ++++------------- 5 files changed, 159 insertions(+), 40 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo new file mode 100644 index 00000000..8e92ed16 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, Tmax=308) annotation (Placement(transformation(extent={{-10,-16},{10,4}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, T0=310) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, h0=30000) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}},rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo new file mode 100644 index 00000000..47bc0115 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, + Tmax=308, + h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-16},{10,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, + h0=2.5e6, + option_temperature=false) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}, rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo new file mode 100644 index 00000000..bb783883 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, Tmax=308) annotation (Placement(transformation(extent={{-10,-16},{10,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, T0=310) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, h0=30000) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}, rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 08496374..4c06f9fa 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -6,3 +6,6 @@ TestSplitter2_FlueGases TestMixer2 TestMixer2_Traces TestMixer2_FlueGases +TestDeheaterMixer2 +TestDeheaterMixer2_Traces +TestDeheaterMixer2_FlueGases diff --git a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo index ce58b140..aabce226 100644 --- a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo +++ b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo @@ -1,33 +1,22 @@ within ThermoSysPro.Fluid.Junctions; model DeheaterMixer2 - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Temperature Tmax=700 "Maximum fluid temperature"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.AbsolutePressure P(start=50e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T(start=700) "Fluid temperature"; Units.SI.SpecificEnthalpy hmax(start=10e5) "Maximum fluid specific enthalpy"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Je_mix "Thermal power diffusion from inlet e_mix"; Units.SI.Power Js "Thermal power diffusion from outlet s"; @@ -40,24 +29,11 @@ public Real rs "Value of r(Q/gamma) for outlet s"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_mix annotation ( - Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement( - transformation(extent={{90,50},{110,70}}, rotation=0))); -public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement( - transformation(extent={{-110,50},{-90,70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_mix(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,50},{110,70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Ce_mix.ftype; - fluids[4] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "DeheaterMixer2: fluids mixing in volume are not compatible with each other"); - /* Mass balance equation */ 0 = Ce.Q + Ce_mix.Q - Cs.Q; @@ -80,17 +56,10 @@ equation end if; /* Fluid composition balance equations */ - 0 = Ce.Xco2*Ce.Q + Ce_mix.Xco2*Ce_mix.Q - Cs.Xco2*Cs.Q; - 0 = Ce.Xh2o*Ce.Q + Ce_mix.Xh2o*Ce_mix.Q - Cs.Xh2o*Cs.Q; - 0 = Ce.Xo2*Ce.Q + Ce_mix.Xo2*Ce_mix.Q - Cs.Xo2*Cs.Q; - 0 = Ce.Xso2*Ce.Q + Ce_mix.Xso2*Ce_mix.Q - Cs.Xso2*Cs.Q; - - Cs.ftype = ftype; + Cs.Xi*Cs.Q = Ce.Xi*Ce.Q + Ce_mix.Xi*Ce_mix.Q; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + /* Traces composition balance equations */ + Cs.SubC*Cs.Q = Ce.SubC*Ce.Q + Ce_mix.SubC*Ce_mix.Q; /* Flow reversal */ if continuous_flow_reversal then @@ -137,9 +106,9 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + T = Medium.temperature_phX(P, h, Cs.Xi); - hmax = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, Tmax, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + hmax = Medium.specificEnthalpy_pTX(P, Tmax, Cs.Xi); annotation ( Diagram(coordinateSystem( From 385e69ba0bb0ca162e59ca8529f0a066bab5f612 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 20:59:13 +0200 Subject: [PATCH 106/213] #125 MassFlowMultiplier --- .../Junctions/TestMassFlowMultiplier.mo | 40 +++++++++++++++ .../TestMassFlowMultiplier_FlueGases.mo | 51 +++++++++++++++++++ .../TestMassFlowMultiplier_Traces.mo | 43 ++++++++++++++++ .../SimpleExamples/Junctions/package.order | 3 ++ .../Fluid/Junctions/MassFlowMultiplier.mo | 42 +++------------ 5 files changed, 144 insertions(+), 35 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo new file mode 100644 index 00000000..ac220531 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo @@ -0,0 +1,40 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo new file mode 100644 index 00000000..789689ec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo @@ -0,0 +1,51 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true, + C(h_vol_2(start=2830566))) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium, rho(start=27, displayUnit="kg/m3")) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium, rho(displayUnit="kg/m3", start=27)) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo new file mode 100644 index 00000000..623e1b0e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 4c06f9fa..78c3b431 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -9,3 +9,6 @@ TestMixer2_FlueGases TestDeheaterMixer2 TestDeheaterMixer2_Traces TestDeheaterMixer2_FlueGases +TestMassFlowMultiplier +TestMassFlowMultiplier_Traces +TestMassFlowMultiplier_FlueGases diff --git a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo index a15f17b6..d130ffb3 100644 --- a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo +++ b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo @@ -1,11 +1,7 @@ within ThermoSysPro.Fluid.Junctions; model MassFlowMultiplier "Mass flow multipliier" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real alpha=2 "Flow multiplier"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; @@ -13,24 +9,16 @@ model MassFlowMultiplier "Mass flow multipliier" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; Units.SI.Density rho(start=998) "Fluid density"; - FluidType fluids[3] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js "Thermal power diffusion from outlet s"; Units.SI.Power J "Total thermal power diffusion"; @@ -40,20 +28,12 @@ public Real rs "Value of r(Q/gamma) for outlet s"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "MassFlowMultiplier: fluids mixing in volume are not compatible with each other"); - /* Mass balance equation */ 0 = alpha*Ce.Q - Cs.Q; @@ -67,17 +47,9 @@ equation Cs.h_vol_1 = h; /* Fluid composition */ - 0 = Ce.Xco2*alpha*Ce.Q - Cs.Xco2*Cs.Q; - 0 = Ce.Xh2o*alpha*Ce.Q - Cs.Xh2o*Cs.Q; - 0 = Ce.Xo2*alpha*Ce.Q - Cs.Xo2*Cs.Q; - 0 = Ce.Xso2*alpha*Ce.Q - Cs.Xso2*Cs.Q; - - Cs.ftype = ftype; + Ce.Xi*alpha*Ce.Q = Cs.Xi*Cs.Q; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + Ce.SubC*alpha*Ce.Q = Cs.SubC*Cs.Q; /* Flow reversal */ if continuous_flow_reversal then @@ -116,12 +88,12 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + T = Medium.temperature_phX(P, h, Cs.Xi); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P,h,fluid,mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + rho = Medium.density_phX(P,h,Cs.Xi); end if; annotation ( From 39c9990c120757beee612a361b13a3b8d0b9791f Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 21:16:13 +0200 Subject: [PATCH 107/213] #125 Mixer3 --- .../SimpleExamples/Junctions/TestMixer3.mo | 31 +++++++++ .../Junctions/TestMixer3_FlueGases.mo | 35 ++++++++++ .../Junctions/TestMixer3_Traces.mo | 33 +++++++++ .../SimpleExamples/Junctions/package.order | 3 + ThermoSysPro/Fluid/Junctions/Mixer3.mo | 67 ++++--------------- 5 files changed, 115 insertions(+), 54 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo new file mode 100644 index 00000000..7161949d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-86,-10},{-66,10}},rotation=0))); +equation + connect(singularPressureLoss1.C2,mixer3_1. Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2,mixer3_1. Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y,mixer3_1. Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer3; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo new file mode 100644 index 00000000..ed8b978e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{-86,-10},{-66,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer3_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer3_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer3_1.Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer3_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo new file mode 100644 index 00000000..e0839bec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-10},{-66,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer3_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer3_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer3_1.Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer3_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 78c3b431..82e8d065 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -12,3 +12,6 @@ TestDeheaterMixer2_FlueGases TestMassFlowMultiplier TestMassFlowMultiplier_Traces TestMassFlowMultiplier_FlueGases +TestMixer3 +TestMixer3_Traces +TestMixer3_FlueGases diff --git a/ThermoSysPro/Fluid/Junctions/Mixer3.mo b/ThermoSysPro/Fluid/Junctions/Mixer3.mo index cc6dde0c..185dbf65 100644 --- a/ThermoSysPro/Fluid/Junctions/Mixer3.mo +++ b/ThermoSysPro/Fluid/Junctions/Mixer3.mo @@ -1,21 +1,15 @@ within ThermoSysPro.Fluid.Junctions; model Mixer3 "Mixer with three inlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Real alpha1 "Extraction coefficient for inlet 1 (<=1)"; @@ -23,11 +17,6 @@ public Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[5] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -43,39 +32,16 @@ public Real rs "Value of r(Q/gamma) for outlet s"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( - transformation(extent={{-50,-110},{-30,-90}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement( - transformation(extent={{90,-10},{110,10}}, rotation=0))); -public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( - transformation(extent={{-50,90},{-30,110}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal Ialpha1 - "Extraction coefficient for inlet 1 (<=1)" - annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha1 - annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); -public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (Placement( - transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal Ialpha2 - "Extraction coefficient for inlet 2 (<=1)" - annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, rotation= - 0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha2 - annotation (Placement(transformation(extent={{-20,-70},{0,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-110},{-30,-90}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for inlet 1 (<=1)" annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha2 "Extraction coefficient for inlet 2 (<=1)" annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha2 annotation (Placement(transformation(extent={{-20,-70},{0,-50}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "Mixer3: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.3; @@ -89,6 +55,7 @@ equation 0 = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q; P = Ce1.P; + P = Ce2.P; P = Ce3.P; P = Cs.P; @@ -117,17 +84,9 @@ equation Oalpha2.signal = alpha2; /* Fluid composition balance equations */ - 0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q; - 0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q; - 0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q; - 0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q; - - Cs.ftype = ftype; + Cs.Xi*Cs.Q = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + Cs.SubC*Cs.Q = Ce1.SubC*Ce1.Q + Ce2.SubC*Ce2.Q + Ce3.SubC*Ce3.Q; /* Flow reversal */ if continuous_flow_reversal then @@ -182,7 +141,7 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + T = Medium.temperature_phX(P, h, Cs.Xi); annotation ( Diagram(coordinateSystem( From aa7ca91ce9df4030a71b9aa434829339ecce9f0d Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 21:25:14 +0200 Subject: [PATCH 108/213] #125 Mixer3 --- .../SimpleExamples/Junctions/TestMixer8.mo | 81 ++++++++++++ .../SimpleExamples/Junctions/package.order | 1 + ThermoSysPro/Fluid/Junctions/Mixer8.mo | 117 +++++------------- 3 files changed, 111 insertions(+), 88 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo new file mode 100644 index 00000000..82b21610 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo @@ -0,0 +1,81 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer8 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=2e5, + Q(start=323.48244470861454)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( + redeclare package Medium = Medium, + C1(h_vol_2(start=71016.12237181116)), + C2(h_vol_2(start=70977.89042837733)), + Pm(start=120690.8728732298)) annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve2( + redeclare package Medium = Medium, + C1(h_vol_2(start=70921.01678153824)), + Pm(start=118970.64778985853)) annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve3( + redeclare package Medium = Medium, + Q(start=804.6933031325926), + Pm(start=108776.21727782265)) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{82,-30},{102,-10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2( + Duration=1, + Initialvalue=1, + Finalvalue=0.05) annotation (Placement(transformation(extent={{32,20},{52,40}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3( + Initialvalue=1, + Starttime=2, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4( + Initialvalue=1, + Starttime=1, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=0))); +equation + connect(valve3.C2, puitsP2.C) annotation (Line(points={{70,-20},{82,-20}}, color={0,0,255})); + connect(rampe2.y, valve3.Ouv) annotation (Line(points={{53,30},{60,30},{60,-3}})); + connect(rampe3.y, valve1.Ouv) annotation (Line(points={{-9,40},{0,40},{0,27}})); + connect(rampe4.y, valve2.Ouv) annotation (Line(points={{-9,-20},{0,-20},{0,-33}})); + connect(sourceP.C, pipe1.C1) annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255})); + connect(sourceP1.C, pipe2.C1) annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255})); + connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},{-50,14},{-40.2,14}}, color={0,0,255})); + connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}}, color={0,0,255})); + connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,-20}}, color={0,0,255})); + connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},{33,-9.8}}, color={0,0,255})); + connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,-50},{33,-29.9}}, color={0,0,255})); + connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,-50},{-50,-46},{-40.2,-46}}, color={0,0,255})); + connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,-50}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer8; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 82e8d065..b1e34f40 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -15,3 +15,4 @@ TestMassFlowMultiplier_FlueGases TestMixer3 TestMixer3_Traces TestMixer3_FlueGases +TestMixer8 diff --git a/ThermoSysPro/Fluid/Junctions/Mixer8.mo b/ThermoSysPro/Fluid/Junctions/Mixer8.mo index 43ddc361..dbb347e6 100644 --- a/ThermoSysPro/Fluid/Junctions/Mixer8.mo +++ b/ThermoSysPro/Fluid/Junctions/Mixer8.mo @@ -1,31 +1,19 @@ within ThermoSysPro.Fluid.Junctions; model Mixer8 "Mixer with eight inlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[10] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -56,47 +44,32 @@ public Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce5 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce5(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{-110,-50},{-90,-30}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce6 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce6(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{-112,-109},{-92,-89}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce7 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce7(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{-40,-109},{-20,-89}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{-112,90},{-92,110}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{-40,90},{-20,110}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{20,92},{40,112}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce8 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce8(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{20,-109},{40,-89}}, rotation= 0))); - - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4 annotation (layer= + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (layer= "icon", Placement(transformation(extent={{-112,30},{-92,50}}, rotation= 0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Ce4.ftype; - fluids[6] = Ce5.ftype; - fluids[7] = Ce6.ftype; - fluids[8] = Ce7.ftype; - fluids[9] = Ce8.ftype; - fluids[10] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "Mixer8: fluids mixing in volume are not compatible with each other"); /* Unconnected connectors */ if (cardinality(Ce1) == 0) then @@ -105,11 +78,8 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -118,11 +88,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then @@ -131,11 +98,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Ce4) == 0) then @@ -144,11 +108,8 @@ equation Ce4.h_vol_1 = 1.e5; Ce4.diff_res_1 = 0; Ce4.diff_on_1 = false; - Ce4.ftype = ftype; - Ce4.Xco2 = 0; - Ce4.Xh2o = 0; - Ce4.Xo2 = 0; - Ce4.Xso2 = 0; + Ce4.Xi = Medium.X_default[1:Medium.nXi]; + Ce4.SubC = Medium.C_default; end if; if (cardinality(Ce5) == 0) then @@ -157,11 +118,8 @@ equation Ce5.h_vol_1 = 1.e5; Ce5.diff_res_1 = 0; Ce5.diff_on_1 = false; - Ce5.ftype = ftype; - Ce5.Xco2 = 0; - Ce5.Xh2o = 0; - Ce5.Xo2 = 0; - Ce5.Xso2 = 0; + Ce5.Xi = Medium.X_default[1:Medium.nXi]; + Ce5.SubC = Medium.C_default; end if; if (cardinality(Ce6) == 0) then @@ -170,11 +128,8 @@ equation Ce6.h_vol_1 = 1.e5; Ce6.diff_res_1 = 0; Ce6.diff_on_1 = false; - Ce6.ftype = ftype; - Ce6.Xco2 = 0; - Ce6.Xh2o = 0; - Ce6.Xo2 = 0; - Ce6.Xso2 = 0; + Ce6.Xi = Medium.X_default[1:Medium.nXi]; + Ce6.SubC = Medium.C_default; end if; if (cardinality(Ce7) == 0) then @@ -183,11 +138,8 @@ equation Ce7.h_vol_1 = 1.e5; Ce7.diff_res_1 = 0; Ce7.diff_on_1 = false; - Ce7.ftype = ftype; - Ce7.Xco2 = 0; - Ce7.Xh2o = 0; - Ce7.Xo2 = 0; - Ce7.Xso2 = 0; + Ce7.Xi = Medium.X_default[1:Medium.nXi]; + Ce7.SubC = Medium.C_default; end if; if (cardinality(Ce8) == 0) then @@ -196,11 +148,8 @@ equation Ce8.h_vol_1 = 1.e5; Ce8.diff_res_1 = 0; Ce8.diff_on_1 = false; - Ce8.ftype = ftype; - Ce8.Xco2 = 0; - Ce8.Xh2o = 0; - Ce8.Xo2 = 0; - Ce8.Xso2 = 0; + Ce8.Xi = Medium.X_default[1:Medium.nXi]; + Ce8.SubC = Medium.C_default; end if; if (cardinality(Cs) == 0) then @@ -237,17 +186,9 @@ equation Cs.h_vol_1 = h; /* Fluid composition balance equations */ - 0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q + Ce5.Xco2*Ce5.Q + Ce6.Xco2*Ce6.Q + Ce7.Xco2*Ce7.Q + Ce8.Xco2*Ce8.Q - Cs.Xco2*Cs.Q; - 0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q + Ce5.Xh2o*Ce5.Q + Ce6.Xh2o*Ce6.Q + Ce7.Xh2o*Ce7.Q + Ce8.Xh2o*Ce8.Q - Cs.Xh2o*Cs.Q; - 0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q + Ce5.Xo2*Ce5.Q + Ce6.Xo2*Ce6.Q + Ce7.Xo2*Ce7.Q + Ce8.Xo2*Ce8.Q - Cs.Xo2*Cs.Q; - 0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q + Ce5.Xso2*Ce5.Q + Ce6.Xso2*Ce6.Q + Ce7.Xso2*Ce7.Q + Ce8.Xso2*Ce8.Q - Cs.Xso2*Cs.Q; - - Cs.ftype = ftype; + Cs.Xi*Cs.Q = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q + Ce5.Xi*Ce5.Q + Ce6.Xi*Ce6.Q + Ce7.Xi*Ce7.Q + Ce8.Xi*Ce8.Q; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + Cs.SubC*Cs.Q = Ce1.SubC*Ce1.Q + Ce2.SubC*Ce2.Q + Ce3.SubC*Ce3.Q + Ce4.SubC*Ce4.Q + Ce5.SubC*Ce5.Q + Ce6.SubC*Ce6.Q + Ce7.SubC*Ce7.Q + Ce8.SubC*Ce8.Q; /* Flow reversal */ if continuous_flow_reversal then @@ -342,7 +283,7 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + T = Medium.temperature_phX(P, h, Cs.Xi); annotation ( Diagram(coordinateSystem( From a2d4f6e7503dbec04af3229b9c5f19e20fe321b1 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 21:30:25 +0200 Subject: [PATCH 109/213] #125 Mixer8's examples --- .../SimpleExamples/Junctions/TestMixer8.mo | 21 +++-- .../Junctions/TestMixer8_Traces.mo | 87 +++++++++++++++++++ .../SimpleExamples/Junctions/package.order | 1 + 3 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo index 82b21610..b653f8bb 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo @@ -3,24 +3,27 @@ model TestMixer8 extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(h_vol_2(start=71016.12237181116)), + Q(start=1659.0367844064706)) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( redeclare package Medium = Medium, P0=2e5, - Q(start=323.48244470861454)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); + Q(start=240.90950915749266)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( redeclare package Medium = Medium, - C1(h_vol_2(start=71016.12237181116)), - C2(h_vol_2(start=70977.89042837733)), + C1(h_vol_2(start=71004.06316721764)), + C2(h_vol_1(start=70977.89042837733)), Pm(start=120690.8728732298)) annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve valve2( redeclare package Medium = Medium, - C1(h_vol_2(start=70921.01678153824)), + C1(h_vol_1(start=70921.01678153824)), Pm(start=118970.64778985853)) annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve valve3( redeclare package Medium = Medium, - Q(start=804.6933031325926), - Pm(start=108776.21727782265)) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); + Q(start=1899.9462935639633), + Pm(start=148922.95104974302, displayUnit="bar")) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{82,-30},{102,-10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2( Duration=1, @@ -34,8 +37,8 @@ model TestMixer8 Initialvalue=1, Starttime=1, Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe1(redeclare package Medium = Medium, Pm(start=286222.6050714449, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe2(redeclare package Medium = Medium, Pm(start=199709.4772494724, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo new file mode 100644 index 00000000..c4016de3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo @@ -0,0 +1,87 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer8_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(h_vol_2(start=71016.12237181116)), + Q(start=1659.0367844064706)) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=2e5, + Q(start=240.90950915749266)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( + redeclare package Medium = Medium, + C1(h_vol_2(start=71004.06316721764)), + C2(h_vol_1(start=70977.89042837733)), + Pm(start=120690.8728732298)) annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve2( + redeclare package Medium = Medium, + C1(h_vol_1(start=70921.01678153824)), + Pm(start=118970.64778985853)) annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve3( + redeclare package Medium = Medium, + Q(start=1899.9462935639633), + Pm(start=148922.95104974302, displayUnit="bar")) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{82,-30},{102,-10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2( + Duration=1, + Initialvalue=1, + Finalvalue=0.05) annotation (Placement(transformation(extent={{32,20},{52,40}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3( + Initialvalue=1, + Starttime=2, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4( + Initialvalue=1, + Starttime=1, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe1(redeclare package Medium = Medium, Pm(start=286222.6050714449, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe2(redeclare package Medium = Medium, Pm(start=199709.4772494724, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=0))); +equation + connect(valve3.C2, puitsP2.C) annotation (Line(points={{70,-20},{82,-20}}, color={0,0,255})); + connect(rampe2.y, valve3.Ouv) annotation (Line(points={{53,30},{60,30},{60,-3}})); + connect(rampe3.y, valve1.Ouv) annotation (Line(points={{-9,40},{0,40},{0,27}})); + connect(rampe4.y, valve2.Ouv) annotation (Line(points={{-9,-20},{0,-20},{0,-33}})); + connect(sourceP.C, pipe1.C1) annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255})); + connect(sourceP1.C, pipe2.C1) annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255})); + connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},{-50,14},{-40.2,14}}, color={0,0,255})); + connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}}, color={0,0,255})); + connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,-20}}, color={0,0,255})); + connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},{33,-9.8}}, color={0,0,255})); + connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,-50},{33,-29.9}}, color={0,0,255})); + connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,-50},{-50,-46},{-40.2,-46}}, color={0,0,255})); + connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,-50}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer8_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index b1e34f40..8e271344 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -16,3 +16,4 @@ TestMixer3 TestMixer3_Traces TestMixer3_FlueGases TestMixer8 +TestMixer8_Traces From 8ba766f94f26995ebc63207898f0c788ebd1be87 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 7 Jul 2025 09:59:53 +0200 Subject: [PATCH 110/213] #125 Splitter3 --- .../SimpleExamples/Junctions/TestSplitter3.mo | 35 ++++++++ .../Junctions/TestSplitter3_FlueGases.mo | 41 ++++++++++ .../Junctions/TestSplitter3_Traces.mo | 38 +++++++++ .../SimpleExamples/Junctions/package.order | 3 + ThermoSysPro/Fluid/Junctions/Splitter3.mo | 80 ++++--------------- 5 files changed, 134 insertions(+), 63 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo new file mode 100644 index 00000000..4fec417a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,-50},{64,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0) annotation (Placement(transformation(extent={{-36,10},{-16,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-10},{104,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss3.C1) annotation (Line(points={{-76,0},{-56,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},{-15.8,0}}, color={0,0,255})); + connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},{-2,40},{44,40}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkP2.C) annotation (Line(points={{64,40},{84,40}}, color={0,0,255})); + connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},{-2,-40},{44,-40}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkP3.C) annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255})); + connect(constante1.y, splitter3.Ialpha1) annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}})); + connect(splitter3.Cs3, sinkP4.C) annotation (Line(points={{4,0},{84,0}}, color={0,0,255})); + connect(splitter3.Ialpha2, constante2.y) annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo new file mode 100644 index 00000000..0f66835f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,-50},{64,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0) annotation (Placement(transformation(extent={{-36,10},{-16,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{84,-10},{104,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss3.C1) annotation (Line(points={{-76,0},{-56,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},{-15.8,0}}, color={0,0,255})); + connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},{-2,40},{44,40}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkP2.C) annotation (Line(points={{64,40},{84,40}}, color={0,0,255})); + connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},{-2,-40},{44,-40}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkP3.C) annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255})); + connect(constante1.y, splitter3.Ialpha1) annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}})); + connect(splitter3.Cs3, sinkP4.C) annotation (Line(points={{4,0},{84,0}}, color={0,0,255})); + connect(splitter3.Ialpha2, constante2.y) annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo new file mode 100644 index 00000000..3da13371 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,-50},{64,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0) annotation (Placement(transformation(extent={{-36,10},{-16,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-10},{104,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss3.C1) annotation (Line(points={{-76,0},{-56,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},{-15.8,0}}, color={0,0,255})); + connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},{-2,40},{44,40}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkP2.C) annotation (Line(points={{64,40},{84,40}}, color={0,0,255})); + connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},{-2,-40},{44,-40}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkP3.C) annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255})); + connect(constante1.y, splitter3.Ialpha1) annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}})); + connect(splitter3.Cs3, sinkP4.C) annotation (Line(points={{4,0},{84,0}}, color={0,0,255})); + connect(splitter3.Ialpha2, constante2.y) annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 8e271344..45759fd4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -17,3 +17,6 @@ TestMixer3_Traces TestMixer3_FlueGases TestMixer8 TestMixer8_Traces +TestSplitter3 +TestSplitter3_Traces +TestSplitter3_FlueGases diff --git a/ThermoSysPro/Fluid/Junctions/Splitter3.mo b/ThermoSysPro/Fluid/Junctions/Splitter3.mo index 92009b08..69463ee9 100644 --- a/ThermoSysPro/Fluid/Junctions/Splitter3.mo +++ b/ThermoSysPro/Fluid/Junctions/Splitter3.mo @@ -1,21 +1,15 @@ within ThermoSysPro.Fluid.Junctions; model Splitter3 "Splitter with three outlets" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Real alpha1 "Extraction coefficient for outlet 1 (<=1)"; @@ -23,11 +17,6 @@ public Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[5] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; @@ -43,36 +32,16 @@ public Real rs3 "Value of r(Q/gamma) for outlet s3"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement( - transformation(extent={{-108,-10},{-88,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3 annotation ( - Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( - Placement(transformation(extent={{30,90},{50,110}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( - Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal Ialpha1 - "Extraction coefficient for outlet 1 (<=1)" - annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0))); - InstrumentationAndControl.Connectors.InputReal Ialpha2 - "Extraction coefficient for outlet 2 (<=1)" - annotation (Placement(transformation(extent={{0,-70},{20,-50}}, rotation=0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha1 - annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha2 - annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for outlet 1 (<=1)" annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha2 "Extraction coefficient for outlet 2 (<=1)" annotation (Placement(transformation(extent={{0,-70},{20,-50}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha2 annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - fluids[5] = Cs3.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "Splitter3: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.3; @@ -114,29 +83,14 @@ equation Oalpha2.signal = alpha2; /* Fluid composition balance equations */ - 0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q; - 0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q; - 0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q; - 0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q; - - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + Ce.Xi*Ce.Q = Cs1.Xi*Cs1.Q + Cs2.Xi*Cs2.Q + Cs3.Xi*Cs3.Q; + Cs1.Xi = Cs2.Xi; + Cs1.Xi = Cs3.Xi; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; + /* Traces composition balance equations */ + Ce.SubC*Ce.Q = Cs1.SubC*Cs1.Q + Cs2.SubC*Cs2.Q + Cs3.SubC*Cs3.Q; + Cs1.SubC = Cs2.SubC; + Cs1.SubC = Cs3.SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -195,7 +149,7 @@ equation Cs3.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + T = Medium.temperature_phX(P, h, Ce.Xi); annotation ( Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 100,100}}), graphics={ From 21b74bd08d2deff747e2da0f2508e588902b6d58 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 7 Jul 2025 10:58:02 +0200 Subject: [PATCH 111/213] #125 constrainedby package for Refs --- .../Fluid/BoundaryConditions/PlugA.mo | 9 ++------ .../Fluid/BoundaryConditions/PlugB.mo | 21 ++++++------------- ThermoSysPro/Fluid/BoundaryConditions/RefP.mo | 2 +- ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo | 2 +- .../Fluid/BoundaryConditions/RefSubC.mo | 2 +- ThermoSysPro/Fluid/BoundaryConditions/RefT.mo | 2 +- 6 files changed, 12 insertions(+), 26 deletions(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo index ef826aa9..426c50b4 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo @@ -1,10 +1,7 @@ within ThermoSysPro.Fluid.BoundaryConditions; model PlugA "Plug" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false @@ -16,7 +13,7 @@ public Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -27,8 +24,6 @@ equation C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; - /* Flow reversal */ if continuous_flow_reversal then C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1); diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo index d49ca0de..66fd6803 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo @@ -1,23 +1,17 @@ within ThermoSysPro.Fluid.BoundaryConditions; model PlugB "Plug" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Real Xco2(start=0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start=0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start=0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + Medium.MassFraction X[Medium.nXi] "Fluid mass fraction"; + Medium.ExtraProperty SubC[Medium.nC] "Fluid trace substances"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); equation @@ -29,12 +23,9 @@ equation C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; + SubC = C.SubC; - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; + X = C.Xi; annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo index 2e4128c5..636b8c97 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefP "Fixed pressure reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure"; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo index f6414019..24f40bee 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefQ "Fixed mass flow reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.MassFlowRate Q0=10 "Fixed fluid mass flow"; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo index 98cef4fa..fb3d1752 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefSubC "Fixed SubC reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( tab="Fluid", diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo index 7aeecfc4..59dbaa1c 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefT "Fixed temperature reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; From d76135051af21b2df7408c9f461456a7eb765eb7 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 7 Jul 2025 10:58:22 +0200 Subject: [PATCH 112/213] #125 StaticDrum --- .../Fluid/BoundaryConditions/RefXgas.mo | 2 +- .../Junctions/TestStaticDrum.mo | 28 ++++ .../Junctions/TestStaticDrum_Plug.mo | 53 +++++++ .../Junctions/TestStaticDrum_Plug_Traces.mo | 56 ++++++++ .../Junctions/TestStaticDrum_Traces.mo | 29 ++++ .../SimpleExamples/Junctions/package.order | 4 + ThermoSysPro/Fluid/Junctions/StaticDrum.mo | 131 ++++++------------ 7 files changed, 211 insertions(+), 92 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo index b05ec942..58c289f5 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo @@ -2,7 +2,7 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefXgas "Fixed gas composition" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Medium.ExtraProperty X0[Medium.nXi] = Medium.X_default[1:Medium.nXi] "Source mass fraction" annotation (Dialog( tab="Fluid", group="Medium")); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo new file mode 100644 index 00000000..2714cbae --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(sourcePQ.C, singularPressureLossVALI2.C1) annotation (Line(points={{-70,-80},{-66,-80},{-66,-54},{-84,-54},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo new file mode 100644 index 00000000..ad146428 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Plug + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + W0={2.4e8}, + T0={290}) annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug(redeclare package Medium = Medium, C(h(fixed=true))) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}}, color={0,0,255})); + connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}}, color={0,0,255})); + connect(refP.C2, singularPressureLossVALI2.C1) annotation (Line(points={{-6,-80},{-2,-80},{-2,-56},{-84,-56},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Plug; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo new file mode 100644 index 00000000..5da9e6d3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo @@ -0,0 +1,56 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Plug_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + W0={2.4e8}, + T0={290}) annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug(redeclare package Medium = Medium, C(h(fixed=true))) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}}, color={0,0,255})); + connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}}, color={0,0,255})); + connect(refP.C2, singularPressureLossVALI2.C1) annotation (Line(points={{-6,-80},{-2,-80},{-2,-56},{-84,-56},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Plug_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo new file mode 100644 index 00000000..10270d0f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(sourcePQ.C, singularPressureLossVALI2.C1) annotation (Line(points={{-70,-80},{-66,-80},{-66,-54},{-84,-54},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation (experiment(StopTime=1000), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 45759fd4..712a41f9 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -20,3 +20,7 @@ TestMixer8_Traces TestSplitter3 TestSplitter3_Traces TestSplitter3_FlueGases +TestStaticDrum +TestStaticDrum_Traces +TestStaticDrum_Plug +TestStaticDrum_Plug_Traces diff --git a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo index 8290aaf5..d2fcb382 100644 --- a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo +++ b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo @@ -1,11 +1,7 @@ -within ThermoSysPro.Fluid.Junctions; +within ThermoSysPro.Fluid.Junctions; model StaticDrum "Static drum" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real x=1 "Vapor separation efficiency at the outlet"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; @@ -17,18 +13,14 @@ protected "Water/steam reference specific enthalpy at 0.01°C"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer fluid=Integer(ftype) "Fluid number"; public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start=10.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy hl(start=100000) "Liquid phase specific enthalpy"; Units.SI.SpecificEnthalpy hv(start=2800000) "Gas phase specific enthalpy"; - FluidType fluids[9] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.MassFraction X[Medium.nXi] "Fluid mass fraction"; + Medium.ExtraProperty SubC[Medium.nC] "Fluid trace substances"; Units.SI.Power Je_steam "Thermal power diffusion from inlet e_steam"; Units.SI.Power Je_sup "Thermal power diffusion from inlet e_sup"; Units.SI.Power Je_eva "Thermal power diffusion from inlet e_eva"; @@ -56,43 +48,27 @@ public Real rs_sur "Value of r(Q/gamma) for outlet s_sur"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eva annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eva(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-104,-44},{-84,-24}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eco annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eco(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-50,-104},{-30,-84}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sup annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sup(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{84,24},{104,44}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_eva annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_eva(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{30,-104},{50,-84}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sur annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sur(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{28,84},{48,104}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_purg annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_purg(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{84,-44},{104,-24}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_steam annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_steam(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-48,84},{-28,104}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_sup annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_sup(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-104,26},{-84,46}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-104,66},{-78,98}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation(extent={{72,68},{100,100}}, rotation=0))); Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); -equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce_steam.ftype; - fluids[3] = Ce_sup.ftype; - fluids[4] = Ce_eva.ftype; - fluids[5] = Ce_eco.ftype; - fluids[6] = Cs_eva.ftype; - fluids[7] = Cs_purg.ftype; - fluids[8] = Cs_sup.ftype; - fluids[9] = Cs_sur.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticDrum: fluids mixing in volume are not compatible with each other"); + Medium.SaturationProperties sat; +equation /* Unconnected connectors */ /* Steam input */ @@ -102,11 +78,8 @@ equation Ce_steam.h_vol_1 = 1.e5; Ce_steam.diff_res_1 = 0; Ce_steam.diff_on_1 = false; - Ce_steam.ftype = ftype; - Ce_steam.Xco2 = 0; - Ce_steam.Xh2o = 0; - Ce_steam.Xo2 = 0; - Ce_steam.Xso2 = 0; + Ce_steam.Xi = Medium.X_default[1:Medium.nXi]; + Ce_steam.SubC = Medium.C_default; end if; /* Extra input */ @@ -116,11 +89,8 @@ equation Ce_sup.h_vol_1 = 1.e5; Ce_sup.diff_res_1 = 0; Ce_sup.diff_on_1 = false; - Ce_sup.ftype = ftype; - Ce_sup.Xco2 = 0; - Ce_sup.Xh2o = 0; - Ce_sup.Xo2 = 0; - Ce_sup.Xso2 = 0; + Ce_sup.Xi = Medium.X_default[1:Medium.nXi]; + Ce_sup.SubC = Medium.C_default; end if; /* Input from evaporator */ @@ -130,11 +100,8 @@ equation Ce_eva.h_vol_1 = 1.e5; Ce_eva.diff_res_1 = 0; Ce_eva.diff_on_1 = false; - Ce_eva.ftype = ftype; - Ce_eva.Xco2 = 0; - Ce_eva.Xh2o = 0; - Ce_eva.Xo2 = 0; - Ce_eva.Xso2 = 0; + Ce_eva.Xi = Medium.X_default[1:Medium.nXi]; + Ce_eva.SubC = Medium.C_default; end if; /* Input from the economizer */ @@ -144,11 +111,8 @@ equation Ce_eco.h_vol_1 = 1.e5; Ce_eco.diff_res_1 = 0; Ce_eco.diff_on_1 = false; - Ce_eco.ftype = ftype; - Ce_eco.Xco2 = 0; - Ce_eco.Xh2o = 0; - Ce_eco.Xo2 = 0; - Ce_eco.Xso2 = 0; + Ce_eco.Xi = Medium.X_default[1:Medium.nXi]; + Ce_eco.SubC = Medium.C_default; end if; /* Output to the evaporator */ @@ -210,35 +174,20 @@ equation Cs_sur.h_vol_1 = (1 - x)*hl + x*hv; /* Fluid composition balance equations */ - 0 = Ce_steam.Xco2*Ce_steam.Q + Ce_sup.Xco2*Ce_sup.Q + Ce_eva.Xco2*Ce_eva.Q + Ce_eco.Xco2*Ce_eco.Q - Cs_sur.Xco2*Cs_sur.Q - Cs_sup.Xco2*Cs_sup.Q - Cs_purg.Xco2*Cs_purg.Q - Cs_eva.Xco2*Cs_eva.Q; - 0 = Ce_steam.Xh2o*Ce_steam.Q + Ce_sup.Xh2o*Ce_sup.Q + Ce_eva.Xh2o*Ce_eva.Q + Ce_eco.Xh2o*Ce_eco.Q - Cs_sur.Xh2o*Cs_sur.Q - Cs_sup.Xh2o*Cs_sup.Q - Cs_purg.Xh2o*Cs_purg.Q - Cs_eva.Xh2o*Cs_eva.Q; - 0 = Ce_steam.Xo2*Ce_steam.Q + Ce_sup.Xo2*Ce_sup.Q + Ce_eva.Xo2*Ce_eva.Q + Ce_eco.Xo2*Ce_eco.Q - Cs_sur.Xo2*Cs_sur.Q - Cs_sup.Xo2*Cs_sup.Q - Cs_purg.Xo2*Cs_purg.Q - Cs_eva.Xo2*Cs_eva.Q; - 0 = Ce_steam.Xso2*Ce_steam.Q + Ce_sup.Xso2*Ce_sup.Q + Ce_eva.Xso2*Ce_eva.Q + Ce_eco.Xso2*Ce_eco.Q - Cs_sur.Xso2*Cs_sur.Q - Cs_sup.Xso2*Cs_sup.Q - Cs_purg.Xso2*Cs_purg.Q - Cs_eva.Xso2*Cs_eva.Q; - - Cs_eva.ftype = ftype; - Cs_purg.ftype = ftype; - Cs_sup.ftype = ftype; - Cs_sur.ftype = ftype; - - Xco2 = Cs_eva.Xco2; - Xh2o = Cs_eva.Xh2o; - Xo2 = Cs_eva.Xo2; - Xso2 = Cs_eva.Xso2; - - Xco2 = Cs_purg.Xco2; - Xh2o = Cs_purg.Xh2o; - Xo2 = Cs_purg.Xo2; - Xso2 = Cs_purg.Xso2; - - Xco2 = Cs_sup.Xco2; - Xh2o = Cs_sup.Xh2o; - Xo2 = Cs_sup.Xo2; - Xso2 = Cs_sup.Xso2; - - Xco2 = Cs_sur.Xco2; - Xh2o = Cs_sur.Xh2o; - Xo2 = Cs_sur.Xo2; - Xso2 = Cs_sur.Xso2; + fill(0,Medium.nXi) = Ce_steam.Xi*Ce_steam.Q + Ce_sup.Xi*Ce_sup.Q + Ce_eva.Xi*Ce_eva.Q + Ce_eco.Xi*Ce_eco.Q - Cs_sur.Xi*Cs_sur.Q - Cs_sup.Xi*Cs_sup.Q - Cs_purg.Xi*Cs_purg.Q - Cs_eva.Xi*Cs_eva.Q; + + X = Cs_eva.Xi; + X = Cs_purg.Xi; + X = Cs_sup.Xi; + X = Cs_sur.Xi; + + /* Traces composition balance equations */ + fill(0, Medium.nC) = Ce_steam.SubC*Ce_steam.Q + Ce_sup.SubC*Ce_sup.Q + Ce_eva.SubC*Ce_eva.Q + Ce_eco.SubC*Ce_eco.Q - Cs_sur.SubC*Cs_sur.Q - Cs_sup.SubC*Cs_sup.Q - Cs_purg.SubC*Cs_purg.Q - Cs_eva.SubC*Cs_eva.Q; + + SubC = Cs_eva.SubC; + SubC = Cs_purg.SubC; + SubC = Cs_sup.SubC; + SubC = Cs_sur.SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -331,11 +280,11 @@ equation Cs_sur.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); + sat = Medium.setSat_p(P); - hl = lsat.h; - hv = vsat.h; - T = lsat.T; + hl = Medium.bubbleEnthalpy(sat); + hv = Medium.dewEnthalpy(sat); + T = sat.Tsat; Cth.T = T; From a68699e8e0f57a0aa7ecbc23a495c3006c5c262f Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Mon, 7 Jul 2025 14:11:11 +0200 Subject: [PATCH 113/213] Modified some values in examples --- .../SimpleExamples/Junctions/TestMixer2.mo | 12 +++++++---- .../Junctions/TestMixer2_FlueGases.mo | 12 +++++++---- .../Junctions/TestMixer2_Traces.mo | 17 ++++++++++------ .../TestLoopBreakerP_FlueGases.mo | 20 ++++++++++++------- .../LoopBreakers/TestLoopBreakerP_Traces.mo | 18 +++++++++++------ 5 files changed, 52 insertions(+), 27 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo index 1c642156..03a1bcd1 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo @@ -4,13 +4,17 @@ model TestMixer2 replaceable package Medium = Properties.Media.WaterSteam; ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) + annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); equation connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo index 51231454..6cf34b74 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo @@ -8,9 +8,12 @@ model TestMixer2_FlueGases C_default={0.2}); ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); @@ -20,7 +23,8 @@ model TestMixer2_FlueGases ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) + annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); equation connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo index 7aabeb2c..d9c40f25 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo @@ -7,13 +7,18 @@ model TestMixer2_Traces C_nominal={0.1}, C_default={0.2}); ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare + package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, SubC0={10}) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package + Medium = Medium, SubC0={20}) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) + annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); equation connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo index 23e929e3..f4d82256 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo @@ -3,21 +3,27 @@ model TestLoopBreakerP_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.FlueGases (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) + option_temperature=true, SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable + package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium, + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); equation connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( points={{-80,10},{-56,10}}, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo index e81b1cbf..63f4c425 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo @@ -3,14 +3,20 @@ model TestLoopBreakerP_Traces extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); equation connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( points={{-80,10},{-56,10}}, From 57d9731ea3b90fd5f05ea4567e29520ae0fac052 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 7 Jul 2025 15:22:33 +0200 Subject: [PATCH 114/213] #125 Reformat --- .../SimpleExamples/Junctions/TestMixer2.mo | 12 +++---- .../Junctions/TestMixer2_FlueGases.mo | 30 ++++++++-------- .../Junctions/TestMixer2_Traces.mo | 15 +++----- .../TestLoopBreakerP_FlueGases.mo | 34 +++++++++---------- .../LoopBreakers/TestLoopBreakerP_Traces.mo | 23 ++++++------- 5 files changed, 49 insertions(+), 65 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo index 03a1bcd1..88646025 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo @@ -4,17 +4,13 @@ model TestMixer2 replaceable package Medium = Properties.Media.WaterSteam; ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) - annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); equation connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo index 6cf34b74..a89f075e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo @@ -6,25 +6,23 @@ model TestMixer2_FlueGases extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium, h(start=2.83057e6)) - annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP( + redeclare package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, + option_temperature=true) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, P0=4500000, - T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, + T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP( + redeclare package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) - annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + option_temperature=true) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); equation connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo index d9c40f25..108d702f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo @@ -7,18 +7,13 @@ model TestMixer2_Traces C_nominal={0.1}, C_default={0.2}); ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare - package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, SubC0={10}) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package - Medium = Medium, SubC0={20}) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, SubC0={20}) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) - annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); equation connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo index f4d82256..33e8eb00 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo @@ -2,28 +2,26 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; model TestLoopBreakerP_FlueGases extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = Properties.Media.FlueGases (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, P0=4500000, T0=573.15, - option_temperature=true, SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable - package Medium = Medium, h(start=2.83057e6)) - annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) - annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium, + option_temperature=true, + SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, T0=573.15, - option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); equation connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( points={{-80,10},{-56,10}}, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo index 63f4c425..3a67cdb0 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo @@ -2,21 +2,18 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; model TestLoopBreakerP_Traces extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare - replaceable package Medium = Medium, SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable - package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package - Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare - replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); equation connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( points={{-80,10},{-56,10}}, From b432fc3bf3f1bd496edd790adc0b2f3ea159ac4a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 15:08:10 +0200 Subject: [PATCH 115/213] #125 StaticExchangerKS --- .../HeatExchangers/TestStaticExchangerKS.mo | 28 ++++++++ .../TestStaticExchangerKS_Traces.mo | 34 ++++++++++ .../HeatExchangers/package.order | 2 + .../Fluid/HeatExchangers/StaticExchangerKS.mo | 68 ++++++++----------- 4 files changed, 92 insertions(+), 40 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo new file mode 100644 index 00000000..19074313 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerKS + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS staticExchangerKS( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + K=100, + S=10, + exchanger_conf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePc.C, staticExchangerKS.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,51}}, color={0,0,255})); + connect(sourcePf.C, staticExchangerKS.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(staticExchangerKS.Sc, sinkPc.C) annotation (Line(points={{0,51},{20,51},{20,54},{40,54}}, color={0,0,255})); + connect(staticExchangerKS.Sf, sinkPf.C) annotation (Line(points={{0,57},{6,57},{6,34},{20,34}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerKS; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo new file mode 100644 index 00000000..be41268e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerKS_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS staticExchangerKS( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + K=100, + S=10, + exchanger_conf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePc.C, staticExchangerKS.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,51}}, color={0,0,255})); + connect(sourcePf.C, staticExchangerKS.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(staticExchangerKS.Sc, sinkPc.C) annotation (Line(points={{0,51},{20,51},{20,54},{40,54}}, color={0,0,255})); + connect(staticExchangerKS.Sf, sinkPf.C) annotation (Line(points={{0,57},{6,57},{6,34},{20,34}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerKS_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 2cd052a4..5fde87f5 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -1,3 +1,5 @@ TestDynamicOnePhaseFlowPipe TestDynamicOnePhaseFlowPipe_Traces TestDynamicOnePhaseFlowPipe_FlueGases +TestStaticExchangerKS +TestStaticExchangerKS_Traces diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo index 6dc0f49e..9854ece7 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model StaticExchangerKS "Static heat exchanger with fixed K and S (Coefficient of heat transfer and Heat exchanger surface)" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.CoefficientOfHeatTransfer K=100 "Global heat exchange coefficient"; parameter Units.SI.Area S=10 "Heat exchange surface"; @@ -20,13 +20,9 @@ model StaticExchangerKS "Static heat exchanger with fixed K and S (Coefficient o parameter Units.SI.Density p_rhof=0 "If > 0, fixed fluid density for the cold fluid" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; public @@ -49,22 +45,22 @@ public Units.SI.Density rhof(start=998) "Cold fluid density"; Units.SI.MassFlowRate Qc(start=100) "Mass flow rate of the hot fluid"; Units.SI.MassFlowRate Qf(start=100) "Mass flow rate of the cold fluid"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_c "Thermodynamic state of the hot fluid"; + Medium_f.ThermodynamicState state_f "Thermodynamic state of the cold fluid"; Real Kcor "Corrective term for the global heat exchange coefficient"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid"; - Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{90,-40},{110,-20}}, rotation=0), iconTransformation(extent={ {90,-40},{110,-20}}))); - Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{-110,-40},{-90,-20}}, rotation=0), iconTransformation(extent= {{-110,-40},{-90,-20}}))); - Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{-110,20},{-90,40}}, rotation=0), iconTransformation(extent={ {-110,20},{-90,40}}))); - Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{90,20},{110,40}}, rotation=0), iconTransformation(extent={{ 90,20},{110,40}}))); InstrumentationAndControl.Connectors.InputReal Kcorr "K_correction" @@ -92,14 +88,8 @@ equation Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - - ftype_c = Ec.ftype; + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; Ef.Q = Sf.Q; @@ -112,17 +102,13 @@ equation Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - - ftype_f = Ef.ftype; + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; Qc = Ec.Q; Qf = Ef.Q; + Xc = Ec.Xi; + Xf = Ef.Xi; /* Presure losses */ Ec.P - Sc.P = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc; @@ -149,30 +135,32 @@ equation W = Qc*(Ec.h-Sc.h); W = Qf*(Sf.h - Ef.h); - /* Fluid specific enthalpy at the inlet */ - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + /* Cold fluid temperatures */ + Tef = Medium_f.temperature_phX(p=Ef.P, h=Ef.h, X=Xf); + Tsf = Medium_f.temperature_phX(p=Sf.P, h=Sf.h, X=Xf); - /* Fluid specific enthalpy at the outlet */ - Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); - Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + /* Hot fluid temperatures */ + Tec = Medium_c.temperature_phX(p=Ec.P, h=Ec.h, X=Xc); + Tsc = Medium_c.temperature_phX(p=Sc.P, h=Sc.h, X=Xc); /* Specific heat capacities */ - Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); - Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + state_f = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_c = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + Cpf = Medium_f.specificHeatCapacityCp(state_f); + Cpc = Medium_c.specificHeatCapacityCp(state_c); /* Hot fluid density */ if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2,(Ec.h + Sc.h)/2, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + rhoc = Medium_c.density_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc); end if; /* Cold fluid density */ if (p_rhof > 0) then rhof = p_rhof; else - rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P+Sf.P)/2,(Ef.h + Sf.h)/2, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + rhof = Medium_f.density_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf); end if; annotation ( From d767a9ee104180468f203065a947c26a31db270c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 15:37:19 +0200 Subject: [PATCH 116/213] #125 StaticPlateHeatExchanger --- .../TestStaticPlateHeatExchanger.mo | 38 ++++++ .../TestStaticPlateHeatExchanger_FlueGases.mo | 57 +++++++++ .../TestStaticPlateHeatExchanger_Traces.mo | 44 +++++++ .../HeatExchangers/package.order | 3 + .../StaticPlateHeatExchanger.mo | 115 +++++++----------- .../Properties/Media/WaterSteam/package.mo | 4 +- 6 files changed, 187 insertions(+), 74 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo new file mode 100644 index 00000000..ac3044f3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Ec(P(start=300000), h(start=280e3)), + Sc(P(start=100000), h(start=250e3), Q(start=1000)), + Ef(P(start=300000), h(start=70e3), Q(start=1000)), + Sf(P(start=100000), h(start=200e3)), + Tec(start=340), + Tsc(start=330), + Tef(start=290), + Tsf(start=320), + Tmc(start=335), + Tmf(start=305), + Hmc(start=270e3), + Hmf(start=140e3)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..b94ad1bd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_c = Properties.Media.FlueGases; + replaceable package Medium_f = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium_c, + redeclare package Medium_f = Medium_f, + Sp=2, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_hc=100, + p_hf=100, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=4450000), h(start=2879115.64844), Q(start=117275.047014), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=300000), h(start=2879115.64844), Q(start=49585.430645), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=100000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Tec(start=573.15), + Tsc(start=573.15), + Tef(start=573.15), + Tsf(start=573.15), + Tmc(start=573.15), + Tmf(start=573.15), + Hmc(start=2879115.64844), + Hmf(start=2879115.64844)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium_c, + P0=4500000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium_f, + P0=300000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium_c, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium_f, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo new file mode 100644 index 00000000..32cd71d4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo @@ -0,0 +1,44 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Ec(P(start=300000), h(start=280e3)), + Sc(P(start=100000), h(start=250e3), Q(start=1000)), + Ef(P(start=300000), h(start=70e3), Q(start=1000)), + Sf(P(start=100000), h(start=200e3)), + Tec(start=340), + Tsc(start=330), + Tef(start=290), + Tsf(start=320), + Tmc(start=335), + Tmf(start=305), + Hmc(start=270e3), + Hmf(start=140e3)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 5fde87f5..7ac2d229 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -3,3 +3,6 @@ TestDynamicOnePhaseFlowPipe_Traces TestDynamicOnePhaseFlowPipe_FlueGases TestStaticExchangerKS TestStaticExchangerKS_Traces +TestStaticPlateHeatExchanger +TestStaticPlateHeatExchanger_Traces +TestStaticPlateHeatExchanger_FlueGases diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo index 4b15b7d3..578799c8 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model StaticPlateHeatExchanger "Static plate heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.ThermalConductivity lambdam=15.0 "Metal thermal conductivity"; parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000 @@ -29,12 +29,6 @@ model StaticPlateHeatExchanger "Static plate heat exchanger" parameter Units.SI.Density p_rhof=0 "If > 0, fixed fluid density for the cold fluid" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - -protected - parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Power W "Thermal power exchanged between the two sides"; @@ -82,37 +76,24 @@ public "Hot fluid average specific enthalpy"; Units.SI.SpecificEnthalpy Hmf(start=100000) "Cold fluid average specific enthalpy"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_c "Average thermodynamic state of the hot fluid"; + Medium_f.ThermodynamicState state_f "Average thermodynamic state of the cold fluid"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; public - Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{-60,-70},{-40,-50}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{40,-70},{60,-50}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{90,-8},{110,12}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs - annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe - annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs - annotation (Placement(transformation(extent={{-20,-100},{0,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); equation /* Mass flow rates */ @@ -127,14 +108,8 @@ equation Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - - ftype_c = Ec.ftype; + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; Ef.Q = Sf.Q; @@ -147,17 +122,13 @@ equation Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - - ftype_f = Ef.ftype; + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; Qc = Ec.Q; Qf = Ef.Q; + Xc = Ec.Xi; + Xf = Ef.Xi; /* Pressures */ Sc.P = if Qc > 0 then Ec.P - DPc else Ec.P + DPc; @@ -168,13 +139,13 @@ equation W = K*S*DTm; if (abs(Qc) > 1.e-3) then - W = Qc*proc.cp*(Tec - Tsc); + W = Qc*Medium_c.specificHeatCapacityCp(state_c)*(Tec - Tsc); else Tec = Tsc; end if; if (abs(Qf) > 1.e-3) then - W = Qf*prof.cp*(Tsf - Tef); + W = Qf*Medium_f.specificHeatCapacityCp(state_f)*(Tsf - Tef); else Tef = Tsf; end if; @@ -214,8 +185,8 @@ equation hc = p_hc; hf = p_hf; elseif (heat_exchange_correlation == 1) then - hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*proc.cp/lambdac)^0.4*lambdac); - hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*prof.cp/lambdaf)^0.4*lambdaf); + hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*Medium_c.specificHeatCapacityCp(state_c)/lambdac)^0.4*lambdac); + hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*Medium_f.specificHeatCapacityCp(state_f)/lambdaf)^0.4*lambdaf); else hc = 0; hf = 0; @@ -245,41 +216,41 @@ equation Hmc = (Ec.h + Sc.h)/2; Hmf = (Ef.h + Sf.h)/2; - proc = ThermoSysPro.Properties.Fluid.Ph(Pmc, Hmc, mode_c, fluid_c); - prof = ThermoSysPro.Properties.Fluid.Ph(Pmf, Hmf, mode_f, fluid_f); + state_c = Medium_c.setState_phX(p=Pmc, h=Hmc, X=Xc); + state_f = Medium_f.setState_phX(p=Pmf, h=Hmf, X=Xf); - Tmc = proc.T; - Tmf = prof.T; + Tmc = Medium_c.temperature(state_c); + Tmf = Medium_f.temperature(state_f); if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = proc.d; + rhoc = Medium_c.density(state_c); end if; if (p_rhof > 0) then rhof = p_rhof; else - rhof = prof.d; + rhof = Medium_f.density(state_f); end if; - muc = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhoc, Tmc, fluid_c); - muf = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhof, Tmf, fluid_f); + muc = Medium_c.dynamicViscosity(state_c); + muf = Medium_f.dynamicViscosity(state_f); - lambdac = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc, Tmc, Pmc, 0, fluid_c); - lambdaf = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof, Tmf, Pmf, 0, fluid_f); + lambdac = Medium_c.thermalConductivity(state_c); + lambdaf = Medium_f.thermalConductivity(state_f); - /* Calcul des températures en entrée et en sortie de l'échangeur */ - proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c); - procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_f); + /* Fluid temperatures at the inlet and outlet of the exchanger */ + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); - profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_c); - profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f); + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); - Tec = proce.T; - Tsc = procs.T; - Tef = profe.T; - Tsf = profs.T; + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); + Tef = Medium_f.temperature(state_fe); + Tsf = Medium_f.temperature(state_fs); annotation ( Icon(coordinateSystem( diff --git a/ThermoSysPro/Properties/Media/WaterSteam/package.mo b/ThermoSysPro/Properties/Media/WaterSteam/package.mo index 12e82bc9..31a51406 100644 --- a/ThermoSysPro/Properties/Media/WaterSteam/package.mo +++ b/ThermoSysPro/Properties/Media/WaterSteam/package.mo @@ -114,11 +114,11 @@ package WaterSteam "1 - Water/steam properties library (IAPWS-IF97)" d=density_ph( p, h, - region=Region), + region=region), T=temperature_ph( p, h, - region=Region), + region=region), phase=if region == 0 then 0 else if region==4 then 2 else 1, h=h, p=p); From 5c83340ee535ac2c65c8aeeca6fed2ed4b7ddd79 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 16:02:59 +0200 Subject: [PATCH 117/213] #125 SimpleDynamicCondenser --- .../TestSimpleDynamicCondenser.mo | 65 +++++++++ .../TestSimpleDynamicCondenser_Traces.mo | 70 +++++++++ .../HeatExchangers/package.order | 2 + .../HeatExchangers/SimpleDynamicCondenser.mo | 134 +++++++----------- 4 files changed, 189 insertions(+), 82 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo new file mode 100644 index 00000000..4b33034f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo @@ -0,0 +1,65 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleDynamicCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, + P0=1e5, + option_temperature=false) annotation (Placement(transformation(extent={{48,30},{88,70}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( + redeclare package Medium = Medium, + K=1e-6, + Q(start=0.598447)) annotation (Placement(transformation(origin={-90,-38}, extent={{-10,-10},{10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( + redeclare package Medium = Medium, + option_temperature=false, + h0=2401e3, + P0=15050) annotation (Placement(transformation(extent={{-207,148},{-183,170}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( + redeclare package Medium = Medium, + h0=191812, + Q0=192) annotation (Placement(transformation(extent={{-184,-52},{-208,-24}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( + redeclare package Medium = Medium, + Q0=29804.5, + h0=113e3) annotation (Placement(transformation(extent={{-212,30},{-172,68}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( + redeclare package Medium = Medium, + K=1e-6) annotation (Placement(transformation(origin={36,50}, extent={{6,-10},{-6,10}}, rotation=180))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( + redeclare package Medium = Medium, + K=1e-6) annotation (Placement(transformation(origin={-154,49}, extent={{6,-10},{-6,10}}, rotation=180))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3( + redeclare package Medium = Medium, + K(fixed=false)=1e-3, + Q(start=192, fixed=true)) + annotation (Placement(transformation(origin={-120,159}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + D=0.018, + V=1000, + A=100, + lambda=0.01, + ntubes=28700, + continuous_flow_reversal=true, + yNiveau(signal(fixed=false, start=1.5)), + Vf0=0.15, + steady_state=false, + P(fixed=false, start=10000)) annotation (Placement(transformation(extent={{-118,6},{1,116}}, rotation=0))); +equation + connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(points={{-172,49},{-160,49}}, color={0,0,255})); + connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(points={{42,50},{48,50}}, color={0,0,255})); + connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(points={{-183,159},{-130,159}}, color={0,0,255})); + connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation (Line(points={{-184,-38},{-100,-38}})); + connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{-148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255})); + connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}})); + connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{-110,159},{-58.5,159},{-58.5,116}}, color={0,0,255})); + connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-250,-60},{130,180}}))); +end TestSimpleDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo new file mode 100644 index 00000000..8846a345 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo @@ -0,0 +1,70 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleDynamicCondenser_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}); + + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, + P0=1e5, + option_temperature=false) annotation (Placement(transformation(extent={{48,30},{88,70}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( + redeclare package Medium = Medium, + K=1e-6, + Q(start=0.598447)) annotation (Placement(transformation(origin={-90,-38}, extent={{-10,-10},{10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( + redeclare package Medium = Medium, + option_temperature=false, + h0=2401e3, + P0=15050, + SubC0={10,20}) annotation (Placement(transformation(extent={{-207,148},{-183,170}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( + redeclare package Medium = Medium, + h0=191812, + Q0=192) annotation (Placement(transformation(extent={{-184,-52},{-208,-24}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( + redeclare package Medium = Medium, + Q0=29804.5, + h0=113e3, + SubC0={10,20}) annotation (Placement(transformation(extent={{-212,30},{-172,68}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( + redeclare package Medium = Medium, + K=1e-6) annotation (Placement(transformation(origin={36,50}, extent={{6,-10},{-6,10}}, rotation=180))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( + redeclare package Medium = Medium, + K=1e-6) annotation (Placement(transformation(origin={-154,49}, extent={{6,-10},{-6,10}}, rotation=180))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3( + redeclare package Medium = Medium, + K(fixed=false)=1e-3, + Q(start=192, fixed=true)) + annotation (Placement(transformation(origin={-120,159}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + D=0.018, + V=1000, + A=100, + lambda=0.01, + ntubes=28700, + continuous_flow_reversal=true, + yNiveau(signal(fixed=false, start=1.5)), + Vf0=0.15, + steady_state=false, + P(fixed=false, start=10000)) annotation (Placement(transformation(extent={{-118,6},{1,116}}, rotation=0))); +equation + connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(points={{-172,49},{-160,49}}, color={0,0,255})); + connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(points={{42,50},{48,50}}, color={0,0,255})); + connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(points={{-183,159},{-130,159}}, color={0,0,255})); + connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation (Line(points={{-184,-38},{-100,-38}})); + connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{-148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255})); + connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}})); + connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{-110,159},{-58.5,159},{-58.5,116}}, color={0,0,255})); + connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-250,-60},{130,180}}))); +end TestSimpleDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 7ac2d229..62b11eb0 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -6,3 +6,5 @@ TestStaticExchangerKS_Traces TestStaticPlateHeatExchanger TestStaticPlateHeatExchanger_Traces TestStaticPlateHeatExchanger_FlueGases +TestSimpleDynamicCondenser +TestSimpleDynamicCondenser_Traces diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo index 43bf0d62..809e9dac 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model SimpleDynamicCondenser "Simple dynamic condenser" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.WaterSteam "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.WaterSteam "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; @@ -35,13 +34,10 @@ model SimpleDynamicCondenser "Simple dynamic condenser" steady_state)); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region for the pipes (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer fluid_c=Integer(ftype) "Fluid number in the cavity"; - parameter Integer mode=Integer(region) - 1 "IF97 region for the pipes. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; @@ -102,37 +98,25 @@ public Real rl "Value of r(Q/gamma) for outlet Cl"; Units.SI.MassFlowRate gamma_diff(start=1.e-4) "Diffusion conductance in the pipes"; - FluidType ftype_p "Fluid type in the pipes"; - Integer fluid_p=Integer(ftype_p) "Fluid number in the pipes"; - - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol - "Propriétés de l'eau dans le ballon" annotation (Placement(transformation( - extent={{-100,80},{-80,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov - "Propriétés de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{80,80},{100,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{10,40},{30,60}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cv annotation (Placement(transformation( + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium_Cooling.MassFraction Xp[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipes"; + Medium.ThermodynamicState state_l "Liquid phase thermodynamic state in the cavity"; + Medium.ThermodynamicState state_v "Vapor phase thermodynamic state in the cavity"; + Medium.ThermodynamicState state_d "Outlet liquid thermodynamic state"; + Medium_Cooling.ThermodynamicState state_e "Average cooling pipe thermodynamic state"; + Medium.SaturationProperties sat "Saturation properties in the cavity"; + + Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,90},{10,110}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cl annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-8,-110},{12,-90}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yNiveau annotation (Placement( transformation(extent={{100,-82},{120,-62}}, rotation=0))); public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod - annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); -public - Interfaces.Connectors.FluidInlet Cee annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( extent={{-110,-32},{-90,-12}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cse annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( extent={{90,-30},{110,-10}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - "Propriétés de l'eau " annotation (Placement( - transformation(extent={{40,20},{60,40}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -141,8 +125,8 @@ initial equation der(Vl) = 0; der(P) = 0; else - hl = lsat.h; - hv = vsat.h; + hl = Medium.bubbleEnthalpy(Medium.setSat_p(P0)); + hv = Medium.dewEnthalpy(Medium.setSat_p(P0)); Vl = Vf0*V; P = P0; end if; @@ -150,9 +134,6 @@ initial equation equation - /* Check that the fluid type for the cooling pipe is water/steam */ - assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "SimpleDynamicCondenser: the fluid type for the cooling pipe must be water/steam"); - /* Unconnected connectors */ if (cardinality(Cv) == 0) then Cv.Q = 0; @@ -160,11 +141,8 @@ equation Cv.h_vol_1 = 1.e5; Cv.diff_res_1 = 0; Cv.diff_on_1 = false; - Cv.ftype = ftype; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; + Cv.Xi = Medium.X_default[1:Medium.nXi]; + Cv.SubC = fill(0, Medium.nC); end if; if (cardinality(Cee) == 0) then @@ -173,11 +151,8 @@ equation Cee.h_vol_1 = 1.e5; Cee.diff_res_1 = 0; Cee.diff_on_1 = false; - Cee.ftype = ftype; - Cee.Xco2 = 0; - Cee.Xh2o = 0; - Cee.Xo2 = 0; - Cee.Xso2 = 0; + Cee.Xi = Medium_Cooling.X_default[1:Medium_Cooling.nXi]; + Cee.SubC = fill(0, Medium_Cooling.nC); end if; if (cardinality(Cl) == 0) then @@ -185,6 +160,8 @@ equation Cl.h_vol_2 = 1.e5; Cl.diff_res_2 = 0; Cl.diff_on_2 = false; + Cl.Xi = Medium.X_default[1:Medium.nXi]; + Cl.SubC = fill(0, Medium.nC); end if; if (cardinality(Cse) == 0) then @@ -192,6 +169,8 @@ equation Cse.h_vol_2 = 1.e5; Cse.diff_res_2 = 0; Cse.diff_on_2 = false; + Cse.Xi = Medium_Cooling.X_default[1:Medium_Cooling.nXi]; + Cse.SubC = fill(0, Medium_Cooling.nC); end if; /* Drum volume */ @@ -201,13 +180,13 @@ equation yNiveau.signal = Vl/A; /* Pressure at the bottom of the condenser */ - Pfond = if gravity_pressure then P + prod.d*g*Vl/A else P; + Pfond = if gravity_pressure then P + Medium.density(state_d)*g*Vl/A else P; /* Liquid phase mass balance equation in the cavity */ BQl = -Cl.Q + Qcond - Qevap; if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(Medium.density_derp_h(state_l)*der(P) + Medium.density_derh_p(state_l)*der(hl)) = BQl; else 0 = BQl; end if; @@ -216,7 +195,7 @@ equation BQv = Cv.Q + Qevap - Qcond; if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(Medium.density_derp_h(state_v)*der(P) + Medium.density_derh_p(state_v)*der(hv)) = BQv; else 0 = BQv; end if; @@ -229,19 +208,19 @@ equation Cl.P = Pfond; /* Liquid phase energy balance equation in the cavity */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wvl + Jt_l; + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(Medium.bubbleEnthalpy(sat) - (hl - P/rhol)) - Qevap*(Medium.dewEnthalpy(sat) - (hl - P/rhol)) + Wvl + Jt_l; if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*Medium.density_derp_h(state_l) - 1)*der(P) + (P/rhol*Medium.density_derh_p(state_l) + rhol)*der(hl)) = BHl; else 0 = BHl; end if; /* Vapor phase energy balance equation in the cavity */ - BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Wout + Jt_v; + BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(Medium.dewEnthalpy(sat) - (hv - P/rhov)) - Qcond*(Medium.bubbleEnthalpy(sat) - (hv - P/rhov)) - Wvl + Wout + Jt_v; if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*Medium.density_derp_h(state_v) - 1)*der(P) + (P/rhov*Medium.density_derh_p(state_v) + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -257,12 +236,9 @@ equation Wout = -Cee.Q*(Cse.h - Cee.h); /* Fluid composition in the cavity (no balance equations) */ - Cl.ftype = ftype; - - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; + Cv.Xi = Cl.Xi; + Cv.SubC = Cl.SubC; + X = Cv.Xi; /* Pipes inlet and outlet */ Cee.Q = Cse.Q; @@ -276,14 +252,9 @@ equation Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff; Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff; - Cee.ftype = Cse.ftype; - - Cee.Xco2 = Cse.Xco2; - Cee.Xh2o = Cse.Xh2o; - Cee.Xo2 = Cse.Xo2; - Cee.Xso2 = Cse.Xso2; - - ftype_p = Cee.ftype; + Cee.Xi = Cse.Xi; + Cee.SubC = Cse.SubC; + Xp = Cee.Xi; Q = Cee.Q; deltaP = Cee.P - Cse.P; @@ -339,25 +310,24 @@ equation Pm = (Cee.P + Cse.P)/2; hm = (Cee.h + Cse.h)/2; - prol = ThermoSysPro.Properties.Fluid.Ph(P, hl,0, fluid_c); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv,0, fluid_c); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid_c); - proe = ThermoSysPro.Properties.Fluid.Ph(Pm, hm, mode, fluid_p); - - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid_c); + sat = Medium.setSat_p(P); + state_l = Medium.setState_phX(p=P, h=hl, X=X); + state_v = Medium.setState_phX(p=P, h=hv, X=X); + state_d = Medium.setState_phX(p=Pfond, h=Cl.h, X=X); + state_e = Medium_Cooling.setState_phX(p=Pm, h=hm, X=Xp); - rhom = proe.d; + rhom = Medium_Cooling.density(state_e); - Tl = prol.T; - rhol = prol.d; - xl = prol.x; + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = (hl - Medium.bubbleEnthalpy(sat))/(Medium.dewEnthalpy(sat) - Medium.bubbleEnthalpy(sat)); - Tv = prov.T; - rhov = prov.d; - xv = prov.x; + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = (hv - Medium.bubbleEnthalpy(sat))/(Medium.dewEnthalpy(sat) - Medium.bubbleEnthalpy(sat)); - k = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o,Cee.Xo2, Cee.Xso2); - cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o, Cee.Xo2, Cee.Xso2); + k = Medium_Cooling.thermalConductivity(state_e); + cp = Medium_Cooling.specificHeatCapacityCp(state_e); annotation ( Diagram(coordinateSystem( From 498735b22286ae4d9a09fdf2243be7d07355f623 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 16:11:00 +0200 Subject: [PATCH 118/213] #125 SimpleStaticCondenser --- .../TestSimpleStaticCondenser.mo | 33 ++++++ .../TestSimpleStaticCondenser_Traces.mo | 38 ++++++ .../HeatExchangers/package.order | 2 + .../HeatExchangers/SimpleDynamicCondenser.mo | 4 +- .../HeatExchangers/SimpleStaticCondenser.mo | 109 ++++++------------ 5 files changed, 111 insertions(+), 75 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo new file mode 100644 index 00000000..be8ea3fb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleStaticCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser simpleStaticCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Ec(h(start=532983.7176868258)), + Ef(h(start=71016.12237181116)), + Qc(start=1049.6385508765125), + Qf(start=4469.84281279143), + Sf(h(start=64330.208038325145))) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + T0=400) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); +equation + connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255})); + connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,-10},{-16,-10},{-16,20}}, color={0,0,255})); + connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},{10,29.9},{10,30},{20,30}}, color={0,0,255})); + connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},{-4,-10},{20,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo new file mode 100644 index 00000000..b18f22c4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleStaticCondenser_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}); + + ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser simpleStaticCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Ec(h(start=532983.7176868258), SubC(start={10,20})), + Ef(h(start=71016.12237181116), SubC(start={10,20})), + Qc(start=1049.6385508765125), + Qf(start=4469.84281279143), + Sf(h(start=64330.208038325145), SubC(start={10,20}))) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + SubC0={10,20}) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + T0=400, + SubC0={10,20}) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); +equation + connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255})); + connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,-10},{-16,-10},{-16,20}}, color={0,0,255})); + connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},{10,29.9},{10,30},{20,30}}, color={0,0,255})); + connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},{-4,-10},{20,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleStaticCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 62b11eb0..20b41532 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -8,3 +8,5 @@ TestStaticPlateHeatExchanger_Traces TestStaticPlateHeatExchanger_FlueGases TestSimpleDynamicCondenser TestSimpleDynamicCondenser_Traces +TestSimpleStaticCondenser +TestSimpleStaticCondenser_Traces diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo index 809e9dac..e535bea9 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo @@ -2,8 +2,8 @@ model SimpleDynamicCondenser "Simple dynamic condenser" extends ThermoSysPro.Fluid.Interfaces.IconColors; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.WaterSteam "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.WaterSteam "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo index 8f8210f0..28800a03 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model SimpleStaticCondenser "Simple static condenser" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real Kc=10 "Friction pressure loss coefficient for the hot side"; parameter Real Kf=10 "Friction pressure loss coefficient for the cold side"; @@ -18,15 +19,8 @@ model SimpleStaticCondenser "Simple static condenser" "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_cs=IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; public @@ -56,47 +50,27 @@ public Units.SI.Density rhof(start=998) "Density of the fluid in the cold side"; Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate"; Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid"; + Medium.MassFraction Xc[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condensing side"; + Medium_Cooling.MassFraction Xf[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling side"; + Medium.ThermodynamicState state_ce "Thermodynamic state at the condensing-side inlet"; + Medium.ThermodynamicState state_cs "Thermodynamic state at the condensing-side outlet"; + Medium.ThermodynamicState state_mc "Average thermodynamic state in the condensing side"; + Medium_Cooling.ThermodynamicState state_fe "Thermodynamic state at the cooling-side inlet"; + Medium_Cooling.ThermodynamicState state_fs "Thermodynamic state at the cooling-side outlet"; + Medium_Cooling.ThermodynamicState state_mf "Average thermodynamic state in the cooling side"; + Medium.SaturationProperties sat_c "Saturation properties at the condensing-side inlet pressure"; public - Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-70,-110},{-50,-90}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( extent={{90,-11},{110,9}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{50,-110},{70,-90}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs - annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf - annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{40,80},{60,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc - annotation (Placement(transformation(extent={{0,-100},{20,-80}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); equation - /* Check that the fluid type for both sides is water/steam */ - assert((ftype_c == FluidType.WaterSteam) or (ftype_c == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the hot side"); - assert((ftype_f == FluidType.WaterSteam) or (ftype_f == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the cold side"); - /* Mass flow rates */ Ec.Q = Sc.Q; @@ -109,14 +83,8 @@ equation Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - - ftype_c = Ec.ftype; + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; Ef.Q = Sf.Q; @@ -129,20 +97,16 @@ equation Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - - ftype_f = Ef.ftype; + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; Qc = Ec.Q; Qf = Ef.Q; + Xc = Ec.Xi; + Xf = Ef.Xi; /* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */ - Sc.h = lsat.h; + Sc.h = Medium.bubbleEnthalpy(sat_c); /* Power exchanged between the two sides */ W = Qf*(Sf.h - Ef.h); @@ -163,33 +127,32 @@ equation DPf = DPff + DPgf; /* Fluid thermodynamic properties at the hot side */ - proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c); - procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_cs, fluid_c); - promc = ThermoSysPro.Properties.Fluid.Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, mode_c, fluid_c); - - Tec = proce.T; - Tsc = procs.T; + sat_c = Medium.setSat_p(Ec.P); + state_ce = Medium.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + state_mc = Medium.setState_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ec.P, fluid_c); + Tec = Medium.temperature(state_ce); + Tsc = Medium.temperature(state_cs); if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = promc.d; + rhoc = Medium.density(state_mc); end if; /* Fluid thermodynamic properties at the cold side */ - profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f); - profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f); - promf = ThermoSysPro.Properties.Fluid.Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, mode_f, fluid_f); + state_fe = Medium_Cooling.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_Cooling.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + state_mf = Medium_Cooling.setState_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf); - Tef = profe.T; - Tsf = profs.T; + Tef = Medium_Cooling.temperature(state_fe); + Tsf = Medium_Cooling.temperature(state_fs); if (p_rhof > 0) then rhof = p_rhof; else - rhof = promf.d; + rhof = Medium_Cooling.density(state_mf); end if; annotation ( From 700ccd57db6484abf27234c5e74a7f67ec7caf77 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 16:25:07 +0200 Subject: [PATCH 119/213] #125 StaticCondenser --- .../HeatExchangers/TestStaticCondenser.mo | 89 +++++++++++++ .../TestStaticCondenser_Traces.mo | 14 ++ .../HeatExchangers/package.order | 2 + .../Fluid/HeatExchangers/StaticCondenser.mo | 122 ++++++------------ 4 files changed, 142 insertions(+), 85 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo new file mode 100644 index 00000000..3dfd512a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo @@ -0,0 +1,89 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) + "Flow pressure at inlet 1"; + parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000) + "Flow pressure at inlet 2"; + parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) + "Flow pressure at inlet 3"; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceCooling( + redeclare package Medium = Medium, + h0=60e3, + Q0(fixed=true)=4000) annotation (Placement(transformation(extent={{-180,0},{-160,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkCooling( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{160,0},{180,20}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + CPCE=0, + KCO=100, + QC0=200, + z=5, + SCO=15e3, + Qee(start=4000, fixed=false), + Pcond(fixed=false, start=2154.77)) annotation (Placement(transformation(extent={{-20,-16},{72,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_1, + h0=2.5817e6, + C(Q(fixed=true, start=100))) annotation (Placement(transformation(extent={{-100,140},{-80,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_2, + h0=2.5481e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-182,80},{-162,100}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_3, + h0=2.5055e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-180,40},{-160,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-40,140},{-20,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkEx( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{100,0},{120,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss.C1) + annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255})); + connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{-80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255})); + connect(sourceP2.C, singularPressureLoss1.C1) + annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255})); + connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{-80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255})); + connect(sourceCooling.C, singularPressureLoss2.C1) + annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{-80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss3.C1) + annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255})); + connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{-20,150},{26,150},{26,82.49}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkCooling.C) + annotation (Line(points={{120,10},{160,10}}, color={0,0,255})); + connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkEx.C) + annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255})); + connect(singularPressureLoss5.C1, condenseur.Cex) + annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16.98}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo new file mode 100644 index 00000000..b235af11 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenser_Traces + extends TestStaticCondenser( + redeclare package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}), + sourceP(SubC0={10,20}), + sourceP1(SubC0={10,20}), + sourceP2(SubC0={10,20}), + sourceCooling(SubC0={10,20}), + condenseur(Cvt(SubC(start={10,20})), Cev(SubC(start={10,20})), Cep(SubC(start={10,20})), Cee(SubC(start={10,20})))); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 20b41532..27280e72 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -10,3 +10,5 @@ TestSimpleDynamicCondenser TestSimpleDynamicCondenser_Traces TestSimpleStaticCondenser TestSimpleStaticCondenser_Traces +TestStaticCondenser +TestStaticCondenser_Traces diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo index c7986653..b8a6630e 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model StaticCondenser "Static condenser" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Area SCO=10000 "Heat exchange surface"; parameter Real CPCE=0.02 "Pressure loss coefficient for the water side (Pa.s²/(kg.m**3))"; @@ -19,16 +18,9 @@ model StaticCondenser "Static condenser" "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_ee=IF97Region.All_regions "IF97 region at the water inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_se=IF97Region.All_regions "IF97 region at the water outlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_ex=IF97Region.All_regions "IF97 region at the extraction point (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid=Integer(ftype) "Water fluid number"; - parameter Integer mode_ee=Integer(region_ee) - 1 "IF97 region at the water inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_se=Integer(region_se) - 1 "IF97 region at the water outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_ex=Integer(region_ex) - 1 "IF97 region at the extraction point. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; @@ -79,7 +71,6 @@ public Units.SI.SpecificEnthalpy Hml(start=250000) "Extraction water average specific enthalpy"; Units.SI.Power W "Heat power released to the cold source"; - FluidType fluids[5] "Fluids mixing in volume"; Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt"; Units.SI.Power Jev "Thermal power diffusion from inlet Cev"; Units.SI.Power Jep "Thermal power diffusion from inlet Cep"; @@ -93,60 +84,34 @@ public Real rev "Value of r(Q/gamma) for inlet Cev"; Real rep "Value of r(Q/gamma) for inlet Cep"; Real rex "Value of r(Q/gamma) for outlet Cex"; - FluidType ftype_p "Cooling pipe fluid type"; - Integer fluid_p=Integer(ftype_p) "Cooling pipe fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity"; + Medium_Cooling.MassFraction X_Cooling[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipe"; + Medium.ThermodynamicState state_ex "Thermodynamic state at the extraction point"; + Medium_Cooling.ThermodynamicState state_ee "Thermodynamic state at the cooling water inlet"; + Medium_Cooling.ThermodynamicState state_se "Thermodynamic state at the cooling water outlet"; + Medium.SaturationProperties sat "Saturation properties inside the condenser"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation (Placement(transformation(extent={{-112,-72},{-88,-50}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72}, {114,-50}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction water" annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation= 0), iconTransformation(extent={{-12,-112},{14,-88}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt(redeclare package Medium = Medium) "Turbine outlet" annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proex - "Propriétés de l'eau" - annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0))); -public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee - "Propriétés de l'eau" - annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0))); -public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prose - "Propriétés de l'eau" - annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1 - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1 - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep(redeclare package Medium = Medium) "Drain inlet" annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0))); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation= 0))); equation - - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cvt.ftype; - fluids[3] = Cev.ftype; - fluids[4] = Cep.ftype; - fluids[5] = Cex.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticCondenser: fluids mixing in condenser volume are not compatible with each other"); - - /* Check that the fluid type for the cooling pipe is water/steam */ - assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenser: the fluid type for the cooling pipe must be water/steam"); - /* Unconnected connectors */ if (cardinality(Cev) == 0) then Cev.Q = 0; @@ -154,11 +119,8 @@ equation Cev.h_vol_1 = 1.e5; Cev.diff_res_1 = 0; Cev.diff_on_1 = false; - Cev.ftype = ftype; - Cev.Xco2 = 0; - Cev.Xh2o = 0; - Cev.Xo2 = 0; - Cev.Xso2 = 0; + Cev.Xi = Medium.X_default[1:Medium.nXi]; + Cev.SubC = Medium.C_default; end if; if (cardinality(Cep) == 0) then @@ -167,11 +129,8 @@ equation Cep.h_vol_1 = 1.e5; Cep.diff_res_1 = 0; Cep.diff_on_1 = false; - Cep.ftype = ftype; - Cep.Xco2 = 0; - Cep.Xh2o = 0; - Cep.Xo2 = 0; - Cep.Xso2 = 0; + Cep.Xi = Medium.X_default[1:Medium.nXi]; + Cep.SubC = Medium.C_default; end if; // Water/steam cavity @@ -227,12 +186,10 @@ equation 0 = Tsat - Tse - (Tsat - Tee)*exp(XKCO*SCO*((Tee - Tse)/W)); /* Fluid composition in the cavity (no balance equations) */ - Cex.ftype = ftype; - - Cex.Xco2 = 0; - Cex.Xh2o = 0; - Cex.Xo2 = 0; - Cex.Xso2 = 0; + X = Cvt.Xi; + SubC = Cvt.SubC; + Cex.Xi = X; + Cex.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -301,17 +258,12 @@ equation Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff; Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff; - Cee.ftype = Cse.ftype; - - Cee.Xco2 = Cse.Xco2; - Cee.Xh2o = Cse.Xh2o; - Cee.Xo2 = Cse.Xo2; - Cee.Xso2 = Cse.Xso2; - - ftype_p = Cee.ftype; + Cee.Xi = Cse.Xi; + Cee.SubC = Cse.SubC; Qee = Cee.Q; Qse = Cse.Q; + X_Cooling = Cee.Xi; Pee = Cee.P; Pse = Cse.P; @@ -326,23 +278,23 @@ equation W = Qee*(Hse - Hee); /* Fluid thermodynamic properties */ - proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode_ee, fluid_p); - proex = ThermoSysPro.Properties.Fluid.Ph(Pex, Hex, mode_ex, fluid); - prose = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode_se, fluid_p); + state_ee = Medium_Cooling.setState_phX(p=Pee, h=Hee, X=X_Cooling); + state_ex = Medium.setState_phX(p=Pex, h=Hex, X=X); + state_se = Medium_Cooling.setState_phX(p=Pse, h=Hse, X=X_Cooling); - rho_ee = proee.d; - rho_ex = proex.d; + rho_ee = Medium_Cooling.density(state_ee); + rho_ex = Medium.density(state_ex); - Tee = proee.T; - Tse = prose.T; + Tee = Medium_Cooling.temperature(state_ee); + Tse = Medium_Cooling.temperature(state_se); /* Vapor pressure inside the condenser */ - Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tsat, fluid); + Pcond = Medium.saturationPressure(Tsat); /* Fluid thermodynamic properties at the saturation point */ - (lsat1,vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid); + sat = Medium.setSat_p(Pcond); - Hsate = lsat1.h; + Hsate = Medium.bubbleEnthalpy(sat); annotation ( Diagram(coordinateSystem( From b69755e2339591ca65cc95aff347c7c33b440d13 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 16:31:06 +0200 Subject: [PATCH 120/213] #125 StaticCondenserHEI --- .../HeatExchangers/TestStaticCondenserHEI.mo | 88 +++++++++++ .../TestStaticCondenserHEI_Traces.mo | 14 ++ .../HeatExchangers/package.order | 2 + .../HeatExchangers/StaticCondenserHEI.mo | 148 ++++++------------ 4 files changed, 152 insertions(+), 100 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo new file mode 100644 index 00000000..2fc01b2a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo @@ -0,0 +1,88 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenserHEI + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) + "Flow pressure at inlet 1"; + parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000) + "Flow pressure at inlet 2"; + parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) + "Flow pressure at inlet 3"; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceCooling( + redeclare package Medium = Medium, + h0=60e3, + Q0(fixed=true)=4000) annotation (Placement(transformation(extent={{-180,0},{-160,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkCooling( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{160,0},{180,20}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticCondenserHEI condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Kf=0, + z1c=0, + z2c=5, + Qc(start=100), + Qf(start=4000), + Pcond(fixed=false, start=2154.77)) annotation (Placement(transformation(extent={{-20,-16},{72,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_1, + h0=2.5817e6, + C(Q(fixed=true, start=100))) annotation (Placement(transformation(extent={{-100,140},{-80,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_2, + h0=2.5481e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-182,80},{-162,100}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_3, + h0=2.5055e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-180,40},{-160,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-40,140},{-20,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkEx( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{100,0},{120,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss.C1) + annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255})); + connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{-80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255})); + connect(sourceP2.C, singularPressureLoss1.C1) + annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255})); + connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{-80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255})); + connect(sourceCooling.C, singularPressureLoss2.C1) + annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{-80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss3.C1) + annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255})); + connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{-20,150},{26,150},{26,82.49}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkCooling.C) + annotation (Line(points={{120,10},{160,10}}, color={0,0,255})); + connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkEx.C) + annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255})); + connect(singularPressureLoss5.C1, condenseur.Cex) + annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16.98}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenserHEI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo new file mode 100644 index 00000000..adacd0a4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenserHEI_Traces + extends TestStaticCondenserHEI( + redeclare package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}), + sourceP(SubC0={10,20}), + sourceP1(SubC0={10,20}), + sourceP2(SubC0={10,20}), + sourceCooling(SubC0={10,20}), + condenseur(Cvt(SubC(start={10,20})), Cev(SubC(start={10,20})), Cep(SubC(start={10,20})), Cee(SubC(start={10,20})))); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenserHEI_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 27280e72..74fb80f4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -12,3 +12,5 @@ TestSimpleStaticCondenser TestSimpleStaticCondenser_Traces TestStaticCondenser TestStaticCondenser_Traces +TestStaticCondenserHEI +TestStaticCondenserHEI_Traces diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo index 0380ebca..789972c3 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model StaticCondenserHEI "HEI static condenser" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real Kf=0 "Friction pressure loss coefficient for the cold side"; parameter Units.SI.Position z1c=0 "Hot inlet altitude"; @@ -72,17 +71,10 @@ model StaticCondenserHEI "HEI static condenser" "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_cs=IF97Region.All_regions "IF97 region at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer fluid=Integer(ftype) "Water fluid number"; - parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; @@ -150,7 +142,6 @@ public "Extraction water average specific enthalpy"; Units.SI.SpecificEnthalpy Hex(start=100000) "Drain specific enthalpy at the outlet"; - FluidType fluids[5] "Fluids mixing in volume"; Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt"; Units.SI.Power Jev "Thermal power diffusion from inlet Cev"; Units.SI.Power Jep "Thermal power diffusion from inlet Cep"; @@ -164,67 +155,37 @@ public Real rev "Value of r(Q/gamma) for inlet Cev"; Real rep "Value of r(Q/gamma) for inlet Cep"; Real rex "Value of r(Q/gamma) for outlet Cex"; - FluidType ftype_p "Cooling pipe fluid type"; - Integer fluid_p=Integer(ftype_p) "Cooling pipe fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity"; + Medium_Cooling.MassFraction X_Cooling[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipe"; + Medium.ThermodynamicState state_ce "Thermodynamic state at the condensing-side inlet average enthalpy"; + Medium.ThermodynamicState state_cs "Thermodynamic state at the extraction outlet"; + Medium_Cooling.ThermodynamicState state_fe "Thermodynamic state at the cooling water inlet"; + Medium_Cooling.ThermodynamicState state_fs "Thermodynamic state at the cooling water outlet"; + Medium_Cooling.ThermodynamicState state_mf "Average thermodynamic state of the cooling water"; + Medium.SaturationProperties sat "Saturation properties inside the condenser"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation (Placement(transformation(extent={{-112,-72},{-88,-50}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72}, {114,-50}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction water" annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation= 0), iconTransformation(extent={{-12,-112},{14,-88}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt(redeclare package Medium = Medium) "Turbine outlet" annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0), iconTransformation(extent={{-13,88},{13,114}}))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs - "Proprietes eau" - annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0))); -public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe - "Proprietes eau" - annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0))); -public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce - "Proprietes eau" - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep(redeclare package Medium = Medium) "Drain inlet" annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0))); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation= 0))); -public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs - "Proprietes eau" - annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf - "Proprietes eau" - annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0))); equation - - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cvt.ftype; - fluids[3] = Cev.ftype; - fluids[4] = Cep.ftype; - fluids[5] = Cex.ftype; - - /* Check that the fluid type for the cooling pipe is water/steam */ - assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenserHEI: the fluid type for the cooling pipe must be water/steam"); - /* Unconnected connectors */ if (cardinality(Cev) == 0) then Cev.Q = 0; @@ -232,11 +193,8 @@ equation Cev.h_vol_1 = 1.e5; Cev.diff_res_1 = 0; Cev.diff_on_1 = false; - Cev.ftype = ftype; - Cev.Xco2 = 0; - Cev.Xh2o = 0; - Cev.Xo2 = 0; - Cev.Xso2 = 0; + Cev.Xi = Medium.X_default[1:Medium.nXi]; + Cev.SubC = Medium.C_default; end if; if (cardinality(Cep) == 0) then @@ -245,11 +203,8 @@ equation Cep.h_vol_1 = 1.e5; Cep.diff_res_1 = 0; Cep.diff_on_1 = false; - Cep.ftype = ftype; - Cep.Xco2 = 0; - Cep.Xh2o = 0; - Cep.Xo2 = 0; - Cep.Xso2 = 0; + Cep.Xi = Medium.X_default[1:Medium.nXi]; + Cep.SubC = Medium.C_default; end if; // Water/steam cavity @@ -273,7 +228,7 @@ equation // 0 = Cvt.Q*(Cvt.h - lsat.h) + Cev.Q*(Cev.h - lsat.h) + Cep.Q*(Cep.h - lsat.h) - W; /* Extraction water average specific enthalpy */ - Hml = lsat.h; + Hml = Medium.bubbleEnthalpy(sat); // Hml = (lsat.h + Hex)/2; Cvt.h_vol_2 = Hml; @@ -290,18 +245,16 @@ equation // Cex.h_vol_1 = Hex; /* Extraction water specific enthalpy */ - Hex = noEvent(if (rho_ex > 0) then lsat.h + ((Cex.P - Pcond)/rho_ex) else lsat.h); + Hex = noEvent(if (rho_ex > 0) then Medium.bubbleEnthalpy(sat) + ((Cex.P - Pcond)/rho_ex) else Medium.bubbleEnthalpy(sat)); /* Gravity pressure losses in the hot side */ DPgc = rho_ex*g*(z2c - z1c); /* Fluid composition in the cavity (no balance equations) */ - Cex.ftype = ftype; - - Cex.Xco2 = 0; - Cex.Xh2o = 0; - Cex.Xo2 = 0; - Cex.Xso2 = 0; + X = Cvt.Xi; + SubC = Cvt.SubC; + Cex.Xi = X; + Cex.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -370,16 +323,11 @@ equation Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff; Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff; - Cee.ftype = Cse.ftype; - - Cee.Xco2 = Cse.Xco2; - Cee.Xh2o = Cse.Xh2o; - Cee.Xo2 = Cse.Xo2; - Cee.Xso2 = Cse.Xso2; - - ftype_p = Cee.ftype; + Cee.Xi = Cse.Xi; + Cee.SubC = Cse.SubC; Qf = Cee.Q; + X_Cooling = Cee.Xi; /* Pressure losses in the cold side */ Cee.P - Cse.P = DPf; @@ -392,33 +340,33 @@ equation W = Qf*(Cse.h - Cee.h); /* Fluid thermodynamic properties of the hot side */ - proce = ThermoSysPro.Properties.Fluid.Ph(Cvt.P, Hmv, mode_c, fluid); - procs = ThermoSysPro.Properties.Fluid.Ph(Cex.P, Cex.h, mode_cs, fluid); - //procs = ThermoSysPro.Properties.Fluid.Ph(Pcond + Cex.P)/2, (lsat.h + Cex.h)/2, modecs); + state_ce = Medium.setState_phX(p=Cvt.P, h=Hmv, X=X); + state_cs = Medium.setState_phX(p=Cex.P, h=Cex.h, X=X); + // state_cs could alternatively use an average pressure and enthalpy between saturation and extraction outlet. - Tec = proce.T; - Tsc = procs.T; + Tec = Medium.temperature(state_ce); + Tsc = Medium.temperature(state_cs); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid); + sat = Medium.setSat_p(Pcond); if (p_rhoc > 0) then rho_ex = p_rhoc; else - rho_ex = procs.d; + rho_ex = Medium.density(state_cs); end if; /* Fluid thermodynamic properties of the cold side */ - profe = ThermoSysPro.Properties.Fluid.Ph(Cee.P, Cee.h, mode_f, fluid_p); - profs = ThermoSysPro.Properties.Fluid.Ph(Cse.P, Cse.h, mode_f, fluid_p); - promf = ThermoSysPro.Properties.Fluid.Ph((Cee.P + Cse.P)/2, (Cee.h + Cse.h)/2, mode_f, fluid_p); + state_fe = Medium_Cooling.setState_phX(p=Cee.P, h=Cee.h, X=X_Cooling); + state_fs = Medium_Cooling.setState_phX(p=Cse.P, h=Cse.h, X=X_Cooling); + state_mf = Medium_Cooling.setState_phX(p=(Cee.P + Cse.P)/2, h=(Cee.h + Cse.h)/2, X=X_Cooling); - Tef = profe.T; - Tsf = profs.T; + Tef = Medium_Cooling.temperature(state_fe); + Tsf = Medium_Cooling.temperature(state_fs); if (p_rhof > 0) then rhof = p_rhof; else - rhof = promf.d; + rhof = Medium_Cooling.density(state_mf); end if; /* Calculation of the heat exchange surface */ @@ -461,19 +409,19 @@ equation U = Ucorr*U1*FM*FC*Fw; /* Calculation of the average specific heat capacity of the cold water */ - Cpmf = promf.cp; + Cpmf = Medium_Cooling.specificHeatCapacityCp(state_mf); /* Calculation of the expected HEI saturation temperature */ Tsat_att = Tef + (W/(Qf*Cpmf))*(1/(1 - Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf)))); /* Calculation of expected HEI saturation pressure */ - Psat_att = ThermoSysPro.Properties.Fluid.P_sat(Tsat_att, fluid); + Psat_att = Medium.saturationPressure(Tsat_att); /* Calculation of the HEI pressure cut-off */ Pcut_off = (5.752433E-04*(Tef-273.15)^3 + 1.735162E-02*(Tef-273.15)^2 + 8.052739E-02*(Tef-273.15) + 2.109159E+01)*100; /* Calculation of the HEI saturation temperature at pressure cut-off */ - Tcut_off = ThermoSysPro.Properties.Fluid.T_sat(Pcut_off, fluid); + Tcut_off = Medium.saturationTemperature(Pcut_off); /* Calculation of HEI zero-load pressure */ Pzero_load = (5.008000E-04*(Tef - 273.15)^3 + 2.039549E-02*(Tef - 273.15)^2 + 2.277566E-01*(Tef - 273.15) + 1.027824E+01)*100; @@ -489,7 +437,7 @@ equation end if; /* Calculation of the expected HEI corrected saturation pressure */ - Tsat = ThermoSysPro.Properties.Fluid.T_sat(Pcond, fluid); + Tsat = Medium.saturationTemperature(Pcond); /* Calculation of the Terminal Temperature Difference */ TTD = Tsat - Tsf; From 15a6faaecf284d693efcb0b5d5bf2c28dec4accd Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 16:37:07 +0200 Subject: [PATCH 121/213] #125 FixedPowerHeatExchanger but examples not working right now need to see if there were examples with the old fluid library --- .../TestFixedPowerHeatExchanger.mo | 40 ++++++++++ .../TestFixedPowerHeatExchanger_Traces.mo | 45 +++++++++++ .../HeatExchangers/package.order | 2 + .../HeatExchangers/FixedPowerHeatExchanger.mo | 78 +++++++------------ 4 files changed, 114 insertions(+), 51 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo new file mode 100644 index 00000000..36776aa2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo @@ -0,0 +1,40 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestFixedPowerHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger fixedPowerHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + DW=1e5, + DPc=1, + DPf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeD volumePc( + redeclare package Medium = Medium, + V=1, + steady_state=false, + h0=2.8e5) annotation (Placement(transformation(extent={{10,44},{30,64}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeD volumePf( + redeclare package Medium = Medium, + V=1, + steady_state=false, + h0=7e4) annotation (Placement(transformation(extent={{-10,24},{10,44}}, rotation=0))); +equation + connect(sourcePc.C, fixedPowerHeatExchanger.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,48}}, color={0,0,255})); + connect(sourcePf.C, fixedPowerHeatExchanger.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(fixedPowerHeatExchanger.Sc, volumePc.Ce) annotation (Line(points={{0,48},{8,48},{8,54},{10,54}}, color={0,0,255})); + connect(volumePc.Cs3, sinkPc.C) annotation (Line(points={{30,54},{40,54}}, color={0,0,255})); + connect(fixedPowerHeatExchanger.Sf, volumePf.Ce) annotation (Line(points={{0,57},{6,57},{6,34},{-10,34}}, color={0,0,255})); + connect(volumePf.Cs3, sinkPf.C) annotation (Line(points={{10,34},{20,34}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestFixedPowerHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo new file mode 100644 index 00000000..27ccee15 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo @@ -0,0 +1,45 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestFixedPowerHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, + C_nominal={0.1, 0.2, 0.3}, + C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger fixedPowerHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + DW=1e5, + DPc=1, + DPf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeD volumePc( + redeclare package Medium = Medium, + V=1, + steady_state=false, + h0=2.8e5) annotation (Placement(transformation(extent={{10,44},{30,64}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeD volumePf( + redeclare package Medium = Medium, + V=1, + steady_state=false, + h0=7e4) annotation (Placement(transformation(extent={{-10,24},{10,44}}, rotation=0))); +equation + connect(sourcePc.C, fixedPowerHeatExchanger.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,48}}, color={0,0,255})); + connect(sourcePf.C, fixedPowerHeatExchanger.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(fixedPowerHeatExchanger.Sc, volumePc.Ce) annotation (Line(points={{0,48},{8,48},{8,54},{10,54}}, color={0,0,255})); + connect(volumePc.Cs3, sinkPc.C) annotation (Line(points={{30,54},{40,54}}, color={0,0,255})); + connect(fixedPowerHeatExchanger.Sf, volumePf.Ce) annotation (Line(points={{0,57},{6,57},{6,34},{-10,34}}, color={0,0,255})); + connect(volumePf.Cs3, sinkPf.C) annotation (Line(points={{10,34},{20,34}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestFixedPowerHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 74fb80f4..34baa843 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -1,6 +1,8 @@ TestDynamicOnePhaseFlowPipe TestDynamicOnePhaseFlowPipe_Traces TestDynamicOnePhaseFlowPipe_FlueGases +TestFixedPowerHeatExchanger +TestFixedPowerHeatExchanger_Traces TestStaticExchangerKS TestStaticExchangerKS_Traces TestStaticPlateHeatExchanger diff --git a/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo index 1ad2ba65..0732ed7b 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model FixedPowerHeatExchanger "Heat exchanger with fixed delta power" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Power DW=0 "Power exchanged between the hot and the cold fluid"; @@ -12,12 +13,6 @@ model FixedPowerHeatExchanger "Heat exchanger with fixed delta power" "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - -protected - parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Temperature Tec "Fluid temperature at the inlet of the hot side"; @@ -26,31 +21,22 @@ public Units.SI.Temperature Tsf "Fluid temperature at the outlet of the cold side"; Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate"; Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; public - Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{-68,-70},{-48,-50}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{88,-9},{108,11}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{48,-70},{68,-50}}, rotation=0))); - - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce - annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs - annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); equation /* Mass flow rates */ @@ -65,14 +51,8 @@ equation Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - - ftype_c = Ec.ftype; + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; Ef.Q = Sf.Q; @@ -85,17 +65,13 @@ equation Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - - ftype_f = Ef.ftype; + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; Qc = Ec.Q; Qf = Ef.Q; + Xc = Ec.Xi; + Xf = Ef.Xi; /* Power exchanged between the hot and cold fluid */ DW = Qf*(Sf.h - Ef.h); @@ -106,18 +82,18 @@ equation Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100; /* Fluid thermodynamic properties for the hot fluid */ - proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c); - procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_c); + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); - Tec = proce.T; - Tsc = procs.T; + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); /* Fluid thermodynamic properties for the cold fluid */ - profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f); - profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f); + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); - Tef = profe.T; - Tsf = profs.T; + Tef = Medium_f.temperature(state_fe); + Tsf = Medium_f.temperature(state_fs); annotation ( Icon(coordinateSystem( From 723d7fce2d2006389b47e65c9ca9108f4362a2eb Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 7 May 2026 17:12:47 +0200 Subject: [PATCH 122/213] #125 NTUWaterHeater --- .../HeatExchangers/TestNTUWaterHeater.mo | 73 ++++++ .../TestNTUWaterHeater_FlueGases.mo | 83 +++++++ .../TestNTUWaterHeater_Traces.mo | 85 +++++++ .../HeatExchangers/package.order | 3 + .../Fluid/HeatExchangers/NTUWaterHeater.mo | 234 +++++++----------- 5 files changed, 329 insertions(+), 149 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo new file mode 100644 index 00000000..f0eea4e3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo @@ -0,0 +1,73 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.WaterSteam; + replaceable package Medium_c = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + h0=760.83e3, + P0=8270000) annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=17.49e5, + h0=2432.50e3) annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + HeiF(start=900000), + HDesF(start=900000), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=760000), + Q(start=1790), + h(start=780000)), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true))) annotation (Placement(transformation(extent={{-66,-77},{50,65}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + Q0=118.02, + h0=889.89e3) annotation (Placement(transformation(extent={{-174,35},{-154,55}}, rotation=0))); +equation + connect(Water_inlet1.C, singularPressureLoss6.C1) annotation (Line(points={{-154,-6},{-111,-6}}, color={0,0,255})); + connect(Steam_inlet1.C, singularPressureLoss7.C1) annotation (Line(points={{-154,94},{-110,94}}, color={0,0,255})); + connect(singularPressureLoss8.C2, Puit_condenseur2.C) annotation (Line(points={{95,-6},{137,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C2, Puit_condenseur3.C) annotation (Line(points={{95,-65},{136,-65}}, color={0,0,255})); + connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev) annotation (Line(points={{-90,94},{26.8,94},{26.8,18.14}}, color={0,0,255})); + connect(nTUWaterHeating1.Se, singularPressureLoss8.C1) annotation (Line(points={{50,-6},{75,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp) annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}, color={0,0,255})); + connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee) annotation (Line(points={{-91,-6},{-66,-6}}, color={0,0,255})); + connect(Drain_inlet1.C, singularPressureLoss10.C1) annotation (Line(points={{-154,45},{-110,45}}, color={0,0,255})); + connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep) annotation (Line(points={{-90,45},{-42.8,45},{-42.8,18.14}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo new file mode 100644 index 00000000..c4b542b3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo @@ -0,0 +1,83 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.FlueGases; + replaceable package Medium_c = Properties.Media.WaterSteam; + + parameter Medium_e.MassFraction X0[Medium_e.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + P0=8270000, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e, + option_temperature=true, + T0=573.15) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=17.49e5, + h0=2432.50e3) annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + HeiF(start=2879115.64844), + HDesF(start=2879115.64844), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=2879115.64844), + Q(start=1790), + h(start=2879115.64844), + Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se( + h(fixed=true, start=2879115.64844), + P(start=80.19e5, fixed=true), + Xi(start={0.1,0.2,0.3,0.2,0.2}))) annotation (Placement(transformation(extent={{-66,-77},{50,65}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + Q0=118.02, + h0=889.89e3) annotation (Placement(transformation(extent={{-174,35},{-154,55}}, rotation=0))); +equation + connect(Water_inlet1.C, singularPressureLoss6.C1) annotation (Line(points={{-154,-6},{-111,-6}}, color={0,0,255})); + connect(Steam_inlet1.C, singularPressureLoss7.C1) annotation (Line(points={{-154,94},{-110,94}}, color={0,0,255})); + connect(singularPressureLoss8.C2, Puit_condenseur2.C) annotation (Line(points={{95,-6},{137,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C2, Puit_condenseur3.C) annotation (Line(points={{95,-65},{136,-65}}, color={0,0,255})); + connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev) annotation (Line(points={{-90,94},{26.8,94},{26.8,18.14}}, color={0,0,255})); + connect(nTUWaterHeating1.Se, singularPressureLoss8.C1) annotation (Line(points={{50,-6},{75,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp) annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}, color={0,0,255})); + connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee) annotation (Line(points={{-91,-6},{-66,-6}}, color={0,0,255})); + connect(Drain_inlet1.C, singularPressureLoss10.C1) annotation (Line(points={{-154,45},{-110,45}}, color={0,0,255})); + connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep) annotation (Line(points={{-90,45},{-42.8,45},{-42.8,18.14}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo new file mode 100644 index 00000000..a79a6470 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo @@ -0,0 +1,85 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + replaceable package Medium_c = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace4","Trace5","Trace6"}, + C_nominal={0.3,0.4,0.5}, + C_default={0.4,0.5,0.6}); + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + h0=760.83e3, + P0=8270000, + SubC0={0.4,0.5,0.6}) + annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=1749000, + h0=2432.50e3, + SubC0={0.4,0.5,0.6}) + annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + HeiF(start=900000), + HDesF(start=900000), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=760000), + Q(start=1790), + h(start=780000)), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true))) annotation (Placement(transformation(extent={{-66,-77},{50,65}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + Q0=118.02, + h0=889.89e3, + SubC0={0.5,0.6,0.7}) + annotation (Placement(transformation(extent={{-174,35},{-154,55}}, rotation=0))); +equation + connect(Water_inlet1.C, singularPressureLoss6.C1) annotation (Line(points={{-154,-6},{-111,-6}}, color={0,0,255})); + connect(Steam_inlet1.C, singularPressureLoss7.C1) annotation (Line(points={{-154,94},{-110,94}}, color={0,0,255})); + connect(singularPressureLoss8.C2, Puit_condenseur2.C) annotation (Line(points={{95,-6},{137,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C2, Puit_condenseur3.C) annotation (Line(points={{95,-65},{136,-65}}, color={0,0,255})); + connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev) annotation (Line(points={{-90,94},{26.8,94},{26.8,18.14}}, color={0,0,255})); + connect(nTUWaterHeating1.Se, singularPressureLoss8.C1) annotation (Line(points={{50,-6},{75,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp) annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}, color={0,0,255})); + connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee) annotation (Line(points={{-91,-6},{-66,-6}}, color={0,0,255})); + connect(Drain_inlet1.C, singularPressureLoss10.C1) annotation (Line(points={{-154,45},{-110,45}}, color={0,0,255})); + connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep) annotation (Line(points={{-90,45},{-42.8,45},{-42.8,18.14}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 34baa843..c0f22855 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -8,6 +8,9 @@ TestStaticExchangerKS_Traces TestStaticPlateHeatExchanger TestStaticPlateHeatExchanger_Traces TestStaticPlateHeatExchanger_FlueGases +TestNTUWaterHeater +TestNTUWaterHeater_Traces +TestNTUWaterHeater_FlueGases TestSimpleDynamicCondenser TestSimpleDynamicCondenser_Traces TestSimpleStaticCondenser diff --git a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo index dc5082df..6105d18c 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model NTUWaterHeater "NTU water heater" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_e = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real lambdaE=0 "Pressure loss coefficient on the water side"; parameter Units.SI.Area SCondDes=3000 @@ -18,23 +17,8 @@ model NTUWaterHeater "NTU water heater" "Diffusion conductance for the water side (active if diffusion=true in neighbouring volumes)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_eeF=IF97Region.All_regions "IF97 region at the inlet of the water side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_seF=IF97Region.All_regions "IF97 region at the outlet of the water side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_evC=IF97Region.All_regions "IF97 region at the inlet of the vapor side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_mF=IF97Region.All_regions "IF97 region in the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_epC=IF97Region.All_regions "IF97 region at the inlet of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_spC=IF97Region.All_regions "IF97 region at the outlet of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_flash=IF97Region.All_regions "IF97 region in the flash zone of the drain (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - parameter Integer fluid=Integer(ftype) "Fluid number"; - parameter Integer mode_eeF=Integer(region_eeF) "IF97 region at the inlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_seF=Integer(region_seF) "IF97 region at the outlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_evC=Integer(region_evC) "IF97 region at the inlet of the vapor side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_mF=Integer(region_mF) "IF97 region in the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_epC=Integer(region_epC) "IF97 region at the inlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_spC=Integer(region_spC) "IF97 region at the outlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_flash=Integer(region_flash) "IF97 region in the flash zone of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; @@ -63,13 +47,9 @@ public Units.SI.SpecificEnthalpy Hep(start=3e5) "Mixing specific enthalpy of the drain and the condensate"; Units.SI.Density rho(start=1e3, min=0) "Average water density"; - FluidType fluids[4] "Fluids mixing in volume"; - FluidType ftype_e "Fluid type for the water side"; - Integer fluid_e=Integer(ftype_e) "Fluid number for the water side"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium_e.MassFraction Xe[Medium_e.nXi](start=Medium_e.X_default[1:Medium_e.nXi]) "Mass fractions on the water side"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions in the condensing volume"; + Medium_c.ExtraProperty SubCc[Medium_c.nC](quantity=Medium_c.extraPropertiesNames, start=Medium_c.C_default) "Trace substances in the condensing volume"; Units.SI.Power Jep "Thermal power diffusion from the inlet of the drain"; Units.SI.Power Jev "Thermal power diffusion from the inlet of the vapor side"; Units.SI.Power Jsp "Thermal power diffusion from the outlet of the drain"; @@ -84,90 +64,46 @@ public Real rev "Value of r(Q/gamma) for inlet for the inlet of the vapor side"; Real rsp "Value of r(Q/gamma) for the outlet of the drain"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proeeF - "Water inlet fluid properties (4F)" - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proseF - "Water outlet fluid properties (1F)" - annotation (Placement(transformation(extent={{-70,-100},{-50,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prospC - "Drain outlet fluid properties (4C)" - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - Interfaces.Connectors.FluidInlet Ee "Water inlet" + Medium_e.ThermodynamicState state_eeF "Water inlet fluid state (4F)"; + Medium_e.ThermodynamicState state_seF "Water outlet fluid state (1F)"; + Medium_c.ThermodynamicState state_spC "Drain outlet fluid state (4C)"; + Interfaces.Connectors.FluidInlet Ee(redeclare package Medium = Medium_e) "Water inlet" annotation (Placement(transformation(extent={{-90,-10},{-110,10}}, rotation= 0))); - Interfaces.Connectors.FluidOutlet Se "Water outlet" annotation (Placement( + Interfaces.Connectors.FluidOutlet Se(redeclare package Medium = Medium_e) "Water outlet" annotation (Placement( transformation(extent={{110,-10},{90,10}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ep "Drain inlet" + Interfaces.Connectors.FluidInlet Ep(redeclare package Medium = Medium_c) "Drain inlet" annotation (Placement(transformation(extent={{-50,24},{-70,44}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sp "Drain outlet" annotation (Placement( + Interfaces.Connectors.FluidOutlet Sp(redeclare package Medium = Medium_c) "Drain outlet" annotation (Placement( transformation(extent={{-50,-43},{-70,-23}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ev "Vapor inlet" + Interfaces.Connectors.FluidInlet Ev(redeclare package Medium = Medium_c) "Vapor inlet" annotation (Placement(transformation(extent={{70,24},{50,44}}, rotation=0), iconTransformation(extent={{70,24},{50,44}}))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proevC - "Vapor inlet fluid properties (1C)" - annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatC - "Saturation conditions for the liquid phase" - annotation (Placement(transformation(extent={{10,40},{30,60}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatC - "Saturation conditions for the vapor phase" - annotation (Placement(transformation(extent={{-30,40},{-10,60}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promeF - "Average water fluid properties (between 4F and 3F)" - annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmC - "Deheating average fluid properties (between 1C and 2C)" - annotation (Placement(transformation(extent={{50,80},{70,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promcF - "Average deheating fluid properties (between 3F and 2F)" - annotation (Placement(transformation(extent={{50,-100},{70,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesF - "Deheating inlet fluid properties (2F)" - annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmF - "Average deheating fluid properties (between 2F and 1F)" - annotation (Placement(transformation(extent={{20,-100},{40,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prosp - "Drain outlet fluid properties before cooling (near 3C)" - annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompC - "Average fluid properties in the drain (between 3C and 4C)" - annotation (Placement(transformation(extent={{20,80},{40,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompF - "Average water fluid properties (between 4F and 3F)" - annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proecF - "Water fluid properties (3F)" - annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph flashepC - "Flash fluid properties (near 4C)" - annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0))); + Medium_c.ThermodynamicState state_evC "Vapor inlet fluid state (1C)"; + Medium_c.SaturationProperties satC "Saturation conditions at the vapor inlet pressure"; + Medium_c.ThermodynamicState state_lsatC "Saturated liquid state"; + Medium_c.ThermodynamicState state_vsatC "Saturated vapor state"; + Medium_e.ThermodynamicState state_meF "Average water fluid state (between 4F and 3F)"; + Medium_c.ThermodynamicState state_desmC "Deheating average fluid state (between 1C and 2C)"; + Medium_e.ThermodynamicState state_mcF "Average deheating fluid state (between 3F and 2F)"; + Medium_e.ThermodynamicState state_desF "Deheating inlet fluid state (2F)"; + Medium_e.ThermodynamicState state_desmF "Average deheating fluid state (between 2F and 1F)"; + Medium_c.ThermodynamicState state_sp "Drain outlet fluid state before cooling (near 3C)"; + Medium_c.ThermodynamicState state_mpC "Average fluid state in the drain (between 3C and 4C)"; + Medium_e.ThermodynamicState state_mpF "Average water fluid state (between 4F and 3F)"; + Medium_e.ThermodynamicState state_ecF "Water fluid state (3F)"; + Units.SI.SpecificHeatCapacity cp_desmC; + Units.SI.SpecificHeatCapacity cp_mcF; + Units.SI.SpecificHeatCapacity cp_desmF; + Units.SI.SpecificHeatCapacity cp_mpC; + Units.SI.SpecificHeatCapacity cp_mpF; + Units.SI.Temperature T_evC; + Units.SI.Temperature T_desF; + Units.SI.Temperature T_sp; + Units.SI.Temperature T_eeF; + Real x_flashepC "Steam mass fraction in the flash state"; equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ev.ftype; - fluids[3] = Ep.ftype; - fluids[4] = Sp.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "NTUWaterHeater: fluids mixing in water heater volume are not compatible with each other"); - - /* Check that the fluid type is water/steam for the water side */ - assert((ftype_e == FluidType.WaterSteam) or (ftype_e == FluidType.WaterSteamSimple), "NTUWaterHeater: the fluid type for the water side must be water/steam"); - /* Unconnected connectors */ if cardinality(Ep) == 0 then Ep.Q = 0; @@ -175,11 +111,8 @@ equation Ep.h_vol_1 = 1.e5; Ep.diff_res_1 = 0; Ep.diff_on_1 = false; - Ep.ftype = ftype; - Ep.Xco2 = 0; - Ep.Xh2o = 0; - Ep.Xo2 = 0; - Ep.Xso2 = 0; + Ep.Xi = Medium_c.X_default[1:Medium_c.nXi]; + Ep.SubC = fill(0, Medium_c.nC); end if; // Cooling pipe @@ -196,14 +129,10 @@ equation Se.diff_res_1 = Ee.diff_res_1 + 1/gamma_diff_e; Ee.diff_res_2 = Se.diff_res_2 + 1/gamma_diff_e; - Ee.ftype = Se.ftype; + Ee.Xi = Se.Xi; + Ee.SubC = Se.SubC; - Ee.Xco2 = Se.Xco2; - Ee.Xh2o = Se.Xh2o; - Ee.Xo2 = Se.Xo2; - Ee.Xso2 = Se.Xso2; - - ftype_e = Ee.ftype; + Xe = Ee.Xi; /* Pressure loss equation in the water pipe */ Ee.P - Se.P = lambdaE*ThermoSysPro.Functions.ThermoSquare(Ee.Q, eps)/rho; @@ -237,7 +166,7 @@ equation if (HsatvC < Ev.h) then 0 = Ev.Q*(Ev.h - HsatvC) - Ee.Q*(Se.h - HDesF) + J/3; Wdes = Ee.Q*(Se.h - HDesF); - Wdes = noEvent(min(Ev.Q*prodesmC.cp, Ee.Q*prodesmF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, prodesmC.cp, prodesmF.cp, KCond/2, SDes, 1)*(proevC.T - prodesF.T)); + Wdes = noEvent(min(Ev.Q*cp_desmC, Ee.Q*cp_desmF)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, cp_desmC, cp_desmF, KCond/2, SDes, 1)*(T_evC - T_desF)); /* If deheating is absent */ else Wdes = 1e-9; @@ -256,20 +185,20 @@ equation end if; Wcond = Ee.Q*(HDesF - HeiF); - Wcond = Ee.Q*promcF.cp*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, promcF.cp, KCond, (SCondDes - SDes), 0.5)*(TsatC - TeiF); + Wcond = Ee.Q*cp_mcF*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, cp_mcF, KCond, (SCondDes - SDes), 0.5)*(TsatC - TeiF); // Flash zone //----------- /* Heat power in case of partial vaporization in the drain */ - if (flashepC.x > 0) then + if (x_flashepC > 0) then Wflash = Ep.Q*(Ep.h - HsateC); else Wflash = 0; end if; /* Condition for partial vaporisation in the drain (flash) */ - if (flashepC.x > 0) then + if (x_flashepC > 0) then Hep = HsateC; else Sp.Q*Hep = HsateC*Ev.Q + Ep.h*Ep.Q; @@ -282,27 +211,21 @@ equation if noEvent(SPurge > 0) then 0 = Sp.Q*(Hep - Sp.h) - Ee.Q*(HeiF - Ee.h) + J/3; Wpurge = Ee.Q*(HeiF - Ee.h); - Wpurge = noEvent(min(Sp.Q*prompC.cp, Ee.Q*prompF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, prompC.cp, prompF.cp, KPurge, SPurge, 0)*(prosp.T - proeeF.T)); - TeiF = proecF.T; + Wpurge = noEvent(min(Sp.Q*cp_mpC, Ee.Q*cp_mpF)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, cp_mpC, cp_mpF, KPurge, SPurge, 0)*(T_sp - T_eeF)); + TeiF = Medium_e.temperature(state_ecF); else HeiF = Ee.h; Wpurge = 0; Hep = Sp.h; - TeiF = proeeF.T; + TeiF = T_eeF; end if; /* Fluid composition balance equations */ - 0 = Ep.Xco2*Ep.Q + Ev.Xco2*Ev.Q - Sp.Xco2*Sp.Q; - 0 = Ep.Xh2o*Ep.Q + Ev.Xh2o*Ev.Q - Sp.Xh2o*Sp.Q; - 0 = Ep.Xo2*Ep.Q + Ev.Xo2*Ev.Q - Sp.Xo2*Sp.Q; - 0 = Ep.Xso2*Ep.Q + Ev.Xso2*Ev.Q - Sp.Xso2*Sp.Q; - - Sp.ftype = ftype; + zeros(Medium_c.nXi) = Ep.Xi*Ep.Q + Ev.Xi*Ev.Q - Sp.Xi*Sp.Q; + zeros(Medium_c.nC) = Ep.SubC*Ep.Q + Ev.SubC*Ev.Q - Sp.SubC*Sp.Q; - Sp.Xco2 = Xco2; - Sp.Xh2o = Xh2o; - Sp.Xo2 = Xo2; - Sp.Xso2 = Xso2; + Xc = Sp.Xi; + SubCc = Sp.SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -349,30 +272,43 @@ equation Sp.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - proeeF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, Ee.h, mode_eeF, fluid_e); - proseF = ThermoSysPro.Properties.Fluid.Ph(Se.P, Se.h, mode_seF, fluid_e); - promeF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2,(Ee.h + Se.h)/2, mode_eeF, fluid_e); - proevC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ev.h, mode_evC, fluid); - prospC = ThermoSysPro.Properties.Fluid.Ph(Sp.P, Sp.h, mode_spC, fluid); - prosp = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Hep, mode_spC, fluid); - prodesF = ThermoSysPro.Properties.Fluid.Ph(Se.P, HDesF, mode_seF, fluid_e); - prompC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (Hep + Sp.h)/2, mode_spC, fluid); - prodesmC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (vsatC.h + Ev.h)/2, mode_evC, fluid); - prompF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, (Ee.h + HeiF)/2, mode_eeF, fluid_e); - promcF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2, (HeiF + HDesF)/2, mode_mF, fluid_e); - prodesmF = ThermoSysPro.Properties.Fluid.Ph(Se.P, (HDesF + Se.h)/2, mode_seF, fluid_e); - proecF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, HeiF, mode_eeF, fluid_e); - flashepC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ep.h, mode_flash, fluid); + state_eeF = Medium_e.setState_phX(p=Ee.P, h=Ee.h, X=Xe); + state_seF = Medium_e.setState_phX(p=Se.P, h=Se.h, X=Xe); + state_meF = Medium_e.setState_phX(p=(Ee.P + Se.P)/2, h=(Ee.h + Se.h)/2, X=Xe); + state_evC = Medium_c.setState_phX(p=Ev.P, h=Ev.h, X=Ev.Xi); + state_spC = Medium_c.setState_phX(p=Sp.P, h=Sp.h, X=Xc); + state_sp = Medium_c.setState_phX(p=Ev.P, h=Hep, X=Xc); + state_desF = Medium_e.setState_phX(p=Se.P, h=HDesF, X=Xe); + state_mpC = Medium_c.setState_phX(p=Ev.P, h=(Hep + Sp.h)/2, X=Xc); + state_desmC = Medium_c.setState_phX(p=Ev.P, h=(HsatvC + Ev.h)/2, X=Ev.Xi); + state_mpF = Medium_e.setState_phX(p=Ee.P, h=(Ee.h + HeiF)/2, X=Xe); + state_mcF = Medium_e.setState_phX(p=(Ee.P + Se.P)/2, h=(HeiF + HDesF)/2, X=Xe); + state_desmF = Medium_e.setState_phX(p=Se.P, h=(HDesF + Se.h)/2, X=Xe); + state_ecF = Medium_e.setState_phX(p=Ee.P, h=HeiF, X=Xe); + cp_desmC = Medium_c.specificHeatCapacityCp(state_desmC); + cp_mcF = Medium_e.specificHeatCapacityCp(state_mcF); + cp_desmF = Medium_e.specificHeatCapacityCp(state_desmF); + cp_mpC = Medium_c.specificHeatCapacityCp(state_mpC); + cp_mpF = Medium_e.specificHeatCapacityCp(state_mpF); + + T_evC = Medium_c.temperature(state_evC); + T_desF = Medium_e.temperature(state_desF); + T_sp = Medium_c.temperature(state_sp); + T_eeF = Medium_e.temperature(state_eeF); + + x_flashepC = noEvent(if (Ep.h <= HsateC) then 0 else if (Ep.h >= HsatvC) then 1 else (Ep.h - HsateC)/(HsatvC - HsateC)); /* Fluid density */ - rho = promeF.d; + rho = Medium_e.density(state_meF); /* Saturation point at the vapor inlet pressure */ - (lsatC, vsatC) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ev.P, fluid); + satC = Medium_c.setSat_p(Ev.P); + state_lsatC = Medium_c.setBubbleState(satC); + state_vsatC = Medium_c.setDewState(satC); - TsatC = lsatC.T; - HsateC = lsatC.h; - HsatvC = vsatC.h; + TsatC = Medium_c.saturationTemperature(Ev.P); + HsateC = Medium_c.specificEnthalpy(state_lsatC); + HsatvC = Medium_c.specificEnthalpy(state_vsatC); annotation ( Icon(coordinateSystem( From 952bcf8b293417a6b2bb798ab4ab835d4f1e5d0a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 8 May 2026 09:26:18 +0200 Subject: [PATCH 123/213] #125 StaticExchangerDTorWorEff --- .../TestStaticExchangerDTorWorEff.mo | 37 +++++++++ ...TestStaticExchangerDTorWorEff_FlueGases.mo | 51 ++++++++++++ .../TestStaticExchangerDTorWorEff_Traces.mo | 42 ++++++++++ .../HeatExchangers/package.order | 3 + .../StaticExchangerDTorWorEff.mo | 79 +++++++++---------- 5 files changed, 170 insertions(+), 42 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo new file mode 100644 index 00000000..e054d592 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo @@ -0,0 +1,37 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF( + redeclare package Medium = Medium, + C(P(start=219e5)), + Q0=481.07, + h0=1067.9e3) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF( + redeclare package Medium = Medium, + P0=217.68e5) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC( + redeclare package Medium = Medium, + C(P(start=24e5)), + Q0=23.377, + h0=3420.3e3) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC( + redeclare package Medium = Medium, + P0=24.13e5) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerWaterSteamDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=1, + Kf=597.832, + Ec(P(start=23e5)), + Ef(P(start=219e5)), + exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); +equation + connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef) annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); + connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo new file mode 100644 index 00000000..b41a7281 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo @@ -0,0 +1,51 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases_FF( + redeclare package Medium = Medium, + C(P(start=4500000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Q0=481.07, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases_FF( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases_FC( + redeclare package Medium = Medium, + C(P(start=300000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Q0=23.377, + option_temperature=true, + T0=673.15, + X0=X0) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases_FC( + redeclare package Medium = Medium, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerFlueGasesDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=0.8, + Kc=1e-4, + Kf=1e-4, + Ec(P(start=300000), h(start=3379115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=100000), h(start=3200000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=4450000), h(start=3000000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Tec(start=673.15), + Tsc(start=640), + Tef(start=573.15), + Tsf(start=600), + exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); +equation + connect(sourceFlueGases_FF.C, exchangerFlueGasesDTorWorEFF.Ef) annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); + connect(exchangerFlueGasesDTorWorEFF.Sf, sinkFlueGases_FF.C) annotation (Line(points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); + connect(sourceFlueGases_FC.C, exchangerFlueGasesDTorWorEFF.Ec) annotation (Line(points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); + connect(exchangerFlueGasesDTorWorEFF.Sc, sinkFlueGases_FC.C) annotation (Line(points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo new file mode 100644 index 00000000..b39a7964 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF( + redeclare package Medium = Medium, + C(P(start=219e5)), + Q0=481.07, + h0=1067.9e3, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF( + redeclare package Medium = Medium, + P0=217.68e5) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC( + redeclare package Medium = Medium, + C(P(start=24e5)), + Q0=23.377, + h0=3420.3e3, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC( + redeclare package Medium = Medium, + P0=24.13e5) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerWaterSteamDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=1, + Kf=597.832, + Ec(P(start=23e5)), + Ef(P(start=219e5)), + exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); +equation + connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef) annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); + connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index c0f22855..6c476968 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -5,6 +5,9 @@ TestFixedPowerHeatExchanger TestFixedPowerHeatExchanger_Traces TestStaticExchangerKS TestStaticExchangerKS_Traces +TestStaticExchangerDTorWorEff +TestStaticExchangerDTorWorEff_Traces +TestStaticExchangerDTorWorEff_FlueGases TestStaticPlateHeatExchanger TestStaticPlateHeatExchanger_Traces TestStaticPlateHeatExchanger_FlueGases diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo index 412b35e6..51548bd1 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model StaticExchangerDTorWorEff "Static heat exchanger with fixed delta temperature, delta power or efficiency" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer exchanger_type=1 "Exchanger type - 1: delta temperature is fixed - 2: delta power is fixed - 3: efficiency is fixed"; parameter ThermoSysPro.Units.SI.TemperatureDifference DTfroid=0 @@ -24,15 +25,9 @@ model StaticExchangerDTorWorEff "Static heat exchanger with fixed delta temperat "If > 0, fixed fluid density for the hot fluid"; parameter Units.SI.Density p_rhof=0 "If > 0, fixed fluid density for the cold fluid"; - parameter IF97Region region_c=IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_cs=IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_f=IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_c=Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_cs=Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f=Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; public @@ -64,19 +59,23 @@ public Units.SI.SpecificHeatCapacity Cpc "Specific heat capacity of the hot fluid"; Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate"; Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c=Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f=Integer(ftype_f) "Fluid number for the cold fluid"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_c.ThermodynamicState state_cm "Average thermodynamic state of the hot fluid"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; + Medium_f.ThermodynamicState state_fm "Average thermodynamic state of the cold fluid"; public - Interfaces.Connectors.FluidInlet Ec "Hot inlet" annotation (Placement( + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) "Hot inlet" annotation (Placement( transformation(extent={{-50,31},{-30,51}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ef "Cold inlet" annotation (Placement( + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) "Cold inlet" annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sf "Cold outlet" annotation (Placement( + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) "Cold outlet" annotation (Placement( transformation(extent={{90,-9},{110,11}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sc "Hot outlet" annotation (Placement( + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) "Hot outlet" annotation (Placement( transformation(extent={{30,31},{50,51}}, rotation=0))); equation @@ -92,14 +91,8 @@ equation Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - - ftype_c = Ec.ftype; + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; Ef.Q = Sf.Q; @@ -112,34 +105,30 @@ equation Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - - ftype_f = Ef.ftype; + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; Qc = Ec.Q; Qf = Ef.Q; + Xc = Ec.Xi; + Xf = Ef.Xi; /* Power exchanged between the hot and cold fluids */ if (exchanger_type == 1) then W = Qf*(Sf.h - Ef.h); W = Qc*(Ec.h - Sc.h); - Sf.h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Sf.P, Tsf, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + Sf.h = Medium_f.specificEnthalpy_pTX(p=Sf.P, T=Tsf, X=Xf); Tsf = Tef + DTfroid; elseif (exchanger_type == 2) then W = Qf*(Sf.h - Ef.h); DW = Qf*(Sf.h - Ef.h); DW = Qc*(Ec.h - Sc.h); - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + Tsf = Medium_f.temperature(state_fs); elseif (exchanger_type == 3) then W = noEvent(min(Qc*Cpc, Qf*Cpf)*EffEch*(Tec - Tef)); Sf.h = Ef.h + W/Qf; Sc.h = Ec.h - W/Qc; - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + Tsf = Medium_f.temperature(state_fs); else assert(false, "StaticWaterWaterExchangerDTorWorEff: invalid option"); end if; @@ -159,29 +148,35 @@ equation DPf = DPff + DPgf; /* Hot fluid Temperature at the inlet and at the outlet */ - Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); - Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_cs, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + state_cm = Medium_c.setState_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc); + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); /* Hot fluid density */ if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2,(Ec.h + Sc.h)/2, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + rhoc = Medium_c.density(state_cm); end if; /* Cold fluid Temperature at the inlet */ - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + state_fm = Medium_f.setState_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf); + Tef = Medium_f.temperature(state_fe); /* Cold fluid density */ if (p_rhof > 0) then rhof = p_rhof; else - rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P + Sf.P)/2,(Ef.h + Sf.h)/2, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + rhof = Medium_f.density(state_fm); end if; /* Average specific heat capacities */ - Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); - Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + Cpf = Medium_f.specificHeatCapacityCp(state_fe); + Cpc = Medium_c.specificHeatCapacityCp(state_ce); annotation ( Icon(coordinateSystem( From 668435b7e0e96c1a13656d530fda885ae47b3d0b Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 8 May 2026 10:01:56 +0200 Subject: [PATCH 124/213] #125 StaticWallFlueGasesExchanger --- ...ticWallFlueGasesExchanger_CustomMixture.mo | 54 ++++++++++++++ ...tStaticWallFlueGasesExchanger_FlueGases.mo | 39 ++++++++++ ...TestStaticWallFlueGasesExchanger_Traces.mo | 53 ++++++++++++++ .../HeatExchangers/package.order | 3 + .../StaticWallFlueGasesExchanger.mo | 72 ++++++++----------- ThermoSysPro/Properties/Media/Functions.mo | 17 +++++ ThermoSysPro/Properties/Media/package.order | 1 + 7 files changed, 195 insertions(+), 44 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo create mode 100644 ThermoSysPro/Properties/Media/Functions.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo new file mode 100644 index 00000000..85a1472e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo @@ -0,0 +1,54 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_CustomMixture + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium + extends ThermoSysPro.Properties.Media.PartialSubCMedium(nSubC=nC, isCompressible=true); + extends Modelica.Media.IdealGases.Common.MixtureGasNasa( + mediumName="CustomCombustionGas", + data={Modelica.Media.IdealGases.Common.SingleGasesData.CO2, + Modelica.Media.IdealGases.Common.SingleGasesData.H2O, + Modelica.Media.IdealGases.Common.SingleGasesData.O2, + Modelica.Media.IdealGases.Common.SingleGasesData.N2}, + fluidConstants={Modelica.Media.IdealGases.Common.FluidData.CO2, + Modelica.Media.IdealGases.Common.FluidData.H2O, + Modelica.Media.IdealGases.Common.FluidData.O2, + Modelica.Media.IdealGases.Common.FluidData.N2}, + substanceNames={"CO2","H2O","O2","N2"}, + reference_X={0.12,0.08,0.05,0.75}); + end Medium; + + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.12,0.08,0.05,0.75}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1(P(start=4500000), h(start=700000), Q(start=10), Xi(start={0.12,0.08,0.05,0.75})), + C2(P(start=4450000), h(start=650000), Q(start=10), Xi(start={0.12,0.08,0.05,0.75})), + h(start=fill(700000, Ns + 2)), + hb(start=fill(700000, Ns + 1)), + T1(start=fill(650, Ns)), + T2(start=fill(650, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=650, + X0=X0) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=650000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_CustomMixture; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo new file mode 100644 index 00000000..0982b5b9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo @@ -0,0 +1,39 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1(P(start=4500000), h(start=2879115.64844), Q(start=10), Xi(start={0.1,0.2,0.3,0.2,0.2})), + C2(P(start=4450000), h(start=2820000), Q(start=10), Xi(start={0.1,0.2,0.3,0.2,0.2})), + h(start=fill(2879115.64844, Ns + 2)), + hb(start=fill(2879115.64844, Ns + 1)), + T1(start=fill(573.15, Ns)), + T2(start=fill(573.15, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=2820000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo new file mode 100644 index 00000000..264cba4b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1( + P(start=4500000), + h(start=2879115.64844), + Q(start=10), + Xi(start={0.1,0.2,0.3,0.2,0.2}), + SubC(start={0.1,0.2,0.3})), + C2( + P(start=4450000), + h(start=2820000), + Q(start=10), + Xi(start={0.1,0.2,0.3,0.2,0.2}), + SubC(start={0.1,0.2,0.3})), + h(start=fill(2879115.64844, Ns + 2)), + hb(start=fill(2879115.64844, Ns + 1)), + T1(start=fill(573.15, Ns)), + T2(start=fill(573.15, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=573.15, + X0=X0, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=2820000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 6c476968..937eb150 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -8,6 +8,9 @@ TestStaticExchangerKS_Traces TestStaticExchangerDTorWorEff TestStaticExchangerDTorWorEff_Traces TestStaticExchangerDTorWorEff_FlueGases +TestStaticWallFlueGasesExchanger_FlueGases +TestStaticWallFlueGasesExchanger_Traces +TestStaticWallFlueGasesExchanger_CustomMixture TestStaticPlateHeatExchanger TestStaticPlateHeatExchanger_Traces TestStaticPlateHeatExchanger_FlueGases diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo index 40765bd4..491d03af 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo @@ -1,8 +1,8 @@ within ThermoSysPro.Fluid.HeatExchangers; model StaticWallFlueGasesExchanger "Static wall - flue gases exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Mixture gas medium" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer Ns=10 "Number of segments"; parameter Integer NbTub=100 "Number of pipes"; @@ -30,11 +30,6 @@ model StaticWallFlueGasesExchanger "Static wall - flue gases exchanger" parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; protected - constant Real Mco2=44.009 "CO2 molar mass"; - constant Real Mh2o=18.0148 "H2O molar mass"; - constant Real Mo2=31.998 "O2 molar mass"; - constant Real Mn2=28.014 "N2 molar mass"; - constant Real Mso2=64.063 "SO2 molar mass"; constant Real pi=Modelica.Constants.pi; constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; @@ -49,6 +44,8 @@ protected parameter Units.SI.Length Perb=Surf_ext/Ls "Geometrical parameter"; parameter Units.SI.CoefficientOfHeatTransfer Kdef=50 "Heat exchange coefficient in case of zero flow"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the medium composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the medium composition"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; parameter Real eps=1.e-1 "Small number for the computation of the pressure losses"; @@ -74,14 +71,8 @@ public "H2O partial pressure in thermal node i"; ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xn2 "N2 mass fraction"; ThermoSysPro.Units.SI.MassFraction Xvh2o "H2O volume fraction"; ThermoSysPro.Units.SI.MassFraction Xvco2 "CO2 volume fraction"; - ThermoSysPro.Units.SI.MassFraction Xvo2 "O2 volume fraction"; - ThermoSysPro.Units.SI.MassFraction Xvn2 "N2 volume fraction"; - ThermoSysPro.Units.SI.MassFraction Xvso2 "SO2 volume fraction"; Units.SI.CoefficientOfHeatTransfer K(start=0) "Total heat exchange coefficient"; Units.SI.CoefficientOfHeatTransfer Kc(start=0) @@ -99,8 +90,9 @@ public - 1)) "Temperature difference between the fluid and the wall"; Units.SI.Temperature TFilm[N - 1] "Film temperature"; Real Mmt "Total flue gases molar mass"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + parameter Units.SI.MolarMass MM[Medium.nX]={Medium.fluidConstants[j].molarMass for j in 1:Medium.nX} "Component molar masses"; + Medium.ThermodynamicState state1[N - 1] "Thermodynamic state in thermal node i"; + Medium.ThermodynamicState state2[N] "Thermodynamic state in hydraulic node i"; Real diff_res[N] "Diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; @@ -120,20 +112,21 @@ public Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; public - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); equation - /* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "StaticWallFlueGasesExchanger: the fluid type must be flue gases"); + assert(Medium.nX > 1, "StaticWallFlueGasesExchanger: Medium must be a gas mixture"); + assert(iH2O > 0, "StaticWallFlueGasesExchanger: Medium.substanceNames must contain H2O/Water for radiative heat transfer"); + assert(iCO2 > 0, "StaticWallFlueGasesExchanger: Medium.substanceNames must contain CO2/Carbondioxide for radiative heat transfer"); /* Wall boundary */ CTh.W = -dW1; - CTh.T = Tp; + Tp = CTh.T; /* Pipe boundaries */ P[1] = C1.P; @@ -157,30 +150,18 @@ equation C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; - ftype = C1.ftype; - - Xh2o = C1.Xh2o; - Xco2 = C1.Xco2; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; - Xn2 = 1 - C1.Xco2 - C1.Xh2o - C1.Xo2 - C1.Xso2; + Xh2o = C1.Xi[iH2O]; + Xco2 = C1.Xi[iCO2]; /* Volume fractions */ - Xvco2 = (Xco2/Mco2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvh2o = (Xh2o/Mh2o)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvo2 = (Xo2/Mo2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvn2 = (Xn2/Mn2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvso2 = (Xso2/Mso2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); + Xvco2 = Xco2/MM[iCO2]/sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX}); + Xvh2o = Xh2o/MM[iH2O]/sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX}); /* Total molar mass */ - Mmt = Xvco2*Mco2 + Xvh2o*Mh2o + Xvo2*Mo2 + Xvn2*Mn2 + Xvso2*Mso2; + Mmt = sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX})^(-1); /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop @@ -194,8 +175,8 @@ equation deltaT[i] = T1[i] - Tp[i]; /* Partial gas pressures */ - Ph2o[i] = P[i + 1]*Xh2o*Mmt/Mh2o; - Pco2[i] = P[i + 1]*Xco2*Mmt/Mco2; + Ph2o[i] = P[i + 1]*Xvh2o; + Pco2[i] = P[i + 1]*Xvco2; if (abs(Q[i]) >= Qmin) then /* Convective heat exchange coefficient */ @@ -267,7 +248,8 @@ equation J[i] = Je[i] + Js[i]; /* Fluid thermodynamic properties */ - T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, 0, Xco2, Xh2o, Xo2, Xso2); + state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=C1.Xi); + T1[i] = Medium.temperature(state1[i]); end for; /* Momentum balance equations (hydraulic nodes) */ @@ -280,13 +262,15 @@ equation gamma[i] = if diffusion then 1/diff_res[i] else gamma0; /* Fluid thermodynamic properties */ + state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=C1.Xi); + if (p_rho > 0) then rho2[i] = p_rho; else - rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2); + rho2[i] = Medium.density(state2[i]); end if; - T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2); + T2[i] = Medium.temperature(state2[i]); end for; /* Total heat exchange coefficient ??? */ diff --git a/ThermoSysPro/Properties/Media/Functions.mo b/ThermoSysPro/Properties/Media/Functions.mo new file mode 100644 index 00000000..602383ba --- /dev/null +++ b/ThermoSysPro/Properties/Media/Functions.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Properties.Media; +package Functions + function findSubstanceIndex + input String substanceNames[:]; + input String aliases[:]; + output Integer index; + algorithm + index := 0; + for i in 1:size(substanceNames, 1) loop + for j in 1:size(aliases, 1) loop + if substanceNames[i] == aliases[j] then + index := i; + end if; + end for; + end for; + end findSubstanceIndex; +end Functions; diff --git a/ThermoSysPro/Properties/Media/package.order b/ThermoSysPro/Properties/Media/package.order index 8d9e6275..bb249bcc 100644 --- a/ThermoSysPro/Properties/Media/package.order +++ b/ThermoSysPro/Properties/Media/package.order @@ -1,5 +1,6 @@ PartialSubCMedium PartialThermoSysProMedium PartialTwoPhaseThermoSysProMedium +Functions WaterSteam FlueGases From 555cb0e0cec86bdd80588beb24adaf44bcdd68ae Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 11 May 2026 11:27:50 +0200 Subject: [PATCH 125/213] #125 DynamicPlateHeatExchanger but issues with examples --- .../TestDynamicPlateHeatExchanger.mo | 61 ++++++++ .../TestDynamicPlateHeatExchangerW.mo | 48 +++++++ ...TestDynamicPlateHeatExchanger_FlueGases.mo | 59 ++++++++ .../TestDynamicPlateHeatExchanger_Traces.mo | 59 ++++++++ .../HeatExchangers/package.order | 4 + .../DynamicPlateHeatExchanger.mo | 134 ++++++++---------- 6 files changed, 291 insertions(+), 74 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo new file mode 100644 index 00000000..48836bb0 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_Kc=1e-4, + p_Kf=1e-4, + state_f2(p(each start=3e5)), + Ec( + P(start=300000), + Q(fixed=true, start=1036), + h(start=280050)), + Sc(P(start=100000), h(start=275103), Q(start=1000)), + Ef(P(start=300000), h(start=280104), Q(start=1000)), + Sf(P(start=100000), h(start=280076)), + Pc(start=fill(3e5, 5+2)), + Pf(start=fill(3e5, 5+2)), + Qf(start=fill(1000, 5+1)), + hc(start={280050,280050,280052,280040,280303,275103,275103}), + hf(start={280076,280104,280154,279724,289301,280000,280000}), + hbc(start={280050,280050,280052,280040,280303,275103}), + hbf(start={280076,280104,280154,279724,289301,280000})) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280050) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280104) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium, + P0(fixed=false) = 100000, + option_temperature=false, + h0=275103) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=280076) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo new file mode 100644 index 00000000..abbd9039 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchangerW + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sc(Q(fixed=true, start=1036))) annotation (Placement(transformation(extent={{-14,6},{6,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(redeclare package Medium = Medium, T0=340) annotation (Placement(transformation(extent={{-74,6},{-54,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,-14},{-34,6}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium, P0(fixed=false) = 100000) annotation (Placement(transformation(extent={{46,6},{66,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{26,-14},{46,6}}, rotation=0))); +equation + connect(sourceP2.C, echangeurAPlaques1D1.Ec) annotation (Line(points={{-54,16},{-14,16}}, color={0,0,255})); + connect(sourceP3.C, echangeurAPlaques1D1.Ef) annotation (Line(points={{-34,-4},{-9,-4},{-9,10}}, color={0,0,255})); + connect(echangeurAPlaques1D1.Sc, puitsP2.C) annotation (Line(points={{6,16},{46,16}}, color={0,0,255})); + connect(echangeurAPlaques1D1.Sf, puitsP3.C) annotation (Line(points={{1,10},{0,10},{0,-4},{26,-4}}, color={0,0,255})); + annotation ( + Diagram(graphics={Text( + extent={{72,24},{92,6}}, + lineColor={0,0,255}, + textString="Qc=true")}), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 9.6.1.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestDynamicPlateHeatExchangerW; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..06417c77 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo @@ -0,0 +1,59 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_c = Properties.Media.FlueGases; + replaceable package Medium_f = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium_c, + redeclare package Medium_f = Medium_f, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_hc=100, + p_hf=100, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=4450000), h(start=2879115.64844), Q(start=117275.047014), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=300000), h(start=2879115.64844), Q(start=49585.430645), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=100000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + hc(start=fill(2879115.64844, 7)), + hf(start=fill(2879115.64844, 7)), + hbc(start=fill(2879115.64844, 6)), + hbf(start=fill(2879115.64844, 6)), + Tc1(start=fill(573.15, 5)), + Tf1(start=fill(573.15, 5)), + Tc2(start=fill(573.15, 6)), + Tf2(start=fill(573.15, 6))) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium_c, + P0=4500000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium_f, + P0=300000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium_c, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium_f, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo new file mode 100644 index 00000000..bfc63f33 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo @@ -0,0 +1,59 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=300000), h(start=280050)), + Sc(P(start=100000), h(start=275103), Q(start=1000)), + Ef(P(start=300000), h(start=280104), Q(start=1000)), + Sf(P(start=100000), h(start=280076)), + hc(start={280050,280050,280052,280040,280303,275103,275103}), + hf(start={280076,280104,280154,279724,289301,280000,280000}), + hbc(start={280050,280050,280052,280040,280303,275103}), + hbf(start={280076,280104,280154,279724,289301,280000})) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280050, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280104, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=275103) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=280076) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 937eb150..c35c0985 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -14,6 +14,9 @@ TestStaticWallFlueGasesExchanger_CustomMixture TestStaticPlateHeatExchanger TestStaticPlateHeatExchanger_Traces TestStaticPlateHeatExchanger_FlueGases +TestDynamicPlateHeatExchanger +TestDynamicPlateHeatExchanger_Traces +TestDynamicPlateHeatExchanger_FlueGases TestNTUWaterHeater TestNTUWaterHeater_Traces TestNTUWaterHeater_FlueGases @@ -25,3 +28,4 @@ TestStaticCondenser TestStaticCondenser_Traces TestStaticCondenserHEI TestStaticCondenserHEI_Traces +TestDynamicPlateHeatExchangerW diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo index de113766..04b48756 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicPlateHeatExchanger "Dynamic plate heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.ThermalConductivity lambdam=15.0 "Metal thermal conductivity"; @@ -63,14 +64,10 @@ model DynamicPlateHeatExchanger "Dynamic plate heat exchanger" parameter Units.SI.Density p_rhof=0 "If > 0, fixed fluid density for the cold fluid" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region_c=IF97Region.All_regions "Hot fluid IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype_c==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_f=IF97Region.All_regions "Cold fluid IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype_f==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode_c=Integer(region_c) - 1 "Hot fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f=Integer(region_f) - 1 "Cold fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; parameter Units.SI.Area Ac=1 "Internal cross sectional pipe area for the hot fluid"; @@ -174,18 +171,16 @@ public Units.SI.Temperature Tsc "Fluid temperature at the hot outlet"; Units.SI.Temperature Tef "Fluid temperature at the cold inlet"; Units.SI.Temperature Tsf "Fluid temperature at the cold outlet"; - FluidType ftype_c "Hot fluid type"; - FluidType ftype_f "Cold fluid type"; - Integer fluid_c=Integer(ftype_c) "Hot fluid number"; - Integer fluid_f=Integer(ftype_f) "Cold fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2_c "Hot fluid CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xco2_f "Cold fluid CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o_c "Hot fluid H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o_f "Cold fluid H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2_c "Hot fluid O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2_f "Cold fluid O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2_c "Hot fluid SO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2_f "Cold fluid SO2 mass fraction"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_c1[N - 1] "Hot fluid thermodynamic state in thermal node i"; + Medium_f.ThermodynamicState state_f1[N - 1] "Cold fluid thermodynamic state in thermal node i"; + Medium_c.ThermodynamicState state_c2[N] "Hot fluid thermodynamic state in hydraulic node i"; + Medium_f.ThermodynamicState state_f2[N] "Cold fluid thermodynamic state in hydraulic node i"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; Real diff_res_c[N] "Diffusion resistance in hydraulic node i for the hot fluid"; Real diff_res_f[N] "Diffusion resistance in hydraulic node i for the cold fluid"; Real diff_res_t_c "Total diffusion resistance in the pipe for the hot fluid"; @@ -224,13 +219,13 @@ public Real rs_f[N - 1] "Value of r(Q/gamma) for outlet of thermal node i for the cold fluid"; public - Interfaces.Connectors.FluidInlet Ec annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ef annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{-60,-70},{-40,-50}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sf annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( extent={{40,-70},{60,-50}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sc annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); initial equation if dynamic_energy_balance then @@ -242,8 +237,8 @@ initial equation else if option_temperature then for i in 2:N loop - hc[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pc0, Tc0[i - 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - hf[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pf0, Tf0[i - 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + hc[i] = Medium_c.specificEnthalpy(Medium_c.setState_pTX(p=Pc0, T=Tc0[i - 1], X=Medium_c.X_default)); + hf[i] = Medium_f.specificEnthalpy(Medium_f.setState_pTX(p=Pf0, T=Tf0[i - 1], X=Medium_f.X_default)); end for; else for i in 2:N loop @@ -299,31 +294,14 @@ equation Sf.diff_res_1 = Ef.diff_res_1 + diff_res_t_f; Ef.diff_res_2 = Sf.diff_res_2 + diff_res_t_f; - Ec.ftype = Sc.ftype; - Sf.ftype = Ef.ftype; - - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - - Sf.Xco2 = Ef.Xco2; - Sf.Xh2o = Ef.Xh2o; - Sf.Xo2 = Ef.Xo2; - Sf.Xso2 = Ef.Xso2; + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; - ftype_c = Ec.ftype; - ftype_f = Sf.ftype; + Sf.Xi = Ef.Xi; + Sf.SubC = Ef.SubC; - Xco2_c = Ec.Xco2; - Xh2o_c = Ec.Xh2o; - Xo2_c = Ec.Xo2; - Xso2_c = Ec.Xso2; - - Xco2_f = Sf.Xco2; - Xh2o_f = Sf.Xh2o; - Xo2_f = Sf.Xo2; - Xso2_f = Sf.Xso2; + Xc = Ec.Xi; + Xf = Ef.Xi; /* Exchange area for the plate exchanger */ dS = (nbp - 2)*Sp/(N - 1); @@ -457,26 +435,28 @@ equation if (p_rhoc > 0) then rhoc1[i] = p_rhoc; else - rhoc1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); + rhoc1[i] = Medium_c.density(state_c1[i]); end if; - Tc1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - cpc1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - muc1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - kc1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - lambdac1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc1[i], Tc1[i], Pc[i + 1], 0, fluid_c); + state_c1[i] = Medium_c.setState_phX(p=Pc[i + 1], h=hc[i + 1], X=Xc); + Tc1[i] = Medium_c.temperature(state_c1[i]); + cpc1[i] = Medium_c.specificHeatCapacityCp(state_c1[i]); + muc1[i] = Medium_c.dynamicViscosity(state_c1[i]); + kc1[i] = Medium_c.thermalConductivity(state_c1[i]); + lambdac1[i] = Medium_c.thermalConductivity(state_c1[i]); if (p_rhof > 0) then rhof1[i] = p_rhof; else - rhof1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + rhof1[i] = Medium_f.density(state_f1[i]); end if; - Tf1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - cpf1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - muf1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - kf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - lambdaf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof1[i], Tf1[i], Pf[i + 1], 0, fluid_f); + state_f1[i] = Medium_f.setState_phX(p=Pf[i + 1], h=hf[i + 1], X=Xf); + Tf1[i] = Medium_f.temperature(state_f1[i]); + cpf1[i] = Medium_f.specificHeatCapacityCp(state_f1[i]); + muf1[i] = Medium_f.dynamicViscosity(state_f1[i]); + kf1[i] = Medium_f.thermalConductivity(state_f1[i]); + lambdaf1[i] = Medium_f.thermalConductivity(state_f1[i]); end for; /* Pressure losses correlations */ @@ -517,32 +497,38 @@ equation if (p_rhoc > 0) then rhoc2[i] = p_rhoc; else - rhoc2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); + rhoc2[i] = Medium_c.density(state_c2[i]); end if; - Tc2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - cpc2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - muc2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - kc2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); + state_c2[i] = Medium_c.setState_phX(p=(Pc[i] + Pc[i + 1])/2, h=hbc[i], X=Xc); + Tc2[i] = Medium_c.temperature(state_c2[i]); + cpc2[i] = Medium_c.specificHeatCapacityCp(state_c2[i]); + muc2[i] = Medium_c.dynamicViscosity(state_c2[i]); + kc2[i] = Medium_c.thermalConductivity(state_c2[i]); if (p_rhof > 0) then rhof2[i] = p_rhof; else - rhof2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + rhof2[i] = Medium_f.density(state_f2[i]); end if; - Tf2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - cpf2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - muf2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - kf2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + state_f2[i] = Medium_f.setState_phX(p=(Pf[i] + Pf[i + 1])/2, h=hbf[i], X=Xf); + Tf2[i] = Medium_f.temperature(state_f2[i]); + cpf2[i] = Medium_f.specificHeatCapacityCp(state_f2[i]); + muf2[i] = Medium_f.dynamicViscosity(state_f2[i]); + kf2[i] = Medium_f.thermalConductivity(state_f2[i]); end for; /* Calcul des températures en entrée et en sortie de l'échangeur */ - Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); + + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + Tef = Medium_f.temperature(state_fe); + Tsf = Medium_f.temperature(state_fs); /* Total fluid diffusion resistance */ diff_res_t_c = sum(diff_res_c); From cbb6f73cc29c0dba4a9aecac68146c328214f158 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 11 May 2026 14:10:23 +0200 Subject: [PATCH 126/213] #125 volatile example media --- .../PhasesSeparation.mo | 18 ++++++++++++++++++ .../WaterSteam_FullyVolatileTrace/package.mo | 5 +++++ .../package.order | 1 + .../SimpleExamples/Media/package.order | 1 + 4 files changed, 25 insertions(+) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo new file mode 100644 index 00000000..988c4877 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; +function PhasesSeparation + extends partialPhasesSeparation; + input Real x(min=0, max=1) "Title"; + +algorithm + // // HomogeneousSubstance + // C_record.Cl := SubC; + // C_record.Cg := SubC; + + // // Non-volatile + // C_record.Cl := SubC/(1 - x); + // C_record.Cg := fill(0, size(SubC, 1)); + +// Fully-volatile +C_record.Cl := fill(0,size(SubC,1)); +C_record.Cg := SubC / x; +end PhasesSeparation; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo new file mode 100644 index 00000000..fabdb6d5 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +package WaterSteam_FullyVolatileTrace + extends Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + +end WaterSteam_FullyVolatileTrace; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order new file mode 100644 index 00000000..11ebc226 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order @@ -0,0 +1 @@ +PhasesSeparation diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order index cc36f421..ddcc39f2 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order @@ -1 +1,2 @@ WaterSteam_NonVolatileTrace +WaterSteam_FullyVolatileTrace From b13b19c631712ce8df4e145b32179b8664185187 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 11 May 2026 16:09:52 +0200 Subject: [PATCH 127/213] #125 SimpleDynamicCondenser SubC balance but example strange --- .../TestSimpleDynamicCondenser_Traces.mo | 12 +++--- .../HeatExchangers/SimpleDynamicCondenser.mo | 43 ++++++++++++++++++- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo index 8846a345..4f669ff2 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo @@ -2,10 +2,7 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; model TestSimpleDynamicCondenser_Traces extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam( - extraPropertiesNames={"Trace1", "Trace2"}, - C_nominal={0.1, 2}, - C_default={0.2, 5}); + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( redeclare package Medium = Medium, @@ -20,7 +17,7 @@ model TestSimpleDynamicCondenser_Traces option_temperature=false, h0=2401e3, P0=15050, - SubC0={10,20}) annotation (Placement(transformation(extent={{-207,148},{-183,170}}, rotation=0))); + SubC0={10}) annotation (Placement(transformation(extent={{-207,148},{-183,170}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( redeclare package Medium = Medium, h0=191812, @@ -29,7 +26,7 @@ model TestSimpleDynamicCondenser_Traces redeclare package Medium = Medium, Q0=29804.5, h0=113e3, - SubC0={10,20}) annotation (Placement(transformation(extent={{-212,30},{-172,68}}, rotation=0))); + SubC0={10}) annotation (Placement(transformation(extent={{-212,30},{-172,68}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( redeclare package Medium = Medium, K=1e-6) annotation (Placement(transformation(origin={36,50}, extent={{6,-10},{-6,10}}, rotation=180))); @@ -39,11 +36,12 @@ model TestSimpleDynamicCondenser_Traces ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3( redeclare package Medium = Medium, K(fixed=false)=1e-3, - Q(start=192, fixed=true)) + Q(fixed=true,start=192)) annotation (Placement(transformation(origin={-120,159}, extent={{10,-10},{-10,10}}, rotation=180))); ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=Condenseur.xv), D=0.018, V=1000, A=100, diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo index e535bea9..8861ebeb 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo @@ -1,9 +1,11 @@ -within ThermoSysPro.Fluid.HeatExchangers; +within ThermoSysPro.Fluid.HeatExchangers; model SimpleDynamicCondenser "Simple dynamic condenser" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; @@ -32,6 +34,14 @@ model SimpleDynamicCondenser "Simple dynamic condenser" "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; @@ -74,6 +84,11 @@ public "Right hand side of the mass balance equation of the liquid phase in the cavity"; Units.SI.MassFlowRate BQv "Right hand side of the mass balance equation of the gas phase in the cavity"; + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase in the cavity"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase in the cavity"; + Medium.C_BiPhase C_record; Units.SI.Power BHl "Right hand side of the energy balance equation of the liquid phase in the cavity"; Units.SI.Power BHv @@ -99,6 +114,9 @@ public Units.SI.MassFlowRate gamma_diff(start=1.e-4) "Diffusion conductance in the pipes"; Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Liquid phase trace substances in the cavity"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Vapor phase trace substances in the cavity"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Medium_Cooling.MassFraction Xp[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipes"; Medium.ThermodynamicState state_l "Liquid phase thermodynamic state in the cavity"; Medium.ThermodynamicState state_v "Vapor phase thermodynamic state in the cavity"; @@ -124,11 +142,15 @@ initial equation der(hv) = 0; der(Vl) = 0; der(P) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else hl = Medium.bubbleEnthalpy(Medium.setSat_p(P0)); hv = Medium.dewEnthalpy(Medium.setSat_p(P0)); Vl = Vf0*V; P = P0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; @@ -237,9 +259,26 @@ equation /* Fluid composition in the cavity (no balance equations) */ Cv.Xi = Cl.Xi; - Cv.SubC = Cl.SubC; X = Cv.Xi; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + + SubCSaS = SaS(); + + BSubCl = Qcond*C_record.Cl - Qevap*SubCl - Cl.Q*Cl.SubC; + BSubCv = Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + Vl*rhol*der(SubCl) + SubCl*BQl = BSubCl; + Vv*rhov*der(SubCv) + SubCv*BQv + Vv*rhov*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + Vv*rhov*SubCSaS = BSubCv; + end if; + + Cl.SubC = SubCl; + /* Pipes inlet and outlet */ Cee.Q = Cse.Q; From 3e4c3f03b600efdf71f52b591ba314bfbbf19665 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 08:53:00 +0200 Subject: [PATCH 128/213] #125 DynamicDrum --- .../SimpleExamples/Volumes/TestDynamicDrum.mo | 34 +++ .../Volumes/TestDynamicDrum_Traces.mo | 37 +++ .../SimpleExamples/Volumes/package.order | 2 + ThermoSysPro/Fluid/Volumes/DynamicDrum.mo | 210 +++++++++--------- 4 files changed, 175 insertions(+), 108 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo new file mode 100644 index 00000000..653e56e1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestDynamicDrum + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.DynamicDrum drum( + redeclare package Medium = Medium, + Vertical=false, + steady_state=false, + Vv(start=39), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + P0=13000000, + P(start=13000000, fixed=true), + Tp(start=592.6), + zl(start=1.05)) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={80,-20}))); +equation + + connect(drum.Cs, sinkQ.C) annotation (Line(points={{40,-2},{64,-2},{64,-20},{70,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestDynamicDrum; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo new file mode 100644 index 00000000..2b29f22e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo @@ -0,0 +1,37 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestDynamicDrum_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.DynamicDrum drum( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=drum.xv), + Vertical=false, + steady_state=false, + Vv(start=39), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + P0=13000000, + P(start=13000000, fixed=true), + Tp(start=592.6), + zl(start=1.05), + SubCl0={0}, + SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={80,-20}))); +equation + + connect(drum.Cs, sinkQ.C) annotation (Line(points={{40,-2},{64,-2},{64,-20},{70,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestDynamicDrum_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index ef3c194c..ea2c1932 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -30,3 +30,5 @@ TestVolumeITh_FlueGases TestVolumeITh_Traces TestTank_withPipePressureLosses TestTank_Traces_withPipePressureLosses +TestDynamicDrum +TestDynamicDrum_Traces diff --git a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo index 333287f5..452b8862 100644 --- a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo +++ b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo @@ -1,9 +1,9 @@ -within ThermoSysPro.Fluid.Volumes; +within ThermoSysPro.Fluid.Volumes; model DynamicDrum "Dynamic drum" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; @@ -38,15 +38,21 @@ model DynamicDrum "Dynamic drum" parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); protected constant Real pi=Modelica.Constants.pi "pi"; constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid=Integer(ftype) "Fluid number"; parameter Units.SI.Volume V=pi*R^2*L "Drum volume"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Units.SI.Volume Vmin=1.e-6; + Medium.C_BiPhase C_record; public Units.SI.AbsolutePressure P "Fluid average pressure"; @@ -90,7 +96,6 @@ public Units.SI.Angle theta "Angle"; Units.SI.Area Avl(start=1.0) "Heat exchange surface between the liquid and gas phases"; - FluidType fluids[8] "Fluids mixing in volume"; Units.SI.Power Je1 "Thermal power diffusion from inlet Ce1"; Units.SI.Power Je2 "Thermal power diffusion from inlet Ce2"; Units.SI.Power Je3 "Thermal power diffusion from inlet Ce3"; @@ -114,30 +119,36 @@ public Real rd "Value of r(Q/gamma) for outlet Cd"; Real rs "Value of r(Q/gamma) for outlet Cs"; Real rv "Value of r(Q/gamma) for outlet Cv"; - - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol - "Propri鴩s de l'eau dans le ballon" annotation (Placement(transformation( - extent={{-60,40},{-20,80}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov - "Propri鴩s de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{0,40},{40,80}}, rotation=0))); + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + + Medium.ThermodynamicState prol "Liquid state in the drum"; + Medium.ThermodynamicState prov "Vapor state in the drum"; + Medium.ThermodynamicState prom "Evaporation loop state"; + Medium.ThermodynamicState prod "Downcomer outlet state"; + Medium.SaturationProperties sat "Saturation properties at drum pressure"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at drum pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at drum pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom - annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{0,-80},{40,-40}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ce1 "Feedwater input 1" annotation ( + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) "Feedwater input 1" annotation ( Placement(transformation(extent={{-110,90},{-90,110}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cm "Evaporation loop outlet" annotation ( + Interfaces.Connectors.FluidInlet Cm(redeclare package Medium = Medium) "Evaporation loop outlet" annotation ( Placement(transformation(extent={{90,-110},{110,-90}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cd "Evaporation loop inlet" annotation ( + Interfaces.Connectors.FluidOutlet Cd(redeclare package Medium = Medium) "Evaporation loop inlet" annotation ( Placement(transformation(extent={{-110,-110},{-90,-90}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cv "Steam outlet" annotation (Placement( + Interfaces.Connectors.FluidOutlet Cv(redeclare package Medium = Medium) "Steam outlet" annotation (Placement( transformation(extent={{90,90},{110,110}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level " @@ -150,14 +161,12 @@ public annotation (Placement(transformation(extent={{-10,90}, {10,110}}, rotation=0))); public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod - annotation (Placement(transformation(extent={{0,-20},{40,20}}, rotation=0))); - Interfaces.Connectors.FluidInlet Ce2 "Feedwater input 2" annotation ( + Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) "Feedwater input 2" annotation ( Placement(transformation(extent={{-110,30},{-90,50}}, rotation=0), iconTransformation(extent={{-110,30},{-90,50}}))); - Interfaces.Connectors.FluidInlet Ce3 "Feedwater input 3" annotation ( + Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) "Feedwater input 3" annotation ( Placement(transformation(extent={{-110,-50},{-90,-30}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cs "Water outlet" annotation (Placement( + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) "Water outlet" annotation (Placement( transformation(extent={{90,-50},{110,-30}}, rotation=0))); initial equation if dynamic_energy_balance then @@ -167,29 +176,20 @@ initial equation der(hv) = 0; der(Vl) = 0; der(Tp) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else P = P0; - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; der(Tp) = 0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cm.ftype; - fluids[6] = Cd.ftype; - fluids[7] = Cs.ftype; - fluids[8] = Cv.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "DynamicDrum: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; @@ -197,11 +197,7 @@ equation Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -210,11 +206,7 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then @@ -223,11 +215,7 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Cm) == 0) then @@ -236,11 +224,7 @@ equation Cm.h_vol_1 = 1.e5; Cm.diff_res_1 = 0; Cm.diff_on_1 = false; - Cm.ftype = ftype; - Cm.Xco2 = 0; - Cm.Xh2o = 0; - Cm.Xo2 = 0; - Cm.Xso2 = 0; + Cm.SubC = Medium.C_default; end if; if (cardinality(Cd) == 0) then @@ -291,13 +275,13 @@ equation Ape = Alp + Avp; /* Pressure at the bottom of the drum */ - Pfond = P + prod.d*g*zl; + Pfond = P + Medium.density(prod)*g*zl; /* Liquid phase mass balance equation */ BQl = Ce1.Q + Ce2.Q + Ce3.Q - Cd.Q - Cs.Q + (1 - xmv)*Cm.Q + Qcond - Qevap; if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; @@ -306,7 +290,7 @@ equation BQv = xmv*Cm.Q - Cv.Q + Qevap - Qcond; if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; @@ -326,22 +310,22 @@ equation /* Liquid phase energy balance equation */ BHl = Ce1.Q*(Ce1.h - (hl - P/rhol)) + Ce2.Q*(Ce2.h - (hl - P/rhol)) + Ce3.Q*(Ce3.h - (hl - P/rhol)) - Cd.Q*(Cd.h - (hl - P/rhol)) - Cs.Q*(Cs.h - (hl - P/rhol)) - + (1 - xmv)*Cm.Q*((if (xmv > 0) then lsat.h else Cm.h) - (hl - P/rhol)) - + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wlv - Wpl + Cth.W + Jt_l; + + (1 - xmv)*Cm.Q*((if (xmv > 0) then hlsat else Cm.h) - (hl - P/rhol)) + + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (hl - P/rhol)) + Wlv - Wpl + Cth.W + Jt_l; if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; /* Gas phase energy balance equation */ - BHv = xmv*Cm.Q*((if (xmv < 1) then vsat.h else Cm.h) - (hv - P/rhov)) - - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) + BHv = xmv*Cm.Q*((if (xmv < 1) then hvsat else Cm.h) - (hv - P/rhov)) + - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (hv - P/rhov)) - Wlv - Wpv + Jt_v; if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -350,7 +334,7 @@ equation Ce2.h_vol_2 = hl; Ce3.h_vol_2 = hl; Cm.h_vol_2 = hl; - Cd.h_vol_1 = noEvent(min(lsat.h, hl)); + Cd.h_vol_1 = noEvent(min(hlsat, hl)); Cs.h_vol_1 = hl; Cv.h_vol_1 = hv; @@ -373,23 +357,26 @@ equation /* Heat exchange between the wall and the outside */ Wpa = Kpa*Ape*(Ta - Tp); - /* Fluid composition (no balance equations) */ - Cd.ftype = ftype; - Cs.ftype = ftype; - Cv.ftype = ftype; - - Cd.Xco2 = 0; - Cd.Xh2o = 0; - Cd.Xo2 = 0; - Cd.Xso2 = 0; - Cs.Xco2 = 0; - Cs.Xh2o = 0; - Cs.Xo2 = 0; - Cs.Xso2 = 0; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + - Cd.Q*Cd.SubC - Cs.Q*Cs.SubC + (1 - xmv)*Cm.Q*Cm.SubC + + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = xmv*Cm.Q*Cm.SubC - Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; + + Cd.SubC = SubCl; + Cs.SubC = SubCl; + Cv.SubC = SubCv; /* Flow reversal */ if continuous_flow_reversal then @@ -473,21 +460,28 @@ equation Cv.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - prol = ThermoSysPro.Properties.Fluid.Ph(P, hl, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cd.h, 0, fluid); - prom = ThermoSysPro.Properties.Fluid.Ph(P, Cm.h, 0, fluid); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - - Tv = prov.T; - rhov = prov.d; - xv = prov.x; - - xmv = if noEvent(Cm.Q > 0) then prom.x else 0; + prol = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X); + prov = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + prod = Medium.setState_phX(p=Pfond, h=Cd.h, X=Medium.reference_X); + prom = Medium.setState_phX(p=P, h=Cm.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + + ddphl = Medium.density_derp_h(prol); + ddhpl = Medium.density_derh_p(prol); + ddphv = Medium.density_derp_h(prov); + ddhpv = Medium.density_derh_p(prov); + + Tl = Medium.temperature(prol); + rhol = Medium.density(prol); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(prov); + rhov = Medium.density(prov); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); + + xmv = if noEvent(Cm.Q > 0) then noEvent(max(0, min(1, (Cm.h - hlsat)/(hvsat - hlsat)))) else 0; Cth.T = Tl; Cex.T = Ta; From 796d8b01a1f613d80b9b63d57b95dd3d9af3ab91 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 09:09:29 +0200 Subject: [PATCH 129/213] #125 TwoPhaseVolume --- .../Volumes/TestTwoPhaseVolume.mo | 31 ++++ .../Volumes/TestTwoPhaseVolume_Traces.mo | 35 ++++ .../SimpleExamples/Volumes/package.order | 2 + ThermoSysPro/Fluid/Volumes/DynamicDrum.mo | 34 ++-- ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo | 153 ++++++++++-------- 5 files changed, 169 insertions(+), 86 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo new file mode 100644 index 00000000..1279de8f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseVolume + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Volumes.TwoPhaseVolume volume( + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + V=80, + A=20, + Vf0=0.5, + redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,-40}))); +equation + connect(sinkQ.C, volume.Cl) annotation (Line(points={{20,-40},{10,-40},{10,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseVolume; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo new file mode 100644 index 00000000..b3ab2755 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseVolume_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.TwoPhaseVolume volume( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=volume.xv), + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + V=80, + A=20, + Vf0=0.5, + SubCl0={0}, + SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,-40}))); +equation + connect(sinkQ.C, volume.Cl) annotation (Line(points={{20,-40},{10,-40},{10,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseVolume_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index ea2c1932..3fee47d4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -32,3 +32,5 @@ TestTank_withPipePressureLosses TestTank_Traces_withPipePressureLosses TestDynamicDrum TestDynamicDrum_Traces +TestTwoPhaseVolume +TestTwoPhaseVolume_Traces diff --git a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo index 452b8862..69138fb8 100644 --- a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo +++ b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo @@ -130,10 +130,10 @@ public Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; - Medium.ThermodynamicState prol "Liquid state in the drum"; - Medium.ThermodynamicState prov "Vapor state in the drum"; - Medium.ThermodynamicState prom "Evaporation loop state"; - Medium.ThermodynamicState prod "Downcomer outlet state"; + Medium.ThermodynamicState state_l "Liquid state in the drum"; + Medium.ThermodynamicState state_v "Vapor state in the drum"; + Medium.ThermodynamicState state_m "Evaporation loop state"; + Medium.ThermodynamicState state_out_l "Downcomer outlet state"; Medium.SaturationProperties sat "Saturation properties at drum pressure"; Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at drum pressure"; Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at drum pressure"; @@ -275,7 +275,7 @@ equation Ape = Alp + Avp; /* Pressure at the bottom of the drum */ - Pfond = P + Medium.density(prod)*g*zl; + Pfond = P + Medium.density(state_out_l)*g*zl; /* Liquid phase mass balance equation */ BQl = Ce1.Q + Ce2.Q + Ce3.Q - Cd.Q - Cs.Q + (1 - xmv)*Cm.Q + Qcond - Qevap; @@ -460,25 +460,25 @@ equation Cv.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - prol = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X); - prov = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); - prod = Medium.setState_phX(p=Pfond, h=Cd.h, X=Medium.reference_X); - prom = Medium.setState_phX(p=P, h=Cm.h, X=Medium.reference_X); + state_l = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cd.h, X=Medium.reference_X); + state_m = Medium.setState_phX(p=P, h=Cm.h, X=Medium.reference_X); sat = Medium.setSat_p(P); hlsat = Medium.bubbleEnthalpy(sat); hvsat = Medium.dewEnthalpy(sat); - ddphl = Medium.density_derp_h(prol); - ddhpl = Medium.density_derh_p(prol); - ddphv = Medium.density_derp_h(prov); - ddhpv = Medium.density_derh_p(prov); + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); - Tl = Medium.temperature(prol); - rhol = Medium.density(prol); + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); - Tv = Medium.temperature(prov); - rhov = Medium.density(prov); + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); xmv = if noEvent(Cm.Q > 0) then noEvent(max(0, min(1, (Cm.h - hlsat)/(hvsat - hlsat)))) else 0; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo index 714c9950..683b6b8b 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo @@ -3,7 +3,9 @@ model TwoPhaseVolume "TwoPhaseVolume" extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; @@ -29,12 +31,18 @@ model TwoPhaseVolume "TwoPhaseVolume" parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid=Integer(ftype) "Fluid number"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.C_BiPhase C_record; public Units.SI.AbsolutePressure P "Fluid average pressure"; @@ -63,7 +71,6 @@ public "Evaporation mass flow rate from the liquid phase"; Units.SI.Power Wvl "Thermal power exchanged from the gas phase to the liquid phase"; - FluidType fluids[4] "Fluids mixing in volume"; Units.SI.Power Je "Thermal power diffusion from inlet Ce"; Units.SI.Power Jv "Thermal power diffusion from inlet Cv"; Units.SI.Power Jl "Thermal power diffusion from outlet Cl"; @@ -76,21 +83,29 @@ public Real rv "Value of r(Q/gamma) for inlet Cv"; Real rl "Value of r(Q/gamma) for outlet Cl"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol - "Propri鴩s de l'eau dans le ballon" annotation (Placement(transformation( - extent={{-60,40},{-20,80}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov - "Propri鴩s de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{0,40},{40,80}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-60,-80},{-20,-40}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{0,-80},{40,-40}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cv "Steam input" annotation (Placement( + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state_l "Liquid state in the volume"; + Medium.ThermodynamicState state_v "Vapor state in the volume"; + Medium.ThermodynamicState state_out_l "Liquid outlet state"; + Medium.SaturationProperties sat "Saturation properties at volume pressure"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at volume pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at volume pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) "Steam input" annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement( + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "Water output" annotation (Placement( transformation(extent={{-10,-110},{10,-90}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation( @@ -99,10 +114,7 @@ public "Water level" annotation (Placement(transformation( extent={{100,-10},{120,10}}, rotation=0))); public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod - annotation (Placement(transformation(extent={{-60,-20},{-20,20}}, rotation= - 0))); - Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement( + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); initial equation if dynamic_energy_balance then @@ -111,24 +123,19 @@ initial equation der(hl) = 0; der(hv) = 0; der(Vl) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else P = P0; - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cv.ftype; - fluids[4] = Cl.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "TwoPhaseVolume: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; @@ -136,11 +143,7 @@ equation Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cv) == 0) then @@ -149,11 +152,7 @@ equation Cv.h_vol_1 = 1.e5; Cv.diff_res_1 = 0; Cv.diff_on_1 = false; - Cv.ftype = ftype; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; + Cv.SubC = Medium.C_default; end if; if (cardinality(Cl) == 0) then @@ -168,13 +167,13 @@ equation V = Vl + Vv; /* Pressure at the bottom of the cavity */ - Pfond = P + prod.d*g*Vl/A; + Pfond = P + Medium.density(state_out_l)*g*Vl/A; /* Liquid phase mass balance equation */ BQl = -Cl.Q + Qcond - Qevap + Ce.Q; if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; @@ -183,33 +182,33 @@ equation BQv = Cv.Q + Qevap - Qcond; if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; /* Condensation and evaporation mass flow rates */ - Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0; - Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0; + Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0; + Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0; Ce.P = P; Cv.P = P; Cl.P = Pfond; /* Liquid phase energy balance equation */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl + Jt_l; + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl + Jt_l; if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; /* Gas phase energy balance equation */ - BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Cth.W + Jt_v; + BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (hv - P/rhov)) - Wvl + Cth.W + Jt_v; if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -224,13 +223,22 @@ equation /* Water leval */ yLevel.signal = Vl/A; - /* Fluid composition (no balance equations) */ - Cl.ftype = ftype; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; + Cl.SubC = SubCl; /* Flow reversal */ if continuous_flow_reversal then @@ -278,18 +286,25 @@ equation Cl.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0,fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0,fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0,fluid); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid); - - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - - Tv = prov.T; - rhov = prov.d; - xv = prov.x; + state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); Cth.T = Tv; From 8eaea3803770b074996652dbbf5d94489a19c268 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 09:22:08 +0200 Subject: [PATCH 130/213] #125 DynamicOnePhaseFlowShell --- .../TestDynamicOnePhaseFlowShell.mo | 28 ++++++++ .../TestDynamicOnePhaseFlowShell_FlueGases.mo | 42 ++++++++++++ .../TestDynamicOnePhaseFlowShell_Traces.mo | 31 +++++++++ .../HeatExchangers/package.order | 3 + .../DynamicOnePhaseFlowShell.mo | 66 ++++++++----------- 5 files changed, 132 insertions(+), 38 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo new file mode 100644 index 00000000..0c70d9a9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo new file mode 100644 index 00000000..7bcd5cfc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + Ns=1, + Q(start=fill(36, dynamicOnePhaseFlowShell.Ns + 1)), + h(start={3077096.0822837264,3135044.986588299,3077096.0822837264}), + P(start=linspace( + 45, + 44.5, + dynamicOnePhaseFlowShell.Ns + 2))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + X0={0,0,1,0,0}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0=fill(726.855, dynamicOnePhaseFlowShell.Ns), + option_temperature=2, + W0=fill(2e6/dynamicOnePhaseFlowShell.Ns, dynamicOnePhaseFlowShell.Ns)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=dynamicOnePhaseFlowShell.Ns) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo new file mode 100644 index 00000000..52a41273 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index c35c0985..5fedf48f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -1,6 +1,9 @@ TestDynamicOnePhaseFlowPipe TestDynamicOnePhaseFlowPipe_Traces TestDynamicOnePhaseFlowPipe_FlueGases +TestDynamicOnePhaseFlowShell +TestDynamicOnePhaseFlowShell_Traces +TestDynamicOnePhaseFlowShell_FlueGases TestFixedPowerHeatExchanger TestFixedPowerHeatExchanger_Traces TestStaticExchangerKS diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo index a5aff1ce..9586a99a 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo @@ -1,8 +1,8 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicOnePhaseFlowShell "Dynamic one-phase flow shell" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer option_arrangement = 1 "1:triangle - 2: square"; parameter Units.SI.Length L=12 "Shell length"; @@ -31,12 +31,10 @@ model DynamicOnePhaseFlowShell "Dynamic one-phase flow shell" parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Integer Nb = integer(floor(L/B)); parameter Units.SI.Distance dt=dc - De "Distance between two tubes"; parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; @@ -116,12 +114,9 @@ public "Friction pressure loss coefficient in node i"; Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res[N] "Diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; @@ -141,9 +136,9 @@ public Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); @@ -156,7 +151,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(P[i], T0[i - 1], X); end for; else for i in 2:N loop @@ -209,19 +204,11 @@ equation C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; - ftype = C1.ftype; + C1.Xi = C2.Xi; - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; + X = C1.Xi; /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop @@ -310,15 +297,16 @@ equation end if; /* Fluid thermodynamic properties */ - ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=X); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); - rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + cp1[i] = Medium.specificHeatCapacityCp(state1[i]); - mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + mu1[i] = Medium.dynamicViscosity(state1[i]); + k1[i] = Medium.thermalConductivity(state1[i]); end for; /* Momentum balance equations (hydraulic nodes) */ @@ -350,11 +338,13 @@ equation gamma[i] = if diffusion then 1/diff_res[i] else gamma0; /* Fluid thermodynamic properties */ - rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2,hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=X); + + rho2[i] = Medium.density(state2[i]); + T2[i] = Medium.temperature(state2[i]); + cp2[i] = Medium.specificHeatCapacityCp(state2[i]); + mu2[i] = Medium.dynamicViscosity(state2[i]); + k2[i] = Medium.thermalConductivity(state2[i]); end for; /* Fluid densities at the boundaries of the nodes */ @@ -362,8 +352,8 @@ equation rhoc[i] = rho1[i - 1]; end for; - rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1], h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rhoc[1] = Medium.density(Medium.setState_phX(p=P[1], h=h[1], X=X)); + rhoc[N + 1] = Medium.density(Medium.setState_phX(p=P[N + 1], h=h[N + 1], X=X)); W1t = sum(dW1); From cf9355b957c272e268e36ccbc332789be25ec4f1 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 09:56:34 +0200 Subject: [PATCH 131/213] #125 Pressurizer --- .../SimpleExamples/Volumes/TestPressurizer.mo | 123 +++++++++++++++++ .../Volumes/TestPressurizer_Traces.mo | 126 ++++++++++++++++++ .../SimpleExamples/Volumes/package.order | 2 + ThermoSysPro/Fluid/Volumes/Pressurizer.mo | 125 +++++++++-------- 4 files changed, 319 insertions(+), 57 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo new file mode 100644 index 00000000..ca7ac920 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo @@ -0,0 +1,123 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestPressurizer + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.Power Wch(fixed=true) = 0.29e6 "Power released by the electrical heaters"; + parameter Real OUVfeedwaterValve(fixed=true) = 0.01 "Position of the feedwater valve"; + + ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( + redeclare package Medium = Medium, + Zm=10.15, + Klv=0.5e6, + cpp=600, + hl(start=1629887.98290107), + hv(start=2596216.59571565), + Zl(start=5.5900717167325), + Yw0=32.92, + steady_state=false, + V=61.12, + Rp=1.27, + Ae=96.23, + Klp=1780, + Kvp=7500, + Mp=107e3, + Kpa=5.63, + Ccond=0.02, + Cevap=0.05, + Yw(start=32.92), + y(start=0.3292), + P0=15500000, + P(start=15500000), + Tp(start=617.94155291055)) + annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray( + Cv(start=100), + C1( + P(start=160e5), + h_vol_2(start=1270e3), + Q(start=0.3), + h(start=1270e3)), + Q(fixed=false, start=0.32), + Cvmax=5000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,36},{-60,56}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + option_temperature=false, + h0=1270e3, + P0=16000000, + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-138,30},{-118,50}}, rotation=0))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005; 300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(transformation(extent={{-104,60},{-78,86}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + Cv(start=25000), + Cvmax(fixed=true) = 5000, + Pm(start=15500000), + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{88,36},{108,56}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=true) = 0.5) annotation (Placement(transformation(extent={{30,62},{50,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + Q0=0, + h0=3e6, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{136,30},{156,50}}, rotation=0))); + Thermal.BoundaryConditions.HeatSource SourceC1( + option_temperature=2, + T0={310}, + W0={1e5}) annotation (Placement(transformation( + origin={-67,-12}, + extent={{-17,17},{17,-17}}, + rotation=270))); + Thermal.BoundaryConditions.HeatSource SourceC2( + T0={310}, + W0={0.286e6}, + option_temperature=1) annotation (Placement(transformation( + origin={-67,11}, + extent={{-17,17},{17,-17}}, + rotation=270))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(extent={{-109,-25},{-83,1}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipe( + z1=1, + z2=0, + C1(P(start=160e5), redeclare package Medium = Medium), + C2(P(start=160e5), redeclare package Medium = Medium), + Q(fixed=false, start=0)) annotation (Placement(transformation( + origin={10,-44}, + extent={{10,-10},{-10,10}}, + rotation=90))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( + Q0=0, + h0=1600000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{12,-78},{32,-58}}, rotation=0))); + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau( + Ti=50, + add(k1=+1, k2=-1), + minval=-100, + pIsat( + Limiteur1(u(signal(start=0.001))), + ureset0=0.0, + maxval=100, + Ti=2000)) annotation (Placement(transformation(extent={{94,-54},{66,-28}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92) annotation (Placement(transformation(extent={{129,-58},{110,-39}}, rotation=0))); +equation + connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(points={{-76.7,73},{-70,73},{-70,57}}, color={0,0,255})); + connect(SteamrValve_O.y, SteamValve.Ouv) annotation (Line(points={{51,72},{98,72},{98,57}})); + connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{40,39.4},{64,39.4},{64,40},{88,40}}, color={0,0,0})); + connect(sinkQ.C, SteamValve.C2) annotation (Line(points={{136,40},{108,40}}, color={0,0,0})); + connect(sourceP.C, FeedwaterValve_Spray.C1) annotation (Line(points={{-118,40},{-80,40}}, color={0,0,0})); + connect(FeedwaterValve_Spray.C2, pressurizer.Cas) annotation (Line(points={{-60,40},{-24,40},{-24,48},{10,48},{10,40}}, color={0,0,0})); + connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-50.34,11},{-33.67,11},{-33.67,10.6},{-17,10.6}}, color={191,95,0})); + connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-50.34,-12},{10,-12},{10,0.4}}, color={191,95,0})); + connect(ElectricalHeaters.y, SourceC1.ISignal) annotation (Line(points={{-81.7,-12},{-75.5,-12}}, color={0,0,255})); + connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line( + points={{109.05,-48.5},{106,-48.5},{106,-48.8},{94.7,-48.8}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(points={{65.3,-52.7},{22,-52.7},{22,-63}}, color={0,0,255})); + connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(points={{37,10},{100,10},{100,-29.3},{94.7,-29.3}}, color={0,0,255})); + connect(pressurizer.Cex, lumpedStraightPipe.C1) annotation (Line(points={{10,-20},{10,-34}}, color={0,0,0})); + connect(lumpedStraightPipe.C2, sinkQ1.C) annotation (Line(points={{10,-54},{10,-68},{12,-68}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestPressurizer; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo new file mode 100644 index 00000000..7c770e2a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo @@ -0,0 +1,126 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestPressurizer_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + parameter Units.SI.Power Wch(fixed=true) = 0.29e6 "Power released by the electrical heaters"; + parameter Real OUVfeedwaterValve(fixed=true) = 0.01 "Position of the feedwater valve"; + + ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=1), + Zm=10.15, + Klv=0.5e6, + cpp=600, + hl(start=1629887.98290107), + hv(start=2596216.59571565), + Zl(start=5.5900717167325), + Yw0=32.92, + steady_state=false, + V=61.12, + Rp=1.27, + Ae=96.23, + Klp=1780, + Kvp=7500, + Mp=107e3, + Kpa=5.63, + Ccond=0.02, + Cevap=0.05, + Yw(start=32.92), + y(start=0.3292), + P0=15500000, + P(start=15500000), + Tp(start=617.94155291055), + SubCl0={0}, + SubCv0={10}) + annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray( + Cv(start=100), + C1( + P(start=160e5), + h_vol_2(start=1270e3), + Q(start=0.3), + h(start=1270e3)), + Q(fixed=false, start=0.32), + Cvmax=5000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,36},{-60,56}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + option_temperature=false, + h0=1270e3, + P0=16000000, + redeclare package Medium = Medium, + SubC0={10}) annotation (Placement(transformation(extent={{-138,30},{-118,50}}, rotation=0))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005; 300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(transformation(extent={{-104,60},{-78,86}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + Cv(start=25000), + Cvmax(fixed=true) = 5000, + Pm(start=15500000), + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{88,36},{108,56}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=true) = 0.5) annotation (Placement(transformation(extent={{30,62},{50,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + Q0=0, + h0=3e6, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{136,30},{156,50}}, rotation=0))); + Thermal.BoundaryConditions.HeatSource SourceC1( + option_temperature=2, + T0={310}, + W0={1e5}) annotation (Placement(transformation( + origin={-67,-12}, + extent={{-17,17},{17,-17}}, + rotation=270))); + Thermal.BoundaryConditions.HeatSource SourceC2( + T0={310}, + W0={0.286e6}, + option_temperature=1) annotation (Placement(transformation( + origin={-67,11}, + extent={{-17,17},{17,-17}}, + rotation=270))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(extent={{-109,-25},{-83,1}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipe( + z1=1, + z2=0, + C1(P(start=160e5), redeclare package Medium = Medium), + C2(P(start=160e5), redeclare package Medium = Medium), + Q(fixed=false, start=0)) annotation (Placement(transformation( + origin={10,-44}, + extent={{10,-10},{-10,10}}, + rotation=90))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( + Q0=0, + h0=1600000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{12,-78},{32,-58}}, rotation=0))); + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau( + Ti=50, + add(k1=+1, k2=-1), + minval=-100, + pIsat( + Limiteur1(u(signal(start=0.001))), + ureset0=0.0, + maxval=100, + Ti=2000)) annotation (Placement(transformation(extent={{94,-54},{66,-28}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92) annotation (Placement(transformation(extent={{129,-58},{110,-39}}, rotation=0))); +equation + connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(points={{-76.7,73},{-70,73},{-70,57}}, color={0,0,255})); + connect(SteamrValve_O.y, SteamValve.Ouv) annotation (Line(points={{51,72},{98,72},{98,57}})); + connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{40,39.4},{64,39.4},{64,40},{88,40}}, color={0,0,0})); + connect(sinkQ.C, SteamValve.C2) annotation (Line(points={{136,40},{108,40}}, color={0,0,0})); + connect(sourceP.C, FeedwaterValve_Spray.C1) annotation (Line(points={{-118,40},{-80,40}}, color={0,0,0})); + connect(FeedwaterValve_Spray.C2, pressurizer.Cas) annotation (Line(points={{-60,40},{-24,40},{-24,48},{10,48},{10,40}}, color={0,0,0})); + connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-50.34,11},{-33.67,11},{-33.67,10.6},{-17,10.6}}, color={191,95,0})); + connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-50.34,-12},{10,-12},{10,0.4}}, color={191,95,0})); + connect(ElectricalHeaters.y, SourceC1.ISignal) annotation (Line(points={{-81.7,-12},{-75.5,-12}}, color={0,0,255})); + connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line( + points={{109.05,-48.5},{106,-48.5},{106,-48.8},{94.7,-48.8}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(points={{65.3,-52.7},{22,-52.7},{22,-63}}, color={0,0,255})); + connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(points={{37,10},{100,10},{100,-29.3},{94.7,-29.3}}, color={0,0,255})); + connect(pressurizer.Cex, lumpedStraightPipe.C1) annotation (Line(points={{10,-20},{10,-34}}, color={0,0,0})); + connect(lumpedStraightPipe.C2, sinkQ1.C) annotation (Line(points={{10,-54},{10,-68},{12,-68}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestPressurizer_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 3fee47d4..4e146b27 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -34,3 +34,5 @@ TestDynamicDrum TestDynamicDrum_Traces TestTwoPhaseVolume TestTwoPhaseVolume_Traces +TestPressurizer +TestPressurizer_Traces diff --git a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo index 31ce1a40..2f34884f 100644 --- a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo +++ b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.Volumes; model Pressurizer "Pressurizer" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cs.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=61.1 "Pressurizer volume"; parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius"; @@ -33,14 +33,20 @@ model Pressurizer "Pressurizer" parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); protected constant Real pi=Modelica.Constants.pi "Pi"; constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid=Integer(ftype) "Fluid number"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Units.SI.Area Ap=pi*Rp*Rp "Pressurizer cross-sectional area"; + Medium.C_BiPhase C_record; public Units.SI.Area Slpin "Exchange surface between the liquid and the wall"; @@ -81,7 +87,6 @@ public "Evaporation mass flow rate from the liquid phase"; Units.SI.Density rhol(start=996) "Liquid phase density"; Units.SI.Density rhov(start=1.5) "Vapor phase density"; - FluidType fluids[4] "Fluids mixing in volume"; Units.SI.Power Jas "Thermal power diffusion from inlet Cas"; Units.SI.Power Jex "Thermal power diffusion from outlet Cex"; Units.SI.Power Js "Thermal power diffusion from outlet Cs"; @@ -93,10 +98,27 @@ public Real ras "Value of r(Q/gamma) for inlet Cas"; Real rex "Value of r(Q/gamma) for outlet Cex"; Real rs "Value of r(Q/gamma) for outlet Cs"; - - Interfaces.Connectors.FluidInlet Cas "Water input" annotation (Placement( + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state_l "Liquid state in the pressurizer"; + Medium.ThermodynamicState state_v "Vapor state in the pressurizer"; + Medium.SaturationProperties sat "Saturation properties at pressurizer pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + + Interfaces.Connectors.FluidInlet Cas(redeclare package Medium = Medium) "Water input" annotation (Placement( transformation(extent={{-8,92},{8,108}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cs "Steam output" annotation (Placement( + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) "Steam output" annotation (Placement( transformation(extent={{92,90},{108,106}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort Ca "Thermal input to the wall" annotation (Placement(transformation(extent={{-100,-8},{-80,12}}, rotation= @@ -109,19 +131,8 @@ public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cex "Water output" annotation (Placement( + Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Water output" annotation (Placement( transformation(extent={{-8,-108},{8,-92}}, rotation=0))); - Properties.WaterSteam.Common.ThermoProperties_ph prov - "Propri鴩s de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{16,44},{56,84}}, rotation=0))); - Properties.WaterSteam.Common.ThermoProperties_ph prol - "Propri鴩s de l'eau dans le ballon" annotation (Placement(transformation( - extent={{-54,44},{-14,84}}, rotation=0))); - Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-54,4},{-14,44}}, rotation=0))); - Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{16,4},{56,44}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -130,25 +141,20 @@ initial equation der(hv) = 0; der(y) = 0; der(Tp) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else P = P0; hl = hls; hv = hvs; Yw = Yw0; der(Tp) = 0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cas.ftype; - fluids[3] = Cex.ftype; - fluids[4] = Cs.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "Pressurizer: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Cas) == 0) then Cas.Q = 0; @@ -156,11 +162,7 @@ equation Cas.h_vol_1 = 1.e5; Cas.diff_res_1 = 0; Cas.diff_on_1 = false; - Cas.ftype = ftype; - Cas.Xco2 = 0; - Cas.Xh2o = 0; - Cas.Xo2 = 0; - Cas.Xso2 = 0; + Cas.SubC = Medium.C_default; end if; if (cardinality(Cex) == 0) then @@ -200,7 +202,7 @@ equation BQl = Cas.Q - Cex.Q + Qcond - Qevap; if dynamic_energy_balance then - rhol*Ap*Zm*der(y) + Vl*prol.ddph*der(P) + Vl*prol.ddhp*der(hl) = BQl; + rhol*Ap*Zm*der(y) + Vl*ddphl*der(P) + Vl*ddhpl*der(hl) = BQl; else 0 = BQl; end if; @@ -209,7 +211,7 @@ equation BQv = Qevap - Cs.Q - Qcond; if dynamic_energy_balance then - -rhov*Ap*Zm*der(y) + Vv*prov.ddph*der(P) + Vv*prov.ddhp*der(hv) = BQv; + -rhov*Ap*Zm*der(y) + Vv*ddphv*der(P) + Vv*ddhpv*der(hv) = BQv; else 0 = BQv; end if; @@ -263,19 +265,23 @@ equation /* Heat exchange between the wall and the outside */ Wpa = Kpa*Ae*(Ta - Tp); - /* Fluid composition (no balance equations) */ - Cex.ftype = ftype; - Cs.ftype = ftype; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = Cas.Q*Cas.SubC - Cex.Q*Cex.SubC + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = Qevap*SubCl - Cs.Q*Cs.SubC - Qcond*C_record.Cg; - Cs.Xco2 = 0; - Cs.Xh2o = 0; - Cs.Xo2 = 0; - Cs.Xso2 = 0; + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; - Cex.Xco2 = 0; - Cex.Xh2o = 0; - Cex.Xo2 = 0; - Cex.Xso2 = 0; + Cex.SubC = SubCl; + Cs.SubC = SubCv; /* Flow reversal */ if continuous_flow_reversal then @@ -325,16 +331,21 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - prol = ThermoSysPro.Properties.Fluid.Ph(P, hl,0,fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv,0,fluid); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid); - - Tl = prol.T; - Tv = prov.T; - rhol = prol.d; - rhov = prov.d; - hls = lsat.h; - hvs = vsat.h; + state_l = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + sat = Medium.setSat_p(P); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + Tv = Medium.temperature(state_v); + rhol = Medium.density(state_l); + rhov = Medium.density(state_v); + hls = Medium.bubbleEnthalpy(sat); + hvs = Medium.dewEnthalpy(sat); annotation (Icon(graphics={ Line( From ef086020463215442c089cc3031fc39606e6b186 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 10:14:03 +0200 Subject: [PATCH 132/213] #125 TankHorizontal --- ...orizontal_Traces_withPipePressureLosses.mo | 65 +++++++ ...stTankHorizontal_withPipePressureLosses.mo | 61 ++++++ .../SimpleExamples/Volumes/package.order | 2 + ThermoSysPro/Fluid/Volumes/TankHorizontal.mo | 178 ++++++------------ 4 files changed, 186 insertions(+), 120 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo new file mode 100644 index 00000000..4c6c1f47 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo @@ -0,0 +1,65 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTankHorizontal_Traces_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.TankHorizontal Tank1( + redeclare package Medium = Medium, + SubC(start={0.9}), + z(fixed=false, start=1), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-5},{20,-5},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-20,5},{-10,5}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,4.9},{20,4.9},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestTankHorizontal_Traces_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo new file mode 100644 index 00000000..b8ff2542 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTankHorizontal_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.TankHorizontal Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=1), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-5},{20,-5},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-20,5},{-10,5}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,4.9},{20,4.9},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestTankHorizontal_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 4e146b27..c1f884cb 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -30,6 +30,8 @@ TestVolumeITh_FlueGases TestVolumeITh_Traces TestTank_withPipePressureLosses TestTank_Traces_withPipePressureLosses +TestTankHorizontal_withPipePressureLosses +TestTankHorizontal_Traces_withPipePressureLosses TestDynamicDrum TestDynamicDrum_Traces TestTwoPhaseVolume diff --git a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo index 04608f26..f434cea1 100644 --- a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo +++ b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo @@ -1,10 +1,8 @@ within ThermoSysPro.Fluid.Volumes; model TankHorizontal "Open horizontal tank" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.AbsolutePressure Patm=1.013e5 "Pressure above the fluid level"; @@ -25,7 +23,7 @@ model TankHorizontal "Open horizontal tank" parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; parameter Boolean dynamic_mass_balance=false - "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium.isCompressible and dynamic_energy_balance)); parameter Boolean steady_state=false "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Units.SI.SpecificEnthalpy h0=1.e5 @@ -43,47 +41,22 @@ model TankHorizontal "Open horizontal tank" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); protected - constant Units.SI.SpecificEnthalpy hr=2501569 - "Water/steam reference specific enthalpy at 0.01°C"; constant Real pi=Modelica.Constants.pi "pi"; parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; parameter Units.SI.Thickness e=0.25 "Inlet/outlet thickness"; parameter Real eps=1.e-0 "Small number for ths square function"; parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level"; - parameter Boolean flue_gases=(ftype == FluidType.FlueGases) "Flue gases"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public Units.SI.Position z "Fluid level"; @@ -106,15 +79,12 @@ public Real Os2; Units.SI.DerDensityByPressure ddph "density derivative by pressure"; Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -133,16 +103,16 @@ public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation (Placement(transformation( extent={{102,-9},{122,11}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,40},{-90,60}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,-60},{110,-40}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-60},{-90,-40}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{92,39},{112,59}}, rotation=0))); initial equation if dynamic_energy_balance then @@ -159,44 +129,23 @@ initial equation z = z0; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0, Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "TankHorizontal: fluids mixing in volume are not compatible with each other"); - if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then @@ -205,11 +154,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then @@ -240,8 +186,8 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; - if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ; + if Medium.isCompressible and dynamic_energy_balance and dynamic_mass_balance then + A*(ddph*der(P) + ddhp*der(h))*z + A*rho*der(z) = BQ; else A*rho*der(z) = BQ; end if; @@ -280,17 +226,17 @@ equation end if; /* Energy balance equation */ - BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J; + BH = Ce1.Q*(Ce1.h - h) + Ce2.Q*(Ce2.h - h) - Cs1.Q*(Cs1.h - h) - Cs2.Q*(Cs2.h - h) + Cth.W + J; if dynamic_energy_balance then if z > zmin then if dynamic_mass_balance then - A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH; + A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h)) = BH; else - A*z*rho*der(h - Xh2o*hr) = BH; + A*z*rho*der(h) = BH; end if; else - der(h - Xh2o*hr) = 0; + der(h) = 0; end if; else BH = 0; @@ -307,42 +253,29 @@ equation yLevel.signal = z; /* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - - if flue_gases then - if dynamic_composition_balance then - A*z*rho*der(Xco2) + Xco2*BQ = BXco2; - A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - A*z*rho*der(Xo2) + Xo2*BQ = BXo2; - A*z*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + A*z*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; + Cs1.Xi = X; + Cs2.Xi = X; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; + SubCSaS = SaS(); + if dynamic_mass_balance then + A*z*rho*der(SubC) + SubC*BQ + A*z*rho*SubCSaS = BSubC; + else + A*z*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; /* Flow reversal */ if continuous_flow_reversal then @@ -401,17 +334,22 @@ equation /* Fluid thermodynamic properties */ P = Patm + rho*g*z/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P,h,fluid,mode,Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + state = Medium.setState_phX( + p=P, + h=h, + X=X); + + T = Medium.temperature(state); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P,h,fluid,mode,Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + rho = Medium.density(state); end if; if dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid,mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; From e894218980c5d4b99fca70081721f72d609dccdb Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 10:56:26 +0200 Subject: [PATCH 133/213] #125 Example fixed for SimpleDynamicCondenser --- .../TestSimpleDynamicCondenser.mo | 147 +++++++++++++----- .../TestSimpleDynamicCondenser_Traces.mo | 68 +------- 2 files changed, 108 insertions(+), 107 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo index 4b33034f..95d05b29 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo @@ -3,63 +3,124 @@ model TestSimpleDynamicCondenser extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( - redeclare package Medium = Medium, - P0=1e5, - option_temperature=false) annotation (Placement(transformation(extent={{48,30},{88,70}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( redeclare package Medium = Medium, K=1e-6, - Q(start=0.598447)) annotation (Placement(transformation(origin={-90,-38}, extent={{-10,-10},{10,10}}, rotation=180))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( - redeclare package Medium = Medium, - option_temperature=false, - h0=2401e3, - P0=15050) annotation (Placement(transformation(extent={{-207,148},{-183,170}}, rotation=0))); + Q(start=234.2), + rho(start=994.7163, displayUnit="g/cm3"), + C1(P(start=33724.215, displayUnit="bar"))) annotation (Placement(transformation( + origin={-8,-80}, + extent={{-10,-10},{10,10}}, + rotation=180))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( redeclare package Medium = Medium, - h0=191812, - Q0=192) annotation (Placement(transformation(extent={{-184,-52},{-208,-24}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( - redeclare package Medium = Medium, - Q0=29804.5, - h0=113e3) annotation (Placement(transformation(extent={{-212,30},{-172,68}}, rotation=0))); + Q0=234.2, + h0=137.9e3) annotation (Placement(transformation(extent={{-58,-90},{-78,-70}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( redeclare package Medium = Medium, - K=1e-6) annotation (Placement(transformation(origin={36,50}, extent={{6,-10},{-6,10}}, rotation=180))); + K=1e-6, + rho(start=995.2436, displayUnit="g/cm3")) annotation (Placement(transformation( + origin={94,-30}, + extent={{10,-10},{-10,10}}, + rotation=180))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( redeclare package Medium = Medium, - K=1e-6) annotation (Placement(transformation(origin={-154,49}, extent={{6,-10},{-6,10}}, rotation=180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3( - redeclare package Medium = Medium, - K(fixed=false)=1e-3, - Q(start=192, fixed=true)) - annotation (Placement(transformation(origin={-120,159}, extent={{10,-10},{-10,10}}, rotation=180))); + K=1e-6, + rho(start=998.6793, displayUnit="g/cm3")) annotation (Placement(transformation( + origin={-22,-30}, + extent={{10,-10},{-10,10}}, + rotation=180))); ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, D=0.018, - V=1000, - A=100, + V=26.592685799971978, + A=1.0140805624113665, lambda=0.01, - ntubes=28700, - continuous_flow_reversal=true, + ntubes=30000, + gravity_pressure=true, + steady_state=true, + P0=5010, yNiveau(signal(fixed=false, start=1.5)), - Vf0=0.15, - steady_state=false, - P(fixed=false, start=10000)) annotation (Placement(transformation(extent={{-118,6},{1,116}}, rotation=0))); + Vf0=0.10, + P(start=4999.0117, + displayUnit="bar"), + rhom(displayUnit="g/cm3", start=997.1903), + xv(start=4.3733834E-09), + Vv(start=23.606508), + xl(start=-3.5873317E-08)) + annotation (Placement(transformation(extent={{14,-46},{70,-6}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source_retourCondensats( + redeclare package Medium = Medium, + P0=25560, + h0=160.7e3, + option_temperature=false, + T(start=311.52)) annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium, h(start=1861385.9)) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={42,40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source_autre( + redeclare package Medium = Medium, + P0=82050, + h0=394.5e3, + option_temperature=false, + T(start=367.32)) annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PdC_chaudCond_out(redeclare package Medium = Medium, K=1e-5) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={42,14}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ source_vapLP( + redeclare package Medium = Medium, + Q0=194.355 - 9.231 - 9.766 - 9.418, + h0=2624.5e3, + option_temperature=false) annotation (Placement(transformation(extent={{-60,110},{-40,130}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare package Medium = Medium, + Q0=7006, + T0=290.68, + h0=113e3, + option_temperature=true) annotation (Placement(transformation(extent={{-72,-40},{-52,-20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, + T0=302.74, + option_temperature=true) annotation (Placement(transformation(extent={{128,-40},{148,-20}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StodolaTurbine LP4( + redeclare package Medium = Medium, + Cst( + fixed=false, + start=92.838486) = 8000, + eta_is_nom(fixed=false) = 0.8, + Ce(P(fixed=true, start=30000)), + Cs(P(fixed=false, start=5010), h(fixed=true, start=2560.8e3))) annotation (Placement(transformation(extent={{20,110},{40,130}}))); + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve_autre( + redeclare package Medium = Medium, + Cvmax(fixed=false) = 8000, + Q(fixed=true, start=0.1199), + C2(P(start=5010, fixed=false))) annotation (Placement(transformation(extent={{-20,36},{0,56}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2 annotation (Placement(transformation(extent={{-28,56},{-20,64}}))); + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve_retourCondensats( + redeclare package Medium = Medium, + Cvmax(fixed=false) = 8000, + C2(P(start=5010, fixed=false))) annotation (Placement(transformation(extent={{-20,76},{0,96}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1 annotation (Placement(transformation(extent={{-28,96},{-20,104}}))); equation - connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(points={{-172,49},{-160,49}}, color={0,0,255})); - connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(points={{42,50},{48,50}}, color={0,0,255})); - connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(points={{-183,159},{-130,159}}, color={0,0,255})); - connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation (Line(points={{-184,-38},{-100,-38}})); - connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{-148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255})); - connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}})); - connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{-110,159},{-58.5,159},{-58.5,116}}, color={0,0,255})); - connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}})); - annotation ( - experiment(StopTime=1000), - Icon(coordinateSystem(preserveAspectRatio=false)), - Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-250,-60},{130,180}}))); + connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{-12,-30},{4,-30},{4,-30.4},{14,-30.4}}, color={0,0,0})); + connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation (Line(points={{2,-80},{42.56,-80},{42.56,-46}})); + connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation (Line(points={{84,-30},{70,-30}})); + connect(PdC_chaudCond_out.C1, volumeC.Cs) annotation (Line(points={{42,24},{42,30}}, color={0,0,0})); + connect(PdC_chaudCond_out.C2, Condenseur.Cv) annotation (Line(points={{42,4},{42,-6}}, color={0,0,0})); + connect(sourceQ.C, PerteChargeCondPompe2.C1) annotation (Line(points={{-52,-30},{-32,-30}}, color={0,0,0})); + connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(points={{104,-30},{128,-30}}, color={0,0,0})); + connect(LP4.Ce, source_vapLP.C) annotation (Line(points={{19.9,120},{-40,120}}, color={0,0,0})); + connect(LP4.Cs, volumeC.Ce2) annotation (Line(points={{40.1,120},{58,120},{58,40},{52,40}}, color={0,0,0})); + connect(source_autre.C, controlValve_autre.C1) annotation (Line(points={{-40,40},{-20,40}}, color={0,0,0})); + connect(controlValve_autre.C2, volumeC.Ce3) annotation (Line(points={{0,40},{32,40}}, color={0,0,0})); + connect(controlValve_autre.Ouv, constante2.y) annotation (Line(points={{-10,57},{-10,60},{-19.6,60}}, color={0,0,255})); + connect(source_retourCondensats.C, controlValve_retourCondensats.C1) annotation (Line(points={{-40,80},{-20,80}}, color={0,0,0})); + connect(controlValve_retourCondensats.C2, volumeC.Ce1) annotation (Line(points={{0,80},{42,80},{42,50}}, color={0,0,0})); + connect(constante1.y, controlValve_retourCondensats.Ouv) annotation (Line(points={{-19.6,100},{-10,100},{-10,97}}, color={0,0,255})); + connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation (Line(points={{-58,-80},{-18,-80}}, color={0,0,0})); + + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); end TestSimpleDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo index 4f669ff2..b974b142 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo @@ -1,68 +1,8 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; model TestSimpleDynamicCondenser_Traces - extends ThermoSysPro.UsersGuide.Icons.Example; + extends ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers.TestSimpleDynamicCondenser( + redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + Condenseur(redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=Condenseur.xv)) - replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; - - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( - redeclare package Medium = Medium, - P0=1e5, - option_temperature=false) annotation (Placement(transformation(extent={{48,30},{88,70}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( - redeclare package Medium = Medium, - K=1e-6, - Q(start=0.598447)) annotation (Placement(transformation(origin={-90,-38}, extent={{-10,-10},{10,10}}, rotation=180))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( - redeclare package Medium = Medium, - option_temperature=false, - h0=2401e3, - P0=15050, - SubC0={10}) annotation (Placement(transformation(extent={{-207,148},{-183,170}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( - redeclare package Medium = Medium, - h0=191812, - Q0=192) annotation (Placement(transformation(extent={{-184,-52},{-208,-24}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( - redeclare package Medium = Medium, - Q0=29804.5, - h0=113e3, - SubC0={10}) annotation (Placement(transformation(extent={{-212,30},{-172,68}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( - redeclare package Medium = Medium, - K=1e-6) annotation (Placement(transformation(origin={36,50}, extent={{6,-10},{-6,10}}, rotation=180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( - redeclare package Medium = Medium, - K=1e-6) annotation (Placement(transformation(origin={-154,49}, extent={{6,-10},{-6,10}}, rotation=180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3( - redeclare package Medium = Medium, - K(fixed=false)=1e-3, - Q(fixed=true,start=192)) - annotation (Placement(transformation(origin={-120,159}, extent={{10,-10},{-10,10}}, rotation=180))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( - redeclare package Medium = Medium, - redeclare package Medium_Cooling = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=Condenseur.xv), - D=0.018, - V=1000, - A=100, - lambda=0.01, - ntubes=28700, - continuous_flow_reversal=true, - yNiveau(signal(fixed=false, start=1.5)), - Vf0=0.15, - steady_state=false, - P(fixed=false, start=10000)) annotation (Placement(transformation(extent={{-118,6},{1,116}}, rotation=0))); -equation - connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation (Line(points={{-172,49},{-160,49}}, color={0,0,255})); - connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(points={{42,50},{48,50}}, color={0,0,255})); - connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation (Line(points={{-183,159},{-130,159}}, color={0,0,255})); - connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation (Line(points={{-184,-38},{-100,-38}})); - connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{-148,49},{-133,49},{-133,48.9},{-118,48.9}}, color={0,0,255})); - connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation (Line(points={{-80,-38},{-57.31,-38},{-57.31,6}})); - connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation (Line(points={{-110,159},{-58.5,159},{-58.5,116}}, color={0,0,255})); - connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation (Line(points={{30,50},{15.5,50},{15.5,50},{1,50}})); - annotation ( - experiment(StopTime=1000), - Icon(coordinateSystem(preserveAspectRatio=false)), - Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-250,-60},{130,180}}))); +) annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); end TestSimpleDynamicCondenser_Traces; From 55c45f516223a20526b53acb55380dcfa41a5a6e Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 11:16:24 +0200 Subject: [PATCH 134/213] #125 SimpleEvaporatorWaterSteamFlueGases --- ...TestSimpleEvaporatorWaterSteamFlueGases.mo | 47 +++++++++ ...pleEvaporatorWaterSteamFlueGases_Traces.mo | 48 ++++++++++ .../HeatExchangers/package.order | 2 + .../SimpleEvaporatorWaterSteamFlueGases.mo | 96 ++++++++----------- 4 files changed, 136 insertions(+), 57 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo new file mode 100644 index 00000000..9ba63f1a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo @@ -0,0 +1,47 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleEvaporatorWaterSteamFlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=10, + C(P(start=2000000)), + h0=300000, + option_temperature=false) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkSteam( + redeclare package Medium = Medium, + P0=1900000) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=50, + C(P(start=300000)), + T0=900, + option_temperature=true, + X0={0.75,0.1,0.1,0.03,0.02}) annotation (Placement(transformation(extent={{-10,70},{10,50}}, rotation=-90, + origin={-60,30}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=250000) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90, + origin={60,-30}))); + ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases evaporator( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Kdpf=0.02, + Kdpe=0.02, + Cws1(P(start=2000000), h(start=300000)), + Cws2(P(start=1900000), h(start=2800000)), + Cfg1(P(start=300000), h(start=1000000), Xi(start={0.75,0.1,0.1,0.03,0.02})), + Cfg2(P(start=250000), h(start=500000), Xi(start={0.75,0.1,0.1,0.03,0.02}))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourceWater.C, evaporator.Cws1) annotation (Line(points={{-60,0},{-10,0}}, color={0,0,255})); + connect(evaporator.Cws2, sinkSteam.C) annotation (Line(points={{10,0},{60,0}}, color={0,0,255})); + connect(sourceFlueGases.C, evaporator.Cfg1) annotation (Line(points={{0,20},{0,9}}, color={0,0,255})); + connect(evaporator.Cfg2, sinkFlueGases.C) annotation (Line(points={{0,-9},{0,-20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleEvaporatorWaterSteamFlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo new file mode 100644 index 00000000..ce5c9c42 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleEvaporatorWaterSteamFlueGases_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=10, + C(P(start=2000000), SubC(start={0.1})), + h0=300000, + option_temperature=false, + SubC0={0.1}) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkSteam(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=50, + C(P(start=300000), SubC(start={0.3})), + T0=900, + option_temperature=true, + X0={0.75,0.1,0.1,0.03,0.02}, + SubC0={0.3}) annotation (Placement(transformation(extent={{-10,70},{10,50}}, rotation=-90, + origin={-60,30}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90, + origin={60,-30}))); + ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases evaporator( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Kdpf=0.02, + Kdpe=0.02, + Cws1(P(start=2000000), h(start=300000), SubC(start={0.1})), + Cws2(P(start=1900000), h(start=2800000), SubC(start={0.1})), + Cfg1(P(start=300000), h(start=1000000), Xi(start={0.75,0.1,0.1,0.03,0.02}), SubC(start={0.3})), + Cfg2(P(start=250000), h(start=500000), Xi(start={0.75,0.1,0.1,0.03,0.02}), SubC(start={0.3}))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourceWater.C, evaporator.Cws1) annotation (Line(points={{-60,0},{-10,0}}, color={0,0,255})); + connect(evaporator.Cws2, sinkSteam.C) annotation (Line(points={{10,0},{60,0}}, color={0,0,255})); + connect(sourceFlueGases.C, evaporator.Cfg1) annotation (Line(points={{0,20},{0,9}}, color={0,0,255})); + connect(evaporator.Cfg2, sinkFlueGases.C) annotation (Line(points={{0,-9},{0,-20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleEvaporatorWaterSteamFlueGases_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 5fedf48f..87d02d37 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -25,6 +25,8 @@ TestNTUWaterHeater_Traces TestNTUWaterHeater_FlueGases TestSimpleDynamicCondenser TestSimpleDynamicCondenser_Traces +TestSimpleEvaporatorWaterSteamFlueGases +TestSimpleEvaporatorWaterSteamFlueGases_Traces TestSimpleStaticCondenser TestSimpleStaticCondenser_Traces TestStaticCondenser diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo index 12091190..01274522 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model SimpleEvaporatorWaterSteamFlueGases "Simple water/steam - flue gases evaporator" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real Kdpf=10 "Flue gases pressure drop coefficient"; parameter Real Kdpe=10 "Water/steam pressure drop coefficient"; @@ -10,10 +11,8 @@ model SimpleEvaporatorWaterSteamFlueGases "Simple water/steam - flue gases evapo "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.MassFlowRate gamma_diff_fg=1e-4 "Diffusion conductance for the flue gases side (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region=IF97Region.All_regions "IF97 region for the water/steam side (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - parameter Integer mode=Integer(region) - 1 "IF97 region for the water/steam side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; public @@ -39,37 +38,26 @@ public Units.SI.Density rhof(start=0.9) "Flue gases density"; Units.SI.Density rhoe(start=700) "Water density"; Units.SI.Power W(start=1e8) "Power exchanged"; - FluidType ftype_ws "Fluid type for the water/steam side"; - Integer fluid_ws=Integer(ftype_ws) "Fluid number for the water/steam side"; - FluidType ftype_fg "Fluid type for the flue gases side"; - Integer fluid_fg=Integer(ftype_fg) "Fluid number for the flue gases side"; - - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation ( + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xfg[Medium_FlueGases.nXi](start=Medium_FlueGases.X_default[1:Medium_FlueGases.nXi]) "Flue gases mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium.ThermodynamicState state_ws_in "Water/steam inlet thermodynamic state"; + Medium.ThermodynamicState state_ws_out "Water/steam outlet thermodynamic state"; + Medium.ThermodynamicState state_ws_m "Water/steam average thermodynamic state"; + Medium.SaturationProperties sat_ws "Water/steam saturation properties at the outlet pressure"; + Medium_FlueGases.ThermodynamicState state_fg_in "Flue gases inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) annotation ( Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) annotation ( Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes - annotation (Placement(transformation(extent={{-52,80},{-32,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem - annotation (Placement(transformation(extent={{-76,80},{-56,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{80,80},{100,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{58,80},{78,100}}, rotation=0))); equation - /* Check that the fluid type for the water/steam side is water/steam */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "SimpleEvaporatorWaterSteamFlueGases: the fluid type must be water/steam for the water/steam side"); - /* Flue gases inlet */ Pef = Cfg1.P; Hef = Cfg1.h; @@ -89,14 +77,10 @@ equation Cfg2.diff_res_1 = Cfg1.diff_res_1 + 1/gamma_diff_fg; Cfg1.diff_res_2 = Cfg2.diff_res_2 + 1/gamma_diff_fg; - Cfg1.ftype = Cfg2.ftype; - - Cfg2.Xco2 = Cfg1.Xco2; - Cfg2.Xh2o = Cfg1.Xh2o; - Cfg2.Xo2 = Cfg1.Xo2; - Cfg2.Xso2 = Cfg1.Xso2; - - ftype_fg = Cfg1.ftype; + Cfg1.Xi = Cfg2.Xi; + Xfg = Cfg1.Xi; + Cfg1.SubC = Cfg2.SubC; + SubCfg = Cfg1.SubC; /* Water inlet */ Pee = Cws1.P; @@ -117,14 +101,10 @@ equation Cws2.diff_res_1 = Cws1.diff_res_1 + 1/gamma_diff_ws; Cws1.diff_res_2 = Cws2.diff_res_2 + 1/gamma_diff_ws; - Cws1.ftype = Cws2.ftype; - - Cws2.Xco2 = Cws1.Xco2; - Cws2.Xh2o = Cws1.Xh2o; - Cws2.Xo2 = Cws1.Xo2; - Cws2.Xso2 = Cws1.Xso2; - - ftype_ws = Cws1.ftype; + Cws1.Xi = Cws2.Xi; + Xws = Cws1.Xi; + Cws1.SubC = Cws2.SubC; + SubCws = Cws1.SubC; /* Pressure losses */ Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof; @@ -135,26 +115,28 @@ equation W = Qe*(Hse - Hee); /* Flue gases specific enthalpy at the inlet */ - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2); + state_fg_in = Medium_FlueGases.setState_phX(p=Pef, h=Hef, X=Xfg); + Tef = Medium_FlueGases.temperature(state_fg_in); /* Flue gases specific enthalpy at the outlet */ - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Psf, Hsf, fluid_fg, 0, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2); + state_fg_out = Medium_FlueGases.setState_phX(p=Psf, h=Hsf, X=Xfg); + Tsf = Medium_FlueGases.temperature(state_fg_out); /* Flue gases density */ - rhof = ThermoSysPro.Properties.Fluid.Density_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2); + rhof = Medium_FlueGases.density(state_fg_in); /* Water/steam thermodynamic properties */ - proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode, fluid_ws); - Tee = proee.T; + state_ws_in = Medium.setState_phX(p=Pee, h=Hee, X=Xws); + Tee = Medium.temperature(state_ws_in); - proem = ThermoSysPro.Properties.Fluid.Ph((Pee + Pse)/2, (Hee + Hse)/2, mode, fluid_ws); - rhoe = proem.d; + state_ws_m = Medium.setState_phX(p=(Pee + Pse)/2, h=(Hee + Hse)/2, X=Xws); + rhoe = Medium.density(state_ws_m); - proes = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode, fluid_ws); - Tse = proes.T; + state_ws_out = Medium.setState_phX(p=Pse, h=Hse, X=Xws); + Tse = Medium.temperature(state_ws_out); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pse, fluid_ws); - Hse = vsat.h; + sat_ws = Medium.setSat_p(Pse); + Hse = Medium.dewEnthalpy(sat_ws); annotation (Diagram(graphics={ Rectangle( From 2796e7fcd2649ffe843d4eb0b30c79b13b7190ba Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 11:38:47 +0200 Subject: [PATCH 135/213] #125 DynamicTwoPhaseFlowPipe --- .../TestDynamicTwoPhaseFlowPipe.mo | 43 +++++ .../TestDynamicTwoPhaseFlowPipe_Traces.mo | 46 +++++ .../HeatExchangers/package.order | 2 + .../HeatExchangers/DynamicTwoPhaseFlowPipe.mo | 162 +++++++----------- 4 files changed, 155 insertions(+), 98 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo new file mode 100644 index 00000000..9a62daa1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + L=10, + D=0.03, + dpfCorr(fixed=false, start=0.2396333653343408)=1, + P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,1995640.0182728,1994163.0145856,1992283.4952231,1990000})) + annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1)), + option_temperature=false, + h0=800e3, + P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( + Ns=10, + L=10, + lambda=10, + cpw=460, + rhow=7900, + e=0.005, + D=0.03) annotation (Placement(transformation(extent={{-40,-28},{40,52}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); + annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowPipe; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo new file mode 100644 index 00000000..1fdfc005 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + L=10, + D=0.03, + C1(SubC(start={0.1})), + C2(SubC(start={0.1})), + dpfCorr(fixed=false, start=0.2396333653343408)=1, + P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,1995640.0182728,1994163.0145856,1992283.4952231,1990000})) + annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1), SubC(start={0.1})), + option_temperature=false, + h0=800e3, + P0=2000000, + SubC0={0.1}) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( + Ns=10, + L=10, + lambda=10, + cpw=460, + rhow=7900, + e=0.005, + D=0.03) annotation (Placement(transformation(extent={{-40,-28},{40,52}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); + annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowPipe_Traces; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 87d02d37..2f5576ca 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -1,6 +1,8 @@ TestDynamicOnePhaseFlowPipe TestDynamicOnePhaseFlowPipe_Traces TestDynamicOnePhaseFlowPipe_FlueGases +TestDynamicTwoPhaseFlowPipe +TestDynamicTwoPhaseFlowPipe_Traces TestDynamicOnePhaseFlowShell TestDynamicOnePhaseFlowShell_Traces TestDynamicOnePhaseFlowShell_FlueGases diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo index 796c3ef6..6b445671 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo @@ -1,8 +1,8 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicTwoPhaseFlowPipe "Dynamic two-phase flow pipe" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=10. "Pipe length"; parameter Units.SI.Diameter D=0.2 "Internal pipe diameter"; @@ -41,12 +41,10 @@ model DynamicTwoPhaseFlowPipe "Dynamic two-phase flow pipe" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; parameter Units.SI.Area A=ntubes*pi*D^2/4 @@ -57,12 +55,9 @@ protected parameter Units.SI.Area dSi=pi*Di*dx1 "Internal heat exchange area for a node"; parameter Real Mmol=18.015 "Water molar mass"; - parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT - "Critical pressure"; - parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT - "Critical temperature"; - parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple - "Triple point pressure"; + parameter Units.SI.AbsolutePressure pcrit=Medium.fluidConstants[1].criticalPressure "Critical pressure"; + parameter Units.SI.Temperature Tcrit=Medium.fluidConstants[1].criticalTemperature "Critical temperature"; + parameter Units.SI.AbsolutePressure ptriple=Medium.fluidConstants[1].triplePointPressure "Triple point pressure"; parameter Real xb1=0.0002 "Min value for vapor mass fraction"; parameter Real xb2=0.85 "Max value for vapor mass fraction"; parameter Units.SI.MassFlowRate gamma0=1.e-4 @@ -183,12 +178,14 @@ public Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N)) "Friction pressure loss coefficient in node i for the vapor)"; Real filo[N] "Pressure loss coefficient for two-phase flow"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; + Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.ThermodynamicState state_c[2]; + Medium.SaturationProperties sat1[N - 1]; + Medium.SaturationProperties sat2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid"; Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor"; Real diff_res[N] "Total diffusion resistance in hydraulic node i"; @@ -209,32 +206,12 @@ public Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i"; Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1] - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2] - annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N] - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N] - annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N] - annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1] - annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1] - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); public - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); initial equation if dynamic_energy_balance then @@ -245,7 +222,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(Pb[i], T0[i - 1], X); end for; else for i in 2:N loop @@ -269,9 +246,6 @@ initial equation equation - /* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowPipe: the fluid type must be water/steam"); - /* Wall temperature */ Tp1 = CTh.T; CTh.W = dW1; @@ -301,19 +275,9 @@ equation C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - - ftype = C1.ftype; - - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; + C1.Xi = C2.Xi; + X = C1.Xi; + C1.SubC = C2.SubC; /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop @@ -321,7 +285,7 @@ equation BQ[i] = Q[i] - Q[i + 1]; if dynamic_energy_balance and dynamic_mass_balance then - A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i]; + A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i]; else 0 = BQ[i]; end if; @@ -334,7 +298,7 @@ equation if simplified_dynamic_energy_balance then A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i]; else - A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; + A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; end if; else A*rho1[i]*der(h[i + 1])*dx1 = BH[i]; @@ -421,37 +385,39 @@ equation end if; /* Fluid thermodynamic properties */ - pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid); + state1[i] = Medium.setState_phX(P[i + 1], h[i + 1], X); - rho1[i] = pro1[i].d; - T1[i] = pro1[i].T; - xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x; + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else Medium.vapourQuality(state1[i]); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); - (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid); + sat1[i] = Medium.setSat_p(P[i + 1]); if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then xbs[i] = 0; xbi[i] = 1; - rhol1[i] = pro1[i].d; - rhov1[i] = pro1[i].d; - cpl1[i] = pro1[i].cp; - cpv1[i] = pro1[i].cp; + rhol1[i] = rho1[i]; + rhov1[i] = rho1[i]; + cpl1[i] = Medium.specificHeatCapacityCp(state1[i]); + cpv1[i] = Medium.specificHeatCapacityCp(state1[i]); lv[i] = 1; else - xbs[i] = min(pro1[i].x, 0.90); - xbi[i] = max(pro1[i].x, 0.10); - rhol1[i] = max(pro1[i].d, lsat1[i].rho); - rhov1[i] = min(pro1[i].d, vsat1[i].rho); - cpl1[i] = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp; - cpv1[i] = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp; - lv[i] = vsat1[i].h - lsat1[i].h; + xbs[i] = min(xv1[i], 0.90); + xbi[i] = max(xv1[i], 0.10); + rhol1[i] = max(rho1[i], Medium.bubbleDensity(sat1[i])); + rhov1[i] = min(rho1[i], Medium.dewDensity(sat1[i])); + cpl1[i] = if noEvent(xv1[i] <= 0.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat1[i])); + cpv1[i] = if noEvent(xv1[i] >= 1.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat1[i])); + lv[i] = Medium.dewEnthalpy(sat1[i]) - Medium.bubbleEnthalpy(sat1[i]); end if; - mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid); - muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid); + mul1[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat1[i])); + muv1[i] = Medium.dynamicViscosity(Medium.setDewState(sat1[i])); - kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid); - kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid); + kl1[i] = Medium.thermalConductivity(Medium.setBubbleState(sat1[i])); + kv1[i] = Medium.thermalConductivity(Medium.setDewState(sat1[i])); Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple); end for; @@ -506,31 +472,31 @@ equation gamma[i] = if diffusion then 1/diff_res[i] else gamma0; /* Fluid thermodynamic properties */ - pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i], mode, fluid); + state2[i] = Medium.setState_phX((P[i] + P[i + 1])/2, hb[i], X); - rho2[i] = pro2[i].d; - xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x; - T2[i] = pro2[i].T; + rho2[i] = Medium.density(state2[i]); + xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else Medium.vapourQuality(state2[i]); + T2[i] = Medium.temperature(state2[i]); - (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid); + sat2[i] = Medium.setSat_p((P[i] + P[i + 1])/2); if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then - rhol2[i] = pro2[i].d; - rhov2[i] = pro2[i].d; - cpl2[i] = pro2[i].cp; - cpv2[i] = pro2[i].cp; + rhol2[i] = rho2[i]; + rhov2[i] = rho2[i]; + cpl2[i] = Medium.specificHeatCapacityCp(state2[i]); + cpv2[i] = Medium.specificHeatCapacityCp(state2[i]); else - rhol2[i] = max(pro2[i].d, lsat2[i].rho); - rhov2[i] = min(pro2[i].d, vsat2[i].rho); - cpl2[i] = if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp; - cpv2[i] = if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp; + rhol2[i] = max(rho2[i], Medium.bubbleDensity(sat2[i])); + rhov2[i] = min(rho2[i], Medium.dewDensity(sat2[i])); + cpl2[i] = if noEvent(xv2[i] <= 0.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat2[i])); + cpv2[i] = if noEvent(xv2[i] >= 1.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat2[i])); end if; - mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i], fluid); - muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i], fluid); + mul2[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat2[i])); + muv2[i] = Medium.dynamicViscosity(Medium.setDewState(sat2[i])); - kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); - kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); + kl2[i] = Medium.thermalConductivity(Medium.setBubbleState(sat2[i])); + kv2[i] = Medium.thermalConductivity(Medium.setDewState(sat2[i])); end for; /* Fluid densities at the boundaries of the nodes */ @@ -538,11 +504,11 @@ equation rhoc[i] = rho1[i - 1]; end for; - proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid); - proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid); + state_c[1] = Medium.setState_phX(P[1], h[1], X); + state_c[2] = Medium.setState_phX(P[N + 1], h[N + 1], X); - rhoc[1] = proc[1].d; - rhoc[N + 1] = proc[2].d; + rhoc[1] = Medium.density(state_c[1]); + rhoc[N + 1] = Medium.density(state_c[2]); W1t = sum(dW1); From bdcb80a0ffa3fcb921e44d9686822cd7d6d743f3 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 14:02:18 +0200 Subject: [PATCH 136/213] #125 DynamicTwoPhaseFlowRiser --- .../TestDynamicTwoPhaseFlowRiser.mo | 41 +++++ .../TestDynamicTwoPhaseFlowRiser_Traces.mo | 44 +++++ .../HeatExchangers/package.order | 2 + .../DynamicTwoPhaseFlowRiser.mo | 154 +++++++----------- 4 files changed, 147 insertions(+), 94 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo new file mode 100644 index 00000000..b3e20adc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowRiser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser( + redeclare package Medium = Medium, + L=10, + D=0.03, + inertia=false, + Ns=1, + steady_state=false, + option_temperature=false, + h0={800e3}) annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1)), + option_temperature=false, + h0=800e3, + P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource1.C, dynamicTwoPhaseFlowRiser.CTh1) annotation (Line(points={{0,31.2},{0,-7.7}}, color={191,95,0})); + connect(heatSource2.C, dynamicTwoPhaseFlowRiser.CTh2) annotation (Line(points={{0,-50},{0,-33.5}}, color={191,95,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowRiser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo new file mode 100644 index 00000000..777fc36f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo @@ -0,0 +1,44 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowRiser_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser( + redeclare package Medium = Medium, + L=10, + D=0.03, + inertia=false, + Ns=1, + steady_state=false, + option_temperature=false, + h0={800e3}, + C1(SubC(start={0.1})), + C2(SubC(start={0.1}))) annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1), SubC(start={0.1})), + option_temperature=false, + h0=800e3, + P0=2000000, + SubC0={0.1}) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource1.C, dynamicTwoPhaseFlowRiser.CTh1) annotation (Line(points={{0,31.2},{0,-7.7}}, color={191,95,0})); + connect(heatSource2.C, dynamicTwoPhaseFlowRiser.CTh2) annotation (Line(points={{0,-50},{0,-33.5}}, color={191,95,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowRiser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 2f5576ca..4cbbe684 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -3,6 +3,8 @@ TestDynamicOnePhaseFlowPipe_Traces TestDynamicOnePhaseFlowPipe_FlueGases TestDynamicTwoPhaseFlowPipe TestDynamicTwoPhaseFlowPipe_Traces +TestDynamicTwoPhaseFlowRiser +TestDynamicTwoPhaseFlowRiser_Traces TestDynamicOnePhaseFlowShell TestDynamicOnePhaseFlowShell_Traces TestDynamicOnePhaseFlowShell_FlueGases diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo index 050ef5ac..fc575000 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo @@ -1,8 +1,8 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicTwoPhaseFlowRiser "Dynamic two-phase flow riser" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=10. "Pipe length"; parameter Units.SI.Diameter D=0.02 "Hydraulic diameter"; @@ -41,12 +41,10 @@ model DynamicTwoPhaseFlowRiser "Dynamic two-phase flow riser" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; parameter Units.SI.Area A=ntubes*pi*D^2/4 @@ -57,12 +55,9 @@ protected parameter Units.SI.Area dSi=pi*Di*dx1 "Internal heat exchange area for a node"; parameter Real Mmol=18.015 "Water molar mass"; - parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT - "Critical pressure"; - parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT - "Critical temperature"; - parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple - "Triple point pressure"; + parameter Units.SI.AbsolutePressure pcrit=Medium.fluidConstants[1].criticalPressure "Critical pressure"; + parameter Units.SI.Temperature Tcrit=Medium.fluidConstants[1].criticalTemperature "Critical temperature"; + parameter Units.SI.AbsolutePressure ptriple=Medium.fluidConstants[1].triplePointPressure "Triple point pressure"; parameter Real xb1=0.0002 "Min value for vapor mass fraction"; parameter Real xb2=0.85 "Max value for vapor mass fraction"; parameter Units.SI.MassFlowRate gamma0=1.e-4 @@ -193,12 +188,14 @@ public Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N)) "Friction pressure loss coefficient in node i for the vapor)"; Real filo[N] "Pressure loss coefficient for two-phase flow"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; + Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.ThermodynamicState state_c[2]; + Medium.SaturationProperties sat1[N - 1]; + Medium.SaturationProperties sat2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid"; Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor"; Real diff_res[N] "Total diffusion resistance in hydraulic node i"; @@ -219,32 +216,12 @@ public Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i"; Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1] - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2] - annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N] - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N] - annotation (Placement(transformation(extent={{80,-100},{100,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N] - annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1] - annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1] - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); public - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-110,0},{-90,20}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort CTh1[Ns] annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,0},{110,20}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort CTh2[Ns] annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation= @@ -259,7 +236,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1],fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(Pb[i], T0[i - 1], X); end for; else for i in 2:N loop @@ -283,9 +260,6 @@ initial equation equation - /* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowRiser: the fluid type must be water/steam"); - /* Wall temperature */ Tp1 = CTh1.T; CTh1.W = dW1; @@ -318,19 +292,9 @@ equation C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - - ftype = C1.ftype; - - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; + C1.Xi = C2.Xi; + X = C1.Xi; + C1.SubC = C2.SubC; /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop @@ -338,7 +302,7 @@ equation /* Mass balance equation */ if dynamic_energy_balance and dynamic_mass_balance then - A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i]; + A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i]; else 0 = BQ[i]; end if; @@ -351,7 +315,7 @@ equation if simplified_dynamic_energy_balance then A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i]; else - A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; + A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; end if; else A*rho1[i]*der(h[i + 1])*dx1 = BH[i]; @@ -447,37 +411,39 @@ equation end if; /* Fluid thermodynamic properties */ - pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid); + state1[i] = Medium.setState_phX(P[i + 1], h[i + 1], X); - rho1[i] = pro1[i].d; - T1[i] = pro1[i].T; - xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x; + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else Medium.vapourQuality(state1[i]); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); - (lsat1[i],vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid); + sat1[i] = Medium.setSat_p(P[i + 1]); if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then xbs[i] = 0; xbi[i] = 1; - rhol1[i] = pro1[i].d; - rhov1[i] = pro1[i].d; - cpl1[i] = pro1[i].cp; - cpv1[i] = pro1[i].cp; + rhol1[i] = rho1[i]; + rhov1[i] = rho1[i]; + cpl1[i] = Medium.specificHeatCapacityCp(state1[i]); + cpv1[i] = Medium.specificHeatCapacityCp(state1[i]); lv[i] = 1; else - xbs[i] = min(pro1[i].x, 0.90); - xbi[i] = max(pro1[i].x, 0.10); - rhol1[i] = max(pro1[i].d, lsat1[i].rho); - rhov1[i] = min(pro1[i].d, vsat1[i].rho); - cpl1[i] = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp; - cpv1[i] = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp; - lv[i] = vsat1[i].h - lsat1[i].h; + xbs[i] = min(xv1[i], 0.90); + xbi[i] = max(xv1[i], 0.10); + rhol1[i] = max(rho1[i], Medium.bubbleDensity(sat1[i])); + rhov1[i] = min(rho1[i], Medium.dewDensity(sat1[i])); + cpl1[i] = if noEvent(xv1[i] <= 0.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat1[i])); + cpv1[i] = if noEvent(xv1[i] >= 1.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat1[i])); + lv[i] = Medium.dewEnthalpy(sat1[i]) - Medium.bubbleEnthalpy(sat1[i]); end if; - mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid); - muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid); + mul1[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat1[i])); + muv1[i] = Medium.dynamicViscosity(Medium.setDewState(sat1[i])); - kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid); - kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid); + kl1[i] = Medium.thermalConductivity(Medium.setBubbleState(sat1[i])); + kv1[i] = Medium.thermalConductivity(Medium.setDewState(sat1[i])); Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple); end for; @@ -532,25 +498,25 @@ equation gamma[i] = if diffusion then 1/diff_res[i] else gamma0; /* Fluid thermodynamic properties */ - pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i],mode,fluid); + state2[i] = Medium.setState_phX((P[i] + P[i + 1])/2, hb[i], X); - rho2[i] = pro2[i].d; - xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x; - T2[i] = pro2[i].T; + rho2[i] = Medium.density(state2[i]); + xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else Medium.vapourQuality(state2[i]); + T2[i] = Medium.temperature(state2[i]); - (lsat2[i],vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid); + sat2[i] = Medium.setSat_p((P[i] + P[i + 1])/2); - rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho); - rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho); + rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then rho2[i] else max(rho2[i], Medium.bubbleDensity(sat2[i])); + rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then rho2[i] else min(rho2[i], Medium.dewDensity(sat2[i])); - cpl2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp); - cpv2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp); + cpl2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then Medium.specificHeatCapacityCp(state2[i]) else (if noEvent(xv2[i] <= 0.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat2[i]))); + cpv2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then Medium.specificHeatCapacityCp(state2[i]) else (if noEvent(xv2[i] >= 1.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat2[i]))); - mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i],fluid); - muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i],fluid); + mul2[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat2[i])); + muv2[i] = Medium.dynamicViscosity(Medium.setDewState(sat2[i])); - kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); - kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); + kl2[i] = Medium.thermalConductivity(Medium.setBubbleState(sat2[i])); + kv2[i] = Medium.thermalConductivity(Medium.setDewState(sat2[i])); end for; /* Fluid densities at the boundaries of the nodes */ @@ -558,11 +524,11 @@ equation rhoc[i] = rho1[i - 1]; end for; - proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid); - proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid); + state_c[1] = Medium.setState_phX(P[1], h[1], X); + state_c[2] = Medium.setState_phX(P[N + 1], h[N + 1], X); - rhoc[1] = proc[1].d; - rhoc[N + 1] = proc[2].d; + rhoc[1] = Medium.density(state_c[1]); + rhoc[N + 1] = Medium.density(state_c[2]); W1t = sum(dW1); From 5979baaecf8581e1662603c0a33e514dc0ee130b Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 14:02:53 +0200 Subject: [PATCH 137/213] #125 DynamicTwoPhaseFlowRiser --- .../Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo index fc575000..d95d7279 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo @@ -55,9 +55,12 @@ protected parameter Units.SI.Area dSi=pi*Di*dx1 "Internal heat exchange area for a node"; parameter Real Mmol=18.015 "Water molar mass"; - parameter Units.SI.AbsolutePressure pcrit=Medium.fluidConstants[1].criticalPressure "Critical pressure"; - parameter Units.SI.Temperature Tcrit=Medium.fluidConstants[1].criticalTemperature "Critical temperature"; - parameter Units.SI.AbsolutePressure ptriple=Medium.fluidConstants[1].triplePointPressure "Triple point pressure"; + parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT + "Critical pressure"; + parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT + "Critical temperature"; + parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple + "Triple point pressure"; parameter Real xb1=0.0002 "Min value for vapor mass fraction"; parameter Real xb2=0.85 "Max value for vapor mass fraction"; parameter Units.SI.MassFlowRate gamma0=1.e-4 From a5bf4e82cb7a98b95e85949cb44d94eb9c2e7b15 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 14:23:58 +0200 Subject: [PATCH 138/213] #125 TwoPhaseCavity --- .../Volumes/TestTwoPhaseCavity.mo | 60 +++++ .../Volumes/TestTwoPhaseCavity_Traces.mo | 65 ++++++ .../SimpleExamples/Volumes/package.order | 2 + ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo | 221 ++++++++++-------- 4 files changed, 245 insertions(+), 103 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo new file mode 100644 index 00000000..59e389cc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo @@ -0,0 +1,60 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavity + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavity cavity( + redeclare package Medium = Medium, + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=1, + Vf0=0.5, + Cal_hconv=false) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400) annotation (Placement(transformation(extent={{-90,20},{-70,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteam( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6) annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, + Q0=2) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource3a( + T0={293.15,293.15}, + option_temperature=2, + W0={1e5,1e5}) + annotation (Placement(transformation(extent={{70,50},{90,70}}, rotation=0))); +equation + cavity.Cth3[3:2*cavity.Ns].W = fill(0, 2*cavity.Ns - 2); + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-70,30},{-40,30},{-40,32},{-1.66667,32}}, + color={0,0,0})); + connect(sourceSteam.C, cavity.Cv) annotation (Line(points={{-40,60},{10.3333,60},{10.3333,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10.3333,-12},{10.3333,-50},{-90,-50}}, + color={0,0,0})); + connect(heatSource1.C, cavity.Cth1) annotation (Line(points={{70,-69.8},{20,-69.8},{20,-5.3},{10.1667,-5.3}},color={255,0,0})); + connect(heatSource2.C, cavity.Cth2) annotation (Line(points={{80,0.2},{42,0.2},{42,25.1},{10.1667,25.1}}, + color={255,0,0})); + connect(cavity.Cth3, heatSource3a.C) annotation (Line(points={{10.1667,10.6},{58,10.6},{58,50.2},{80,50.2}}, color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavity; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo new file mode 100644 index 00000000..c526b9af --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo @@ -0,0 +1,65 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavity_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavity cavity( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=cavity.xv), + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=1, + Vf0=0.5, + Cal_hconv=false, + SubCl0={0}, + SubCv0={0}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400, + SubC0={0}) annotation (Placement(transformation(extent={{-90,20},{-70,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteam( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6, + SubC0={10}) annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, + Q0=2) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0))); + Thermal.BoundaryConditions.HeatSource heatSource3a( + T0={293.15,293.15}, + option_temperature=2, + W0={1e5,1e5}) + annotation (Placement(transformation(extent={{68,56},{88,76}}, rotation=0))); +equation + cavity.Cth3[3:2*cavity.Ns].W = fill(0, 2*cavity.Ns - 2); + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-70,30},{-40,30},{-40,32},{-1.66667,32}}, + color={0,0,0})); + connect(sourceSteam.C, cavity.Cv) annotation (Line(points={{-40,60},{10.3333,60},{10.3333,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10.3333,-12},{10.3333,-50},{-90,-50}}, + color={0,0,0})); + connect(heatSource1.C, cavity.Cth1) annotation (Line(points={{70,-69.8},{20,-69.8},{20,-5.3},{10.1667,-5.3}},color={255,0,0})); + connect(heatSource2.C, cavity.Cth2) annotation (Line(points={{80,0.2},{42,0.2},{42,25.1},{10.1667,25.1}}, + color={255,0,0})); + connect(cavity.Cth3, heatSource3a.C) annotation (Line(points={{10.1667,10.6},{64,10.6},{64,52},{78,52},{78,56.2}}, color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavity_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index c1f884cb..1949b3fe 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -36,5 +36,7 @@ TestDynamicDrum TestDynamicDrum_Traces TestTwoPhaseVolume TestTwoPhaseVolume_Traces +TestTwoPhaseCavity +TestTwoPhaseCavity_Traces TestPressurizer TestPressurizer_Traces diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo index 7c08789e..bf560520 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.Volumes; model TwoPhaseCavity "TwoPhaseCavity for one shell pass " - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; @@ -63,16 +63,22 @@ model TwoPhaseCavity "TwoPhaseCavity for one shell pass " parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi; parameter Integer Ns3=2*Ns "Number of segments for half pipes"; - parameter Integer fluid=Integer(ftype) "Fluid number"; parameter Units.SI.CoefficientOfHeatTransfer h4=1 "Heat exchange coefficient"; parameter Units.SI.Area S4=1 "Heat exchange surface"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.C_BiPhase C_record; public Units.SI.Length L(start=15) "Cavity length"; @@ -154,7 +160,6 @@ public "Heat transfer coefficient between the liquid and the cooling pipes zone 1"; Units.SI.Diameter DH(start=0.02) "hydraulic diameter"; Real EE[Ns](start=fill(1, Ns)); - FluidType fluids[4] "Fluids mixing in volume"; Units.SI.Power Je "Thermal power diffusion from inlet Ce"; Units.SI.Power Jv "Thermal power diffusion from inlet Cv"; Units.SI.Power Jl "Thermal power diffusion from outlet Cl"; @@ -166,23 +171,37 @@ public Real re "Value of r(Q/gamma) for inlet Ce"; Real rv "Value of r(Q/gamma) for inlet Cv"; Real rl "Value of r(Q/gamma) for outlet Cl"; - - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol - "Propri鴩s de l'eau dans le ballon" annotation (Placement(transformation( - extent={{-250,70},{-210,110}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov - "Propri鴩s de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{60,70},{100,110}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-250,-200},{-210,-160}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{58,-200},{98,-160}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cv "Steam input" annotation (Placement( + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + + Medium.ThermodynamicState state_l "Liquid state in the cavity"; + Medium.ThermodynamicState state_v "Vapor state in the cavity"; + Medium.ThermodynamicState state_in_l "Water inlet state"; + Medium.ThermodynamicState state_out_l "Water outlet state"; + Medium.SaturationProperties sat "Saturation properties at cavity pressure"; + Medium.SaturationProperties sat_wall "Saturation properties for wall heat transfer correlations"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at cavity pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at cavity pressure"; + Units.SI.Density rholsat "Bubble density at cavity pressure"; + Units.SI.Density rhovsat "Dew density at cavity pressure"; + Units.SI.Temperature Tsat "Saturation temperature at cavity pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + + Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) "Steam input" annotation (Placement( transformation(extent={{-88,50},{-68,70}}, rotation=0), iconTransformation(extent={{-88,50},{-68,70}}))); - Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement( + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "Water output" annotation (Placement( transformation(extent={{-88,-170},{-68,-150}}, rotation=0), iconTransformation(extent={{-88,-170},{-68,-150}}))); ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns3] @@ -194,10 +213,7 @@ public extent={{88,-109},{108,-89}}, rotation=0), iconTransformation(extent={ {88,-109},{108,-89}}))); public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod - annotation (Placement(transformation(extent={{-250,-20},{-210,20}}, - rotation=0))); - Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement( + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement( transformation(extent={{-160,50},{-140,70}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort Cth1[Ns] annotation (Placement(transformation( @@ -208,13 +224,6 @@ public extent={{-85,19},{-73,32}}, rotation=0), iconTransformation(extent={{ -85,19},{-73,32}}))); -public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - annotation (Placement(transformation(extent={{-250,-110},{-210,-70}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provIn - "Propri鴩s de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{12,70},{52,110}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -223,25 +232,20 @@ initial equation der(Vl) = 0; der(P) = 0; der(Tp) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; P = P0; der(Tp) = 0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cv.ftype; - fluids[4] = Cl.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "TwoPhaseCavity: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; @@ -249,11 +253,7 @@ equation Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cv) == 0) then @@ -262,11 +262,7 @@ equation Cv.h_vol_1 = 1.e5; Cv.diff_res_1 = 0; Cv.diff_on_1 = false; - Cv.ftype = ftype; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; + Cv.SubC = Medium.C_default; end if; if (cardinality(Cl) == 0) then @@ -322,22 +318,22 @@ equation Ape = Alp + Avp; /* Pressure at the bottom of the cavity */ - Pfond = P + prod.d*g*zl; + Pfond = P + Medium.density(state_out_l)*g*zl; /* Liquid phase mass balance equation */ - BQl = -Cl.Q + Qcond - Qevap + (1 - proe.x)*Ce.Q; + BQl = -Cl.Q + Qcond - Qevap + (1 - Medium.vapourQuality(state_in_l))*Ce.Q; if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; /* Vapor phase mass balance equation */ - BQv = Cv.Q + Qevap - Qcond + proe.x*Ce.Q; + BQv = Cv.Q + Qevap - Qcond + Medium.vapourQuality(state_in_l)*Ce.Q; if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; @@ -347,19 +343,19 @@ equation Cl.P = Pfond; /* Liquid phase energy balance equation */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t + Jt_l; + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (hl - P/rhol)) + (1 - Medium.vapourQuality(state_in_l))*Ce.Q*((if (Medium.vapourQuality(state_in_l) > 0) then hlsat else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t + Jt_l; if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; /* Gas phase energy balance equation */ - BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t + Jt_v; + BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (hv - P/rhov)) + Medium.vapourQuality(state_in_l)*Ce.Q*((if (Medium.vapourQuality(state_in_l) < 1) then hvsat else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t + Jt_v; if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -402,12 +398,12 @@ equation QS = Cl.Q /(DIc*Lc*(PasL - Dext)/PasL); Rel = noEvent( abs(QS*DH/mul)); - Prl = mul*prol.cp/kl; + Prl = mul*Medium.specificHeatCapacityCp(state_l)/kl; assert(PasL - Dext > 0, "Error Data for TwoPhaseCavity model (PasL - Dext)<= 0 "); for i in 1:Ns loop - mult[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tp1[i], fluid); + mult[i] = Medium.dynamicViscosity(Medium.setState_pTX(p=P, T=Tp1[i], X=Medium.reference_X)); EE[i]= max((PasT/Dext - 1/2/((((PasL/Dext)^2 + (PasT/Dext/2)^2)^0.5/Dext) - 1)), 1); @@ -420,14 +416,14 @@ equation end if; if Cal_hconv then - /* Heat transfer coefficient of vapeur*/ - if Vertical then - // Frank P. & David P. Fundamentals of Heat Transfer For (PasL/Dext)= 1.4 - hcond2[i] = COPv*noEvent(min(1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L2, 1)*mul*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); - else - // Nusselt corelation - hcond2[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); - end if; + /* Heat transfer coefficient of vapeur*/ + if Vertical then + // Frank P. & David P. Fundamentals of Heat Transfer For (PasL/Dext)= 1.4 + hcond2[i] = COPv*noEvent(min(1.13*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(max(L2, 1)*mul*abs(Tsat - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); + else + // Nusselt corelation + hcond2[i] = COPv*noEvent(min(0.728*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*abs(Tsat - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); + end if; else hcond2[i] = COPv*hcond; end if; @@ -449,14 +445,14 @@ equation for i in 1:Ns3 loop if Cal_hconv then - /* Heat transfer coefficient of vapeur*/ - if Vertical then - // Frank P. & David P. Fundamentals of Heat Transfer For vertical plate - hcond3[i] = COPv*noEvent(min( 1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L3,1)*mul*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); - else - // Nusselt corelation - hcond3[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); - end if; + /* Heat transfer coefficient of vapeur*/ + if Vertical then + // Frank P. & David P. Fundamentals of Heat Transfer For vertical plate + hcond3[i] = COPv*noEvent(min( 1.13*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(max(L3,1)*mul*abs(Tsat - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); + else + // Nusselt corelation + hcond3[i] = COPv*noEvent(min(0.728*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*abs(Tsat - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); + end if; else hcond3[i] = COPv*hcond; end if; @@ -474,15 +470,24 @@ equation W3t = sum(dW3); /* Total power exchanged for Deheating*/ - W4t = noEvent(if (Cv.h > vsat.h) then -Cv.Q*(Cv.h - vsat.h) else -0.0001); + W4t = noEvent(if (Cv.h > hvsat) then -Cv.Q*(Cv.h - hvsat) else -0.0001); - /* Fluid composition (no balance equations) */ - Cl.ftype = ftype; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = (1 - Medium.vapourQuality(state_in_l))*Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = Cv.Q*Cv.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*Ce.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; + Cl.SubC = SubCl; /* Flow reversal */ if continuous_flow_reversal then @@ -530,23 +535,33 @@ equation Cl.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid); - prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0, fluid); - provIn = ThermoSysPro.Properties.Fluid.Ph(P, Cv.h, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - - Tv = prov.T; - rhov = prov.d; - xv = prov.x; - - mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid); - kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid)); + state_in_l = Medium.setState_phX(p=P, h=Ce.h, X=Medium.reference_X); + state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + sat_wall = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + rholsat = Medium.bubbleDensity(sat_wall); + rhovsat = Medium.dewDensity(sat_wall); + Tsat = Medium.saturationTemperature(P); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); + + mul = Medium.dynamicViscosity(state_l); + kl = noEvent(Medium.thermalConductivity(state_l)); annotation ( Diagram(coordinateSystem( From 49c0e867b16932fde5fc4fc2e5858d3017c0f861 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 14:38:11 +0200 Subject: [PATCH 139/213] #125 TwoPhaseCavityOnePipe --- .../Volumes/TestTwoPhaseCavityOnePipe.mo | 57 +++++ .../TestTwoPhaseCavityOnePipe_Traces.mo | 63 ++++++ .../SimpleExamples/Volumes/package.order | 2 + .../Fluid/Volumes/TwoPhaseCavityOnePipe.mo | 212 +++++++++--------- 4 files changed, 230 insertions(+), 104 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo new file mode 100644 index 00000000..b435abf8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavityOnePipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavityOnePipe cavity( + redeclare package Medium = Medium, + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + hvIn(start=2.8e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=2, + Vf0=0.5, + Cal_hcond=false) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamBP( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6) annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamGCT( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, + Q0=3) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={293.15, 293.15}, + option_temperature=2, + W0={1e5, 1e5}) annotation (Placement(transformation(extent={{70,30},{90,50}}, rotation=0))); +equation + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-80,10},{-26,10},{-26,25.8},{-12.971,25.8}}, + color={0,0,0})); + connect(sourceSteamBP.C, cavity.CvBP) annotation (Line(points={{-60,60},{9.82857,60},{9.82857,32}}, + color={0,0,0})); + connect(sourceSteamGCT.C, cavity.CvGCT) annotation (Line(points={{-90,60},{-84,60},{-84,46},{-2.857,46},{-2.857,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10,-12},{10,-34},{-94,-34},{-94,-50},{-90,-50}}, + color={0,0,0})); + connect(cavity.Cth3, heatSource.C) annotation (Line(points={{9.82857,21.2},{50,21.2},{50,30.2},{80,30.2}}, + color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavityOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo new file mode 100644 index 00000000..a08ab52e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo @@ -0,0 +1,63 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavityOnePipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavityOnePipe cavity( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=cavity.xv), + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + hvIn(start=2.8e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=2, + Vf0=0.5, + Cal_hcond=false, + SubCl0={1}, + SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400, + SubC0={1}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamBP( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6, + SubC0={10}) annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamGCT( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6, + SubC0={10}) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, + Q0=0) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={293.15, 293.15}, + option_temperature=2, + W0={1e5, 1e5}) annotation (Placement(transformation(extent={{70,30},{90,50}}, rotation=0))); +equation + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-80,10},{-26,10},{-26,25.8},{-12.971,25.8}}, + color={0,0,0})); + connect(sourceSteamBP.C, cavity.CvBP) annotation (Line(points={{-60,60},{9.82857,60},{9.82857,32}}, + color={0,0,0})); + connect(sourceSteamGCT.C, cavity.CvGCT) annotation (Line(points={{-90,60},{-84,60},{-84,46},{-2.857,46},{-2.857,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10,-12},{10,-34},{-94,-34},{-94,-50},{-90,-50}}, + color={0,0,0})); + connect(cavity.Cth3, heatSource.C) annotation (Line(points={{9.82857,21.2},{50,21.2},{50,30.2},{80,30.2}}, + color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavityOnePipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order index 1949b3fe..f8cc92cc 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -38,5 +38,7 @@ TestTwoPhaseVolume TestTwoPhaseVolume_Traces TestTwoPhaseCavity TestTwoPhaseCavity_Traces +TestTwoPhaseCavityOnePipe +TestTwoPhaseCavityOnePipe_Traces TestPressurizer TestPressurizer_Traces diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo index fa24d18e..6be384a6 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.Volumes; model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass " - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = CvBP.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; @@ -41,13 +41,19 @@ model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass " steady_state)); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi; - parameter Integer fluid=Integer(ftype) "Fluid number"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.C_BiPhase C_record; public Units.SI.Pressure P(start=10000) "Fluid average pressure"; @@ -113,7 +119,6 @@ public "Heat exchange coefficient between the liquid phase and the wall"; Units.SI.CoefficientOfHeatTransfer Kvp(start=10) "Heat exchange coefficient between the gas phase and the wall"; - FluidType fluids[5] "Fluids mixing in volume"; Units.SI.Power Je "Thermal power diffusion from inlet Ce"; Units.SI.Power JvGCT "Thermal power diffusion from inlet CvGCT"; Units.SI.Power JvBP "Thermal power diffusion from inlet CvBP"; @@ -128,22 +133,33 @@ public Real rvGCT "Value of r(Q/gamma) for inlet CvGCT"; Real rvBP "Value of r(Q/gamma) for inlet CvBP"; Real rl "Value of r(Q/gamma) for outlet Cl"; - - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol - "Propri鴩s de l'eau dans le ballon" annotation (Placement(transformation( - extent={{-250,70},{-210,110}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov - "Propri鴩s de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{60,70},{100,110}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-250,-200},{-210,-160}}, - rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation( - extent={{58,-200},{98,-160}}, rotation=0))); - Interfaces.Connectors.FluidInlet CvBP "Steam input" annotation (Placement( + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + + Medium.ThermodynamicState state_l "Liquid state in the cavity"; + Medium.ThermodynamicState state_v "Vapor state in the cavity"; + Medium.ThermodynamicState state_in_l "Water inlet state"; + Medium.ThermodynamicState state_in_v "Average vapor inlet state"; + Medium.ThermodynamicState state_out_l "Water outlet state"; + Medium.SaturationProperties sat "Saturation properties at cavity pressure"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at cavity pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at cavity pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + + Interfaces.Connectors.FluidInlet CvBP(redeclare package Medium = Medium) "Steam input" annotation (Placement( transformation(extent={{-86,50},{-66,70}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cl "Water output" annotation (Placement( + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "Water output" annotation (Placement( transformation(extent={{-85,-170},{-65,-150}}, rotation=0))); ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns] annotation (Placement(transformation( @@ -152,18 +168,9 @@ public "Water level" annotation (Placement(transformation( extent={{88,-107},{108,-87}}, rotation=0))); public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod - annotation (Placement(transformation(extent={{-250,-16},{-210,24}}, - rotation=0))); - Interfaces.Connectors.FluidInlet Ce "Water input" annotation (Placement( + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement( transformation(extent={{-219,19},{-199,39}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - "Propri鴩s de l'eau dans le ballon" annotation (Placement(transformation( - extent={{-250,-106},{-210,-66}}, rotation=0))); - Properties.WaterSteam.Common.ThermoProperties_ph provIn - "Propri鴩s de la vapeur dans le ballon" annotation (Placement( - transformation(extent={{0,70},{40,110}}, rotation=0))); - Interfaces.Connectors.FluidInlet CvGCT "Steam input" annotation (Placement( + Interfaces.Connectors.FluidInlet CvGCT(redeclare package Medium = Medium) "Steam input" annotation (Placement( transformation(extent={{-160,50},{-140,70}}, rotation=0))); initial equation if dynamic_energy_balance then @@ -175,27 +182,21 @@ initial equation der(P) = 0; der(Tp) = 0; der(hvIn) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; P = P0; Tp = 320; hvIn = hv; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = CvGCT.ftype; - fluids[4] = CvBP.ftype; - fluids[5] = Cl.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "TwoPhaseCavityOnePipe: fluids mixing in volume are not compatible with each other"); - /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; @@ -203,11 +204,7 @@ equation Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.SubC = Medium.C_default; end if; if (cardinality(CvGCT) == 0) then @@ -216,11 +213,7 @@ equation CvGCT.h_vol_1 = 1.e5; CvGCT.diff_res_1 = 0; CvGCT.diff_on_1 = false; - CvGCT.ftype = ftype; - CvGCT.Xco2 = 0; - CvGCT.Xh2o = 0; - CvGCT.Xo2 = 0; - CvGCT.Xso2 = 0; + CvGCT.SubC = Medium.C_default; end if; if (cardinality(CvBP) == 0) then @@ -229,11 +222,7 @@ equation CvBP.h_vol_1 = 1.e5; CvBP.diff_res_1 = 0; CvBP.diff_on_1 = false; - CvBP.ftype = ftype; - CvBP.Xco2 = 0; - CvBP.Xh2o = 0; - CvBP.Xo2 = 0; - CvBP.Xso2 = 0; + CvBP.SubC = Medium.C_default; end if; if (cardinality(Cl) == 0) then @@ -274,22 +263,22 @@ equation Ape = Alp + Avp; /* Pressure at the bottom of the cavity */ - Pfond = P + prod.d*g*zl; + Pfond = P + Medium.density(state_out_l)*g*zl; /* Liquid phase mass balance equation */ - BQl = -Cl.Q + Qcond + QcondS + (1 - proe.x)*Ce.Q; + BQl = -Cl.Q + Qcond + QcondS + (1 - Medium.vapourQuality(state_in_l))*Ce.Q; if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; /* Vapor phase mass balance equation */ - BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + proe.x*Ce.Q; + BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + Medium.vapourQuality(state_in_l)*Ce.Q; if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; @@ -300,19 +289,19 @@ equation Ce.P = P; /* Liquid phase energy balance equation */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond + QcondS)*(lsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wlp + Wvl + Jt_l; + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond + QcondS)*(hlsat - (hl - P/rhol)) + (1 - Medium.vapourQuality(state_in_l))*Ce.Q*((if (Medium.vapourQuality(state_in_l) > 0) then hlsat else Ce.h) - (hl - P/rhol)) - Wlp + Wvl + Jt_l; if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; /* Gas phase energy balance equation */ - BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond + QcondS)*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt + Jt_v; + BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond + QcondS)*(hlsat - (hv - P/rhov)) + Medium.vapourQuality(state_in_l)*Ce.Q*((if (Medium.vapourQuality(state_in_l) < 1) then hvsat else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt + Jt_v; if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -324,25 +313,34 @@ equation /* Condensation mass flow rates */ // Only the power used to condensate steam - Qcond = (-Wt + Wt2 + noEvent(max(Wvl, 0)) + Wvp)/(vsat.h - lsat.h); + Qcond = (-Wt + Wt2 + noEvent(max(Wvl, 0)) + Wvp)/(hvsat - hlsat); - QcondS = (1 - provIn.x)*(CvBP.Q + CvGCT.Q); + QcondS = (1 - Medium.vapourQuality(state_in_v))*(CvBP.Q + CvGCT.Q); /* Steam average specific enthalpy input cavity */ // 0 = noEvent(hvIn*(max(CvBP.Q, 1e-10) + max(CvGCT.Q, 1e-10)) - max(CvBP.Q, 1e-10)*CvBP.h - max(CvGCT.Q, 1e-10)*CvGCT.h); if dynamic_energy_balance then - 0.1*provIn.d*der(hvIn) = CvBP.Q*(CvBP.h - (hvIn - P/rhov)) + CvGCT.Q*(CvGCT.h - (hvIn - P/rhov)); + 0.1*Medium.density(state_in_v)*der(hvIn) = CvBP.Q*(CvBP.h - (hvIn - P/rhov)) + CvGCT.Q*(CvGCT.h - (hvIn - P/rhov)); else 0 = hvIn*(CvBP.Q + CvGCT.Q) - CvBP.Q*CvBP.h - CvGCT.Q*CvGCT.h; end if; - /* Fluid composition (no balance equations) */ - Cl.ftype = ftype; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = (1 - Medium.vapourQuality(state_in_l))*Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + (Qcond + QcondS)*C_record.Cl; + BSubCv = CvBP.Q*CvBP.SubC + CvGCT.Q*CvGCT.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*Ce.SubC - (Qcond + QcondS)*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; + Cl.SubC = SubCl; /* Flow reversal */ if continuous_flow_reversal then @@ -398,41 +396,47 @@ equation Cl.diff_on_1 = diffusion; /* Fluid thermodynamic properties*/ - proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid); - prol = ThermoSysPro.Properties.Fluid.Ph((P+Pfond)/2, hl, 0, fluid); - - provIn = ThermoSysPro.Properties.Fluid.Ph(P, hvIn, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid); - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid); - - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - - Tv = prov.T; - rhov = prov.d; - xv = prov.x; - - muv = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(provIn.d, provIn.T, fluid); - mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid); - kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid)); - kv = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(provIn.d, provIn.T, P, 0,fluid)); + state_in_l = Medium.setState_phX(p=P, h=Ce.h, X=Medium.reference_X); + state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X); + state_in_v = Medium.setState_phX(p=P, h=hvIn, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); + + muv = Medium.dynamicViscosity(state_in_v); + mul = Medium.dynamicViscosity(state_l); + kl = noEvent(Medium.thermalConductivity(state_l)); + kv = noEvent(Medium.thermalConductivity(state_in_v)); /* Heat transfer coefficient between liquid and wall*/ /* SACADURA, Von Karman equation*/ Rel = noEvent(abs(Cl.Q*zl/(pi*R^2*mul))); - Klp = 0.037*kl*Rel^0.8*(mul*prol.cp/kl)^0.3333/zl; + Klp = 0.037*kl*Rel^0.8*(mul*Medium.specificHeatCapacityCp(state_l)/kl)^0.3333/zl; /* Heat transfer coefficient between steam and wall*/ - Rev = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(L - zl)/(pi*R^2*muv))); - Revl = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(2*R)/(pi*R^2*muv))); + Rev = noEvent(abs((CvBP.Q + CvGCT.Q + Medium.vapourQuality(state_in_l)*Ce.Q)*(L - zl)/(pi*R^2*muv))); + Revl = noEvent(abs((CvBP.Q + CvGCT.Q + Medium.vapourQuality(state_in_l)*Ce.Q)*(2*R)/(pi*R^2*muv))); - Kvp = 0.037*kv*Rev^0.8*(muv*prov.cp/kv)^0.3333/(L - zl); + Kvp = 0.037*kv*Rev^0.8*(muv*Medium.specificHeatCapacityCp(state_v)/kv)^0.3333/(L - zl); /* Heat transfer coefficient between steam and liquid */ - Kvl = 0.105*kv*Revl^0.68*(muv*prov.cp/kv)^0.33333*(L/2/R)^(-0.103)/(2*R); + Kvl = 0.105*kv*Revl^0.68*(muv*Medium.specificHeatCapacityCp(state_v)/kv)^0.33333*(L/2/R)^(-0.103)/(2*R); /* Thermal power losses*/ /* Energy balance equation at the wall */ @@ -459,8 +463,8 @@ equation if Cal_hcond then // Nusselt corelation hcond3[i] = ThermoSysPro.Functions.SmoothCond(Tv - Tp1[i], - COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]), 0.1)))^0.25, - COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h -lsat.h))/(NbTubV*mul*Dext*0.1))^0.25); + COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]), 0.1)))^0.25, + COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*0.1))^0.25); else hcond3[i] = hcond; end if; @@ -473,7 +477,7 @@ equation /* Total power exchanged for deheating*/ /* This equation is not valid for mass flow rate in the pipes = 0 */ - Wt2 = noEvent(if (hvIn > vsat.h) then -(CvBP.Q + CvGCT.Q)*(hvIn - vsat.h) else 0); + Wt2 = noEvent(if (hvIn > hvsat) then -(CvBP.Q + CvGCT.Q)*(hvIn - hvsat) else 0); annotation ( Diagram(coordinateSystem( From d1073aad7f8c1c67df2aa1dbd1dcb0c64d4f383e Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 14:56:08 +0200 Subject: [PATCH 140/213] #125 modified StaticDrum for subC balance --- .../Junctions/TestStaticDrum_Plug_Traces.mo | 11 ++++--- .../Junctions/TestStaticDrum_Traces.mo | 13 ++++---- .../PhasesSeparation.mo | 2 +- ThermoSysPro/Fluid/Junctions/StaticDrum.mo | 30 +++++++++++++++---- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo index 5da9e6d3..b8cd3e1d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo @@ -2,11 +2,10 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; model TestStaticDrum_Plug_Traces extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = Properties.Media.WaterSteam ( - extraPropertiesNames={"Trace"}, - C_nominal={0.1}, - C_default={0.2}); - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=StaticDrumTh1.x)) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); @@ -18,7 +17,7 @@ model TestStaticDrum_Plug_Traces ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug(redeclare package Medium = Medium, C(h(fixed=true))) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug(redeclare package Medium = Medium, C(h(fixed=false), SubC={10})) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); equation connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255})); connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo index 10270d0f..3d5d4c78 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo @@ -2,15 +2,16 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; model TestStaticDrum_Traces extends ThermoSysPro.UsersGuide.Icons.Example; - replaceable package Medium = Properties.Media.WaterSteam ( - extraPropertiesNames={"Trace"}, - C_nominal={0.1}, - C_default={0.2}); - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=StaticDrumTh1.x)) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, + P0=10000000, + SubC0={10}) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo index d1d7026a..b9c1251f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo @@ -9,7 +9,7 @@ algorithm // C_record.Cg := SubC; // Non-volatile - C_record.Cl := SubC/(1 - x); + C_record.Cl := SubC/max(1 - x, Modelica.Constants.eps); C_record.Cg := fill(0, size(SubC, 1)); // // Fully-volatile diff --git a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo index d2fcb382..1158844a 100644 --- a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo +++ b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo @@ -2,6 +2,7 @@ within ThermoSysPro.Fluid.Junctions; model StaticDrum "Static drum" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Ce_steam.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real x=1 "Vapor separation efficiency at the outlet"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; @@ -20,7 +21,10 @@ public Units.SI.SpecificEnthalpy hl(start=100000) "Liquid phase specific enthalpy"; Units.SI.SpecificEnthalpy hv(start=2800000) "Gas phase specific enthalpy"; Medium.MassFraction X[Medium.nXi] "Fluid mass fraction"; - Medium.ExtraProperty SubC[Medium.nC] "Fluid trace substances"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames) "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames) "Vapor phase trace substances"; + Medium.ExtraProperty SubCs_sur[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace substances at the steam/reheater outlet"; + Medium.C_BiPhase C_record; Units.SI.Power Je_steam "Thermal power diffusion from inlet e_steam"; Units.SI.Power Je_sup "Thermal power diffusion from inlet e_sup"; Units.SI.Power Je_eva "Thermal power diffusion from inlet e_eva"; @@ -68,6 +72,10 @@ public extent={{-10,-10},{10,10}}, rotation=0))); Medium.SaturationProperties sat; + Medium.ThermodynamicState state_e_steam "Steam inlet state"; + Medium.ThermodynamicState state_e_sup "Extra inlet state"; + Medium.ThermodynamicState state_e_eva "Evaporator inlet state"; + Medium.ThermodynamicState state_e_eco "Economizer inlet state"; equation /* Unconnected connectors */ @@ -182,12 +190,18 @@ equation X = Cs_sur.Xi; /* Traces composition balance equations */ - fill(0, Medium.nC) = Ce_steam.SubC*Ce_steam.Q + Ce_sup.SubC*Ce_sup.Q + Ce_eva.SubC*Ce_eva.Q + Ce_eco.SubC*Ce_eco.Q - Cs_sur.SubC*Cs_sur.Q - Cs_sup.SubC*Cs_sup.Q - Cs_purg.SubC*Cs_purg.Q - Cs_eva.SubC*Cs_eva.Q; + C_record = PhasesSeparationFunction(); - SubC = Cs_eva.SubC; - SubC = Cs_purg.SubC; - SubC = Cs_sup.SubC; - SubC = Cs_sur.SubC; + fill(0, Medium.nC) = (1 - Medium.vapourQuality(state_e_steam))*Ce_steam.Q*Ce_steam.SubC + (1 - Medium.vapourQuality(state_e_sup))*Ce_sup.Q*Ce_sup.SubC + (1 - Medium.vapourQuality(state_e_eva))*Ce_eva.Q*Ce_eva.SubC + (1 - Medium.vapourQuality(state_e_eco))*Ce_eco.Q*Ce_eco.SubC - Cs_eva.Q*Cs_eva.SubC - Cs_purg.Q*Cs_purg.SubC - Cs_sup.Q*Cs_sup.SubC + Medium.vapourQuality(state_e_steam)*Ce_steam.Q*C_record.Cl + Medium.vapourQuality(state_e_sup)*Ce_sup.Q*C_record.Cl + Medium.vapourQuality(state_e_eva)*Ce_eva.Q*C_record.Cl + Medium.vapourQuality(state_e_eco)*Ce_eco.Q*C_record.Cl - (1 - x)*Cs_sur.Q*SubCl; + + fill(0, Medium.nC) = Medium.vapourQuality(state_e_steam)*Ce_steam.Q*C_record.Cg + Medium.vapourQuality(state_e_sup)*Ce_sup.Q*C_record.Cg + Medium.vapourQuality(state_e_eva)*Ce_eva.Q*C_record.Cg + Medium.vapourQuality(state_e_eco)*Ce_eco.Q*C_record.Cg - x*Cs_sur.Q*SubCv; + + SubCs_sur = (1 - x)*SubCl + x*SubCv; + + Cs_eva.SubC = SubCl; + Cs_purg.SubC = SubCl; + Cs_sup.SubC = SubCl; + Cs_sur.SubC = SubCs_sur; /* Flow reversal */ if continuous_flow_reversal then @@ -280,6 +294,10 @@ equation Cs_sur.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ + state_e_steam = Medium.setState_phX(p=P, h=Ce_steam.h, X=Medium.reference_X); + state_e_sup = Medium.setState_phX(p=P, h=Ce_sup.h, X=Medium.reference_X); + state_e_eva = Medium.setState_phX(p=P, h=Ce_eva.h, X=Medium.reference_X); + state_e_eco = Medium.setState_phX(p=P, h=Ce_eco.h, X=Medium.reference_X); sat = Medium.setSat_p(P); hl = Medium.bubbleEnthalpy(sat); From 8cc4569b7bee7a8b1ff5db0a92f80681580cba85 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 16:11:40 +0200 Subject: [PATCH 141/213] #125 InvSingularPressureLoss and LumpedStraightPipe --- .../TestInvSingularPressureLoss.mo | 17 ++++++++++ .../TestInvSingularPressureLoss_FlueGases.mo | 22 ++++++++++++ .../TestInvSingularPressureLoss_Traces.mo | 18 ++++++++++ .../PressureLosses/TestLumpedStraightPipe.mo | 18 ++++++++++ .../TestLumpedStraightPipe_FlueGases.mo | 23 +++++++++++++ .../TestLumpedStraightPipe_Traces.mo | 19 +++++++++++ .../PressureLosses/package.order | 6 ++++ .../PressureLosses/InvSingularPressureLoss.mo | 26 +++++--------- .../PressureLosses/LumpedStraightPipe.mo | 34 ++++++++----------- 9 files changed, 146 insertions(+), 37 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo new file mode 100644 index 00000000..61534adc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestInvSingularPressureLoss + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(invSingularPressureLoss.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(invSingularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestInvSingularPressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo new file mode 100644 index 00000000..9fcc68d7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestInvSingularPressureLoss_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(invSingularPressureLoss.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(invSingularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestInvSingularPressureLoss_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo new file mode 100644 index 00000000..b041dcab --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestInvSingularPressureLoss_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + SubC0={10,20,30}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(invSingularPressureLoss.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(invSingularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestInvSingularPressureLoss_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo new file mode 100644 index 00000000..8ee42b80 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare replaceable package Medium = Medium, + L=10, + D=0.2) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(lumpedStraightPipe.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo new file mode 100644 index 00000000..623c5fdc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare replaceable package Medium = Medium, + L=10, + D=0.2) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(lumpedStraightPipe.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo new file mode 100644 index 00000000..52c96120 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare replaceable package Medium = Medium, + L=10, + D=0.2) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + SubC0={10,20,30}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(lumpedStraightPipe.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index dff4b5f9..81d4ca5e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -4,6 +4,12 @@ TestPipePressureLoss_Traces TestSingularPressureLoss TestSingularPressureLoss_Traces TestSingularPressureLoss_Traces_FlueGases +TestLumpedStraightPipe +TestLumpedStraightPipe_FlueGases +TestLumpedStraightPipe_Traces +TestInvSingularPressureLoss +TestInvSingularPressureLoss_FlueGases +TestInvSingularPressureLoss_Traces TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases diff --git a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo index e20f2e35..90c5695c 100644 --- a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo @@ -1,16 +1,13 @@ within ThermoSysPro.Fluid.PressureLosses; model InvSingularPressureLoss "Inverse singular pressure loss" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; constant Real pi=Modelica.Constants.pi "pi"; parameter Units.SI.MassFlowRate Qeps=1.e-3 "Small mass flow rate"; @@ -23,13 +20,12 @@ public Units.SI.Temperature T(start=290) "Fluid temperature"; Units.SI.Density rho(start=998) "Fluid density"; Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); equation @@ -45,31 +41,27 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; - /* Pressure loss */ deltaP = if noEvent(abs(Q) < Qeps) then 1.e-10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho; /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; annotation ( diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index fb8f7fb1..54439c4d 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -1,8 +1,7 @@ within ThermoSysPro.Fluid.PressureLosses; model LumpedStraightPipe "Lumped straight pipe (circular duct)" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=10. "Pipe length"; parameter Units.SI.Diameter D=0.2 "Pipe internal hydraulic diameter"; @@ -19,12 +18,10 @@ model LumpedStraightPipe "Lumped straight pipe (circular duct)" "true: momentum balance equation with inertia - false: without inertia"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; parameter Units.SI.Area A=ntubes*pi*D^2/4 "Pipe cross-sectional area (circular duct is assumed)"; @@ -47,13 +44,13 @@ public Units.SI.SpecificHeatCapacity cp(start=4200) "Fluid specific heat capacity"; Units.SI.ThermalConductivity k(start=0.05) "Fluid thermal conductivity"; Units.SI.MassFlowRate gamma_diff(start=1.e-4) "Diffusion conductance"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + Medium.ThermodynamicState state "Fluid thermodynamic state"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); initial equation if inertia then @@ -74,19 +71,15 @@ equation C2.diff_res_1 = C1.diff_res_1 + 1/gamma_diff; C1.diff_res_2 = C2.diff_res_2 + 1/gamma_diff; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; + X = C1.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; - /* Diffusion resistance */ gamma_diff = A*k/cp/L; @@ -117,17 +110,18 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; + state = Medium.setState_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density(state); end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - k = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o,C1.Xo2, C1.Xso2); - cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature(state); + mu = Medium.dynamicViscosity(state); + k = Medium.thermalConductivity(state); + cp = Medium.specificHeatCapacityCp(state); annotation ( Diagram(coordinateSystem( From ba1afafc65dc5bd8f178f016c13b46fafb267b38 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 16:43:12 +0200 Subject: [PATCH 142/213] #125 StaticAerocondenser, example not working yet --- .../HeatExchangers/TestStaticAerocondenser.mo | 84 +++++ .../TestStaticAerocondenser_TSP.mo | 96 ++++++ .../HeatExchangers/package.order | 2 + .../HeatExchangers/StaticAerocondenser.mo | 317 +++--------------- 4 files changed, 221 insertions(+), 278 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo new file mode 100644 index 00000000..cc15ced7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo @@ -0,0 +1,84 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticAerocondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases; + + model SourceH + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; + parameter Units.SI.MassFlowRate Q0=1; + parameter Units.SI.SpecificEnthalpy h0=1e5; + parameter Medium.MassFraction X0[Medium.nXi]=Medium.X_default[1:Medium.nXi]; + parameter Medium.ExtraProperty SubC0[Medium.nC]=Medium.C_default; + parameter Boolean fix_h_vol_2=false; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium); + equation + C.Q = Q0; + C.h = h0; + C.h_vol_1 = h0; + if fix_h_vol_2 then + C.h_vol_2 = h0; + end if; + C.diff_res_1 = 0; + C.diff_on_1 = false; + C.Xi = X0; + C.SubC = SubC0; + end SourceH; + + model SinkDiff + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; + parameter Boolean fix_h_vol_2=false; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); + equation + if fix_h_vol_2 then + C.h_vol_2 = C.h; + end if; + C.diff_res_2 = 0; + C.diff_on_2 = false; + end SinkDiff; + + model SinkPOnly + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; + parameter Units.SI.AbsolutePressure P0=1e5; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); + equation + C.P = P0; + C.diff_res_2 = 0; + C.diff_on_2 = false; + end SinkPOnly; + + ThermoSysPro.Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser( + redeclare package Medium = Medium, + redeclare package Medium_Air = Medium_Air, + Se=10000, + z=0.5, + use_Cw=true, + Ka=1) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + SourceH steamSource( + redeclare package Medium = Medium, + Q0=100, + h0=2600000) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=-90, + origin={4,22}))); + SourceH drainSource( + redeclare package Medium = Medium, + Q0=1, + h0=370000) annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}, rotation=0))); + SinkDiff condensateSink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90))); + SourceH airSource( + redeclare package Medium = Medium_Air, + fix_h_vol_2=true, + Q0=1400, + h0=Medium_Air.specificEnthalpy_pTX(p=100000, T=293.15, X=Medium_Air.X_default)) annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0))); + SinkPOnly airSink( + redeclare package Medium = Medium_Air, + P0=100000) annotation (Placement(transformation(extent={{40,50},{60,70}}, rotation=90))); +equation + staticAerocondenser.Cws2.h_vol_2 = staticAerocondenser.Cws2.h; + connect(steamSource.C, staticAerocondenser.Cws1) annotation (Line(points={{0,50},{0,9.16667}}, color={0,0,0})); + connect(drainSource.C, staticAerocondenser.Cw) annotation (Line(points={{-50,-30},{-9.16667,-7.5}}, color={0,0,0})); + connect(staticAerocondenser.Cws2, condensateSink.C) annotation (Line(points={{0,-9.16667},{0,-50}}, color={0,0,0})); + connect(airSource.C, staticAerocondenser.Cair1) annotation (Line(points={{40,0},{9.16667,-9.08333}}, color={0,0,0})); + connect(staticAerocondenser.Cair2, airSink.C) annotation (Line(points={{9.16667,9.16667},{50,50}}, color={0,0,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticAerocondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo new file mode 100644 index 00000000..538ad522 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo @@ -0,0 +1,96 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticAerocondenser_TSP + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases; + + model SourceH + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; + parameter Units.SI.MassFlowRate Q0=1; + parameter Units.SI.SpecificEnthalpy h0=1e5; + parameter Medium.MassFraction X0[Medium.nXi]=Medium.X_default[1:Medium.nXi]; + parameter Medium.ExtraProperty SubC0[Medium.nC]=Medium.C_default; + parameter Boolean fix_h_vol_2=false; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium); + equation + C.Q = Q0; + C.h = h0; + C.h_vol_1 = h0; + if fix_h_vol_2 then + C.h_vol_2 = h0; + end if; + C.diff_res_1 = 0; + C.diff_on_1 = false; + C.Xi = X0; + C.SubC = SubC0; + end SourceH; + + model SinkDiff + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; + parameter Boolean fix_h_vol_2=false; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); + equation + if fix_h_vol_2 then + C.h_vol_2 = C.h; + end if; + C.diff_res_2 = 0; + C.diff_on_2 = false; + end SinkDiff; + + model SinkPOnly + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; + parameter Units.SI.AbsolutePressure P0=1e5; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); + equation + C.P = P0; + C.diff_res_2 = 0; + C.diff_on_2 = false; + end SinkPOnly; + + ThermoSysPro.Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser( + redeclare package Medium = Medium, + redeclare package Medium_Air = Medium_Air, + Se=10000, + z=0.5, + use_Cw=true, + Ka=1) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + SourceH airSource( + redeclare package Medium = Medium_Air, + fix_h_vol_2=true, + Q0=1400, + h0=Medium_Air.specificEnthalpy_pTX( + p=100000, + T=293.15, + X=Medium_Air.X_default)) annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ drainSource( + redeclare package Medium = Medium, + Q0=1, + T0=340, + h0=370000) annotation (Placement(transformation(extent={{-70,-62},{-50,-42}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource1( + redeclare package Medium = Medium, + Q0=100, + T0=340, + h0=2600000) annotation (Placement(transformation(extent={{-44,68},{-24,88}}, rotation=0))); + SinkDiff condensateSink(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-70},{10,-50}}, + rotation=-90, + origin={100,-34}))); + SinkPOnly airSink(redeclare package Medium = Medium_Air, P0=100000) annotation (Placement(transformation( + extent={{40,50},{60,70}}, + rotation=90, + origin={92,-10}))); +equation + staticAerocondenser.Cws2.h_vol_2 = staticAerocondenser.Cws2.h; + + connect(airSource.C, staticAerocondenser.Cair1) annotation (Line(points={{40,0},{9.16667,-9.08333}}, color={0,0,0})); + connect(drainSource.C, staticAerocondenser.Cw) annotation (Line(points={{-50,-52},{-16,-52},{-16,-7.5},{-9.16667,-7.5}}, color={0,0,0})); + connect(staticAerocondenser.Cws1, steamSource1.C) annotation (Line(points={{0,9.16667},{0,78},{-24,78}}, color={0,0,0})); + connect(staticAerocondenser.Cws2, condensateSink.C) annotation (Line(points={{0,-9.16667},{0,-36},{24,-36},{24,-76}}, color={0,0,0})); + connect(staticAerocondenser.Cair2, airSink.C) annotation (Line(points={{9.16667,9.16667},{142,40}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticAerocondenser_TSP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 4cbbe684..707e0f75 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -37,4 +37,6 @@ TestStaticCondenser TestStaticCondenser_Traces TestStaticCondenserHEI TestStaticCondenserHEI_Traces +TestStaticAerocondenser TestDynamicPlateHeatExchangerW +TestStaticAerocondenser_TSP diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo index 40d08f2a..c48369ab 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo @@ -1,35 +1,27 @@ within ThermoSysPro.Fluid.HeatExchangers; model StaticAerocondenser "Static aerocondenser" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the air side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.CoefficientOfHeatTransfer Uref=50 "Reference heat transfer coefficient between the air and the condenser external wall"; parameter Real UCOR=1. "Heat transfer corrective coefficient"; parameter Units.SI.Area Se=1.e4 "Condenser external wall area"; parameter Units.SI.Height z=0 "Water level in the condenser"; - parameter Real K=0.02 "Pressure loss coefficient for the water/steam pipe (Pa.s²/(kg.m**3))"; - parameter Real Ka=0.00 "Pressure loss coefficient for the air (Pa.s²/(kg.m**3))"; + parameter Real K=0.02 "Pressure loss coefficient for the water/steam pipe (Pa.s2/(kg.m3))"; + parameter Real Ka=0.00 "Pressure loss coefficient for the air (Pa.s2/(kg.m3))"; parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_s=IF97Region.All_regions "IF97 region at the outlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter Boolean use_Cw=false "true: enable drain inlet Cw" annotation(Evaluate=true, Dialog(tab="General", group="Optional connectors")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer fluid_w=Integer(ftype) "Water fluid number"; - parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_s=Integer(region_s) - 1 "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Units.SI.MassFlowRate Qeps=1.e-3 - "Small mass flow rate for continuous flow reversal"; public Units.SI.SpecificEnthalpy he(start=370000) @@ -63,7 +55,6 @@ public Units.SI.Density rho_e(start=998) "Water density at the outlet of the condenser"; Units.SI.Density rho_a(start=1) "Air density"; - FluidType fluids[4] "Fluids mixing in volume"; Units.SI.Power Jws1 "Thermal power diffusion from inlet Cws1"; Units.SI.Power Jw "Thermal power diffusion from inlet Cw"; Units.SI.Power Jws2 "Thermal power diffusion from outlet Cws2"; @@ -74,48 +65,34 @@ public Real rws1 "Value of r(Q/gamma) for inlet Cws1"; Real rw "Value of r(Q/gamma) for inlet Cw"; Real rws2 "Value of r(Q/gamma) for outlet Cws1"; - FluidType ftype_a "Air fluid type"; - Integer fluid_a=Integer(ftype_a) "Air fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity"; + Medium_Air.MassFraction X_Air[Medium_Air.nXi](start=Medium_Air.X_default[1:Medium_Air.nXi]) "Air mass fractions"; + Medium.SaturationProperties sat "Saturation properties inside the condenser"; public - Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,100},{10,120}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,-120},{10,-100}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cair1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cair1(redeclare package Medium = Medium_Air) annotation (Placement(transformation( extent={{100,-119},{120,-99}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cair2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cair2(redeclare package Medium = Medium_Air) annotation (Placement(transformation( extent={{100,100},{120,120}}, rotation=0))); public - Interfaces.Connectors.FluidInlet Cw annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cw(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-120,-100},{-100,-80}}, rotation=0), iconTransformation( extent={{-120,-100},{-100,-80}}))); - Properties.WaterSteam.Common.ThermoProperties_ph proe "Water properties" - annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0))); - Properties.WaterSteam.Common.PropThermoSat lsat annotation (Placement( - transformation(extent={{-100,80},{-80,100}}, rotation=0))); equation - - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cws1.ftype; - fluids[3] = Cw.ftype; - fluids[4] = Cws2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticAerocondenser: fluids mixing in condenser volume are not compatible with each other"); - /* Unconnected connectors */ - if (cardinality(Cw) == 0) then + if not use_Cw then Cw.Q = 0; Cw.h = 1.e5; Cw.h_vol_1 = 1.e5; Cw.diff_res_1 = 0; Cw.diff_on_1 = false; - Cw.ftype = ftype; - Cw.Xco2 = 0; - Cw.Xh2o = 0; - Cw.Xo2 = 0; - Cw.Xso2 = 0; + Cw.Xi = Medium.X_default[1:Medium.nXi]; + Cw.SubC = Medium.C_default; end if; /* Pressure at the bottom of the condenser*/ @@ -132,23 +109,16 @@ equation /* Water/steam energy balance equation */ 0 = (Cws1.h - he)*Cws1.Q + (Cw.h - he)*Cw.Q - (Cws2.h - he)*Cws2.Q - W + J; - // if noEvent(Qa > 0) then - // (has - hae)*Qa - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0; - // else - // (has - hae)*1.e-6 - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0; - // end if; Cws1.h_vol_2 = he; Cw.h_vol_2 = he; Cws2.h_vol_1 = he; /* Fluid composition in the cavity (no balance equations) */ - Cws2.ftype = ftype; - - Cws2.Xco2 = 0; - Cws2.Xh2o = 0; - Cws2.Xo2 = 0; - Cws2.Xso2 = 0; + X = Cws1.Xi; + SubC = Cws1.SubC; + Cws2.Xi = X; + Cws2.SubC = SubC; /* Air inlet and outlet */ Cair1.Q = Cair2.Q; @@ -162,14 +132,9 @@ equation Cair2.diff_res_1 = Cair1.diff_res_1 + 1/gamma_diff; Cair1.diff_res_2 = Cair2.diff_res_2 + 1/gamma_diff; - Cair1.ftype = Cair2.ftype; - - Cair1.Xco2 = Cair2.Xco2; - Cair1.Xh2o = Cair2.Xh2o; - Cair1.Xo2 = Cair2.Xo2; - Cair1.Xso2 = Cair2.Xso2; - - ftype_a = Cair1.ftype; + Cair1.Xi = Cair2.Xi; + Cair1.SubC = Cair2.SubC; + X_Air = Cair1.Xi; Qa = Cair1.Q; Pae = Cair1.P; @@ -242,152 +207,26 @@ equation Tcond = ((Tas + Tae*(Ef - 1.0))/Ef); /* Condensation pressure */ - Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tcond, fluid_w); + Pcond = Medium.saturationPressure(Tcond); /* Water/steam thermodynamic properties */ - proe = ThermoSysPro.Properties.Fluid.Ph((Pfond + Pcond)/2, he, mode_s, fluid_w); - rho_e = proe.d; + rho_e = Medium.density_phX(p=(Pfond + Pcond)/2, h=he, X=X); /* Water specific enthalpy at the saturation point with pressure Pcond */ - lsat = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid_w); - he = lsat.h; + sat = Medium.setSat_p(Pcond); + he = Medium.bubbleEnthalpy(sat); /* Air thermodynamic properties */ - hae = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pae, Tae, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - has = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pas, Tas, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - rho_a = ThermoSysPro.Properties.Fluid.Density_Ph(Pae, hae, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - cp_a = ThermoSysPro.Properties.FlueGases.FlueGases_cp((Pae + Pas)/2, (Tae + Tas)/2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - //cp_a = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_PT((Pae + Pas)/2, (Tae + Tas)/2, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); + Tae = Medium_Air.temperature_phX(p=Pae, h=hae, X=X_Air); + has = Medium_Air.specificEnthalpy_pTX(p=Pas, T=Tas, X=X_Air); + rho_a = Medium_Air.density_phX(p=Pae, h=hae, X=X_Air); + cp_a = Medium_Air.specificHeatCapacityCp(Medium_Air.setState_pTX(p=(Pae + Pas)/2, T=(Tae + Tas)/2, X=X_Air)); annotation ( Diagram(coordinateSystem( preserveAspectRatio=false, extent={{-120,-120},{120,120}}, - grid={2,2}), graphics={ - Text( - extent={{86,112},{98,102}}, - lineColor={0,0,0}, - lineThickness=1, - fillPattern=FillPattern.Sphere, - fillColor={191,0,0}, - textString= - "Air"), - Text( - extent={{82,-106},{94,-116}}, - lineColor={0,0,0}, - lineThickness=1, - fillPattern=FillPattern.Sphere, - fillColor={191,0,0}, - textString= - "Air"), - Text( - extent={{-36,-112},{-12,-120}}, - lineColor={0,0,0}, - lineThickness=1, - fillPattern=FillPattern.Sphere, - fillColor={191,0,0}, - textString= - "Water"), - Text( - extent={{-38,114},{-12,106}}, - lineColor={0,0,0}, - lineThickness=1, - fillPattern=FillPattern.Sphere, - fillColor={191,0,0}, - textString= - "Steam"), - Polygon( - points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}}, - lineColor={28,108,200}, - fillColor={0,255,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{89,40},{79,20},{99,20},{89,40}}, - lineColor={0,0,0}, - lineThickness=0.5, - fillPattern=FillPattern.Sphere, - fillColor={191,0,0}), - Line( - points={{89,20},{89,4}}, - color={0,0,0}, - thickness=1), - Ellipse( - extent={{-20,100},{20,60}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={255,0,0}), - Ellipse( - extent={{60,-39},{100,-79}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,128,255}), - Ellipse( - extent={{-100,-39},{-60,-79}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,128,255}), - Polygon( - points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={255,0,0}), - Polygon( - points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}}, - lineColor={255,128,0}, - fillColor={255,128,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}}, - lineColor={0,128,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{38,33},{30,29},{9,64},{16,69},{38,33}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={255,0,0}), - Polygon( - points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={255,128,0}), - Polygon( - points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={0,128,255}), - Polygon( - points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}}, - lineColor={28,108,200}, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}}, - lineColor={28,108,200}, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-100,-79},{-80,-100}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,255,255}), - Ellipse( - extent={{80,-79},{100,-100}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,255,255}), - Rectangle( - extent={{-89,-79},{90,-100}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,255,255}), - Text( - extent={{-38,22},{36,-38}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={255,255,0}, - textString= - "Volume")}), + grid={2,2})), Icon(coordinateSystem( preserveAspectRatio=false, extent={{-120,-120},{120,120}}, @@ -395,80 +234,18 @@ equation Polygon( points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}}, lineColor={0,255,0}, - fillColor= DynamicSelect({85,170,255}, - if diffusion then fill_color_singular - else fill_color_static), + fillColor=DynamicSelect({85,170,255}, if diffusion then fill_color_singular else fill_color_static), fillPattern=FillPattern.Solid, lineThickness=0), Line( - points={{110,20},{110,-8}}, - color={0,0,0}, - thickness=0), + points={{110,-99},{110,104}}, + color={28,108,200}, + thickness=1), Ellipse( extent={{-20,100},{20,60}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={255,0,0}), - Ellipse( - extent={{60,-39},{100,-79}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,128,255}), - Ellipse( - extent={{-100,-39},{-60,-79}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,128,255}), - Polygon( - points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={255,0,0}), - Polygon( - points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}}, - lineColor={255,128,0}, - fillColor={255,128,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}}, - lineColor={0,128,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{38,33},{30,29},{9,64},{16,69},{38,33}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={255,0,0}), - Polygon( - points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={255,128,0}), - Polygon( - points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}}, - lineColor={0,0,0}, - fillPattern=FillPattern.VerticalCylinder, - fillColor={0,128,255}), - Polygon( - points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}}, - lineColor={28,108,200}, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}}, - lineColor={28,108,200}, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{80,-79},{100,-100}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,255,255}), - Ellipse( - extent={{-100,-79},{-80,-100}}, - lineColor={0,0,0}, - fillPattern=FillPattern.HorizontalCylinder, - fillColor={0,255,255}), Rectangle( extent={{-89,-79},{90,-100}}, lineColor={0,0,0}, @@ -477,31 +254,15 @@ equation Text( extent={{20,120},{54,100}}, lineColor={238,46,47}, - fillColor={255,213,170}, - fillPattern=FillPattern.Solid, textString="Steam inlet"), Text( extent={{126,116},{154,100}}, lineColor={0,0,255}, - fillColor={255,213,170}, - fillPattern=FillPattern.Solid, textString="Air outlet"), Text( extent={{126,-104},{150,-116}}, lineColor={0,0,255}, - fillColor={255,213,170}, - fillPattern=FillPattern.Solid, - textString="Air inlet"), - Line( - points={{110,-99},{110,104}}, - color={28,108,200}, - thickness=1), - Polygon( - points={{110,12},{100,-8},{120,-8},{110,12}}, - lineColor={0,0,0}, - lineThickness=0, - fillPattern=FillPattern.Sphere, - fillColor={191,0,0})}), + textString="Air inlet")}), Window( x=0.09, y=0.08, From c3bced51eeb100d49c9c7badd86e3b4fc42c0111 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 12 May 2026 16:47:58 +0200 Subject: [PATCH 143/213] #125 StaticAerocondenser, example not working yet --- .../HeatExchangers/StaticAerocondenser.mo | 214 +++++++++++++++++- 1 file changed, 208 insertions(+), 6 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo index c48369ab..2d8f867c 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo @@ -226,7 +226,131 @@ equation Diagram(coordinateSystem( preserveAspectRatio=false, extent={{-120,-120},{120,120}}, - grid={2,2})), + grid={2,2}), graphics={ + Text( + extent={{86,112},{98,102}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Air"), + Text( + extent={{82,-106},{94,-116}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Air"), + Text( + extent={{-36,-112},{-12,-120}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Water"), + Text( + extent={{-38,114},{-12,106}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Steam"), + Polygon( + points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}}, + lineColor={28,108,200}, + fillColor={0,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{89,40},{79,20},{99,20},{89,40}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}), + Line( + points={{89,20},{89,4}}, + color={0,0,0}, + thickness=1), + Ellipse( + extent={{-20,100},{20,60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={255,0,0}), + Ellipse( + extent={{60,-39},{100,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Ellipse( + extent={{-100,-39},{-60,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}}, + lineColor={255,128,0}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}}, + lineColor={0,128,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{38,33},{30,29},{9,64},{16,69},{38,33}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,128,0}), + Polygon( + points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-100,-79},{-80,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Ellipse( + extent={{80,-79},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Rectangle( + extent={{-89,-79},{90,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Text( + extent={{-38,22},{36,-38}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={255,255,0}, + textString= + "Volume")}), Icon(coordinateSystem( preserveAspectRatio=false, extent={{-120,-120},{120,120}}, @@ -234,18 +358,80 @@ equation Polygon( points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}}, lineColor={0,255,0}, - fillColor=DynamicSelect({85,170,255}, if diffusion then fill_color_singular else fill_color_static), + fillColor= DynamicSelect({85,170,255}, + if diffusion then fill_color_singular + else fill_color_static), fillPattern=FillPattern.Solid, lineThickness=0), Line( - points={{110,-99},{110,104}}, - color={28,108,200}, - thickness=1), + points={{110,20},{110,-8}}, + color={0,0,0}, + thickness=0), Ellipse( extent={{-20,100},{20,60}}, lineColor={0,0,0}, fillPattern=FillPattern.HorizontalCylinder, fillColor={255,0,0}), + Ellipse( + extent={{60,-39},{100,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Ellipse( + extent={{-100,-39},{-60,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}}, + lineColor={255,128,0}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}}, + lineColor={0,128,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{38,33},{30,29},{9,64},{16,69},{38,33}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,128,0}), + Polygon( + points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{80,-79},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Ellipse( + extent={{-100,-79},{-80,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), Rectangle( extent={{-89,-79},{90,-100}}, lineColor={0,0,0}, @@ -254,15 +440,31 @@ equation Text( extent={{20,120},{54,100}}, lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, textString="Steam inlet"), Text( extent={{126,116},{154,100}}, lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, textString="Air outlet"), Text( extent={{126,-104},{150,-116}}, lineColor={0,0,255}, - textString="Air inlet")}), + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Air inlet"), + Line( + points={{110,-99},{110,104}}, + color={28,108,200}, + thickness=1), + Polygon( + points={{110,12},{100,-8},{120,-8},{110,12}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0})}), Window( x=0.09, y=0.08, From 6aac26508342680b0c5f46aa5f269b0530528fd4 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 13 May 2026 14:08:59 +0200 Subject: [PATCH 144/213] #125 StaticAerocondenser with working example --- .../HeatExchangers/TestStaticAerocondenser.mo | 101 +++++++----------- .../TestStaticAerocondenser_TSP.mo | 96 ----------------- .../HeatExchangers/package.order | 3 +- .../HeatExchangers/StaticAerocondenser.mo | 68 +++++++++++- 4 files changed, 104 insertions(+), 164 deletions(-) delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo index cc15ced7..3194641a 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo @@ -5,49 +5,6 @@ model TestStaticAerocondenser replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases; - model SourceH - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; - parameter Units.SI.MassFlowRate Q0=1; - parameter Units.SI.SpecificEnthalpy h0=1e5; - parameter Medium.MassFraction X0[Medium.nXi]=Medium.X_default[1:Medium.nXi]; - parameter Medium.ExtraProperty SubC0[Medium.nC]=Medium.C_default; - parameter Boolean fix_h_vol_2=false; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium); - equation - C.Q = Q0; - C.h = h0; - C.h_vol_1 = h0; - if fix_h_vol_2 then - C.h_vol_2 = h0; - end if; - C.diff_res_1 = 0; - C.diff_on_1 = false; - C.Xi = X0; - C.SubC = SubC0; - end SourceH; - - model SinkDiff - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; - parameter Boolean fix_h_vol_2=false; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); - equation - if fix_h_vol_2 then - C.h_vol_2 = C.h; - end if; - C.diff_res_2 = 0; - C.diff_on_2 = false; - end SinkDiff; - - model SinkPOnly - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; - parameter Units.SI.AbsolutePressure P0=1e5; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); - equation - C.P = P0; - C.diff_res_2 = 0; - C.diff_on_2 = false; - end SinkPOnly; - ThermoSysPro.Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser( redeclare package Medium = Medium, redeclare package Medium_Air = Medium_Air, @@ -55,30 +12,46 @@ model TestStaticAerocondenser z=0.5, use_Cw=true, Ka=1) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - SourceH steamSource( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ airSource( + redeclare package Medium = Medium_Air, + Q0=1400, + h0=Medium_Air.specificEnthalpy_pTX( + p=100000, + T=293.15, + X=Medium_Air.X_default)) annotation (Placement(transformation(extent={{40,-30},{20,-10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ drainSource( + redeclare package Medium = Medium, + Q0=1, + T0=340, + h0=370000) annotation (Placement(transformation(extent={{-40,-20},{-20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource1( redeclare package Medium = Medium, Q0=100, - h0=2600000) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=-90, - origin={4,22}))); - SourceH drainSource( + T0=340, + h0=2600000) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink condensateSink( redeclare package Medium = Medium, - Q0=1, - h0=370000) annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}, rotation=0))); - SinkDiff condensateSink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90))); - SourceH airSource( - redeclare package Medium = Medium_Air, - fix_h_vol_2=true, - Q0=1400, - h0=Medium_Air.specificEnthalpy_pTX(p=100000, T=293.15, X=Medium_Air.X_default)) annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0))); - SinkPOnly airSink( + h0=370000) annotation (Placement(transformation( + extent={{-10,-70},{10,-50}}, + rotation=-90, + origin={60,-50}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP airSink( redeclare package Medium = Medium_Air, - P0=100000) annotation (Placement(transformation(extent={{40,50},{60,70}}, rotation=90))); + P0=100000, + T0=293.15) annotation (Placement(transformation( + extent={{40,50},{60,70}}, + rotation=90, + origin={80,-20}))); equation - staticAerocondenser.Cws2.h_vol_2 = staticAerocondenser.Cws2.h; - connect(steamSource.C, staticAerocondenser.Cws1) annotation (Line(points={{0,50},{0,9.16667}}, color={0,0,0})); - connect(drainSource.C, staticAerocondenser.Cw) annotation (Line(points={{-50,-30},{-9.16667,-7.5}}, color={0,0,0})); - connect(staticAerocondenser.Cws2, condensateSink.C) annotation (Line(points={{0,-9.16667},{0,-50}}, color={0,0,0})); - connect(airSource.C, staticAerocondenser.Cair1) annotation (Line(points={{40,0},{9.16667,-9.08333}}, color={0,0,0})); - connect(staticAerocondenser.Cair2, airSink.C) annotation (Line(points={{9.16667,9.16667},{50,50}}, color={0,0,0})); - annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(airSource.C, staticAerocondenser.Cair1) annotation (Line(points={{20,-20},{9.16667,-20},{9.16667,-9.08333}}, + color={0,0,0})); + connect(drainSource.C, staticAerocondenser.Cw) annotation (Line(points={{-20,-10},{-14,-10},{-14,-7.5},{-9.16667,-7.5}}, color={0,0,0})); + connect(staticAerocondenser.Cws1, steamSource1.C) annotation (Line(points={{0,9.16667},{0,20},{-20,20}}, color={0,0,0})); + connect(staticAerocondenser.Cws2, condensateSink.C) annotation (Line(points={{0,-9.16667},{0,-40}}, color={0,0,0})); + connect(staticAerocondenser.Cair2, airSink.C) annotation (Line(points={{9.16667,9.16667},{20,9.16667},{20,20}}, + color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); end TestStaticAerocondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo deleted file mode 100644 index 538ad522..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser_TSP.mo +++ /dev/null @@ -1,96 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; -model TestStaticAerocondenser_TSP - extends ThermoSysPro.UsersGuide.Icons.Example; - - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases; - - model SourceH - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; - parameter Units.SI.MassFlowRate Q0=1; - parameter Units.SI.SpecificEnthalpy h0=1e5; - parameter Medium.MassFraction X0[Medium.nXi]=Medium.X_default[1:Medium.nXi]; - parameter Medium.ExtraProperty SubC0[Medium.nC]=Medium.C_default; - parameter Boolean fix_h_vol_2=false; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium); - equation - C.Q = Q0; - C.h = h0; - C.h_vol_1 = h0; - if fix_h_vol_2 then - C.h_vol_2 = h0; - end if; - C.diff_res_1 = 0; - C.diff_on_1 = false; - C.Xi = X0; - C.SubC = SubC0; - end SourceH; - - model SinkDiff - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; - parameter Boolean fix_h_vol_2=false; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); - equation - if fix_h_vol_2 then - C.h_vol_2 = C.h; - end if; - C.diff_res_2 = 0; - C.diff_on_2 = false; - end SinkDiff; - - model SinkPOnly - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium; - parameter Units.SI.AbsolutePressure P0=1e5; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium); - equation - C.P = P0; - C.diff_res_2 = 0; - C.diff_on_2 = false; - end SinkPOnly; - - ThermoSysPro.Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser( - redeclare package Medium = Medium, - redeclare package Medium_Air = Medium_Air, - Se=10000, - z=0.5, - use_Cw=true, - Ka=1) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - SourceH airSource( - redeclare package Medium = Medium_Air, - fix_h_vol_2=true, - Q0=1400, - h0=Medium_Air.specificEnthalpy_pTX( - p=100000, - T=293.15, - X=Medium_Air.X_default)) annotation (Placement(transformation(extent={{60,-10},{40,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ drainSource( - redeclare package Medium = Medium, - Q0=1, - T0=340, - h0=370000) annotation (Placement(transformation(extent={{-70,-62},{-50,-42}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource1( - redeclare package Medium = Medium, - Q0=100, - T0=340, - h0=2600000) annotation (Placement(transformation(extent={{-44,68},{-24,88}}, rotation=0))); - SinkDiff condensateSink(redeclare package Medium = Medium) annotation (Placement(transformation( - extent={{-10,-70},{10,-50}}, - rotation=-90, - origin={100,-34}))); - SinkPOnly airSink(redeclare package Medium = Medium_Air, P0=100000) annotation (Placement(transformation( - extent={{40,50},{60,70}}, - rotation=90, - origin={92,-10}))); -equation - staticAerocondenser.Cws2.h_vol_2 = staticAerocondenser.Cws2.h; - - connect(airSource.C, staticAerocondenser.Cair1) annotation (Line(points={{40,0},{9.16667,-9.08333}}, color={0,0,0})); - connect(drainSource.C, staticAerocondenser.Cw) annotation (Line(points={{-50,-52},{-16,-52},{-16,-7.5},{-9.16667,-7.5}}, color={0,0,0})); - connect(staticAerocondenser.Cws1, steamSource1.C) annotation (Line(points={{0,9.16667},{0,78},{-24,78}}, color={0,0,0})); - connect(staticAerocondenser.Cws2, condensateSink.C) annotation (Line(points={{0,-9.16667},{0,-36},{24,-36},{24,-76}}, color={0,0,0})); - connect(staticAerocondenser.Cair2, airSink.C) annotation (Line(points={{9.16667,9.16667},{142,40}}, color={0,0,0})); - annotation ( - experiment(StopTime=1000), - Icon(coordinateSystem(preserveAspectRatio=false)), - Diagram(coordinateSystem(preserveAspectRatio=false))); -end TestStaticAerocondenser_TSP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index 707e0f75..cb2aed89 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -37,6 +37,5 @@ TestStaticCondenser TestStaticCondenser_Traces TestStaticCondenserHEI TestStaticCondenserHEI_Traces -TestStaticAerocondenser TestDynamicPlateHeatExchangerW -TestStaticAerocondenser_TSP +TestStaticAerocondenser diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo index 2d8f867c..6b9ec23d 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo @@ -471,8 +471,72 @@ equation width=0.76, height=0.76), Documentation(info=" -

    Copyright © EDF 2002 - 2024

    -

    ThermoSysPro Version 4.1

    +

    # StaticAerocondenser

    + +

    +Static model of an air-cooled condenser. A water/steam flow is condensed at the +condensation pressure and the released heat is transferred to a cooling-air flow. +An optional drain inlet Cw can be enabled with use_Cw=true. +

    + +

    ## Main hypotheses

    +
      +
    • The model is static: no mass or energy storage is represented.
    • +
    • The condensing side is assumed to be at a single condensation pressure Pcond.
    • +
    • The liquid outlet enthalpy he is the saturated liquid enthalpy at Pcond.
    • +
    • The pressure at the bottom of the condenser includes the hydrostatic head: Pfond = Pcond + rho_e*g*z.
    • +
    • The air side is single phase and exchanges heat with the condensing side through an NTU-effectiveness law.
    • +
    • The air pressure loss is quadratic: deltaP = Ka*Qa*abs(Qa)/rho_a.
    • +
    • The water/steam pressure loss is represented through the imposed relation between Pcond, Pfond, and the connected ports.
    • +
    • Fluid composition and trace substances are transported without internal accumulation or phase-separation model.
    • +
    + +

    ## Connectors

    +
      +
    • Cws1: steam inlet on the condensing side.
    • +
    • Cws2: condensate outlet on the condensing side.
    • +
    • Cw: optional drain inlet on the condensing side; disabled internally when use_Cw=false.
    • +
    • Cair1: cooling-air inlet.
    • +
    • Cair2: cooling-air outlet.
    • +
    + +

    ## Main equations

    +
      +
    • Water/steam mass balance: 0 = Cws1.Q + Cw.Q - Cws2.Q.
    • +
    • Water/steam energy balance: 0 = (Cws1.h - he)*Cws1.Q + (Cw.h - he)*Cw.Q - (Cws2.h - he)*Cws2.Q - W + J.
    • +
    • Air heat power: W = Qa*(has - hae).
    • +
    • Air-side NTU: Nut = Se*U/(Qa*cp_a) when Qa*cp_a > 0.
    • +
    • Two-phase effectiveness: Ef = 1 - exp(-Nut).
    • +
    • Condensation temperature: Tcond = (Tas + Tae*(Ef - 1))/Ef.
    • +
    • Condensation pressure: Pcond = Medium.saturationPressure(Tcond).
    • +
    + +

    ## Media and transported quantities

    +
      +
    • Medium is the condensing-side medium and must provide two-phase saturation properties.
    • +
    • Medium_Air is the air-side medium and is evaluated with the generic Medium API.
    • +
    • Condensing-side mass fractions are taken from Cws1.Xi and propagated to Cws2.Xi.
    • +
    • Air-side mass fractions are propagated between Cair1 and Cair2.
    • +
    • Trace substances are passed through directly; no source/sink or separation term is added in this component.
    • +
    + +

    ## Heat-transfer law

    +

    +The reference heat-transfer coefficient Uref is corrected by +UCOR and by an empirical dependency on the inlet air temperature: +

    +

    U = UCOR*Uref*(-2e-4*(Tae - 273.16)^2 + 0.0187*(Tae - 273.16) + 0.5007)

    + +

    ## Limitations

    +
      +
    • The model is intended for steady-state or quasi-steady network calculations.
    • +
    • It does not represent condenser metal thermal inertia, air-side distributed effects, fan behavior, or detailed tube geometry.
    • +
    • The optional drain inlet is mixed algebraically with the steam inlet before condensation.
    • +
    • Reverse-flow behavior is handled with the connector enthalpy variables and the continuous_flow_reversal option.
    • +
    + +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    ", revisions="

    Author

    From 3d9a3c1d7a3208c0c9b93ea771d86c4f6a3dd1ab Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 13 May 2026 14:48:48 +0200 Subject: [PATCH 145/213] #125 ThreeWayValve --- .../PressureLosses/TestThreeWayValve.mo | 50 +++++++++++++++++ .../TestThreeWayValve_FlueGases.mo | 54 +++++++++++++++++++ .../TestThreeWayValve_Traces.mo | 52 ++++++++++++++++++ .../PressureLosses/package.order | 3 ++ .../Fluid/PressureLosses/ThreeWayValve.mo | 52 ++++++------------ 5 files changed, 174 insertions(+), 37 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo new file mode 100644 index 00000000..5d93f85f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo @@ -0,0 +1,50 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestThreeWayValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare replaceable package Medium = Medium, + P0=300000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare replaceable package Medium = Medium, + C2(Q(start=0)), + C3(Q(start=2000)), + Valve1(Pm(start=200000)), + VolumeA1(h(start=100000))) + annotation (Placement(transformation(extent={{-10,-6},{10,14}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-10},{90,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp( + Starttime=1, + Duration=2, + Initialvalue=0.2, + Finalvalue=0.8) + annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); +equation + connect(sourceP.C, threeWayValve.C1) + annotation (Line(points={{-70,0},{-10,0}}, color={0,0,255})); + connect(threeWayValve.C2, sinkP1.C) + annotation (Line(points={{10,0},{70,0}}, color={255,0,0})); + connect(threeWayValve.C3, sinkP2.C) + annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={255,0,0})); + connect(ramp.y, threeWayValve.Ouv) + annotation (Line(points={{-29,40},{0,40},{0,15}}, color={0,0,255})); + annotation (experiment(StopTime=5), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestThreeWayValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo new file mode 100644 index 00000000..9aac55bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo @@ -0,0 +1,54 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestThreeWayValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare replaceable package Medium = Medium, + P0=450000, + T0=573.15, + option_temperature=true, + X0={0.1,0.2,0.3,0.2,0.2}) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare replaceable package Medium = Medium, + Cvmax1=50000, + Cvmax2=50000, + C2(Q(start=0)), + C3(Q(start=20)), + Valve1(Pm(start=200000)), + Valve2(Pm(start=200000)), + VolumeA1(h(start=2800000))) + annotation (Placement(transformation(extent={{-10,-6},{10,14}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=100000, + T0=573.15, + option_temperature=true) + annotation (Placement(transformation(extent={{70,-10},{90,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2( + redeclare replaceable package Medium = Medium, + P0=100000, + T0=573.15, + option_temperature=true) + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp( + Starttime=1, + Duration=2, + Initialvalue=0.2, + Finalvalue=0.8) + annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); +equation + connect(sourceP.C, threeWayValve.C1) + annotation (Line(points={{-70,0},{-10,0}}, color={0,0,255})); + connect(threeWayValve.C2, sinkP1.C) + annotation (Line(points={{10,0},{70,0}}, color={255,0,0})); + connect(threeWayValve.C3, sinkP2.C) + annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={255,0,0})); + connect(ramp.y, threeWayValve.Ouv) + annotation (Line(points={{-29,40},{0,40},{0,15}}, color={0,0,255})); + annotation (experiment(StopTime=5), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestThreeWayValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo new file mode 100644 index 00000000..50a9e55f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo @@ -0,0 +1,52 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestThreeWayValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = + ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare replaceable package Medium = Medium, + P0=300000, + h0=100000, + option_temperature=false, + SubC0={10}) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare replaceable package Medium = Medium, + C2(Q(start=0)), + C3(Q(start=2000)), + Valve1(Pm(start=200000)), + VolumeA1(h(start=100000))) + annotation (Placement(transformation(extent={{-10,-6},{10,14}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-10},{90,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp( + Starttime=1, + Duration=2, + Initialvalue=0.2, + Finalvalue=0.8) + annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); +equation + connect(sourceP.C, threeWayValve.C1) + annotation (Line(points={{-70,0},{-10,0}}, color={0,0,255})); + connect(threeWayValve.C2, sinkP1.C) + annotation (Line(points={{10,0},{70,0}}, color={255,0,0})); + connect(threeWayValve.C3, sinkP2.C) + annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={255,0,0})); + connect(ramp.y, threeWayValve.Ouv) + annotation (Line(points={{-29,40},{0,40},{0,15}}, color={0,0,255})); + annotation (experiment(StopTime=5), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestThreeWayValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order index 81d4ca5e..6c71b9c9 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -13,6 +13,9 @@ TestInvSingularPressureLoss_Traces TestControlValve TestControlValve_Traces TestControlValve_Traces_FlueGases +TestThreeWayValve +TestThreeWayValve_FlueGases +TestThreeWayValve_Traces TestDynamicReliefValve TestDynamicReliefValve_FlueGases TestDynamicReliefValve_Traces diff --git a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo index 530b1576..b56b06ba 100644 --- a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo @@ -1,11 +1,10 @@ within ThermoSysPro.Fluid.PressureLosses; model ThreeWayValve "Three way valve" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter ThermoSysPro.Units.xSI.Cv Cvmax1=8005.42 "Valve 1 max CV"; parameter ThermoSysPro.Units.xSI.Cv Cvmax2=8005.42 "Valve 2 max CV"; parameter Real caract1[:, 2]=[0, 0; 1, Cvmax1] @@ -29,45 +28,27 @@ model ThreeWayValve "Three way valve" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false - "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.FlueGases), tab="Fluid", group="Fluid properties")); + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20=0.0 - "Initial CO2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0=if ftype == FluidType.FlueGases then 0.05 else 0 - "Initial H20 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20=0.23 - "Initial O2 mass fraction" annotation (Evaluate=true, Dialog( - enable=dynamic_composition_balance, - tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20=0 - "Initial SO2 mass fraction" annotation (Evaluate=true, Dialog( + parameter Medium.ExtraProperty X0[Medium.nX]=Medium.X_default + "Initial composition values" annotation (Evaluate=true, Dialog( enable=dynamic_composition_balance, tab="Fluid", - group= - "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + group="Medium")); ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv annotation (Placement(transformation( origin={0,110}, extent={{-10,-10},{10,10}}, rotation=270))); - Interfaces.Connectors.FluidInlet C1 annotation (layer="icon", Placement( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (layer="icon", Placement( transformation(extent={{-110,-50},{-90,-30}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (layer="icon", Placement( + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (layer="icon", Placement( transformation(extent={{90,-50},{110,-30}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve Valve1( + redeclare package Medium = Medium, Cvmax=Cvmax1, caract=caract1, mode_caract=mode_caract1, @@ -78,9 +59,10 @@ model ThreeWayValve "Three way valve" origin={-6,-50}, extent={{10,-10},{-10,10}}, rotation=90))); - Interfaces.Connectors.FluidOutlet C3 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C3(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,-110},{10,-90}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve Valve2( + redeclare package Medium = Medium, Cvmax=Cvmax2, caract=caract2, mode_caract=mode_caract2, @@ -95,20 +77,16 @@ model ThreeWayValve "Three way valve" ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add Add1(k2=-1) annotation (Placement(transformation( extent={{-40,40},{-20,60}}, rotation=0))); Volumes.VolumeA VolumeA1( + redeclare package Medium = Medium, V=V, p_rho=p_rho, dynamic_energy_balance=dynamic_energy_balance, diffusion=diffusion, continuous_flow_reversal=continuous_flow_reversal, - ftype=ftype, - region=region, dynamic_composition_balance=dynamic_composition_balance, - Xco20=Xco20, - Xh2o0=Xh2o0, - Xo20=Xo20, - Xso20=Xso20) annotation (Placement(transformation(extent={{-10, + X0=X0) annotation (Placement(transformation(extent={{-10, -10},{10,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1(K=0, region=region, gamma_diff=gamma_diff) + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1(redeclare package Medium = Medium, K=0, gamma_diff=gamma_diff) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation= 0))); equation From 02de5c96388c93dc3dab43e4dd7a124631338ab3 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 18 May 2026 09:52:36 +0200 Subject: [PATCH 146/213] #125 HeatExchangers with examples What is done: Migrated the HeatExchangers assembly components to replaceable media. Added/redeclared media through internal components/connectors. Added the requested example files under ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers. Updated package.order. Migrated SensorP because the steam generator assemblies needed medium-aware connectors. What currently simulates with omc: TestDynamicMultiFluidHeatExchanger TestDynamicMultiFluidHeatExchanger_Traces TestDynamicWaterSteamMultiFluidsHeatExchanger TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces TestDynamicCondenser TestDynamicCondenser_Traces TestSteamGenerator_1SG TestSteamGenerator_1SG_Traces Still failing in omc simulation: Flue-gases examples for the generic wrappers: temperature_phX/root-bracketing failures in FlueGases. TestDynamicFlueGasesMultiFluidHeatExchanger: still tied to the same FlueGases initialization issue. TestDynamicWaterHeater / OnePipe: initialization nonlinear systems fail. TestSteamGenerator_4SG / _Traces: nonlinear initialization fails even after switching to the 1SG-style boundary values. --- .../HeatExchangers/TestDynamicCondenser.mo | 31 +++++++++++++ .../TestDynamicCondenser_Traces.mo | 7 +++ ...DynamicFlueGasesMultiFluidHeatExchanger.mo | 26 +++++++++++ ...FlueGasesMultiFluidHeatExchanger_Traces.mo | 8 ++++ .../TestDynamicMultiFluidHeatExchanger.mo | 24 ++++++++++ ...TestDynamicMultiFluidHeatExchangerShell.mo | 24 ++++++++++ ...cMultiFluidHeatExchangerShell_FlueGases.mo | 11 +++++ ...amicMultiFluidHeatExchangerShell_Traces.mo | 8 ++++ ...ynamicMultiFluidHeatExchanger_FlueGases.mo | 11 +++++ ...stDynamicMultiFluidHeatExchanger_Traces.mo | 8 ++++ .../HeatExchangers/TestDynamicWaterHeater.mo | 32 ++++++++++++++ .../TestDynamicWaterHeaterOnePipe.mo | 30 +++++++++++++ .../TestDynamicWaterHeaterOnePipe_Traces.mo | 7 +++ .../TestDynamicWaterHeater_Traces.mo | 7 +++ ...namicWaterSteamMultiFluidsHeatExchanger.mo | 24 ++++++++++ ...terSteamMultiFluidsHeatExchanger_Traces.mo | 8 ++++ .../HeatExchangers/TestSteamGenerator_1SG.mo | 24 ++++++++++ .../TestSteamGenerator_1SG_Traces.mo | 7 +++ .../HeatExchangers/TestSteamGenerator_4SG.mo | 24 ++++++++++ .../TestSteamGenerator_4SG_Traces.mo | 7 +++ .../HeatExchangers/package.order | 22 +++++++++- .../Fluid/HeatExchangers/DynamicCondenser.mo | 35 +++++++-------- ...DynamicFlueGasesMultiFluidHeatExchanger.mo | 16 ++++--- .../DynamicMultiFluidHeatExchanger.mo | 18 ++++---- .../DynamicMultiFluidHeatExchangerShell.mo | 22 +++++----- .../HeatExchangers/DynamicWaterHeater.mo | 44 +++++++++---------- .../DynamicWaterHeaterOnePipe.mo | 38 ++++++++-------- ...namicWaterSteamMultiFluidsHeatExchanger.mo | 16 ++++--- .../HeatExchangers/SteamGenerator_1SG.mo | 38 +++++++++------- .../HeatExchangers/SteamGenerator_4SG.mo | 41 +++++++++-------- ThermoSysPro/Fluid/Sensors/SensorP.mo | 14 +++--- 31 files changed, 493 insertions(+), 139 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo new file mode 100644 index 00000000..94c9e846 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser condenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + Ns=3, + ntubest=1000, + ntubesV=50, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ vaporSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraVaporSource(redeclare package Medium = Medium, Q0=1e-4, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraWaterSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, Q0=10.0002, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-20},{-50,0}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{50,-20},{70,0}}))); +equation + connect(vaporSource.C, condenser.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraVaporSource.C, condenser.C2vap) annotation (Line(points={{-50,60},{-3.9,60},{-3.9,9.2}}, color={0,0,255})); + connect(extraWaterSource.C, condenser.C1) annotation (Line(points={{-50,30},{-8.1,30},{-8.1,7.5}}, color={0,0,255})); + connect(condenser.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-50}}, color={0,0,255})); + connect(coolingSource.C, condenser.Ce1) annotation (Line(points={{-50,-10},{-10,-10},{-10,-0.1}}, color={0,0,255})); + connect(condenser.Ce2, coolingSink.C) annotation (Line(points={{9.9,-0.1},{30,-0.1},{30,-10},{50,-10}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo new file mode 100644 index 00000000..0a600512 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicCondenser_Traces + extends TestDynamicCondenser( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo new file mode 100644 index 00000000..fd5ab781 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicFlueGasesMultiFluidHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger exchanger( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + h0=fill(1.2e6, 1), + option_temperature=false, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFg(redeclare package Medium = Medium_FlueGases, Q0=10, T0=573.15, option_temperature=true, X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFg(redeclare package Medium = Medium_FlueGases, P0=100000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceWs(redeclare package Medium = Medium, P0=300000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWs(redeclare package Medium = Medium, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); +equation + connect(sourceFg.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sinkFg.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + connect(sourceWs.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sinkWs.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicFlueGasesMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo new file mode 100644 index 00000000..39a421d8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicFlueGasesMultiFluidHeatExchanger_Traces + extends TestDynamicFlueGasesMultiFluidHeatExchanger( + redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_FlueGases = Properties.Media.FlueGases(extraPropertiesNames={"Trace1"}, C_nominal={0.1}, C_default={0.2}), + sourceFg(SubC0={30}), + sourceWs(SubC0={10})); +end TestDynamicFlueGasesMultiFluidHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo new file mode 100644 index 00000000..d0b36344 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_1 = Properties.Media.WaterSteam; + replaceable package Medium_2 = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicMultiFluidHeatExchanger exchanger( + redeclare package Medium_1 = Medium_1, + redeclare package Medium_2 = Medium_2, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source1(redeclare package Medium = Medium_1, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-70,-30},{-50,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink1(redeclare package Medium = Medium_1, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{50,-30},{70,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source2(redeclare package Medium = Medium_2, P0=300000, h0=320000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink2(redeclare package Medium = Medium_2, P0=100000, h0=310000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); +equation + connect(source1.C, exchanger.Cws1) annotation (Line(points={{-50,-20},{-30,-20},{-30,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sink1.C) annotation (Line(points={{10,0},{30,0},{30,-20},{50,-20}}, color={0,0,255})); + connect(source2.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sink2.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo new file mode 100644 index 00000000..ec2729ec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_shell = Properties.Media.WaterSteam; + replaceable package Medium_pipe = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicMultiFluidHeatExchangerShell exchanger( + redeclare package Medium_shell = Medium_shell, + redeclare package Medium_pipe = Medium_pipe, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePipe(redeclare package Medium = Medium_pipe, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPipe(redeclare package Medium = Medium_pipe, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceShell(redeclare package Medium = Medium_shell, P0=300000, h0=320000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkShell(redeclare package Medium = Medium_shell, P0=100000, h0=310000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); +equation + connect(sourcePipe.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sinkPipe.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(sourceShell.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sinkShell.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicMultiFluidHeatExchangerShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo new file mode 100644 index 00000000..ae54a033 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo @@ -0,0 +1,11 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell_FlueGases + extends TestDynamicMultiFluidHeatExchangerShell( + redeclare package Medium_shell = Properties.Media.FlueGases, + redeclare package Medium_pipe = Properties.Media.FlueGases, + exchanger(P0=450000, h0=fill(3e6, 1), option_temperature=false), + sourceShell(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), + sinkShell(P0=100000, h0=3e6, option_temperature=false), + sourcePipe(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), + sinkPipe(P0=100000, h0=3e6, option_temperature=false)); +end TestDynamicMultiFluidHeatExchangerShell_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo new file mode 100644 index 00000000..0f698216 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell_Traces + extends TestDynamicMultiFluidHeatExchangerShell( + redeclare package Medium_shell = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_pipe = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + sourcePipe(SubC0={10}), + sourceShell(SubC0={20})); +end TestDynamicMultiFluidHeatExchangerShell_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..0a8a7d9a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo @@ -0,0 +1,11 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger_FlueGases + extends TestDynamicMultiFluidHeatExchanger( + redeclare package Medium_1 = Properties.Media.FlueGases, + redeclare package Medium_2 = Properties.Media.FlueGases, + exchanger(P0=450000, h0=fill(3e6, 1), option_temperature=false), + source1(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), + sink1(P0=100000, h0=3e6, option_temperature=false), + source2(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), + sink2(P0=100000, h0=3e6, option_temperature=false)); +end TestDynamicMultiFluidHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo new file mode 100644 index 00000000..268cc90a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger_Traces + extends TestDynamicMultiFluidHeatExchanger( + redeclare package Medium_1 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_2 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + source1(SubC0={10}), + source2(SubC0={20})); +end TestDynamicMultiFluidHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo new file mode 100644 index 00000000..6569c47c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeater + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater waterHeater( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + dynamic_energy_balance=true, + dynamic_mass_balance=true, + steady_state=false, + P0c=2200000, + Vf0=0.43, + pipe_1(h0=fill(9e5, 10), P0=6900000), + pipe_2(h0=fill(1.0e6, 10), P0=6900000), + pipe_3(h0=fill(9e5, 20), P0=6900000), + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP condensateSink(redeclare package Medium = Medium, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); +equation + connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-50}}, color={0,0,255})); + connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-50,20}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterHeater; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo new file mode 100644 index 00000000..88c9f980 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeaterOnePipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeaterOnePipe waterHeater( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + dynamic_energy_balance=true, + dynamic_mass_balance=true, + steady_state=false, + P0c=2200000, + Vf0=0.43, + pipe_3(h0=fill(9e5, 20), P0=6900000), + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP condensateSink(redeclare package Medium = Medium, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); +equation + connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-50}}, color={0,0,255})); + connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-50,20}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterHeaterOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo new file mode 100644 index 00000000..62c252c9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeaterOnePipe_Traces + extends TestDynamicWaterHeaterOnePipe( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicWaterHeaterOnePipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo new file mode 100644 index 00000000..ec38847c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeater_Traces + extends TestDynamicWaterHeater( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicWaterHeater_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo new file mode 100644 index 00000000..42c72368 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterSteamMultiFluidsHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_1 = Properties.Media.WaterSteam; + replaceable package Medium_2 = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterSteamMultiFluidsHeatExchanger exchanger( + redeclare package Medium_1 = Medium_1, + redeclare package Medium_2 = Medium_2, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source1(redeclare package Medium = Medium_1, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink1(redeclare package Medium = Medium_1, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source2(redeclare package Medium = Medium_2, P0=300000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink2(redeclare package Medium = Medium_2, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); +equation + connect(source1.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sink1.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + connect(source2.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sink2.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterSteamMultiFluidsHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo new file mode 100644 index 00000000..ab12229d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces + extends TestDynamicWaterSteamMultiFluidsHeatExchanger( + redeclare package Medium_1 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_2 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + source1(SubC0={10}), + source2(SubC0={20})); +end TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo new file mode 100644 index 00000000..569af238 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Primary = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_1SG steamGenerator( + redeclare package Medium = Medium, + redeclare package Medium_Primary = Medium_Primary, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, Q0=531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP steamSink(redeclare package Medium = Medium, P0=6600000, h0=2.77257e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, Q0=4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); +equation + connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,50}}, color={0,0,255})); + connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSteamGenerator_1SG; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo new file mode 100644 index 00000000..dd461219 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG_Traces + extends TestSteamGenerator_1SG( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Primary = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + primaryInlet(SubC0={10})); +end TestSteamGenerator_1SG_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo new file mode 100644 index 00000000..1d436e20 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_4SG + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Primary = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_4SG steamGenerator( + redeclare package Medium = Medium, + redeclare package Medium_Primary = Medium_Primary, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, Q0=531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP steamSink(redeclare package Medium = Medium, P0=6600000, h0=2.77257e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, Q0=4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); +equation + connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,50}}, color={0,0,255})); + connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSteamGenerator_4SG; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo new file mode 100644 index 00000000..2b9eb78f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_4SG_Traces + extends TestSteamGenerator_4SG( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Primary = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + primaryInlet(SubC0={10})); +end TestSteamGenerator_4SG_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index cb2aed89..a33c9fb7 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -24,6 +24,7 @@ TestStaticPlateHeatExchanger_FlueGases TestDynamicPlateHeatExchanger TestDynamicPlateHeatExchanger_Traces TestDynamicPlateHeatExchanger_FlueGases +TestDynamicPlateHeatExchangerW TestNTUWaterHeater TestNTUWaterHeater_Traces TestNTUWaterHeater_FlueGases @@ -37,5 +38,24 @@ TestStaticCondenser TestStaticCondenser_Traces TestStaticCondenserHEI TestStaticCondenserHEI_Traces -TestDynamicPlateHeatExchangerW TestStaticAerocondenser +TestDynamicCondenser +TestDynamicCondenser_Traces +TestDynamicFlueGasesMultiFluidHeatExchanger +TestDynamicFlueGasesMultiFluidHeatExchanger_Traces +TestDynamicMultiFluidHeatExchanger +TestDynamicMultiFluidHeatExchanger_FlueGases +TestDynamicMultiFluidHeatExchanger_Traces +TestDynamicMultiFluidHeatExchangerShell +TestDynamicMultiFluidHeatExchangerShell_FlueGases +TestDynamicMultiFluidHeatExchangerShell_Traces +TestDynamicWaterHeater +TestDynamicWaterHeater_Traces +TestDynamicWaterHeaterOnePipe +TestDynamicWaterHeaterOnePipe_Traces +TestDynamicWaterSteamMultiFluidsHeatExchanger +TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces +TestSteamGenerator_1SG +TestSteamGenerator_1SG_Traces +TestSteamGenerator_4SG +TestSteamGenerator_4SG_Traces diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo index 78f20d96..4615b798 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicCondenser "Dynamic condenser" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area"; parameter Units.SI.Length Lv=15 "Cavity length"; @@ -45,6 +45,7 @@ model DynamicCondenser "Dynamic condenser" parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; Volumes.TwoPhaseCavityOnePipe DynamicCondenser( + redeclare package Medium = Medium, Vf0=Vf0, P0=P0c, Ns=Ns, @@ -56,7 +57,6 @@ model DynamicCondenser "Dynamic condenser" R=Rv, L=Lv, Vertical=true, - wsftype=wsftype, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, continuous_flow_reversal=continuous_flow_reversal, @@ -64,6 +64,7 @@ model DynamicCondenser "Dynamic condenser" annotation ( Placement(transformation(extent={{-100,-100}, {100,100}}, rotation=0))); DynamicOnePhaseFlowPipe pipe_3( + redeclare package Medium = Medium_Cooling, D=Dc, L=L2, ntubes=ntubest, @@ -80,20 +81,20 @@ model DynamicCondenser "Dynamic condenser" T0=T0, h0=h0) annotation (Placement(transformation(extent={{-58,-20},{54,18}}, rotation=0))); - Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation (Placement( + Interfaces.Connectors.FluidInlet C1vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet" + Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet" annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation= 0))); - Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation ( + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation ( Placement(transformation(extent={{-110,-11},{-90,9}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation ( + Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation ( Placement(transformation(extent={{89,-11},{109,9}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle annotation (Placement(transformation(extent={{98,-62},{118,-42}}, rotation= 0))); - Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation ( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) "Extra water inlet" annotation ( Placement(transformation(extent={{-91,65},{-71,85}}, rotation=0), iconTransformation(extent={{-91,65},{-71,85}}))); Thermal.HeatTransfer.HeatExchangerWall Wall_3( @@ -108,7 +109,7 @@ model DynamicCondenser "Dynamic condenser" dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state) annotation (Placement(transformation(extent={{-58,-4},{54,40}}, rotation=0))); - Interfaces.Connectors.FluidInlet C2vap "Vapor inlet" annotation (Placement( + Interfaces.Connectors.FluidInlet C2vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( transformation(extent={{-49,82},{-29,102}}, rotation=0), iconTransformation(extent={{-49,82},{-29,102}}))); equation @@ -119,11 +120,8 @@ equation C1.h_vol_1 = 1.e5; C1.diff_res_1 = 0; C1.diff_on_1 = false; - C1.ftype = ftype; - C1.Xco2 = 0; - C1.Xh2o = 0; - C1.Xo2 = 0; - C1.Xso2 = 0; + C1.Xi = Medium.X_default[1:Medium.nXi]; + C1.SubC = Medium.C_default; end if; if (cardinality(C2vap) == 1) then @@ -132,11 +130,8 @@ equation C2vap.h_vol_1 = 1.e5; C2vap.diff_res_1 = 0; C2vap.diff_on_1 = false; - C2vap.ftype = ftype; - C2vap.Xco2 = 0; - C2vap.Xh2o = 0; - C2vap.Xo2 = 0; - C2vap.Xso2 = 0; + C2vap.Xi = Medium.X_default[1:Medium.nXi]; + C2vap.SubC = Medium.C_default; end if; connect(DynamicCondenser.Cl, C2ex) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo index fd87f70f..75b5109b 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicFlueGasesMultiFluidHeatExchanger "Dynamic flue gases - water/steam heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=1 "Exchanger length"; parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; @@ -35,10 +36,10 @@ model DynamicFlueGasesMultiFluidHeatExchanger "Dynamic flue gases - water/steam parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); StaticWallFlueGasesExchanger ExchangerFlueGasesMetal( + redeclare package Medium = Medium_FlueGases, Dext=0.022, Ns=Ns, NbTub=Ntubes, @@ -60,6 +61,7 @@ model DynamicFlueGasesMultiFluidHeatExchanger "Dynamic flue gases - water/steam T0=T0[1]) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe( + redeclare package Medium = Medium, L=L, D=Dint, ntubes=Ntubes, @@ -79,13 +81,13 @@ model DynamicFlueGasesMultiFluidHeatExchanger "Dynamic flue gases - water/steam h0=h0) annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation= 0))); - Interfaces.Connectors.FluidInlet Cfg1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation( extent={{-10,40},{10,60}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cfg2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation( extent={{-10,-60},{10,-40}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); equation connect(Cws2, TwoPhaseFlowPipe.C2) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo index 524ae21b..fe49ab75 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_1 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for fluid 1" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_2 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for fluid 2" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=1 "Exchanger length"; parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; @@ -51,9 +52,9 @@ model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_2( + redeclare package Medium = Medium_2, Ns=Ns, L=L, ntubes=Ntubes, @@ -68,7 +69,6 @@ model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger" option_temperature=option_temperature, diffusion=diffusion, simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, - region=region, P0=P0, z1=z1, z2=z2, @@ -90,6 +90,7 @@ model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger" lambda=lambda) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_1( + redeclare package Medium = Medium_1, ntubes=Ntubes, Ns=Ns, T0=T0, @@ -103,7 +104,6 @@ model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger" option_temperature=option_temperature, continuous_flow_reversal=continuous_flow_reversal, diffusion=diffusion, - region=region, P0=P0, L=L, D=Dint, @@ -111,13 +111,13 @@ model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger" z1=z1, z2=z2) annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cfg1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_2) annotation (Placement(transformation( extent={{-10,40},{10,60}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cfg2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_2) annotation (Placement(transformation( extent={{-10,-60},{10,-40}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cws1 annotation ( + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_1) annotation ( Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation ( + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_1) annotation ( Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); equation connect(Cws2, DynamicOnePhaseFlowPipe_1.C2) annotation (Line( diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo index 22151929..3d06449f 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_shell = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for shell-side fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_pipe = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for pipe-side fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=1 "Exchanger length"; parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; @@ -41,10 +42,10 @@ model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium_shell, Ns=Ns, L=L, ntubes=Ntubes, @@ -59,8 +60,7 @@ model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger" advection=advection, diffusion=diffusion, T0=T0, - h0=h0, - region=region) + h0=h0) annotation (Placement(transformation(extent={{-10,30},{10,10}}, rotation=0))); ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall( @@ -72,6 +72,7 @@ model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger" steady_state=steady_state) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe( + redeclare package Medium = Medium_pipe, L=L, D=Dint, ntubes=Ntubes, @@ -89,17 +90,16 @@ model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger" dynamic_mass_balance=dynamic_mass_balance, T0=T0, h0=h0, - P0=P0, - region=region) + P0=P0) annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_shell) annotation ( Placement(transformation(extent={{-10,40},{10,60}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_shell) annotation ( Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_pipe) annotation ( Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_pipe) annotation ( Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); equation connect(Cws2, DynamicOnePhaseFlowPipe.C2) annotation (Line( diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo index db36e781..c078ba6a 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicWaterHeater "Dynamic water heater" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume"; //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area"; @@ -39,7 +39,7 @@ model DynamicWaterHeater "Dynamic water heater" parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia"; parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme"; parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium_Cooling.isCompressible and dynamic_energy_balance)); parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -51,6 +51,7 @@ model DynamicWaterHeater "Dynamic water heater" parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; Volumes.TwoPhaseCavity WaterHeating( + redeclare package Medium = Medium, Vf0=Vf0, P0=P0c, Ns=Ns, @@ -73,11 +74,11 @@ model DynamicWaterHeater "Dynamic water heater" steady_state=steady_state, Cal_hconv=true, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - wsftype=wsftype) + diffusion=diffusion) annotation ( Placement(transformation(extent={{-100, -100},{100,100}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3( + redeclare package Medium = Medium_Cooling, option_temperature=false, D=Dc, Ns=Ns*2, @@ -95,20 +96,20 @@ model DynamicWaterHeater "Dynamic water heater" simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, advection=advection) annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0))); - Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation (Placement( + Interfaces.Connectors.FluidInlet C1vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet" + Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet" annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation= 0))); - Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation ( + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation ( Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation ( + Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation ( Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation= 0))); - Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation ( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) "Extra water inlet" annotation ( Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0))); Thermal.HeatTransfer.HeatExchangerWall Wall_3( D=Dc, @@ -123,6 +124,7 @@ model DynamicWaterHeater "Dynamic water heater" steady_state=steady_state) annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_1( + redeclare package Medium = Medium_Cooling, option_temperature=false, D=Dc, Ns=Ns, @@ -155,6 +157,7 @@ model DynamicWaterHeater "Dynamic water heater" annotation (Placement(transformation(extent={{-35,-69},{59,-21}}, rotation= 0))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_2( + redeclare package Medium = Medium_Cooling, option_temperature=false, D=Dc, Ns=Ns, @@ -186,30 +189,30 @@ model DynamicWaterHeater "Dynamic water heater" steady_state=steady_state) annotation (Placement(transformation(extent={{-35,21},{59,69}}, rotation=0))); Volumes.VolumeC volumeC( + redeclare package Medium = Medium_Cooling, h0=890e3, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, diffusion=diffusion, dynamic_mass_balance=dynamic_mass_balance, - continuous_flow_reversal=continuous_flow_reversal, - ftype=ftype) annotation (Placement(transformation(extent={{ + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{ -56,35},{-74,53}}, rotation=0))); Volumes.VolumeD volumeD( + redeclare package Medium = Medium_Cooling, h0=790e3, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, diffusion=diffusion, dynamic_mass_balance=dynamic_mass_balance, - continuous_flow_reversal=continuous_flow_reversal, - ftype=ftype) annotation (Placement(transformation(extent={{-74,-54},{-56, + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{-74,-54},{-56, -36}}, rotation=0))); Volumes.VolumeD volumeD1( + redeclare package Medium = Medium_Cooling, h0=850e3, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, diffusion=diffusion, - dynamic_mass_balance=dynamic_mass_balance, - ftype=ftype) annotation (Placement(transformation( + dynamic_mass_balance=dynamic_mass_balance) annotation (Placement(transformation( origin={75,-33}, extent={{-9,-9},{9,9}}, rotation=90))); @@ -221,11 +224,8 @@ equation C1.h_vol_1 = 1.e5; C1.diff_res_1 = 0; C1.diff_on_1 = false; - C1.ftype = ftype; - C1.Xco2 = 0; - C1.Xh2o = 0; - C1.Xo2 = 0; - C1.Xso2 = 0; + C1.Xi = Medium.X_default[1:Medium.nXi]; + C1.SubC = Medium.C_default; end if; connect(C1vap, WaterHeating.Cv) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo index 85cf51ee..983d6f73 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo @@ -1,9 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicWaterHeaterOnePipe "Dynamic water heater" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipe" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume"; //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area"; @@ -39,7 +39,7 @@ model DynamicWaterHeaterOnePipe "Dynamic water heater" parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia"; parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme"; parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium_Cooling.isCompressible and dynamic_energy_balance)); parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); parameter Boolean steady_state=true "true: start from steady state - false: start from (Vf0, P0c, T0 or h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); @@ -60,6 +60,7 @@ model DynamicWaterHeaterOnePipe "Dynamic water heater" parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; Volumes.TwoPhaseCavity WaterHeating( + redeclare package Medium = Medium, Vf0=Vf0, P0=P0c, Ns=Ns, @@ -81,11 +82,11 @@ model DynamicWaterHeaterOnePipe "Dynamic water heater" dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - wsftype=wsftype) + diffusion=diffusion) annotation ( Placement(transformation(extent={{-100, -100},{100,100}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3( + redeclare package Medium = Medium_Cooling, D=Dc, Ns=Ns*2, dpfCorr=DpfCorr, @@ -105,20 +106,20 @@ model DynamicWaterHeaterOnePipe "Dynamic water heater" option_temperature=option_temperature, P0=P0c) annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0))); - Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation (Placement( + Interfaces.Connectors.FluidInlet C1vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( transformation(extent={{-10,90},{10,110}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet" + Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet" annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation= 0))); - Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation ( + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation ( Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation ( + Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation ( Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation= 0))); - Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation ( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) "Extra water inlet" annotation ( Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0))); Thermal.HeatTransfer.HeatExchangerWall Wall_3( D=Dc, @@ -134,22 +135,22 @@ model DynamicWaterHeaterOnePipe "Dynamic water heater" annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0))); Volumes.VolumeD volumeD( + redeclare package Medium = Medium_Cooling, h0=790e3, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, diffusion=diffusion, dynamic_mass_balance=dynamic_mass_balance, - continuous_flow_reversal=continuous_flow_reversal, - ftype=ftype) annotation (Placement(transformation(extent={{-72,-54},{-54,-36}}, + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{-72,-54},{-54,-36}}, rotation=0))); Volumes.VolumeC volumeC( + redeclare package Medium = Medium_Cooling, h0=890e3, dynamic_energy_balance=dynamic_energy_balance, dynamic_mass_balance=dynamic_mass_balance, steady_state=steady_state, diffusion=diffusion, - continuous_flow_reversal=continuous_flow_reversal, - ftype=ftype) annotation (Placement(transformation(extent={{-52,35}, + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{-52,35}, {-70,53}}, rotation=0))); equation if (cardinality(C1) == 1) then @@ -158,11 +159,8 @@ equation C1.h_vol_1 = 1.e5; C1.diff_res_1 = 0; C1.diff_on_1 = false; - C1.ftype = ftype; - C1.Xco2 = 0; - C1.Xh2o = 0; - C1.Xo2 = 0; - C1.Xso2 = 0; + C1.Xi = Medium.X_default[1:Medium.nXi]; + C1.SubC = Medium.C_default; end if; connect(C1vap, WaterHeating.Cv) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo index 2492a6bb..fce224ee 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo @@ -1,8 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model DynamicWaterSteamMultiFluidsHeatExchanger "Dynamic water/steam heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_1 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the one-phase side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_2 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Length L=1 "Exchanger length"; parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; @@ -41,9 +42,9 @@ model DynamicWaterSteamMultiFluidsHeatExchanger "Dynamic water/steam heat exchan "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); Fluid.HeatExchangers.DynamicOnePhaseFlowPipe ExchangerMultiFluids( + redeclare package Medium = Medium_1, Ns=Ns, L=L, ntubes=Ntubes, @@ -71,6 +72,7 @@ model DynamicWaterSteamMultiFluidsHeatExchanger "Dynamic water/steam heat exchan T0=T0[1]) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe( + redeclare package Medium = Medium_2, L=L, D=Dint, ntubes=Ntubes, @@ -90,13 +92,13 @@ model DynamicWaterSteamMultiFluidsHeatExchanger "Dynamic water/steam heat exchan continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation= 0))); - Interfaces.Connectors.FluidInlet Cfg1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_1) annotation (Placement(transformation( extent={{-10,40},{10,60}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cfg2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_1) annotation (Placement(transformation( extent={{-10,-60},{10,-40}}, rotation=0))); - Interfaces.Connectors.FluidInlet Cws1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_2) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_2) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); equation connect(Cws2, TwoPhaseFlowPipe.C2) diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo index d7f788fb..a44a2548 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model SteamGenerator_1SG "Single steam generator" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the secondary water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Primary = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the primary side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real H0_Mix_AlimDomeGV=1194812.89980521; parameter Boolean inertia=false @@ -33,6 +32,7 @@ model SteamGenerator_1SG "Single steam generator" public ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg( + redeclare package Medium = Medium_Primary, L=10.848, D=0.01687, z2=10.848, @@ -60,6 +60,7 @@ public rotation=270))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg( + redeclare package Medium = Medium_Primary, L=10.848, D=0.01687, h(start={1326153.46646787,1310848.36111251,1299218.76228131, @@ -87,6 +88,7 @@ public rotation=90))); ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV( + redeclare package Medium = Medium, hl(start=1257382.15477056), hv(start=2771260.46625813), cpp=500, @@ -100,12 +102,12 @@ public continuous_flow_reversal=continuous_flow_reversal, diffusion=diffusion, Vf0=Vf0, - P0=P0, - wsftype=wsftype) + P0=P0) annotation (Placement(transformation(extent={{-22,64},{22,107}}, rotation=0))); protected ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone( + redeclare package Medium = Medium, L=1, D=0.95886, lambda=0.03, @@ -116,6 +118,7 @@ protected rotation=90))); public ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV( + redeclare package Medium = Medium, h0=H0_Mix_AlimDomeGV, h(start=1194851.37111438), V=0.01, @@ -123,39 +126,40 @@ public steady_state=steady_state, dynamic_mass_balance=dynamic_mass_balance, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - ftype=ftype) " " + diffusion=diffusion) " " annotation (Placement(transformation( origin={94,63}, extent={{-8,-8},{8,8}}, rotation=270))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc( + redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation( origin={94,88}, extent={{-6,-7},{6,7}}, rotation=270))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc( + redeclare package Medium = Medium, p_rho=0, C2(P(start=6829391.22090726), Q(fixed=false, start=6643)), K=0.172144) annotation (Placement(transformation(extent={{53,53}, {63,73}}, rotation=0))); public - ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim + ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim(redeclare package Medium = Medium) annotation (Placement(transformation( origin={99,26}, extent={{-6,-6},{6,6}}, rotation=270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{42,102},{62,122}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1(redeclare package Medium = Medium_Primary) annotation ( Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1 + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1(redeclare package Medium = Medium_Primary) annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal @@ -163,6 +167,7 @@ public 0))); public ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV( + redeclare package Medium = Medium, p_rho=0, h(start=1194851.3), z1=10.8, @@ -217,6 +222,7 @@ public rotation=270))); ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV( + redeclare package Medium = Medium, Ns=5, h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846, 1525552.01981793,1595519.78942018,1595519.78863864}), @@ -247,24 +253,24 @@ public rotation=90))); ThermoSysPro.Fluid.Volumes.VolumeC volumeA( + redeclare package Medium = Medium, h0=1185.2e3, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, dynamic_mass_balance=dynamic_mass_balance, continuous_flow_reversal=continuous_flow_reversal, diffusion=diffusion, - ftype=ftype, P0=6849350) annotation (Placement(transformation( origin={1,-90}, extent={{-10,-10},{10,10}}, rotation=90))); ThermoSysPro.Fluid.Volumes.VolumeC volumeA1( + redeclare package Medium = Medium, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, dynamic_mass_balance=dynamic_mass_balance, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - ftype=ftype) annotation ( + diffusion=diffusion) annotation ( Placement(transformation( origin={0,18}, extent={{-10,-10},{10,10}}, diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo index 73f41820..7a19f642 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.HeatExchangers; model SteamGenerator_4SG "Single steam generator equivalent to four steam generators" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the secondary water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Primary = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the primary side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real H0_Mix_AlimDomeGV=1194812.89980521; parameter Boolean inertia=false @@ -33,6 +32,7 @@ model SteamGenerator_4SG "Single steam generator equivalent to four steam genera public ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg( + redeclare package Medium = Medium_Primary, L=10.848, D=0.01687, z2=10.848, @@ -60,6 +60,7 @@ public rotation=270))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg( + redeclare package Medium = Medium_Primary, L=10.848, D=0.01687, z1=10.848, @@ -87,6 +88,7 @@ public rotation=90))); ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV( + redeclare package Medium = Medium, hl(start=1257382.15477056), hv(start=2771260.46625813), Mp=32000, @@ -100,11 +102,11 @@ public Vf0=Vf0, P0=P0, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - wsftype=wsftype) annotation (Placement(transformation(extent={{ + diffusion=diffusion) annotation (Placement(transformation(extent={{ -22,64},{22,107}}, rotation=0))); protected ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone( + redeclare package Medium = Medium, L=1, D=0.95886, lambda=0.03, @@ -115,6 +117,7 @@ protected rotation=90))); public ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV( + redeclare package Medium = Medium, h0=H0_Mix_AlimDomeGV, h(start=1194851.37111438), V=0.01, @@ -122,19 +125,19 @@ public dynamic_mass_balance=dynamic_mass_balance, steady_state=steady_state, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - ftype=ftype) " " + diffusion=diffusion) " " annotation (Placement(transformation( origin={94,63}, extent={{-8,-8},{8,8}}, rotation=270))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc( - K=1e-4, rho(start=839)) + redeclare package Medium = Medium, K=1e-4, rho(start=839)) annotation (Placement(transformation( origin={94,88}, extent={{-6,-7},{6,7}}, rotation=270))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc( + redeclare package Medium = Medium, p_rho=0, C2(P(start=6829391.22090726), Q(fixed=false, start=6643)), K=0.172144, @@ -142,20 +145,20 @@ public {{53,53},{63,73}}, rotation=0))); public - ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim + ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim(redeclare package Medium = Medium) annotation (Placement(transformation( origin={99,26}, extent={{-6,-6},{6,6}}, rotation=270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet(redeclare package Medium = Medium) annotation ( Placement(transformation(extent={{42,102},{62,122}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation ( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1(redeclare package Medium = Medium_Primary) annotation ( Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1 + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1(redeclare package Medium = Medium_Primary) annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal @@ -163,6 +166,7 @@ public 0))); public ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV( + redeclare package Medium = Medium, p_rho=0, h(start=1194851.3), z1=10.8, @@ -218,6 +222,7 @@ public rotation=270))); ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV( + redeclare package Medium = Medium, Ns=5, Q(start={8600,8600,8600,8600,8600,8600}), h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846, @@ -246,26 +251,26 @@ public rotation=90))); ThermoSysPro.Fluid.Volumes.VolumeC volumeA( + redeclare package Medium = Medium, h0=1185.2e3, dynamic_energy_balance=dynamic_energy_balance, dynamic_mass_balance=dynamic_mass_balance, - ftype=ftype, P0=6849350) annotation (Placement(transformation( origin={0.5,-92}, extent={{-8,-8.5},{8,8.5}}, rotation=90))); ThermoSysPro.Fluid.Volumes.VolumeC volumeA1( + redeclare package Medium = Medium, dynamic_energy_balance=dynamic_energy_balance, dynamic_mass_balance=dynamic_mass_balance, steady_state=steady_state, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - ftype=ftype) annotation ( + diffusion=diffusion) annotation ( Placement(transformation( origin={-0.5,17}, extent={{-9,-9.5},{9,9.5}}, rotation=90))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Vapeur(K= + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Vapeur(redeclare package Medium = Medium, K= 1e-4, Q(start=2113)) annotation (Placement(transformation( origin={-0.5,124}, diff --git a/ThermoSysPro/Fluid/Sensors/SensorP.mo b/ThermoSysPro/Fluid/Sensors/SensorP.mo index a173f50b..bbac2f0c 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorP.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorP.mo @@ -1,15 +1,17 @@ within ThermoSysPro.Fluid.Sensors; model SensorP "Pressure sensor" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation (Placement(transformation( origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -26,12 +28,8 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; /* Sensor signal */ Measure.signal = C1.P; From 3e39bd49ecbf0d18e5d679058a98a92cd1e94822 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 11:25:58 +0200 Subject: [PATCH 147/213] 125 Sensors --- .../SimpleExamples/Sensors/TestSensors.mo | 25 ++++++ .../Sensors/TestSensors_FlueGases.mo | 30 +++++++ .../Sensors/TestSensors_Traces.mo | 29 +++++++ .../SimpleExamples/Sensors/package.order | 3 + ThermoSysPro/Fluid/Sensors/SensorH.mo | 13 ++- ThermoSysPro/Fluid/Sensors/SensorP.mo | 2 +- ThermoSysPro/Fluid/Sensors/SensorQ.mo | 13 ++- ThermoSysPro/Fluid/Sensors/SensorQv.mo | 23 ++---- ThermoSysPro/Fluid/Sensors/SensorSubC.mo | 81 +++++++++++++++++++ ThermoSysPro/Fluid/Sensors/SensorT.mo | 25 +++--- ThermoSysPro/Fluid/Sensors/SensorX.mo | 81 +++++++++++++++++++ ThermoSysPro/Fluid/Sensors/package.order | 2 + 12 files changed, 280 insertions(+), 47 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo create mode 100644 ThermoSysPro/Fluid/Sensors/SensorSubC.mo create mode 100644 ThermoSysPro/Fluid/Sensors/SensorX.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo new file mode 100644 index 00000000..c0f0702e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo new file mode 100644 index 00000000..2a5805a4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo new file mode 100644 index 00000000..c163eb70 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) + annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order index e69de29b..89cbb72b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order @@ -0,0 +1,3 @@ +TestSensors +TestSensors_FlueGases +TestSensors_Traces diff --git a/ThermoSysPro/Fluid/Sensors/SensorH.mo b/ThermoSysPro/Fluid/Sensors/SensorH.mo index d6fcfd4b..92c53c8f 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorH.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorH.mo @@ -1,15 +1,17 @@ within ThermoSysPro.Fluid.Sensors; model SensorH "Specific enthalpy sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation (Placement(transformation( origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -26,12 +28,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; /* Sensor signal */ Measure.signal = C1.h; diff --git a/ThermoSysPro/Fluid/Sensors/SensorP.mo b/ThermoSysPro/Fluid/Sensors/SensorP.mo index bbac2f0c..2ff4edba 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorP.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorP.mo @@ -1,8 +1,8 @@ within ThermoSysPro.Fluid.Sensors; model SensorP "Pressure sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation (Placement(transformation( diff --git a/ThermoSysPro/Fluid/Sensors/SensorQ.mo b/ThermoSysPro/Fluid/Sensors/SensorQ.mo index 2867db77..9deb22a2 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQ.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQ.mo @@ -1,15 +1,17 @@ within ThermoSysPro.Fluid.Sensors; model SensorQ "Mass flow sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation (Placement(transformation( origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -26,12 +28,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; /* Sensor signal */ Measure.signal = C1.Q; diff --git a/ThermoSysPro/Fluid/Sensors/SensorQv.mo b/ThermoSysPro/Fluid/Sensors/SensorQv.mo index 1f039216..2c9b2e9a 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQv.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQv.mo @@ -1,14 +1,12 @@ within ThermoSysPro.Fluid.Sensors; model SensorQv "Volumetric flow sensor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor"; public @@ -17,8 +15,6 @@ public Units.SI.AbsolutePressure Pm "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Density rho(start=998) "Fluid density"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -26,9 +22,9 @@ public origin={0,102}, extent={{-10,-10},{10,10}}, rotation=90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -45,17 +41,12 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; - ftype = C1.ftype; - /* Sensor signal */ Qv = Q/rho; Measure.signal = Qv*facteur; @@ -63,7 +54,7 @@ equation /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; h = C1.h; - rho = ThermoSysPro.Properties.Fluid.Density_Ph(C1.P,h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=C1.Xi); annotation ( Icon(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Sensors/SensorSubC.mo b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo new file mode 100644 index 00000000..8f4b21fe --- /dev/null +++ b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo @@ -0,0 +1,81 @@ +within ThermoSysPro.Fluid.Sensors; +model SensorSubC "SubC sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nC] Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); +equation + + C1.P = C2.P; + C1.Q = C2.Q; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ + Measure.signal = C1.SubC; + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "C")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "C")}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +", + revisions=" +

    Authors

    +
      +
    • Daniel Bouskela
    • +
    • Baligh El Hefni
    • +
    +")); +end SensorSubC; diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo index 5c4d341d..e9ec13d9 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorT.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo @@ -1,14 +1,12 @@ within ThermoSysPro.Fluid.Sensors; model SensorT "Temperature sensor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real pi=Modelica.Constants.pi "pi"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Units.SI.MassFlowRate Qeps=1.e-3 "Minimum mass flow rate for continuous flow reversal"; @@ -17,8 +15,7 @@ public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -29,9 +26,9 @@ public extent={{-10,-10},{10,10}}, rotation=90, origin={0,102}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation @@ -48,16 +45,12 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; - - ftype = C1.ftype; + X = C1.Xi; /* Sensor signal */ Measure.signal = T; @@ -66,7 +59,7 @@ equation P = (C1.P + C2.P)/2; h = (C1.h + C2.h)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h,fluid,mode,C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Sensors/SensorX.mo b/ThermoSysPro/Fluid/Sensors/SensorX.mo new file mode 100644 index 00000000..a6a72209 --- /dev/null +++ b/ThermoSysPro/Fluid/Sensors/SensorX.mo @@ -0,0 +1,81 @@ +within ThermoSysPro.Fluid.Sensors; +model SensorX "X sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nXi] Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); +equation + + C1.P = C2.P; + C1.Q = C2.Q; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ + Measure.signal = C1.Xi; + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "X")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "X")}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +", + revisions=" +

    Authors

    +
      +
    • Daniel Bouskela
    • +
    • Baligh El Hefni
    • +
    +")); +end SensorX; diff --git a/ThermoSysPro/Fluid/Sensors/package.order b/ThermoSysPro/Fluid/Sensors/package.order index f2873124..eefb8c73 100644 --- a/ThermoSysPro/Fluid/Sensors/package.order +++ b/ThermoSysPro/Fluid/Sensors/package.order @@ -3,3 +3,5 @@ SensorQ SensorQv SensorH SensorT +SensorSubC +SensorX From 452e3052abeeac5dd2959e7b293b1945c8305adf Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 3 Jul 2025 11:49:36 +0200 Subject: [PATCH 148/213] #125 SensorT without X redeclaration --- ThermoSysPro/Fluid/Sensors/SensorT.mo | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo index e9ec13d9..307551eb 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorT.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo @@ -15,7 +15,6 @@ public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -50,7 +49,6 @@ equation C1.SubC = C2.SubC; Q = C1.Q; - X = C1.Xi; /* Sensor signal */ Measure.signal = T; @@ -59,7 +57,7 @@ equation P = (C1.P + C2.P)/2; h = (C1.h + C2.h)/2; - T = Medium.temperature_phX(p=P, h=h, X=X); + T = Medium.temperature_phX(p=P, h=h, X=C1.Xi); annotation ( Diagram(coordinateSystem( From 4666d38d5a5aa9f55b8be8cdb839301a7286cee9 Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Thu, 3 Jul 2025 15:13:45 +0200 Subject: [PATCH 149/213] Simplified sensor T et Qv : removed unused variables, transformed facteur into parameter instead of variable --- ThermoSysPro/Fluid/Sensors/SensorQv.mo | 9 ++------- ThermoSysPro/Fluid/Sensors/SensorT.mo | 16 +--------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/ThermoSysPro/Fluid/Sensors/SensorQv.mo b/ThermoSysPro/Fluid/Sensors/SensorQv.mo index 2c9b2e9a..83b43337 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQv.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQv.mo @@ -6,14 +6,11 @@ model SensorQv "Volumetric flow sensor" parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; protected - constant Real pi=Modelica.Constants.pi "pi"; - Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor"; + parameter Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor"; public Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; - Units.SI.AbsolutePressure Pm "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Density rho(start=998) "Fluid density"; public @@ -52,9 +49,7 @@ equation Measure.signal = Qv*facteur; /* Fluid thermodynamic properties */ - Pm = (C1.P + C2.P)/2; - h = C1.h; - rho = Medium.density_phX(p=Pm, h=h, X=C1.Xi); + rho = Medium.density_phX(p=C1.P, h=C1.h, X=C1.Xi); annotation ( Icon(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo index 307551eb..2a6d4746 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorT.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo @@ -3,18 +3,9 @@ model SensorT "Temperature sensor" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - -protected - constant Real pi=Modelica.Constants.pi "pi"; - parameter Units.SI.MassFlowRate Qeps=1.e-3 - "Minimum mass flow rate for continuous flow reversal"; public - Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; public ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure @@ -48,16 +39,11 @@ equation C1.SubC = C2.SubC; - Q = C1.Q; - /* Sensor signal */ Measure.signal = T; /* Fluid thermodynamic properties */ - P = (C1.P + C2.P)/2; - h = (C1.h + C2.h)/2; - - T = Medium.temperature_phX(p=P, h=h, X=C1.Xi); + T = Medium.temperature_phX(p=C1.P, h=C1.h, X=C1.Xi); annotation ( Diagram(coordinateSystem( From 2d7a532349ab42a53636886b479b09a3fd5cffac Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Mon, 16 Jun 2025 17:50:22 +0200 Subject: [PATCH 150/213] conflict #125-LumpedStraightPipe --- ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index 54439c4d..014b462a 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -112,6 +112,8 @@ equation Pm = (C1.P + C2.P)/2; state = Medium.setState_phX(p=Pm, h=h, X=X); + state=Medium.setState_phX(p=Pm, h=h, X=X, region=mode); + if (p_rho > 0) then rho = p_rho; else From 977c98bb8adad56eabfa1e74ce62f5b58d9401b4 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 15:27:10 +0200 Subject: [PATCH 151/213] 125 LumpedStraightPipe for FlueGases --- ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index 014b462a..3bb6f579 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -112,7 +112,7 @@ equation Pm = (C1.P + C2.P)/2; state = Medium.setState_phX(p=Pm, h=h, X=X); - state=Medium.setState_phX(p=Pm, h=h, X=X, region=mode); + state=Medium.setState_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; From 09fbe1f19de7ecd03f2d82ecfcc06a3b6e6f9ec2 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 20:23:19 +0200 Subject: [PATCH 152/213] #125 CombustionTurbine --- .../Machines/TestCombustionTurbine.mo | 46 +++++++++++++++++ .../Machines/TestCombustionTurbine_Traces.mo | 50 +++++++++++++++++++ .../SimpleExamples/Machines/package.order | 2 + .../Fluid/Machines/CombustionTurbine.mo | 45 ++++++----------- 4 files changed, 114 insertions(+), 29 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo new file mode 100644 index 00000000..6812d7bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCombustionTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + parameter Real Qred1(fixed=false, start=0.01) "Reduced mass flow rate"; + + Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2+Medium.h_offset)) annotation (Placement(transformation(extent={{-42,-42},{36,42}}, rotation=0))); + Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + option_temperature=true, + X0={1-0.14-0.06-0.06,0.14,0.06,0.06,0}, + Q0=430, + T0=1500) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, rotation=0))); + Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, + P0=100000, + T0=830) annotation (Placement(transformation( + origin={94,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); + InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8) annotation (Placement(transformation(extent={{-100,-42},{-80,-22}}, rotation=0))); +equation + connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line( + points={{-86,0},{-42,0}}, + color={0,0,0}, + thickness=1)); + connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line( + points={{36,0},{84,0}}, + color={0,0,0}, + thickness=1)); + connect(Wc1.y, CombustionTurbine.CompressorPower) annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}})); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 11.4.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestCombustionTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo new file mode 100644 index 00000000..6dac368b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo @@ -0,0 +1,50 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCombustionTurbine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + parameter Real Qred1(fixed=false, start=0.01) "Reduced mass flow rate"; + + Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2 + Medium.h_offset)) annotation (Placement(transformation(extent={{-42,-42},{36,42}}, rotation=0))); + Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.14 - 0.06 - 0.06,0.14,0.06,0.06,0}, + Q0=430, + T0=1500) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, rotation=0))); + Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=100000, + T0=830) annotation (Placement(transformation( + origin={94,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); + InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8) annotation (Placement(transformation(extent={{-100,-42},{-80,-22}}, rotation=0))); +equation + connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line( + points={{-86,0},{-42,0}}, + color={0,0,0}, + thickness=1)); + connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line( + points={{36,0},{84,0}}, + color={0,0,0}, + thickness=1)); + connect(Wc1.y, CombustionTurbine.CompressorPower) annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}})); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 11.4.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestCombustionTurbine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 693aa900..5a733a68 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -6,3 +6,5 @@ TestStaticCentrifugalPump_Traces TestCentrifugalPump TestCentrifugalPump_FlueGases TestCentrifugalPump_Traces +TestCombustionTurbine +TestCombustionTurbine_Traces diff --git a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo index d521b5ea..76cf21e6 100644 --- a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo @@ -1,7 +1,8 @@ within ThermoSysPro.Fluid.Machines; model CombustionTurbine "Combustion turbine" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real A3=0 "X^3 coefficient of the efficiency curve"; parameter Real A2=-0.04778 "X^2 coefficient of the efficiency curve"; parameter Real A1=0.09555 "X^1 coefficient of the efficiency curve"; @@ -33,25 +34,15 @@ public Units.SI.SpecificEnthalpy His(start=6e5) "Flue gases specific enthalpy after the isentropic expansion"; Units.SI.SpecificEntropy Se "Flue gases specific entropy at the inlet"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; public - Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation( - extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation( - extent={{90,-10},{110,10}}, rotation=0))); -public - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower - annotation (Placement(transformation(extent={{-120,-50},{-100,-30}}, - rotation=0))); -public - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower - annotation (Placement(transformation(extent={{100,-100},{120,-80}}, - rotation=0))); + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower annotation (Placement(transformation(extent={{-120,-50},{-100,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + + Medium.ThermodynamicState state_e; equation - /* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "CombustionTurbine: the fluid type must be flue gases"); Ce.Q = Cs.Q; @@ -64,12 +55,9 @@ equation Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - Ce.ftype = Cs.ftype; + Ce.SubC = Cs.SubC; - Ce.Xco2 = Cs.Xco2; - Ce.Xh2o = Cs.Xh2o; - Ce.Xo2 = Cs.Xo2; - Ce.Xso2 = Cs.Xso2; + Ce.Xi = Cs.Xi; Q = Ce.Q; @@ -79,8 +67,6 @@ equation He = Ce.h; Hs = Cs.h; - ftype = Ce.ftype; - /* Input compressor power (negative value) */ Wcp = CompressorPower.signal; @@ -104,20 +90,21 @@ equation MechPower.signal = Wmech; /* Temperature at the inlet */ - Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + state_e = Medium.setState_phX(Pe,He,Ce.Xi); + Te=Medium.temperature(state_e); /* Specific entropy at the inlet */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + Se = Medium.specificEntropy(state_e); /* Specific enthalpy after the isentropic expansion */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + Tis=Medium.temperature(Medium.setState_psX(Ps,Se,Ce.Xi)); + His = Medium.specificEnthalpy_pTX(Ps,Tis,Ce.Xi); /* Specific enthalpy at the outlet */ Hs = is_eff*(His - He) + He; /* Temperature at the outlet */ - Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + Ts = Medium.temperature_phX(Ps,Hs,Ce.Xi); annotation ( Diagram(coordinateSystem( From d40a6104758d910427567c59f1440a0d5e2486c5 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 20:37:10 +0200 Subject: [PATCH 153/213] #125 Compressor --- .../SimpleExamples/Machines/TestCompressor.mo | 40 ++++++++++++++++ .../Machines/TestCompressor_Traces.mo | 43 +++++++++++++++++ .../SimpleExamples/Machines/package.order | 2 + ThermoSysPro/Fluid/Machines/Compressor.mo | 48 ++++++++----------- 4 files changed, 104 insertions(+), 29 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo new file mode 100644 index 00000000..345c316c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo @@ -0,0 +1,40 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCompressor + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + Ps(fixed=false), + tau_n=16, + is_eff_n=is_eff_n1, + Pe(fixed=false, start=100000), + Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{-52,-52},{48,52}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}, + Q0=420, + P0=100000, + T0=288, + option_temperature=true) annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, P0=15.8e5) annotation (Placement(transformation( + origin={96,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(SourceQ1.C, Compressor.Ce) annotation (Line( + points={{-84,0},{-39.5,0}}, + color={0,0,0}, + thickness=1)); + connect(Compressor.Cs, SinkP1.C) annotation (Line( + points={{35.5,0},{86,0}}, + color={0,0,0}, + thickness=1)); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo new file mode 100644 index 00000000..e2792641 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCompressor_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + Ps(fixed=false), + tau_n=16, + is_eff_n=is_eff_n1, + Pe(fixed=false, start=100000), + Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{-52,-52},{48,52}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}, + Q0=420, + P0=100000, + T0=288, + option_temperature=true) annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, P0=15.8e5) annotation (Placement(transformation( + origin={96,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(SourceQ1.C, Compressor.Ce) annotation (Line( + points={{-84,0},{-39.5,0}}, + color={0,0,0}, + thickness=1)); + connect(Compressor.Cs, SinkP1.C) annotation (Line( + points={{35.5,0},{86,0}}, + color={0,0,0}, + thickness=1)); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestCompressor_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 5a733a68..22dae67a 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -8,3 +8,5 @@ TestCentrifugalPump_FlueGases TestCentrifugalPump_Traces TestCombustionTurbine TestCombustionTurbine_Traces +TestCompressor +TestCompressor_Traces diff --git a/ThermoSysPro/Fluid/Machines/Compressor.mo b/ThermoSysPro/Fluid/Machines/Compressor.mo index ffcd288c..485a23cc 100644 --- a/ThermoSysPro/Fluid/Machines/Compressor.mo +++ b/ThermoSysPro/Fluid/Machines/Compressor.mo @@ -1,7 +1,8 @@ within ThermoSysPro.Fluid.Machines; model Compressor "Gas compressor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer mass_flow_rate_comp=1 "Ways for computing the mass flow rate - 1: Q = rho*Qv - 2: Q = rho*f(T)"; parameter Units.SI.Temperature Tmax=284.16 "Air transition temperature between f1 = a*x + b and f2 = c*x + d for the computation of Q (active if mass_flow_rate_comp == 2)"; @@ -43,22 +44,15 @@ public "Air specific enthalpy after the isentropic compression"; Units.SI.SpecificEntropy Se "Air specific entropy at the inlet"; Units.SI.Density rho_e(start=1) "Air density at the inlet"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; public - Interfaces.Connectors.FluidInlet Ce annotation (Placement(transformation( - extent={{-100,-10},{-80,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cs annotation (Placement(transformation( - extent={{80,-10},{100,10}}, rotation=0))); -public - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power - annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation= - 0))); -equation - /* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "Compressor: the fluid type must be flue gases"); + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation=0))); + Medium.ThermodynamicState state_e; + Medium.ThermodynamicState state_s; +equation Ce.Q = Cs.Q; Ce.h_vol_1 = Cs.h_vol_1; @@ -70,12 +64,9 @@ equation Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - Ce.ftype = Cs.ftype; + Ce.SubC = Cs.SubC; - Ce.Xco2 = Cs.Xco2; - Ce.Xh2o = Cs.Xh2o; - Ce.Xo2 = Cs.Xo2; - Ce.Xso2 = Cs.Xso2; + Ce.Xi = Cs.Xi; Q = Ce.Q; @@ -85,8 +76,6 @@ equation He = Ce.h; Hs = Cs.h; - ftype = Ce.ftype; - /* Compression rate */ tau = Ps/Pe; @@ -107,18 +96,19 @@ equation /* Specific enthalpy at the inlet */ //Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); // Call implicitly to avoid function that cannot be differentiated. - He = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - + state_e = Medium.setState_pTX(Pe,Te,Ce.Xi); + He = Medium.specificEnthalpy_pTX(Pe,Te,Ce.Xi); /* Specific entropy at the inlet */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + Se = Medium.specificEntropy(state_e); /* Specific enthalpy after the isentropic compression */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + state_s= Medium.setState_psX(Ps,Se,Ce.Xi); + Tis = Medium.temperature(state_s); + His = Medium.specificEnthalpy(state_s); /* Fluid density at the inlet */ //rho_e = ThermoSysPro.Properties.Fluid.Density_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - rho_e = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); + rho_e = Medium.density(state_e); /* Specific enthalpy at the outlet */ Hs = (His - He + is_eff*He)/is_eff; @@ -126,9 +116,9 @@ equation /* Temperature at the outlet */ // Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); // Call implicitly to avoid function that cannot be differentiated. - Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - + Hs= Medium.specificEnthalpy_pTX(Ps,Ts,Ce.Xi); annotation ( + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{ 120,100}}), graphics={Polygon( points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}}, From fed0621b2b226a587dff8fc265beebe296577db7 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 21:33:09 +0200 Subject: [PATCH 154/213] conflict #125 AirHumidity --- .../Fluid/BoundaryConditions/AirHumidity.mo | 45 +++++--------- .../BoundaryConditions/TestAirHumidity.mo | 56 ++++++++++++++++++ .../TestAirHumidity_Traces.mo | 59 +++++++++++++++++++ .../BoundaryConditions/package.order | 2 + .../Properties/FlueGases/getSubstanceIndex.mo | 16 +++++ .../Properties/FlueGases/package.order | 1 + 6 files changed, 148 insertions(+), 31 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo create mode 100644 ThermoSysPro/Properties/FlueGases/getSubstanceIndex.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo index a90a1049..6da2c852 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo @@ -1,19 +1,12 @@ within ThermoSysPro.Fluid.BoundaryConditions; model AirHumidity "Air humidity" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real hum0=0.5 "Air humidiy"; parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - -protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; public - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; Units.SI.AbsolutePressure ppvap0(start=1e4) "Intermediate vapor partial pressure"; Units.SI.Density rho_vap0(start=200) "Intermediate H2O density"; @@ -28,16 +21,13 @@ public Units.SI.AbsolutePressure ppair "Air partial pressure"; Real hum "Air relative humidity"; Real Xo2as(start=0.2) "O2 mass fraction in dry air"; - Real Xco2 "CO2 mass fraction at the outlet"; Real Xh2o "H2O mass fraction at the outlet"; - Real Xo2 "O2 mass fraction at the outlet"; - Real Xso2 "SO2 mas fraction at the outlet"; public ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= 0))); - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium=Medium) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.InputReal humidity "Air humidity" @@ -45,12 +35,9 @@ public origin={0,110}, extent={{-10,-10},{10,10}}, rotation=270))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium=Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); equation - /* The fluid type must be flue gases */ - assert(ftype == FluidType.FlueGases, "AirHumidity: the fluid type must be flue gases"); - if (cardinality(humidity) == 0) then humidity.signal = hum0; end if; @@ -70,30 +57,26 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.SubC = C2.SubC; P = C1.P; Q = C1.Q; h = C1.h; - ftype = C1.ftype; - /* O2 mass fraction at the inlet */ - Xo2as = C1.Xo2; + Xo2as = C1.Xi[Properties.FlueGases.getSubstanceIndex("Oxygen",Medium.substanceNames)]; /* Temperature at the outlet */ - T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2as, Xso2); +// T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, 0, Xh2o, Xo2as, 0); + T = Medium.temperature_phX(P,h, C2.Xi); /* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */ - Xco2 = 0; - Xso2 = 0; + C2.Xi[Properties.FlueGases.getSubstanceIndex("Sulfurdioxide",Medium.substanceNames)] = 0; + C2.Xi[Properties.FlueGases.getSubstanceIndex("Carbondioxide",Medium.substanceNames)] = 0; Xh2o = rho_vap/(rho_vap + rho_air); - Xo2 = Xo2as*(1 - Xh2o); - - C2.Xco2 = Xco2; - C2.Xso2 = Xso2; - C2.Xh2o = Xh2o; - C2.Xo2 = Xo2; + C2.Xi[Properties.FlueGases.getSubstanceIndex("Water",Medium.substanceNames)] = Xh2o; + C2.Xi[Properties.FlueGases.getSubstanceIndex("Oxygen",Medium.substanceNames)] = Xo2as*(1 - Xh2o); + C2.Xi[Properties.FlueGases.getSubstanceIndex("Nitrogen",Medium.substanceNames)] = 1- Xo2as*(1 - Xh2o) - Xh2o; /* Vapor partial pressure */ ppvap = psvap*hum; @@ -106,14 +89,14 @@ equation psvap = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T); /* H2O density */ - pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, mode); + pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, 0); rho_vap0 = pro.d; 0 = if (ppvap < 0.061080e-4) then rho_vap - (rho_vap0*ppvap/ppvap0) else rho_vap - rho_vap0; /* Air density */ - rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, Xco2, Xh2o, Xo2as, Xso2); + rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, 0, Xh2o, Xo2as, 0); annotation (Diagram(graphics={ Ellipse( diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo new file mode 100644 index 00000000..3bd41c98 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo @@ -0,0 +1,56 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestAirHumidity + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity( + redeclare package Medium = Medium, + hum0=0.9, + T0=293, + ppvap0(start=2085), + rho_air(start=1.14), + rho_vap(start=0.015)) annotation (Placement(transformation(extent={{-10,0},{10,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=1.e-5, + rho(start=1.17)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium, + T0=293, + h0=53484, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.0132625 - 0.217282,0.217282,0.0132625,0,0}, + P0=100000, + T0=293) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + +equation + connect(airHumidity.C2, singularPressureLoss.C1) annotation (Line(points={{10,10},{40,10}}, color={0,0,0})); + connect(singularPressureLoss.C2, sinkFlueGases.C) annotation (Line(points={{60,10},{80,10}}, color={0,0,0})); + connect(sourceFlueGasesPQ.C, airHumidity.C1) annotation (Line(points={{-60,10},{-10,10}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestAirHumidity; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo new file mode 100644 index 00000000..6f7a9783 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo @@ -0,0 +1,59 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestAirHumidity_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity( + redeclare package Medium = Medium, + hum0=0.9, + T0=293, + ppvap0(start=2085), + rho_air(start=1.14), + rho_vap(start=0.015)) annotation (Placement(transformation(extent={{-10,0},{10,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=1.e-5, + rho(start=1.17)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium, + T0=293, + h0=53484, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.0132625 - 0.217282,0.217282,0.0132625,0,0}, + P0=100000, + T0=293) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + +equation + connect(airHumidity.C2, singularPressureLoss.C1) annotation (Line(points={{10,10},{40,10}}, color={0,0,0})); + connect(singularPressureLoss.C2, sinkFlueGases.C) annotation (Line(points={{60,10},{80,10}}, color={0,0,0})); + connect(sourceFlueGasesPQ.C, airHumidity.C1) annotation (Line(points={{-60,10},{-10,10}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestAirHumidity_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index 3e1250f4..d731fabb 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -7,3 +7,5 @@ TestRefP_Traces_FlueGases TestRefT TestRefSubC_Traces TestRefX_FlueGases +TestAirHumidity +TestAirHumidity_Traces diff --git a/ThermoSysPro/Properties/FlueGases/getSubstanceIndex.mo b/ThermoSysPro/Properties/FlueGases/getSubstanceIndex.mo new file mode 100644 index 00000000..15a53b20 --- /dev/null +++ b/ThermoSysPro/Properties/FlueGases/getSubstanceIndex.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Properties.FlueGases; +function getSubstanceIndex + input String substanceName; + input String substanceNames[:]; + output Integer index; +algorithm + index := 0; + for i in 1:size(substanceNames, 1) loop + if substanceNames[i] == substanceName then + index := i; + return; + end if; + end for; + assert(false, "Substance name " + substanceName + " not found in the list."); + +end getSubstanceIndex; diff --git a/ThermoSysPro/Properties/FlueGases/package.order b/ThermoSysPro/Properties/FlueGases/package.order index 13a21699..3e99d6f8 100644 --- a/ThermoSysPro/Properties/FlueGases/package.order +++ b/ThermoSysPro/Properties/FlueGases/package.order @@ -16,3 +16,4 @@ FlueGases_T FlueGases_Xtot unsafeForJacobian XSat +getSubstanceIndex From 0e3bfa660d4f39c72ccdcf0a659fc93c692218a7 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 21:51:54 +0200 Subject: [PATCH 155/213] #125 Fan without example --- .../SimpleExamples/Machines/TestStaticFan.mo | 186 ++++++++++++++++++ .../SimpleExamples/Machines/package.order | 1 + ThermoSysPro/Fluid/Machines/StaticFan.mo | 28 +-- 3 files changed, 197 insertions(+), 18 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo new file mode 100644 index 00000000..68f1d3b1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo @@ -0,0 +1,186 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticFan + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees( + redeclare package Medium = Medium, + Xso2=0, + Xco2=0.0, + Xh2o=0.006, + Xo2=0.23, + Q0=4, + ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, + P0=130000, + T0=300, + option_temperature=true) annotation (Placement(transformation(extent={{-210,-24},{-164,24}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees(redeclare package Medium = Medium) annotation (Placement(transformation( + origin={182,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); + ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + redeclare package Medium = Medium, + option_temperature=2, + W0={1e4}) annotation (Placement(transformation(extent={{-48,90},{-28,110}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases( + redeclare package Medium = Medium, + Q(fixed=false, start=10), + K=10) annotation (Placement(transformation(extent={{12,50},{32,70}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases1( + redeclare package Medium = Medium, + Q(fixed=false, start=11), + K=0.01) annotation (Placement(transformation(extent={{-108,50},{-88,70}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe( + Starttime=50, + Duration=50, + Initialvalue=1e4, + Finalvalue=2e5) annotation (Placement(transformation(extent={{0,100},{-20,120}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticFan staticFan( + redeclare package Medium = Medium, + VRotn=2700, + rm=1, + a2=0, + b1=-1.315, + b2=2.4593, + VRot=2700, + a1=-263.145, + a3=500, + Q(start=2), + Qv(start=1.4), + rho(start=1.4)) annotation (Placement(transformation(extent={{52,50},{72,70}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.CheckValve singularPressureLossFlueGases2(redeclare package Medium = Medium,Q(fixed=false, start=10)) annotation (Placement(transformation(extent={{92,50},{112,70}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature=2, W0={1e4}) annotation (Placement(transformation(extent={{-48,-90},{-28,-110}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases3(redeclare package Medium = Medium,Q(fixed=false, start=10), K=10) annotation (Placement(transformation(extent={{12,-70},{32,-50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases4(redeclare package Medium = Medium,Q(fixed=false, start=11), K=0.01) annotation (Placement(transformation(extent={{-108,-70},{-88,-50}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1( + Starttime=50, + Duration=50, + Initialvalue=1e4, + Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,-100}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticFan staticFan1( + redeclare package Medium = Medium, + VRotn=2700, + rm=1, + b2=2.4593, + b1=-1.315, + VRot=2700, + a1=-263.145, + a2=0, + a3=500, + Q(start=2), + Qv(start=1.4), + rho(start=1.4)) annotation (Placement(transformation(extent={{52,-70},{72,-50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.CheckValve singularPressureLossFlueGases5(redeclare package Medium = Medium,Q(fixed=false, start=10)) annotation (Placement(transformation(extent={{92,-70},{112,-50}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixerFlueGases2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volume2S(redeclare package Medium = Medium,dynamic_composition_balance=true) annotation (Placement(transformation(extent={{-148,-10},{-128,10}}, rotation=0))); + ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0))); + ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin( + Starttime=50, + Duration=50, + Initialvalue=4, + Finalvalue=1) annotation (Placement(transformation(extent={{-200,40},{-180,60}}, rotation=0))); +equation + connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line( + points={{32,60},{52,60}}, + color={0,0,0}, + thickness=1)); + connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line( + points={{72,60},{91,60}}, + color={0,0,0}, + thickness=1)); + connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line( + points={{32,-60},{52,-60}}, + color={0,0,0}, + thickness=1)); + connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line( + points={{72,-60},{91,-60}}, + color={0,0,0}, + thickness=1)); + connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line( + points={{113,60},{138,60},{138,10}}, + color={0,0,0}, + thickness=1)); + connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line( + points={{113,-60},{138,-60},{138,-10}}, + color={0,0,0}, + thickness=1)); + connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line( + points={{-7.8,-60},{12,-60}}, + color={0,0,0}, + thickness=1)); + connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line( + points={{-7.8,60},{12,60}}, + color={0,0,0}, + thickness=1)); + connect(Source_Fumees.C, volume2S.Ce) annotation (Line( + points={{-164,0},{-148,0}}, + color={0,0,0}, + thickness=1)); + connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line( + points={{-138,10},{-138,60},{-108,60}}, + color={0,0,0}, + thickness=1)); + connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line( + points={{-138,-10},{-138,-60},{-108,-60}}, + color={0,0,0}, + thickness=1)); + connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,90.2},{-58,60}}, color={191,95,0})); + connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{-38,-90.2},{-58,-60}}, color={191,95,0})); + connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line( + points={{152,0},{162,0},{162,-1.20011e-015},{172,-1.20011e-015}}, + color={0,0,0}, + thickness=1)); + connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (Line( + points={{-88,60},{-68,60}}, + color={0,0,0}, + thickness=1, + smooth=Smooth.None)); + connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line( + points={{-48,60},{-28,60}}, + color={0,0,0}, + thickness=1, + smooth=Smooth.None)); + connect(Qin.y, Source_Fumees.IMassFlow) annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}})); + connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (Line( + points={{-88,-60},{-68,-60}}, + color={0,0,0}, + thickness=1)); + connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation (Line( + points={{-48,-60},{-38,-60},{-28,-60}}, + color={0,0,0}, + thickness=1)); + connect(rampe.y, heatSource.ISignal) annotation (Line(points={{-21,110},{-38,110},{-38,105}}, color={0,0,255})); + connect(rampe1.y, heatSource1.ISignal) annotation (Line(points={{-21,-110},{-38,-110},{-38,-105}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-200,-150},{200,150}}, + initialScale=0.1)), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestStaticFan; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 22dae67a..1ecdd94e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -10,3 +10,4 @@ TestCombustionTurbine TestCombustionTurbine_Traces TestCompressor TestCompressor_Traces +TestStaticFan diff --git a/ThermoSysPro/Fluid/Machines/StaticFan.mo b/ThermoSysPro/Fluid/Machines/StaticFan.mo index 066b16b6..65871d0e 100644 --- a/ThermoSysPro/Fluid/Machines/StaticFan.mo +++ b/ThermoSysPro/Fluid/Machines/StaticFan.mo @@ -1,6 +1,8 @@ within ThermoSysPro.Fluid.Machines; model StaticFan "Static fan" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400 "Rotational speed"; @@ -42,8 +44,6 @@ public Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure"; Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy"; Units.SI.Temperature T(start=500) "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; public ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan @@ -51,9 +51,9 @@ public origin={0,110}, extent={{-10,-10},{10,10}}, rotation=270))); - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation annotation (Placement(transformation( @@ -61,8 +61,6 @@ public extent={{-10,-10},{10,10}}, rotation=90))); equation - /* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "StaticFan: the fluid type must be flue gases"); if (cardinality(commandeFan) == 0) then commandeFan.signal = true; @@ -83,14 +81,9 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; - ftype = C1.ftype; + C1.Xi = C2.Xi; Q = C1.Q; Q = Qv*rho; @@ -124,12 +117,12 @@ equation h = (C2.h + C1.h)/2; // Temperature - h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2); + h = Medium.specificEnthalpy_pTX(P, T, C2.Xi); if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2); + rho = Medium.density_pTX(P, T, C2.Xi); end if; annotation ( Diagram(coordinateSystem( @@ -177,6 +170,5 @@ equation
  • Daniel Bouskela
  • Baligh El Hefni
  • -"), - DymolaStoredErrors); +")); end StaticFan; From 28424fe595a26208bbf82b8bd9f485ebeac87557 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 22:02:35 +0200 Subject: [PATCH 156/213] #125 example for StaticFan but no init, need to try implicit declaration for the problematic variable --- .../Examples/SimpleExamples/Machines/TestStaticFan.mo | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo index 68f1d3b1..724f4f1b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo @@ -5,12 +5,8 @@ model TestStaticFan replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees( redeclare package Medium = Medium, - Xso2=0, - Xco2=0.0, - Xh2o=0.006, - Xo2=0.23, + X0={1-0.006-0.23,0.23,0.006,0,0}, Q0=4, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0=130000, T0=300, option_temperature=true) annotation (Placement(transformation(extent={{-210,-24},{-164,24}}, rotation=0))); @@ -21,7 +17,6 @@ model TestStaticFan rotation=180))); ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - redeclare package Medium = Medium, option_temperature=2, W0={1e4}) annotation (Placement(transformation(extent={{-48,90},{-28,110}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases( From 66cb4692ebe37478cc7e753ea6b3d4405af524ca Mon Sep 17 00:00:00 2001 From: VESCOVI Guilherme Date: Mon, 16 Jun 2025 17:50:22 +0200 Subject: [PATCH 157/213] 125-LumpedStraightPipe --- ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index 3bb6f579..25cb7a21 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -114,6 +114,8 @@ equation state=Medium.setState_phX(p=Pm, h=h, X=X); + state=Medium.setState_phX(p=Pm, h=h, X=X, region=mode); + if (p_rho > 0) then rho = p_rho; else From 5debdb06a5646ac16c698b22b16d558514029feb Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 4 Jul 2025 15:27:10 +0200 Subject: [PATCH 158/213] 125 LumpedStraightPipe for FlueGases --- ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index 25cb7a21..c03f52e9 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -114,7 +114,7 @@ equation state=Medium.setState_phX(p=Pm, h=h, X=X); - state=Medium.setState_phX(p=Pm, h=h, X=X, region=mode); + state=Medium.setState_phX(p=Pm, h=h, X=X); if (p_rho > 0) then rho = p_rho; From a3cf6be50ac0e275ef66cc0e3342c9613238524b Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 19:33:26 +0200 Subject: [PATCH 159/213] #125 Easier Fan example --- .../SimpleExamples/Machines/TestStaticFan.mo | 178 ++---------------- .../Machines/TestStaticFan_Traces.mo | 46 +++++ .../SimpleExamples/Machines/package.order | 1 + 3 files changed, 66 insertions(+), 159 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo index 724f4f1b..d1bc4845 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo @@ -3,37 +3,9 @@ model TestStaticFan extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees( - redeclare package Medium = Medium, - X0={1-0.006-0.23,0.23,0.006,0,0}, - Q0=4, - P0=130000, - T0=300, - option_temperature=true) annotation (Placement(transformation(extent={{-210,-24},{-164,24}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees(redeclare package Medium = Medium) annotation (Placement(transformation( - origin={182,0}, - extent={{10,-10},{-10,10}}, - rotation=180))); - ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-68,50},{-48,70}}, rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( - option_temperature=2, - W0={1e4}) annotation (Placement(transformation(extent={{-48,90},{-28,110}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases( + ThermoSysPro.Fluid.Machines.StaticFan Compressor( redeclare package Medium = Medium, - Q(fixed=false, start=10), - K=10) annotation (Placement(transformation(extent={{12,50},{32,70}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases1( - redeclare package Medium = Medium, - Q(fixed=false, start=11), - K=0.01) annotation (Placement(transformation(extent={{-108,50},{-88,70}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe( - Starttime=50, - Duration=50, - Initialvalue=1e4, - Finalvalue=2e5) annotation (Placement(transformation(extent={{0,100},{-20,120}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticFan staticFan( - redeclare package Medium = Medium, VRotn=2700, rm=1, a2=0, @@ -44,137 +16,25 @@ model TestStaticFan a3=500, Q(start=2), Qv(start=1.4), - rho(start=1.4)) annotation (Placement(transformation(extent={{52,50},{72,70}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve singularPressureLossFlueGases2(redeclare package Medium = Medium,Q(fixed=false, start=10)) annotation (Placement(transformation(extent={{92,50},{112,70}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-68,-70},{-48,-50}}, rotation=0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature=2, W0={1e4}) annotation (Placement(transformation(extent={{-48,-90},{-28,-110}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases3(redeclare package Medium = Medium,Q(fixed=false, start=10), K=10) annotation (Placement(transformation(extent={{12,-70},{32,-50}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases4(redeclare package Medium = Medium,Q(fixed=false, start=11), K=0.01) annotation (Placement(transformation(extent={{-108,-70},{-88,-50}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1( - Starttime=50, - Duration=50, - Initialvalue=1e4, - Finalvalue=2e5) annotation (Placement(transformation(extent={{0,-120},{-20,-100}}, rotation=0))); - ThermoSysPro.Fluid.Machines.StaticFan staticFan1( - redeclare package Medium = Medium, - VRotn=2700, - rm=1, - b2=2.4593, - b1=-1.315, - VRot=2700, - a1=-263.145, - a2=0, - a3=500, - Q(start=2), - Qv(start=1.4), - rho(start=1.4)) annotation (Placement(transformation(extent={{52,-70},{72,-50}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve singularPressureLossFlueGases5(redeclare package Medium = Medium,Q(fixed=false, start=10)) annotation (Placement(transformation(extent={{92,-70},{112,-50}}, rotation=0))); - ThermoSysPro.Fluid.Junctions.Mixer2 mixerFlueGases2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{132,-10},{152,10}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeDTh volume2S(redeclare package Medium = Medium,dynamic_composition_balance=true) annotation (Placement(transformation(extent={{-148,-10},{-128,10}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-28,58},{-8,78}}, rotation=0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-28,-62},{-8,-42}}, rotation=0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin( - Starttime=50, - Duration=50, - Initialvalue=4, - Finalvalue=1) annotation (Placement(transformation(extent={{-200,40},{-180,60}}, rotation=0))); + rho(start=1.4)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + X0={1-0.006-0.23,0.23,0.006,0,0}, + Q0=4, + P0=130000, + T0=300, + option_temperature=true) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink SinkP1(redeclare package Medium = Medium, + T0=300, + option_temperature=true) annotation (Placement(transformation( + origin={50,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); equation - connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation (Line( - points={{32,60},{52,60}}, - color={0,0,0}, - thickness=1)); - connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation (Line( - points={{72,60},{91,60}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation (Line( - points={{32,-60},{52,-60}}, - color={0,0,0}, - thickness=1)); - connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation (Line( - points={{72,-60},{91,-60}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation (Line( - points={{113,60},{138,60},{138,10}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation (Line( - points={{113,-60},{138,-60},{138,-10}}, - color={0,0,0}, - thickness=1)); - connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation (Line( - points={{-7.8,-60},{12,-60}}, - color={0,0,0}, - thickness=1)); - connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation (Line( - points={{-7.8,60},{12,60}}, - color={0,0,0}, - thickness=1)); - connect(Source_Fumees.C, volume2S.Ce) annotation (Line( - points={{-164,0},{-148,0}}, - color={0,0,0}, - thickness=1)); - connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation (Line( - points={{-138,10},{-138,60},{-108,60}}, - color={0,0,0}, - thickness=1)); - connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation (Line( - points={{-138,-10},{-138,-60},{-108,-60}}, - color={0,0,0}, - thickness=1)); - connect(heatSource.C[1], dynamicExchanger.Cth) annotation (Line(points={{-38,90.2},{-58,60}}, color={191,95,0})); - connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation (Line(points={{-38,-90.2},{-58,-60}}, color={191,95,0})); - connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation (Line( - points={{152,0},{162,0},{162,-1.20011e-015},{172,-1.20011e-015}}, - color={0,0,0}, - thickness=1)); - connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation (Line( - points={{-88,60},{-68,60}}, - color={0,0,0}, - thickness=1, - smooth=Smooth.None)); - connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation (Line( - points={{-48,60},{-28,60}}, - color={0,0,0}, - thickness=1, - smooth=Smooth.None)); - connect(Qin.y, Source_Fumees.IMassFlow) annotation (Line(points={{-179,50},{-170,50},{-170,28},{-187,28},{-187,12}})); - connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation (Line( - points={{-88,-60},{-68,-60}}, - color={0,0,0}, - thickness=1)); - connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation (Line( - points={{-48,-60},{-38,-60},{-28,-60}}, - color={0,0,0}, - thickness=1)); - connect(rampe.y, heatSource.ISignal) annotation (Line(points={{-21,110},{-38,110},{-38,105}}, color={0,0,255})); - connect(rampe1.y, heatSource1.ISignal) annotation (Line(points={{-21,-110},{-38,-110},{-38,-105}}, color={0,0,255})); - annotation ( - experiment(StopTime=1000), - Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-200,-150},{200,150}}, - initialScale=0.1)), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), - Documentation(info=" + connect(Compressor.C2, SinkP1.C) annotation (Line(points={{10,0},{40,0}}, color={0,0,0})); + connect(Compressor.C1, SourceQ1.C) annotation (Line(points={{-10,0},{-40,0}}, color={0,0,0})); + annotation ( Documentation(info="

    Copyright © EDF 2002 - 2021

    ThermoSysPro Version 4.0

    ")); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo new file mode 100644 index 00000000..acf05608 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticFan_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.Machines.StaticFan Compressor( + redeclare package Medium = Medium, + VRotn=2700, + rm=1, + a2=0, + b1=-1.315, + b2=2.4593, + VRot=2700, + a1=-263.145, + a3=500, + Q(start=2), + Qv(start=1.4), + rho(start=1.4)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + SubC0={0.5}, + X0={1 - 0.006 - 0.23,0.23,0.006,0,0}, + Q0=4, + P0=130000, + T0=300, + option_temperature=true) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink SinkP1( + redeclare package Medium = Medium, + T0=300, + option_temperature=true) annotation (Placement(transformation( + origin={50,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(Compressor.C2, SinkP1.C) annotation (Line(points={{10,0},{40,0}}, color={0,0,0})); + connect(Compressor.C1, SourceQ1.C) annotation (Line(points={{-10,0},{-40,0}}, color={0,0,0})); + annotation (Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestStaticFan_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 1ecdd94e..cff52f3b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -11,3 +11,4 @@ TestCombustionTurbine_Traces TestCompressor TestCompressor_Traces TestStaticFan +TestStaticFan_Traces From 80101581830e0deefeaa1480b0d14bccee4ecb99 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 19:53:05 +0200 Subject: [PATCH 160/213] #125 SteamEngine --- .../Machines/TestSteamEngine.mo | 49 +++++++++++++++ .../Machines/TestSteamEngine_Traces.mo | 52 ++++++++++++++++ .../SimpleExamples/Machines/package.order | 2 + ThermoSysPro/Fluid/Machines/SteamEngine.mo | 59 ++++++++----------- 4 files changed, 127 insertions(+), 35 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo new file mode 100644 index 00000000..aeb4b91b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo @@ -0,0 +1,49 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestSteamEngine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(redeclare package Medium = Medium, P0=100000) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + h0=3.e6, + option_temperature=false, + P0=1600000) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); +equation + connect(sourceP.C, steamEngine1.C1) annotation (Line(points={{-30,0},{-7,0}}, color={0,0,255})); + connect(steamEngine1.C2, puitsP.C) annotation (Line(points={{7,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Window( + x=0.32, + y=0.02, + width=0.39, + height=0.47), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo new file mode 100644 index 00000000..647c4ef3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo @@ -0,0 +1,52 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestSteamEngine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(redeclare package Medium = Medium, P0=100000) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + h0=3.e6, + option_temperature=false, + P0=1600000) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); +equation + connect(sourceP.C, steamEngine1.C1) annotation (Line(points={{-30,0},{-7,0}}, color={0,0,255})); + connect(steamEngine1.C2, puitsP.C) annotation (Line(points={{7,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Window( + x=0.32, + y=0.02, + width=0.39, + height=0.47), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamEngine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index cff52f3b..91f27a61 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -12,3 +12,5 @@ TestCompressor TestCompressor_Traces TestStaticFan TestStaticFan_Traces +TestSteamEngine +TestSteamEngine_Traces diff --git a/ThermoSysPro/Fluid/Machines/SteamEngine.mo b/ThermoSysPro/Fluid/Machines/SteamEngine.mo index ca363d38..0c94597b 100644 --- a/ThermoSysPro/Fluid/Machines/SteamEngine.mo +++ b/ThermoSysPro/Fluid/Machines/SteamEngine.mo @@ -1,5 +1,8 @@ within ThermoSysPro.Fluid.Machines; model SteamEngine "Steam engine" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; @@ -10,13 +13,14 @@ model SteamEngine "Steam engine" parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation"; parameter Units.SI.MassFlowRate gamma_diff=1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_e=IF97Region.All_regions "Inlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); - parameter IF97Region region_s=IF97Region.All_regions "Outlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter IF97Region region_e=IF97Region.All_regions "Inlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region_s=IF97Region.All_regions "Outlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_e=Integer(region_e) - 1 "Inlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_s=Integer(region_s) - 1 "Outlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + + Integer phase_e=if Integer(region_e) == 0 then 0 else if Integer(region_e)==4 then 2 else 1; + Integer phase_s=if Integer(region_s) == 0 then 0 else if Integer(region_s)==4 then 2 else 1; public Units.SI.Power W "Power produced by the engine"; @@ -29,26 +33,17 @@ public Units.SI.Temperature Te "Temperature at the inlet"; Units.SI.Temperature Ts "Temperature at the outlet"; Real xm(start=1.0,min=0) "Average vapor mass fraction (n.u.)"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; + + + Medium.ThermodynamicState state_e; + Medium.ThermodynamicState state_s; + Medium.ThermodynamicState state_ps; public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - annotation (Placement(transformation(extent={{-80,80},{-60,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros - annotation (Placement(transformation(extent={{60,80},{80,100}}, rotation=0))); - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( - extent={{-80,-10},{-60,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( - extent={{60,-10},{80,10}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props - annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); equation - /* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "SteamEngine: the fluid type must be water/steam"); - C1.Q = C2.Q; C1.h_vol_1 = C2.h_vol_1; @@ -60,22 +55,16 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; + C1.Xi = C2.Xi; Q = C1.Q; Pe = C1.P; Ps = C2.P; deltaP = Pe - Ps; - ftype = C1.ftype; - /* Average vapor mass fraction during the expansion */ - xm = (proe.x + pros.x)/2.0; + xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s)) /2.0; /* Mass flow */ if (option_interpolation == 1) then @@ -93,16 +82,16 @@ equation W = Q*eta_stato*(C1.h - C2.h)*(1 - W_frot/100); /* Fluid thermodynamic properties before the expansion */ - proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, mode_e,fluid); - Te = proe.T; + state_e = Medium.setState_ph(Pe,C1.h, phase=phase_e); + Te=Medium.temperature(state_e); /* Fluid thermodynamic properties after the expansion */ - pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, mode_s,fluid); - Ts = pros.T; + state_s = Medium.setState_ph(Ps, C2.h, phase=phase_s); + Ts=Medium.temperature(state_s); /* Fluid thermodynamic properties after the isentropic expansion */ - props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_s,fluid); - His = props.h; + state_ps = Medium.setState_ps(Ps, Medium.specificEntropy(state_e), phase=phase_s); + His=Medium.specificEnthalpy(state_ps); annotation ( Diagram(coordinateSystem( From 495dad4c32b76c309f1872e474c6d9a7d6c6e22c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Sun, 6 Jul 2025 20:15:45 +0200 Subject: [PATCH 161/213] 125 SteamExtractionSplitter and small fixes on SteamEngines examples --- .../Junctions/TestSteamExtractionSplitter.mo | 27 ++++++ .../TestSteamExtractionSplitter_Traces.mo | 27 ++++++ .../SimpleExamples/Junctions/package.order | 2 + .../Machines/TestSteamEngine.mo | 18 ---- .../Machines/TestSteamEngine_Traces.mo | 21 +---- .../Junctions/SteamExtractionSplitter.mo | 88 +++++++------------ ThermoSysPro/Fluid/Machines/SteamEngine.mo | 1 - 7 files changed, 91 insertions(+), 93 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo new file mode 100644 index 00000000..bb39c918 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSteamExtractionSplitter + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2600000) annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium, K=2.e-3) annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0))); +equation + connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255})); + connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(points={{-40,30},{-20.3,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(points={{0.3,30},{20,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{40,30},{60,30}}, color={0,0,255})); + connect(singularPressureLoss3.C2, sink.C) annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamExtractionSplitter; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo new file mode 100644 index 00000000..83e5941e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSteamExtractionSplitter_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamExtractionSplitter.xe)) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2600000) annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium, K=2.e-3) annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0))); +equation + connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255})); + connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(points={{-40,30},{-20.3,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(points={{0.3,30},{20,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{40,30},{60,30}}, color={0,0,255})); + connect(singularPressureLoss3.C2, sink.C) annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamExtractionSplitter_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index 712a41f9..f44cdf65 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -24,3 +24,5 @@ TestStaticDrum TestStaticDrum_Traces TestStaticDrum_Plug TestStaticDrum_Plug_Traces +TestSteamExtractionSplitter +TestSteamExtractionSplitter_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo index aeb4b91b..6fd8484e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo @@ -24,24 +24,6 @@ equation preserveAspectRatio=false, extent={{-100,-100},{100,100}}, grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), Documentation(info="

    Copyright © EDF 2002 - 2024

    ThermoSysPro Version 4.1 diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo index 647c4ef3..20f0d47c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo @@ -12,7 +12,8 @@ model TestSteamEngine_Traces redeclare package Medium = Medium, h0=3.e6, option_temperature=false, - P0=1600000) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + P0=1600000, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); equation connect(sourceP.C, steamEngine1.C1) annotation (Line(points={{-30,0},{-7,0}}, color={0,0,255})); connect(steamEngine1.C2, puitsP.C) annotation (Line(points={{7,0},{30,0}}, color={0,0,255})); @@ -27,24 +28,6 @@ equation preserveAspectRatio=false, extent={{-100,-100},{100,100}}, grid={2,2}), graphics), - Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Polygon( - origin={8.0,14.0}, - lineColor={78,138,73}, - fillColor={78,138,73}, - pattern=LinePattern.None, - fillPattern=FillPattern.Solid, - points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), Documentation(info="

    Copyright © EDF 2002 - 2024

    ThermoSysPro Version 4.1 diff --git a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo index 7b449566..8d732139 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo @@ -1,9 +1,10 @@ within ThermoSysPro.Fluid.Junctions; model SteamExtractionSplitter "Splitter for steam extraction" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter Real alpha = 1 @@ -12,23 +13,21 @@ model SteamExtractionSplitter "Splitter for steam extraction" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); + parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer fluid=Integer(ftype) "Fluid number"; + Medium.C_BiPhase C_record; public Real x_ex(start=0.99) "Vapor mass fraction at the extraction outlet"; Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Real xe(start=1.0) "Vapor mass fraction at the inlet"; + Medium.ExtraProperty X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js "Thermal power diffusion from outlet s"; Units.SI.Power Jex "Thermal power diffusion from outlet ex"; @@ -40,32 +39,15 @@ public Real rs "Value of r(Q/gamma) for outlet s"; Real rex "Value of r(Q/gamma) for outlet ex"; -public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation (Placement( - transformation(extent={{-113,-10},{-93,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation (Placement( - transformation(extent={{93,-10},{113,10}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat - annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction outlet" - annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation= - 0))); -equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs.ftype; - fluids[4] = Cex.ftype; + Medium.SaturationProperties sat; + Medium.ThermodynamicState state_e; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "SteamExtractionSplitter: fluids mixing in volume are not compatible with each other"); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-113,-10},{-93,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{93,-10},{113,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction outlet" annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0))); +equation /* Mass balance equation */ 0 = Ce.Q - Cs.Q - Cex.Q; @@ -78,26 +60,21 @@ equation Ce.h_vol_2 = h; Cs.h_vol_1 = h; - Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*lsat.h + x_ex*vsat.h else h; + Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*Medium.bubbleEnthalpy(sat)+ x_ex*Medium.dewEnthalpy(sat) else h; - /* Fluid composition */ - 0 = Ce.Xco2*Ce.Q - Cs.Xco2*Cs.Q - Cex.Xco2*Cex.Q; - 0 = Ce.Xh2o*Ce.Q - Cs.Xh2o*Cs.Q - Cex.Xh2o*Cex.Q; - 0 = Ce.Xo2*Ce.Q - Cs.Xo2*Cs.Q - Cex.Xo2*Cex.Q; - 0 = Ce.Xso2*Ce.Q - Cs.Xso2*Cs.Q - Cex.Xso2*Cex.Q; + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + Cs.SubC = C_record.Cg; - Cs.ftype = ftype; - Cex.ftype = ftype; + Cs.Q*Cs.SubC + Cex.Q*Cex.SubC = Ce.Q*Ce.SubC + SubCSaS * Ce.Q; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; + SubCSaS = SaS(); - Cex.Xco2 = Xco2; - Cex.Xh2o = Xh2o; - Cex.Xo2 = Xo2; - Cex.Xso2 = Xso2; + /* Fluid composition */ + Ce.Xi*Ce.Q = Cs.Xi*Cs.Q + Cex.Xi*Cex.Q; + + Cs.Xi = X; + Cex.Xi = X; /* Flow reversal */ if continuous_flow_reversal then @@ -146,13 +123,14 @@ equation Cex.diff_on_1 = diffusion; /* Fluid thermodynamic properties at the inlet */ - proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, mode_e,fluid); - - /* Fluid thermodynamic properties at the saturation point */ - (lsat,vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P,fluid); + state_e=Medium.setState_phX(p=P, h=Ce.h, X=Ce.Xi, region=mode_e); + xe = Medium.vapourQuality(state_e); /* Vapor mass fraction at the extraction outlet */ - x_ex = alpha*proe.x; + x_ex = alpha*xe; + + /* Fluid thermodynamic properties at the saturation point */ + sat = Medium.setSat_p(P); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/Machines/SteamEngine.mo b/ThermoSysPro/Fluid/Machines/SteamEngine.mo index 0c94597b..ce1d094d 100644 --- a/ThermoSysPro/Fluid/Machines/SteamEngine.mo +++ b/ThermoSysPro/Fluid/Machines/SteamEngine.mo @@ -3,7 +3,6 @@ model SteamEngine "Steam engine" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter Real caract[:, 2]=[0, 0; 15e5, 20.0] "Engine charateristics Q=f(deltaP)"; From f9dbeed41b40d738fd79da5f74dd46c4edbe8e64 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 09:18:08 +0200 Subject: [PATCH 162/213] #125 LumpedStraightPipe fixed after rebase --- ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index c03f52e9..54439c4d 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -112,10 +112,6 @@ equation Pm = (C1.P + C2.P)/2; state = Medium.setState_phX(p=Pm, h=h, X=X); - state=Medium.setState_phX(p=Pm, h=h, X=X); - - state=Medium.setState_phX(p=Pm, h=h, X=X); - if (p_rho > 0) then rho = p_rho; else From 11b37781445988a3ff13a2a1154743f2d61c90d4 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 10:06:24 +0200 Subject: [PATCH 163/213] #125 Boilers subpackage --- ThermoSysPro/Fluid/Boilers/BoilerSystem.mo | 18 +-- .../Fluid/Boilers/FossilFuelBoiler.mo | 109 +++++++++--------- .../Boilers/TestBoilerSystem.mo | 60 ++++++++++ .../Boilers/TestFossilFuelBoiler.mo | 77 +++++++++++++ .../SimpleExamples/Boilers/package.order | 2 + 5 files changed, 205 insertions(+), 61 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo diff --git a/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo b/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo index 713891a7..6d76624d 100644 --- a/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo +++ b/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.Boilers; model BoilerSystem "Boiler" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Temperature Tsf=423.16 "Flue gases temperature at the outlet"; @@ -19,7 +18,6 @@ model BoilerSystem "Boiler" "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ Fuel( Xashes=0.011, @@ -36,6 +34,8 @@ model BoilerSystem "Boiler" annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation= 0))); ThermoSysPro.Fluid.Boilers.FossilFuelBoiler Boiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, Qsf(start=45.8744, fixed=false), Pee(fixed=false), Qe(fixed=false, start=6), @@ -59,15 +59,15 @@ model BoilerSystem "Boiler" origin={-10,0}, extent={{20,-20},{-20,20}}, rotation=270))); - Interfaces.Connectors.FluidInlet InletWaterSteam "Water inlet" annotation ( + Interfaces.Connectors.FluidInlet InletWaterSteam(redeclare package Medium = Medium) "Water inlet" annotation ( Placement(transformation(extent={{40,-110},{60,-90}}, rotation=0))); - Interfaces.Connectors.FluidOutlet OutletWaterSteam "Water/steam outlet" + Interfaces.Connectors.FluidOutlet OutletWaterSteam(redeclare package Medium = Medium) "Water/steam outlet" annotation (Placement(transformation(extent={{40,90},{60,110}}, rotation=0))); - Interfaces.Connectors.FluidOutlet OutletFlueGases "Flue gases outlet" + Interfaces.Connectors.FluidOutlet OutletFlueGases(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation (Placement( transformation(extent={{-80,90},{-60,110}}, rotation=0), iconTransformation(extent={{-80,90},{-60,110}}))); - Interfaces.Connectors.FluidInlet InletFlueGases "Flue gases inlet" + Interfaces.Connectors.FluidInlet InletFlueGases(redeclare package Medium = Medium_FlueGases) "Flue gases inlet" annotation (Placement( transformation(extent={{-80,-110},{-60,-90}}, rotation=0))); equation diff --git a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo index 7642f228..17959c3d 100644 --- a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo +++ b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.Boilers; model FossilFuelBoiler "Fossil fuel boiler" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Temperature Tsf=400 "Flue gases temperature at the outlet"; parameter Integer Boiler_efficiency_type = 1 "1: Taking into account LHV only - 2: Using the total incoming power"; @@ -18,7 +17,6 @@ model FossilFuelBoiler "Fossil fuel boiler" "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real amC=12.01115 "Carbon atomic mass"; @@ -29,7 +27,11 @@ protected constant Real amH2O = 2*amH + amO "H2O molecular mass"; constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; constant Real teps=1e-6 "Small number"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Real eps=1.e-0 "Small number for pressure loss equation"; @@ -98,7 +100,6 @@ public Real exc(start=1) "Air combustion ratio"; Real exc_air(start=0.1) "Pertcentage of air in excess"; - FluidType fluids[2] "Fluids mixing in volume"; Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy"; Units.SI.Power Jair "Thermal power diffusion from inlet Cair"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -107,44 +108,43 @@ public Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg"; Real rair "Value of r(Q/gamma) for inlet Cair"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium.ThermodynamicState state_ws_m "Water/steam average thermodynamic state"; + Medium.ThermodynamicState state_ws_out "Water/steam outlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_comb "Flue gases thermodynamic state after combustion"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_m "Flue gases average thermodynamic state"; public Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation (Placement(transformation(extent={{-10,-90},{10,-70}}, rotation= 0))); - Interfaces.Connectors.FluidInlet Cair "Air inlet" + Interfaces.Connectors.FluidInlet Cair(redeclare package Medium = Medium_FlueGases) "Air inlet" annotation (Placement(transformation( extent={{-110,-72},{-90,-52}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" + Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation (Placement(transformation( extent={{90,-72},{110,-52}}, rotation=0))); public - Interfaces.Connectors.FluidInlet Cws1 "Water inlet" + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) "Water inlet" annotation (Placement(transformation( extent={{-110,50},{-90,70}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Cws2 "Water/steam outlet" + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) "Water/steam outlet" annotation (Placement(transformation( extent={{90,50},{110,70}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros - annotation (Placement(transformation(extent={{-100,84},{-80,104}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom - annotation (Placement(transformation(extent={{80,84},{100,104}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cair.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other"); + assert(Medium_FlueGases.nX > 1, "FossilFuelBoiler: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "FossilFuelBoiler: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); // ---------------- // Water/steam side - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam"); - Cws1.Q = Cws2.Q; Cws1.h_vol_1 = Cws2.h_vol_1; @@ -156,14 +156,10 @@ equation Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); - Cws1.ftype = Cws2.ftype; - - Cws1.Xco2 = Cws2.Xco2; - Cws1.Xh2o = Cws2.Xh2o; - Cws1.Xo2 = Cws2.Xo2; - Cws1.Xso2 = Cws2.Xso2; - - ftype_ws = Cws1.ftype; + Cws1.Xi = Cws2.Xi; + Xws = Cws1.Xi; + Cws1.SubC = Cws2.SubC; + SubCws = Cws1.SubC; Qe = Cws1.Q; @@ -191,10 +187,14 @@ equation Pea = Cair.P; Hea = Cair.h; - XeaCO2 = Cair.Xco2; - XeaH2O = Cair.Xh2o; - XeaO2 = Cair.Xo2; - XeaSO2 = Cair.Xso2; + Xea[1:Medium_FlueGases.nXi] = Cair.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Cair.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; /* Flue gases outlet */ Qsf = Cfg.Q; @@ -237,12 +237,14 @@ equation 0 = Qea*XeaO2c - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - Qsf*XsfO2; 0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - Qsf*XsfSO2; - Cfg.ftype = ftype; - - Cfg.Xco2 = XsfCO2; - Cfg.Xh2o = XsfH2O; - Cfg.Xo2 = XsfO2; - Cfg.Xso2 = XsfSO2; + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Qsf*Cfg.SubC = Qea*Cair.SubC; + SubCfg = Cfg.SubC; /* Combustion air ratio */ exc = Qea*(1 - XeaH2O) / ((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO)) / (XeaO2c/(1 - XeaH2O))); @@ -291,17 +293,20 @@ equation Cfg.diff_on_1 = diffusion; /* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2); + state_air_in = Medium_FlueGases.setState_phX(p=Pea, h=Hea, X=Xea); + Tea = Medium_FlueGases.temperature(state_air_in); /* Flue gases tempretaure after combustion */ - // Changed from FlueGases_T to FlueGases_h to provide a differentiable function - Hf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + Hf = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tf, X=Xsf); + state_fg_comb = Medium_FlueGases.setState_phX(p=Pea, h=Hf, X=Xsf); /* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_phX(p=Psf, h=Hsf, X=Xsf); /* Flue gases density */ - rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, (Tea + Tf)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2); + state_fg_m = Medium_FlueGases.setState_pTX(p=Pea, T=(Tea + Tf)/2, X=Xsf); + rhof = Medium_FlueGases.density(state_fg_m); 0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps); @@ -311,11 +316,11 @@ equation Hrfum = 2501.569e3*XsfH2O; /* Water/steam thermodynamic properties */ - prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode); - rhoe = prom.d; + state_ws_m = Medium.setState_phX(p=(Pee + Pse)/2, h=(Hee + Hse)/2, X=Xws); + rhoe = Medium.density(state_ws_m); - pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode); - Tse = pros.T; + state_ws_out = Medium.setState_phX(p=Pse, h=Hse, X=Xws); + Tse = Medium.temperature(state_ws_out); annotation ( Icon(graphics={ Rectangle( diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo new file mode 100644 index 00000000..bede404b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo @@ -0,0 +1,60 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Boilers; +model TestBoilerSystem + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.BoilerSystem boilerSystem( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Wloss=0, + Ke=1.e6, + Tsf=386.16) + annotation (Placement(transformation(extent={{-28,-40},{28,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=27, + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) + annotation (Placement(transformation(extent={{-84,-58},{-48,-22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) + annotation (Placement(transformation(extent={{-34,74},{2,110}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + P0=140e5, + Q0=24, + h0=600e3) + annotation (Placement(transformation(extent={{54,-80},{90,-44}}, rotation=180, + origin={132,-126}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWaterSteam(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{54,44},{90,80}}, rotation=180, + origin={90,148}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=932.96)) + annotation (Placement(transformation(extent={{34,-66},{42,-58}}, rotation=90, + origin={-38,-94}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=29.77)) + annotation (Placement(transformation(extent={{34,58},{42,66}}, rotation=90, + origin={112,14}))); +equation + connect(sourceFlueGases.C, boilerSystem.InletFlueGases) annotation (Line(points={{-48,-40},{-24,-40}}, color={0,0,0})); + connect(boilerSystem.OutletFlueGases, sinkFlueGases.C) annotation (Line(points={{-24,40},{-40,40},{-40,92},{-34,92}}, color={0,0,0})); + connect(sourceWaterSteam.C, inletPressureLoss.C1) annotation (Line(points={{42,-64},{24,-64},{24,-60}}, + color={0,0,255})); + connect(inletPressureLoss.C2, boilerSystem.InletWaterSteam) annotation (Line(points={{24,-52},{24,-40}}, color={0,0,255})); + connect(boilerSystem.OutletWaterSteam, outletPressureLoss.C1) annotation (Line(points={{24,40},{48,40},{48,44},{50,44},{50,48}}, + color={0,0,255})); + connect(outletPressureLoss.C2, sinkWaterSteam.C) annotation (Line(points={{50,56},{50,86},{36,86}}, + color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestBoilerSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo new file mode 100644 index 00000000..c9928e94 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo @@ -0,0 +1,77 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Boilers; +model TestFossilFuelBoiler + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.FossilFuelBoiler fossilFuelBoiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Wloss=0, + Ke=1.e6, + Tsf=386.16, + Tea(start=298.16), + Tf(start=2138.32), + deltaPe(start=4028755.6), + rhof(start=0.2733)) + annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( + Xashes=0.011, + rho=1000, + Hum=0.50, + Xc=0.2479, + Xh=0.0297, + Xo=0.2088, + Xn=0.0017, + Xs=0.0003, + LHV=1.5e7, + Q0=0.0407331, + T0=294.45) + annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=27, + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) + annotation (Placement(transformation(extent={{-110,-50},{-71,-13}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) + annotation (Placement(transformation(extent={{68,-51},{110,-12}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + P0=140e5, + Q0=24, + h0=600e3) + annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWaterSteam(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{74,13},{110,49}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=932.96)) + annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=29.77)) + annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0))); +equation + connect(sourceFlueGases.C, fossilFuelBoiler.Cair) annotation (Line( + points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}}, + color={0,0,0}, + thickness=1)); + connect(fossilFuelBoiler.Cfg, sinkFlueGases.C) annotation (Line( + points={{45,-31.62},{62,-31.62},{62,-31.5},{68,-31.5}}, + color={0,0,0}, + thickness=1)); + connect(fuelSourcePQ.C, fossilFuelBoiler.Cfuel) annotation (Line(points={{0,-59.5},{0,-40.8}}, color={0,0,0})); + connect(sourceWaterSteam.C, inletPressureLoss.C1) annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255})); + connect(inletPressureLoss.C2, fossilFuelBoiler.Cws1) annotation (Line(points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255})); + connect(fossilFuelBoiler.Cws2, outletPressureLoss.C1) annotation (Line(points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255})); + connect(outletPressureLoss.C2, sinkWaterSteam.C) annotation (Line(points={{65,31},{74,31}}, color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestFossilFuelBoiler; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order index e69de29b..5d6f590f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order @@ -0,0 +1,2 @@ +TestFossilFuelBoiler +TestBoilerSystem From 2040b69e3473287d7269adb43654f9e8f6bc332a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 13:15:56 +0200 Subject: [PATCH 164/213] #125 Combustion chambers with examples --- .../CombustionChambers/GTCombustionChamber.mo | 90 ++++++++------ .../CombustionChambers/GenericCombustion.mo | 81 ++++++------ .../CombustionChambers/GenericCombustion1D.mo | 81 ++++++------ .../CombustionChambers/GridFurnace.mo | 88 ++++++++------ .../CombustionChambers/PostCombustionGas.mo | 72 ++++++----- .../Combustion/TestGTCombustionChamber.mo | 49 ++++++++ .../Combustion/TestGenericCombustion.mo | 49 ++++++++ .../Combustion/TestGenericCombustion1D.mo | 27 ++++ .../TestGenericCombustion1DWithPipe.mo | 115 ++++++++++++++++++ .../Combustion/TestGridFurnace.mo | 73 +++++++++++ .../Combustion/TestPostCombustionGas.mo | 67 ++++++++++ .../SimpleExamples/Combustion/package.order | 6 + .../TestFixedPowerHeatExchanger.mo | 38 ++---- .../TestFixedPowerHeatExchanger_Traces.mo | 50 ++------ 14 files changed, 638 insertions(+), 248 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo index 62a05a60..7cca4a70 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; model GTCombustionChamber "Gas turbine combustion chamber" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real kcham=1 "Pressure loss coefficient in the combustion chamber"; parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber"; @@ -28,6 +27,11 @@ protected constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; constant Real amH2O = 2*amH + amO "H2O molecular mass"; constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; @@ -84,7 +88,6 @@ public Units.SI.Area Achamc(start=1) "Intermediate variable for the computation of the average corss-section aera of the combusion chamber"; Real XeaO2c(start=0.2) "Intermediate variable for the computation of the O2 mass fraction"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; - FluidType fluids[3] "Fluids mixing in volume"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jws "Thermal power diffusion from inlet Cws"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -95,30 +98,31 @@ public Real ra "Value of r(Q/gamma) for inlet Ca"; Real rws "Value of r(Q/gamma) for inlet Cws"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_atom_in "Atomisation compressor inlet state"; public ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "Water/steam inlet" annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation= 0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); + assert(Medium_FlueGases.nX > 1, "GTCombustionChamber: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GTCombustionChamber: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); /* Fuel inlet */ Qfuel = Cfuel.Q; @@ -131,36 +135,33 @@ equation Cpfuel = Cfuel.cp; /* Water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam"); - Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; - Qews = Cws.Q; Hews = Cws.h; + Xws = Cws.Xi; + SubCws = Cws.SubC; /* Air inlet */ Qea = Ca.Q; Pea = Ca.P; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; - /* Mass balance equation */ 0 = Qea + Qews + Qfuel - Qsf; @@ -191,8 +192,6 @@ equation Ca.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; - /* No flow reversal */ Cfg.h = Cfg.h_vol_1; @@ -233,11 +232,13 @@ equation /* Specific enthalpy and entropy at the inlet of the atomisation compressor */ if air_atomisation then - Hecpat = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2); - Secpat = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2); - Hiscpat = ThermoSysPro.Properties.FlueGases.FlueGases_h_Ps(Pscpat, Secpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2); + Hecpat = Medium_FlueGases.specificEnthalpy_pTX(p=Pecpat, T=Tecpat, X=Xea); + state_atom_in = Medium_FlueGases.setState_pTX(p=Pecpat, T=Tecpat, X=Xea); + Secpat = Medium_FlueGases.specificEntropy(state_atom_in); + Hiscpat = Medium_FlueGases.isentropicEnthalpy(p_downstream=Pscpat, refState=state_atom_in); else Hecpat = 60000; + state_atom_in = Medium_FlueGases.setState_pTX(p=Pecpat, T=Tecpat, X=Xea); Secpat = -2000; Hiscpat = 60000; end if; @@ -249,17 +250,19 @@ equation Hrfg = 2501.569e3*XsfH2O; /* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2); + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); /* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); /* Air density at the inlet */ - rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2); + rhoea = Medium_FlueGases.density(state_air_in); Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1; /* Flue gases density at the outlet */ - rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + rhosf = Medium_FlueGases.density(state_fg_out); Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1; 0 = if (eta_is > eps_a) then (eta_isc - eta_is) else (eta_isc - eps_a); @@ -278,6 +281,15 @@ equation /* SO2 flue gases mass fraction */ XsfSO2*(Qea + Qews + Qfuel) = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + /* Fuel thermal power */ Wfuel = Qfuel*LHVfuel; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo index 461c5b93..bd708dd3 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; model GenericCombustion "Generic combustion chamber" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=1 "Pressure loss coefficient in the combustion chamber"; parameter Units.SI.Area Acham=1 "Average corss-sectional area of the combusiton chamber"; @@ -25,6 +24,11 @@ protected constant Real amCO2=amC + 2*amO "CO2 molecular mass"; constant Real amH2O=2*amH + amO "H2O molecular mass"; constant Real amSO2=amS + 2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; @@ -82,7 +86,6 @@ public Real Vccbm(start=0.001) "Average volume mass in the combustion chamber"; Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; - FluidType fluids[3] "Fluids mixing in volume"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jws "Thermal power diffusion from inlet Cws"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -93,30 +96,30 @@ public Real ra "Value of r(Q/gamma) for inlet Ca"; Real rws "Value of r(Q/gamma) for inlet Cws"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; public ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation (Placement(transformation(extent={{60,-100},{80,-80}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "Water/steam inlet" annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); + assert(Medium_FlueGases.nX > 1, "GenericCombustion: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GenericCombustion: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); /* Fuel inlet */ Qfuel = Cfuel.Q; @@ -133,36 +136,33 @@ equation Cpfuel = Cfuel.cp; /* Water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam"); - Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; - Qews = Cws.Q; Hews = Cws.h; + Xws = Cws.Xi; + SubCws = Cws.SubC; /* Air inlet */ Qea = Ca.Q; Pea = Ca.P; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; - /* Mass balance equation */ 0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf; @@ -181,8 +181,6 @@ equation Ca.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; - /* No flow reversal */ Cfg.h = Cfg.h_vol_1; @@ -229,17 +227,19 @@ equation Hrcd = 0; /* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); /* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); /* Air density at the inlet */ - rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); + rhoea = Medium_FlueGases.density(state_air_in); Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1; /* Flue gases density at the outlet */ - rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + rhosf = Medium_FlueGases.density(state_fg_out); Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1; /* CO2 flue gases mass fraction */ @@ -254,6 +254,15 @@ equation /* SO2 flue gases mass fraction */ XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + /* Fuel thermal power */ HHVfuel = LHVfuel + 224.3e5*XHfuel + 25.1e5*Xwfuel; Wfuel = Qfuel*HHVfuel; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo index 1e4270db..5643856c 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; model GenericCombustion1D "Generic combustion chamber 1D" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer NCEL = 7; parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber"; @@ -34,6 +33,11 @@ protected constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; constant Real amH2O = 2*amH + amO "H2O molecular mass"; constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; @@ -93,7 +97,6 @@ public Units.SI.Power Ws[NCEL](start=fill(10e6, NCEL)) "Power delivered to each segment"; Units.SI.Power Wst(start=50.e6) "Total power exchanged on all segment"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; - FluidType fluids[3] "Fluids mixing in volume"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jws "Thermal power diffusion from inlet Cws"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -104,32 +107,32 @@ public Real ra "Value of r(Q/gamma) for inlet Ca"; Real rws "Value of r(Q/gamma) for inlet Cws"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; public ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "Water/steam inlet" annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation= 0))); Thermal.Connectors.ThermalPort Cth[NCEL] "Thermal W T" annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); + assert(Medium_FlueGases.nX > 1, "GenericCombustion1D: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GenericCombustion1D: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); /* Heat transfer */ Cth.W = -Ws; @@ -148,36 +151,33 @@ equation Cpfuel = Cfuel.cp; /* Water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam"); - Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; - Qews = Cws.Q; Hews = Cws.h; + Xws = Cws.Xi; + SubCws = Cws.SubC; /* Air inlet */ Qea = Ca.Q; Pea = Ca.P; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; - /* Mass balance equation */ 0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf; @@ -196,8 +196,6 @@ equation Ca.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; - /* No flow reversal */ Cfg.h = Cfg.h_vol_1; @@ -244,17 +242,19 @@ equation Hrcd = 0; /* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); /* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); /* Air density at the inlet */ - rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); + rhoea = Medium_FlueGases.density(state_air_in); Vea = if (rhoea >0.001) then 1/rhoea else 1/1.1; /* Flue gases density at the outlet */ - rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + rhosf = Medium_FlueGases.density(state_fg_out); Vsf = if (rhosf >0.001) then 1/rhosf else 1/0.1; /* CO2 flue gases mass fraction */ @@ -270,6 +270,15 @@ equation /* SO2 flue gases mass fraction */ XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + /* LHV conversion from dryer to crude*/ LHVfuel = -2510000.0*Xwfuel + LHVfuel_D*(1-Xwfuel); diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo index a13c091a..b08bb7d4 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; model GridFurnace "Combustion furnace" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real X2eap=0.1 "Primary air fraction in zone 2"; parameter Real X3eap=0.1 "Primary air fraction in zone 3"; @@ -44,6 +43,11 @@ protected constant Units.SI.SpecificEnthalpy HfH2Ol=15.883300e6 "H2Ol formation enthalpy"; constant Units.SI.SpecificHeatCapacity Cp3g=1100 "Average flue gases specific heat capacity at T3g"; parameter Integer mode=0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; @@ -264,17 +268,20 @@ public Real FVN0(start=0.1) "Ashes normal volume fraction for the computation of FVN"; Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; - FluidType fluids[4] "Fluids mixing in volume"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xeap[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Primary air mass fractions"; + Medium_FlueGases.MassFraction Xeas[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Secondary air mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2(redeclare package Medium = Medium_FlueGases) annotation (Placement( transformation(extent={{-60,50},{-40,70}}, rotation=0))); ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Com annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet port_eau_refroid + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet port_eau_refroid(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0))); ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1 annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= @@ -292,20 +299,14 @@ public annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= 0))); public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1(redeclare package Medium = Medium_FlueGases) annotation (Placement( transformation(extent={{-10,-100},{10,-80}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca1.ftype; - fluids[3] = Ca2.ftype; - fluids[4] = Cfg.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); + assert(Medium_FlueGases.nX > 1, "GridFurnace: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GridFurnace: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); /* Mixing specific enthalpy */ port_eau_refroid.h_vol_2 = h; @@ -313,8 +314,6 @@ equation Ca2.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; - /* No flow reversal */ Cfg.h = Cfg.h_vol_1; @@ -340,15 +339,13 @@ equation Cpom = Com.cp; /* Cooling water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GridFurnace: the fluid type for the water/steam inlet must be water/steam"); - port_eau_refroid.diff_res_2 = 0; port_eau_refroid.diff_on_2 = diffusion; - ftype_ws = port_eau_refroid.ftype; - Qerefo = port_eau_refroid.Q; Herefo = port_eau_refroid.h; + Xws = port_eau_refroid.Xi; + SubCws = port_eau_refroid.SubC; /* Primary air inlet */ Qeap = Ca1.Q; @@ -356,11 +353,15 @@ equation Peap = Psf; Heap = Ca1.h; - XeapCO2 = Ca1.Xco2; - XeapH2O = Ca1.Xh2o; - XeapO2 = Ca1.Xo2; - XeapSO2 = Ca1.Xso2; - XeapN2 = 1 - Ca1.Xco2 - Ca1.Xh2o - Ca1.Xo2 - Ca1.Xso2; + Xeap[1:Medium_FlueGases.nXi] = Ca1.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xeap[Medium_FlueGases.nX] = 1 - sum(Ca1.Xi); + end if; + XeapCO2 = Xeap[iCO2]; + XeapH2O = Xeap[iH2O]; + XeapO2 = Xeap[iO2]; + XeapSO2 = Xeap[iSO2]; + XeapN2 = Xeap[iN2]; /* Secondary air inlet */ Qeas = Ca2.Q; @@ -368,22 +369,21 @@ equation Peas = Psf; Heas = Ca2.h; - XeasCO2 = Ca2.Xco2; - XeasH2O = Ca2.Xh2o; - XeasO2 = Ca2.Xo2; - XeasSO2 = Ca2.Xso2; - XeasN2 = 1 - Ca2.Xco2 - Ca2.Xh2o - Ca2.Xo2 - Ca2.Xso2; + Xeas[1:Medium_FlueGases.nXi] = Ca2.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xeas[Medium_FlueGases.nX] = 1 - sum(Ca2.Xi); + end if; + XeasCO2 = Xeas[iCO2]; + XeasH2O = Xeas[iH2O]; + XeasO2 = Xeas[iO2]; + XeasSO2 = Xeas[iSO2]; + XeasN2 = Xeas[iN2]; /* Flue gases outlet */ Qsf = Cfg.Q; Hsf = Cfg.h; Psf = Cfg.P; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; - /* Primary air mass flow rates */ X1eap = 1 - X2eap - X3eap; Q1eap = Qeap*X1eap; @@ -747,6 +747,14 @@ end if; XsfHF = Q5eHF/Qsf; XsfCEND = Q5ecend/Qsf; XsfN2 = 1 - (XsfCO2 + XsfH2O + XsfO2 + XsfSO2); + Xsf[iN2] = XsfN2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca1.SubC; + SubCfg = Cfg.SubC; /* Power accumulated by the flue gases in zone 5 */ P5a = Qeasm*Heasm; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo index 40503f14..d93c61a9 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo @@ -1,24 +1,26 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; model PostCombustionGas "Post-combustion" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real XClfuel=0 "Chloride mass fraction in fuel"; parameter Real XFfuel=0 "Fluoride mass fraction in fuel"; parameter Real Xrad=0 "Fraction of radiated power"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(enable=(ftype==FluidType.WaterSteam), tab="Fluid", group="Fluid properties")); protected constant Real HfCO2=3.275e+07 "CO2 formation specific enthalpy"; constant Real HfCO=9.201e+06 "CO formation specific enthalpy"; constant Real HfH2O=2.418e+08 "H2O steam formation specific enthalpy"; constant Units.SI.SpecificEnthalpy H0v=2501551.43 "Vaporisation specific enthalpy at 0°C"; - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer mode=0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; public @@ -132,7 +134,6 @@ public Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet"; Real Keq0(start=0.1) "Intermediate variable for the compuation of Keq"; Real delta(start=0.1) "Intermediate variable to compute the progress of stage 4"; - FluidType fluids[4] "Fluids mixing in volume"; Units.SI.SpecificEnthalpy h(start=10e5) "Fluid mixture specific enthalpy"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jfg1 "Thermal power diffusion from inlet Cfg1"; @@ -144,14 +145,17 @@ public Real ra "Value of r(Q/gamma) for inlet Ca"; Real rfg1 "Value of r(Q/gamma) for inlet Cfg1"; Real rfg2 "Value of r(Q/gamma) for outlet Cfg2"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xef[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; public - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 "Flue gases outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 "Flue gases inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) "Flue gases inlet" annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}, @@ -161,14 +165,8 @@ public 0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg1.ftype; - fluids[4] = Cfg2.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), - "PostCombustionGas: fluids mixing in volume are not compatible with each other"); + assert(Medium_FlueGases.nX > 1, "PostCombustionGas: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "PostCombustionGas: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); /* Fuel inlet */ Qec = Cfuel.Q; @@ -188,31 +186,34 @@ equation Pea = 1.01e+5; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; /* Flue gases inlet */ Qef = Cfg1.Q; Hef = Cfg1.h; Cfg1.P = Cfg2.P; - XefCO2 = Cfg1.Xco2; - XefH2O = Cfg1.Xh2o; - XefO2 = Cfg1.Xo2; - XefSO2 = Cfg1.Xso2; + Xef[1:Medium_FlueGases.nXi] = Cfg1.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xef[Medium_FlueGases.nX] = 1 - sum(Cfg1.Xi); + end if; + XefCO2 = Xef[iCO2]; + XefH2O = Xef[iH2O]; + XefO2 = Xef[iO2]; + XefSO2 = Xef[iSO2]; /* Flue gases outlet */ Qsf = Cfg2.Q; Hsf = Cfg2.h; Psf = Cfg2.P; - XsfCO2 = Cfg2.Xco2; - XsfH2O = Cfg2.Xh2o; - XsfO2 = Cfg2.Xo2; - XsfSO2 = Cfg2.Xso2; - // 1st zone : Mixing air - flue gases - water in fuel // -------------------------------------------------- @@ -235,8 +236,6 @@ equation Cfg1.h_vol_2 = h; Cfg2.h_vol_1 = h; - Cfg2.ftype = ftype; - /* Mixture composition */ XmelO2 = (XefO2*Qef + XeaO2*Qea)/Qmel; XmelCO2 = (XefCO2*Qef)/Qmel; @@ -482,6 +481,13 @@ equation XsfCO2 = Q24CO2/Qsf; XsfC = XsfCO2 + XsfCO; XsfN2 = 1 - (XsfO2 + XsfSO2 + XsfH2O + XsfCO2 + XsfCO); + Xsf[iN2] = 1 - XsfO2 - XsfH2O - XsfCO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg2.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg2.SubC = Cfg1.SubC; /* Power accumukated by the gases in zone 2 */ P2t = ((Q24H2O - (Qmel*XmelH2O))*H0v + Qmel*Hmel + Q1ec*Hfuel + P2g)*(1 - Xrad); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo new file mode 100644 index 00000000..0a2ca23b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo @@ -0,0 +1,49 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGTCombustionChamber + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber combustionChamber( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=15e5, + h0=300e3) + annotation (Placement(transformation(extent={{-100,50},{-60,90}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Hum=0, + Xo=0, + Xn=0, + Xs=0, + rho=0.838, + Xc=0.755, + Xh=0.245, + Cp=2255, + T0=410, + Q0=9.30, + LHV=47500e3) + annotation (Placement(transformation(extent={{-100,-90},{-60,-50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{80,-20},{120,20}}, rotation=0))); +equation + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation (Line(points={{-60,70},{-24,70},{-24,36}}, color={0,0,255})); + connect(sourceFuel.C, combustionChamber.Cfuel) annotation (Line(points={{-60,-70},{0,-70},{0,-36}}, color={0,0,0})); + connect(sourceAir.C, combustionChamber.Ca) annotation (Line(points={{-80,0},{-36,0}}, color={0,0,0})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation (Line(points={{36,0},{80,0}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGTCombustionChamber; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo new file mode 100644 index 00000000..353493ee --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo @@ -0,0 +1,49 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion combustionChamber( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=15e5, + h0=300e3) + annotation (Placement(transformation(extent={{-120,10},{-80,50}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Hum=0, + Xo=0, + Xn=0, + Xs=0, + rho=0.838, + Xc=0.755, + Xh=0.245, + Cp=2255, + T0=410, + Q0=9.30, + LHV=47500e3) + annotation (Placement(transformation(extent={{30,-100},{70,-60}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-40,-100},{0,-60}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{-20,80},{20,120}}, rotation=0))); +equation + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation (Line(points={{-80,30},{-70,30},{-70,4},{-36,4}}, color={0,0,255})); + connect(sourceFuel.C, combustionChamber.Cfuel) annotation (Line(points={{70,-80},{28,-80},{28,-36}}, color={0,0,0})); + connect(sourceAir.C, combustionChamber.Ca) annotation (Line(points={{0,-80},{-12,-80},{-12,-36}}, color={0,0,0})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation (Line(points={{-12,36},{-12,100},{-20,100}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGenericCombustion; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo new file mode 100644 index 00000000..dab35fd7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion1D + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D combustionChamber(redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, NCEL = 7, Qm(fixed = false), Qsf(fixed = false), kcham(fixed = true) = 0.1, Acham = 275, Xbf = 0, ImbCV = 0.05, EPSPAR = 0.7, Kec = 8.8, SM = {639.92, 198.58, 466.48, 466.48, 466.48, 358.56, 358.56}, ImbBF = 0.0, Psf(start = 113275)) annotation( + Placement(transformation(origin = {-4, 10}, extent = {{-40, -40}, {40, 40}}))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel(Xn = 0.0208, Xashes = 0.136, Cp = 1200, rho = 1100, LHV = 29245e3, Xc = 0.719, Xh = 0.0414, Xo = 0.086, Xs = 0.0044, Vol = 0.286, Q0 = 57.20, T0 = 358.15, Hum = 0.08) annotation( + Placement(transformation(extent = {{-100, -30}, {-60, 10}}, rotation = 0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(redeclare package Medium = Medium_FlueGases, Q0 = 609.29, P0 = 191000, T0 = 524.89, option_temperature = true, X0 = {0.76, 0.23, 0.01, 0, 0}) annotation( + Placement(transformation(origin = {-80, -74}, extent = {{-20, -100}, {20, -60}}, rotation = 90))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam(redeclare package Medium = Medium, Q0 = 0, P0 = 100000) annotation( + Placement(transformation(extent = {{-100, 30}, {-60, 70}}, rotation = 0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium_FlueGases, T0 = 1200, option_temperature = true) annotation( + Placement(transformation(origin = {24, -18}, extent = {{-20, 80}, {20, 120}}))); +equation + connect(sourceFuel.C, combustionChamber.Cfuel) annotation( + Line(points = {{-60, -10}, {-40, -10}})); + connect(sourceAir.C, combustionChamber.Ca) annotation( + Line(points = {{0, -54}, {0, -45}, {-4, -45}, {-4, -26}})); + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation( + Line(points = {{-60, 50}, {-60, 32}, {-40, 32}, {-40, 30}}, color = {0, 0, 255})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation( + Line(points = {{-4, 46}, {-4, 63}, {4, 63}, {4, 82}})); + annotation( + experiment(StopTime = 1)); +end TestGenericCombustion1D; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo new file mode 100644 index 00000000..f9d75047 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo @@ -0,0 +1,115 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion1DWithPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D combustionChamber( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + NCEL=7, + Qm(fixed=false), + Qsf(fixed=false), + kcham(fixed=true)=0.1, + Acham=275, + Xbf=0, + ImbCV=0.05, + EPSPAR=0.7, + Kec=8.8, + SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56}, + ImbBF=0.0, + Psf(start=113275)) + annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Xn=0.0208, + Xashes=0.136, + Cp=1200, + rho=1100, + LHV=29245e3, + Xc=0.719, + Xh=0.0414, + Xo=0.086, + Xs=0.0044, + Vol=0.286, + Q0=57.20, + T0=358.15, + Hum=0.08) + annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=609.29, + P0=191000, + T0=524.89, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=100000) + annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{0,70},{44,112}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe pipeWaterSteam( + redeclare package Medium = Medium, + Ns=7, + inertia=false, + dynamic_energy_balance=false, + z2=56, + rugosrel=5e-5, + ntubes=403, + L=58, + D=0.0327, + P(start=fill(2.0e7, 9)), + Q(start=fill(486.69, 8)), + h(start=fill(1.8e6, 9)), + C2(Q(fixed=false, start=486.69), P(fixed=false, start=1.96318e7, displayUnit="Pa")), + dpfCorr=3.5) + annotation (Placement(transformation(origin={91,8}, extent={{49,16},{-49,-16}}, rotation=270))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall wall( + Ns=7, + dynamic_energy_balance=false, + Tp1(start=fill(500, 7)), + Tp2(start=fill(400, 7)), + lambda=40, + steady_state=true, + ntubes=403, + L=58, + D=0.0327, + e=0.001) + annotation (Placement(transformation(origin={73,7.5}, extent={{51.5,-15},{-51.5,15}}, rotation=270))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePipe( + redeclare package Medium = Medium, + h0=1.292e6, + option_temperature=false, + P0=20112000) + annotation (Placement(transformation(origin={91,-81}, extent={{15,-15},{-15,15}}, rotation=270))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPipe( + redeclare package Medium = Medium, + option_temperature=false, + Q(start=486.69), + h0=2.5e6, + P0=19621600) + annotation (Placement(transformation(origin={90,90.5}, extent={{14.5,-15},{-14.5,15}}, rotation=270))); +equation + connect(sourceFuel.C, combustionChamber.Cfuel) + annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0})); + connect(combustionChamber.Cfg, sinkFlueGases.C) + annotation (Line(points={{0,65.6},{0,91}}, color={0,0,0})); + connect(sourceAir.C, combustionChamber.Ca) + annotation (Line(points={{0,-78},{0,-49.6}}, color={0,0,0})); + connect(sourceWaterSteam.C, combustionChamber.Cws) + annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255})); + connect(combustionChamber.Cth, wall.WT2) + annotation (Line(points={{55.8,8},{68,8},{68,7.5},{76,7.5}}, color={191,95,0})); + connect(wall.WT1, pipeWaterSteam.CTh) + annotation (Line(points={{70,7.5},{71,7.5},{71,8},{86.2,8}}, color={191,95,0})); + connect(sourcePipe.C, pipeWaterSteam.C1) + annotation (Line(points={{91,-66},{91,-41}}, color={0,0,255})); + connect(pipeWaterSteam.C2, sinkPipe.C) + annotation (Line(points={{91,57},{91,76},{90,76}}, color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestGenericCombustion1DWithPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo new file mode 100644 index 00000000..f7dcf2e6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo @@ -0,0 +1,73 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGridFurnace + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSource( + Xn=0.0208, + Xashes=0.136, + Cp=1200, + rho=1100, + LHV=29245e3, + Xc=0.719, + Xh=0.0414, + Xo=0.086, + Xs=0.0044, + Vol=0.286, + Q0=57.20, + T0=358.15, + Hum=0.08) + annotation (Placement(transformation(extent={{-106,-23},{-72,15}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePrimaryAir( + redeclare package Medium = Medium_FlueGases, + T0=300, + Q0=10, + P0=1.9e5, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-74,-80},{-30,-40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{28,50},{72,92}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceCoolingWater( + redeclare package Medium = Medium, + P0=1.e5, + Q0=1) + annotation (Placement(transformation(extent={{89,13},{53,47}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.CombustionChambers.GridFurnace gridFurnace( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Q5eH2O(start=27.562088697651173), + Q5eN2(start=18.629997579210396), + Q5sCO(start=16.083169558220888), + Q5sCO2(start=-23.220946069965017), + Q5sO2(start=-1.7763568394002505E-15), + T2(start=4353.611752483582), + Teap(start=2396.269823464287, displayUnit="degC"), + Teas(start=2396.269823464287, displayUnit="degC"), + Teasm(start=2419.8632089574135, displayUnit="degC"), + Tsf(start=1964.2922985959055), Hsf(start = 4575373),Qeasm(start=14.733687)) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSecondaryAir( + redeclare package Medium = Medium_FlueGases, + option_temperature=true, + T0=300, + Q0=10, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-90,4},{-46,44}}, rotation=0))); +equation + connect(fuelSource.C, gridFurnace.Com) + annotation (Line(points={{-72,-4},{-36,-4}}, color={0,0,0})); + connect(gridFurnace.Cfg, sinkFlueGases.C) + annotation (Line(points={{0,36},{0,71},{28,71}}, color={0,0,0})); + connect(sourceCoolingWater.C, gridFurnace.port_eau_refroid) + annotation (Line(points={{53,30},{32,30},{32,12}}, color={0,0,255})); + connect(sourceSecondaryAir.C, gridFurnace.Ca2) + annotation (Line(points={{-46,24},{-20,24}}, color={0,0,0})); + connect(sourcePrimaryAir.C, gridFurnace.Ca1) + annotation (Line(points={{-30,-60},{0,-60},{0,-36}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGridFurnace; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo new file mode 100644 index 00000000..7b9a15fe --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo @@ -0,0 +1,67 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestPostCombustionGas + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(origin={151,-6}, extent={{23,-24},{-23,24}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-174,-30},{-128,18}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceAir( + redeclare package Medium = Medium_FlueGases, + T0=680, + option_temperature=true, + Q0=10, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-172,68},{-132,108}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Hum=0, + Xo=0, + Xn=0, + Xs=0, + rho=0.838, + Xc=0.755, + Xh=0.245, + Cp=2255, + T0=410, + Q0=9.30, + LHV=47500e3) + annotation (Placement(transformation(extent={{-107,-109},{-71,-73}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.CombustionChambers.PostCombustionGas postCombustionGas( + redeclare package Medium_FlueGases = Medium_FlueGases, Psf(start = 1.5e6), Tmel(start = 2427.85 + 273.15), h(start = 4026550)) + annotation (Placement(transformation(extent={{-52,-74},{74,50}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss airPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{-100,78},{-80,98}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{-102,-16},{-82,4}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{90,-16},{110,4}}))); +equation + connect(sourceFuel.C, postCombustionGas.Cfuel) + annotation (Line(points={{-71,-91},{-7.9,-91},{-7.9,-67.8}}, color={0,0,0})); + connect(sourceAir.C, airPressureLoss.C1) + annotation (Line(points={{-132,88},{-100,88}}, color={0,0,0})); + connect(airPressureLoss.C2, postCombustionGas.Ca) + annotation (Line(points={{-80,88},{-20.5,88},{-20.5,43.8}}, color={0,0,0})); + connect(sourceFlueGases.C, inletPressureLoss.C1) + annotation (Line(points={{-128,-6},{-102,-6}}, color={0,0,0})); + connect(inletPressureLoss.C2, postCombustionGas.Cfg1) + annotation (Line(points={{-82,-6},{-64,-6},{-64,-5.8},{-45.7,-5.8}}, color={0,0,0})); + connect(postCombustionGas.Cfg2, outletPressureLoss.C1) + annotation (Line(points={{67.7,-5.8},{79.85,-5.8},{79.85,-6},{90,-6}}, color={0,0,0})); + connect(outletPressureLoss.C2, sinkFlueGases.C) + annotation (Line(points={{110,-6},{128,-6}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestPostCombustionGas; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order index e69de29b..a7bc0903 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order @@ -0,0 +1,6 @@ +TestGTCombustionChamber +TestGenericCombustion +TestGenericCombustion1D +TestGenericCombustion1DWithPipe +TestPostCombustionGas +TestGridFurnace diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo index 36776aa2..79aa47c2 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo @@ -7,34 +7,22 @@ model TestFixedPowerHeatExchanger ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger fixedPowerHeatExchanger( redeclare package Medium_c = Medium, redeclare package Medium_f = Medium, - DW=1e5, - DPc=1, - DPf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + DW=1e6) + annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( redeclare package Medium = Medium, - T0=340) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + T0=340) annotation (Placement(transformation(extent={{-70,22},{-50,42}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-58,44},{-38,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkPc( redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkPf( redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumePc( - redeclare package Medium = Medium, - V=1, - steady_state=false, - h0=2.8e5) annotation (Placement(transformation(extent={{10,44},{30,64}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumePf( - redeclare package Medium = Medium, - V=1, - steady_state=false, - h0=7e4) annotation (Placement(transformation(extent={{-10,24},{10,44}}, rotation=0))); equation - connect(sourcePc.C, fixedPowerHeatExchanger.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,48}}, color={0,0,255})); - connect(sourcePf.C, fixedPowerHeatExchanger.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); - connect(fixedPowerHeatExchanger.Sc, volumePc.Ce) annotation (Line(points={{0,48},{8,48},{8,54},{10,54}}, color={0,0,255})); - connect(volumePc.Cs3, sinkPc.C) annotation (Line(points={{30,54},{40,54}}, color={0,0,255})); - connect(fixedPowerHeatExchanger.Sf, volumePf.Ce) annotation (Line(points={{0,57},{6,57},{6,34},{-10,34}}, color={0,0,255})); - connect(volumePf.Cs3, sinkPf.C) annotation (Line(points={{10,34},{20,34}}, color={0,0,255})); + connect(sourcePQ.C, fixedPowerHeatExchanger.Ec) annotation (Line(points={{-50,32},{-16,32},{-16,48},{-15.8,48}}, + color={0,0,255})); + connect(sourcePQ1.C, fixedPowerHeatExchanger.Ef) annotation (Line(points={{-38,54},{-20,54}}, color={0,0,255})); + connect(fixedPowerHeatExchanger.Sc, sinkPf.C) annotation (Line(points={{-4.2,48},{-4.2,34},{20,34}}, color={0,0,0})); + connect(fixedPowerHeatExchanger.Sf, sinkPc.C) annotation (Line(points={{-0.2,54.1},{19.9,54.1},{19.9,54},{40,54}}, color={0,0,0})); annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestFixedPowerHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo index 27ccee15..84d2f19c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo @@ -1,45 +1,17 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; model TestFixedPowerHeatExchanger_Traces extends ThermoSysPro.UsersGuide.Icons.Example; + extends TestFixedPowerHeatExchanger( + redeclare replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}), + sourcePQ1(SubC0={1}), + sourcePQ(SubC0={2})); - replaceable package Medium = Properties.Media.WaterSteam( - extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, - C_nominal={0.1, 0.2, 0.3}, - C_default={0.2, 0.3, 0.4}); - ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger fixedPowerHeatExchanger( - redeclare package Medium_c = Medium, - redeclare package Medium_f = Medium, - DW=1e5, - DPc=1, - DPf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( - redeclare package Medium = Medium, - T0=340, - SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( - redeclare package Medium = Medium, - SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( - redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumePc( - redeclare package Medium = Medium, - V=1, - steady_state=false, - h0=2.8e5) annotation (Placement(transformation(extent={{10,44},{30,64}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumePf( - redeclare package Medium = Medium, - V=1, - steady_state=false, - h0=7e4) annotation (Placement(transformation(extent={{-10,24},{10,44}}, rotation=0))); -equation - connect(sourcePc.C, fixedPowerHeatExchanger.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,48}}, color={0,0,255})); - connect(sourcePf.C, fixedPowerHeatExchanger.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); - connect(fixedPowerHeatExchanger.Sc, volumePc.Ce) annotation (Line(points={{0,48},{8,48},{8,54},{10,54}}, color={0,0,255})); - connect(volumePc.Cs3, sinkPc.C) annotation (Line(points={{30,54},{40,54}}, color={0,0,255})); - connect(fixedPowerHeatExchanger.Sf, volumePf.Ce) annotation (Line(points={{0,57},{6,57},{6,34},{-10,34}}, color={0,0,255})); - connect(volumePf.Cs3, sinkPf.C) annotation (Line(points={{10,34},{20,34}}, color={0,0,255})); - annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); end TestFixedPowerHeatExchanger_Traces; From 8462ec8641bee2bf6d15d863f3ab752dc564d236 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 13:52:43 +0200 Subject: [PATCH 165/213] #125 GridFurnace and PostCombustionGas dont use pro anymore but ThermodynamicStates --- .../CombustionChambers/GridFurnace.mo | 64 +++++++++++-------- .../CombustionChambers/PostCombustionGas.mo | 12 ++-- 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo index b08bb7d4..80ebb760 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo @@ -274,6 +274,11 @@ public Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium.ThermodynamicState state_biomass_water "Water in biomass thermodynamic state"; + Medium.ThermodynamicState state_biomass_water_sat_v "Saturated vapor state of water in biomass"; + Medium.ThermodynamicState state_biomass_water_sat_l "Saturated liquid state of water in biomass"; + Medium.ThermodynamicState state_dried_water "Water vapor state after drying"; + Medium.ThermodynamicState state_water_seal_vapor "Water seal vapor state"; public ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2(redeclare package Medium = Medium_FlueGases) annotation (Placement( @@ -283,21 +288,6 @@ public 0))); ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet port_eau_refroid(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1 - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro2 - annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro3 - annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro4 - annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro5 - annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= - 0))); public ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1(redeclare package Medium = Medium_FlueGases) annotation (Placement( transformation(extent={{-10,-100},{10,-80}}, rotation=0))); @@ -439,21 +429,33 @@ equation end if; /* Specific enthalpy of the water in the biomass */ - pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, Teom, mode); - Heauom = pro1.h; + state_biomass_water = Medium.setState_pTX( + p=Peap, + T=Teom, + region=mode); + Heauom = Medium.specificEnthalpy(state_biomass_water); /* Water phase transition energy at Teom */ Psateom = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Teom); - pro2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 2); - Hvteom = pro2.h; - pro3 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 1); - Hlteom = pro3.h; + state_biomass_water_sat_v = Medium.setState_pTX( + p=Psateom, + T=Teom, + region=2); + Hvteom = Medium.specificEnthalpy(state_biomass_water_sat_v); + state_biomass_water_sat_l = Medium.setState_pTX( + p=Psateom, + T=Teom, + region=1); + Hlteom = Medium.specificEnthalpy(state_biomass_water_sat_l); Hvapteom = Hvteom - Hlteom; /* Specific enthalpy of the water in the biomass */ - pro4 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psf, T1sfm, 0); - Hs1vom = pro4.h; + state_dried_water = Medium.setState_pTX( + p=Psf, + T=T1sfm, + region=0); + Hs1vom = Medium.specificEnthalpy(state_dried_water); /* Specific enthalpy of the biomass at Teom */ Heom = Cpom*(Teom - 273.15); @@ -663,9 +665,12 @@ end if; P4m = Q4eom*CpMACHs4*((T3o - 273.15) - (T4o - 273.15)); P4h = Q4eom*X4H2O*Cp4liq*((T4o - 273.15) - (T4er - 273.15)); Q4v = rendje*(P4m - P4h)/(Cp4liq*(373.15 - (T4er - 273.15)) + Hvapo); - pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2); - H4 = pro5.h; - P4v = Q4v*pro5.h; + state_water_seal_vapor = Medium.setState_pTX( + p=Peap, + T=373.15, + region=2); + H4 = Medium.specificEnthalpy(state_water_seal_vapor); + P4v = Q4v*Medium.specificEnthalpy(state_water_seal_vapor); else T4o = 273.15; TsMACH = T3o; @@ -675,8 +680,11 @@ end if; P4m = 0; P4h = 0; Q4v = 0; - pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2); - H4 = pro5.h; + state_water_seal_vapor = Medium.setState_pTX( + p=Peap, + T=373.15, + region=2); + H4 = Medium.specificEnthalpy(state_water_seal_vapor); P4v = 0; end if; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo index d93c61a9..1a2ccd8b 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo @@ -2,6 +2,7 @@ model PostCombustionGas "Post-combustion" extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam properties" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real XClfuel=0 "Chloride mass fraction in fuel"; @@ -148,6 +149,7 @@ public Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; Medium_FlueGases.MassFraction Xef[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases inlet mass fractions"; Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ThermodynamicState state_fuel_water "Water in fuel thermodynamic state"; public ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" @@ -160,9 +162,6 @@ public ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1 - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); equation assert(Medium_FlueGases.nX > 1, "PostCombustionGas: Medium_FlueGases must be a gas mixture"); @@ -295,8 +294,11 @@ equation // - - /* Specific enthalpy of the water in fuel */ - pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pea, Tec, mode); - Hwfuel = pro1.h; + state_fuel_water = Medium.setState_pTX( + p=Pea, + T=Tec, + region=mode); + Hwfuel = Medium.specificEnthalpy(state_fuel_water); /* Fuel specific enthalpy */ Hfuel = Cpfuel*(Tec - 273.16); From d40a32a07e7b0ab3d6eea57422e0edc4857eb178 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 14:07:04 +0200 Subject: [PATCH 166/213] #125 RefH with examples --- ThermoSysPro/Fluid/BoundaryConditions/RefH.mo | 13 ++-- .../BoundaryConditions/TestRefH.mo | 63 +++++++++++++++++++ .../BoundaryConditions/TestRefH_Traces.mo | 17 +++++ .../TestRefH_Traces_FlueGases.mo | 19 ++++++ .../BoundaryConditions/package.order | 3 + 5 files changed, 108 insertions(+), 7 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo index 9e1a3b52..673561dc 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo @@ -1,6 +1,8 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefH "Fixed specific enthalpy reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.SpecificEnthalpy h0=1.e5 "Fixed fluid specific enthalpy"; public @@ -8,9 +10,9 @@ public Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-110,-10},{-90,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation (Placement( + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( transformation(extent={{90,-10},{110,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy annotation (Placement(transformation( @@ -36,12 +38,9 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + C1.Xi = C2.Xi; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; Q = C1.Q; P = C1.P; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo new file mode 100644 index 00000000..860e2926 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo @@ -0,0 +1,63 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP( + redeclare package Medium = Medium, + P0=2000000) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=110) + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{126,-10},{146,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefH refH( + redeclare package Medium = Medium, + h0=2600e3) + annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA( + redeclare package Medium = Medium, + h0=2600e3, + dynamic_energy_balance=false) + annotation (Placement(transformation(extent={{20,-50},{0,-30}}))); + InstrumentationAndControl.Blocks.Sources.Constante enthalpy(k=2600e3) + annotation (Placement(transformation(extent={{-58,38},{-38,58}}))); + InstrumentationAndControl.Blocks.Sources.Constante pressure(k=2000000) + annotation (Placement(transformation(extent={{-110,38},{-90,58}}))); + InstrumentationAndControl.Blocks.Sources.Constante massFlow(k=110) + annotation (Placement(transformation(extent={{2,38},{22,58}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{18,-10},{38,10}}, + rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{46,-10},{66,10}}, + rotation=0))); +equation + connect(refP.C2, refH.C1) + annotation (Line(points={{-70,0},{-40,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{112,0},{126,0}}, + color={0,0,0})); + connect(pipePressureLoss.C2, volumeA.Ce1) + annotation (Line(points={{146,0},{150,0},{150,-40},{20,-40}}, + color={0,0,0})); + connect(volumeA.Cs1, refP.C1) + annotation (Line(points={{0,-40},{-102,-40},{-102,0},{-90,0}}, color={0,0,0})); + connect(enthalpy.y, refH.ISpecificEnthalpy) + annotation (Line(points={{-37,48},{-30,48},{-30,11}}, color={0,0,255})); + connect(pressure.y, refP.IPressure) + annotation (Line(points={{-89,48},{-80,48},{-80,11}}, color={0,0,255})); + connect(massFlow.y, refQ.IMassFlow) + annotation (Line(points={{23,48},{102,48},{102,11}}, + color={0,0,255})); + connect(refH.C2, loopBreakerH.C1) annotation (Line(points={{-20,0},{-10,0}}, color={0,0,0})); + connect(loopBreakerH.C2, loopBreakerQ.C1) annotation (Line(points={{10,0},{18,0}}, color={0,0,0})); + connect(loopBreakerQ.C2, loopBreakerP.C1) annotation (Line(points={{38,0},{46,0}}, color={0,0,0})); + connect(loopBreakerP.C2, refQ.C1) annotation (Line(points={{66,0},{92,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo new file mode 100644 index 00000000..cc1aebed --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH_Traces + extends TestRefH( + redeclare package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}), + volumeA( + dynamic_energy_balance=true, + dynamic_mass_balance=true, + steady_state=false, + P0=2000000, + h0=2600e3)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo new file mode 100644 index 00000000..72e57825 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH_Traces_FlueGases + extends TestRefH( + redeclare package Medium = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}), + volumeA( + dynamic_energy_balance=true, + dynamic_mass_balance=true, + dynamic_composition_balance=true, + steady_state=true, + P0=2000000, + h0=2600e3, + X0={0.1,0.2,0.3,0.2,0.2})); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order index d731fabb..1cb5ba44 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -1,6 +1,9 @@ TestRefQ TestRefQ_Traces TestRefQ_Traces_FlueGases +TestRefH +TestRefH_Traces +TestRefH_Traces_FlueGases TestRefP TestRefP_Traces TestRefP_Traces_FlueGases From 3455d6c4245136af7155f214c8e24b547dba1637 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 14:19:52 +0200 Subject: [PATCH 167/213] #125 CHPEngineBarkantineSystem and InternalCombustionEngine --- .../Machines/TestCHPEngineBarkantineSystem.mo | 57 ++++++++++++ .../Machines/TestInternalCombustionEngine.mo | 93 +++++++++++++++++++ .../SimpleExamples/Machines/package.order | 2 + .../Machines/CHPEngineBarkantineSystem.mo | 50 +++++++--- .../Machines/InternalCombustionEngine.mo | 75 ++++++++------- 5 files changed, 227 insertions(+), 50 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo new file mode 100644 index 00000000..4b0c3637 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCHPEngineBarkantineSystem + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium, + P0=300000, + h0=293e3, + option_temperature=false) + annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= + 0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium, + P0=100000, + T0=360) + annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.Machines.CHPEngineBarkantineSystem CHPBarkantine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,0},{20,60}}, rotation=0))); +equation + connect(SourceP1.C, CHPBarkantine.inletWaterSteam) annotation (Line(points={{ + -80,30},{-50,30},{-50,45},{-40,45}}, color={0,0,0})); + connect(CHPBarkantine.outletWaterSteam, PuitsP1.C) + annotation (Line(points={{20,45},{30,45},{30,30},{60,30}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2})), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end TestCHPEngineBarkantineSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo new file mode 100644 index 00000000..3a722f76 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo @@ -0,0 +1,93 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestInternalCombustionEngine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( + Hum=0, + Xh=0.25, + Xs=0, + Xashes=0, + Xc=0.75, + Xo=0, + Xn=0, + Q0=0.0676, + rho=0.744, + LHV=50e6, + T0(displayUnit="K") = 299, + P0=210300, + Vol=1) + annotation (Placement(transformation(extent={{-106,-81},{-72,-43}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=1.9627, + T0=30 + 273.16, + option_temperature=true, + X0={0.765,0.23,0.005,0,0}, + P0=191000) + annotation (Placement(transformation(extent={{111,-79},{73,-45}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium_FlueGases, + option_temperature=true) + annotation (Placement(transformation(extent={{0,44},{44,86}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWater( + redeclare package Medium = Medium, + Q0=15.3, + h0=334.41e3, + P0=410000) + annotation (Placement(transformation(extent={{-107,-19},{-71,15}}, rotation=0))); + ThermoSysPro.Fluid.Machines.InternalCombustionEngine internalCombustionEngine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + mechanical_efficiency_type=2, + Rmeca_nom=0.41, + Coef_Rm_a=-5.4727e-9, + Coef_Rm_b=4.9359e-5, + Coef_Rm_c=0.30814, + Xpth=0.05, + MMg=20, + DPe=1, + RV=6.45, + Kc=1.28, + Kd=1.33, + Wmeca(start=1400e3), + Welec(start=1358e3), + Wcomb(start=3.4942e6), + exc(start=1.8), + Gamma=1.2085, + Tsf(start=1088.15)) + annotation (Placement(transformation(extent={{-44,-46},{44,42}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWater(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{75,-19},{111,15}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss waterPressureLossIn( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-63,-8},{-51,4}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss waterPressureLossOut( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{51,-9},{65,5}}))); +equation + connect(internalCombustionEngine.Cair, sourceAir.C) annotation (Line( + points={{0,-41.6},{0,-62},{73,-62}}, + color={0,0,0}, + thickness=1)); + connect(internalCombustionEngine.Cfuel, fuelSourcePQ.C) annotation (Line( + points={{-30.8,-41.6},{-30.8,-62},{-72,-62}}, color={0,0,0})); + connect(sourceWater.C, waterPressureLossIn.C1) + annotation (Line(points={{-71,-2},{-63,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cws1, waterPressureLossIn.C2) annotation ( + Line(points={{-39.6,-2},{-51,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cws2, waterPressureLossOut.C1) + annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255})); + connect(sinkWater.C, waterPressureLossOut.C2) + annotation (Line(points={{75,-2},{65,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cfg, sink.C) annotation (Line( + points={{0,37.6},{0,65}}, + color={0,0,0}, + thickness=1)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestInternalCombustionEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 91f27a61..45bab71a 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -8,6 +8,8 @@ TestCentrifugalPump_FlueGases TestCentrifugalPump_Traces TestCombustionTurbine TestCombustionTurbine_Traces +TestInternalCombustionEngine +TestCHPEngineBarkantineSystem TestCompressor TestCompressor_Traces TestStaticFan diff --git a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo index d85c728e..d33e1844 100644 --- a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo +++ b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo @@ -1,5 +1,8 @@ within ThermoSysPro.Fluid.Machines; model CHPEngineBarkantineSystem + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.Temperature Tair=300 "Inlet air temperature"; parameter Real RechFumEff=0.73 "Flue gases heater efficiency"; parameter Real RechWaterEff=0.9 "Water heater efficiency"; @@ -27,11 +30,14 @@ model CHPEngineBarkantineSystem Vol=1) annotation (Placement(transformation(extent={{62,-26},{38,-2}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ WaterSource( + redeclare package Medium = Medium, h0=293e3, Q0=11.8, P0=300000) annotation (Placement(transformation(extent={{62,-46},{40,-24}}, rotation=0))); ThermoSysPro.Fluid.Machines.InternalCombustionEngine Engine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, DPe=1, MMg=20, Kd=1.33, @@ -50,25 +56,37 @@ model CHPEngineBarkantineSystem rotation=90))); ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff ExchangerWaterWater( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, EffEch=RechWaterEff, exchanger_type=3, Kf=50) annotation (Placement(transformation( origin={0,-66}, extent={{14,14},{-14,-14}}, rotation=270))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC1(L=0.0001) + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC1( + redeclare package Medium = Medium, + L=0.0001) annotation (Placement(transformation( origin={-60,-10}, extent={{10,-10},{-10,10}}, rotation=90))); - ThermoSysPro.Fluid.BoundaryConditions.Sink WaterSteamSink annotation ( + ThermoSysPro.Fluid.BoundaryConditions.Sink WaterSteamSink( + redeclare package Medium = Medium, + option_temperature=true, + T0=320) annotation ( Placement(transformation(extent={{-22,-72},{-44,-48}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC2(L=0.0001) + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC2( + redeclare package Medium = Medium, + L=0.0001) annotation (Placement(transformation( origin={-80,-10}, extent={{10,-10},{-10,10}}, rotation=270))); ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff - ExchangerWaterFlueGases( EffEch=RechFumEff, + ExchangerWaterFlueGases( + redeclare package Medium_c = Medium_FlueGases, + redeclare package Medium_f = Medium, + EffEch=RechFumEff, exchanger_type=3, Kf=50, DTfroid=283.15, @@ -77,24 +95,28 @@ model CHPEngineBarkantineSystem origin={0,68}, extent={{-14,-14},{14,14}}, rotation=90))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss silencieux(K=20) + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss silencieux( + redeclare package Medium = Medium_FlueGases, + K=20) annotation (Placement(transformation( origin={-39,16}, extent={{10,-9},{-10,9}}, rotation=270))); - Interfaces.Connectors.FluidOutlet outletWaterSteam annotation (Placement( + Interfaces.Connectors.FluidOutlet outletWaterSteam(redeclare package Medium = + Medium) annotation (Placement( transformation(extent={{180,80},{220,120}}, rotation=0))); - Interfaces.Connectors.FluidInlet inletWaterSteam annotation (Placement( + Interfaces.Connectors.FluidInlet inletWaterSteam(redeclare package Medium = + Medium) annotation (Placement( transformation(extent={{-220,80},{-180,120}}, rotation=0))); - BoundaryConditions.Sink FlueGasesSink annotation (Placement(transformation( - extent={{-56,86},{-80,110}}, rotation=0))); + BoundaryConditions.Sink FlueGasesSink( + redeclare package Medium = Medium_FlueGases, + option_temperature=true, + T0=400) annotation (Placement(transformation(extent={{-56,86},{-80,110}}, + rotation=0))); BoundaryConditions.SourcePQ AirSource( - Xco2=0, - Xh2o=0.005, - Xo2=0.23, - Xso2=0, + redeclare package Medium = Medium_FlueGases, + X0={0.765,0.23,0.005,0,0}, h0=40000, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature=true, P0=160000) annotation (Placement(transformation(extent={{64,2},{40,26}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo index ec4904c5..fc4ec8ca 100644 --- a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo +++ b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo @@ -1,10 +1,9 @@ within ThermoSysPro.Fluid.Machines; model InternalCombustionEngine "Internal combustion engine with electrical output" - extends - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Integer mechanical_efficiency_type=1 "1: fixed nominal efficiency - 2: Linear efficiency using Coef_Rm_a, Coef_Rm_b and Coef_Rm_c - 3: Beau de Rochas cycle efficiency"; parameter Real Rmeca_nom=0.40 "Fixed nominal mechanical efficiency (active if mechanical_efficiency_type=1)"; @@ -36,6 +35,11 @@ protected constant Real amCO2=amC+2*amO "CO2 molecular mass"; constant Real amH2O=2*amH+amO "H2O molecular mass"; constant Real amSO2=amS+2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; @@ -109,7 +113,6 @@ public "Water specific enthalpy at the outlet"; Real MMairgaz(start=30) "Air/gas mixture molecular mass (g/mol)"; Real MMfumees(start=30) "Flue gases molecular mass (g/mol)"; - FluidType fluids[2] "Fluids mixing in volume"; Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy"; Units.SI.Power Jair "Thermal power diffusion from inlet Cair"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -118,38 +121,36 @@ public Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg"; Real rair "Value of r(Q/gamma) for inlet Cair"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws=Integer(ftype_ws) "Water/steam fluid number"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; public ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cair "Air inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cair(redeclare package Medium = Medium_FlueGases) "Air inlet" annotation ( Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" annotation ( Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 "Water inlet" + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) "Water inlet" annotation ( Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) "Water/steam outlet" annotation ( Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); equation - /* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cair.ftype; - - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other"); + assert(Medium_FlueGases.nX > 1, "InternalCombustionEngine: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "InternalCombustionEngine: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); // ---------------- // Water/steam side - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam"); - Cws1.Q = Cws2.Q; Cws1.h_vol_1 = Cws2.h_vol_1; @@ -161,14 +162,10 @@ equation Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); - Cws1.ftype = Cws2.ftype; - - Cws1.Xco2 = Cws2.Xco2; - Cws1.Xh2o = Cws2.Xh2o; - Cws1.Xo2 = Cws2.Xo2; - Cws1.Xso2 = Cws2.Xso2; - - ftype_ws = Cws1.ftype; + Cws1.Xi = Cws2.Xi; + Cws1.SubC = Cws2.SubC; + Xws = Cws1.Xi; + SubCws = Cws1.SubC; Qe = Cws1.Q; Hev = Cws1.h; @@ -194,10 +191,14 @@ equation Pea = Cair.P; Hea = Cair.h; /***/ - XeaCO2 = Cair.Xco2; - XeaH2O = Cair.Xh2o; - XeaO2 = Cair.Xo2; - XeaSO2 = Cair.Xso2; + Xea[1:Medium_FlueGases.nXi] = Cair.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Cair.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; /* Flue gases outlet */ Qsf = Cfg.Q; @@ -229,12 +230,14 @@ equation 0 = Qea*XeaO2 - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - XsfO2*Qsf; 0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - XsfSO2*Qsf; - Cfg.ftype = ftype; - - Cfg.Xco2 = XsfCO2; - Cfg.Xh2o = XsfH2O; - Cfg.Xo2 = XsfO2; - Cfg.Xso2 = XsfSO2; + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Cair.SubC; + SubCfg = Cfg.SubC; /* No flow reversal */ Cfg.h = Cfg.h_vol_1; From 257ce97433140aedc4acb1192a1e30f49ec218d3 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 14:28:43 +0200 Subject: [PATCH 168/213] #125 GasTurbine --- .../SimpleExamples/Machines/TestGasTurbine.mo | 120 ++++++++++++++++++ .../SimpleExamples/Machines/package.order | 1 + ThermoSysPro/Fluid/Machines/GasTurbine.mo | 19 ++- 3 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo new file mode 100644 index 00000000..1d20227f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo @@ -0,0 +1,120 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestGasTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium_FlueGases, + P0=1.013e5, + Q0=600, + T0=29.4 + 273.16, + option_temperature=true, + X0={1 - 0.20994,0.20994,0,0,0}) + annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante humidity(k=0.93) + annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe fuel( + Starttime=200, + Duration=800, + Initialvalue=13.507, + Finalvalue=8.756) + annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe air( + Starttime=200, + Duration=800, + Initialvalue=592.7, + Finalvalue=415.70) + annotation (Placement(transformation(extent={{-98,0},{-78,20}}))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( + Q0=13.4368286133, + T0=185 + 273.16, + LHV=46989e3, + Cp=2255, + Xc=0.755, + Xh=0.245, + rho=0.838) + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ water( + redeclare package Medium = Medium, + Q0=0) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + ThermoSysPro.Fluid.Machines.GasTurbine gasTurbine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + comp_tau_n=14.0178, + comp_eff_n=0.87004, + exp_tau_n=0.06458, + exp_eff_n=0.89045, + TurbQred=0.0175634, + Kcham=2.02088, + Wpth=1e6, + Compresseur( + Ps(start=1404200.0), + He(start=2.5525e6), + Hs(start=3.008e6), + His(start=2.95e6), + Te(start=302.56000000000006), + Tis(start=630.0), + Ts(start=729.0)), + TurbineAgaz( + He(start=4.0e6), + Hs(start=3.24e6), + His(start=3.1e6), + Tis(start=847.0)), + chambreCombustionTAC( + Psf(start=1310000.0), + Tea(start=729.0), + Hsf(start=4.0e6), + Tsf(start=1532.57)), + xAIR( + T(start=302.56000000000006), + ppvap0(start=4104.0), + rho_air(start=1.0836), + rho_vap(start=0.029))) + annotation (Placement(transformation(extent={{-30,-28},{30,28}}))); +equation + connect(air.y, sourcePQ.IMassFlow) + annotation (Line(points={{-77,10},{-60,10},{-60,5}}, color={0,0,255})); + connect(humidity.y, gasTurbine.Huminide) annotation (Line(points={{-79,40},{ + -60,40},{-60,16.8},{-31.2,16.8}},color={0,0,255})); + connect(fuel.y, fuelSourcePQ.IMassFlow) + annotation (Line(points={{-19,70},{-10,70},{-10,55}}, + color={0,0,255})); + connect(sourcePQ.C, gasTurbine.Entree_air) annotation (Line(points={{-50,0},{ + -32,0},{-32,3.55271e-015},{-30,3.55271e-015}}, color={0,0,0})); + connect(fuelSourcePQ.C, gasTurbine.Entree_combustible) + annotation (Line(points={{0,50},{18,50},{18,28}}, color={0,0,0})); + connect(water.C, gasTurbine.Entree_eau_combustion) + annotation (Line(points={{-40,50},{-18,50},{-18,28}}, color={0,0,0})); + connect(gasTurbine.Sortie_fumees, sink.C) + annotation (Line(points={{30,3.55271e-015},{46,3.55271e-015},{46,0},{60,0}}, + color={0,0,0})); + annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +"), + experiment(StopTime=1200)); +end TestGasTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index 45bab71a..e900b238 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -8,6 +8,7 @@ TestCentrifugalPump_FlueGases TestCentrifugalPump_Traces TestCombustionTurbine TestCombustionTurbine_Traces +TestGasTurbine TestInternalCombustionEngine TestCHPEngineBarkantineSystem TestCompressor diff --git a/ThermoSysPro/Fluid/Machines/GasTurbine.mo b/ThermoSysPro/Fluid/Machines/GasTurbine.mo index 25231cb2..195b6d16 100644 --- a/ThermoSysPro/Fluid/Machines/GasTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/GasTurbine.mo @@ -1,5 +1,8 @@ within ThermoSysPro.Fluid.Machines; model GasTurbine "Combustion turbine for CICO and Barilla plants" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Real comp_tau_n=15 "Nominal compression nominal rate"; parameter Real comp_eff_n=0.9 "Compressor nominal efficiency"; parameter Real A0=0.1725914; @@ -16,12 +19,14 @@ model GasTurbine "Combustion turbine for CICO and Barilla plants" parameter Real Kcham=1 "Chamber pressure loss coefficient"; parameter Units.SI.Power Wpth=1e5 "Combustion chamber thermal losses"; - ThermoSysPro.Fluid.BoundaryConditions.AirHumidity xAIR + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity xAIR( + redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation( origin={-84,30}, extent={{-10,-10},{10,10}}, rotation=270))); ThermoSysPro.Fluid.Machines.Compressor Compresseur( + redeclare package Medium = Medium_FlueGases, A4=A4, A3=A3, A2=A2, @@ -31,6 +36,8 @@ model GasTurbine "Combustion turbine for CICO and Barilla plants" is_eff_n=comp_eff_n) annotation (Placement(transformation( extent={{-82,-28},{-32,28}}, rotation=0))); ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber chambreCombustionTAC( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, Acham=1, eta_comb=1, kcham=Kcham, @@ -42,6 +49,7 @@ model GasTurbine "Combustion turbine for CICO and Barilla plants" Tsf(start=1495)) annotation (Placement(transformation(extent={{-25,31},{ 25,83}}, rotation=0))); ThermoSysPro.Fluid.Machines.CombustionTurbine TurbineAgaz( + redeclare package Medium = Medium_FlueGases, Te(start=1495), Pe(start=13.2e5), A2=B2, @@ -54,11 +62,14 @@ model GasTurbine "Combustion turbine for CICO and Barilla plants" Ts(start=894.518, fixed=false)) annotation (Placement(transformation(extent= {{47,-22},{79,22}}, rotation=0))); - Interfaces.Connectors.FluidInlet Entree_air annotation (Placement( + Interfaces.Connectors.FluidInlet Entree_air(redeclare package Medium = + Medium_FlueGases) annotation (Placement( transformation(extent={{-104,-4},{-96,4}}, rotation=0))); - Interfaces.Connectors.FluidOutlet Sortie_fumees annotation (Placement( + Interfaces.Connectors.FluidOutlet Sortie_fumees(redeclare package Medium = + Medium_FlueGases) annotation (Placement( transformation(extent={{96,-4},{104,4}}, rotation=0))); - Interfaces.Connectors.FluidInlet Entree_eau_combustion annotation (Placement( + Interfaces.Connectors.FluidInlet Entree_eau_combustion(redeclare package + Medium = Medium) annotation (Placement( transformation(extent={{-64,96},{-56,104}}, rotation=0))); Interfaces.Connectors.FuelInlet Entree_combustible annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0))); From bed2e266f3aaa1b5681ce9546060fc44c249fd49 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 14:43:58 +0200 Subject: [PATCH 169/213] #125 C3H3F5 media --- .../Properties/Media/C3H3F5/package.mo | 609 ++++++++++++++++++ .../Properties/Media/C3H3F5/package.order | 59 ++ ThermoSysPro/Properties/Media/package.order | 1 + 3 files changed, 669 insertions(+) create mode 100644 ThermoSysPro/Properties/Media/C3H3F5/package.mo create mode 100644 ThermoSysPro/Properties/Media/C3H3F5/package.order diff --git a/ThermoSysPro/Properties/Media/C3H3F5/package.mo b/ThermoSysPro/Properties/Media/C3H3F5/package.mo new file mode 100644 index 00000000..a4fbfc64 --- /dev/null +++ b/ThermoSysPro/Properties/Media/C3H3F5/package.mo @@ -0,0 +1,609 @@ +within ThermoSysPro.Properties.Media; +package C3H3F5 "C3H3F5 medium using the legacy ThermoSysPro property functions" + + extends PartialTwoPhaseThermoSysProMedium( + isCompressible=true, + mediumName="C3H3F5", + substanceNames={"C3H3F5"}, + singleState=false, + SpecificEnthalpy(start=3.0e5, nominal=3.0e5, min=h_min, max=h_max), + Density(start=1000, nominal=1000), + AbsolutePressure(start=10e5, nominal=10e5, min=p_min, max=p_crit), + Temperature(start=300, nominal=300), + smoothModel=false, + onePhase=false, + fluidConstants={c3h3f5Constants}, + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant AbsolutePressure p_min=1 "Lower pressure bound of the legacy fit"; + constant AbsolutePressure p_crit=3640000 "Critical pressure used by the legacy fit"; + constant SpecificEnthalpy h_min=100000 "Lower enthalpy bound of the legacy fit"; + constant SpecificEnthalpy h_max=640000 "Upper enthalpy bound of the legacy fit"; + constant Temperature T_min=200 "Lower temperature search bound"; + constant Temperature T_max=6000 "Upper temperature search bound"; + + constant FluidConstants c3h3f5Constants( + iupacName="C3H3F5", + casRegistryNumber="", + chemicalFormula="C3H3F5", + structureFormula="", + molarMass=0.134047); + + redeclare record extends SaturationProperties + end SaturationProperties; + + redeclare record extends ThermodynamicState "Thermodynamic state" + SpecificEnthalpy h "Specific enthalpy"; + Density d "Density"; + Temperature T "Temperature"; + AbsolutePressure p "Pressure"; + end ThermodynamicState; + +protected + function saturationTemperature_p + input AbsolutePressure p "Pressure"; + output Temperature T "Saturation temperature"; + protected + AbsolutePressure Pcalc; + algorithm + if p > p_crit then + Pcalc := p_crit/100000; + elseif p <= 0 then + Pcalc := 1/100000; + else + Pcalc := p/100000; + end if; + + T := -0.0000033655*Pcalc^6 + 0.0004044854*Pcalc^5 - 0.0190328128*Pcalc^4 + + 0.4443722095*Pcalc^3 - 5.4337547883*Pcalc^2 + + 36.7572359309*Pcalc + 246.4280421048; + annotation (Inline=true); + end saturationTemperature_p; + + function temperatureResidual_h + extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, u); + y := pro.T - T; + end temperatureResidual_h; + + function saturationPressureResidual_p + extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction; + input Temperature T "Saturation temperature"; + algorithm + y := saturationTemperature_p(u) - T; + end saturationPressureResidual_p; + +public + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + "Base properties of C3H3F5" + Integer phase( + min=0, + max=2, + start=1, + fixed=false) "2 for two-phase, 1 for one-phase, 0 if not known"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + equation + pro = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + MM = fluidConstants[1].molarMass; + R_s = Modelica.Constants.R/fluidConstants[1].molarMass; + + phase = if pro.x > 0 and pro.x < 1 then 2 else 1; + sat = setSat_p(p); + state = ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=phase); + + T = pro.T; + d = pro.d; + u = h - p/d; + end BaseProperties; + + redeclare function density_ph + "Computes density as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + d := pro.d; + annotation (Inline=true); + end density_ph; + + redeclare function temperature_ph + "Computes temperature as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + T := pro.T; + annotation (Inline=true); + end temperature_ph; + + redeclare function extends setState_phX + "Return thermodynamic state as function of p and h" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_psX + "Return thermodynamic state as function of p and s" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + state := ThermodynamicState( + p=p, + h=pro.h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_psX; + + redeclare function specificEnthalpy_pT + "Compute specific enthalpy from p and T by inverting the legacy C3H3F5_Ph fit" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output SpecificEnthalpy h "Specific enthalpy"; + protected + Temperature Tlow; + Temperature Thigh; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proLow; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proHigh; + algorithm + proLow := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h_min); + proHigh := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h_max); + Tlow := proLow.T; + Thigh := proHigh.T; + + if T <= Tlow then + h := h_min; + elseif T >= Thigh then + h := h_max; + else + h := Modelica.Math.Nonlinear.solveOneNonlinearEquation( + function temperatureResidual_h(p=p, T=T), + h_min, + h_max); + end if; + end specificEnthalpy_pT; + + redeclare function specificEnthalpy_pTX + "Return specific enthalpy from pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input MassFraction X[:] "Mass fractions"; + input FixedPhase phase=0 + "2 for two-phase, 1 for one-phase, 0 if not known"; + output SpecificEnthalpy h "Specific enthalpy at p, T, X"; + algorithm + h := specificEnthalpy_pT(p, T, phase); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function density_pT + "Computes density as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Density d "Density"; + algorithm + d := density_ph(p, specificEnthalpy_pT(p, T, phase), phase); + annotation (Inline=true); + end density_pT; + + redeclare function extends setState_pTX + "Return thermodynamic state as function of p and T" + protected + SpecificEnthalpy h; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + h := specificEnthalpy_pT(p, T, phase); + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_dTX + "Return thermodynamic state as function of d and T" + algorithm + assert(false, "C3H3F5: setState_dTX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=p_min, + h=h_min, + T=T, + d=d, + phase=phase); + end setState_dTX; + + redeclare function extends setSmoothState + "Return a smooth thermodynamic state" + import Modelica.Media.Common.smoothStep; + algorithm + state := ThermodynamicState( + p=smoothStep(x, state_a.p, state_b.p, x_small), + h=smoothStep(x, state_a.h, state_b.h, x_small), + T=temperature_ph( + smoothStep(x, state_a.p, state_b.p, x_small), + smoothStep(x, state_a.h, state_b.h, x_small)), + d=density_ph( + smoothStep(x, state_a.p, state_b.p, x_small), + smoothStep(x, state_a.h, state_b.h, x_small)), + phase=0); + annotation (Inline=true); + end setSmoothState; + + redeclare function temperature_ps + "Compute temperature from pressure and specific entropy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + T := pro.T; + annotation (Inline=true); + end temperature_ps; + + redeclare function density_ps + "Computes density as a function of pressure and specific entropy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + d := pro.d; + annotation (Inline=true); + end density_ps; + + redeclare function extends pressure "Return pressure" + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature "Return temperature" + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density "Return density" + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy "Return specific enthalpy" + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + "Return specific internal energy" + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy "Specific entropy" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(state.p, state.h); + s := pro.s; + annotation (Inline=true); + end specificEntropy; + + redeclare function extends specificGibbsEnergy "Return specific Gibbs energy" + algorithm + g := state.h - state.T*specificEntropy(state); + annotation (Inline=true); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + "Return specific Helmholtz energy" + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + annotation (Inline=true); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + "Approximate specific heat capacity at constant pressure" + protected + constant Temperature dT=0.1; + algorithm + cp := (specificEnthalpy_pT(state.p, state.T + dT) - specificEnthalpy_pT(state.p, state.T - dT))/(2*dT); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + "Approximate specific heat capacity at constant volume" + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends velocityOfSound + "Velocity of sound is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy "Compute h(s,p)" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p_downstream, specificEntropy(refState)); + h_is := pro.h; + annotation (Inline=true); + end isentropicEnthalpy; + + redeclare function extends dynamicViscosity + "Dynamic viscosity is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: dynamicViscosity is not available in the legacy ThermoSysPro implementation"); + eta := 0; + end dynamicViscosity; + + redeclare function extends thermalConductivity + "Thermal conductivity is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: thermalConductivity is not available in the legacy ThermoSysPro implementation"); + lambda := 0; + end thermalConductivity; + + redeclare function extends surfaceTension + "Surface tension is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: surfaceTension is not available in the legacy ThermoSysPro implementation"); + sigma := 0; + end surfaceTension; + + redeclare function extends saturationTemperature + "Saturation temperature" + algorithm + T := saturationTemperature_p(p); + annotation (Inline=true); + end saturationTemperature; + + redeclare function extends saturationTemperature_derp + "Derivative of saturation temperature w.r.t. pressure" + protected + constant AbsolutePressure dp=1; + algorithm + dTp := (saturationTemperature_p(p + dp) - saturationTemperature_p(p - dp))/(2*dp); + annotation (Inline=true); + end saturationTemperature_derp; + + redeclare function extends saturationPressure + "Saturation pressure" + protected + Temperature Tlow; + Temperature Thigh; + algorithm + Tlow := saturationTemperature_p(p_min); + Thigh := saturationTemperature_p(p_crit); + + if T <= Tlow then + p := p_min; + elseif T >= Thigh then + p := p_crit; + else + p := Modelica.Math.Nonlinear.solveOneNonlinearEquation( + function saturationPressureResidual_p(T=T), + p_min, + p_crit); + end if; + end saturationPressure; + + redeclare function setSat_p + "Return saturation properties from pressure" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + output SaturationProperties sat "Saturation property record"; + algorithm + sat := SaturationProperties( + psat=p, + Tsat=saturationTemperature_p(p)); + annotation (Inline=true); + end setSat_p; + + redeclare function setSat_T + "Return saturation properties from temperature" + extends Modelica.Icons.Function; + input Temperature T "Temperature"; + output SaturationProperties sat "Saturation property record"; + algorithm + sat := SaturationProperties( + psat=saturationPressure(T), + Tsat=T); + annotation (Inline=true); + end setSat_T; + + redeclare function extends bubbleEnthalpy + "Boiling curve specific enthalpy" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + hl := 1000*(-0.0000039275*Pcalc^6 + 0.0004780040*Pcalc^5 + - 0.0227439765*Pcalc^4 + 0.5370471515*Pcalc^3 + - 6.6496487588*Pcalc^2 + 46.8685173786*Pcalc + + 166.7823742593); + annotation (Inline=true); + end bubbleEnthalpy; + + redeclare function extends dewEnthalpy + "Dew curve specific enthalpy" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + hv := 1000*(-0.00000274*Pcalc^6 + 0.00032217*Pcalc^5 + - 0.01489673*Pcalc^4 + 0.34258030*Pcalc^3 + - 4.15381744*Pcalc^2 + 27.64876596*Pcalc + + 385.22149853); + annotation (Inline=true); + end dewEnthalpy; + + redeclare function extends bubbleDensity + "Boiling curve density" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + dl := 0.0000057803*Pcalc^6 - 0.0007528646*Pcalc^5 + + 0.0377373800*Pcalc^4 - 0.9314090824*Pcalc^3 + + 11.9184348938*Pcalc^2 - 89.9582798898*Pcalc + + 1467.5902188299; + annotation (Inline=true); + end bubbleDensity; + + redeclare function extends dewDensity + "Dew curve density" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + dv := 0.00000207*Pcalc^6 - 0.00019163*Pcalc^5 + + 0.00675913*Pcalc^4 - 0.10924667*Pcalc^3 + + 0.84661954*Pcalc^2 + 2.83415571*Pcalc + + 2.12959146; + annotation (Inline=true); + end dewDensity; + + redeclare function extends bubbleEntropy + "Boiling curve specific entropy" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(sat.psat, bubbleEnthalpy(sat)); + sl := pro.s; + annotation (Inline=true); + end bubbleEntropy; + + redeclare function extends dewEntropy + "Dew curve specific entropy" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(sat.psat, dewEnthalpy(sat)); + sv := pro.s; + annotation (Inline=true); + end dewEntropy; + + redeclare function extends setBubbleState + "Set the thermodynamic state on the bubble line" + algorithm + state := setState_phX(sat.psat, bubbleEnthalpy(sat), fill(0, 0), phase); + annotation (Inline=true); + end setBubbleState; + + redeclare function extends setDewState + "Set the thermodynamic state on the dew line" + algorithm + state := setState_phX(sat.psat, dewEnthalpy(sat), fill(0, 0), phase); + annotation (Inline=true); + end setDewState; + + redeclare function extends dBubbleDensity_dPressure + "Bubble point density derivative" + algorithm + ddldp := 0; + annotation (Inline=true); + end dBubbleDensity_dPressure; + + redeclare function extends dDewDensity_dPressure + "Dew point density derivative" + algorithm + ddvdp := 0; + annotation (Inline=true); + end dDewDensity_dPressure; + + redeclare function extends dBubbleEnthalpy_dPressure + "Bubble point specific enthalpy derivative" + algorithm + dhldp := 0; + annotation (Inline=true); + end dBubbleEnthalpy_dPressure; + + redeclare function extends dDewEnthalpy_dPressure + "Dew point specific enthalpy derivative" + algorithm + dhvdp := 0; + annotation (Inline=true); + end dDewEnthalpy_dPressure; + + redeclare function extends density_derh_p + "Density derivative by specific enthalpy" + protected + constant SpecificEnthalpy dh=1; + algorithm + ddhp := (density_ph(state.p, state.h + dh) - density_ph(state.p, state.h - dh))/(2*dh); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + "Density derivative by pressure" + protected + constant AbsolutePressure dp=1; + algorithm + ddph := (density_ph(state.p + dp, state.h) - density_ph(state.p - dp, state.h))/(2*dp); + annotation (Inline=true); + end density_derp_h; + + annotation (Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end C3H3F5; diff --git a/ThermoSysPro/Properties/Media/C3H3F5/package.order b/ThermoSysPro/Properties/Media/C3H3F5/package.order new file mode 100644 index 00000000..5018ecc8 --- /dev/null +++ b/ThermoSysPro/Properties/Media/C3H3F5/package.order @@ -0,0 +1,59 @@ +p_min +p_crit +h_min +h_max +T_min +T_max +c3h3f5Constants +SaturationProperties +ThermodynamicState +saturationTemperature_p +temperatureResidual_h +saturationPressureResidual_p +BaseProperties +density_ph +temperature_ph +setState_phX +setState_psX +specificEnthalpy_pT +specificEnthalpy_pTX +density_pT +setState_pTX +setState_dTX +setSmoothState +temperature_ps +density_ps +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +velocityOfSound +isentropicEnthalpy +dynamicViscosity +thermalConductivity +surfaceTension +saturationTemperature +saturationTemperature_derp +saturationPressure +setSat_p +setSat_T +bubbleEnthalpy +dewEnthalpy +bubbleDensity +dewDensity +bubbleEntropy +dewEntropy +setBubbleState +setDewState +dBubbleDensity_dPressure +dDewDensity_dPressure +dBubbleEnthalpy_dPressure +dDewEnthalpy_dPressure +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/package.order b/ThermoSysPro/Properties/Media/package.order index bb249bcc..5d7b2ae9 100644 --- a/ThermoSysPro/Properties/Media/package.order +++ b/ThermoSysPro/Properties/Media/package.order @@ -4,3 +4,4 @@ PartialTwoPhaseThermoSysProMedium Functions WaterSteam FlueGases +C3H3F5 From 62b54a403addc3e947383cdad9f0e2b01924b491 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 14:44:24 +0200 Subject: [PATCH 170/213] #125 HeatPumpCompressor with C3H3F5 --- .../Machines/TestHeatPumpCompressor.mo | 55 +++++++++++++++++++ .../SimpleExamples/Machines/package.order | 1 + .../Fluid/Machines/HeatPumpCompressor.mo | 29 +++------- ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo | 6 ++ 4 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo new file mode 100644 index 00000000..d4210dc3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo @@ -0,0 +1,55 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestHeatPumpCompressor + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.C3H3F5; + + ThermoSysPro.Fluid.Machines.HeatPumpCompressor Compressor( + redeclare package Medium = Medium, + Pe(fixed=false, start=100000), + Ts(fixed=false, start=680)) + annotation (Placement(transformation(extent={{-52,-52},{48,52}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + Q0=420, + h0=3.e5, + T0=288, + option_temperature=false) + annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=1580000, + option_temperature=false) + annotation (Placement(transformation( + origin={96,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(SourceQ1.C, Compressor.C1) + annotation (Line(points={{-84,0},{-52,0}}, color={0,0,0})); + connect(SinkP1.C, Compressor.C2) + annotation (Line(points={{86,0},{48,0}}, color={0,0,0})); + annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end TestHeatPumpCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order index e900b238..a20912f4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -9,6 +9,7 @@ TestCentrifugalPump_Traces TestCombustionTurbine TestCombustionTurbine_Traces TestGasTurbine +TestHeatPumpCompressor TestInternalCombustionEngine TestCHPEngineBarkantineSystem TestCompressor diff --git a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo index 12505323..85622e51 100644 --- a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo +++ b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo @@ -1,7 +1,7 @@ within ThermoSysPro.Fluid.Machines; model HeatPumpCompressor "Heat pump compressor " - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + replaceable package Medium = ThermoSysPro.Properties.Media.C3H3F5 constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium + "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real pi=10.0 "Compression factor (Ps/Pe)"; parameter Real eta=0.85 "Isentropic efficiency"; @@ -20,12 +20,10 @@ public Units.SI.Temperature Te "Inlet temperature"; Units.SI.Temperature Ts "Outlet temperature"; Real xm(start=1.0) "Average vapor mass fraction"; - FluidType ftype "Fluid type"; - Integer fluid=Integer(ftype) "Fluid number"; - Interfaces.Connectors.FluidInlet C1 annotation (Placement(transformation( + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-110,-10},{-90,10}}, rotation=0))); - Interfaces.Connectors.FluidOutlet C2 annotation (Placement(transformation( + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); public ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe @@ -38,9 +36,6 @@ public rotation=0))); equation - /* Check that the fluid type is C3H3F5 */ - assert(ftype == FluidType.C3H3F5, "HeatPumpCompressor: the fluid type must be C3H3F5"); - C1.Q = C2.Q; C1.h_vol_1 = C2.h_vol_1; @@ -52,19 +47,13 @@ equation C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + C1.SubC = C2.SubC; + C1.Xi = C2.Xi; Q = C1.Q; Pe = C1.P; Ps = C2.P; - ftype = C1.ftype; - /* Mechnical power delivered to the compressor */ W = Q*(C2.h - C1.h) / (1 - W_fric/100); @@ -78,15 +67,15 @@ equation His - C1.h = max(xm, 0.01)*eta*(C2.h - C1.h); /* Fluid thermodynamic properties before the compression */ - proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, 0, fluid); + proe = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(Pe, C1.h); Te = proe.T; /* Fluid thermodynamic properties after the compression */ - pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, 0, fluid); + pros = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(Ps, C2.h); Ts = pros.T; /* Fluid thermodynamic properties after the identropic compression */ - props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, 0, fluid); + props = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(Ps, proe.s); His = props.h; annotation ( diff --git a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo index b5604d5c..fe52301e 100644 --- a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo +++ b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo @@ -119,6 +119,12 @@ algorithm pro.s := ssatV; end if; end if; + pro.u := h - P/pro.d; + pro.cp := 1000; + pro.ddhp := 0; + pro.ddph := 0; + pro.duph := 0; + pro.duhp := 1; annotation ( smoothOrder = 2, Documentation(info=" From 24ceb03a234a2011e5cb2b04a9d1868804811234 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 20:16:37 +0200 Subject: [PATCH 171/213] #125 modif C3H3F5 so that closer to old implementation, and Oil Medium --- .../SimpleExamples/Media/TestC3H3F5.mo | 41 +++ .../SimpleExamples/Media/package.order | 1 + .../Fluid/Machines/HeatPumpCompressor.mo | 26 +- ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo | 6 - .../Properties/Media/C3H3F5/package.mo | 8 +- .../Media/Oil_TherminolVP1/package.mo | 233 ++++++++++++++++++ .../Media/Oil_TherminolVP1/package.order | 28 +++ ThermoSysPro/Properties/Media/package.order | 1 + 8 files changed, 317 insertions(+), 27 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo create mode 100644 ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo create mode 100644 ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo new file mode 100644 index 00000000..bb2e9ecf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestC3H3F5 + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.C3H3F5; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.SpecificEnthalpy h = 3e5; + parameter Units.SI.SpecificEntropy s = 1.5e3; + parameter Medium.ThermodynamicState state_ph = Medium.setState_phX(p, h, {1}); + parameter Medium.ThermodynamicState state_ps = Medium.setState_psX(p, s, {1}); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph legacy_ph = + ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps legacy_ps = + ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state_ph) - legacy_ph.T) < eps, + "C3H3F5 medium temperature_ph differs from legacy C3H3F5_Ph"); + assert(abs(Medium.density(state_ph) - legacy_ph.d) < eps, + "C3H3F5 medium density_ph differs from legacy C3H3F5_Ph"); + assert(abs(Medium.specificEntropy(state_ph) - legacy_ph.s) < eps, + "C3H3F5 medium specificEntropy differs from legacy C3H3F5_Ph"); + assert(abs(Medium.vapourQuality(state_ph) - legacy_ph.x) < 1e-4, + "C3H3F5 medium vapourQuality differs from legacy C3H3F5_Ph"); + + assert(abs(Medium.temperature(state_ps) - legacy_ps.T) < eps, + "C3H3F5 medium temperature_ps differs from legacy C3H3F5_Ps"); + assert(abs(Medium.density(state_ps) - legacy_ps.d) < eps, + "C3H3F5 medium density_ps differs from legacy C3H3F5_Ps"); + assert(abs(Medium.specificEnthalpy(state_ps) - legacy_ps.h) < eps, + "C3H3F5 medium specificEnthalpy_ps differs from legacy C3H3F5_Ps"); + + assert(abs(Medium.specificInternalEnergy(state_ph) - (h - p/legacy_ph.d)) < eps, + "C3H3F5 medium internal energy does not match legacy Fluid assumption u=h-p/d"); + assert(abs(Medium.density_derh_p(state_ph) + 1e6) < eps, + "C3H3F5 medium density_derh_p does not match legacy Fluid assumption"); + assert(abs(Medium.density_derp_h(state_ph) - 1e-8) < eps, + "C3H3F5 medium density_derp_h does not match legacy Fluid assumption"); + annotation (experiment(StopTime=1)); +end TestC3H3F5; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order index ddcc39f2..b3e51986 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order @@ -1,2 +1,3 @@ WaterSteam_NonVolatileTrace WaterSteam_FullyVolatileTrace +TestC3H3F5 diff --git a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo index 85622e51..1f43daea 100644 --- a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo +++ b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo @@ -26,14 +26,10 @@ public Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{90,-10},{110,10}}, rotation=0))); public - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe - annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= - 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros - annotation (Placement(transformation(extent={{80,80},{100,100}}, rotation=0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}, - rotation=0))); + Medium.ThermodynamicState state_e "Fluid thermodynamic state before the compression"; + Medium.ThermodynamicState state_s "Fluid thermodynamic state after the compression"; + Medium.ThermodynamicState state_is + "Fluid thermodynamic state after the isentropic compression"; equation C1.Q = C2.Q; @@ -61,22 +57,22 @@ equation pi = Ps/Pe; /* Average vapor mass fraction */ - xm = (proe.x + pros.x)/2.0; + xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s))/2.0; /* Compression efficiency */ His - C1.h = max(xm, 0.01)*eta*(C2.h - C1.h); /* Fluid thermodynamic properties before the compression */ - proe = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(Pe, C1.h); - Te = proe.T; + state_e = Medium.setState_phX(Pe, C1.h, C1.Xi); + Te = Medium.temperature(state_e); /* Fluid thermodynamic properties after the compression */ - pros = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(Ps, C2.h); - Ts = pros.T; + state_s = Medium.setState_phX(Ps, C2.h, C2.Xi); + Ts = Medium.temperature(state_s); /* Fluid thermodynamic properties after the identropic compression */ - props = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(Ps, proe.s); - His = props.h; + state_is = Medium.setState_psX(Ps, Medium.specificEntropy(state_e), C1.Xi); + His = Medium.specificEnthalpy(state_is); annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo index fe52301e..b5604d5c 100644 --- a/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo +++ b/ThermoSysPro/Properties/C3H3F5/C3H3F5_Ph.mo @@ -119,12 +119,6 @@ algorithm pro.s := ssatV; end if; end if; - pro.u := h - P/pro.d; - pro.cp := 1000; - pro.ddhp := 0; - pro.ddph := 0; - pro.duph := 0; - pro.duhp := 1; annotation ( smoothOrder = 2, Documentation(info=" diff --git a/ThermoSysPro/Properties/Media/C3H3F5/package.mo b/ThermoSysPro/Properties/Media/C3H3F5/package.mo index a4fbfc64..1f4cef83 100644 --- a/ThermoSysPro/Properties/Media/C3H3F5/package.mo +++ b/ThermoSysPro/Properties/Media/C3H3F5/package.mo @@ -586,19 +586,15 @@ public redeclare function extends density_derh_p "Density derivative by specific enthalpy" - protected - constant SpecificEnthalpy dh=1; algorithm - ddhp := (density_ph(state.p, state.h + dh) - density_ph(state.p, state.h - dh))/(2*dh); + ddhp := -1e6; annotation (Inline=true); end density_derh_p; redeclare function extends density_derp_h "Density derivative by pressure" - protected - constant AbsolutePressure dp=1; algorithm - ddph := (density_ph(state.p + dp, state.h) - density_ph(state.p - dp, state.h))/(2*dp); + ddph := 1e-8; annotation (Inline=true); end density_derp_h; diff --git a/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo new file mode 100644 index 00000000..0266eca6 --- /dev/null +++ b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo @@ -0,0 +1,233 @@ +within ThermoSysPro.Properties.Media; +package Oil_TherminolVP1 "Therminol VP1 oil medium using the legacy ThermoSysPro property functions" + + extends PartialThermoSysProMedium( + isCompressible=false, + mediumName="Oil_TherminolVP1", + substanceNames={"Oil_TherminolVP1"}, + singleState=false, + SpecificEnthalpy(start=3.0e5, nominal=3.0e5), + Density(start=900, nominal=900), + AbsolutePressure(start=1e5, nominal=1e5), + Temperature(start=400, nominal=400), + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant FluidConstants oilConstants( + iupacName="Therminol VP1", + casRegistryNumber="", + chemicalFormula="", + structureFormula="", + molarMass=0.166); + constant FluidConstants fluidConstants[1]={oilConstants}; + + redeclare record extends ThermodynamicState "Thermodynamic state" + SpecificEnthalpy h "Specific enthalpy"; + Density d "Density"; + Temperature T "Temperature"; + AbsolutePressure p "Pressure"; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + "Base properties of Therminol VP1" + equation + T = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h); + d = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T); + u = h - p/d; + MM = fluidConstants[1].molarMass; + R_s = 0; + state = ThermodynamicState(p=p, h=h, T=T, d=d); + end BaseProperties; + + redeclare function extends setState_phX + "Return thermodynamic state from p and h" + algorithm + state := ThermodynamicState( + p=p, + h=h, + T=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h), + d=ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h))); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_pTX + "Return thermodynamic state from p and T" + protected + SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(T); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T)); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_psX + "Return thermodynamic state from p and s" + algorithm + assert(false, "Oil_TherminolVP1: setState_psX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState(p=p, h=0, T=0, d=0); + end setState_psX; + + redeclare function extends setState_dTX + "Return thermodynamic state from d and T" + algorithm + state := ThermodynamicState( + p=reference_p, + h=ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(T), + T=T, + d=d); + annotation (Inline=true); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + algorithm + state := ThermodynamicState( + p=smoothStep(x, state_a.p, state_b.p, x_small), + h=smoothStep(x, state_a.h, state_b.h, x_small), + T=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(smoothStep(x, state_a.h, state_b.h, x_small)), + d=ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(smoothStep(x, state_a.h, state_b.h, x_small)))); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + algorithm + assert(false, "Oil_TherminolVP1: specificEntropy is not available in the legacy ThermoSysPro implementation"); + s := 0; + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + algorithm + cp := ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(state.T); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(state.T); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends velocityOfSound + algorithm + assert(false, "Oil_TherminolVP1: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + assert(false, "Oil_TherminolVP1: isentropicEnthalpy is not available in the legacy ThermoSysPro implementation"); + h_is := refState.h; + end isentropicEnthalpy; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input MassFraction X[:] "Mass fractions"; + output SpecificEnthalpy h "Specific enthalpy"; + algorithm + h := ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(T); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input MassFraction X[:] "Mass fractions"; + output Temperature T "Temperature"; + algorithm + T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input MassFraction X[:] "Mass fractions"; + output Density d "Density"; + algorithm + d := ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h)); + annotation (Inline=true); + end density_phX; + + redeclare function extends density_derh_p + protected + SpecificEnthalpy delta_h=0.01*state.h; + algorithm + ddhp := (ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(state.h + delta_h)) + - ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(state.h - delta_h)))/(2*delta_h); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + algorithm + ddph := 1e-8; + annotation (Inline=true); + end density_derp_h; + + annotation (Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end Oil_TherminolVP1; diff --git a/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order new file mode 100644 index 00000000..9bf6eaa0 --- /dev/null +++ b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order @@ -0,0 +1,28 @@ +oilConstants +fluidConstants +ThermodynamicState +BaseProperties +setState_phX +setState_pTX +setState_psX +setState_dTX +setSmoothState +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +velocityOfSound +isentropicEnthalpy +specificEnthalpy_pTX +temperature_phX +density_phX +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/package.order b/ThermoSysPro/Properties/Media/package.order index 5d7b2ae9..8966d666 100644 --- a/ThermoSysPro/Properties/Media/package.order +++ b/ThermoSysPro/Properties/Media/package.order @@ -5,3 +5,4 @@ Functions WaterSteam FlueGases C3H3F5 +Oil_TherminolVP1 From 6a365f0b2e72e31afb1fb96c99b8bd9512025e38 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 22:39:24 +0200 Subject: [PATCH 172/213] #125 WaterSteamSimple MoltenSalt and DryAirIdealGas --- .../Media/TestDryAirIdealGas.mo | 32 ++ .../SimpleExamples/Media/TestMoltenSalt.mo | 32 ++ .../Media/TestWaterSteamSimple.mo | 35 ++ .../SimpleExamples/Media/package.order | 3 + .../Media/DryAirIdealGas/package.mo | 254 ++++++++++ .../Media/DryAirIdealGas/package.order | 29 ++ .../Properties/Media/MoltenSalt/package.mo | 249 ++++++++++ .../Properties/Media/MoltenSalt/package.order | 28 ++ .../Media/WaterSteamSimple/package.mo | 466 ++++++++++++++++++ .../Media/WaterSteamSimple/package.order | 48 ++ ThermoSysPro/Properties/Media/package.order | 3 + 11 files changed, 1179 insertions(+) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo create mode 100644 ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo create mode 100644 ThermoSysPro/Properties/Media/DryAirIdealGas/package.order create mode 100644 ThermoSysPro/Properties/Media/MoltenSalt/package.mo create mode 100644 ThermoSysPro/Properties/Media/MoltenSalt/package.order create mode 100644 ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo create mode 100644 ThermoSysPro/Properties/Media/WaterSteamSimple/package.order diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo new file mode 100644 index 00000000..6335caae --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestDryAirIdealGas + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.DryAirIdealGas; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.Temperature T = 300; + parameter Units.SI.SpecificEnthalpy h = + ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(p, T, 6, 0, 0, 0, 0, 0); + parameter Medium.ThermodynamicState state = Medium.setState_phX(p, h, {1}); + parameter ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas data; + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state) - + ThermoSysPro.Properties.Fluid.Temperature_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium temperature differs from legacy Fluid wrapper"); + assert(abs(Medium.density(state) - + ThermoSysPro.Properties.Fluid.Density_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density differs from legacy Fluid wrapper"); + assert(abs(Medium.specificEnthalpy_pTX(p, T, {1}) - h) < eps, + "DryAirIdealGas medium specificEnthalpy_pTX differs from legacy Fluid wrapper"); + assert(abs(Medium.specificInternalEnergy(state) - (h - data.specificGasConstant*Medium.temperature(state))) < eps, + "DryAirIdealGas medium internal energy differs from legacy Fluid assumption"); + assert(abs(Medium.density_derh_p(state) - + ThermoSysPro.Properties.Fluid.Density_derh_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density_derh_p differs from legacy Fluid wrapper"); + assert(abs(Medium.density_derp_h(state) - + ThermoSysPro.Properties.Fluid.Density_derp_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density_derp_h differs from legacy Fluid wrapper"); + annotation (experiment(StopTime=1)); +end TestDryAirIdealGas; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo new file mode 100644 index 00000000..c6a355da --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestMoltenSalt + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.MoltenSalt; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.Temperature T = 600; + parameter Units.SI.SpecificEnthalpy h = + ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(p, T, 4, 0, 0, 0, 0, 0); + parameter Medium.ThermodynamicState state = Medium.setState_phX(p, h, {1}); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state) - + ThermoSysPro.Properties.Fluid.Temperature_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium temperature differs from legacy Fluid wrapper"); + assert(abs(Medium.density(state) - + ThermoSysPro.Properties.Fluid.Density_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density differs from legacy Fluid wrapper"); + assert(abs(Medium.specificEnthalpy_pTX(p, T, {1}) - h) < eps, + "MoltenSalt medium specificEnthalpy_pTX differs from legacy Fluid wrapper"); + assert(abs(Medium.specificInternalEnergy(state) - + ThermoSysPro.Properties.Fluid.SpecificInternalEnergy_Ph_DO_NOT_USE(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium internal energy differs from legacy Fluid assumption"); + assert(abs(Medium.density_derh_p(state) - + ThermoSysPro.Properties.Fluid.Density_derh_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density_derh_p differs from legacy Fluid wrapper"); + assert(abs(Medium.density_derp_h(state) - + ThermoSysPro.Properties.Fluid.Density_derp_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density_derp_h differs from legacy Fluid wrapper"); + annotation (experiment(StopTime=1)); +end TestMoltenSalt; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo new file mode 100644 index 00000000..d20ae3ca --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestWaterSteamSimple + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.WaterSteamSimple; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.SpecificEnthalpy h = 3e5; + parameter Units.SI.SpecificEntropy s = 1000; + parameter Medium.ThermodynamicState state_ph = Medium.setState_phX(p, h, {1}); + parameter Medium.ThermodynamicState state_ps = Medium.setState_psX(p, s, {1}); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph legacy_ph = + ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, 0); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps legacy_ps = + ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ps(p, s, 0); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state_ph) - legacy_ph.T) < eps, + "WaterSteamSimple medium temperature_ph differs from legacy SimpleWater"); + assert(abs(Medium.density(state_ph) - legacy_ph.d) < eps, + "WaterSteamSimple medium density_ph differs from legacy SimpleWater"); + assert(abs(Medium.specificEntropy(state_ph) - legacy_ph.s) < eps, + "WaterSteamSimple medium entropy differs from legacy SimpleWater"); + assert(abs(Medium.temperature(state_ps) - legacy_ps.T) < eps, + "WaterSteamSimple medium temperature_ps differs from legacy SimpleWater"); + assert(abs(Medium.density(state_ps) - legacy_ps.d) < eps, + "WaterSteamSimple medium density_ps differs from legacy SimpleWater"); + assert(abs(Medium.specificEnthalpy(state_ps) - legacy_ps.h) < eps, + "WaterSteamSimple medium enthalpy_ps differs from legacy SimpleWater"); + assert(abs(Medium.density_derh_p(state_ph) - legacy_ph.ddhp) < eps, + "WaterSteamSimple medium density_derh_p differs from legacy SimpleWater"); + assert(abs(Medium.density_derp_h(state_ph) - legacy_ph.ddph) < eps, + "WaterSteamSimple medium density_derp_h differs from legacy SimpleWater"); + annotation (experiment(StopTime=1)); +end TestWaterSteamSimple; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order index b3e51986..66036803 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order @@ -1,3 +1,6 @@ WaterSteam_NonVolatileTrace WaterSteam_FullyVolatileTrace TestC3H3F5 +TestMoltenSalt +TestDryAirIdealGas +TestWaterSteamSimple diff --git a/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo new file mode 100644 index 00000000..8b0cc9af --- /dev/null +++ b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo @@ -0,0 +1,254 @@ +within ThermoSysPro.Properties.Media; +package DryAirIdealGas "Dry air ideal gas medium using the legacy ThermoSysPro property functions" + + extends PartialThermoSysProMedium( + isCompressible=true, + mediumName="DryAirIdealGas", + substanceNames={"DryAirIdealGas"}, + singleState=false, + SpecificEnthalpy(start=3e5, nominal=3e5), + Density(start=1, nominal=1), + AbsolutePressure(start=1e5, nominal=1e5), + Temperature(start=300, nominal=300), + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas data; + constant FluidConstants dryAirConstants( + iupacName="Dry air", + casRegistryNumber="", + chemicalFormula="", + structureFormula="", + molarMass=data.molarMass); + constant FluidConstants fluidConstants[1]={dryAirConstants}; + + redeclare record extends ThermodynamicState + SpecificEnthalpy h; + Density d; + Temperature T; + AbsolutePressure p; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + equation + T = ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + d = ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T); + u = h - data.specificGasConstant*T; + MM = fluidConstants[1].molarMass; + R_s = data.specificGasConstant; + state = ThermodynamicState( + p=p, + h=h, + T=T, + d=d); + end BaseProperties; + + redeclare function extends setState_phX + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_pTX + protected + SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_psX + algorithm + assert(false, "DryAirIdealGas: setState_psX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=p, + h=0, + T=0, + d=0); + end setState_psX; + + redeclare function extends setState_dTX + algorithm + state := ThermodynamicState( + p=d*data.specificGasConstant*T, + h=ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T), + T=T, + d=d); + annotation (Inline=true); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + protected + SpecificEnthalpy h; + AbsolutePressure p; + Temperature T; + algorithm + h := smoothStep( + x, + state_a.h, + state_b.h, + x_small); + p := smoothStep( + x, + state_a.p, + state_b.p, + x_small); + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - data.specificGasConstant*state.T; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + algorithm + assert(false, "DryAirIdealGas: specificEntropy is not available in the legacy ThermoSysPro implementation"); + s := 0; + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - data.specificGasConstant*state.T - state.T*specificEntropy(state); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + algorithm + cp := ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(state.T); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state) - data.specificGasConstant; + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(T=state.T, rho=state.d); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.DryAirIdealGas.ThermalConductivity_Trho(T=state.T, rho=state.d); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends velocityOfSound + algorithm + a := sqrt(specificHeatCapacityCp(state)/specificHeatCapacityCv(state)*data.specificGasConstant*state.T); + annotation (Inline=true); + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + assert(false, "DryAirIdealGas: isentropicEnthalpy is not available in the legacy ThermoSysPro implementation"); + h_is := refState.h; + end isentropicEnthalpy; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input Temperature T; + input MassFraction X[:]; + output SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Density d; + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + d := ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T); + annotation (Inline=true); + end density_phX; + + redeclare function extends density_derh_p + protected + SpecificEnthalpy delta_h=0.01*state.h; + algorithm + ddhp := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(state.h + delta_h)) - ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(state.h - delta_h)))/(2*delta_h); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + protected + AbsolutePressure delta_P=0.0001*state.p; + algorithm + ddph := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p + delta_P, T=state.T) - ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p - delta_P, T=state.T))/(2*delta_P); + annotation (Inline=true); + end density_derp_h; +end DryAirIdealGas; diff --git a/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order new file mode 100644 index 00000000..79f7605f --- /dev/null +++ b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order @@ -0,0 +1,29 @@ +data +dryAirConstants +fluidConstants +ThermodynamicState +BaseProperties +setState_phX +setState_pTX +setState_psX +setState_dTX +setSmoothState +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +velocityOfSound +isentropicEnthalpy +specificEnthalpy_pTX +temperature_phX +density_phX +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/MoltenSalt/package.mo b/ThermoSysPro/Properties/Media/MoltenSalt/package.mo new file mode 100644 index 00000000..a200e9c5 --- /dev/null +++ b/ThermoSysPro/Properties/Media/MoltenSalt/package.mo @@ -0,0 +1,249 @@ +within ThermoSysPro.Properties.Media; +package MoltenSalt "Molten salt medium using the legacy ThermoSysPro property functions" + + extends PartialThermoSysProMedium( + isCompressible=false, + mediumName="MoltenSalt", + substanceNames={"MoltenSalt"}, + singleState=false, + SpecificEnthalpy(start=3e5, nominal=3e5), + Density(start=1800, nominal=1800), + AbsolutePressure(start=1e5, nominal=1e5), + Temperature(start=600, nominal=600), + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant FluidConstants saltConstants( + iupacName="Molten salt", + casRegistryNumber="", + chemicalFormula="", + structureFormula="", + molarMass=0.1); + constant FluidConstants fluidConstants[1]={saltConstants}; + + redeclare record extends ThermodynamicState + SpecificEnthalpy h; + Density d; + Temperature T; + AbsolutePressure p; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + equation + T = ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + d = ThermoSysPro.Properties.MoltenSalt.Density_T(T); + u = h - p/d; + MM = fluidConstants[1].molarMass; + R_s = 0; + state = ThermodynamicState( + p=p, + h=h, + T=T, + d=d); + end BaseProperties; + + redeclare function extends setState_phX + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.MoltenSalt.Density_T(T)); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_pTX + protected + SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.MoltenSalt.Density_T(T)); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_psX + algorithm + assert(false, "MoltenSalt: setState_psX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=p, + h=0, + T=0, + d=0); + end setState_psX; + + redeclare function extends setState_dTX + algorithm + state := ThermodynamicState( + p=reference_p, + h=ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T), + T=T, + d=d); + annotation (Inline=true); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + protected + SpecificEnthalpy h; + Temperature T; + algorithm + h := smoothStep( + x, + state_a.h, + state_b.h, + x_small); + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + state := ThermodynamicState( + p=smoothStep( + x, + state_a.p, + state_b.p, + x_small), + h=h, + T=T, + d=ThermoSysPro.Properties.MoltenSalt.Density_T(T)); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + algorithm + assert(false, "MoltenSalt: specificEntropy is not available in the legacy ThermoSysPro implementation"); + s := 0; + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + algorithm + cp := ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(state.T); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(state.T); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends velocityOfSound + algorithm + assert(false, "MoltenSalt: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + assert(false, "MoltenSalt: isentropicEnthalpy is not available in the legacy ThermoSysPro implementation"); + h_is := refState.h; + end isentropicEnthalpy; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input Temperature T; + input MassFraction X[:]; + output SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Temperature T; + algorithm + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Density d; + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + d := ThermoSysPro.Properties.MoltenSalt.Density_T(T); + annotation (Inline=true); + end density_phX; + + redeclare function extends density_derh_p + protected + SpecificEnthalpy delta_h=0.01*state.h; + algorithm + ddhp := (ThermoSysPro.Properties.MoltenSalt.Density_T(ThermoSysPro.Properties.MoltenSalt.Temperature_h(state.h + delta_h)) - ThermoSysPro.Properties.MoltenSalt.Density_T(ThermoSysPro.Properties.MoltenSalt.Temperature_h(state.h - delta_h)))/(2*delta_h); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + algorithm + ddph := 1e-8; + annotation (Inline=true); + end density_derp_h; +end MoltenSalt; diff --git a/ThermoSysPro/Properties/Media/MoltenSalt/package.order b/ThermoSysPro/Properties/Media/MoltenSalt/package.order new file mode 100644 index 00000000..6167fc42 --- /dev/null +++ b/ThermoSysPro/Properties/Media/MoltenSalt/package.order @@ -0,0 +1,28 @@ +saltConstants +fluidConstants +ThermodynamicState +BaseProperties +setState_phX +setState_pTX +setState_psX +setState_dTX +setSmoothState +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +velocityOfSound +isentropicEnthalpy +specificEnthalpy_pTX +temperature_phX +density_phX +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo new file mode 100644 index 00000000..e33895ae --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo @@ -0,0 +1,466 @@ +within ThermoSysPro.Properties.Media; +package WaterSteamSimple "Simple water/steam medium using the legacy ThermoSysPro property functions" + + extends PartialTwoPhaseThermoSysProMedium( + isCompressible=true, + mediumName="WaterSteamSimple", + substanceNames={"water"}, + singleState=false, + SpecificEnthalpy(start=1e5, nominal=5e5), + Density(start=150, nominal=500), + AbsolutePressure( + start=50e5, + nominal=10e5, + min=611.657, + max=100e6), + Temperature( + start=500, + nominal=500, + min=273.15, + max=2273.15), + smoothModel=false, + onePhase=false, + fluidConstants=Modelica.Media.Water.waterConstants, + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant Integer Region=0 "Simple water region. 0: automatic"; + + redeclare record extends SaturationProperties + end SaturationProperties; + + redeclare record extends ThermodynamicState + SpecificEnthalpy h; + Density d; + Temperature T; + AbsolutePressure p; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + Integer phase( + min=0, + max=2, + start=1, + fixed=false); + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + equation + pro = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + MM = fluidConstants[1].molarMass; + R_s = Modelica.Constants.R/fluidConstants[1].molarMass; + phase = if pro.x > 0 and pro.x < 1 then 2 else 1; + sat = setSat_p(p); + state = ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=phase); + T = pro.T; + d = pro.d; + u = pro.u; + end BaseProperties; + + redeclare function density_ph + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input FixedPhase phase=0; + output Density d; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + d := pro.d; + annotation (Inline=true); + end density_ph; + + redeclare function temperature_ph + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input FixedPhase phase=0; + output Temperature T; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + T := pro.T; + annotation (Inline=true); + end temperature_ph; + + redeclare function extends setState_phX + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_psX + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ps(p, s, Region); + state := ThermodynamicState( + p=p, + h=pro.h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_psX; + + redeclare function extends setState_pTX + protected + SpecificEnthalpy h; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + h := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SpecificEnthalpy_PT(p, T, Region); + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_dTX + algorithm + assert(false, "WaterSteamSimple: setState_dTX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=reference_p, + h=0, + T=T, + d=d, + phase=phase); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + algorithm + state := setState_phX( + smoothStep( + x, + state_a.p, + state_b.p, + x_small), + smoothStep( + x, + state_a.h, + state_b.h, + x_small), + fill(0, 0)); + annotation (Inline=true); + end setSmoothState; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input Temperature T; + input MassFraction X[:]; + input FixedPhase phase=0; + output SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SpecificEnthalpy_PT(p, T, Region); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + input FixedPhase phase=0; + output Temperature T; + algorithm + T := temperature_ph(p, h, phase); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + input FixedPhase phase=0; + output Density d; + algorithm + d := density_ph(p, h, phase); + annotation (Inline=true); + end density_phX; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + s := pro.s; + annotation (Inline=true); + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + annotation (Inline=true); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + annotation (Inline=true); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + cp := pro.cp; + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=state.d, T=state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=state.d, T=state.T); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends surfaceTension + algorithm + sigma := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SurfaceTension_T(sat.Tsat); + annotation (Inline=true); + end surfaceTension; + + redeclare function extends velocityOfSound + algorithm + assert(false, "WaterSteamSimple: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + h_is := specificEnthalpy( + setState_psX(p_downstream, specificEntropy(refState), fill(0, 0))); + annotation (Inline=true); + end isentropicEnthalpy; + + redeclare function extends saturationTemperature + algorithm + T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p); + annotation (Inline=true); + end saturationTemperature; + + redeclare function extends saturationTemperature_derp + algorithm + dTp := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dTsatp_P(p); + annotation (Inline=true); + end saturationTemperature_derp; + + redeclare function extends saturationPressure + algorithm + p := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Pressure_sat_hl(0); + annotation (Inline=true); + end saturationPressure; + + redeclare function setSat_p + extends Modelica.Icons.Function; + input AbsolutePressure p; + output SaturationProperties sat; + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(p); + sat := SaturationProperties(psat=p, Tsat=lsat.T); + annotation (Inline=true); + end setSat_p; + + redeclare function setSat_T + extends Modelica.Icons.Function; + input Temperature T; + output SaturationProperties sat; + algorithm + assert(false, "WaterSteamSimple: setSat_T is not available in the legacy ThermoSysPro implementation"); + sat := SaturationProperties(psat=0, Tsat=T); + end setSat_T; + + redeclare function extends bubbleEnthalpy + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(sat.psat); + hl := lsat.h; + annotation (Inline=true); + end bubbleEnthalpy; + + redeclare function extends dewEnthalpy + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(sat.psat); + hv := vsat.h; + annotation (Inline=true); + end dewEnthalpy; + + redeclare function extends bubbleDensity + algorithm + dl := density_ph(sat.psat, bubbleEnthalpy(sat)); + annotation (Inline=true); + end bubbleDensity; + + redeclare function extends dewDensity + algorithm + dv := density_ph(sat.psat, dewEnthalpy(sat)); + annotation (Inline=true); + end dewDensity; + + redeclare function extends bubbleEntropy + algorithm + sl := specificEntropy( + setState_phX( + sat.psat, + bubbleEnthalpy(sat), + fill(0, 0))); + annotation (Inline=true); + end bubbleEntropy; + + redeclare function extends dewEntropy + algorithm + sv := specificEntropy( + setState_phX( + sat.psat, + dewEnthalpy(sat), + fill(0, 0))); + annotation (Inline=true); + end dewEntropy; + + redeclare function extends setBubbleState + algorithm + state := setState_phX( + sat.psat, + bubbleEnthalpy(sat), + fill(0, 0), + phase); + annotation (Inline=true); + end setBubbleState; + + redeclare function extends setDewState + algorithm + state := setState_phX( + sat.psat, + dewEnthalpy(sat), + fill(0, 0), + phase); + annotation (Inline=true); + end setDewState; + + redeclare function extends dBubbleDensity_dPressure + algorithm + ddldp := 0; + annotation (Inline=true); + end dBubbleDensity_dPressure; + + redeclare function extends dDewDensity_dPressure + algorithm + ddvdp := 0; + annotation (Inline=true); + end dDewDensity_dPressure; + + redeclare function extends dBubbleEnthalpy_dPressure + algorithm + dhldp := 0; + annotation (Inline=true); + end dBubbleEnthalpy_dPressure; + + redeclare function extends dDewEnthalpy_dPressure + algorithm + dhvdp := 0; + annotation (Inline=true); + end dDewEnthalpy_dPressure; + + redeclare function extends density_derh_p + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + ddhp := pro.ddhp; + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + ddph := pro.ddph; + annotation (Inline=true); + end density_derp_h; +end WaterSteamSimple; diff --git a/ThermoSysPro/Properties/Media/WaterSteamSimple/package.order b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.order new file mode 100644 index 00000000..24365266 --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.order @@ -0,0 +1,48 @@ +Region +SaturationProperties +ThermodynamicState +BaseProperties +density_ph +temperature_ph +setState_phX +setState_psX +setState_pTX +setState_dTX +setSmoothState +specificEnthalpy_pTX +temperature_phX +density_phX +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +surfaceTension +velocityOfSound +isentropicEnthalpy +saturationTemperature +saturationTemperature_derp +saturationPressure +setSat_p +setSat_T +bubbleEnthalpy +dewEnthalpy +bubbleDensity +dewDensity +bubbleEntropy +dewEntropy +setBubbleState +setDewState +dBubbleDensity_dPressure +dDewDensity_dPressure +dBubbleEnthalpy_dPressure +dDewEnthalpy_dPressure +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/package.order b/ThermoSysPro/Properties/Media/package.order index 8966d666..ded20b5d 100644 --- a/ThermoSysPro/Properties/Media/package.order +++ b/ThermoSysPro/Properties/Media/package.order @@ -6,3 +6,6 @@ WaterSteam FlueGases C3H3F5 Oil_TherminolVP1 +MoltenSalt +DryAirIdealGas +WaterSteamSimple From ca2825b516687e903498be0d19e1ddea9565e12a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 19 May 2026 23:14:47 +0200 Subject: [PATCH 173/213] #125 ThermoSysPro.Fluid.Examples.Book.SimpleExamples except HX --- .../Boiler/TestFossilFuelBoiler.mo | 46 +++++++++++++------ .../TestCentrifugalPump/Scenario_1.mo | 9 +++- .../TestCentrifugalPump/Scenario_2.mo | 12 +++-- .../TestCentrifugalPump/Scenario_3.mo | 10 +++- .../TestCentrifugalPump/Scenario_4.mo | 6 ++- .../TestStaticCentrifugalPump.mo | 12 +++-- .../TestGTCombustionChamber.mo | 20 ++++---- .../TestGenericCombustion1D.mo | 38 +++++++++++---- .../GasTurbine/TestCombustionTurbine.mo | 19 ++++---- .../GasTurbine/TestCompressor.mo | 15 +++--- .../TestInternalCombustionEngine.mo | 28 +++++++---- .../SimpleExamples/PressureLoss/TestBend.mo | 10 ++-- .../PressureLoss/TestCheckValve.mo | 8 +++- .../PressureLoss/TestControlValve.mo | 11 +++-- .../PressureLoss/TestDiaphragm.mo | 10 ++-- .../PressureLoss/TestDynamicCheckValve.mo | 9 +++- .../PressureLoss/TestDynamicReliefValve.mo | 17 +++++-- .../PressureLoss/TestLumpedStraightPipe.mo | 10 +++- .../PressureLoss/TestPipePressureLoss.mo | 10 ++-- .../PressureLoss/TestSwitchValve.mo | 16 +++++-- .../PressureLoss/TestThreeWayValve.mo | 11 +++-- .../SolarCollector/TestFresnelField.mo | 8 +++- .../SteamTurbine/TestStodolaTurbine.mo | 10 +++- .../SimpleExamples/Volume/TestDynamicDrum.mo | 9 ++++ .../Book/SimpleExamples/Volume/TestMixer3.mo | 24 ++++++---- .../SimpleExamples/Volume/TestPressurizer.mo | 28 +++++++---- .../SimpleExamples/Volume/TestSplitter3.mo | 23 ++++++---- .../SimpleExamples/Volume/TestStaticDrum3.mo | 33 +++++++++---- .../SimpleExamples/Volume/TestSteamDryer.mo | 23 +++++++--- .../Book/SimpleExamples/Volume/TestTank.mo | 23 +++++++--- .../SimpleExamples/Volume/TestVolumeATh.mo | 15 ++++-- 31 files changed, 372 insertions(+), 151 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo index 1b70289b..118548ed 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo @@ -1,6 +1,11 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Boiler; model TestFossilFuelBoiler + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, Wloss=0, Ke=1.e6, Tsf=386.16, @@ -10,37 +15,50 @@ model TestFossilFuelBoiler rhof(start=0.2733355904203506)) annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0))); ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( - T0=338.16, - Cp=1282, - Xh=0.24403, - Xc=0.75323, - Q0=1.45) annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, + Xashes=0.011, + rho=1000, + Hum=0.50, + Xc=0.2479, + Xh=0.0297, + Xo=0.2088, + Xn=0.0017, + Xs=0.0003, + LHV=1.5e7, + Q0=0.0407331, + T0=294.45) annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( - Xco2=0, - Xh2o=0.01, + redeclare package Medium = Medium_FlueGases, Q0=27., T0=298.16, - Xo2=0.233, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=true) + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) annotation (Placement(transformation(extent={{-110,-50},{-71,-13}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation (Placement(transformation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) annotation (Placement(transformation( extent={{68,-51},{110,-12}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, P0=140e5, Q0=24., h0=600e3) annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = Medium) annotation (Placement(transformation( extent={{74,13},{110,49}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K=1e-3, rho( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=1e-3, rho( start=932.9612394321883)) annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K=1e-3, rho( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=1e-3, rho( start=29.766102492862515)) annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0))); equation diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo index 9aec12bb..811f5307 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo @@ -1,16 +1,21 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_1 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, mode_car=1, mode_car_hn=1, mode_car_Cr=1, dynamic_mech_equation=false) annotation (Placement(transformation(extent={{-20,20},{0, 40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=0) + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + Q0=0) annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe( Starttime=10, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo index 54dfa881..29617eea 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo @@ -1,13 +1,19 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_2 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(mode_car_hn= + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + mode_car_hn= 1, mode_car_Cr=1, mode_car=1) annotation (Placement(transformation(extent={{-20,20},{0, 40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0=100) + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + Q0=100) annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,20},{60,40}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe( Starttime=10, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo index 78d7ef17..4c0dc39b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo @@ -1,7 +1,9 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_3 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, hn_nom_p=10, mode_car=1, V=0.01, @@ -9,9 +11,12 @@ model Scenario_3 mode_car_Cr=1, mode_car_hn=1) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(P0=300000) + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=300000) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2( Duration=100, @@ -20,6 +25,7 @@ model Scenario_3 Initialvalue=400000) annotation (Placement( transformation(extent={{0,60},{20,80}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, lambda=0, inertia=true) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo index b3ceaf57..9ab55f34 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo @@ -1,7 +1,9 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_4 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, J=5.685, dynamic_mech_equation=true, hn_coef={-165.23,774.95}, @@ -15,11 +17,13 @@ model Scenario_4 Qv(start=0.010949905982587188)) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceP( + redeclare package Medium = Medium, Q0=10, h0=650e3, P0=100000) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3( Duration=1000, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo index 97a0d98d..4c942bc1 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo @@ -1,13 +1,19 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump; model TestStaticCentrifugalPump + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1 + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-50},{-30,-30}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.Tank Bache1(ze2=10, zs2=10) + ThermoSysPro.Fluid.Volumes.Tank Bache1( + redeclare package Medium = Medium, + ze2=10, + zs2=10) annotation (Placement(transformation(extent={{-30,10},{-10,30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(k=0.5) annotation (Placement( transformation(extent={{-10,50},{10,70}}, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo index f5da7e46..24ddff22 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo @@ -1,15 +1,22 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber; model TestGTCombustionChamber + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 + ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) annotation (Placement(transformation( origin={149,-2}, extent={{23,-24},{-23,24}}, rotation=180))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P( - fixed=true, start=14.1e5)), kcham(fixed=false, start=1)) annotation ( + ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) annotation ( Placement(transformation(extent={{-67,-68},{67,64}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2( + redeclare package Medium = Medium, Q0=0, P0=15e5, h0=300e3) @@ -29,15 +36,12 @@ model TestGTCombustionChamber LHV=47500e3) annotation (Placement(transformation(extent={{-107,-93},{-71,-57}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2( - Xso2=0, - Xco2=0.0, - Xo2=0.23, - Xh2o=0.01, + redeclare package Medium = Medium_FlueGases, P0=15e5, Q0=415, T0=680, option_temperature=true, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) + X0={0.76,0.23,0.01,0,0}) annotation (Placement(transformation(extent={{-174,-26},{-128,22}}, rotation=0))); equation diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo index b789a7f1..df6fa0d8 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo @@ -1,7 +1,11 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber; model TestGenericCombustion1D "TestGenericCombustion1D" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, NCEL=7, Qm(fixed=false), Qsf(fixed=false), @@ -31,29 +35,38 @@ model TestGenericCombustion1D "TestGenericCombustion1D" Hum=0.08) annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( - Xso2=0, + redeclare package Medium = Medium_FlueGases, Q0=609.29, - Xh2o=0.01, - Xo2=0.230, - Xco2=0, P0=191000, T0=524.89, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=true) + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation (Placement(transformation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) annotation (Placement(transformation( extent={{0,70},{44,112}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0=0, P0=100000) + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water( + redeclare package Medium = Medium, + Q0=0, + P0=100000) annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation= 0))); ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe PipeWaterSteam( + redeclare package Medium = Medium, Ns=7, + inertia=false, + dynamic_energy_balance=false, z2=56, rugosrel=5e-5, ntubes=403, L=58, D=0.0327, + P(start=fill(2.0e7, 9)), + Q(start=fill(486.69, 8)), + h(start=fill(1.8e6, 9)), C2(Q(fixed=false, start=486.69), P( fixed=false, start=1.96318e+07, @@ -65,6 +78,9 @@ model TestGenericCombustion1D "TestGenericCombustion1D" rotation=270))); ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall paroiEcrans( Ns=7, + dynamic_energy_balance=false, + Tp1(start=fill(500, 7)), + Tp2(start=fill(400, 7)), lambda=40, steady_state=true, ntubes=403, @@ -76,15 +92,17 @@ model TestGenericCombustion1D "TestGenericCombustion1D" extent={{51.5,-15},{-51.5,15}}, rotation=270))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam2( + redeclare package Medium = Medium, option_temperature=false, - Q(start=486.69, fixed=true), + Q(start=486.69), h0=2.5e+06, - P0(fixed=false) = 19621600) + P0=19621600) annotation (Placement(transformation( origin={90,90.5}, extent={{14.5,-15},{-14.5,15}}, rotation=270))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceEcrans( + redeclare package Medium = Medium, h0=1.292e+06, option_temperature=false, P0=20112000) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo index 4d4b1e64..0e4be423 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo @@ -1,28 +1,31 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine; model TestCombustionTurbine + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency"; parameter Real Qred1(fixed=false,start=0.01) "Reduced mass flow rate"; ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, tau_n=0.065, is_eff_n=is_eff_n1, Qred=Qred1, Pe(fixed=true, start=1500000), - Ts(fixed=true, start=830)) annotation (Placement(transformation(extent={{ + Ts(fixed=true, start=830), + Hs(start=769796.2 + Medium.h_offset)) annotation (Placement(transformation(extent={{ -42,-42},{36,42}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1( - Xso2=0, + redeclare package Medium = Medium, Q0=430, - Xco2=0.06, - Xh2o=0.06, - Xo2=0.14, T0=1500, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=true) + option_temperature=true, + X0={1 - 0.14 - 0.06 - 0.06,0.14,0.06,0.06,0}) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=1e5) + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=1e5, + T0=830) annotation (Placement(transformation( origin={94,0}, extent={{10,-10},{-10,10}}, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo index 718d4bc1..e9de00fd 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo @@ -1,8 +1,10 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine; model TestCompressor + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; parameter Real is_eff_n1(fixed=false,start=0.85) "Nominal isentropic efficiency"; ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, Ps(fixed=false), tau_n=16, is_eff_n=is_eff_n1, @@ -10,19 +12,18 @@ model TestCompressor Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{ -52,-52},{48,52}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( - Xso2=0, + redeclare package Medium = Medium, T0=288, - Xco2=0.0, - Xh2o=0.003, - Xo2=0.23, P0=1e5, Q0=420, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, - option_temperature=true) + option_temperature=true, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}) annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0=15.8e5) + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=15.8e5) annotation (Placement(transformation( origin={96,0}, extent={{10,-10},{-10,10}}, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo index 2a51e641..7cdd2733 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo @@ -1,5 +1,8 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.InternalCombustionEngine; model TestInternalCombustionEngine + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + parameter Integer NCEL = 7; Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( @@ -15,29 +18,31 @@ model TestInternalCombustionEngine LHV=50e6, T0(displayUnit="K") = 299, P0=210300, - Vol=100) annotation (Placement(transformation(extent={{-106,-81},{-72,-43}}, + Vol=1) annotation (Placement(transformation(extent={{-106,-81},{-72,-43}}, rotation=0))); BoundaryConditions.SourcePQ sourceAir( - Xso2=0, - Xco2=0, - Xh2o=0.005, - Xo2=0.23, + redeclare package Medium = Medium_FlueGases, Q0=1.9627, T0=30 + 273.16, option_temperature=true, - ftype=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, + X0={0.765,0.23,0.005,0,0}, P0=191000) annotation (Placement(transformation(extent={{111,-79},{73,-45}},rotation=0))); - BoundaryConditions.Sink sink(option_temperature=true) + BoundaryConditions.Sink sink( + redeclare package Medium = Medium_FlueGases, + option_temperature=true) annotation (Placement(transformation( extent={{0,44},{44,86}}, rotation=0))); BoundaryConditions.SourcePQ SourcePQ_Water( + redeclare package Medium = Medium, Q0=15.3, h0=334.41e3, P0=410000) annotation (Placement(transformation(extent={{-107,-19},{-71,15}},rotation= 0))); Machines.InternalCombustionEngine alternatingEngine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, mechanical_efficiency_type=2, Rmeca_nom=0.41, Coef_Rm_a=-5.4727e-9, @@ -56,11 +61,14 @@ model TestInternalCombustionEngine Gamma=1.2085, Tsf(start=1088.15)) annotation (Placement(transformation(extent={{-44,-46},{44,42}}))); - BoundaryConditions.Sink Sink_Water1 annotation (Placement( + BoundaryConditions.Sink Sink_Water1(redeclare package Medium = + Medium) annotation (Placement( transformation(extent={{75,-19},{111,15}}, rotation=0))); - PressureLosses.SingularPressureLoss singularPressureLoss + PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-63,-8},{-51,4}}))); - PressureLosses.SingularPressureLoss singularPressureLoss1 + PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{51,-9},{65,5}}))); equation connect(alternatingEngine.Cair,sourceAir. C) annotation (Line( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo index ccabc713..aeee300b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo @@ -1,14 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestBend + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-62,-6},{-42,14}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{41,-34},{61,-14}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.Bend Bend annotation (Placement( + ThermoSysPro.Fluid.PressureLosses.Bend Bend( + redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-8,-6},{12,14}}, rotation=0))); equation connect(Bend.C2, SinkP1.C) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo index 8920f780..8d1bd13a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo @@ -1,10 +1,13 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestCheckValve + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-40,-10},{-20,10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( + redeclare package Medium = Medium, P0=6e5) annotation (Placement(transformation( extent={{40,-10},{60,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse( @@ -13,7 +16,8 @@ model TestCheckValve period=100, offset=3e5) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3 + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); equation connect(sourceP1.C, checkValve3.C1) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo index 61789a1e..b2220c51 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo @@ -1,13 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestControlValve + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-64,-10},{-44,10}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{44,-10},{64,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve(mode_caract=1, caract=[ + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve( + redeclare package Medium = Medium, + mode_caract=1, caract=[ 0,0; 0.5,3000; 0.75,7000; 1,8000]) annotation (Placement(transformation( extent={{-10,-4},{10,16}},rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo index b01b951c..ee64a04c 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo @@ -1,12 +1,16 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDiaphragm + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-64,-10},{-44,10}},rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{44,-10},{64,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm + ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo index 7ff1999b..0fb26b6a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo @@ -1,13 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDynamicCheckValve + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-38,-10},{-18,10}},rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( + redeclare package Medium = Medium, P0=6e5) annotation (Placement(transformation( extent={{42,-10},{62,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J=10) + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve( + redeclare package Medium = Medium, + J=10) annotation (Placement(transformation(extent={{2,-10},{22,10}},rotation=0))); InstrumentationAndControl.Blocks.Sources.Sinusoide pulse( period=100, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo index bf4bdf35..bd3cba73 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo @@ -1,7 +1,9 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDynamicReliefValve + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve ReliefValve( + redeclare package Medium = Medium, mech_steady_state=false, caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351; 0.7,8625; 0.8,8818; 0.9,8958; 1,9063], @@ -15,23 +17,30 @@ model TestDynamicReliefValve Q(start=1.4404060369658185E-32)) annotation (Placement(transformation(extent={{0,20},{20,40}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe2( + redeclare package Medium = Medium, Pm(start=199283), Q(start=1335.993983016864)) annotation (Placement(transformation( extent={{40,-20},{60,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2 + ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2( + redeclare package Medium = Medium) annotation (Placement(transformation(extent= {{80,-20},{100,0}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe1( + redeclare package Medium = Medium, D=0.4, Pm(start=1478795.1075221882)) annotation (Placement(transformation( extent={{-40,-20},{-20,0}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.VolumeD VolumeD1(P(start=298566), h(start= + ThermoSysPro.Fluid.Volumes.VolumeD VolumeD1( + redeclare package Medium = Medium, + P(start=298566), h(start= 72156.6431966866)) annotation (Placement(transformation( extent={{0,-20},{20,0}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent= {{40,20},{60,40}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); InstrumentationAndControl.Blocks.Sources.Rampe ramp( Duration=200, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo index 4a798a1b..cbfcbdb1 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo @@ -1,11 +1,17 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestLumpedStraightPipe + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Volumes.Tank tank1(h0=2e5) annotation (Placement( + ThermoSysPro.Fluid.Volumes.Tank tank1( + redeclare package Medium = Medium, + h0=2e5) annotation (Placement( transformation(extent={{-50,16},{-30,36}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.Tank tank2(z0=10) annotation (Placement( + ThermoSysPro.Fluid.Volumes.Tank tank2( + redeclare package Medium = Medium, + z0=10) annotation (Placement( transformation(extent={{30,16},{50,36}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, inertia=true, lambda=0.012, lambda_fixed=true) annotation (Placement(transformation(extent={{-10,-24},{ diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo index 7bb8be22..acf9db0f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo @@ -1,13 +1,17 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestPipePressureLoss + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-85,-10},{-65,10}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{64,-10},{84,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-40,-53},{38,53}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo index fac6f896..7cbf5fa4 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo @@ -1,22 +1,28 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestSwitchValve + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{70,-10},{90,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve + ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-18,-9},{18,37}},rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse( width=10, period=20) annotation (Placement(transformation(extent={{-50,31},{-30,51}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{-55,-10},{-35,10}},rotation=0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{34,-10},{54,10}},rotation=0))); equation diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo index 95a0db81..3f791282 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo @@ -1,19 +1,24 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestThreeWayValve + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{70,-10},{90,10}},rotation=0))); ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare package Medium = Medium, C2(Q(start=-7.902947109890763E-33)), C3(Q(start=2716.4138702433384)), Valve1(Pm(start=200000.0)), VolumeA1(h(start=71016.12237181117))) annotation (Placement(transformation(extent={{-10,-6},{10,14}},rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{70,-50},{90,-30}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo index 35fa5758..718bcf15 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo @@ -1,5 +1,6 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SolarCollector; model TestFresnelField + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; public ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( @@ -46,6 +47,7 @@ public annotation (Placement(transformation(extent={{-40,-36},{40,-2}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, ntubes=1, steady_state=true, rugosrel=0.00005, @@ -85,9 +87,13 @@ public T0=303) annotation (Placement(transformation(extent={{-40,-16},{40,72}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, h0=2000e3, P0=125e5) annotation (Placement(transformation(extent={ {48,-54},{68,-34}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0=11, h0=1500e3) + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP( + redeclare package Medium = Medium, + Q0=11, + h0=1500e3) annotation (Placement(transformation(extent={{-69,-53},{-49,-33}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo index 94d1c2ad..b56693ef 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo @@ -1,12 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SteamTurbine; model TestStodolaTurbine + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Cst=2e6, + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare package Medium = Medium, + Cst=2e6, eta_is_nom=0.94) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0=10000000) + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP( + redeclare package Medium = Medium, + P0=10000000) annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, option_temperature=false, P0=27000000, h0=3475.e3) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo index 7977bd97..bdd5cc5f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo @@ -1,11 +1,14 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestDynamicDrum + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed=false, start=670) "Maximum CV (active if mode_caract=0)"; parameter Real LambdaPipe(fixed=false,start=0.085) "Friction pressure loss coefficient (active if lambda_fixed=true)"; ThermoSysPro.Fluid.Volumes.DynamicDrum Drum( + redeclare package Medium = Medium, Vv(start=39), Vertical=false, hl(start=1454400), @@ -19,6 +22,7 @@ model TestDynamicDrum Tp(start=592.6)) annotation (Placement(transformation(extent={{-61,16},{1, 78}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve( + redeclare package Medium = Medium, Cv(start=335), Q(start=79.5), rho(start=888), @@ -33,6 +37,7 @@ model TestDynamicDrum annotation (Placement(transformation(extent={{-120,74},{ -100,94}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + redeclare package Medium = Medium, Cv(start=25000), Q(start=79.5), rho(start=78.5), @@ -42,6 +47,7 @@ model TestDynamicDrum annotation (Placement(transformation(extent={{40,74},{60,94}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcranBoucleEvaporatoire( + redeclare package Medium = Medium, T0=fill(400, 10), heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}), advection=false, @@ -75,6 +81,7 @@ model TestDynamicDrum extent={{-10,-10},{10,10}}, rotation=90))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, L=20, z1=20, C1(P(start=130e5)), @@ -85,11 +92,13 @@ model TestDynamicDrum extent={{10,-10},{-10,10}}, rotation=90))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceQ(h0=1400000, + redeclare package Medium = Medium, option_temperature=false, P0=13300000) annotation (Placement(transformation(extent={{-196,68},{-176,88}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, option_temperature=false, h0=2.650e6, P0=12700000) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo index 3d90a867..b32f607f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo @@ -1,34 +1,40 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestMixer3 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2 + ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3 annotation (Placement(transformation(extent={{34,-10}, + singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10}, {54,10}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4 annotation (Placement(transformation(extent={{-46,10}, + singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10}, {-26,30}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5 annotation (Placement(transformation(extent={{-46,-30}, + singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30}, {-26,-10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2 + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k= 0.5) annotation (Placement(transformation(extent={{-46,30},{-26,50}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-10},{-66,10}}, rotation= 0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss6 annotation (Placement(transformation(extent={{-46,-10}, + singularPressureLoss6(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10}, {-26,10}}, rotation=0))); equation connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation (Line(points={{-26,20}, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo index 76d25762..ba1629c7 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo @@ -1,12 +1,14 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestPressurizer + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - parameter Units.SI.Power Wch(fixed=false) = 0.29e6 + parameter Units.SI.Power Wch(fixed=true) = 0.29e6 "Power released by the electrical heaters"; - parameter Real OUVfeedwaterValve( fixed=false)=0.01 + parameter Real OUVfeedwaterValve( fixed=true)=0.01 "Position of the feedwater valve"; ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray( + redeclare package Medium = Medium, Cv(start=100), C1( P(start=160e5), @@ -17,11 +19,13 @@ model TestPressurizer Cvmax=5000) annotation (Placement(transformation(extent={{-110,130},{-90, 150}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + redeclare package Medium = Medium, Cv(start=25000), Cvmax(fixed=true) = 5000, Pm(start=15500000)) annotation (Placement(transformation(extent={{58,130},{78,150}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, L=1, D=1, z1=1, @@ -37,23 +41,28 @@ model TestPressurizer true) = 0.5) annotation (Placement(transformation(extent={{0,156},{20, 176}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, option_temperature=false, h0=1270e3, P0=16000000) annotation (Placement(transformation(extent={{-168,124},{-148,144}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=0, h0=3e6) + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare package Medium = Medium, + Q0=0, + h0=3e6) annotation (Placement(transformation(extent={{106,124},{126,144}}, rotation= 0))); ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( + redeclare package Medium = Medium, Zm=10.15, Klv=0.5e6, cpp=600, hl(start=1629887.98290107), hv(start=2596216.59571565), Zl(start=5.5900717167325), - Yw0=60, - steady_state=true, + Yw0=32.92, + steady_state=false, V=61.12, Rp=1.27, Ae=96.23, @@ -64,12 +73,15 @@ model TestPressurizer Ccond=0.02, Cevap=0.05, Yw(start=32.92), - y(start=0.3292, fixed=true), + y(start=0.3292), P0=15500000, - P(start=15500000, fixed=true), + P(start=15500000), Tp(start=617.94155291055)) annotation (Placement(transformation(extent={{-92, -12},{32,118}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( Q0=0, h0=1600000) + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( + redeclare package Medium = Medium, + Q0=0, + h0=1600000) annotation (Placement(transformation(extent={{-30,-76},{-10,-56}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo index eed8f5a9..c9da836e 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo @@ -1,30 +1,37 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestSplitter3 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Junctions.Splitter3 splitter3 + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0=100, + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1( + redeclare package Medium = Medium, + Q0=100, option_temperature=true) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3 annotation (Placement(transformation(extent={{-56,-10}, + singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10}, {-36,10}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3 + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation= 0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4 annotation (Placement(transformation(extent={{44,30}, + singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30}, {64,50}},rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5 annotation (Placement(transformation(extent={{44,-50}, + singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,-50}, {64,-30}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k= 0) annotation (Placement(transformation(extent={{-36,10},{-16,30}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4 + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-10},{104,10}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k= diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo index e1378a5e..6eb37c0f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo @@ -1,17 +1,26 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestStaticDrum3 + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,1},{20,51}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI1(K=1e-4) + singularPressureLossVALI1( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI2(K=1e-4) + singularPressureLossVALI2( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0=10) + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare package Medium = Medium, + Q0=10) annotation (Placement(transformation(extent={{74,7},{94,27}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, Q0=100, h0=1400e3, P0=10000000) @@ -22,11 +31,16 @@ model TestStaticDrum3 extent={{-10,-10},{10,10}}, rotation=90))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossVALI3(K=1e-4) + singularPressureLossVALI3( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,52},{94,72}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + inertia=false, z1=0, rugosrel=0.0001, D=0.05, @@ -37,16 +51,19 @@ model TestStaticDrum3 extent={{13.5,11.5},{-13.5,-11.5}}, rotation=270))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, lambda(fixed=false) = 0.03, D=0.05, ntubes=10, L=10, z1=10, - Q(fixed=true, start=30)) annotation (Placement(transformation( + Q(fixed=false, start=30)) annotation (Placement(transformation( origin={20,-45}, extent={{-14,-12},{14,12}}, rotation=270))); - ThermoSysPro.Fluid.Volumes.VolumeA volumeA annotation (Placement(transformation( + ThermoSysPro.Fluid.Volumes.VolumeA volumeA( + redeclare package Medium = Medium, + steady_state=false) annotation (Placement(transformation( extent={{1,-72},{-9,-62}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( option_temperature=2, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo index 5dd37429..a9d8b92a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo @@ -1,27 +1,36 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestSteamDryer + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta=0.9, P(start= + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer( + redeclare package Medium = Medium, + eta=0.9, P(start= 10000000)) annotation (Placement(transformation(extent={{-10,-8},{10, 12}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0=10000000, h0= + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ( + redeclare package Medium = Medium, + P0=10000000, h0= 2400000) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation= 0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss2 annotation (Placement(transformation(extent={{-50,-4}, + singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-4}, {-30,16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1 annotation (Placement(transformation(extent={{30,-4}, + singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-4}, {50,16}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=1.e-4) + singularPressureLoss3( + redeclare package Medium = Medium, + K=1.e-4) annotation (Placement(transformation(extent={{30,-44}, {50,-24}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-44},{90,-24}}, rotation=0))); equation diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo index 96318f98..bb83a52b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo @@ -1,25 +1,34 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestTank + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1 + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-90,-4},{-70,16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{70,-50},{90,-30}}, rotation=0))); - ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed=false, start=5)) + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=5)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation= 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{70,-4},{90,16}}, rotation=0))); equation diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo index ab93fe88..f61040f7 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo @@ -1,7 +1,9 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestVolumeATh + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh( + redeclare package Medium = Medium, h0=1.2e5, V=1, P0=300000, @@ -9,28 +11,35 @@ model TestVolumeATh annotation (Placement(transformation(extent={{-15,21},{15,-9}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sink( + redeclare package Medium = Medium, T0=320, option_temperature=false, h0=200000) annotation (Placement(transformation(extent={{64,-4},{84,16}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve1(Cvmax=80) + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve1( + redeclare package Medium = Medium, + Cvmax=80) annotation (Placement(transformation(extent={{-47,-58},{-27,-38}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue= 0, Initialvalue=1) annotation (Placement(transformation( extent={{-89,-38},{-73,-22}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve2 + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve2( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{28,2},{48,22}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-83,-6},{-59,18}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constant annotation (Placement(transformation( extent={{10,18},{26,34}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, option_temperature=false) annotation (Placement(transformation(extent={{-79,-64},{-59,-44}}, rotation= 0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1( + redeclare package Medium = Medium, L=0.1, D=1) annotation (Placement(transformation(extent={{-47,-4},{-27,16}}, rotation=0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table=[0,10; From 3155c90120bb1ee8fb80514d5118b4a2fae43191 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 20 May 2026 11:36:24 +0200 Subject: [PATCH 174/213] #125 ThermoSysPro.Fluid.Examples.Book.SimpleExample.HX but not all working --- .../DynamicWaterHeater/Islanding.mo | 33 ++++++++++++--- .../DynamicWaterHeater/NegativeFlow.mo | 33 ++++++++++++--- .../DynamicWaterHeater/ZeroFlow.mo | 33 ++++++++++++--- .../HeatExchanger/TestDynamicCondenser.mo | 23 +++++++++-- .../TestDynamicOnePhaseFlowShell.mo | 12 ++++-- .../TestDynamicPlateHeatExchanger.mo | 20 +++++---- .../TestDynamicTwoPhaseFlowPipe.mo | 11 +++-- .../HeatExchanger/TestNTUWaterHeater.mo | 37 ++++++++++++----- .../TestSimpleDynamicCondenser.mo | 27 +++++++++--- .../HeatExchanger/TestStaticCondenser.mo | 40 ++++++++++++++---- .../TestStaticPlateHeatExchanger.mo | 41 +++++++++++++------ 11 files changed, 238 insertions(+), 72 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo index 8437f2af..7f414a7e 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo @@ -1,17 +1,21 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater; model Islanding + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, option_temperature=false, P0=22.733e5, h0=2650.6e3) annotation (Placement(transformation(extent={{-192,110},{-150,150}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, option_temperature=false, P0(fixed=true) = 10e5) annotation (Placement(transformation(extent={{124,-202},{160,-162}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, Q(fixed=false, start=56), Cvmax(fixed=false) = 354.534, mode_caract=0, @@ -21,6 +25,8 @@ model Islanding {108,-166}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, Dc=0.016, Lc=2.56, PasL=0.027, @@ -129,15 +135,22 @@ model Islanding annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3) + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + h0=940.000e3) annotation (Placement(transformation(extent={{-150,22},{-192,66}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterIn(Q(fixed=false, start=650), K=35) + singularPressureLossWaterIn( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + K=35) annotation (Placement(transformation(extent={{-99,-48}, {-79,-28}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterOut(Q(fixed=false, start=650), K=30, + singularPressureLossWaterOut( + redeclare package Medium = Medium, + Q(fixed=false, start=650), K=30, C2(h_vol_1(start=927700), h(start=927700))) annotation (Placement(transformation(extent={{-80,34}, {-100,54}}, rotation=0))); @@ -151,13 +164,16 @@ model Islanding annotation (Placement(transformation(extent={{-196,-88},{ -176,-68}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, P0=71.29e5, h0=772.09e3, T0=454.46, option_temperature=true) annotation (Placement(transformation(extent={{-192,-60},{-150,-16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53) + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=53) annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA( @@ -176,11 +192,15 @@ model Islanding ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43) annotation (Placement(transformation(extent={{191, -140},{169,-118}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3))) + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + C2(h_vol_1(start=2600e3), h(start=2600e3))) annotation (Placement(transformation(extent={{-100,122},{-84,138}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3, + singularPressureLossPurge( + redeclare package Medium = Medium, + Q(fixed=false, start=56), K=1e-3, T(fixed=true, start=461.56), Pm(start=2220000)) annotation (Placement(transformation( origin={54,-138}, @@ -191,6 +211,7 @@ model Islanding annotation (Placement(transformation(extent={{162,-178},{182, -158}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, Q(fixed=false, start=650), lambda(fixed=false) = 0.03, L=48.72, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo index d73dc9a6..f8c679ca 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo @@ -1,17 +1,21 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater; model NegativeFlow + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, option_temperature=false, P0=22.733e5, h0=2650.6e3) annotation (Placement(transformation(extent={{-192,110},{-150,150}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, option_temperature=false, P0(fixed=true) = 10e5) annotation (Placement(transformation(extent={{124,-202},{160,-162}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, Q(fixed=false, start=56), Cvmax(fixed=false) = 354.534, mode_caract=0, @@ -21,6 +25,8 @@ model NegativeFlow {108,-166}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, Dc=0.016, Lc=2.56, PasL=0.027, @@ -130,15 +136,22 @@ model NegativeFlow annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3) + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + h0=940.000e3) annotation (Placement(transformation(extent={{-150,22},{-192,66}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterIn(Q(fixed=false, start=650), K=35) + singularPressureLossWaterIn( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + K=35) annotation (Placement(transformation(extent={{-99,-48}, {-79,-28}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterOut(Q(fixed=false, start=650), K=30, + singularPressureLossWaterOut( + redeclare package Medium = Medium, + Q(fixed=false, start=650), K=30, C2(h_vol_1(start=927700), h(start=927700))) annotation (Placement(transformation(extent={{-80,34}, {-100,54}}, rotation=0))); @@ -151,13 +164,16 @@ model NegativeFlow annotation (Placement(transformation(extent={{-196,-88},{ -176,-68}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, P0=71.29e5, h0=772.09e3, T0=454.46, option_temperature=true) annotation (Placement(transformation(extent={{-192,-60},{-150,-16}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53) + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=53) annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0, @@ -175,11 +191,15 @@ model NegativeFlow ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43) annotation (Placement(transformation(extent={{191, -140},{169,-118}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3))) + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + C2(h_vol_1(start=2600e3), h(start=2600e3))) annotation (Placement(transformation(extent={{-100,122},{-84,138}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3, + singularPressureLossPurge( + redeclare package Medium = Medium, + Q(fixed=false, start=56), K=1e-3, T(fixed=true, start=461.56), Pm(start=2220000)) annotation (Placement(transformation( origin={54,-138}, @@ -190,6 +210,7 @@ model NegativeFlow annotation (Placement(transformation(extent={{162,-178},{182, -158}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, Q(fixed=false, start=650), lambda(fixed=false) = 0.03, L=48.72, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo index bcd3c1cb..f7e45860 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo @@ -1,17 +1,21 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater; model ZeroFlow + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, option_temperature=false, P0=22.733e5, h0=2650.6e3) annotation (Placement(transformation(extent={{-192,110},{-150,150}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, option_temperature=false, P0(fixed=true) = 10e5) annotation (Placement(transformation(extent={{124,-202},{160,-162}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, Q(fixed=false, start=56), Cvmax(fixed=false) = 354.534, mode_caract=0, @@ -21,6 +25,8 @@ model ZeroFlow {108,-166}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, Dc=0.016, Lc=2.56, PasL=0.027, @@ -130,15 +136,22 @@ model ZeroFlow annotation (Placement(transformation(extent={{-58,-90},{162,96}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0=940.000e3) + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + h0=940.000e3) annotation (Placement(transformation(extent={{-150,22},{-192,66}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterIn(Q(fixed=false, start=650), K=35) + singularPressureLossWaterIn( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + K=35) annotation (Placement(transformation(extent={{-99,-48}, {-79,-28}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossWaterOut(Q(fixed=false, start=650), K=30, + singularPressureLossWaterOut( + redeclare package Medium = Medium, + Q(fixed=false, start=650), K=30, C2(h_vol_1(start=927700), h(start=927700))) annotation (Placement(transformation(extent={{-80,34}, {-100,54}}, rotation=0))); @@ -151,13 +164,16 @@ model ZeroFlow annotation (Placement(transformation(extent={{-196,-88},{ -176,-68}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, P0=71.29e5, h0=772.09e3, T0=454.46, option_temperature=true) annotation (Placement(transformation(extent={{-192,-16},{-150,-60}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0=53) + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=53) annotation (Placement(transformation(extent={{-115,34},{-135,54}}, rotation= 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table=[0, @@ -175,11 +191,15 @@ model ZeroFlow ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k=0.43) annotation (Placement(transformation(extent={{191, -140},{169,-118}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start=2600e3), h(start=2600e3))) + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + C2(h_vol_1(start=2600e3), h(start=2600e3))) annotation (Placement(transformation(extent={{-100,122},{-84,138}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLossPurge(Q(fixed=false, start=56), K=1e-3, + singularPressureLossPurge( + redeclare package Medium = Medium, + Q(fixed=false, start=56), K=1e-3, T(fixed=true, start=461.56), Pm(start=2220000)) annotation (Placement(transformation( origin={54,-138}, @@ -190,6 +210,7 @@ model ZeroFlow annotation (Placement(transformation(extent={{162,-178},{182, -158}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, Q(fixed=false, start=650), lambda(fixed=false) = 0.03, L=48.72, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo index 7af4cbff..ac435324 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo @@ -1,5 +1,6 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; parameter Real COP1( fixed=false,start=0.7) "Corrective terme for heat exchange coefficient or Fouling coefficient"; @@ -8,18 +9,25 @@ model TestDynamicCondenser //parameter Modelica.SIunits.Position z=1.05 "Liquid level in Cavity"; ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Eau( + redeclare package Medium = Medium, h0=50000, Q0=19000) annotation (Placement(transformation(extent={{-191,-27},{-133,29}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_vapeur(Q0=310, h0= + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_vapeur( + redeclare package Medium = Medium, + Q0=310, h0= 2400e3) annotation (Placement(transformation(extent={{-192,144},{-134,200}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1(Q0=310) + ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1( + redeclare package Medium = Medium, + Q0=310) annotation (Placement(transformation(extent={{151,-187},{213,-133}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser DynamicCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, Dc=0.016, ec=0.5e-3, ntubest=52176, @@ -57,17 +65,20 @@ model TestDynamicCondenser annotation (Placement(transformation(extent={{-47,-52},{71,64}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_Eau( + redeclare package Medium = Medium, option_temperature=false, P0=100000) annotation (Placement(transformation(extent={{181,-8},{201,12}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_VapeurIn( + redeclare package Medium = Medium, Q(start=900), K=1e-4, Pm(start=10000)) annotation (Placement(transformation(extent={{-100, 162},{-80,182}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.ControlValve Valve_ext( + redeclare package Medium = Medium, Q(fixed=false, start=927), C1(P(start=10000), Q(start=927)), Cvmax=15000, @@ -77,10 +88,14 @@ model TestDynamicCondenser annotation (Placement(transformation(extent={{113, -123},{91,-101}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PressureLoss_VapeurIn_in4(K=1e-4, Q(fixed=false, start=0.01)) + PressureLoss_VapeurIn_in4( + redeclare package Medium = Medium, + K=1e-4, + Q(fixed=false, start=0.01)) annotation (Placement(transformation(extent={{-102,83}, {-82,102}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Vsup1(Q0=0.00001, + redeclare package Medium = Medium, h0=2759.6e3) annotation ( Placement(transformation( extent={{-191,65},{-134,119}}, rotation=0))); @@ -91,10 +106,12 @@ model TestDynamicCondenser rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_EauOut( + redeclare package Medium = Medium, K=1e-4, Q(start=20000)) annotation (Placement(transformation(extent={{112,-8}, {132,12}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1( + redeclare package Medium = Medium, Q(start=1000)) annotation (Placement(transformation( origin={12,96}, extent={{-6,-9},{6,9}}, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo index 33544c3a..b394a089 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo @@ -1,8 +1,11 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicOnePhaseFlowShell + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowPipeShell( + redeclare package Medium = Medium, + inertia=false, Q(start={30,30,30,30,30,30,30,30,30,30,30}), Ds=1, ntubes=520, @@ -10,14 +13,17 @@ model TestDynamicOnePhaseFlowShell P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000, 1973000,1965000,1955000,1950000})) annotation (Placement( transformation(extent={{-48,-36},{48,36}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature=false, P0(fixed= - false) = 1900000) + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + P0=1900000) annotation (Placement(transformation(extent={{74,-15},{102,15}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, option_temperature=false, h0=600e3, - Q(start=500, fixed=true), + Q(start=500, fixed=false), P0=2000000) annotation (Placement(transformation(extent={{-103,-15},{-75,15}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo index 5989c56d..87475594 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo @@ -1,12 +1,13 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicPlateHeatExchanger + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, Ns=5, Sc(Q(fixed=true, start=1036)), - region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, Qc(start={39464.19306563736,39464.19140625,39464.19140625,39464.19140625,39464.19140625, 39464.19140625}), hc(start={280049.6746505721,280050.4252984669,280051.8112565058,280040.0015809256, @@ -24,19 +25,22 @@ model TestDynamicPlateHeatExchanger annotation (Placement(transformation(extent={{-14,6},{6,26}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0=340, region= - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-74,6},{-54,26}}, rotation= 0))); - BoundaryConditions.SourceP sourcePQ(region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, + BoundaryConditions.SourceP sourcePQ( + redeclare package Medium = Medium, Q(start=1084)) annotation (Placement( transformation(extent={{-54,-14},{-34,6}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)= - 100000, region= - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) + 100000, + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{46,6},{66,26}}, rotation=0))); - BoundaryConditions.SinkP puitsP3(region=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) + BoundaryConditions.SinkP puitsP3( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{26,-14},{46,6}}, rotation=0))); equation diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo index 3e63b726..962b6345 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo @@ -1,12 +1,13 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicTwoPhaseFlowPipe + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1( + redeclare package Medium = Medium, + inertia=false, L=10, D=0.03, - dpfCorr(fixed=false, - start=0.2396333653343408)= - 1, + dpfCorr=1, P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818, 1998271.6837222823,1997833.0364982954,1997391.599890757, 1996715.8221090273,1995640.018272837,1994163.014585635, @@ -14,13 +15,15 @@ model TestDynamicTwoPhaseFlowPipe annotation (Placement(transformation(extent={{-40,-48}, {40,10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( - C(Q(fixed=true, start=1)), + redeclare package Medium = Medium, + C(Q(fixed=false, start=1)), option_temperature=false, h0=800e3, P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation= 0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium, option_temperature=false, h0=2000e3, P0=19.9e5) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo index 8053f0e9..aef644a1 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo @@ -1,41 +1,56 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestNTUWaterHeater + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium, Q0=1788.90, h0=760.83e3, P0=8270000) annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium, option_temperature=false, P0=17.49e5, h0=2432.50e3) annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss6(K=1e-4) + singularPressureLoss6( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-111, -16},{-91,4}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss7(K=1e-4) + singularPressureLoss7( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-110,84}, {-90,104}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3 + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss8(K=1e-4) + singularPressureLoss8( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{75,-16}, {95,4}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss9(K=1e-4) + singularPressureLoss9( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{75,-75}, {95,-55}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium, + redeclare package Medium_c = Medium, HeiF(start=900000), HDesF(start=900000), Hep(start=500000), @@ -47,20 +62,22 @@ model TestNTUWaterHeater h(start=780000)), Ep(Q(start=118)), Ev(P(start=27.22e5), h_vol_2(start=2430000)), - KCond(fixed=false) = 5024, - KPurge(fixed=false) = 1767, + KCond=5024, + KPurge=1767, Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), - lambdaE(fixed=false) = 67.1, + lambdaE=67.1, SPurge=1458, Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true))) annotation (Placement(transformation(extent={{-66,-77},{ 50,65}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( - K=1e-4) + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-110,35}, {-90,55}}, rotation=0))); BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium, Q0=118.02, h0=889.89e3) annotation (Placement(transformation(extent={{-174,35},{-154,55}}, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo index 6612b1c9..c4e9292c 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo @@ -1,5 +1,6 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestSimpleDynamicCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; parameter Real L1 = 425 "First sensor chain length"; parameter Integer Ns1 = 80 "Number of cells in the first sensor chain"; @@ -8,47 +9,63 @@ parameter Real L2 = 75 "Second sensor chain length"; parameter Integer Ns2 = 1 "Number of cells in the second sensor chain"; ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, P0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{48,30}, {88,70}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe( K=1e-6, Q(start= + PerteChargeCondPompe( + redeclare package Medium = Medium, + K=1e-6, Q(start= 0.598447)) annotation (Placement(transformation( origin={-90,-38}, extent={{-10,-10},{10,10}}, rotation=180))); ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( + redeclare package Medium = Medium, option_temperature=false, h0=2401e3, P0=15050) annotation (Placement(transformation(extent={{-207, 148},{-183,170}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( + redeclare package Medium = Medium, h0=191812, Q0=192) annotation (Placement(transformation(extent={{-184, -52},{-208,-24}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0=29804.5, h0=113e3) + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( + redeclare package Medium = Medium, + Q0=29804.5, h0=113e3) annotation (Placement(transformation(extent={{-212,30}, {-172,68}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe1( K=1e-6) + PerteChargeCondPompe1( + redeclare package Medium = Medium, + K=1e-6) annotation (Placement(transformation( origin={36,50}, extent={{6,-10},{-6,10}}, rotation=180))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe2( K=1e-6) + PerteChargeCondPompe2( + redeclare package Medium = Medium, + K=1e-6) annotation (Placement(transformation( origin={-154,49}, extent={{6,-10},{-6,10}}, rotation=180))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - PerteChargeCondPompe3(K(fixed=false) = 1e-3, Q(start=192, fixed=true)) + PerteChargeCondPompe3( + redeclare package Medium = Medium, + K=1e-3, + Q(start=192, fixed=false)) annotation (Placement(transformation( origin={-120,159}, extent={{10,-10},{-10,10}}, rotation=180))); ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( D=0.018, + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, V=1000, A=100, lambda=0.01, diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo index 8f6287be..a46ecb3a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo @@ -1,5 +1,6 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestStaticCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) "Flow pressure at inlet 1 (sourceP)"; @@ -8,10 +9,13 @@ model TestStaticCondenser parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) "Flow pressure at inlet 3 (sourceP2)"; - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(P0(fixed=false) = 100000) + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur( + redeclare package Medium = Medium, + P0=100000) annotation (Placement(transformation(extent={{158,-15},{178,5}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, option_temperature=false, P0=Pin_1, C(Q(fixed=true, start=832.66)), @@ -19,42 +23,57 @@ model TestStaticCondenser annotation (Placement(transformation(extent={{-100,140},{-80,160}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, option_temperature=false, h0=2.5481e6, C(Q(fixed=true, start=1e-5)), P0=Pin_2) annotation (Placement(transformation(extent={ {-182,80},{-162,100}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, option_temperature=false, h0=2.5055e6, C(Q(fixed=true, start=1e-5)), P0=Pin_3) annotation (Placement(transformation(extent= {{-180,40},{-160,60}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss(K=10) + singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,80}, {-80,100}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss1(K=10) + singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,40}, {-80,60}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss3(K=10) + singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-40,140}, {-20,160}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss4(K=1e-4) + singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{98,-15}, {118,5}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss - singularPressureLoss5(K=1e-4) + singularPressureLoss5( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{40,-100}, {60,-80}}, rotation=0))); ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, SCO=47786, z=0, CPCE=0, @@ -62,12 +81,15 @@ model TestStaticCondenser QC0=37700) annotation (Placement(transformation( extent={{-24,-24},{68,74}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur( + redeclare package Medium = Medium, h0=60e3, - C(P(fixed=true, start=328800)), + C(P(fixed=false, start=328800)), Q0(fixed=true) = 42261) annotation (Placement(transformation(extent={{-189,-25},{-146,15}}, rotation=0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(K=1e-3) + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-3) annotation (Placement(transformation(extent={{-101, -15},{-81,5}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo index e6afa9c7..b57a86bb 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo @@ -1,42 +1,59 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestStaticPlateHeatExchanger + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, Sp=2, Sc(Q(fixed=true, start=1036.78)), - region_c=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) + Hmc(start=220524.0), + Hmf(start=127690.0), + Qf(start=1000.0)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, T0=340) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3( + redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-50,10},{-30,30}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)= + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2( + redeclare package Medium = Medium, + P0(fixed=false)= 100000) annotation (Placement(transformation( extent={{50,30},{70,50}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{30,10},{50,30}}, rotation=0))); - ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c= - ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, - region_f=ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) - annotation (Placement(transformation(extent={{-10,-34},{10,-14}}, + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Hmc(start=220524.0), + Hmf(start=127690.0), + Qc(start=1000.0), + Qf(start=1000.0)) annotation (Placement(transformation(extent={{-10,-34},{10,-14}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP6( + redeclare package Medium = Medium, T0=340) annotation (Placement(transformation(extent={{-70,-34},{-50,-14}}, rotation= 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP7 + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP7( + redeclare package Medium = Medium) annotation (Placement( transformation(extent={{-50,-54},{-30,-34}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP6 + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP6( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{50,-34},{70,-14}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP7 + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP7( + redeclare package Medium = Medium) annotation (Placement(transformation( extent={{30,-54},{50,-34}}, rotation=0))); equation From bbf765c3f065b2939601ce1509487c3cba3428ce Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 22 May 2026 10:49:47 +0200 Subject: [PATCH 175/213] #125 HX exemples inside SimpleExamples --- .../HeatExchangers/TestDynamicCondenser.mo | 31 ++++++++++++++++--- ...DynamicFlueGasesMultiFluidHeatExchanger.mo | 5 +-- ...TestDynamicMultiFluidHeatExchangerShell.mo | 5 ++- ...cMultiFluidHeatExchangerShell_FlueGases.mo | 15 ++++++--- ...ynamicMultiFluidHeatExchanger_FlueGases.mo | 15 ++++++--- .../TestDynamicTwoPhaseFlowPipe.mo | 2 +- .../TestDynamicTwoPhaseFlowPipe_Traces.mo | 2 +- .../HeatExchangers/TestDynamicWaterHeater.mo | 18 +++++++---- .../TestDynamicWaterHeaterOnePipe.mo | 17 ++++++---- ...namicWaterSteamMultiFluidsHeatExchanger.mo | 3 +- .../TestSimpleDynamicCondenser_Traces.mo | 4 +-- .../HeatExchangers/TestSteamGenerator_1SG.mo | 30 +++++++++++++++++- .../HeatExchangers/TestSteamGenerator_4SG.mo | 9 ++++-- 13 files changed, 117 insertions(+), 39 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo index 94c9e846..3568f0c4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo @@ -11,20 +11,41 @@ model TestDynamicCondenser Ns=3, ntubest=1000, ntubesV=50, + C1vap(P(start=66004), h_vol_2(start=353999)), + C2vap(P(start=66004), h_vol_2(start=353999)), + C1(P(start=66004)), + C2ex(P(start=47631), h(start=370191)), + DynamicCondenser( + P(start=66004), + Pfond(start=47631), + hv(start=353999), + hl(start=370191), + Tp(start=357.683), + Tp1(start={351.781,354.987,356.535}), + CvBP(P(start=66004), h_vol_2(start=353999)), + CvGCT(P(start=66004), h_vol_2(start=353999)), + Cl(P(start=47631))), + Wall_3(Tp2(start={351.781,354.987,356.535})), + pipe_3( + P(start={107635,105730,103825,101915,100000}), + mu2(start=fill(9.14034e-4, 4)), + rho2(start=fill(997.34, 4))), + sortieReelle(signal(start=-97.6173)), dynamic_energy_balance=false, dynamic_mass_balance=false, inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ vaporSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraVaporSource(redeclare package Medium = Medium, Q0=1e-4, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraWaterSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, Q0=10.0002, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ vaporSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false, C(P(start=66004), h_vol_2(start=353999))) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraVaporSource(redeclare package Medium = Medium, Q0=1e-4, h0=2.7e6, option_temperature=false, C(P(start=66004), h_vol_2(start=353999))) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraWaterSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false, C(P(start=66004))) annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, Q0=10.0002, h0=1e5, option_temperature=false, C(P(start=47631), h(start=370191))) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-20},{-50,0}}))); ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{50,-20},{70,0}}))); equation connect(vaporSource.C, condenser.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); connect(extraVaporSource.C, condenser.C2vap) annotation (Line(points={{-50,60},{-3.9,60},{-3.9,9.2}}, color={0,0,255})); connect(extraWaterSource.C, condenser.C1) annotation (Line(points={{-50,30},{-8.1,30},{-8.1,7.5}}, color={0,0,255})); - connect(condenser.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-50}}, color={0,0,255})); + connect(condenser.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); connect(coolingSource.C, condenser.Ce1) annotation (Line(points={{-50,-10},{-10,-10},{-10,-0.1}}, color={0,0,255})); connect(condenser.Ce2, coolingSink.C) annotation (Line(points={{9.9,-0.1},{30,-0.1},{30,-10},{50,-10}}, color={0,0,255})); annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo index fd5ab781..4345686d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo @@ -10,11 +10,12 @@ model TestDynamicFlueGasesMultiFluidHeatExchanger redeclare package Medium_FlueGases = Medium_FlueGases, h0=fill(1.2e6, 1), option_temperature=false, + ExchangerFlueGasesMetal(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), dynamic_energy_balance=false, dynamic_mass_balance=false, inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFg(redeclare package Medium = Medium_FlueGases, Q0=10, T0=573.15, option_temperature=true, X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFg(redeclare package Medium = Medium_FlueGases, P0=100000, T0=573.15, option_temperature=true) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFg(redeclare package Medium = Medium_FlueGases, Q0=10, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFg(redeclare package Medium = Medium_FlueGases, P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceWs(redeclare package Medium = Medium, P0=300000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWs(redeclare package Medium = Medium, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); equation diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo index ec2729ec..7699ef1f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo @@ -8,6 +8,8 @@ model TestDynamicMultiFluidHeatExchangerShell ThermoSysPro.Fluid.HeatExchangers.DynamicMultiFluidHeatExchangerShell exchanger( redeclare package Medium_shell = Medium_shell, redeclare package Medium_pipe = Medium_pipe, + Dint=0.016, + Dext=0.019, dynamic_energy_balance=false, dynamic_mass_balance=false, inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); @@ -19,6 +21,7 @@ equation connect(sourcePipe.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); connect(exchanger.Cws2, sinkPipe.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); connect(sourceShell.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); - connect(exchanger.Cfg2, sinkShell.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + connect(exchanger.Cfg2, sinkShell.C) annotation (Line(points={{0,-5},{0,-32},{0,-60},{-10,-60}}, + color={0,0,255})); annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicMultiFluidHeatExchangerShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo index ae54a033..7df2c666 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo @@ -3,9 +3,14 @@ model TestDynamicMultiFluidHeatExchangerShell_FlueGases extends TestDynamicMultiFluidHeatExchangerShell( redeclare package Medium_shell = Properties.Media.FlueGases, redeclare package Medium_pipe = Properties.Media.FlueGases, - exchanger(P0=450000, h0=fill(3e6, 1), option_temperature=false), - sourceShell(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), - sinkShell(P0=100000, h0=3e6, option_temperature=false), - sourcePipe(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), - sinkPipe(P0=100000, h0=3e6, option_temperature=false)); + exchanger( + P0=450000, + h0=fill(3e6, 1), + option_temperature=false, + dynamicOnePhaseFlowShell(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + DynamicOnePhaseFlowPipe(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2)))), + sourceShell(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sinkShell(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))), + sourcePipe(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sinkPipe(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6)))); end TestDynamicMultiFluidHeatExchangerShell_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo index 0a8a7d9a..a794ed00 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo @@ -3,9 +3,14 @@ model TestDynamicMultiFluidHeatExchanger_FlueGases extends TestDynamicMultiFluidHeatExchanger( redeclare package Medium_1 = Properties.Media.FlueGases, redeclare package Medium_2 = Properties.Media.FlueGases, - exchanger(P0=450000, h0=fill(3e6, 1), option_temperature=false), - source1(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), - sink1(P0=100000, h0=3e6, option_temperature=false), - source2(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}), - sink2(P0=100000, h0=3e6, option_temperature=false)); + exchanger( + P0=450000, + h0=fill(3e6, 1), + option_temperature=false, + DynamicOnePhaseFlowPipe_1(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + DynamicOnePhaseFlowPipe_2(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2)))), + source1(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sink1(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))), + source2(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sink2(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6)))); end TestDynamicMultiFluidHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo index 9a62daa1..e17466f4 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo @@ -40,4 +40,4 @@ equation connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); -end TestDynamicTwoPhaseFlowPipe; \ No newline at end of file +end TestDynamicTwoPhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo index 1fdfc005..f5decb40 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo @@ -43,4 +43,4 @@ equation connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); -end TestDynamicTwoPhaseFlowPipe_Traces; \ No newline at end of file +end TestDynamicTwoPhaseFlowPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo index 6569c47c..5aab623f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo @@ -10,23 +10,29 @@ model TestDynamicWaterHeater redeclare package Medium_Cooling = Medium_Cooling, dynamic_energy_balance=true, dynamic_mass_balance=true, - steady_state=false, P0c=2200000, Vf0=0.43, pipe_1(h0=fill(9e5, 10), P0=6900000), pipe_2(h0=fill(1.0e6, 10), P0=6900000), pipe_3(h0=fill(9e5, 20), P0=6900000), - inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + inertia=false, + volumeC(P0=6900000, P(start=6900000)), + volumeD1(P0=6900000, P(start=6900000)), + volumeD(P0=6900000, P(start=6900000))) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP condensateSink(redeclare package Medium = Medium, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, + Q0=10 + 1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, + P0=6900000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); equation connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); - connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-50}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); - connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-50,20}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-70,20}}, color={0,0,255})); annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicWaterHeater; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo index 88c9f980..1593241d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo @@ -10,21 +10,26 @@ model TestDynamicWaterHeaterOnePipe redeclare package Medium_Cooling = Medium_Cooling, dynamic_energy_balance=true, dynamic_mass_balance=true, - steady_state=false, P0c=2200000, Vf0=0.43, pipe_3(h0=fill(9e5, 20), P0=6900000), - inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + inertia=false, + volumeC(P0=6900000, P(start=6900000)), + volumeD(P0=6900000, P(start=6900000))) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP condensateSink(redeclare package Medium = Medium, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, + Q0=10 + 1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, + P0=6900000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); equation connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); - connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-50}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); - connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-50,20}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-70,20}}, color={0,0,255})); annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); end TestDynamicWaterHeaterOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo index 42c72368..163d83df 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo @@ -17,7 +17,8 @@ model TestDynamicWaterSteamMultiFluidsHeatExchanger ThermoSysPro.Fluid.BoundaryConditions.SinkP sink2(redeclare package Medium = Medium_2, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); equation connect(source1.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); - connect(exchanger.Cfg2, sink1.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + connect(exchanger.Cfg2, sink1.C) annotation (Line(points={{0,-5},{0,-32},{0,-60},{-10,-60}}, + color={0,0,255})); connect(source2.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); connect(exchanger.Cws2, sink2.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo index b974b142..97ebc8ef 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo @@ -2,7 +2,7 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; model TestSimpleDynamicCondenser_Traces extends ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers.TestSimpleDynamicCondenser( redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, - Condenseur(redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=Condenseur.xv)) - + Condenseur(redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=Condenseur.xv) +) ) annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); end TestSimpleDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo index 569af238..850ef506 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo @@ -8,6 +8,33 @@ model TestSteamGenerator_1SG ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_1SG steamGenerator( redeclare package Medium = Medium, redeclare package Medium_Primary = Medium_Primary, + DomeGV( + Cm(h_vol_1(start=1467382.1491761294), + Q(start=3682.6323348377664)), + hl(start=1239103.1618852438), + Tp(start=1085.1630860204652, displayUnit="degC"), + Pfond(start=6537896.329041586, displayUnit="bar")), + DownComerGV(C2(P(start=6652618.15111204, displayUnit="bar"))), + fluidInlet(h_vol_2(start=1203352.0170161917)), + fluidInlet1(P(start=15603447.190394623, displayUnit="bar")), + fluidOutletI(h_vol_1(start=2.82156e6)), + fluidOutletI1(h(start=1266398.0525517925)), + MixAlimDomeGV(P(start=6597719.510802327, displayUnit="bar"), + Cs(h_vol_2(start=1203352.0170161917))), + outputReal(signal(start=-6.329123415280561)), + RiserGV( + h(start={1.20335e6,1.28046e6,1.34313e6,1.39379e6,1.43460e6,1.46738e6,1.46738e6}), + P(start={6.65262e6,6.63846e6,6.62828e6,6.62094e6,6.61445e6,6.60826e6,6.53790e6}), + Tp1(start={556.156,555.899,555.700,555.537,555.398}), + Tp2(start={557.644,557.097,556.655,556.295,555.999}), + state1(h(start={1280461.0750118925,1343134.833335842,1393794.5882590986,1434595.9090880589,1467382.1491761294}), p(start={6638456.595608159,6628277.414901627,6620936.90876653,6614447.789782153,6608263.233348276}, each displayUnit="bar"))), + UtubeColdtLeg( + P(start={1.54474e7,1.54475e7,1.54477e7,1.54482e7,1.54487e7,1.54493e7,1.54500e7}), + Tp(start={565.892673062783,563.7423137333859,562.0024887705413,560.5974122265403,559.4633025748175}, each displayUnit="degC")), + UtubeHotLeg( + P(start={1.56034e7,1.55774e7,1.55514e7,1.55254e7,1.54994e7,1.54734e7,1.54474e7}), + Tp(start={586.895939774836,580.9426855874689,575.9677586513063,571.864684816329,568.5110695637635}, each displayUnit="degC")), + DPnulle_AlimDwnc(rho(start=830.6664450130019, displayUnit="g/cm3")), dynamic_energy_balance=false, dynamic_mass_balance=false, inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); @@ -17,7 +44,8 @@ model TestSteamGenerator_1SG ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); equation connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); - connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,50}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,34},{0,60},{-10,60}}, + color={0,0,255})); connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo index 1d436e20..823a3933 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo @@ -11,13 +11,16 @@ model TestSteamGenerator_4SG dynamic_energy_balance=false, dynamic_mass_balance=false, inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, Q0=531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, + Q0=4*531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); ThermoSysPro.Fluid.BoundaryConditions.SinkP steamSink(redeclare package Medium = Medium, P0=6600000, h0=2.77257e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, Q0=4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, + Q0=4*4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); equation connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); - connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,50}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,34},{0,60},{-10,60}}, + color={0,0,255})); connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); From 631e4afda73fa6c3b658c7ecf9617197d516f5ca Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 8 Jun 2026 17:48:15 +0200 Subject: [PATCH 176/213] #125 issue with the rebase --- ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo | 2 -- 1 file changed, 2 deletions(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index 3bb6f579..54439c4d 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -112,8 +112,6 @@ equation Pm = (C1.P + C2.P)/2; state = Medium.setState_phX(p=Pm, h=h, X=X); - state=Medium.setState_phX(p=Pm, h=h, X=X); - if (p_rho > 0) then rho = p_rho; else From 0455263df6330588feb2283022fab57365e14992 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Tue, 9 Jun 2026 09:47:30 +0200 Subject: [PATCH 177/213] #125 changed some init for examples --- .../TestDynamicTwoPhaseFlowPipe.mo | 11 ++++---- .../SimpleExamples/Volume/TestStaticDrum3.mo | 13 +++++++--- .../TestGenericCombustion1DWithPipe.mo | 26 +++++++------------ .../TestDynamicTwoPhaseFlowPipe.mo | 6 ++--- .../TestDynamicTwoPhaseFlowPipe_Traces.mo | 2 +- .../TestTwoPhaseCavityOnePipe_Traces.mo | 4 +-- 6 files changed, 30 insertions(+), 32 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo index 962b6345..3fe20f25 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo @@ -7,16 +7,15 @@ model TestDynamicTwoPhaseFlowPipe inertia=false, L=10, D=0.03, - dpfCorr=1, - P(start={2000000.0,1999571.707027408,1999140.94021676,1998707.6248918818, - 1998271.6837222823,1997833.0364982954,1997391.599890757, - 1996715.8221090273,1995640.018272837,1994163.014585635, - 1992283.4952231126,1990000.0})) + dpfCorr( + fixed=false, + start=0.2396333653343408) = 1, + P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,1995640.0182728,1994163.0145856,1992283.4952231,1990000})) annotation (Placement(transformation(extent={{-40,-48}, {40,10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( redeclare package Medium = Medium, - C(Q(fixed=false, start=1)), + C(Q(fixed=true, start=1)), option_temperature=false, h0=800e3, P0=2000000) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo index 6eb37c0f..3cb722f2 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo @@ -8,12 +8,14 @@ model TestStaticDrum3 ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1( redeclare package Medium = Medium, - K=1e-4) + K=1e-4, + rho(start=688.4113, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{38,7},{58,27}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2( redeclare package Medium = Medium, - K=1e-4) + K=1e-4, + rho(start=691.7364, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-58,-8},{-38,12}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( redeclare package Medium = Medium, @@ -33,7 +35,8 @@ model TestStaticDrum3 ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3( redeclare package Medium = Medium, - K=1e-4) + K=1e-4, + rho(start=55.45212, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{38,52},{58,72}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink( redeclare package Medium = Medium) @@ -46,7 +49,9 @@ model TestStaticDrum3 D=0.05, ntubes=10, L=10, - z2=10) annotation (Placement(transformation( + z2=10, + P(start={10053832.0,10046967.0,10041924.0,10037550.0,10033392.0,10029237.0,10024966.0,10020505.0,10015807.0,10010839.0,10005576.0,10000000.0}, each displayUnit="bar")) + annotation (Placement(transformation( origin={-28.5,-45.5}, extent={{13.5,11.5},{-13.5,-11.5}}, rotation=270))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo index f9d75047..80cede49 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo @@ -4,13 +4,13 @@ model TestGenericCombustion1DWithPipe replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; - ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D combustionChamber( + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS( redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, NCEL=7, Qm(fixed=false), Qsf(fixed=false), - kcham(fixed=true)=0.1, + kcham(fixed=true) = 0.1, Acham=275, Xbf=0, ImbCV=0.05, @@ -18,8 +18,7 @@ model TestGenericCombustion1DWithPipe Kec=8.8, SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56}, ImbBF=0.0, - Psf(start=113275)) - annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0))); + Psf(start=113275)) annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0))); ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( Xn=0.0208, Xashes=0.136, @@ -90,21 +89,16 @@ model TestGenericCombustion1DWithPipe ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPipe( redeclare package Medium = Medium, option_temperature=false, - Q(start=486.69), + Q(start=486.69, fixed=true), h0=2.5e6, - P0=19621600) + P0(fixed=false) = 19621600) annotation (Placement(transformation(origin={90,90.5}, extent={{14.5,-15},{-14.5,15}}, rotation=270))); equation - connect(sourceFuel.C, combustionChamber.Cfuel) - annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0})); - connect(combustionChamber.Cfg, sinkFlueGases.C) - annotation (Line(points={{0,65.6},{0,91}}, color={0,0,0})); - connect(sourceAir.C, combustionChamber.Ca) - annotation (Line(points={{0,-78},{0,-49.6}}, color={0,0,0})); - connect(sourceWaterSteam.C, combustionChamber.Cws) - annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255})); - connect(combustionChamber.Cth, wall.WT2) - annotation (Line(points={{55.8,8},{68,8},{68,7.5},{76,7.5}}, color={191,95,0})); + connect(sourceFuel.C, genericCombustionCCS.Cfuel) annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0})); + connect(genericCombustionCCS.Cfg, sinkFlueGases.C) annotation (Line(points={{0,65.6},{0,91}}, color={0,0,0})); + connect(sourceAir.C, genericCombustionCCS.Ca) annotation (Line(points={{0,-78},{0,-49.6}}, color={0,0,0})); + connect(sourceWaterSteam.C, genericCombustionCCS.Cws) annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255})); + connect(genericCombustionCCS.Cth, wall.WT2) annotation (Line(points={{55.8,8},{68,8},{68,7.5},{76,7.5}}, color={191,95,0})); connect(wall.WT1, pipeWaterSteam.CTh) annotation (Line(points={{70,7.5},{71,7.5},{71,8},{86.2,8}}, color={191,95,0})); connect(sourcePipe.C, pipeWaterSteam.C1) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo index e17466f4..986a0e6b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo @@ -13,7 +13,7 @@ model TestDynamicTwoPhaseFlowPipe annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( redeclare package Medium = Medium, - C(Q(start=1)), + C(Q(start=1, fixed=true)), option_temperature=false, h0=800e3, P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); @@ -21,7 +21,7 @@ model TestDynamicTwoPhaseFlowPipe redeclare package Medium = Medium, option_temperature=false, h0=2000e3, - P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + P0=19.9e5) annotation (Placement(transformation(extent={{68,-28},{88,-8}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( option_temperature=2, T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, @@ -36,7 +36,7 @@ model TestDynamicTwoPhaseFlowPipe D=0.03) annotation (Placement(transformation(extent={{-40,-28},{40,52}}, rotation=0))); equation connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); - connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{68,-18}}, color={0,0,255})); connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo index f5decb40..178c5f8c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo @@ -15,7 +15,7 @@ model TestDynamicTwoPhaseFlowPipe_Traces annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( redeclare package Medium = Medium, - C(Q(start=1), SubC(start={0.1})), + C(Q(start=1, fixed=true), SubC(start={0.1})), option_temperature=false, h0=800e3, P0=2000000, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo index a08ab52e..7a5465cd 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo @@ -38,8 +38,8 @@ model TestTwoPhaseCavityOnePipe_Traces h0=2.8e6, SubC0={10}) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( - redeclare package Medium = Medium, - Q0=0) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + redeclare package Medium = Medium, Q0=3) + annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( T0={293.15, 293.15}, From 791b649fef700cd11b1243693025081b6713af30 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 15:17:59 +0200 Subject: [PATCH 178/213] #125 added subC0 to PlugA for example --- ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo | 5 +++++ .../SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo index 426c50b4..0b3995f0 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo @@ -6,6 +6,9 @@ model PlugA "Plug" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); public Units.SI.MassFlowRate Q "Fluid mass flow rate"; @@ -24,6 +27,8 @@ equation C.diff_res_1 = 0; C.diff_on_1 = diffusion; + C.SubC = SubC0; + /* Flow reversal */ if continuous_flow_reversal then C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo index b8cd3e1d..3d031a88 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo @@ -17,7 +17,10 @@ model TestStaticDrum_Plug_Traces ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug(redeclare package Medium = Medium, C(h(fixed=false), SubC={10})) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug( + redeclare package Medium = Medium, + SubC0={10}, + C(h(fixed=false))) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); equation connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255})); connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); From b3dfa7d3d81edf29dd71fe7ebd3a12f412e17525 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 15:56:23 +0200 Subject: [PATCH 179/213] #125 port media foundation onto develop --- .../Fluid/Interfaces/Connectors/FluidInlet.mo | 10 +- .../Interfaces/Connectors/FluidOutlet.mo | 10 +- .../Properties/Media/C3H3F5/package.mo | 605 +++++++++++++++ .../Properties/Media/C3H3F5/package.order | 59 ++ .../Media/DryAirIdealGas/package.mo | 254 ++++++ .../Media/DryAirIdealGas/package.order | 29 + .../Properties/Media/FlueGases/package.mo | 74 ++ .../Properties/Media/FlueGases/package.order | 4 + ThermoSysPro/Properties/Media/Functions.mo | 17 + .../Properties/Media/MoltenSalt/package.mo | 249 ++++++ .../Properties/Media/MoltenSalt/package.order | 28 + .../Media/Oil_TherminolVP1/package.mo | 233 ++++++ .../Media/Oil_TherminolVP1/package.order | 28 + .../Media/PartialSubCMedium/C_BiPhase.mo | 6 + .../HomogeneousPhasesSeparation.mo | 18 + .../Media/PartialSubCMedium/noSaS.mo | 6 + .../Media/PartialSubCMedium/package.mo | 6 + .../Media/PartialSubCMedium/package.order | 7 + .../partialPhasesSeparation.mo | 64 ++ .../Media/PartialSubCMedium/partialSaS.mo | 5 + .../PartialThermoSysProMedium/package.mo | 5 + .../PartialThermoSysProMedium/package.order | 0 .../package.mo | 5 + .../package.order | 0 .../Properties/Media/WaterSteam/package.mo | 731 ++++++++++++++++++ .../Properties/Media/WaterSteam/package.order | 53 ++ .../Media/WaterSteamSimple/package.mo | 466 +++++++++++ .../Media/WaterSteamSimple/package.order | 48 ++ ThermoSysPro/Properties/Media/package.mo | 115 +++ ThermoSysPro/Properties/Media/package.order | 11 + ThermoSysPro/Properties/package.order | 1 + 31 files changed, 3135 insertions(+), 12 deletions(-) create mode 100644 ThermoSysPro/Properties/Media/C3H3F5/package.mo create mode 100644 ThermoSysPro/Properties/Media/C3H3F5/package.order create mode 100644 ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo create mode 100644 ThermoSysPro/Properties/Media/DryAirIdealGas/package.order create mode 100644 ThermoSysPro/Properties/Media/FlueGases/package.mo create mode 100644 ThermoSysPro/Properties/Media/FlueGases/package.order create mode 100644 ThermoSysPro/Properties/Media/Functions.mo create mode 100644 ThermoSysPro/Properties/Media/MoltenSalt/package.mo create mode 100644 ThermoSysPro/Properties/Media/MoltenSalt/package.order create mode 100644 ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo create mode 100644 ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/package.order create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo create mode 100644 ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo create mode 100644 ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.order create mode 100644 ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo create mode 100644 ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.order create mode 100644 ThermoSysPro/Properties/Media/WaterSteam/package.mo create mode 100644 ThermoSysPro/Properties/Media/WaterSteam/package.order create mode 100644 ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo create mode 100644 ThermoSysPro/Properties/Media/WaterSteamSimple/package.order create mode 100644 ThermoSysPro/Properties/Media/package.mo create mode 100644 ThermoSysPro/Properties/Media/package.order diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo index 6f069bd8..ceb0c3f5 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo @@ -1,16 +1,14 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidInlet "Fluid inlet connector" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation(choicesAllMatching = true, Dialog(tab = "Fluid", group = "Medium")); Units.SI.Pressure P(start = 1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start = 500) "Mass flow rate of the fluid crossing the boundary of the control volume"; Units.SI.SpecificEnthalpy h(start = 1.e5) "Specific enthalpy of the fluid crossing the boundary of the control volume"; Units.SI.SpecificEnthalpy h_vol_1(start = 1.e5) "Fluid specific enthalpy in the control volume 1"; Units.SI.SpecificEnthalpy h_vol_2(start = 1.e5) "Fluid specific enthalpy in the control volume 2"; - input ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype "Fluid type"; - ThermoSysPro.Units.SI.MassFraction Xco2(start = 0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xo2(start = 0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xso2(start = 0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + Medium.ExtraProperty SubC[Medium.nC] "Substances concentration (ppm) of the fluid crossing the boundary of the control volume"; + Medium.MassFraction Xi[Medium.nXi] "Independent mixture mass fractions m_i/m of the fluid crossing the boundary of the control volume"; input Real diff_res_1(start = 1e4) "Diffusion resistance from control volume 1"; output Real diff_res_2(start = 1e4) "Diffusion resistance from control volume 2"; input Boolean diff_on_1 "true: with diffusion - false: without diffusion from control volume 1"; @@ -27,4 +25,4 @@ Author Daniel Bouskela ")); -end FluidInlet; \ No newline at end of file +end FluidInlet; diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo index 402bbbd8..76cbab14 100644 --- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo +++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo @@ -1,16 +1,14 @@ within ThermoSysPro.Fluid.Interfaces.Connectors; connector FluidOutlet "Fluid outlet connector" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation(choicesAllMatching = true, Dialog(tab = "Fluid", group = "Medium")); Units.SI.Pressure P(start = 1.e5) "Fluid pressure in the control volume"; Units.SI.MassFlowRate Q(start = 500) "Mass flow rate of the fluid crossing the boundary of the control volume"; Units.SI.SpecificEnthalpy h(start = 1.e5) "Specific enthalpy of the fluid crossing the boundary of the control volume"; Units.SI.SpecificEnthalpy h_vol_1(start = 1.e5) "Fluid specific enthalpy in the control volume 1"; Units.SI.SpecificEnthalpy h_vol_2(start = 1.e5) "Fluid specific enthalpy in the control volume 2"; - output ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType ftype "Fluid type"; - ThermoSysPro.Units.SI.MassFraction Xco2(start = 0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xo2(start = 0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xso2(start = 0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; + Medium.ExtraProperty SubC[Medium.nC] "Substances concentration (ppm) of the fluid crossing the boundary of the control volume"; + Medium.MassFraction Xi[Medium.nXi] "Independent mixture mass fractions m_i/m of the fluid crossing the boundary of the control volume"; output Real diff_res_1(start = 1e4) "Diffusion resistance from control volume 1"; input Real diff_res_2(start = 1e4) "Diffusion resistance from control volume 2"; output Boolean diff_on_1 "true: with diffusion - false: without diffusion from control volume 1"; @@ -27,4 +25,4 @@ Author Daniel Bouskela ")); -end FluidOutlet; \ No newline at end of file +end FluidOutlet; diff --git a/ThermoSysPro/Properties/Media/C3H3F5/package.mo b/ThermoSysPro/Properties/Media/C3H3F5/package.mo new file mode 100644 index 00000000..1f4cef83 --- /dev/null +++ b/ThermoSysPro/Properties/Media/C3H3F5/package.mo @@ -0,0 +1,605 @@ +within ThermoSysPro.Properties.Media; +package C3H3F5 "C3H3F5 medium using the legacy ThermoSysPro property functions" + + extends PartialTwoPhaseThermoSysProMedium( + isCompressible=true, + mediumName="C3H3F5", + substanceNames={"C3H3F5"}, + singleState=false, + SpecificEnthalpy(start=3.0e5, nominal=3.0e5, min=h_min, max=h_max), + Density(start=1000, nominal=1000), + AbsolutePressure(start=10e5, nominal=10e5, min=p_min, max=p_crit), + Temperature(start=300, nominal=300), + smoothModel=false, + onePhase=false, + fluidConstants={c3h3f5Constants}, + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant AbsolutePressure p_min=1 "Lower pressure bound of the legacy fit"; + constant AbsolutePressure p_crit=3640000 "Critical pressure used by the legacy fit"; + constant SpecificEnthalpy h_min=100000 "Lower enthalpy bound of the legacy fit"; + constant SpecificEnthalpy h_max=640000 "Upper enthalpy bound of the legacy fit"; + constant Temperature T_min=200 "Lower temperature search bound"; + constant Temperature T_max=6000 "Upper temperature search bound"; + + constant FluidConstants c3h3f5Constants( + iupacName="C3H3F5", + casRegistryNumber="", + chemicalFormula="C3H3F5", + structureFormula="", + molarMass=0.134047); + + redeclare record extends SaturationProperties + end SaturationProperties; + + redeclare record extends ThermodynamicState "Thermodynamic state" + SpecificEnthalpy h "Specific enthalpy"; + Density d "Density"; + Temperature T "Temperature"; + AbsolutePressure p "Pressure"; + end ThermodynamicState; + +protected + function saturationTemperature_p + input AbsolutePressure p "Pressure"; + output Temperature T "Saturation temperature"; + protected + AbsolutePressure Pcalc; + algorithm + if p > p_crit then + Pcalc := p_crit/100000; + elseif p <= 0 then + Pcalc := 1/100000; + else + Pcalc := p/100000; + end if; + + T := -0.0000033655*Pcalc^6 + 0.0004044854*Pcalc^5 - 0.0190328128*Pcalc^4 + + 0.4443722095*Pcalc^3 - 5.4337547883*Pcalc^2 + + 36.7572359309*Pcalc + 246.4280421048; + annotation (Inline=true); + end saturationTemperature_p; + + function temperatureResidual_h + extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, u); + y := pro.T - T; + end temperatureResidual_h; + + function saturationPressureResidual_p + extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction; + input Temperature T "Saturation temperature"; + algorithm + y := saturationTemperature_p(u) - T; + end saturationPressureResidual_p; + +public + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + "Base properties of C3H3F5" + Integer phase( + min=0, + max=2, + start=1, + fixed=false) "2 for two-phase, 1 for one-phase, 0 if not known"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + equation + pro = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + MM = fluidConstants[1].molarMass; + R_s = Modelica.Constants.R/fluidConstants[1].molarMass; + + phase = if pro.x > 0 and pro.x < 1 then 2 else 1; + sat = setSat_p(p); + state = ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=phase); + + T = pro.T; + d = pro.d; + u = h - p/d; + end BaseProperties; + + redeclare function density_ph + "Computes density as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + d := pro.d; + annotation (Inline=true); + end density_ph; + + redeclare function temperature_ph + "Computes temperature as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + T := pro.T; + annotation (Inline=true); + end temperature_ph; + + redeclare function extends setState_phX + "Return thermodynamic state as function of p and h" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_psX + "Return thermodynamic state as function of p and s" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + state := ThermodynamicState( + p=p, + h=pro.h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_psX; + + redeclare function specificEnthalpy_pT + "Compute specific enthalpy from p and T by inverting the legacy C3H3F5_Ph fit" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output SpecificEnthalpy h "Specific enthalpy"; + protected + Temperature Tlow; + Temperature Thigh; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proLow; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proHigh; + algorithm + proLow := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h_min); + proHigh := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h_max); + Tlow := proLow.T; + Thigh := proHigh.T; + + if T <= Tlow then + h := h_min; + elseif T >= Thigh then + h := h_max; + else + h := Modelica.Math.Nonlinear.solveOneNonlinearEquation( + function temperatureResidual_h(p=p, T=T), + h_min, + h_max); + end if; + end specificEnthalpy_pT; + + redeclare function specificEnthalpy_pTX + "Return specific enthalpy from pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input MassFraction X[:] "Mass fractions"; + input FixedPhase phase=0 + "2 for two-phase, 1 for one-phase, 0 if not known"; + output SpecificEnthalpy h "Specific enthalpy at p, T, X"; + algorithm + h := specificEnthalpy_pT(p, T, phase); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function density_pT + "Computes density as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Density d "Density"; + algorithm + d := density_ph(p, specificEnthalpy_pT(p, T, phase), phase); + annotation (Inline=true); + end density_pT; + + redeclare function extends setState_pTX + "Return thermodynamic state as function of p and T" + protected + SpecificEnthalpy h; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + h := specificEnthalpy_pT(p, T, phase); + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_dTX + "Return thermodynamic state as function of d and T" + algorithm + assert(false, "C3H3F5: setState_dTX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=p_min, + h=h_min, + T=T, + d=d, + phase=phase); + end setState_dTX; + + redeclare function extends setSmoothState + "Return a smooth thermodynamic state" + import Modelica.Media.Common.smoothStep; + algorithm + state := ThermodynamicState( + p=smoothStep(x, state_a.p, state_b.p, x_small), + h=smoothStep(x, state_a.h, state_b.h, x_small), + T=temperature_ph( + smoothStep(x, state_a.p, state_b.p, x_small), + smoothStep(x, state_a.h, state_b.h, x_small)), + d=density_ph( + smoothStep(x, state_a.p, state_b.p, x_small), + smoothStep(x, state_a.h, state_b.h, x_small)), + phase=0); + annotation (Inline=true); + end setSmoothState; + + redeclare function temperature_ps + "Compute temperature from pressure and specific entropy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + T := pro.T; + annotation (Inline=true); + end temperature_ps; + + redeclare function density_ps + "Computes density as a function of pressure and specific entropy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + d := pro.d; + annotation (Inline=true); + end density_ps; + + redeclare function extends pressure "Return pressure" + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature "Return temperature" + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density "Return density" + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy "Return specific enthalpy" + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + "Return specific internal energy" + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy "Specific entropy" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(state.p, state.h); + s := pro.s; + annotation (Inline=true); + end specificEntropy; + + redeclare function extends specificGibbsEnergy "Return specific Gibbs energy" + algorithm + g := state.h - state.T*specificEntropy(state); + annotation (Inline=true); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + "Return specific Helmholtz energy" + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + annotation (Inline=true); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + "Approximate specific heat capacity at constant pressure" + protected + constant Temperature dT=0.1; + algorithm + cp := (specificEnthalpy_pT(state.p, state.T + dT) - specificEnthalpy_pT(state.p, state.T - dT))/(2*dT); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + "Approximate specific heat capacity at constant volume" + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends velocityOfSound + "Velocity of sound is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy "Compute h(s,p)" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p_downstream, specificEntropy(refState)); + h_is := pro.h; + annotation (Inline=true); + end isentropicEnthalpy; + + redeclare function extends dynamicViscosity + "Dynamic viscosity is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: dynamicViscosity is not available in the legacy ThermoSysPro implementation"); + eta := 0; + end dynamicViscosity; + + redeclare function extends thermalConductivity + "Thermal conductivity is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: thermalConductivity is not available in the legacy ThermoSysPro implementation"); + lambda := 0; + end thermalConductivity; + + redeclare function extends surfaceTension + "Surface tension is not available in the legacy C3H3F5 implementation" + algorithm + assert(false, "C3H3F5: surfaceTension is not available in the legacy ThermoSysPro implementation"); + sigma := 0; + end surfaceTension; + + redeclare function extends saturationTemperature + "Saturation temperature" + algorithm + T := saturationTemperature_p(p); + annotation (Inline=true); + end saturationTemperature; + + redeclare function extends saturationTemperature_derp + "Derivative of saturation temperature w.r.t. pressure" + protected + constant AbsolutePressure dp=1; + algorithm + dTp := (saturationTemperature_p(p + dp) - saturationTemperature_p(p - dp))/(2*dp); + annotation (Inline=true); + end saturationTemperature_derp; + + redeclare function extends saturationPressure + "Saturation pressure" + protected + Temperature Tlow; + Temperature Thigh; + algorithm + Tlow := saturationTemperature_p(p_min); + Thigh := saturationTemperature_p(p_crit); + + if T <= Tlow then + p := p_min; + elseif T >= Thigh then + p := p_crit; + else + p := Modelica.Math.Nonlinear.solveOneNonlinearEquation( + function saturationPressureResidual_p(T=T), + p_min, + p_crit); + end if; + end saturationPressure; + + redeclare function setSat_p + "Return saturation properties from pressure" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + output SaturationProperties sat "Saturation property record"; + algorithm + sat := SaturationProperties( + psat=p, + Tsat=saturationTemperature_p(p)); + annotation (Inline=true); + end setSat_p; + + redeclare function setSat_T + "Return saturation properties from temperature" + extends Modelica.Icons.Function; + input Temperature T "Temperature"; + output SaturationProperties sat "Saturation property record"; + algorithm + sat := SaturationProperties( + psat=saturationPressure(T), + Tsat=T); + annotation (Inline=true); + end setSat_T; + + redeclare function extends bubbleEnthalpy + "Boiling curve specific enthalpy" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + hl := 1000*(-0.0000039275*Pcalc^6 + 0.0004780040*Pcalc^5 + - 0.0227439765*Pcalc^4 + 0.5370471515*Pcalc^3 + - 6.6496487588*Pcalc^2 + 46.8685173786*Pcalc + + 166.7823742593); + annotation (Inline=true); + end bubbleEnthalpy; + + redeclare function extends dewEnthalpy + "Dew curve specific enthalpy" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + hv := 1000*(-0.00000274*Pcalc^6 + 0.00032217*Pcalc^5 + - 0.01489673*Pcalc^4 + 0.34258030*Pcalc^3 + - 4.15381744*Pcalc^2 + 27.64876596*Pcalc + + 385.22149853); + annotation (Inline=true); + end dewEnthalpy; + + redeclare function extends bubbleDensity + "Boiling curve density" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + dl := 0.0000057803*Pcalc^6 - 0.0007528646*Pcalc^5 + + 0.0377373800*Pcalc^4 - 0.9314090824*Pcalc^3 + + 11.9184348938*Pcalc^2 - 89.9582798898*Pcalc + + 1467.5902188299; + annotation (Inline=true); + end bubbleDensity; + + redeclare function extends dewDensity + "Dew curve density" + protected + AbsolutePressure Pcalc; + algorithm + Pcalc := max(p_min, min(p_crit, sat.psat))/100000; + dv := 0.00000207*Pcalc^6 - 0.00019163*Pcalc^5 + + 0.00675913*Pcalc^4 - 0.10924667*Pcalc^3 + + 0.84661954*Pcalc^2 + 2.83415571*Pcalc + + 2.12959146; + annotation (Inline=true); + end dewDensity; + + redeclare function extends bubbleEntropy + "Boiling curve specific entropy" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(sat.psat, bubbleEnthalpy(sat)); + sl := pro.s; + annotation (Inline=true); + end bubbleEntropy; + + redeclare function extends dewEntropy + "Dew curve specific entropy" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(sat.psat, dewEnthalpy(sat)); + sv := pro.s; + annotation (Inline=true); + end dewEntropy; + + redeclare function extends setBubbleState + "Set the thermodynamic state on the bubble line" + algorithm + state := setState_phX(sat.psat, bubbleEnthalpy(sat), fill(0, 0), phase); + annotation (Inline=true); + end setBubbleState; + + redeclare function extends setDewState + "Set the thermodynamic state on the dew line" + algorithm + state := setState_phX(sat.psat, dewEnthalpy(sat), fill(0, 0), phase); + annotation (Inline=true); + end setDewState; + + redeclare function extends dBubbleDensity_dPressure + "Bubble point density derivative" + algorithm + ddldp := 0; + annotation (Inline=true); + end dBubbleDensity_dPressure; + + redeclare function extends dDewDensity_dPressure + "Dew point density derivative" + algorithm + ddvdp := 0; + annotation (Inline=true); + end dDewDensity_dPressure; + + redeclare function extends dBubbleEnthalpy_dPressure + "Bubble point specific enthalpy derivative" + algorithm + dhldp := 0; + annotation (Inline=true); + end dBubbleEnthalpy_dPressure; + + redeclare function extends dDewEnthalpy_dPressure + "Dew point specific enthalpy derivative" + algorithm + dhvdp := 0; + annotation (Inline=true); + end dDewEnthalpy_dPressure; + + redeclare function extends density_derh_p + "Density derivative by specific enthalpy" + algorithm + ddhp := -1e6; + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + "Density derivative by pressure" + algorithm + ddph := 1e-8; + annotation (Inline=true); + end density_derp_h; + + annotation (Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end C3H3F5; diff --git a/ThermoSysPro/Properties/Media/C3H3F5/package.order b/ThermoSysPro/Properties/Media/C3H3F5/package.order new file mode 100644 index 00000000..5018ecc8 --- /dev/null +++ b/ThermoSysPro/Properties/Media/C3H3F5/package.order @@ -0,0 +1,59 @@ +p_min +p_crit +h_min +h_max +T_min +T_max +c3h3f5Constants +SaturationProperties +ThermodynamicState +saturationTemperature_p +temperatureResidual_h +saturationPressureResidual_p +BaseProperties +density_ph +temperature_ph +setState_phX +setState_psX +specificEnthalpy_pT +specificEnthalpy_pTX +density_pT +setState_pTX +setState_dTX +setSmoothState +temperature_ps +density_ps +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +velocityOfSound +isentropicEnthalpy +dynamicViscosity +thermalConductivity +surfaceTension +saturationTemperature +saturationTemperature_derp +saturationPressure +setSat_p +setSat_T +bubbleEnthalpy +dewEnthalpy +bubbleDensity +dewDensity +bubbleEntropy +dewEntropy +setBubbleState +setDewState +dBubbleDensity_dPressure +dDewDensity_dPressure +dBubbleEnthalpy_dPressure +dDewEnthalpy_dPressure +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo new file mode 100644 index 00000000..8b0cc9af --- /dev/null +++ b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo @@ -0,0 +1,254 @@ +within ThermoSysPro.Properties.Media; +package DryAirIdealGas "Dry air ideal gas medium using the legacy ThermoSysPro property functions" + + extends PartialThermoSysProMedium( + isCompressible=true, + mediumName="DryAirIdealGas", + substanceNames={"DryAirIdealGas"}, + singleState=false, + SpecificEnthalpy(start=3e5, nominal=3e5), + Density(start=1, nominal=1), + AbsolutePressure(start=1e5, nominal=1e5), + Temperature(start=300, nominal=300), + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas data; + constant FluidConstants dryAirConstants( + iupacName="Dry air", + casRegistryNumber="", + chemicalFormula="", + structureFormula="", + molarMass=data.molarMass); + constant FluidConstants fluidConstants[1]={dryAirConstants}; + + redeclare record extends ThermodynamicState + SpecificEnthalpy h; + Density d; + Temperature T; + AbsolutePressure p; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + equation + T = ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + d = ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T); + u = h - data.specificGasConstant*T; + MM = fluidConstants[1].molarMass; + R_s = data.specificGasConstant; + state = ThermodynamicState( + p=p, + h=h, + T=T, + d=d); + end BaseProperties; + + redeclare function extends setState_phX + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_pTX + protected + SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_psX + algorithm + assert(false, "DryAirIdealGas: setState_psX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=p, + h=0, + T=0, + d=0); + end setState_psX; + + redeclare function extends setState_dTX + algorithm + state := ThermodynamicState( + p=d*data.specificGasConstant*T, + h=ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T), + T=T, + d=d); + annotation (Inline=true); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + protected + SpecificEnthalpy h; + AbsolutePressure p; + Temperature T; + algorithm + h := smoothStep( + x, + state_a.h, + state_b.h, + x_small); + p := smoothStep( + x, + state_a.p, + state_b.p, + x_small); + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - data.specificGasConstant*state.T; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + algorithm + assert(false, "DryAirIdealGas: specificEntropy is not available in the legacy ThermoSysPro implementation"); + s := 0; + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - data.specificGasConstant*state.T - state.T*specificEntropy(state); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + algorithm + cp := ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(state.T); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state) - data.specificGasConstant; + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(T=state.T, rho=state.d); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.DryAirIdealGas.ThermalConductivity_Trho(T=state.T, rho=state.d); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends velocityOfSound + algorithm + a := sqrt(specificHeatCapacityCp(state)/specificHeatCapacityCv(state)*data.specificGasConstant*state.T); + annotation (Inline=true); + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + assert(false, "DryAirIdealGas: isentropicEnthalpy is not available in the legacy ThermoSysPro implementation"); + h_is := refState.h; + end isentropicEnthalpy; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input Temperature T; + input MassFraction X[:]; + output SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Density d; + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + d := ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T); + annotation (Inline=true); + end density_phX; + + redeclare function extends density_derh_p + protected + SpecificEnthalpy delta_h=0.01*state.h; + algorithm + ddhp := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(state.h + delta_h)) - ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(state.h - delta_h)))/(2*delta_h); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + protected + AbsolutePressure delta_P=0.0001*state.p; + algorithm + ddph := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p + delta_P, T=state.T) - ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p - delta_P, T=state.T))/(2*delta_P); + annotation (Inline=true); + end density_derp_h; +end DryAirIdealGas; diff --git a/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order new file mode 100644 index 00000000..79f7605f --- /dev/null +++ b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order @@ -0,0 +1,29 @@ +data +dryAirConstants +fluidConstants +ThermodynamicState +BaseProperties +setState_phX +setState_pTX +setState_psX +setState_dTX +setSmoothState +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +velocityOfSound +isentropicEnthalpy +specificEnthalpy_pTX +temperature_phX +density_phX +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.mo b/ThermoSysPro/Properties/Media/FlueGases/package.mo new file mode 100644 index 00000000..5deca97c --- /dev/null +++ b/ThermoSysPro/Properties/Media/FlueGases/package.mo @@ -0,0 +1,74 @@ +within ThermoSysPro.Properties.Media; +package FlueGases "Flue gases library inherited from Modelica.Media" + import Modelica.Media.Interfaces.Choices.ReferenceEnthalpy; + + extends PartialSubCMedium(nSubC=nC,isCompressible=true); + extends Modelica.Media.IdealGases.Common.MixtureGasNasa( + mediumName="MediaMonomeld", + data={Modelica.Media.IdealGases.Common.SingleGasesData.N2,Modelica.Media.IdealGases.Common.SingleGasesData.O2, + Modelica.Media.IdealGases.Common.SingleGasesData.H2O,Modelica.Media.IdealGases.Common.SingleGasesData.CO2, + Modelica.Media.IdealGases.Common.SingleGasesData.SO2}, + fluidConstants={Modelica.Media.IdealGases.Common.FluidData.N2,Modelica.Media.IdealGases.Common.FluidData.O2, + Modelica.Media.IdealGases.Common.FluidData.H2O,Modelica.Media.IdealGases.Common.FluidData.CO2, + Modelica.Media.IdealGases.Common.FluidData.SO2}, + substanceNames={"Nitrogen","Oxygen","Water","Carbondioxide","Sulfurdioxide"}, + reference_X={0.768,0.232,0.0,0.0,0.0}, + referenceChoice=ReferenceEnthalpy.UserDefined, + h_offset = hr - hr_FlueGases + Modelica.Media.IdealGases.Common.SingleGasesData.H2O.H0); + + constant Units.SI.SpecificEnthalpy hr=2501569 "ThermoSysPro Water/steam reference specific enthalpy at 0.01°C"; + constant Units.SI.SpecificEnthalpy hr_FlueGases=503298 "FlueGases reference specific enthalpy, computed from ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) at (0.006112 bars, 0.01°C)"; + + redeclare function extends density_derh_p "Density derivative by specific enthalpy" + + protected + Units.SI.SpecificEntropy s "Flue gases specific entropy"; + Units.SI.Density rho "Flue gaases density"; + Units.SI.SpecificHeatCapacity cp "Specific heat capacity"; + Units.SI.SpecificHeatCapacity R "gas constant"; + Units.SI.DerDensityByEnthalpy drhodh + "Derivative of the density wrt. the specific enthalpy at constant pressure"; + + algorithm + s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state); + rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state); + cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state); + R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state); + + drhodh := -rho*rho*R/(state.p*cp); + ddhp := drhodh; + + annotation ( + smoothOrder=2, + Icon(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2010

    + + +

    ThermoSysPro Version 2.0

    + +")); + + end density_derh_p; + + redeclare function extends density_derp_h "Density derivative by pressure" + protected + Units.SI.SpecificEntropy s "Flue gases specific entropy"; + Units.SI.Density rho "Flue gaases density"; + Units.SI.SpecificHeatCapacity cp "Specific heat capacity"; + Units.SI.SpecificHeatCapacity R "gas constant"; + Units.SI.DerDensityByPressure drhodp "Derivative of the density wrt. the pressure at constant specific enthalpy"; + algorithm + s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state); + rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state); + cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state); + R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state); + + drhodp := (rho*rho*R)/(state.p*cp)*(1/rho + state.T/state.p*(cp - R)); + ddph := drhodp; + annotation (Inline=true); + end density_derp_h; + annotation (Documentation(info=" + +")); +end FlueGases; diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.order b/ThermoSysPro/Properties/Media/FlueGases/package.order new file mode 100644 index 00000000..24c2001d --- /dev/null +++ b/ThermoSysPro/Properties/Media/FlueGases/package.order @@ -0,0 +1,4 @@ +hr +hr_FlueGases +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/Functions.mo b/ThermoSysPro/Properties/Media/Functions.mo new file mode 100644 index 00000000..602383ba --- /dev/null +++ b/ThermoSysPro/Properties/Media/Functions.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Properties.Media; +package Functions + function findSubstanceIndex + input String substanceNames[:]; + input String aliases[:]; + output Integer index; + algorithm + index := 0; + for i in 1:size(substanceNames, 1) loop + for j in 1:size(aliases, 1) loop + if substanceNames[i] == aliases[j] then + index := i; + end if; + end for; + end for; + end findSubstanceIndex; +end Functions; diff --git a/ThermoSysPro/Properties/Media/MoltenSalt/package.mo b/ThermoSysPro/Properties/Media/MoltenSalt/package.mo new file mode 100644 index 00000000..a200e9c5 --- /dev/null +++ b/ThermoSysPro/Properties/Media/MoltenSalt/package.mo @@ -0,0 +1,249 @@ +within ThermoSysPro.Properties.Media; +package MoltenSalt "Molten salt medium using the legacy ThermoSysPro property functions" + + extends PartialThermoSysProMedium( + isCompressible=false, + mediumName="MoltenSalt", + substanceNames={"MoltenSalt"}, + singleState=false, + SpecificEnthalpy(start=3e5, nominal=3e5), + Density(start=1800, nominal=1800), + AbsolutePressure(start=1e5, nominal=1e5), + Temperature(start=600, nominal=600), + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant FluidConstants saltConstants( + iupacName="Molten salt", + casRegistryNumber="", + chemicalFormula="", + structureFormula="", + molarMass=0.1); + constant FluidConstants fluidConstants[1]={saltConstants}; + + redeclare record extends ThermodynamicState + SpecificEnthalpy h; + Density d; + Temperature T; + AbsolutePressure p; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + equation + T = ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + d = ThermoSysPro.Properties.MoltenSalt.Density_T(T); + u = h - p/d; + MM = fluidConstants[1].molarMass; + R_s = 0; + state = ThermodynamicState( + p=p, + h=h, + T=T, + d=d); + end BaseProperties; + + redeclare function extends setState_phX + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.MoltenSalt.Density_T(T)); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_pTX + protected + SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.MoltenSalt.Density_T(T)); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_psX + algorithm + assert(false, "MoltenSalt: setState_psX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=p, + h=0, + T=0, + d=0); + end setState_psX; + + redeclare function extends setState_dTX + algorithm + state := ThermodynamicState( + p=reference_p, + h=ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T), + T=T, + d=d); + annotation (Inline=true); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + protected + SpecificEnthalpy h; + Temperature T; + algorithm + h := smoothStep( + x, + state_a.h, + state_b.h, + x_small); + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + state := ThermodynamicState( + p=smoothStep( + x, + state_a.p, + state_b.p, + x_small), + h=h, + T=T, + d=ThermoSysPro.Properties.MoltenSalt.Density_T(T)); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + algorithm + assert(false, "MoltenSalt: specificEntropy is not available in the legacy ThermoSysPro implementation"); + s := 0; + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + algorithm + cp := ThermoSysPro.Properties.MoltenSalt.SpecificHeatCapacityCp_T(state.T); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.MoltenSalt.DynamicViscosity_T(state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.MoltenSalt.ThermalConductivity_T(state.T); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends velocityOfSound + algorithm + assert(false, "MoltenSalt: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + assert(false, "MoltenSalt: isentropicEnthalpy is not available in the legacy ThermoSysPro implementation"); + h_is := refState.h; + end isentropicEnthalpy; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input Temperature T; + input MassFraction X[:]; + output SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.MoltenSalt.SpecificEnthalpy_T(T); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Temperature T; + algorithm + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Density d; + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.MoltenSalt.Temperature_h(h); + d := ThermoSysPro.Properties.MoltenSalt.Density_T(T); + annotation (Inline=true); + end density_phX; + + redeclare function extends density_derh_p + protected + SpecificEnthalpy delta_h=0.01*state.h; + algorithm + ddhp := (ThermoSysPro.Properties.MoltenSalt.Density_T(ThermoSysPro.Properties.MoltenSalt.Temperature_h(state.h + delta_h)) - ThermoSysPro.Properties.MoltenSalt.Density_T(ThermoSysPro.Properties.MoltenSalt.Temperature_h(state.h - delta_h)))/(2*delta_h); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + algorithm + ddph := 1e-8; + annotation (Inline=true); + end density_derp_h; +end MoltenSalt; diff --git a/ThermoSysPro/Properties/Media/MoltenSalt/package.order b/ThermoSysPro/Properties/Media/MoltenSalt/package.order new file mode 100644 index 00000000..6167fc42 --- /dev/null +++ b/ThermoSysPro/Properties/Media/MoltenSalt/package.order @@ -0,0 +1,28 @@ +saltConstants +fluidConstants +ThermodynamicState +BaseProperties +setState_phX +setState_pTX +setState_psX +setState_dTX +setSmoothState +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +velocityOfSound +isentropicEnthalpy +specificEnthalpy_pTX +temperature_phX +density_phX +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo new file mode 100644 index 00000000..0266eca6 --- /dev/null +++ b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.mo @@ -0,0 +1,233 @@ +within ThermoSysPro.Properties.Media; +package Oil_TherminolVP1 "Therminol VP1 oil medium using the legacy ThermoSysPro property functions" + + extends PartialThermoSysProMedium( + isCompressible=false, + mediumName="Oil_TherminolVP1", + substanceNames={"Oil_TherminolVP1"}, + singleState=false, + SpecificEnthalpy(start=3.0e5, nominal=3.0e5), + Density(start=900, nominal=900), + AbsolutePressure(start=1e5, nominal=1e5), + Temperature(start=400, nominal=400), + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant FluidConstants oilConstants( + iupacName="Therminol VP1", + casRegistryNumber="", + chemicalFormula="", + structureFormula="", + molarMass=0.166); + constant FluidConstants fluidConstants[1]={oilConstants}; + + redeclare record extends ThermodynamicState "Thermodynamic state" + SpecificEnthalpy h "Specific enthalpy"; + Density d "Density"; + Temperature T "Temperature"; + AbsolutePressure p "Pressure"; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + "Base properties of Therminol VP1" + equation + T = ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h); + d = ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T); + u = h - p/d; + MM = fluidConstants[1].molarMass; + R_s = 0; + state = ThermodynamicState(p=p, h=h, T=T, d=d); + end BaseProperties; + + redeclare function extends setState_phX + "Return thermodynamic state from p and h" + algorithm + state := ThermodynamicState( + p=p, + h=h, + T=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h), + d=ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h))); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_pTX + "Return thermodynamic state from p and T" + protected + SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(T); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(T)); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_psX + "Return thermodynamic state from p and s" + algorithm + assert(false, "Oil_TherminolVP1: setState_psX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState(p=p, h=0, T=0, d=0); + end setState_psX; + + redeclare function extends setState_dTX + "Return thermodynamic state from d and T" + algorithm + state := ThermodynamicState( + p=reference_p, + h=ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(T), + T=T, + d=d); + annotation (Inline=true); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + algorithm + state := ThermodynamicState( + p=smoothStep(x, state_a.p, state_b.p, x_small), + h=smoothStep(x, state_a.h, state_b.h, x_small), + T=ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(smoothStep(x, state_a.h, state_b.h, x_small)), + d=ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(smoothStep(x, state_a.h, state_b.h, x_small)))); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + algorithm + assert(false, "Oil_TherminolVP1: specificEntropy is not available in the legacy ThermoSysPro implementation"); + s := 0; + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + algorithm + cp := ThermoSysPro.Properties.Oil_TherminolVP1.SpecificHeatCp_T(state.T); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.Oil_TherminolVP1.DynamicViscosity_T(state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.Oil_TherminolVP1.ThermalConductivity_T(state.T); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends velocityOfSound + algorithm + assert(false, "Oil_TherminolVP1: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + assert(false, "Oil_TherminolVP1: isentropicEnthalpy is not available in the legacy ThermoSysPro implementation"); + h_is := refState.h; + end isentropicEnthalpy; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input MassFraction X[:] "Mass fractions"; + output SpecificEnthalpy h "Specific enthalpy"; + algorithm + h := ThermoSysPro.Properties.Oil_TherminolVP1.Enthalpy_T(T); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input MassFraction X[:] "Mass fractions"; + output Temperature T "Temperature"; + algorithm + T := ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input MassFraction X[:] "Mass fractions"; + output Density d "Density"; + algorithm + d := ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(h)); + annotation (Inline=true); + end density_phX; + + redeclare function extends density_derh_p + protected + SpecificEnthalpy delta_h=0.01*state.h; + algorithm + ddhp := (ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(state.h + delta_h)) + - ThermoSysPro.Properties.Oil_TherminolVP1.Density_T(ThermoSysPro.Properties.Oil_TherminolVP1.Temperature_h(state.h - delta_h)))/(2*delta_h); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + algorithm + ddph := 1e-8; + annotation (Inline=true); + end density_derp_h; + + annotation (Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end Oil_TherminolVP1; diff --git a/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order new file mode 100644 index 00000000..9bf6eaa0 --- /dev/null +++ b/ThermoSysPro/Properties/Media/Oil_TherminolVP1/package.order @@ -0,0 +1,28 @@ +oilConstants +fluidConstants +ThermodynamicState +BaseProperties +setState_phX +setState_pTX +setState_psX +setState_dTX +setSmoothState +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +velocityOfSound +isentropicEnthalpy +specificEnthalpy_pTX +temperature_phX +density_phX +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo new file mode 100644 index 00000000..e117fa5c --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo @@ -0,0 +1,6 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +record C_BiPhase + Real Cl[nSubC]; + Real Cg[nSubC]; + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end C_BiPhase; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo new file mode 100644 index 00000000..7aebdec9 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +function HomogeneousPhasesSeparation + extends partialPhasesSeparation; +// input Real x(min=0, max=1) "Title"; + +algorithm + // HomogeneousSubstance + C_record.Cl := SubC; + C_record.Cg := SubC; + +// // Non-volatile +// C_record.Cl := SubC / (1-x); +// C_record.Cg := fill(0,size(SubC,1)); + +// // Fully-volatile +// C_record.Cl := fill(0,size(SubC,1)); +// C_record.Cg := SubC / x; +end HomogeneousPhasesSeparation; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo new file mode 100644 index 00000000..e00d5bc8 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo @@ -0,0 +1,6 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +function noSaS + extends partialSaS; +algorithm + C := fill(0,nSubC); +end noSaS; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo new file mode 100644 index 00000000..c689fdcb --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo @@ -0,0 +1,6 @@ +within ThermoSysPro.Properties.Media; +partial package PartialSubCMedium + constant Integer nSubC; + constant Boolean isCompressible; + +end PartialSubCMedium; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order new file mode 100644 index 00000000..62ead749 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order @@ -0,0 +1,7 @@ +nSubC +isCompressible +partialPhasesSeparation +HomogeneousPhasesSeparation +C_BiPhase +partialSaS +noSaS diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo new file mode 100644 index 00000000..4f208f63 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo @@ -0,0 +1,64 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +partial function partialPhasesSeparation + input Real SubC[:] "Total Species Concentrations"; + output C_BiPhase C_record; + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Ellipse( + extent={{-60,60},{60,-60}}, + lineColor={0,0,255}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Polygon( + points={{60,0},{58,14},{54,26},{48,36},{38,46},{26,54},{14,58},{0,60}, + {0,0},{60,0}}, + fillColor={170,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Polygon( + points={{-60,0},{-58,14},{-54,26},{-48,36},{-38,46},{-26,54},{-14,58}, + {0,60},{0,0},{-60,0}}, + fillColor={170,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Ellipse( + extent={{-42,28},{-26,12}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-18,48},{-6,36}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-4,24},{16,4}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{26,34},{42,18}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{24,-12},{40,-28}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-40,-22},{-24,-38}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{10,-36},{22,-48}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-20,-4},{2,-26}}, + lineColor={28,108,200}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem( + preserveAspectRatio=false))); +end partialPhasesSeparation; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo new file mode 100644 index 00000000..69547374 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +partial function partialSaS + input Real SubC[:] "Total Species Concentrations"; + output Real C[size(SubC,1)]; +end partialSaS; diff --git a/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo b/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo new file mode 100644 index 00000000..5f292163 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Properties.Media; +partial package PartialThermoSysProMedium + extends Modelica.Media.Interfaces.PartialMedium; + extends PartialSubCMedium(nSubC=nC); +end PartialThermoSysProMedium; diff --git a/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.order b/ThermoSysPro/Properties/Media/PartialThermoSysProMedium/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo b/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo new file mode 100644 index 00000000..eb2a9267 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Properties.Media; +partial package PartialTwoPhaseThermoSysProMedium + extends Modelica.Media.Interfaces.PartialTwoPhaseMedium; + extends PartialSubCMedium(nSubC=nC); +end PartialTwoPhaseThermoSysProMedium; diff --git a/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.order b/ThermoSysPro/Properties/Media/PartialTwoPhaseThermoSysProMedium/package.order new file mode 100644 index 00000000..e69de29b diff --git a/ThermoSysPro/Properties/Media/WaterSteam/package.mo b/ThermoSysPro/Properties/Media/WaterSteam/package.mo new file mode 100644 index 00000000..31a51406 --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteam/package.mo @@ -0,0 +1,731 @@ +within ThermoSysPro.Properties.Media; +package WaterSteam "1 - Water/steam properties library (IAPWS-IF97)" + + extends PartialTwoPhaseThermoSysProMedium( + isCompressible=true, + mediumName="WaterIF97", + substanceNames={"water"}, + singleState=false, + SpecificEnthalpy(start=1.0e5, nominal=5.0e5), + Density(start=150, nominal=500), + AbsolutePressure( + start=50e5, + nominal=10e5, + min=611.657, + max=100e6), + Temperature( + start=500, + nominal=500, + min=273.15, + max=2273.15), + smoothModel=false, + onePhase=false, + fluidConstants=Modelica.Media.Water.waterConstants, + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + redeclare record extends SaturationProperties + end SaturationProperties; + + redeclare record extends ThermodynamicState "Thermodynamic state" + SpecificEnthalpy h "Specific enthalpy"; + Density d "Density"; + Temperature T "Temperature"; + AbsolutePressure p "Pressure"; + end ThermodynamicState; + constant Integer Region = 0 "IF97 region. 0:automatic"; + + redeclare replaceable model extends BaseProperties( + h(stateSelect= StateSelect.prefer), + d(stateSelect= StateSelect.default), + T(stateSelect= StateSelect.default), + p(stateSelect= StateSelect.prefer)) + "Base properties of waterBase properties (p, d, T, h, u, R_s, MM and, if applicable, X and Xi) of a medium" + Integer phase( + min=0, + max=2, + start=1, + fixed=false) "2 for two-phase, 1 for one-phase, 0 if not known"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + equation + pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(p, h, Region); + MM = fluidConstants[1].molarMass; + R_s = Modelica.Constants.R/fluidConstants[1].molarMass; + + phase = if ((h < ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hl_p(p)) + or (h > ThermoSysPro.Properties.WaterSteam.BaseIF97.Regions.hv_p(p)) + or (p >ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT)) then 1 else 2; + + sat = setSat_p(state.p); + state = setState_ph(p, h, phase); + + d=pro.d; + T=pro.T; + u = pro.u; + end BaseProperties; + + redeclare function density_ph + "Computes density as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + p, + h, + region); + d := pro.d; + annotation (Inline=true); + end density_ph; + + redeclare function temperature_ph + "Computes temperature as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEnthalpy h "Specific enthalpy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + p, + h, + region); + T := pro.T; + annotation (Inline=true); + end temperature_ph; + + redeclare function extends setState_phX + "Return thermodynamic state of water as function of p, h, and optional region" + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + algorithm + state := ThermodynamicState( + d=density_ph( + p, + h, + region=region), + T=temperature_ph( + p, + h, + region=region), + phase=if region == 0 then 0 else if region==4 then 2 else 1, + h=h, + p=p); + annotation (Inline=true); + end setState_phX; + + redeclare function temperature_ps + "Compute temperature from pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Temperature T "Temperature"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + T := pro.T; + annotation (Inline=true); + end temperature_ps; + + redeclare function density_ps + "Computes density as a function of pressure and specific enthalpy" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + d := pro.d; + annotation (Inline=true); + end density_ps; + + redeclare function specificEnthalpy_pT + "Computes specific enthalpy as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output SpecificEnthalpy h "Specific enthalpy"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT + pro; + algorithm + + pro := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_PT(p, T, region); + h := pro.h; + annotation (Inline=true); + end specificEnthalpy_pT; + + redeclare function specificEnthalpy_ps + "Computes specific enthalpy as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input SpecificEntropy s "Specific entropy"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output SpecificEnthalpy h "Specific enthalpy"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + h := pro.h; + annotation (Inline=true); + end specificEnthalpy_ps; + + redeclare function density_pT + "Computes density as a function of pressure and temperature" + extends Modelica.Icons.Function; + input AbsolutePressure p "Pressure"; + input Temperature T "Temperature"; + input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + output Density d "Density"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT + pro; + algorithm + + pro := ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_PT(p, T, region); + d := pro.d; + + annotation (Inline=true); + end density_pT; + + redeclare function extends dewEnthalpy "Dew curve specific enthalpy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + hv := vsat.h; + annotation (Inline=true); + end dewEnthalpy; + + redeclare function extends dewDensity "Dew curve specific density of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + dv := vsat.rho; + annotation (Inline=true); + end dewDensity; + + redeclare function extends setDewState + "Set the thermodynamic state on the dew line" + algorithm + state := ThermodynamicState( + phase=phase, + p=sat.psat, + T=sat.Tsat, + h=dewEnthalpy(sat), + d=dewDensity(sat)); + + annotation (Inline=true); + end setDewState; + + redeclare function extends bubbleEnthalpy + "Boiling curve specific enthalpy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + hl := lsat.h; + annotation (Inline=true); + end bubbleEnthalpy; + + redeclare function extends bubbleDensity + "Boiling curve specific density of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + dl := lsat.rho; + annotation (Inline=true); + end bubbleDensity; + + redeclare function extends setBubbleState + "Set the thermodynamic state on the bubble line" + algorithm + state := ThermodynamicState( + phase=phase, + p=sat.psat, + T=sat.Tsat, + h=bubbleEnthalpy(sat), + d=bubbleDensity(sat)); + annotation (Inline=true); + end setBubbleState; + + redeclare function extends dynamicViscosity "Dynamic viscosity of water" + algorithm + + // Water/Steam /// FONCTIONNE EN DIPHASIQUE ??? + // if fluid==1 then + eta := ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho=state.d,T=state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + "Thermal conductivity of water" + input Integer region=Region; + algorithm + lambda := ThermoSysPro.Properties.WaterSteam.IF97.ThermalConductivity_rhoT(rho=state.d,T=state.T,P=state.p,region=region); + + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends surfaceTension + "Surface tension in two phase region of water" + algorithm + sigma := ThermoSysPro.Properties.WaterSteam.IF97.SurfaceTension_T(sat.Tsat); + annotation (Inline=true); + end surfaceTension; + + redeclare function extends pressure "Return pressure of ideal gas" + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature "Return temperature of ideal gas" + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density "Return density of ideal gas" + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy "Return specific enthalpy" + extends Modelica.Icons.Function; + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + "Return specific internal energy" + extends Modelica.Icons.Function; + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy "Specific entropy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + s := pro.s; + + annotation (Inline=true); + end specificEntropy; + + redeclare function extends specificGibbsEnergy "Return specific Gibbs energy" + extends Modelica.Icons.Function; + algorithm + g := state.h - state.T*specificEntropy(state); + annotation (Inline=true); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + "Return specific Helmholtz energy" + extends Modelica.Icons.Function; + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + annotation (Inline=true); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + "Specific heat capacity at constant pressure of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + cp := pro.cp; + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + "Specific heat capacity at constant volume of water" + algorithm + cv := Modelica.Media.Water.IF97_Utilities.cv_ph( + state.p, + state.h, + state.phase, + Region); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends velocityOfSound + "Return velocity of sound as a function of the thermodynamic state record" + algorithm + a := ThermoSysPro.Properties.WaterSteam.IF97_Utilities.AnalyticDerivatives.velocityOfSound_pT(state.p,state.T,Region); + annotation (Inline=true); + end velocityOfSound; + + redeclare function extends isentropicEnthalpy "Compute h(s,p)" + algorithm + // h_is := Modelica.Media.Water.IF97_Utilities.isentropicEnthalpy(p_downstream, specificEntropy(refState), 0); + h_is := ThermoSysPro.Properties.WaterSteam.IF97_Utilities.AnalyticDerivatives.dynamicIsentropicEnthalpy(p_downstream, specificEntropy(refState), refState.d, refState.T, refState.phase); + annotation (Inline=true); + end isentropicEnthalpy; + + redeclare function extends density_derh_p + "Density derivative by specific enthalpy" + + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + ddhp:=pro.ddhp; + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h "Density derivative by pressure" + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + state.p, + state.h, + Region); + ddph:=pro.ddph; + annotation (Inline=true); + end density_derp_h; + // redeclare function extends density_derT_p + // "Density derivative by temperature" + // algorithm + // ddTp := IF97_Utilities.ddTp(state.p, state.h, state.phase); + // end density_derT_p; + // + // redeclare function extends density_derp_T + // "Density derivative by pressure" + // algorithm + // ddpT := IF97_Utilities.ddpT(state.p, state.h, state.phase); + // end density_derp_T; + + redeclare function extends bubbleEntropy + "Boiling curve specific entropy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + sat.psat, + lsat.h, + Region); + sl:=pro.s; + annotation (Inline=true); + end bubbleEntropy; + + redeclare function extends dewEntropy "Dew curve specific entropy of water" + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + + algorithm + (lsat,vsat):=ThermoSysPro.Properties.WaterSteam.IF97_packages.IF97_wAJ.Water_sat_P(sat.psat); + pro := ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph( + sat.psat, + vsat.h, + Region); + sv := pro.s; + annotation (Inline=true); + end dewEntropy; + + redeclare function extends saturationTemperature + "Saturation temperature of water" + algorithm + T := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.tsat(p); + annotation (Inline=true); + end saturationTemperature; + + redeclare function extends saturationTemperature_derp + "Derivative of saturation temperature w.r.t. pressure" + algorithm + dTp := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.dtsatofp(p); + annotation (Inline=true); + end saturationTemperature_derp; + + redeclare function extends saturationPressure "Saturation pressure of water" + algorithm + p := ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T); + annotation (Inline=true); + end saturationPressure; + + redeclare function extends dBubbleDensity_dPressure + "Bubble point density derivative" + // algorithm + // ddldp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.drhol_dp(sat.psat); + annotation (Inline=true); + end dBubbleDensity_dPressure; + + redeclare function extends dDewDensity_dPressure + "Dew point density derivative" + // algorithm + // ddvdp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.drhov_dp(sat.psat); + annotation (Inline=true); + end dDewDensity_dPressure; + + redeclare function extends dBubbleEnthalpy_dPressure + "Bubble point specific enthalpy derivative" + // algorithm + // dhldp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dhl_dp(sat.psat); + annotation (Inline=true); + end dBubbleEnthalpy_dPressure; + + redeclare function extends dDewEnthalpy_dPressure + "Dew point specific enthalpy derivative" + // algorithm + // dhvdp := Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dhv_dp(sat.psat); + annotation (Inline=true); + end dDewEnthalpy_dPressure; + + redeclare function extends setState_psX + "Return thermodynamic state of water as function of p, s, and optional region" + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_Ps( + p, + s, + region); + state := ThermodynamicState( + d=pro.d, + T=pro.T, + phase=if region == 0 then 0 else if region==4 then 2 else 1, + h=pro.h, + p=p); + annotation (Inline=true); + end setState_psX; + + redeclare function extends setState_pTX + "Return thermodynamic state of water as function of p, T, and optional region" + input Integer region=Region + "If 0, region is unknown, otherwise known and this input"; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro; + algorithm + pro :=ThermoSysPro.Properties.WaterSteam.IF97.Water_PT( + p, + T, + region); + state := ThermodynamicState( + d=pro.d, + T=T, + phase=1, + h=pro.h, + p=p); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setSmoothState + "Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b" + import Modelica.Media.Common.smoothStep; + algorithm + state := ThermodynamicState( + p=smoothStep( + x, + state_a.p, + state_b.p, + x_small), + h=smoothStep( + x, + state_a.h, + state_b.h, + x_small), + d=density_ph(smoothStep( + x, + state_a.p, + state_b.p, + x_small), smoothStep( + x, + state_a.h, + state_b.h, + x_small)), + T=temperature_ph(smoothStep( + x, + state_a.p, + state_b.p, + x_small), smoothStep( + x, + state_a.h, + state_b.h, + x_small)), + phase=0); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends setState_dTX + "Return thermodynamic state of water as function of d, T, and optional region" + // input Integer region=Region + // "If 0, region is unknown, otherwise known and this input"; + // algorithm + // state := ThermodynamicState( + // d=d, + // T=T, + // phase=if region == 0 then 0 else if + // region == 4 then 2 else 1, + // h=specificEnthalpy_dT( + // d, + // T, + // region=region), + // p=pressure_dT( + // d, + // T, + // region=region)); + // annotation (Inline=true); + end setState_dTX; + + redeclare function extends specificEnthalpy_dT + "Computes specific enthalpy as a function of density and temperature" + // extends Modelica.Icons.Function; + // input Density d "Density"; + // input Temperature T "Temperature"; + // input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + // input Integer region=Region + // "If 0, region is unknown, otherwise known and this input"; + // output SpecificEnthalpy h "Specific enthalpy"; + // algorithm + // h := Modelica.Media.Water.IF97_Utilities.h_dT( + // d, + // T, + // phase, + // region); + // annotation (Inline=true); + + end specificEnthalpy_dT; + + redeclare function extends pressure_dT + "Computes pressure as a function of density and temperature" + // extends Modelica.Icons.Function; + // input Density d "Density"; + // input Temperature T "Temperature"; + // input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known"; + // input Integer region=Region + // "If 0, region is unknown, otherwise known and this input"; + // output AbsolutePressure p "Pressure"; + // algorithm + // p := Modelica.Media.Water.IF97_Utilities.p_dT( + // d, + // T, + // phase, + // region); + // annotation (Inline=true); + + end pressure_dT; + + redeclare function extends isentropicExponent "Return isentropic exponent" + // algorithm + // gamma := if dT_explicit then Modelica.Media.Water.IF97_Utilities.isentropicExponent_dT( + // state.d, + // state.T, + // state.phase, + // Region) else if pT_explicit then Modelica.Media.Water.IF97_Utilities.isentropicExponent_pT( + // state.p, + // state.T, + // Region) else Modelica.Media.Water.IF97_Utilities.isentropicExponent_ph( + // state.p, + // state.h, + // state.phase, + // Region); + // annotation (Inline=true); + end isentropicExponent; + + redeclare function extends isothermalCompressibility + "Isothermal compressibility of water" + // algorithm + // // assert(state.phase <> 2, "Isothermal compressibility can not be computed with 2-phase inputs!"); + // kappa := if dT_explicit then Modelica.Media.Water.IF97_Utilities.kappa_dT( + // state.d, + // state.T, + // state.phase, + // Region) else if pT_explicit then Modelica.Media.Water.IF97_Utilities.kappa_pT( + // state.p, + // state.T, + // Region) else Modelica.Media.Water.IF97_Utilities.kappa_ph( + // state.p, + // state.h, + // state.phase, + // Region); + // annotation (Inline=true); + end isothermalCompressibility; + + redeclare function extends isobaricExpansionCoefficient + "Isobaric expansion coefficient of water" + // algorithm + // // assert(state.phase <> 2, "The isobaric expansion coefficient can not be computed with 2-phase inputs!"); + // beta := if dT_explicit then Modelica.Media.Water.IF97_Utilities.beta_dT( + // state.d, + // state.T, + // state.phase, + // Region) else if pT_explicit then Modelica.Media.Water.IF97_Utilities.beta_pT( + // state.p, + // state.T, + // Region) else Modelica.Media.Water.IF97_Utilities.beta_ph( + // state.p, + // state.h, + // state.phase, + // Region); + // annotation (Inline=true); + end isobaricExpansionCoefficient; +end WaterSteam; diff --git a/ThermoSysPro/Properties/Media/WaterSteam/package.order b/ThermoSysPro/Properties/Media/WaterSteam/package.order new file mode 100644 index 00000000..0b73fe30 --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteam/package.order @@ -0,0 +1,53 @@ +SaturationProperties +ThermodynamicState +Region +BaseProperties +density_ph +temperature_ph +setState_phX +temperature_ps +density_ps +specificEnthalpy_pT +specificEnthalpy_ps +density_pT +dewEnthalpy +dewDensity +setDewState +bubbleEnthalpy +bubbleDensity +setBubbleState +dynamicViscosity +thermalConductivity +surfaceTension +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +velocityOfSound +isentropicEnthalpy +density_derh_p +density_derp_h +bubbleEntropy +dewEntropy +saturationTemperature +saturationTemperature_derp +saturationPressure +dBubbleDensity_dPressure +dDewDensity_dPressure +dBubbleEnthalpy_dPressure +dDewEnthalpy_dPressure +setState_psX +setState_pTX +setSmoothState +setState_dTX +specificEnthalpy_dT +pressure_dT +isentropicExponent +isothermalCompressibility +isobaricExpansionCoefficient diff --git a/ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo new file mode 100644 index 00000000..e33895ae --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.mo @@ -0,0 +1,466 @@ +within ThermoSysPro.Properties.Media; +package WaterSteamSimple "Simple water/steam medium using the legacy ThermoSysPro property functions" + + extends PartialTwoPhaseThermoSysProMedium( + isCompressible=true, + mediumName="WaterSteamSimple", + substanceNames={"water"}, + singleState=false, + SpecificEnthalpy(start=1e5, nominal=5e5), + Density(start=150, nominal=500), + AbsolutePressure( + start=50e5, + nominal=10e5, + min=611.657, + max=100e6), + Temperature( + start=500, + nominal=500, + min=273.15, + max=2273.15), + smoothModel=false, + onePhase=false, + fluidConstants=Modelica.Media.Water.waterConstants, + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant Integer Region=0 "Simple water region. 0: automatic"; + + redeclare record extends SaturationProperties + end SaturationProperties; + + redeclare record extends ThermodynamicState + SpecificEnthalpy h; + Density d; + Temperature T; + AbsolutePressure p; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + Integer phase( + min=0, + max=2, + start=1, + fixed=false); + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + equation + pro = ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + MM = fluidConstants[1].molarMass; + R_s = Modelica.Constants.R/fluidConstants[1].molarMass; + phase = if pro.x > 0 and pro.x < 1 then 2 else 1; + sat = setSat_p(p); + state = ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=phase); + T = pro.T; + d = pro.d; + u = pro.u; + end BaseProperties; + + redeclare function density_ph + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input FixedPhase phase=0; + output Density d; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + d := pro.d; + annotation (Inline=true); + end density_ph; + + redeclare function temperature_ph + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input FixedPhase phase=0; + output Temperature T; + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + T := pro.T; + annotation (Inline=true); + end temperature_ph; + + redeclare function extends setState_phX + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_psX + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ps(p, s, Region); + state := ThermodynamicState( + p=p, + h=pro.h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_psX; + + redeclare function extends setState_pTX + protected + SpecificEnthalpy h; + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + h := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SpecificEnthalpy_PT(p, T, Region); + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, Region); + state := ThermodynamicState( + p=p, + h=h, + T=pro.T, + d=pro.d, + phase=if pro.x > 0 and pro.x < 1 then 2 else 1); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_dTX + algorithm + assert(false, "WaterSteamSimple: setState_dTX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=reference_p, + h=0, + T=T, + d=d, + phase=phase); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + algorithm + state := setState_phX( + smoothStep( + x, + state_a.p, + state_b.p, + x_small), + smoothStep( + x, + state_a.h, + state_b.h, + x_small), + fill(0, 0)); + annotation (Inline=true); + end setSmoothState; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input Temperature T; + input MassFraction X[:]; + input FixedPhase phase=0; + output SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SpecificEnthalpy_PT(p, T, Region); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + input FixedPhase phase=0; + output Temperature T; + algorithm + T := temperature_ph(p, h, phase); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + input FixedPhase phase=0; + output Density d; + algorithm + d := density_ph(p, h, phase); + annotation (Inline=true); + end density_phX; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - state.p/state.d; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + s := pro.s; + annotation (Inline=true); + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + annotation (Inline=true); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - state.p/state.d - state.T*specificEntropy(state); + annotation (Inline=true); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + cp := pro.cp; + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state); + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.DynamicViscosity_rhoT(rho=state.d, T=state.T); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.ThermalConductivity_rhoT(rho=state.d, T=state.T); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends surfaceTension + algorithm + sigma := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.SurfaceTension_T(sat.Tsat); + annotation (Inline=true); + end surfaceTension; + + redeclare function extends velocityOfSound + algorithm + assert(false, "WaterSteamSimple: velocityOfSound is not available in the legacy ThermoSysPro implementation"); + a := 0; + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + h_is := specificEnthalpy( + setState_psX(p_downstream, specificEntropy(refState), fill(0, 0))); + annotation (Inline=true); + end isentropicEnthalpy; + + redeclare function extends saturationTemperature + algorithm + T := ThermoSysPro.Properties.WaterSteamSimple.Temperature.Tsat_P(p); + annotation (Inline=true); + end saturationTemperature; + + redeclare function extends saturationTemperature_derp + algorithm + dTp := ThermoSysPro.Properties.WaterSteamSimple.Temperature.dTsatp_P(p); + annotation (Inline=true); + end saturationTemperature_derp; + + redeclare function extends saturationPressure + algorithm + p := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Pressure_sat_hl(0); + annotation (Inline=true); + end saturationPressure; + + redeclare function setSat_p + extends Modelica.Icons.Function; + input AbsolutePressure p; + output SaturationProperties sat; + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(p); + sat := SaturationProperties(psat=p, Tsat=lsat.T); + annotation (Inline=true); + end setSat_p; + + redeclare function setSat_T + extends Modelica.Icons.Function; + input Temperature T; + output SaturationProperties sat; + algorithm + assert(false, "WaterSteamSimple: setSat_T is not available in the legacy ThermoSysPro implementation"); + sat := SaturationProperties(psat=0, Tsat=T); + end setSat_T; + + redeclare function extends bubbleEnthalpy + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(sat.psat); + hl := lsat.h; + annotation (Inline=true); + end bubbleEnthalpy; + + redeclare function extends dewEnthalpy + protected + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat; + ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat; + algorithm + (lsat,vsat) := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_sat_P(sat.psat); + hv := vsat.h; + annotation (Inline=true); + end dewEnthalpy; + + redeclare function extends bubbleDensity + algorithm + dl := density_ph(sat.psat, bubbleEnthalpy(sat)); + annotation (Inline=true); + end bubbleDensity; + + redeclare function extends dewDensity + algorithm + dv := density_ph(sat.psat, dewEnthalpy(sat)); + annotation (Inline=true); + end dewDensity; + + redeclare function extends bubbleEntropy + algorithm + sl := specificEntropy( + setState_phX( + sat.psat, + bubbleEnthalpy(sat), + fill(0, 0))); + annotation (Inline=true); + end bubbleEntropy; + + redeclare function extends dewEntropy + algorithm + sv := specificEntropy( + setState_phX( + sat.psat, + dewEnthalpy(sat), + fill(0, 0))); + annotation (Inline=true); + end dewEntropy; + + redeclare function extends setBubbleState + algorithm + state := setState_phX( + sat.psat, + bubbleEnthalpy(sat), + fill(0, 0), + phase); + annotation (Inline=true); + end setBubbleState; + + redeclare function extends setDewState + algorithm + state := setState_phX( + sat.psat, + dewEnthalpy(sat), + fill(0, 0), + phase); + annotation (Inline=true); + end setDewState; + + redeclare function extends dBubbleDensity_dPressure + algorithm + ddldp := 0; + annotation (Inline=true); + end dBubbleDensity_dPressure; + + redeclare function extends dDewDensity_dPressure + algorithm + ddvdp := 0; + annotation (Inline=true); + end dDewDensity_dPressure; + + redeclare function extends dBubbleEnthalpy_dPressure + algorithm + dhldp := 0; + annotation (Inline=true); + end dBubbleEnthalpy_dPressure; + + redeclare function extends dDewEnthalpy_dPressure + algorithm + dhvdp := 0; + annotation (Inline=true); + end dDewEnthalpy_dPressure; + + redeclare function extends density_derh_p + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + ddhp := pro.ddhp; + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + protected + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro; + algorithm + pro := ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph( + state.p, + state.h, + Region); + ddph := pro.ddph; + annotation (Inline=true); + end density_derp_h; +end WaterSteamSimple; diff --git a/ThermoSysPro/Properties/Media/WaterSteamSimple/package.order b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.order new file mode 100644 index 00000000..24365266 --- /dev/null +++ b/ThermoSysPro/Properties/Media/WaterSteamSimple/package.order @@ -0,0 +1,48 @@ +Region +SaturationProperties +ThermodynamicState +BaseProperties +density_ph +temperature_ph +setState_phX +setState_psX +setState_pTX +setState_dTX +setSmoothState +specificEnthalpy_pTX +temperature_phX +density_phX +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +surfaceTension +velocityOfSound +isentropicEnthalpy +saturationTemperature +saturationTemperature_derp +saturationPressure +setSat_p +setSat_T +bubbleEnthalpy +dewEnthalpy +bubbleDensity +dewDensity +bubbleEntropy +dewEntropy +setBubbleState +setDewState +dBubbleDensity_dPressure +dDewDensity_dPressure +dBubbleEnthalpy_dPressure +dDewEnthalpy_dPressure +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/package.mo b/ThermoSysPro/Properties/Media/package.mo new file mode 100644 index 00000000..921e6fe5 --- /dev/null +++ b/ThermoSysPro/Properties/Media/package.mo @@ -0,0 +1,115 @@ +within ThermoSysPro.Properties; +package Media + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Media; diff --git a/ThermoSysPro/Properties/Media/package.order b/ThermoSysPro/Properties/Media/package.order new file mode 100644 index 00000000..ded20b5d --- /dev/null +++ b/ThermoSysPro/Properties/Media/package.order @@ -0,0 +1,11 @@ +PartialSubCMedium +PartialThermoSysProMedium +PartialTwoPhaseThermoSysProMedium +Functions +WaterSteam +FlueGases +C3H3F5 +Oil_TherminolVP1 +MoltenSalt +DryAirIdealGas +WaterSteamSimple diff --git a/ThermoSysPro/Properties/package.order b/ThermoSysPro/Properties/package.order index 46af4f53..9ac6910e 100644 --- a/ThermoSysPro/Properties/package.order +++ b/ThermoSysPro/Properties/package.order @@ -10,3 +10,4 @@ WaterSolution SolarSalt ModelicaMediaFlueGases Common +Media From 3d5457cc57e8925f649e9795b5033df7a84f5941 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:03:35 +0200 Subject: [PATCH 180/213] #125 port Fluid boundary conditions medium support onto develop --- .../Fluid/BoundaryConditions/AirHumidity.mo | 140 ++++++++++++------ .../Fluid/BoundaryConditions/PlugA.mo | 28 ++-- .../Fluid/BoundaryConditions/PlugB.mo | 63 +++++--- ThermoSysPro/Fluid/BoundaryConditions/RefH.mo | 33 +++-- ThermoSysPro/Fluid/BoundaryConditions/RefP.mo | 34 +++-- ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo | 34 +++-- .../Fluid/BoundaryConditions/RefSubC.mo | 94 ++++++++++++ ThermoSysPro/Fluid/BoundaryConditions/RefT.mo | 107 +++++++++---- .../Fluid/BoundaryConditions/RefXgas.mo | 111 ++++++++------ ThermoSysPro/Fluid/BoundaryConditions/Sink.mo | 61 ++++---- .../Fluid/BoundaryConditions/SinkP.mo | 77 +++++----- .../Fluid/BoundaryConditions/SinkPQ.mo | 78 +++++----- .../Fluid/BoundaryConditions/SinkQ.mo | 78 +++++----- .../Fluid/BoundaryConditions/Source.mo | 86 +++++------ .../Fluid/BoundaryConditions/SourceP.mo | 102 ++++++------- .../Fluid/BoundaryConditions/SourcePQ.mo | 103 ++++++------- .../Fluid/BoundaryConditions/SourceQ.mo | 98 ++++++------ .../Fluid/BoundaryConditions/package.order | 1 + 18 files changed, 779 insertions(+), 549 deletions(-) create mode 100644 ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo diff --git a/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo index b6bc6662..adfb720b 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo @@ -2,17 +2,15 @@ within ThermoSysPro.Fluid.BoundaryConditions; model AirHumidity "Air humidity" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real hum0 = 0.5 "Air humidiy"; - parameter Units.SI.Temperature T0 = 290 "Fixed fluid temperature"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - Units.SI.AbsolutePressure ppvap0(start = 1e4) "Intermediate vapor partial pressure"; - Units.SI.Density rho_vap0(start = 200) "Intermediate H2O density"; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Real hum0=0.5 "Air humidiy"; + parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; + +public + Units.SI.AbsolutePressure ppvap0(start=1e4) + "Intermediate vapor partial pressure"; + Units.SI.Density rho_vap0(start=200) "Intermediate H2O density"; Units.SI.AbsolutePressure P "Air pressure"; Units.SI.MassFlowRate Q "Air mass flow rate"; Units.SI.SpecificEnthalpy h "Air specific enthalpy"; @@ -23,24 +21,30 @@ model AirHumidity "Air humidity" Units.SI.AbsolutePressure ppvap(start = 1e4) "Vapor partial pressure"; Units.SI.AbsolutePressure ppair "Air partial pressure"; Real hum "Air relative humidity"; - Real Xo2as(start = 0.2) "O2 mass fraction in dry air"; - Real Xco2 "CO2 mass fraction at the outlet"; + Real Xo2as(start=0.2) "O2 mass fraction in dry air"; Real Xh2o "H2O mass fraction at the outlet"; - Real Xo2 "O2 mass fraction at the outlet"; - Real Xso2 "SO2 mas fraction at the outlet"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal humidity "Air humidity" annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + +public + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro + annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet C1(redeclare package Medium=Medium) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal humidity + "Air humidity" + annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium=Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Nitrogen"}); + parameter Integer iO2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Oxygen"}); + parameter Integer iH2O = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Water"}); + parameter Integer iCO2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Carbondioxide"}); + parameter Integer iSO2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Sulfurdioxide"}); equation -/* The fluid type must be flue gases */ - assert(ftype == FluidType.FlueGases, "AirHumidity: the fluid type must be flue gases"); if (cardinality(humidity) == 0) then humidity.signal = hum0; end if; @@ -54,40 +58,78 @@ equation C1.diff_on_2 = C2.diff_on_2; C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; + + C1.SubC = C2.SubC; + P = C1.P; Q = C1.Q; h = C1.h; - ftype = C1.ftype; -/* O2 mass fraction at the inlet */ - Xo2as = C1.Xo2; -/* Temperature at the outlet */ - T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, Xco2, Xh2o, Xo2as, Xso2); -/* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */ - Xco2 = 0; - Xso2 = 0; + + /* O2 mass fraction at the inlet */ + Xo2as = C1.Xi[iO2]; + + /* Temperature at the outlet */ +// T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, 0, Xh2o, Xo2as, 0); + T = Medium.temperature_phX(P,h, C2.Xi); + + /* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */ + C2.Xi[iSO2] = 0; + C2.Xi[iCO2] = 0; Xh2o = rho_vap/(rho_vap + rho_air); - Xo2 = Xo2as*(1 - Xh2o); - C2.Xco2 = Xco2; - C2.Xso2 = Xso2; - C2.Xh2o = Xh2o; - C2.Xo2 = Xo2; -/* Vapor partial pressure */ + C2.Xi[iH2O] = Xh2o; + C2.Xi[iO2] = Xo2as*(1 - Xh2o); + C2.Xi[iN2] = 1- Xo2as*(1 - Xh2o) - Xh2o; + + /* Vapor partial pressure */ ppvap = psvap*hum; 0 = if (ppvap < 0.061080e-4) then ppvap0 - 0.061080e-4 else ppvap - ppvap0; /* Air partial pressure */ ppair = P - ppvap; /* Vapor saturation pressure */ psvap = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(T); -/* H2O density */ - pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, mode); + + /* H2O density */ + pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, 0); + rho_vap0 = pro.d; 0 = if (ppvap < 0.061080e-4) then rho_vap - (rho_vap0*ppvap/ppvap0) else rho_vap - rho_vap0; -/* Air density */ - rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, Xco2, Xh2o, Xo2as, Xso2); - annotation( - Diagram(graphics = {Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{0, 100}, {0, 40}}, color = {0, 0, 255}), Line(points = {{20, 60}, {0, 40}, {-20, 60}}, color = {0, 0, 255}), Line(points = {{-90, 0}, {-40, 0}}, color = {0, 0, 255}), Line(points = {{40, 0}, {90, 0}}, color = {0, 0, 255}), Text(extent = {{-28, 30}, {28, -26}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid, textString = "H2O")}), - Icon(graphics = {Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{0, 100}, {0, 40}}, color = {0, 0, 255}), Line(points = {{20, 60}, {0, 40}, {-20, 60}}, color = {0, 0, 255}), Line(points = {{-90, 0}, {-40, 0}}, color = {0, 0, 255}), Line(points = {{40, 0}, {90, 0}}, color = {0, 0, 255}), Text(extent = {{-28, 30}, {28, -26}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid, textString = "H2O")}), + + /* Air density */ + rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, 0, Xh2o, Xo2as, 0); + + annotation (Diagram(graphics={ + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "H2O")}), Icon(graphics={ + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({255,255,0}, fill_color_static), + fillPattern=FillPattern.Solid), + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "H2O")}), Documentation(revisions = " Author @@ -97,4 +139,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end AirHumidity; \ No newline at end of file +end AirHumidity; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo index 8c3172d9..548a40e5 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo @@ -1,24 +1,34 @@ within ThermoSysPro.Fluid.BoundaryConditions; model PlugA "Plug" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation Q = C.Q; P = C.P; C.h_vol_1 = h; C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; -/* Flow reversal */ + + C.SubC = SubC0; + + /* Flow reversal */ if continuous_flow_reversal then C.h = ThermoSysPro.Functions.SmoothCond(C.Q*C.diff_res_2, C.h_vol_1, C.h_vol_2, 1); else diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo index 533f1f2a..13dd493b 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo @@ -1,20 +1,19 @@ within ThermoSysPro.Fluid.BoundaryConditions; model PlugB "Plug" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Real Xco2(start = 0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start = 0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start = 0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); + Medium.MassFraction X[Medium.nXi] "Fluid mass fraction"; + Medium.ExtraProperty SubC[Medium.nC] "Fluid trace substances"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); equation Q = C.Q; P = C.P; @@ -22,15 +21,39 @@ equation C.h_vol_2 = h; C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {-40, 0}, {-54, 10}}), Line(points = {{-54, -10}, {-40, 0}}), Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {128, 255, 0})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-92, 0}, {-40, 0}, {-54, 10}}), Line(points = {{-54, -10}, {-40, 0}}), Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular))}), - Window(x = 0.23, y = 0.15, width = 0.81, height = 0.71), + + SubC = C.SubC; + + X = C.Xi; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{-90,0},{-40,0},{-54,10}}), + Line(points={{-54,-10},{-40,0}}), + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={128,255,0})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{-92,0},{-40,0},{-54,10}}), + Line(points={{-54,-10},{-40,0}}), + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular))}), + Window( + x=0.23, + y=0.15, + width=0.81, + height=0.71), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -41,4 +64,4 @@ Baligh El Hefni Daniel Bouskela ")); -end PlugB; \ No newline at end of file +end PlugB; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo index b9855f7e..d7805d26 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo @@ -2,16 +2,25 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefH "Fixed specific enthalpy reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter Units.SI.SpecificEnthalpy h0 = 1.e5 "Fixed fluid specific enthalpy"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.SpecificEnthalpy h0=1.e5 "Fixed fluid specific enthalpy"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpy + annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + equation if (cardinality(ISpecificEnthalpy) == 0) then ISpecificEnthalpy.signal = h0; @@ -25,11 +34,11 @@ equation C1.diff_on_2 = C2.diff_on_2; C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; P = C1.P; h = C1.h; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo index 3e991483..6e0dc6ed 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo @@ -2,16 +2,25 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefP "Fixed pressure reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fixed fluid pressure"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.AbsolutePressure P0=1.e5 "Fixed fluid pressure"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure + annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + equation if (cardinality(IPressure) == 0) then IPressure.signal = P0; @@ -25,11 +34,12 @@ equation C1.diff_on_2 = C2.diff_on_2; C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; P = C1.P; h = C1.h; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo index 345ab0b1..0506177c 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo @@ -2,16 +2,26 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefQ "Fixed mass flow reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter Units.SI.MassFlowRate Q0 = 10 "Fixed fluid mass flow"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + + parameter Units.SI.MassFlowRate Q0=10 "Fixed fluid mass flow"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow + annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + equation if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; @@ -25,11 +35,11 @@ equation C1.diff_on_2 = C2.diff_on_2; C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; P = C1.P; h = C1.h; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo new file mode 100644 index 00000000..eb4d6aa8 --- /dev/null +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo @@ -0,0 +1,94 @@ +within ThermoSysPro.Fluid.BoundaryConditions; +model RefSubC "Fixed SubC reference" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + + +public + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + +equation + C1.Q = C2.Q; + C1.P = C2.P; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + C1.SubC = SubC0; + + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={128,255,0}), + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "C")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor= {0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "C")}), + Window( + x=0.06, + y=0.08, + width=0.82, + height=0.65), + Documentation(info = " +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + ", revisions = " +Authors + +Baligh El Hefni +Daniel Bouskela + + ")); +end RefSubC; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo index 356987a0..a21c5b71 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo @@ -2,25 +2,28 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefT "Fixed temperature reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Temperature T0 = 290 "Fixed fluid temperature"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + + parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ITemperature annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + equation if (cardinality(ITemperature) == 0) then ITemperature.signal = T0; @@ -34,21 +37,67 @@ equation C1.diff_on_2 = C2.diff_on_2; C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; P = C1.P; h = C1.h; - ftype = C1.ftype; -/* Computation of the fluid specific enthalpy */ - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, ITemperature.signal, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {128, 255, 0}), Line(points = {{0, 100}, {0, 40}}, color = {0, 0, 255}), Line(points = {{20, 60}, {0, 40}, {-20, 60}}, color = {0, 0, 255}), Line(points = {{-90, 0}, {-40, 0}}, color = {0, 0, 255}), Line(points = {{40, 0}, {90, 0}}, color = {0, 0, 255}), Text(extent = {{-28, 30}, {28, -26}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid, textString = "T")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{0, 100}, {0, 40}}, color = {0, 0, 255}), Line(points = {{20, 60}, {0, 40}, {-20, 60}}, color = {0, 0, 255}), Line(points = {{-90, 0}, {-40, 0}}, color = {0, 0, 255}), Line(points = {{40, 0}, {90, 0}}, color = {0, 0, 255}), Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Text(extent = {{-28, 30}, {28, -26}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid, textString = "T")}), - Window(x = 0.06, y = 0.08, width = 0.82, height = 0.65), + + + /* Computation of the fluid specific enthalpy */ + h = Medium.specificEnthalpy_pTX(p=P, T=ITemperature.signal, X=X); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={128,255,0}), + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "T")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor= {0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString= + "T")}), + Window( + x=0.06, + y=0.08, + width=0.82, + height=0.65), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -60,4 +109,4 @@ Daniel Bouskela "), DymolaStoredErrors); -end RefT; \ No newline at end of file +end RefT; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo index 6e0e3420..8ee3224a 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo @@ -2,38 +2,19 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefXgas "Fixed gas composition" extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter Real Xco2 = 0.05 "CO2 mass fraction at the outlet"; - parameter Real Xh2o = 0.01 "H2O mass fraction at the outlet"; - parameter Real Xo2 = 0.1 "O2 mass fraction at the outlet"; - parameter Real Xso2 = 0 "SO2 mas fraction at the outlet"; - Units.SI.MassFlowRate Q "Fluid mass flow rate"; - Units.SI.AbsolutePressure P "Pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal IXco2 annotation( - Placement(transformation(origin = {-90, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - InstrumentationAndControl.Connectors.InputReal IXh2o annotation( - Placement(transformation(origin = {-30, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - InstrumentationAndControl.Connectors.InputReal IXo2 annotation( - Placement(transformation(origin = {30, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - InstrumentationAndControl.Connectors.InputReal IXso2 annotation( - Placement(transformation(origin = {90, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nXi] = Medium.X_default[1:Medium.nXi] "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + equation - if (cardinality(IXco2) == 0) then - IXco2.signal = Xco2; - end if; - if (cardinality(IXh2o) == 0) then - IXh2o.signal = Xh2o; - end if; - if (cardinality(IXo2) == 0) then - IXo2.signal = Xo2; - end if; - if (cardinality(IXso2) == 0) then - IXso2.signal = Xso2; - end if; + C1.Q = C2.Q; C1.P = C2.P; C1.h = C2.h; @@ -43,22 +24,56 @@ equation C1.diff_on_2 = C2.diff_on_2; C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - Q = C1.Q; - P = C1.P; - h = C1.h; - C1.Xco2 = Xco2; - C1.Xso2 = Xso2; - C1.Xh2o = Xh2o; - C1.Xo2 = Xo2; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {128, 255, 0}), Line(points = {{-90, 0}, {-40, 0}}, color = {0, 0, 255}), Line(points = {{40, 0}, {90, 0}}, color = {0, 0, 255}), Text(extent = {{-28, 30}, {28, -26}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid, textString = "X"), Line(points = {{0, 100}, {0, 40}}, color = {0, 0, 255}), Line(points = {{20, 60}, {0, 40}, {-20, 60}}, color = {0, 0, 255})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{-90, 0}, {-40, 0}}, color = {0, 0, 255}), Line(points = {{40, 0}, {90, 0}}, color = {0, 0, 255}), Text(extent = {{-28, 27}, {28, -29}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid, textString = "X"), Line(points = {{0, 100}, {0, 40}}, color = {0, 0, 255}), Line(points = {{20, 60}, {0, 40}, {-20, 60}}, color = {0, 0, 255}), Rectangle(extent = {{-100, 100}, {100, 90}}, lineColor = {28, 108, 200}, fillColor = {28, 108, 200}, fillPattern = FillPattern.Solid), Text(extent = {{-100, 90}, {-80, 80}}, lineColor = {28, 108, 200}, fillColor = {28, 108, 200}, fillPattern = FillPattern.None, textString = "CO2"), Text(extent = {{-40, 90}, {-20, 80}}, lineColor = {28, 108, 200}, fillColor = {28, 108, 200}, fillPattern = FillPattern.None, textString = "H2O"), Text(extent = {{20, 90}, {40, 80}}, lineColor = {28, 108, 200}, fillColor = {28, 108, 200}, fillPattern = FillPattern.None, textString = "O2"), Text(extent = {{80, 90}, {100, 80}}, lineColor = {28, 108, 200}, fillColor = {28, 108, 200}, fillPattern = FillPattern.None, textString = "SO2")}), - Window(x = 0.06, y = 0.08, width = 0.82, height = 0.65), + + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; + + C1.Xi = X0; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={128,255,0}), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Text( + extent={{-28,30},{28,-26}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString="X"), + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-40,40},{40,-40}}, + lineColor={0,0,255}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{-90,0},{-40,0}}, color={0,0,255}), + Line(points={{40,0},{90,0}}, color={0,0,255}), + Text( + extent={{-28,27},{28,-29}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid, + textString="X"), + Line(points={{0,100},{0,40}}, color={0,0,255}), + Line(points={{20,60},{0,40},{-20,60}}, color={0,0,255})}), + Window( + x=0.06, + y=0.08, + width=0.82, + height=0.65), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -70,4 +85,4 @@ Daniel Bouskela "), DymolaStoredErrors); -end RefXgas; \ No newline at end of file +end RefXgas; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo index c274688a..60e34bb9 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo @@ -1,49 +1,42 @@ within ThermoSysPro.Fluid.BoundaryConditions; model Sink "MultiFluids sink" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = false "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - Real Xco2(start = 0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start = 0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start = 0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature + "Fixed specific enthalpy or temperature according to option_temperature" + annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); equation Q = C.Q; P = C.P; C.h_vol_2 = h; C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; -/* Specific enthalpy or temperature */ + + X = C.Xi; + SubC = C.SubC; + + /* Specific enthalpy or temperature */ if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then if option_temperature then ISpecificEnthalpyOrTemperature.signal = T0; @@ -53,10 +46,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {-40, 0}, {-54, 10}}), Line(points = {{-54, -10}, {-40, 0}}), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {255, 255, 0}), Text(extent = {{12, -42}, {42, -62}}, textString = "h / T")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo index 3341e814..e7b8265c 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo @@ -1,51 +1,56 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SinkP "Multi-fluid sink with fixed pressure" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeVariableInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.AbsolutePressure P0 = 100000 "Sink pressure"; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = true "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.AbsolutePressure P0=100000 "Sink pressure"; + parameter Units.SI.Temperature T0=290 + "Source temperature (active if option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 + "Source specific enthalpy (active if option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=true + "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2(start = 0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xo2(start = 0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.Units.SI.MassFraction Xso2(start = 0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure "Fixed pressure" annotation( - Placement(transformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure + "Fixed pressure" + annotation (Placement(transformation( + origin={50,0}, + extent={{-10,-10},{10,10}}, + rotation=180))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature + "Fixed specific enthalpy or temperature according to option_temperature" + annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); equation Q = C.Q; C.P = P; C.h_vol_2 = h; C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; + + X = C.Xi; + SubC = C.SubC; + if (cardinality(IPressure) == 0) then IPressure.signal = P0; end if; @@ -60,10 +65,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {-40, 0}, {-58, 10}}), Line(points = {{-40, 0}, {-58, -10}}), Text(extent = {{40, 28}, {58, 8}}, textString = "P"), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Text(extent = {{-94, 26}, {98, -30}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, textString = "P"), Text(extent = {{12, -42}, {42, -62}}, textString = "h / T")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo index d969741d..4f99c8d3 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo @@ -1,54 +1,54 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SinkPQ "MultiFluids sink with fixed pressure and mass flow rate" + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.AbsolutePressure P0 = 100000 "Fluid pressure (active if IPressure connector is not connected)"; - parameter Units.SI.MassFlowRate Q0 = 100 "Mass flow (active if IMassFlow connector is not connected)"; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = false "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", + group="Medium")); + parameter Units.SI.AbsolutePressure P0=100000 "Fluid pressure (active if IPressure connector is not connected)"; + parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - Real Xco2(start = 0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start = 0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start = 0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation( - Placement(transformation(origin = {0, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure "Fixed pressure" annotation( - Placement(transformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation (Placement(transformation( + origin={0,50}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure "Fixed pressure" annotation (Placement(transformation( + origin={50,0}, + extent={{-10,-10},{10,10}}, + rotation=180))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" + annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); equation C.Q = Q; P = C.P; C.h_vol_2 = h; C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; -/* Mass flow */ + + X = C.Xi; + SubC = C.SubC; + + /* Mass flow */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -68,10 +68,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {-40, 0}, {-54, 10}}), Line(points = {{-54, -10}, {-40, 0}}), Text(extent = {{40, 30}, {60, 10}}, textString = "P"), Text(extent = {{12, 60}, {32, 40}}, textString = "Q"), Text(extent = {{10, -40}, {30, -60}}, textString = "h"), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {255, 255, 0}), Text(extent = {{-20, 20}, {22, -24}}, lineColor = {0, 0, 255}, textString = "P Q")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo index 7d209703..6fee15ac 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo @@ -1,51 +1,57 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SinkQ "Multi-fluids sink with fixed mass flow rate" + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.MassFlowRate Q0 = 100 "Mass flow (active if IMassFlow connector is not connected)"; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = false "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.MassFlowRate Q0=100 + "Mass flow (active if IMassFlow connector is not connected)"; + parameter Units.SI.Temperature T0=290 + "Source temperature (active if option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 + "Source specific enthalpy (active if option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false + "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - Real Xco2(start = 0.01) "CO2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xh2o "H2O mass fraction of the fluid crossing the boundary of the control volume"; - Real Xo2(start = 0.2) "O2 mass fraction of the fluid crossing the boundary of the control volume"; - Real Xso2(start = 0) "SO2 mass fraction of the fluid crossing the boundary of the control volume"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation( - Placement(transformation(origin = {0, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation (Placement(transformation( + origin={0,50}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); equation C.Q = Q; P = C.P; C.h_vol_2 = h; C.diff_res_2 = 0; C.diff_on_2 = diffusion; - ftype = C.ftype; - Xco2 = C.Xco2; - Xh2o = C.Xh2o; - Xo2 = C.Xo2; - Xso2 = C.Xso2; -/* Mass flow */ + + X = C.Xi; + SubC = C.SubC; + + + + /* Mass flow */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -60,10 +66,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {-40, 0}, {-54, 10}}), Line(points = {{-54, -10}, {-40, 0}}), Text(extent = {{16, 60}, {36, 40}}, textString = "Q"), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {255, 255, 0}), Text(extent = {{-20, 20}, {22, -24}}, lineColor = {0, 0, 255}, textString = "Q"), Text(extent = {{12, -42}, {42, -62}}, textString = "h / T")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo index 52bc5246..f68e0ea2 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo @@ -1,64 +1,48 @@ within ThermoSysPro.Fluid.BoundaryConditions; model Source "MultiFluids Source" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = false "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco2 = 0.01 "CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o = if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2 = 0.22 "O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2 = 0 "SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - Units.SI.Temperature T(start = 300) "Fluid temperature"; - Interfaces.Connectors.FluidOutlet C annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); -protected - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Units.SI.Temperature T(start=300) "Fluid temperature"; + + Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature + "Fixed specific enthalpy or temperature according to option_temperature" + annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); equation Q = C.Q; P = C.P; C.h_vol_1 = h; C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; -/* Specific enthalpy or temperature */ + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + /* Specific enthalpy or temperature */ if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then if option_temperature then ISpecificEnthalpyOrTemperature.signal = T0; @@ -68,10 +52,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo index 2593715c..0a8b1799 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo @@ -1,66 +1,62 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SourceP "Multi-fluid source with fixed pressure" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.AbsolutePressure P0 = 300000 "Source pressure"; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = true "true: temperature is fixed - false: specific enthalpy is fixed"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco2 = 0.01 "CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o = if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2 = 0.22 "O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2 = 0 "SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.AbsolutePressure P0=300000 "Source pressure"; + parameter Units.SI.Temperature T0=290 + "Source temperature (active if option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 + "Source specific enthalpy (active if option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=true + "true: temperature is fixed - false: specific enthalpy is fixed"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - Units.SI.Temperature T(start = 300) "Fluid temperature"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure "Fixed pressure" annotation( - Placement(transformation(extent = {{-60, -10}, {-40, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); -protected - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Units.SI.Temperature T(start=300) "Fluid temperature"; + + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure + "Fixed pressure" annotation (Placement(transformation(extent={{-60,-10},{-40, + 10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package + Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110, + 10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature + "Fixed specific enthalpy or temperature according to option_temperature" + annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); equation Q = C.Q; C.P = P; C.h_vol_1 = h; C.diff_res_1 = 0; C.diff_on_1 = diffusion; - C.ftype = ftype; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + if (cardinality(IPressure) == 0) then IPressure.signal = P0; end if; @@ -75,10 +71,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo index 9e9906f8..d2e784c1 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo @@ -1,70 +1,61 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SourcePQ "MultiFluids source with fixed pressure and mass flow rate" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.AbsolutePressure P0 = 300000 "Fluid pressure (active if IPressure connector is not connected)"; - parameter Units.SI.MassFlowRate Q0 = 100 "Mass flow (active if IMassFlow connector is not connected)"; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = false "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco2 = 0.01 "CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o = if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2 = 0.22 "O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2 = 0 "SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.AbsolutePressure P0=300000 "Fluid pressure (active if IPressure connector is not connected)"; + parameter Units.SI.MassFlowRate Q0=100 "Mass flow (active if IMassFlow connector is not connected)"; + parameter Units.SI.Temperature T0=290 "Source temperature (active if option_temperature=true)" annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 "Source specific enthalpy (active if option_temperature=false)" annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + parameter Boolean option_temperature=false "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - Units.SI.Temperature T(start = 300) "Fluid temperature"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation( - Placement(transformation(origin = {0, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure "Fixed pressure" annotation( - Placement(transformation(extent = {{-60, -10}, {-40, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Units.SI.Temperature T(start=300) "Fluid temperature"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow + "Fixed mass flow rate" + annotation (Placement(transformation( + origin={0,50}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IPressure + "Fixed pressure" + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation= + 0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature + "Fixed specific enthalpy or temperature according to option_temperature" + annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation C.Q = Q; C.P = P; C.h_vol_1 = h; C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; -/* Mass flow */ + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + /* Mass flow */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -84,10 +75,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo index 51ac4b98..fbd574bb 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo @@ -1,67 +1,59 @@ within ThermoSysPro.Fluid.BoundaryConditions; model SourceQ "Multi-fluid source with fixed mass flow rate" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.MassFlowRate Q0 = 100 "Mass flow (active if IMassFlow connector is not connected)"; - parameter Units.SI.Temperature T0 = 290 "Source temperature (active if option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = option_temperature)); - parameter Units.SI.SpecificEnthalpy h0 = 100000 "Source specific enthalpy (active if option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not option_temperature)); - parameter Boolean option_temperature = false "true:temperature fixed - false:specific enthalpy fixed"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 regions (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco2 = 0.01 "CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o = if ftype == FluidType.FlueGases then 0.05 else 0 "H2O mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo2 = 0.22 "O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso2 = 0 "SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Composition values (active for flue gases only)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.MassFlowRate Q0=100 + "Mass flow (active if IMassFlow connector is not connected)"; + parameter Units.SI.Temperature T0=290 + "Source temperature (active if option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=option_temperature)); + parameter Units.SI.SpecificEnthalpy h0=100000 + "Source specific enthalpy (active if option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not option_temperature)); + parameter Boolean option_temperature=false + "true:temperature fixed - false:specific enthalpy fixed"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + +public Units.SI.MassFlowRate Q "Fluid mass flow rate"; Units.SI.AbsolutePressure P "Fluid pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - Units.SI.Temperature T(start = 300) "Fluid temperature"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation( - Placement(transformation(origin = {0, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation( - Placement(transformation(origin = {0, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); -protected - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Units.SI.Temperature T(start=300) "Fluid temperature"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal IMassFlow "Fixed mass flow rate" annotation (Placement(transformation( + origin={0,50}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal ISpecificEnthalpyOrTemperature "Fixed specific enthalpy or temperature according to option_temperature" annotation (Placement(transformation( + origin={0,-50}, + extent={{10,-10},{-10,10}}, + rotation=270))); equation C.Q = Q; P = C.P; C.h_vol_1 = h; C.diff_res_1 = 0; C.diff_on_1 = diffusion; - ftype = C.ftype; - if flue_gases then - C.Xco2 = Xco2; - C.Xh2o = Xh2o; - C.Xo2 = Xo2; - C.Xso2 = Xso2; - else - C.Xco2 = 0; - C.Xh2o = 0; - C.Xo2 = 0; - C.Xso2 = 0; - end if; -/* Mass flow rate */ + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + /* Mass flow rate */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -76,10 +68,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/package.order b/ThermoSysPro/Fluid/BoundaryConditions/package.order index 6583266e..fe404a50 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/BoundaryConditions/package.order @@ -6,6 +6,7 @@ RefQ RefH RefT RefXgas +RefSubC SourceP SourceQ SourcePQ From b1141930465306d6fe0419b10258006ab90939e4 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:08:29 +0200 Subject: [PATCH 181/213] #125 port Fluid junctions medium support onto develop --- .../Fluid/Junctions/DeheaterMixer2.mo | 125 +++++---- .../Fluid/Junctions/MassFlowMultiplier.mo | 85 +++--- ThermoSysPro/Fluid/Junctions/Mixer2.mo | 129 +++++---- ThermoSysPro/Fluid/Junctions/Mixer3.mo | 132 +++++---- ThermoSysPro/Fluid/Junctions/Mixer8.mo | 261 ++++++++++-------- ThermoSysPro/Fluid/Junctions/Splitter2.mo | 137 +++++---- ThermoSysPro/Fluid/Junctions/Splitter3.mo | 181 +++++++----- ThermoSysPro/Fluid/Junctions/StaticDrum.mo | 201 +++++++------- ThermoSysPro/Fluid/Junctions/SteamDryer.mo | 158 ++++++----- .../Junctions/SteamExtractionSplitter.mo | 158 ++++++----- 10 files changed, 878 insertions(+), 689 deletions(-) diff --git a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo index 8012586d..0fc54605 100644 --- a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo +++ b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo @@ -1,25 +1,23 @@ within ThermoSysPro.Fluid.Junctions; model DeheaterMixer2 - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Temperature Tmax = 700 "Maximum fluid temperature"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P(start = 50e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - Units.SI.Temperature T(start = 700) "Fluid temperature"; - Units.SI.SpecificEnthalpy hmax(start = 10e5) "Maximum fluid specific enthalpy"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.Temperature Tmax=700 "Maximum fluid temperature"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.AbsolutePressure P(start=50e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; + Units.SI.Temperature T(start=700) "Fluid temperature"; + Units.SI.SpecificEnthalpy hmax(start=10e5) "Maximum fluid specific enthalpy"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Je_mix "Thermal power diffusion from inlet e_mix"; Units.SI.Power Js "Thermal power diffusion from outlet s"; @@ -30,23 +28,14 @@ model DeheaterMixer2 Real re "Value of r(Q/gamma) for inlet e"; Real re_mix "Value of r(Q/gamma) for inlet e_mix"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_mix annotation( - Placement(transformation(extent = {{-9, -110}, {11, -90}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{90, 50}, {110, 70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-110, 50}, {-90, 70}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_mix(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,50},{110,70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Ce_mix.ftype; - fluids[4] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "DeheaterMixer2: fluids mixing in volume are not compatible with each other"); -/* Mass balance equation */ + + /* Mass balance equation */ 0 = Ce.Q + Ce_mix.Q - Cs.Q; P = Ce.P; P = Ce_mix.P; @@ -62,17 +51,14 @@ equation else h = hmax; end if; -/* Fluid composition balance equations */ - 0 = Ce.Xco2*Ce.Q + Ce_mix.Xco2*Ce_mix.Q - Cs.Xco2*Cs.Q; - 0 = Ce.Xh2o*Ce.Q + Ce_mix.Xh2o*Ce_mix.Q - Cs.Xh2o*Cs.Q; - 0 = Ce.Xo2*Ce.Q + Ce_mix.Xo2*Ce_mix.Q - Cs.Xo2*Cs.Q; - 0 = Ce.Xso2*Ce.Q + Ce_mix.Xso2*Ce_mix.Q - Cs.Xso2*Cs.Q; - Cs.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; -/* Flow reversal */ + + /* Fluid composition balance equations */ + Cs.Xi*Cs.Q = Ce.Xi*Ce.Q + Ce_mix.Xi*Ce_mix.Q; + + /* Traces composition balance equations */ + Cs.SubC*Cs.Q = Ce.SubC*Ce.Q + Ce_mix.SubC*Ce_mix.Q; + + /* Flow reversal */ if continuous_flow_reversal then Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); else @@ -107,13 +93,46 @@ equation Ce.diff_on_2 = diffusion; Ce_mix.diff_on_2 = diffusion; Cs.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); - hmax = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, Tmax, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 80}, {-100, 40}, {-20, 40}, {-20, -100}, {20, -100}, {20, 40}, {100, 40}, {100, 80}, {-100, 80}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-16, 72}, {16, 46}}, lineColor = {0, 0, 255}, textString = "D")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 80}, {-100, 40}, {-20, 40}, {-20, -100}, {20, -100}, {20, 40}, {100, 40}, {100, 80}, {-100, 80}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Text(extent = {{-18, 78}, {22, 38}}, lineColor = {0, 0, 255}, textString = "D")}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(P, h, Cs.Xi); + + hmax = Medium.specificEnthalpy_pTX(P, Tmax, Cs.Xi); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{ + 100,40},{100,80},{-100,80}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), Text( + extent={{-16,72},{16,46}}, + lineColor={0,0,255}, + textString= + "D")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-100,80},{-100,40},{-20,40},{-20,-100},{20,-100},{20,40},{ + 100,40},{100,80},{-100,80}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), Text( + extent={{-18,78},{22,38}}, + lineColor={0,0,255}, + textString= + "D")}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -124,4 +143,4 @@ Baligh El Hefni Daniel Bouskela ")); -end DeheaterMixer2; \ No newline at end of file +end DeheaterMixer2; diff --git a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo index 80474a59..054bfbaf 100644 --- a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo +++ b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo @@ -1,28 +1,25 @@ within ThermoSysPro.Fluid.Junctions; model MassFlowMultiplier "Mass flow multipliier" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real alpha = 2 "Flow multiplier"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Real alpha=2 "Flow multiplier"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - Units.SI.Density rho(start = 998) "Fluid density"; - FluidType fluids[3] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.Density rho(start=998) "Fluid density"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js "Thermal power diffusion from outlet s"; Units.SI.Power J "Total thermal power diffusion"; @@ -30,21 +27,15 @@ model MassFlowMultiplier "Mass flow multipliier" Units.SI.MassFlowRate gamma_s "Diffusion conductance for outlet s"; Real re "Value of r(Q/gamma) for inlet e"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "MassFlowMultiplier: fluids mixing in volume are not compatible with each other"); -/* Mass balance equation */ + + /* Mass balance equation */ 0 = alpha*Ce.Q - Cs.Q; P = Ce.P; P = Cs.P; @@ -52,17 +43,13 @@ equation 0 = alpha*Ce.Q*Ce.h - Cs.Q*Cs.h + J; Ce.h_vol_2 = h; Cs.h_vol_1 = h; -/* Fluid composition */ - 0 = Ce.Xco2*alpha*Ce.Q - Cs.Xco2*Cs.Q; - 0 = Ce.Xh2o*alpha*Ce.Q - Cs.Xh2o*Cs.Q; - 0 = Ce.Xo2*alpha*Ce.Q - Cs.Xo2*Cs.Q; - 0 = Ce.Xso2*alpha*Ce.Q - Cs.Xso2*Cs.Q; - Cs.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; -/* Flow reversal */ + + /* Fluid composition */ + Ce.Xi*alpha*Ce.Q = Cs.Xi*Cs.Q; + + Ce.SubC*alpha*Ce.Q = Cs.SubC*Cs.Q; + + /* Flow reversal */ if continuous_flow_reversal then Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); else @@ -89,12 +76,14 @@ equation Cs.diff_res_1 = 0; Ce.diff_on_2 = diffusion; Cs.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(P, h, Cs.Xi); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); + rho = Medium.density_phX(P,h,Cs.Xi); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 60}, {-100, -60}, {90, 0}, {-100, 60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 255, 0}), Text(extent = {{-60, 24}, {-20, -16}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "%alpha")}), diff --git a/ThermoSysPro/Fluid/Junctions/Mixer2.mo b/ThermoSysPro/Fluid/Junctions/Mixer2.mo index 019a85a5..93d2a4c1 100644 --- a/ThermoSysPro/Fluid/Junctions/Mixer2.mo +++ b/ThermoSysPro/Fluid/Junctions/Mixer2.mo @@ -1,24 +1,23 @@ within ThermoSysPro.Fluid.Junctions; model Mixer2 "Mixer with two inlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Real alpha1 "Extraction coefficient for inlet 1 (<=1)"; Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js "Thermal power diffusion from outlet s"; @@ -29,27 +28,22 @@ model Mixer2 "Mixer with two inlets" Real re1 "Value of r(Q/gamma) for inlet e1"; Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-50, -110}, {-30, -90}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-50, 90}, {-30, 110}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for inlet 1 (<=1)" annotation( - Placement(transformation(extent = {{-80, 50}, {-60, 70}}, rotation = 0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation( - Placement(transformation(extent = {{-20, 50}, {0, 70}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-50,-110},{-30,-90}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-50,90},{-30,110}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha1 + "Extraction coefficient for inlet 1 (<=1)" + annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha1 + annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "Mixer2: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.5; end if; @@ -63,17 +57,16 @@ equation Ce1.h_vol_2 = h; Ce2.h_vol_2 = h; Cs.h_vol_1 = h; -/* Fluid composition balance equations */ - 0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs.Xco2*Cs.Q; - 0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs.Xh2o*Cs.Q; - 0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs.Xo2*Cs.Q; - 0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs.Xso2*Cs.Q; - Cs.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; -/* Mass flow at the outlet */ + + /* Fluid composition balance equations */ + fill(0,Medium.nXi) = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs.Xi*Cs.Q; + + Cs.Xi = X; + + /* Traces composition balance equations */ + Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC = Cs.Q*Cs.SubC; + + /* Mass flow at the outlet */ if (cardinality(Ialpha1) <> 0) then Ce1.Q = Ialpha1.signal*Cs.Q; end if; @@ -114,12 +107,46 @@ equation Ce1.diff_on_2 = diffusion; Ce2.diff_on_2 = diffusion; Cs.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, -100}, {-20, -100}, {-20, -20}, {100, -20}, {100, 20}, {-20, 20}, {-20, 100}, {-60, 100}, {-60, -100}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-60, 80}, {-20, 40}}, textString = "1"), Text(extent = {{-60, -40}, {-20, -80}}, textString = "2")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, -100}, {-20, -100}, {-20, -20}, {100, -20}, {100, 20}, {-20, 20}, {-20, 100}, {-60, 100}, {-60, -100}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Text(extent = {{-56, 90}, {-24, 66}}, textString = "1"), Text(extent = {{-50, -66}, {-30, -88}}, textString = "2")}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(p=P, h=h, X=X); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{ + -20,100},{-60,100},{-60,-100}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text(extent={{-60,80},{-20,40}}, textString= + "1"), + Text(extent={{-60,-40},{-20,-80}}, textString= + "2")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,-100},{-20,-100},{-20,-20},{100,-20},{100,20},{-20,20},{ + -20,100},{-60,100},{-60,-100}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Text(extent={{-56,90},{-24,66}}, textString= + "1"), + Text(extent={{-50,-66},{-30,-88}}, textString= + "2")}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -131,4 +158,4 @@ Baligh El Hefni Daniel Bouskela ")); -end Mixer2; \ No newline at end of file +end Mixer2; diff --git a/ThermoSysPro/Fluid/Junctions/Mixer3.mo b/ThermoSysPro/Fluid/Junctions/Mixer3.mo index 8a2c8dfa..3c409f78 100644 --- a/ThermoSysPro/Fluid/Junctions/Mixer3.mo +++ b/ThermoSysPro/Fluid/Junctions/Mixer3.mo @@ -1,25 +1,23 @@ within ThermoSysPro.Fluid.Junctions; model Mixer3 "Mixer with three inlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Real alpha1 "Extraction coefficient for inlet 1 (<=1)"; Real alpha2 "Extraction coefficient for inlet 2 (<=1)"; Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[5] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -33,34 +31,19 @@ model Mixer3 "Mixer with three inlets" Real re2 "Value of r(Q/gamma) for inlet e2"; Real re3 "Value of r(Q/gamma) for inlet e3"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-50, -110}, {-30, -90}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-50, 90}, {-30, 110}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for inlet 1 (<=1)" annotation( - Placement(transformation(extent = {{-80, 50}, {-60, 70}}, rotation = 0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation( - Placement(transformation(extent = {{-20, 50}, {0, 70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal Ialpha2 "Extraction coefficient for inlet 2 (<=1)" annotation( - Placement(transformation(extent = {{-80, -70}, {-60, -50}}, rotation = 0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha2 annotation( - Placement(transformation(extent = {{-20, -70}, {0, -50}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-110},{-30,-90}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for inlet 1 (<=1)" annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha2 "Extraction coefficient for inlet 2 (<=1)" annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha2 annotation (Placement(transformation(extent={{-20,-70},{0,-50}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "Mixer3: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.3; end if; @@ -70,6 +53,7 @@ equation /* Mass balance equation */ 0 = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q; P = Ce1.P; + P = Ce2.P; P = Ce3.P; P = Cs.P; @@ -90,17 +74,13 @@ equation Oalpha1.signal = alpha1; alpha2 = if noEvent(abs(Cs.Q) > 0) then Ce2.Q/Cs.Q else Modelica.Constants.inf; Oalpha2.signal = alpha2; -/* Fluid composition balance equations */ - 0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q; - 0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q; - 0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q; - 0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q; - Cs.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; -/* Flow reversal */ + + /* Fluid composition balance equations */ + Cs.Xi*Cs.Q = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q; + + Cs.SubC*Cs.Q = Ce1.SubC*Ce1.Q + Ce2.SubC*Ce2.Q + Ce3.SubC*Ce3.Q; + + /* Flow reversal */ if continuous_flow_reversal then Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); else @@ -143,12 +123,48 @@ equation Ce2.diff_on_2 = diffusion; Ce3.diff_on_2 = diffusion; Cs.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 100}, {-20, 100}, {-20, 20}, {100, 20}, {100, -20}, {-20, -20}, {-20, -100}, {-60, -100}, {-60, -20}, {-100, -20}, {-100, 20}, {-60, 20}, {-60, 100}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-60, 80}, {-20, 40}}, textString = "1"), Text(extent = {{-60, -40}, {-20, -80}}, textString = "2")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 100}, {-20, 100}, {-20, 20}, {100, 20}, {100, -20}, {-20, -20}, {-20, -100}, {-60, -100}, {-60, -20}, {-100, -20}, {-100, 20}, {-60, 20}, {-60, 100}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Text(extent = {{-50, 88}, {-32, 72}}, textString = "1"), Text(extent = {{-54, -72}, {-26, -88}}, textString = "2")}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(P, h, Cs.Xi); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{ + -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60, + 100}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text(extent={{-60,80},{-20,40}}, textString= + "1"), + Text(extent={{-60,-40},{-20,-80}}, textString= + "2")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,100},{-20,100},{-20,20},{100,20},{100,-20},{-20,-20},{ + -20,-100},{-60,-100},{-60,-20},{-100,-20},{-100,20},{-60,20},{-60, + 100}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Text(extent={{-50,88},{-32,72}}, textString= + "1"), + Text(extent={{-54,-72},{-26,-88}}, textString= + "2")}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -160,4 +176,4 @@ Baligh El Hefni Daniel Bouskela ")); -end Mixer3; \ No newline at end of file +end Mixer3; diff --git a/ThermoSysPro/Fluid/Junctions/Mixer8.mo b/ThermoSysPro/Fluid/Junctions/Mixer8.mo index c4354ca9..b5445bee 100644 --- a/ThermoSysPro/Fluid/Junctions/Mixer8.mo +++ b/ThermoSysPro/Fluid/Junctions/Mixer8.mo @@ -1,23 +1,20 @@ within ThermoSysPro.Fluid.Junctions; model Mixer8 "Mixer with eight inlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[10] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -45,62 +42,45 @@ model Mixer8 "Mixer with eight inlets" Real re6 "Value of r(Q/gamma) for inlet e6"; Real re7 "Value of r(Q/gamma) for inlet e7"; Real re8 "Value of r(Q/gamma) for inlet e8"; - Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce5 annotation( - layer = "icon", - Placement(transformation(extent = {{-110, -50}, {-90, -30}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce6 annotation( - layer = "icon", - Placement(transformation(extent = {{-112, -109}, {-92, -89}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce7 annotation( - layer = "icon", - Placement(transformation(extent = {{-40, -109}, {-20, -89}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation( - layer = "icon", - Placement(transformation(extent = {{-112, 90}, {-92, 110}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - layer = "icon", - Placement(transformation(extent = {{-40, 90}, {-20, 110}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - layer = "icon", - Placement(transformation(extent = {{20, 92}, {40, 112}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - layer = "icon", - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce8 annotation( - layer = "icon", - Placement(transformation(extent = {{20, -109}, {40, -89}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4 annotation( - layer = "icon", - Placement(transformation(extent = {{-112, 30}, {-92, 50}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Real rs + "Value of r(Q/gamma) for outlet s"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce5(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{-110,-50},{-90,-30}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce6(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{-112,-109},{-92,-89}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce7(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{-40,-109},{-20,-89}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{-112,90},{-92,110}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{-40,90},{-20,110}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{20,92},{40,112}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce8(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{20,-109},{40,-89}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (layer= + "icon", Placement(transformation(extent={{-112,30},{-92,50}}, rotation= + 0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Ce4.ftype; - fluids[6] = Ce5.ftype; - fluids[7] = Ce6.ftype; - fluids[8] = Ce7.ftype; - fluids[9] = Ce8.ftype; - fluids[10] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "Mixer8: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -108,11 +88,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then Ce3.Q = 0; @@ -120,11 +97,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Ce4) == 0) then Ce4.Q = 0; @@ -132,11 +106,8 @@ equation Ce4.h_vol_1 = 1.e5; Ce4.diff_res_1 = 0; Ce4.diff_on_1 = false; - Ce4.ftype = ftype; - Ce4.Xco2 = 0; - Ce4.Xh2o = 0; - Ce4.Xo2 = 0; - Ce4.Xso2 = 0; + Ce4.Xi = Medium.X_default[1:Medium.nXi]; + Ce4.SubC = Medium.C_default; end if; if (cardinality(Ce5) == 0) then Ce5.Q = 0; @@ -144,11 +115,8 @@ equation Ce5.h_vol_1 = 1.e5; Ce5.diff_res_1 = 0; Ce5.diff_on_1 = false; - Ce5.ftype = ftype; - Ce5.Xco2 = 0; - Ce5.Xh2o = 0; - Ce5.Xo2 = 0; - Ce5.Xso2 = 0; + Ce5.Xi = Medium.X_default[1:Medium.nXi]; + Ce5.SubC = Medium.C_default; end if; if (cardinality(Ce6) == 0) then Ce6.Q = 0; @@ -156,11 +124,8 @@ equation Ce6.h_vol_1 = 1.e5; Ce6.diff_res_1 = 0; Ce6.diff_on_1 = false; - Ce6.ftype = ftype; - Ce6.Xco2 = 0; - Ce6.Xh2o = 0; - Ce6.Xo2 = 0; - Ce6.Xso2 = 0; + Ce6.Xi = Medium.X_default[1:Medium.nXi]; + Ce6.SubC = Medium.C_default; end if; if (cardinality(Ce7) == 0) then Ce7.Q = 0; @@ -168,11 +133,8 @@ equation Ce7.h_vol_1 = 1.e5; Ce7.diff_res_1 = 0; Ce7.diff_on_1 = false; - Ce7.ftype = ftype; - Ce7.Xco2 = 0; - Ce7.Xh2o = 0; - Ce7.Xo2 = 0; - Ce7.Xso2 = 0; + Ce7.Xi = Medium.X_default[1:Medium.nXi]; + Ce7.SubC = Medium.C_default; end if; if (cardinality(Ce8) == 0) then Ce8.Q = 0; @@ -180,11 +142,8 @@ equation Ce8.h_vol_1 = 1.e5; Ce8.diff_res_1 = 0; Ce8.diff_on_1 = false; - Ce8.ftype = ftype; - Ce8.Xco2 = 0; - Ce8.Xh2o = 0; - Ce8.Xo2 = 0; - Ce8.Xso2 = 0; + Ce8.Xi = Medium.X_default[1:Medium.nXi]; + Ce8.SubC = Medium.C_default; end if; if (cardinality(Cs) == 0) then Cs.Q = 0; @@ -214,17 +173,13 @@ equation Ce7.h_vol_2 = h; Ce8.h_vol_2 = h; Cs.h_vol_1 = h; -/* Fluid composition balance equations */ - 0 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q + Ce5.Xco2*Ce5.Q + Ce6.Xco2*Ce6.Q + Ce7.Xco2*Ce7.Q + Ce8.Xco2*Ce8.Q - Cs.Xco2*Cs.Q; - 0 = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q + Ce5.Xh2o*Ce5.Q + Ce6.Xh2o*Ce6.Q + Ce7.Xh2o*Ce7.Q + Ce8.Xh2o*Ce8.Q - Cs.Xh2o*Cs.Q; - 0 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q + Ce5.Xo2*Ce5.Q + Ce6.Xo2*Ce6.Q + Ce7.Xo2*Ce7.Q + Ce8.Xo2*Ce8.Q - Cs.Xo2*Cs.Q; - 0 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q + Ce5.Xso2*Ce5.Q + Ce6.Xso2*Ce6.Q + Ce7.Xso2*Ce7.Q + Ce8.Xso2*Ce8.Q - Cs.Xso2*Cs.Q; - Cs.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; -/* Flow reversal */ + + /* Fluid composition balance equations */ + Cs.Xi*Cs.Q = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q + Ce5.Xi*Ce5.Q + Ce6.Xi*Ce6.Q + Ce7.Xi*Ce7.Q + Ce8.Xi*Ce8.Q; + + Cs.SubC*Cs.Q = Ce1.SubC*Ce1.Q + Ce2.SubC*Ce2.Q + Ce3.SubC*Ce3.Q + Ce4.SubC*Ce4.Q + Ce5.SubC*Ce5.Q + Ce6.SubC*Ce6.Q + Ce7.SubC*Ce7.Q + Ce8.SubC*Ce8.Q; + + /* Flow reversal */ if continuous_flow_reversal then Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); else @@ -307,12 +262,84 @@ equation Ce7.diff_on_2 = diffusion; Ce8.diff_on_2 = diffusion; Cs.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs.Xco2, Cs.Xh2o, Cs.Xo2, Cs.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-40, 80}, {40, 0}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-40, 0}, {40, -80}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{40, 0}, {92, 0}}), Line(points = {{-92, -40}, {-40, -40}}), Line(points = {{-30, 90}, {-30, 66}}, color = {0, 0, 255}), Line(points = {{30, 92}, {30, 66}}, color = {0, 0, 255}), Line(points = {{-30, -66}, {-30, -90}}, color = {0, 0, 255}), Line(points = {{30, -66}, {30, -90}}, color = {0, 0, 255}), Line(points = {{-92, 40}, {-40, 40}}), Line(points = {{-38, -52}, {-92, -90}}, color = {0, 0, 255}), Line(points = {{-38, 54}, {-92, 90}}, color = {0, 0, 255}), Polygon(points = {{-40, 40}, {-38, 54}, {-34, 60}, {-24, 72}, {-8, 80}, {6, 80}, {18, 76}, {26, 70}, {34, 62}, {38, 52}, {40, 46}, {40, 40}, {40, 38}, {40, 34}, {40, -40}, {40, -46}, {36, -58}, {30, -66}, {24, -72}, {16, -76}, {6, -80}, {0, -80}, {-4, -80}, {-8, -80}, {-18, -76}, {-28, -70}, {-34, -60}, {-36, -58}, {-38, -54}, {-38, -52}, {-40, -46}, {-40, -40}, {-40, 0}, {-40, 40}}, lineColor = {28, 108, 200})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-40, 80}, {40, 0}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Ellipse(extent = {{-40, 0}, {40, -80}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-30, 90}, {-30, 66}}, color = {0, 0, 255}), Line(points = {{-30, -66}, {-30, -90}}, color = {0, 0, 255}), Line(points = {{30, 92}, {30, 66}}, color = {0, 0, 255}), Line(points = {{30, -66}, {30, -90}}, color = {0, 0, 255}), Line(points = {{-92, 40}, {-40, 40}}), Line(points = {{-92, -40}, {-40, -40}}), Line(points = {{40, 0}, {92, 0}}), Line(points = {{-38, -52}, {-92, -90}}, color = {0, 0, 255}), Line(points = {{-38, 54}, {-92, 90}}, color = {0, 0, 255})}), - Window(x = 0.05, y = 0.07, width = 0.74, height = 0.85), + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(P, h, Cs.Xi); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-40,80},{40,0}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-40,0},{40,-80}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-40,40},{40,-40}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Line(points={{40,0},{92,0}}), + Line(points={{-92,-40},{-40,-40}}), + Line(points={{-30,90},{-30,66}}, color={0,0,255}), + Line(points={{30,92},{30,66}}, color={0,0,255}), + Line(points={{-30,-66},{-30,-90}}, color={0,0,255}), + Line(points={{30,-66},{30,-90}}, color={0,0,255}), + Line(points={{-92,40},{-40,40}}), + Line(points={{-38,-52},{-92,-90}}, color={0,0,255}), + Line(points={{-38,54},{-92,90}}, color={0,0,255}), + Polygon(points={{-40,40},{-38,54},{-34,60},{-24,72},{-8,80},{6,80},{18, + 76},{26,70},{34,62},{38,52},{40,46},{40,40},{40,38},{40,34},{40, + -40},{40,-46},{36,-58},{30,-66},{24,-72},{16,-76},{6,-80},{0,-80}, + {-4,-80},{-8,-80},{-18,-76},{-28,-70},{-34,-60},{-36,-58},{-38, + -54},{-38,-52},{-40,-46},{-40,-40},{-40,0},{-40,40}}, lineColor={ + 28,108,200})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-40,80},{40,0}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-40,0},{40,-80}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-40,40},{40,-40}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Line(points={{-30,90},{-30,66}}, color={0,0,255}), + Line(points={{-30,-66},{-30,-90}}, color={0,0,255}), + Line(points={{30,92},{30,66}}, color={0,0,255}), + Line(points={{30,-66},{30,-90}}, color={0,0,255}), + Line(points={{-92,40},{-40,40}}), + Line(points={{-92,-40},{-40,-40}}), + Line(points={{40,0},{92,0}}), + Line(points={{-38,-52},{-92,-90}}, color={0,0,255}), + Line(points={{-38,54},{-92,90}}, color={0,0,255})}), + Window( + x=0.05, + y=0.07, + width=0.74, + height=0.85), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -324,4 +351,4 @@ Baligh El Hefni Daniel Bouskela ")); -end Mixer8; \ No newline at end of file +end Mixer8; diff --git a/ThermoSysPro/Fluid/Junctions/Splitter2.mo b/ThermoSysPro/Fluid/Junctions/Splitter2.mo index fcf24e17..ba8dcd89 100644 --- a/ThermoSysPro/Fluid/Junctions/Splitter2.mo +++ b/ThermoSysPro/Fluid/Junctions/Splitter2.mo @@ -1,24 +1,23 @@ within ThermoSysPro.Fluid.Junctions; model Splitter2 "Splitter with two outlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Real alpha1 "Extraction coefficient for outlet 1 (<=1)"; Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; @@ -29,27 +28,22 @@ model Splitter2 "Splitter with two outlets" Real re "Value of r(Q/gamma) for inlet e"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{30, 90}, {50, 110}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{30, -110}, {50, -90}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for outlet 1 (<=1)" annotation( - Placement(transformation(extent = {{0, 50}, {20, 70}}, rotation = 0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation( - Placement(transformation(extent = {{60, 50}, {80, 70}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{30,90},{50,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha1 + "Extraction coefficient for outlet 1 (<=1)" + annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha1 + annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "Splitter2: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.5; end if; @@ -63,22 +57,19 @@ equation Ce.h_vol_2 = h; Cs1.h_vol_1 = h; Cs2.h_vol_1 = h; -/* Fluid composition balance equations */ - 0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - 0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - 0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - 0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; -/* Mass flow at outlet 1 */ + + /* Fluid composition balance equations */ + fill(0,Medium.nXi) = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + Cs1.Xi = X; + Cs2.Xi = X; + + /* Traces composition balance equations */ + Cs1.Q*Cs1.SubC + Cs2.Q*Cs2.SubC = Ce.Q*Ce.SubC; + + Cs2.SubC = Cs1.SubC; + + /* Mass flow at outlet 1 */ if (cardinality(Ialpha1) <> 0) then Cs1.Q = Ialpha1.signal*Ce.Q; end if; @@ -121,12 +112,46 @@ equation Ce.diff_on_2 = diffusion; Cs1.diff_on_1 = diffusion; Cs2.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{60, 100}, {60, -100}, {20, -100}, {20, -20}, {-100, -20}, {-100, 20}, {20, 20}, {20, 100}, {60, 100}}, lineColor = {0, 0, 0}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{20, 80}, {60, 40}}, textString = "1"), Text(extent = {{20, -40}, {60, -80}}, textString = "2")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{60, 100}, {60, -100}, {20, -100}, {20, -20}, {-100, -20}, {-100, 20}, {20, 20}, {20, 100}, {60, 100}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Text(extent = {{30, 88}, {50, 72}}, textString = "1"), Text(extent = {{32, -72}, {50, -88}}, textString = "2")}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(p=P, h=h, X=X); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{ + 20,20},{20,100},{60,100}}, + lineColor={0,0,0}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text(extent={{20,80},{60,40}}, textString= + "1"), + Text(extent={{20,-40},{60,-80}}, textString= + "2")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{60,100},{60,-100},{20,-100},{20,-20},{-100,-20},{-100,20},{ + 20,20},{20,100},{60,100}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Text(extent={{30,88},{50,72}}, textString= + "1"), + Text(extent={{32,-72},{50,-88}}, textString= + "2")}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -139,4 +164,4 @@ Daniel Bouskela "), DymolaStoredErrors); -end Splitter2; \ No newline at end of file +end Splitter2; diff --git a/ThermoSysPro/Fluid/Junctions/Splitter3.mo b/ThermoSysPro/Fluid/Junctions/Splitter3.mo index 36d80092..90e2be64 100644 --- a/ThermoSysPro/Fluid/Junctions/Splitter3.mo +++ b/ThermoSysPro/Fluid/Junctions/Splitter3.mo @@ -1,25 +1,23 @@ within ThermoSysPro.Fluid.Junctions; model Splitter3 "Splitter with three outlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Real alpha1 "Extraction coefficient for outlet 1 (<=1)"; Real alpha2 "Extraction coefficient for outlet 2 (<=1)"; Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; Units.SI.Temperature T "Fluid temperature"; - FluidType fluids[5] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; @@ -33,34 +31,19 @@ model Splitter3 "Splitter with three outlets" Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; Real rs3 "Value of r(Q/gamma) for outlet s3"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-108, -10}, {-88, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{30, 90}, {50, 110}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{30, -110}, {50, -90}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for outlet 1 (<=1)" annotation( - Placement(transformation(extent = {{0, 50}, {20, 70}}, rotation = 0))); - InstrumentationAndControl.Connectors.InputReal Ialpha2 "Extraction coefficient for outlet 2 (<=1)" annotation( - Placement(transformation(extent = {{0, -70}, {20, -50}}, rotation = 0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation( - Placement(transformation(extent = {{60, 50}, {80, 70}}, rotation = 0))); - InstrumentationAndControl.Connectors.OutputReal Oalpha2 annotation( - Placement(transformation(extent = {{60, -70}, {80, -50}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha1 "Extraction coefficient for outlet 1 (<=1)" annotation (Placement(transformation(extent={{0,50},{20,70}}, rotation=0))); + InstrumentationAndControl.Connectors.InputReal Ialpha2 "Extraction coefficient for outlet 2 (<=1)" annotation (Placement(transformation(extent={{0,-70},{20,-50}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha1 annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + InstrumentationAndControl.Connectors.OutputReal Oalpha2 annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - fluids[5] = Cs3.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "Splitter3: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ialpha1) == 0) then Ialpha1.signal = 0.3; end if; @@ -90,27 +73,18 @@ equation Oalpha1.signal = alpha1; alpha2 = if noEvent(abs(Ce.Q) > 0) then Cs2.Q/Ce.Q else Modelica.Constants.inf; Oalpha2.signal = alpha2; -/* Fluid composition balance equations */ - 0 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q; - 0 = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q; - 0 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q; - 0 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; -/* Flow reversal */ + + /* Fluid composition balance equations */ + Ce.Xi*Ce.Q = Cs1.Xi*Cs1.Q + Cs2.Xi*Cs2.Q + Cs3.Xi*Cs3.Q; + Cs1.Xi = Cs2.Xi; + Cs1.Xi = Cs3.Xi; + + /* Traces composition balance equations */ + Ce.SubC*Ce.Q = Cs1.SubC*Cs1.Q + Cs2.SubC*Cs2.Q + Cs3.SubC*Cs3.Q; + Cs1.SubC = Cs2.SubC; + Cs1.SubC = Cs3.SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -157,11 +131,84 @@ equation Cs1.diff_on_1 = diffusion; Cs2.diff_on_1 = diffusion; Cs3.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics = {Text(extent = {{10, -60}, {48, -90}}, textString = "3"), Rectangle(extent = {{44, -27}, {50, -65}}, lineColor = {28, 108, 200}, pattern = LinePattern.None, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-100, -20}, {-100, 20}, {20, 20}, {20, 100}, {60, 100}, {60, 20}, {100, 20}, {100, -20}, {60, -20}, {60, -100}, {20, -100}, {20, -20}, {-100, -20}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{20, 80}, {60, 40}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "1"), Text(extent = {{20, -40}, {60, -80}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "2"), Text(extent = {{60, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "3")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics = {Text(extent = {{10, -60}, {48, -90}}, textString = "3"), Rectangle(extent = {{44, -27}, {50, -65}}, lineColor = {28, 108, 200}, pattern = LinePattern.None, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-100, -20}, {-100, 20}, {20, 20}, {20, 100}, {60, 100}, {60, 20}, {100, 20}, {100, -20}, {60, -20}, {60, -100}, {20, -100}, {20, -20}, {-100, -20}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Text(extent = {{26, 88}, {52, 74}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "1"), Text(extent = {{26, -74}, {52, -88}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "2"), Text(extent = {{66, 6}, {92, -8}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "3")}), + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(P, h, Ce.Xi); + annotation ( + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ + 100,100}}), graphics={ + Text(extent={{10,-60},{48,-90}}, textString = "3"), + Rectangle( + extent={{44,-27},{50,-65}}, + lineColor={28,108,200}, + pattern=LinePattern.None, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100, + 20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{20,80},{60,40}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString= + "1"), + Text( + extent={{20,-40},{60,-80}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString= + "2"), + Text( + extent={{60,20},{100,-20}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString= + "3")}), + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={ + Text(extent={{10,-60},{48,-90}}, textString = "3"), + Rectangle( + extent={{44,-27},{50,-65}}, + lineColor={28,108,200}, + pattern=LinePattern.None, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-100,-20},{-100,20},{20,20},{20,100},{60,100},{60,20},{100, + 20},{100,-20},{60,-20},{60,-100},{20,-100},{20,-20},{-100,-20}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Text( + extent={{26,88},{52,74}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString= + "1"), + Text( + extent={{26,-74},{52,-88}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString= + "2"), + Text( + extent={{66,6},{92,-8}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString= + "3")}), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -173,4 +220,4 @@ Baligh El Hefni Daniel Bouskela ")); -end Splitter3; \ No newline at end of file +end Splitter3; diff --git a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo index 30478631..31df68ca 100644 --- a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo +++ b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo @@ -1,22 +1,30 @@ within ThermoSysPro.Fluid.Junctions; - model StaticDrum "Static drum" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real x = 1 "Vapor separation efficiency at the outlet"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Ce_steam.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Real x=1 "Vapor separation efficiency at the outlet"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.SpecificEnthalpy hr=2501569 + "Water/steam reference specific enthalpy at 0.01°C"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P(start = 10.e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy hl(start = 100000) "Liquid phase specific enthalpy"; - Units.SI.SpecificEnthalpy hv(start = 2800000) "Gas phase specific enthalpy"; - FluidType fluids[9] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.AbsolutePressure P(start=10.e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy hl(start=100000) "Liquid phase specific enthalpy"; + Units.SI.SpecificEnthalpy hv(start=2800000) "Gas phase specific enthalpy"; + Medium.MassFraction X[Medium.nXi] "Fluid mass fraction"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames) "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames) "Vapor phase trace substances"; + Medium.ExtraProperty SubCs_sur[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace substances at the steam/reheater outlet"; + Medium.C_BiPhase C_record; Units.SI.Power Je_steam "Thermal power diffusion from inlet e_steam"; Units.SI.Power Je_sup "Thermal power diffusion from inlet e_sup"; Units.SI.Power Je_eva "Thermal power diffusion from inlet e_eva"; @@ -42,57 +50,44 @@ model StaticDrum "Static drum" Real rs_purg "Value of r(Q/gamma) for outlet s_purg"; Real rs_sup "Value of r(Q/gamma) for outlet s_sup"; Real rs_sur "Value of r(Q/gamma) for outlet s_sur"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eva annotation( - Placement(transformation(extent = {{-104, -44}, {-84, -24}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eco annotation( - Placement(transformation(extent = {{-50, -104}, {-30, -84}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sup annotation( - Placement(transformation(extent = {{84, 24}, {104, 44}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_eva annotation( - Placement(transformation(extent = {{30, -104}, {50, -84}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sur annotation( - Placement(transformation(extent = {{28, 84}, {48, 104}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_purg annotation( - Placement(transformation(extent = {{84, -44}, {104, -24}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_steam annotation( - Placement(transformation(extent = {{-48, 84}, {-28, 104}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_sup annotation( - Placement(transformation(extent = {{-104, 26}, {-84, 46}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-104, 66}, {-78, 98}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{72, 68}, {100, 100}}, rotation = 0))); - Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer fluid = Integer(ftype) "Fluid number"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eva(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-104,-44},{-84,-24}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eco(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-50,-104},{-30,-84}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sup(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{84,24},{104,44}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_eva(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{30,-104},{50,-84}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sur(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{28,84},{48,104}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_purg(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{84,-44},{104,-24}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_steam(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-48,84},{-28,104}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_sup(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-104,26},{-84,46}}, rotation=0))); + Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); + + Medium.SaturationProperties sat; + Medium.ThermodynamicState state_e_steam "Steam inlet state"; + Medium.ThermodynamicState state_e_sup "Extra inlet state"; + Medium.ThermodynamicState state_e_eva "Evaporator inlet state"; + Medium.ThermodynamicState state_e_eco "Economizer inlet state"; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce_steam.ftype; - fluids[3] = Ce_sup.ftype; - fluids[4] = Ce_eva.ftype; - fluids[5] = Ce_eco.ftype; - fluids[6] = Cs_eva.ftype; - fluids[7] = Cs_purg.ftype; - fluids[8] = Cs_sup.ftype; - fluids[9] = Cs_sur.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticDrum: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ -/* Steam input */ + + /* Unconnected connectors */ + /* Steam input */ if (cardinality(Ce_steam) == 0) then Ce_steam.Q = 0; Ce_steam.h = 1.e5; Ce_steam.h_vol_1 = 1.e5; Ce_steam.diff_res_1 = 0; Ce_steam.diff_on_1 = false; - Ce_steam.ftype = ftype; - Ce_steam.Xco2 = 0; - Ce_steam.Xh2o = 0; - Ce_steam.Xo2 = 0; - Ce_steam.Xso2 = 0; + Ce_steam.Xi = Medium.X_default[1:Medium.nXi]; + Ce_steam.SubC = Medium.C_default; end if; /* Extra input */ if (cardinality(Ce_sup) == 0) then @@ -101,11 +96,8 @@ equation Ce_sup.h_vol_1 = 1.e5; Ce_sup.diff_res_1 = 0; Ce_sup.diff_on_1 = false; - Ce_sup.ftype = ftype; - Ce_sup.Xco2 = 0; - Ce_sup.Xh2o = 0; - Ce_sup.Xo2 = 0; - Ce_sup.Xso2 = 0; + Ce_sup.Xi = Medium.X_default[1:Medium.nXi]; + Ce_sup.SubC = Medium.C_default; end if; /* Input from evaporator */ if (cardinality(Ce_eva) == 0) then @@ -114,11 +106,8 @@ equation Ce_eva.h_vol_1 = 1.e5; Ce_eva.diff_res_1 = 0; Ce_eva.diff_on_1 = false; - Ce_eva.ftype = ftype; - Ce_eva.Xco2 = 0; - Ce_eva.Xh2o = 0; - Ce_eva.Xo2 = 0; - Ce_eva.Xso2 = 0; + Ce_eva.Xi = Medium.X_default[1:Medium.nXi]; + Ce_eva.SubC = Medium.C_default; end if; /* Input from the economizer */ if (cardinality(Ce_eco) == 0) then @@ -127,11 +116,8 @@ equation Ce_eco.h_vol_1 = 1.e5; Ce_eco.diff_res_1 = 0; Ce_eco.diff_on_1 = false; - Ce_eco.ftype = ftype; - Ce_eco.Xco2 = 0; - Ce_eco.Xh2o = 0; - Ce_eco.Xo2 = 0; - Ce_eco.Xso2 = 0; + Ce_eco.Xi = Medium.X_default[1:Medium.nXi]; + Ce_eco.SubC = Medium.C_default; end if; /* Output to the evaporator */ if (cardinality(Cs_eva) == 0) then @@ -181,32 +167,30 @@ equation Cs_purg.h_vol_1 = hl; Cs_sup.h_vol_1 = hl; Cs_sur.h_vol_1 = (1 - x)*hl + x*hv; -/* Fluid composition balance equations */ - 0 = Ce_steam.Xco2*Ce_steam.Q + Ce_sup.Xco2*Ce_sup.Q + Ce_eva.Xco2*Ce_eva.Q + Ce_eco.Xco2*Ce_eco.Q - Cs_sur.Xco2*Cs_sur.Q - Cs_sup.Xco2*Cs_sup.Q - Cs_purg.Xco2*Cs_purg.Q - Cs_eva.Xco2*Cs_eva.Q; - 0 = Ce_steam.Xh2o*Ce_steam.Q + Ce_sup.Xh2o*Ce_sup.Q + Ce_eva.Xh2o*Ce_eva.Q + Ce_eco.Xh2o*Ce_eco.Q - Cs_sur.Xh2o*Cs_sur.Q - Cs_sup.Xh2o*Cs_sup.Q - Cs_purg.Xh2o*Cs_purg.Q - Cs_eva.Xh2o*Cs_eva.Q; - 0 = Ce_steam.Xo2*Ce_steam.Q + Ce_sup.Xo2*Ce_sup.Q + Ce_eva.Xo2*Ce_eva.Q + Ce_eco.Xo2*Ce_eco.Q - Cs_sur.Xo2*Cs_sur.Q - Cs_sup.Xo2*Cs_sup.Q - Cs_purg.Xo2*Cs_purg.Q - Cs_eva.Xo2*Cs_eva.Q; - 0 = Ce_steam.Xso2*Ce_steam.Q + Ce_sup.Xso2*Ce_sup.Q + Ce_eva.Xso2*Ce_eva.Q + Ce_eco.Xso2*Ce_eco.Q - Cs_sur.Xso2*Cs_sur.Q - Cs_sup.Xso2*Cs_sup.Q - Cs_purg.Xso2*Cs_purg.Q - Cs_eva.Xso2*Cs_eva.Q; - Cs_eva.ftype = ftype; - Cs_purg.ftype = ftype; - Cs_sup.ftype = ftype; - Cs_sur.ftype = ftype; - Xco2 = Cs_eva.Xco2; - Xh2o = Cs_eva.Xh2o; - Xo2 = Cs_eva.Xo2; - Xso2 = Cs_eva.Xso2; - Xco2 = Cs_purg.Xco2; - Xh2o = Cs_purg.Xh2o; - Xo2 = Cs_purg.Xo2; - Xso2 = Cs_purg.Xso2; - Xco2 = Cs_sup.Xco2; - Xh2o = Cs_sup.Xh2o; - Xo2 = Cs_sup.Xo2; - Xso2 = Cs_sup.Xso2; - Xco2 = Cs_sur.Xco2; - Xh2o = Cs_sur.Xh2o; - Xo2 = Cs_sur.Xo2; - Xso2 = Cs_sur.Xso2; -/* Flow reversal */ + + /* Fluid composition balance equations */ + fill(0,Medium.nXi) = Ce_steam.Xi*Ce_steam.Q + Ce_sup.Xi*Ce_sup.Q + Ce_eva.Xi*Ce_eva.Q + Ce_eco.Xi*Ce_eco.Q - Cs_sur.Xi*Cs_sur.Q - Cs_sup.Xi*Cs_sup.Q - Cs_purg.Xi*Cs_purg.Q - Cs_eva.Xi*Cs_eva.Q; + + X = Cs_eva.Xi; + X = Cs_purg.Xi; + X = Cs_sup.Xi; + X = Cs_sur.Xi; + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + + fill(0, Medium.nC) = (1 - Medium.vapourQuality(state_e_steam))*Ce_steam.Q*Ce_steam.SubC + (1 - Medium.vapourQuality(state_e_sup))*Ce_sup.Q*Ce_sup.SubC + (1 - Medium.vapourQuality(state_e_eva))*Ce_eva.Q*Ce_eva.SubC + (1 - Medium.vapourQuality(state_e_eco))*Ce_eco.Q*Ce_eco.SubC - Cs_eva.Q*Cs_eva.SubC - Cs_purg.Q*Cs_purg.SubC - Cs_sup.Q*Cs_sup.SubC + Medium.vapourQuality(state_e_steam)*Ce_steam.Q*C_record.Cl + Medium.vapourQuality(state_e_sup)*Ce_sup.Q*C_record.Cl + Medium.vapourQuality(state_e_eva)*Ce_eva.Q*C_record.Cl + Medium.vapourQuality(state_e_eco)*Ce_eco.Q*C_record.Cl - (1 - x)*Cs_sur.Q*SubCl; + + fill(0, Medium.nC) = Medium.vapourQuality(state_e_steam)*Ce_steam.Q*C_record.Cg + Medium.vapourQuality(state_e_sup)*Ce_sup.Q*C_record.Cg + Medium.vapourQuality(state_e_eva)*Ce_eva.Q*C_record.Cg + Medium.vapourQuality(state_e_eco)*Ce_eco.Q*C_record.Cg - x*Cs_sur.Q*SubCv; + + SubCs_sur = (1 - x)*SubCl + x*SubCv; + + Cs_eva.SubC = SubCl; + Cs_purg.SubC = SubCl; + Cs_sup.SubC = SubCl; + Cs_sur.SubC = SubCs_sur; + + /* Flow reversal */ if continuous_flow_reversal then Cs_eva.h = ThermoSysPro.Functions.SmoothCond(Cs_eva.Q/gamma_s_eva, Cs_eva.h_vol_1, Cs_eva.h_vol_2, 1); Cs_purg.h = ThermoSysPro.Functions.SmoothCond(Cs_purg.Q/gamma_s_purg, Cs_purg.h_vol_1, Cs_purg.h_vol_2, 1); @@ -287,11 +271,18 @@ equation Cs_purg.diff_on_1 = diffusion; Cs_sup.diff_on_1 = diffusion; Cs_sur.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - hl = lsat.h; - hv = vsat.h; - T = lsat.T; + + /* Fluid thermodynamic properties */ + state_e_steam = Medium.setState_phX(p=P, h=Ce_steam.h, X=Medium.reference_X); + state_e_sup = Medium.setState_phX(p=P, h=Ce_sup.h, X=Medium.reference_X); + state_e_eva = Medium.setState_phX(p=P, h=Ce_eva.h, X=Medium.reference_X); + state_e_eco = Medium.setState_phX(p=P, h=Ce_eco.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + + hl = Medium.bubbleEnthalpy(sat); + hv = Medium.dewEnthalpy(sat); + T = sat.Tsat; + Cth.T = T; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{0, 90}, {0, -100}}), Ellipse(extent = {{-98, 96}, {98, -96}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{-86, -44}, {86, -44}}, color = {28, 108, 200}, pattern = LinePattern.Dash), Line(points = {{-44, -86}, {44, -86}}, color = {28, 108, 200}, pattern = LinePattern.Dash), Line(points = {{-64, -72}, {64, -72}}, color = {28, 108, 200}, pattern = LinePattern.Dash), Line(points = {{-78, -58}, {76, -58}}, color = {28, 108, 200}, pattern = LinePattern.Dash), Text(extent = {{-56, 94}, {-56, 92}}, textString = "Esteam")}), diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo index f3c10b71..b2b921d9 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo @@ -1,24 +1,33 @@ within ThermoSysPro.Fluid.Junctions; model SteamDryer "Steam dryer" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real eta = 1 "Steam dryer efficiency (0 <= eta <= 1)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e = IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - Real xe(start = 1.0) "Vapor mass fraction at the inlet"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + parameter Real eta=1 "Steam dryer efficiency (0 <= eta <= 1)"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.C_BiPhase C_record; + +public + Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; + Units.SI.Density rho(start=1.0) "Fluid density at inlet"; + Real xe(start=1.0) "Vapor mass fraction at the inlet"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Units.SI.Power Jev "Thermal power diffusion from inlet ev"; Units.SI.Power Jsv "Thermal power diffusion from outlet sv"; Units.SI.Power Jsl "Thermal power diffusion from outlet sl"; @@ -29,30 +38,20 @@ model SteamDryer "Steam dryer" Real rev "Value of r(Q/gamma) for inlet ev"; Real rsv "Value of r(Q/gamma) for outlet sv"; Real rsl "Value of r(Q/gamma) for outlet sl"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev annotation( - Placement(transformation(extent = {{-109, 30}, {-89, 50}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csv annotation( - Placement(transformation(extent = {{89, 30}, {109, 50}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1 annotation( - Placement(transformation(extent = {{-100, -98}, {-80, -78}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1 annotation( - Placement(transformation(extent = {{-76, -98}, {-56, -78}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csl annotation( - Placement(transformation(extent = {{-9, -110}, {11, -90}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode_e = Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer fluid = Integer(ftype) "Fluid number"; + +public + Medium.SaturationProperties sat; + Medium.ThermodynamicState state_e; + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-109,30},{-89,50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csv(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{89,30},{109,50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csl(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0))); + equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cev.ftype; - fluids[3] = Csv.ftype; - fluids[4] = Csl.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "SteamDryer: fluids mixing in volume are not compatible with each other"); -/* Check that eta is between 0 and 1 */ + + /* Check that eta is between 0 and 1 */ assert((eta >= 0) and (eta <= 1), "SteamDryer - Parameter eta should be >= 0 and <= 1"); /* Mass flow at the vapor outlet */ Csv.Q = noEvent(if (xe > 0) then Cev.Q*(1 - eta*(1 - xe)) else 0); @@ -65,23 +64,23 @@ equation 0 = Cev.Q*Cev.h - Csv.Q*Csv.h - Csl.Q*Csl.h + J; Cev.h_vol_2 = h; Csv.h_vol_1 = h; - Csl.h_vol_1 = noEvent(if (xe > 0) then lsat1.h else Cev.h); -/* Fluid composition balance equations*/ - 0 = Cev.Xco2*Cev.Q - Csv.Xco2*Csv.Q - Csl.Xco2*Csl.Q; - 0 = Cev.Xh2o*Cev.Q - Csv.Xh2o*Csv.Q - Csl.Xh2o*Csl.Q; - 0 = Cev.Xo2*Cev.Q - Csv.Xo2*Csv.Q - Csl.Xo2*Csl.Q; - 0 = Cev.Xso2*Cev.Q - Csv.Xso2*Csv.Q - Csl.Xso2*Csl.Q; - Csv.ftype = ftype; - Csl.ftype = ftype; - Csv.Xco2 = Xco2; - Csv.Xh2o = Xh2o; - Csv.Xo2 = Xo2; - Csv.Xso2 = Xso2; - Csl.Xco2 = Xco2; - Csl.Xh2o = Xh2o; - Csl.Xo2 = Xo2; - Csl.Xso2 = Xso2; -/* Flow reversal */ + Csl.h_vol_1 = noEvent(if (xe > 0) then Medium.bubbleEnthalpy(sat) else Cev.h); + + /* Fluid composition balance equations*/ + Cev.Xi*Cev.Q = Csv.Xi*Csv.Q + Csl.Xi*Csl.Q; + + Csv.Xi = X; + Csl.Xi = X; + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + Csv.SubC = C_record.Cg; + + Csv.Q*Csv.SubC + Csl.Q*Csl.SubC = Cev.Q*Cev.SubC + SubCSaS * Cev.Q; + + SubCSaS = SaS(); + + /* Flow reversal */ if continuous_flow_reversal then Csv.h = ThermoSysPro.Functions.SmoothCond(Csv.Q/gamma_sv, Csv.h_vol_1, Csv.h_vol_2, 1); Csl.h = ThermoSysPro.Functions.SmoothCond(Csl.Q/gamma_sl, Csl.h_vol_1, Csl.h_vol_2, 1); @@ -118,16 +117,41 @@ equation Cev.diff_on_2 = diffusion; Csv.diff_on_1 = diffusion; Csl.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - proe = ThermoSysPro.Properties.Fluid.Ph(Cev.P, Cev.h, mode_e, fluid); -/* Vapor mass fraction at the inlet */ - xe = proe.x; -/* Fluid thermodynamic properties at the saturation point */ - (lsat1, vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Cev.P, fluid); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-98, 40}, {-18, -100}, {22, -100}, {102, 40}, {-98, 40}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 40}, {-20, -100}, {20, -100}, {100, 40}, {-100, 40}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid)}), - Window(x = 0.17, y = 0.1, width = 0.76, height = 0.76), + + /* Fluid thermodynamic properties */ + state_e=Medium.setState_phX(p=Cev.P, h=Cev.h, X=Cev.Xi, region=mode_e); + rho = state_e.d; + + /* Vapor mass fraction at the inlet */ + xe=Medium.vapourQuality(state_e); + + /* Fluid thermodynamic properties at the saturation point */ + sat = Medium.setSat_p(Cev.P); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-98,40},{-18,-100},{22,-100},{102,40},{-98,40}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-100,40},{-20,-100},{20,-100},{100,40},{-100,40}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid)}), + Window( + x=0.17, + y=0.1, + width=0.76, + height=0.76), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -139,4 +163,4 @@ Baligh El Hefni Daniel Bouskela ")); -end SteamDryer; \ No newline at end of file +end SteamDryer; diff --git a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo index 9cb1a362..a9e62c3b 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo @@ -1,24 +1,34 @@ within ThermoSysPro.Fluid.Junctions; model SteamExtractionSplitter "Splitter for steam extraction" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real alpha = 1 "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e = IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Real x_ex(start = 0.99) "Vapor mass fraction at the extraction outlet"; - Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - FluidType fluids[4] "Fluids mixing in volume"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + + parameter Real alpha = 1 + "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.C_BiPhase C_record; + +public + Real x_ex(start=0.99) "Vapor mass fraction at the extraction outlet"; + Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; + Real xe(start=1.0) "Vapor mass fraction at the inlet"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js "Thermal power diffusion from outlet s"; Units.SI.Power Jex "Thermal power diffusion from outlet ex"; @@ -29,30 +39,17 @@ model SteamExtractionSplitter "Splitter for steam extraction" Real re "Value of r(Q/gamma) for inlet e"; Real rs "Value of r(Q/gamma) for outlet s"; Real rex "Value of r(Q/gamma) for outlet ex"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-113, -10}, {-93, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{93, -10}, {113, 10}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{-20, 80}, {0, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction outlet" annotation( - Placement(transformation(extent = {{30, -110}, {50, -90}}, rotation = 0))); -protected - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode_e = Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer fluid = Integer(ftype) "Fluid number"; + + Medium.SaturationProperties sat; + Medium.ThermodynamicState state_e; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-113,-10},{-93,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{93,-10},{113,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction outlet" annotation (Placement(transformation(extent={{30,-110},{50,-90}}, rotation=0))); + equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs.ftype; - fluids[4] = Cex.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "SteamExtractionSplitter: fluids mixing in volume are not compatible with each other"); -/* Mass balance equation */ + /* Mass balance equation */ 0 = Ce.Q - Cs.Q - Cex.Q; P = Ce.P; P = Cs.P; @@ -61,23 +58,23 @@ equation 0 = Ce.Q*Ce.h - Cs.Q*Cs.h - Cex.Q*Cex.h + J; Ce.h_vol_2 = h; Cs.h_vol_1 = h; - Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*lsat.h + x_ex*vsat.h else h; -/* Fluid composition */ - 0 = Ce.Xco2*Ce.Q - Cs.Xco2*Cs.Q - Cex.Xco2*Cex.Q; - 0 = Ce.Xh2o*Ce.Q - Cs.Xh2o*Cs.Q - Cex.Xh2o*Cex.Q; - 0 = Ce.Xo2*Ce.Q - Cs.Xo2*Cs.Q - Cex.Xo2*Cex.Q; - 0 = Ce.Xso2*Ce.Q - Cs.Xso2*Cs.Q - Cex.Xso2*Cex.Q; - Cs.ftype = ftype; - Cex.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; - Cex.Xco2 = Xco2; - Cex.Xh2o = Xh2o; - Cex.Xo2 = Xo2; - Cex.Xso2 = Xso2; -/* Flow reversal */ + Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*Medium.bubbleEnthalpy(sat)+ x_ex*Medium.dewEnthalpy(sat) else h; + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + Cs.SubC = C_record.Cg; + + Cs.Q*Cs.SubC + Cex.Q*Cex.SubC = Ce.Q*Ce.SubC + SubCSaS * Ce.Q; + + SubCSaS = SaS(); + + /* Fluid composition */ + Ce.Xi*Ce.Q = Cs.Xi*Cs.Q + Cex.Xi*Cex.Q; + + Cs.Xi = X; + Cex.Xi = X; + + /* Flow reversal */ if continuous_flow_reversal then Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1); @@ -114,16 +111,43 @@ equation Ce.diff_on_2 = diffusion; Cs.diff_on_1 = diffusion; Cex.diff_on_1 = diffusion; -/* Fluid thermodynamic properties at the inlet */ - proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, mode_e, fluid); -/* Fluid thermodynamic properties at the saturation point */ - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); -/* Vapor mass fraction at the extraction outlet */ - x_ex = alpha*proe.x; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 30}, {-100, -30}, {-40, -30}, {20, -100}, {20, -100}, {60, -100}, {70, -100}, {0, -30}, {100, -30}, {100, 30}, {-100, 30}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 28}, {-100, -32}, {-40, -32}, {20, -102}, {20, -102}, {60, -102}, {70, -102}, {0, -32}, {100, -32}, {100, 28}, {-100, 28}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid)}), - Window(x = 0.17, y = 0.1, width = 0.76, height = 0.76), + + /* Fluid thermodynamic properties at the inlet */ + state_e=Medium.setState_phX(p=P, h=Ce.h, X=Ce.Xi, region=mode_e); + xe = Medium.vapourQuality(state_e); + + /* Vapor mass fraction at the extraction outlet */ + x_ex = alpha*xe; + + /* Fluid thermodynamic properties at the saturation point */ + sat = Medium.setSat_p(P); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-100,30},{-100,-30},{-40,-30},{20,-100},{20,-100},{60,-100}, + {70,-100},{0,-30},{100,-30},{100,30},{-100,30}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-100,28},{-100,-32},{-40,-32},{20,-102},{20,-102},{60,-102}, + {70,-102},{0,-32},{100,-32},{100,28},{-100,28}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid)}), + Window( + x=0.17, + y=0.1, + width=0.76, + height=0.76), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -134,4 +158,4 @@ Baligh El Hefni Daniel Bouskela ")); -end SteamExtractionSplitter; \ No newline at end of file +end SteamExtractionSplitter; From 27cc506cdaf0e05e4660c694ea066d9b9a1fdfe7 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:15:38 +0200 Subject: [PATCH 182/213] #125 port Fluid volumes medium support onto develop --- ThermoSysPro/Fluid/Volumes/DynamicDrum.mo | 332 ++++--- ThermoSysPro/Fluid/Volumes/Pressurizer.mo | 326 +++++-- ThermoSysPro/Fluid/Volumes/Tank.mo | 323 ++++--- ThermoSysPro/Fluid/Volumes/TankHorizontal.mo | 293 +++--- ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo | 863 ++++++++++++++---- .../Fluid/Volumes/TwoPhaseCavityOnePipe.mo | 605 ++++++++---- ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo | 277 +++--- ThermoSysPro/Fluid/Volumes/VolumeA.mo | 263 +++--- ThermoSysPro/Fluid/Volumes/VolumeATh.mo | 259 +++--- ThermoSysPro/Fluid/Volumes/VolumeB.mo | 251 +++-- ThermoSysPro/Fluid/Volumes/VolumeBTh.mo | 260 +++--- ThermoSysPro/Fluid/Volumes/VolumeC.mo | 254 +++--- ThermoSysPro/Fluid/Volumes/VolumeCTh.mo | 260 +++--- ThermoSysPro/Fluid/Volumes/VolumeD.mo | 254 +++--- ThermoSysPro/Fluid/Volumes/VolumeDTh.mo | 256 +++--- ThermoSysPro/Fluid/Volumes/VolumeI.mo | 322 +++---- ThermoSysPro/Fluid/Volumes/VolumeITh.mo | 314 +++---- 17 files changed, 3190 insertions(+), 2522 deletions(-) diff --git a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo index 45b104c8..e245f7dd 100644 --- a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo +++ b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo @@ -1,34 +1,60 @@ within ThermoSysPro.Fluid.Volumes; - model DynamicDrum "Dynamic drum" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Boolean Vertical = true "true: vertical cylinder - false: horizontal cylinder"; - parameter Units.SI.Radius R = 1.05 "Radius of the drum cross-sectional area"; - parameter Units.SI.Length L = 16.27 "Drum length"; - parameter Real Ccond = 0.01 "Condensation coefficient"; - parameter Real Cevap = 0.09 "Evaporation coefficient"; - parameter Real Xlo = 0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; - parameter Real Xvo = 0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; - parameter Real Kvl = 1000 "Heat exchange coefficient between the liquid and gas phases"; - parameter Units.SI.CoefficientOfHeatTransfer Klp = 400 "Heat exchange coefficient between the liquid phase and the wall"; - parameter Units.SI.CoefficientOfHeatTransfer Kvp = 100 "Heat exchange coefficient between the gas phase and the wall"; - parameter Units.SI.CoefficientOfHeatTransfer Kpa = 25 "Heat exchange coefficient between the wall and the outside"; - parameter Units.SI.Mass Mp = 117e3 "Wall mass"; - parameter Units.SI.SpecificHeatCapacity cpp = 600 "Wall specific heat"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 50.e5 "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean Vertical=true + "true: vertical cylinder - false: horizontal cylinder"; + parameter Units.SI.Radius R=1.05 "Radius of the drum cross-sectional area"; + parameter Units.SI.Length L=16.27 "Drum length"; + parameter Real Ccond=0.01 "Condensation coefficient"; + parameter Real Cevap=0.09 "Evaporation coefficient"; + parameter Real Xlo=0.0025 + "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; + parameter Real Xvo=0.9975 + "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; + parameter Real Kvl=1000 + "Heat exchange coefficient between the liquid and gas phases"; + parameter Units.SI.CoefficientOfHeatTransfer Klp=400 + "Heat exchange coefficient between the liquid phase and the wall"; + parameter Units.SI.CoefficientOfHeatTransfer Kvp=100 + "Heat exchange coefficient between the gas phase and the wall"; + parameter Units.SI.CoefficientOfHeatTransfer Kpa=25 + "Heat exchange coefficient between the wall and the outside"; + parameter Units.SI.Mass Mp=117e3 "Wall mass"; + parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.5 + "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=50.e5 + "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + +protected + constant Real pi=Modelica.Constants.pi "pi"; + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Units.SI.Volume V=pi*R^2*L "Drum volume"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Units.SI.Volume Vmin=1.e-6; + Medium.C_BiPhase C_record; + +public Units.SI.AbsolutePressure P "Fluid average pressure"; Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the drum"; Units.SI.SpecificEnthalpy hl "Liquid phase specific enthalpy"; @@ -60,8 +86,8 @@ model DynamicDrum "Dynamic drum" Units.SI.Position zl(start = 1.05) "Liquid level in drum"; Units.SI.Area Al "Cross sectional area of the liquid phase"; Units.SI.Angle theta "Angle"; - Units.SI.Area Avl(start = 1.0) "Heat exchange surface between the liquid and gas phases"; - FluidType fluids[8] "Fluids mixing in volume"; + Units.SI.Area Avl(start=1.0) + "Heat exchange surface between the liquid and gas phases"; Units.SI.Power Je1 "Thermal power diffusion from inlet Ce1"; Units.SI.Power Je2 "Thermal power diffusion from inlet Ce2"; Units.SI.Power Je3 "Thermal power diffusion from inlet Ce3"; @@ -85,46 +111,55 @@ model DynamicDrum "Dynamic drum" Real rd "Value of r(Q/gamma) for outlet Cd"; Real rs "Value of r(Q/gamma) for outlet Cs"; Real rv "Value of r(Q/gamma) for outlet Cv"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol "Propri鴩s de l'eau dans le ballon" annotation( - Placement(transformation(extent = {{-60, 40}, {-20, 80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov "Propri鴩s de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{0, 40}, {40, 80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom annotation( - Placement(transformation(extent = {{-60, -20}, {-20, 20}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-60, -80}, {-20, -40}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{0, -80}, {40, -40}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce1 "Feedwater input 1" annotation( - Placement(transformation(extent = {{-110, 90}, {-90, 110}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cm "Evaporation loop outlet" annotation( - Placement(transformation(extent = {{90, -110}, {110, -90}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cd "Evaporation loop inlet" annotation( - Placement(transformation(extent = {{-110, -110}, {-90, -90}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cv "Steam outlet" annotation( - Placement(transformation(extent = {{90, 90}, {110, 110}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level " annotation( - layer = "icon", - Placement(transformation(extent = {{100, -10}, {120, 10}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth "Thermal input to the liquid" annotation( - Placement(transformation(extent = {{-10, -60}, {10, -40}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cex "Thermal input to the wall" annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod annotation( - Placement(transformation(extent = {{0, -20}, {40, 20}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce2 "Feedwater input 2" annotation( - Placement(transformation(extent = {{-110, 30}, {-90, 50}}, rotation = 0), iconTransformation(extent = {{-110, 30}, {-90, 50}}))); - Interfaces.Connectors.FluidInlet Ce3 "Feedwater input 3" annotation( - Placement(transformation(extent = {{-110, -50}, {-90, -30}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cs "Water outlet" annotation( - Placement(transformation(extent = {{90, -50}, {110, -30}}, rotation = 0))); -protected - constant Real pi = Modelica.Constants.pi "pi"; - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid = Integer(ftype) "Fluid number"; - parameter Units.SI.Volume V = pi*R^2*L "Drum volume"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Units.SI.Volume Vmin = 1.e-6; + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + + Medium.ThermodynamicState state_l "Liquid state in the drum"; + Medium.ThermodynamicState state_v "Vapor state in the drum"; + Medium.ThermodynamicState state_m "Evaporation loop state"; + Medium.ThermodynamicState state_out_l "Downcomer outlet state"; + Medium.SaturationProperties sat "Saturation properties at drum pressure"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at drum pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at drum pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; +public + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) "Feedwater input 1" annotation ( + Placement(transformation(extent={{-110,90},{-90,110}}, rotation=0))); + Interfaces.Connectors.FluidInlet Cm(redeclare package Medium = Medium) "Evaporation loop outlet" annotation ( + Placement(transformation(extent={{90,-110},{110,-90}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cd(redeclare package Medium = Medium) "Evaporation loop inlet" annotation ( + Placement(transformation(extent={{-110,-110},{-90,-90}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cv(redeclare package Medium = Medium) "Steam outlet" annotation (Placement( + transformation(extent={{90,90},{110,110}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel + "Water level " + annotation ( layer="icon", Placement( + transformation(extent={{100,-10},{120,10}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth "Thermal input to the liquid" + annotation (Placement(transformation( + extent={{-10,-60},{10,-40}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cex "Thermal input to the wall" + annotation (Placement(transformation(extent={{-10,90}, + {10,110}}, rotation=0))); +public + Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) "Feedwater input 2" annotation ( + Placement(transformation(extent={{-110,30},{-90,50}}, rotation=0), + iconTransformation(extent={{-110,30},{-90,50}}))); + Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) "Feedwater input 3" annotation ( + Placement(transformation(extent={{-110,-50},{-90,-30}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) "Water outlet" annotation (Placement( + transformation(extent={{90,-50},{110,-30}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -133,37 +168,27 @@ initial equation der(hv) = 0; der(Vl) = 0; der(Tp) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else P = P0; - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; der(Tp) = 0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cm.ftype; - fluids[6] = Cd.ftype; - fluids[7] = Cs.ftype; - fluids[8] = Cv.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "DynamicDrum: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -171,11 +196,7 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then Ce3.Q = 0; @@ -183,11 +204,7 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Cm) == 0) then Cm.Q = 0; @@ -195,11 +212,7 @@ equation Cm.h_vol_1 = 1.e5; Cm.diff_res_1 = 0; Cm.diff_on_1 = false; - Cm.ftype = ftype; - Cm.Xco2 = 0; - Cm.Xh2o = 0; - Cm.Xo2 = 0; - Cm.Xso2 = 0; + Cm.SubC = Medium.C_default; end if; if (cardinality(Cd) == 0) then Cd.Q = 0; @@ -240,19 +253,21 @@ equation Avp = if Vertical then 2*pi*R*(L - zl) + Al else (pi + 2*theta)*R*L + 2*Al; /* Wall surface on contact with the outside */ Ape = Alp + Avp; -/* Pressure at the bottom of the drum */ - Pfond = P + prod.d*g*zl; -/* Liquid phase mass balance equation */ + + /* Pressure at the bottom of the drum */ + Pfond = P + Medium.density(state_out_l)*g*zl; + + /* Liquid phase mass balance equation */ BQl = Ce1.Q + Ce2.Q + Ce3.Q - Cd.Q - Cs.Q + (1 - xmv)*Cm.Q + Qcond - Qevap; if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; /* Gas phase mass balance equation */ BQv = xmv*Cm.Q - Cv.Q + Qevap - Qcond; if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; @@ -266,17 +281,26 @@ equation Cd.P = Pfond; Cs.P = P; Cv.P = P; -/* Liquid phase energy balance equation */ - BHl = Ce1.Q*(Ce1.h - (hl - P/rhol)) + Ce2.Q*(Ce2.h - (hl - P/rhol)) + Ce3.Q*(Ce3.h - (hl - P/rhol)) - Cd.Q*(Cd.h - (hl - P/rhol)) - Cs.Q*(Cs.h - (hl - P/rhol)) + (1 - xmv)*Cm.Q*((if (xmv > 0) then lsat.h else Cm.h) - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wlv - Wpl + Cth.W + Jt_l; + + /* Liquid phase energy balance equation */ + BHl = Ce1.Q*(Ce1.h - (hl - P/rhol)) + Ce2.Q*(Ce2.h - (hl - P/rhol)) + Ce3.Q*(Ce3.h - (hl - P/rhol)) + - Cd.Q*(Cd.h - (hl - P/rhol)) - Cs.Q*(Cs.h - (hl - P/rhol)) + + (1 - xmv)*Cm.Q*((if (xmv > 0) then hlsat else Cm.h) - (hl - P/rhol)) + + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (hl - P/rhol)) + Wlv - Wpl + Cth.W + Jt_l; + if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; -/* Gas phase energy balance equation */ - BHv = xmv*Cm.Q*((if (xmv < 1) then vsat.h else Cm.h) - (hv - P/rhov)) - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wlv - Wpv + Jt_v; + + /* Gas phase energy balance equation */ + BHv = xmv*Cm.Q*((if (xmv < 1) then hvsat else Cm.h) - (hv - P/rhov)) + - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (hv - P/rhov)) + - Wlv - Wpv + Jt_v; + if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -284,7 +308,7 @@ equation Ce2.h_vol_2 = hl; Ce3.h_vol_2 = hl; Cm.h_vol_2 = hl; - Cd.h_vol_1 = noEvent(min(lsat.h, hl)); + Cd.h_vol_1 = noEvent(min(hlsat, hl)); Cs.h_vol_1 = hl; Cv.h_vol_1 = hv; /* Energy balance equation at the wall */ @@ -301,23 +325,29 @@ equation Wpv = Kvp*Avp*(Tv - Tp); /* Heat exchange between the wall and the outside */ Wpa = Kpa*Ape*(Ta - Tp); -/* Fluid composition (no balance equations) */ - Cd.ftype = ftype; - Cs.ftype = ftype; - Cv.ftype = ftype; - Cd.Xco2 = 0; - Cd.Xh2o = 0; - Cd.Xo2 = 0; - Cd.Xso2 = 0; - Cs.Xco2 = 0; - Cs.Xh2o = 0; - Cs.Xo2 = 0; - Cs.Xso2 = 0; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; -/* Flow reversal */ + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + - Cd.Q*Cd.SubC - Cs.Q*Cs.SubC + (1 - xmv)*Cm.Q*Cm.SubC + + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = xmv*Cm.Q*Cm.SubC - Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; + + Cd.SubC = SubCl; + Cs.SubC = SubCl; + Cv.SubC = SubCv; + + /* Flow reversal */ if continuous_flow_reversal then Cd.h = ThermoSysPro.Functions.SmoothCond(Cd.Q/gamma_d, Cd.h_vol_1, Cd.h_vol_2, 1); Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); @@ -389,19 +419,31 @@ equation Cd.diff_on_1 = diffusion; Cs.diff_on_1 = diffusion; Cv.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - prol = ThermoSysPro.Properties.Fluid.Ph(P, hl, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cd.h, 0, fluid); - prom = ThermoSysPro.Properties.Fluid.Ph(P, Cm.h, 0, fluid); - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - Tv = prov.T; - rhov = prov.d; - xv = prov.x; - xmv = if noEvent(Cm.Q > 0) then prom.x else 0; + + /* Fluid thermodynamic properties */ + state_l = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cd.h, X=Medium.reference_X); + state_m = Medium.setState_phX(p=P, h=Cm.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); + + xmv = if noEvent(Cm.Q > 0) then noEvent(max(0, min(1, (Cm.h - hlsat)/(hvsat - hlsat)))) else 0; + Cth.T = Tl; Cex.T = Ta; Cex.W = Wpa; diff --git a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo index ac4b6587..85af4bb6 100644 --- a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo +++ b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo @@ -1,33 +1,55 @@ within ThermoSysPro.Fluid.Volumes; model Pressurizer "Pressurizer" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.Volume V = 61.1 "Pressurizer volume"; - parameter Units.SI.Radius Rp = 1.265 "Pressurizer cross-sectional radius"; - parameter Units.SI.Area Ae = 1 "Wall surface"; - parameter Units.SI.Position Zm = 10.15 "Hauteur de la gamme de mesure niveau"; - parameter Real Ccond = 0.1 "Condensation coefficient"; - parameter Real Cevap = 0.1 "Evaporation coefficient"; - parameter Units.SI.CoefficientOfHeatTransfer Klv = 0.5e6 "Heat exchange coefficient between the liquid and gas phases"; - parameter Units.SI.CoefficientOfHeatTransfer Klp = 50000 "Heat exchange coefficient between the liquid phase and the wall"; - parameter Units.SI.CoefficientOfHeatTransfer Kvp = 25 "Heat exchange coefficient between the gas phase and the wall"; - parameter Units.SI.CoefficientOfHeatTransfer Kpa = 542 "Heat exchange coefficient between the wall and the outside"; - parameter Units.SI.Mass Mp = 117e3 "Wall mass"; - parameter Units.SI.SpecificHeatCapacity cpp = 600 "Wall specific heat"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Yw0 = 50 "Initial water level - percent of the measure scale level (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 155e5 "Initial fluid pressure (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cs.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Volume V=61.1 "Pressurizer volume"; + parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius"; + parameter Units.SI.Area Ae=1 "Wall surface"; + parameter Units.SI.Position Zm=10.15 "Hauteur de la gamme de mesure niveau"; + parameter Real Ccond=0.1 "Condensation coefficient"; + parameter Real Cevap=0.1 "Evaporation coefficient"; + parameter Units.SI.CoefficientOfHeatTransfer Klv=0.5e6 + "Heat exchange coefficient between the liquid and gas phases"; + parameter Units.SI.CoefficientOfHeatTransfer Klp=50000 + "Heat exchange coefficient between the liquid phase and the wall"; + parameter Units.SI.CoefficientOfHeatTransfer Kvp=25 + "Heat exchange coefficient between the gas phase and the wall"; + parameter Units.SI.CoefficientOfHeatTransfer Kpa=542 + "Heat exchange coefficient between the wall and the outside"; + parameter Units.SI.Mass Mp=117e3 "Wall mass"; + parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Yw0=50 + "Initial water level - percent of the measure scale level (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=155e5 + "Initial fluid pressure (active if steady_state=false)" annotation ( + Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + +protected + constant Real pi=Modelica.Constants.pi "Pi"; + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Units.SI.Area Ap=pi*Rp*Rp "Pressurizer cross-sectional area"; + Medium.C_BiPhase C_record; + +public Units.SI.Area Slpin "Exchange surface between the liquid and the wall"; Units.SI.Area Svpin "Exchange surface between the vapor and the wall"; Real Yw(start = 50) "Liquid level as a percent of the measure scale"; @@ -50,15 +72,20 @@ model Pressurizer "Pressurizer" Units.SI.Power Wpv "Thermal power exchanged from the gas phase to the wall"; Units.SI.Power Wpa "Thermal power exchanged from the outside to the wall"; Units.SI.Power Wch "Power released by the electrical heaters"; - Units.SI.MassFlowRate BQl "Right hand side of the mass balance equation of the liquid phase"; - Units.SI.MassFlowRate BQv "Right hand side of the mass balance equation of the gas phase"; - Units.SI.Power BHl "Right hand side of the energy balance equation of the liquid phase"; - Units.SI.Power BHv "Right hand side of the energy balance equation of the gas phase"; - Units.SI.MassFlowRate Qcond "Condensation mass flow rate from the vapor phase"; - Units.SI.MassFlowRate Qevap "Evaporation mass flow rate from the liquid phase"; - Units.SI.Density rhol(start = 996) "Liquid phase density"; - Units.SI.Density rhov(start = 1.5) "Vapor phase density"; - FluidType fluids[4] "Fluids mixing in volume"; + Units.SI.MassFlowRate BQl + "Right hand side of the mass balance equation of the liquid phase"; + Units.SI.MassFlowRate BQv + "Right hand side of the mass balance equation of the gas phase"; + Units.SI.Power BHl + "Right hand side of the energy balance equation of the liquid phase"; + Units.SI.Power BHv + "Right hand side of the energy balance equation of the gas phase"; + Units.SI.MassFlowRate Qcond + "Condensation mass flow rate from the vapor phase"; + Units.SI.MassFlowRate Qevap + "Evaporation mass flow rate from the liquid phase"; + Units.SI.Density rhol(start=996) "Liquid phase density"; + Units.SI.Density rhov(start=1.5) "Vapor phase density"; Units.SI.Power Jas "Thermal power diffusion from inlet Cas"; Units.SI.Power Jex "Thermal power diffusion from outlet Cex"; Units.SI.Power Js "Thermal power diffusion from outlet Cs"; @@ -70,32 +97,41 @@ model Pressurizer "Pressurizer" Real ras "Value of r(Q/gamma) for inlet Cas"; Real rex "Value of r(Q/gamma) for outlet Cex"; Real rs "Value of r(Q/gamma) for outlet Cs"; - Interfaces.Connectors.FluidInlet Cas "Water input" annotation( - Placement(transformation(extent = {{-8, 92}, {8, 108}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cs "Steam output" annotation( - Placement(transformation(extent = {{92, 90}, {108, 106}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Ca "Thermal input to the wall" annotation( - Placement(transformation(extent = {{-100, -8}, {-80, 12}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cc "Thermal input to the liquid" annotation( - Placement(transformation(extent = {{-10, -42}, {10, -22}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cex "Water output" annotation( - Placement(transformation(extent = {{-8, -108}, {8, -92}}, rotation = 0))); - Properties.WaterSteam.Common.ThermoProperties_ph prov "Propri鴩s de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{16, 44}, {56, 84}}, rotation = 0))); - Properties.WaterSteam.Common.ThermoProperties_ph prol "Propri鴩s de l'eau dans le ballon" annotation( - Placement(transformation(extent = {{-54, 44}, {-14, 84}}, rotation = 0))); - Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-54, 4}, {-14, 44}}, rotation = 0))); - Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{16, 4}, {56, 44}}, rotation = 0))); -protected - constant Real pi = Modelica.Constants.pi "Pi"; - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid = Integer(ftype) "Fluid number"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Units.SI.Area Ap = pi*Rp*Rp "Pressurizer cross-sectional area"; + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state_l "Liquid state in the pressurizer"; + Medium.ThermodynamicState state_v "Vapor state in the pressurizer"; + Medium.SaturationProperties sat "Saturation properties at pressurizer pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + + Interfaces.Connectors.FluidInlet Cas(redeclare package Medium = Medium) "Water input" annotation (Placement( + transformation(extent={{-8,92},{8,108}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) "Steam output" annotation (Placement( + transformation(extent={{92,90},{108,106}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Ca "Thermal input to the wall" + annotation (Placement(transformation(extent={{-100,-8},{-80,12}}, rotation= + 0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cc "Thermal input to the liquid" + annotation (Placement(transformation(extent={{-10,-42},{10,-22}}, rotation= + 0))); + +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel + "Water level" + annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Water output" annotation (Placement( + transformation(extent={{-8,-108},{8,-92}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -104,33 +140,27 @@ initial equation der(hv) = 0; der(y) = 0; der(Tp) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else P = P0; hl = hls; hv = hvs; Yw = Yw0; der(Tp) = 0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cas.ftype; - fluids[3] = Cex.ftype; - fluids[4] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "Pressurizer: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Cas) == 0) then Cas.Q = 0; Cas.h = 1.e5; Cas.h_vol_1 = 1.e5; Cas.diff_res_1 = 0; Cas.diff_on_1 = false; - Cas.ftype = ftype; - Cas.Xco2 = 0; - Cas.Xh2o = 0; - Cas.Xo2 = 0; - Cas.Xso2 = 0; + Cas.SubC = Medium.C_default; end if; if (cardinality(Cex) == 0) then Cex.Q = 0; @@ -161,14 +191,14 @@ equation /* Liquid phase mass balance equation */ BQl = Cas.Q - Cex.Q + Qcond - Qevap; if dynamic_energy_balance then - rhol*Ap*Zm*der(y) + Vl*prol.ddph*der(P) + Vl*prol.ddhp*der(hl) = BQl; + rhol*Ap*Zm*der(y) + Vl*ddphl*der(P) + Vl*ddhpl*der(hl) = BQl; else 0 = BQl; end if; /* Gas phase mass balance equation */ BQv = Qevap - Cs.Q - Qcond; if dynamic_energy_balance then - -rhov*Ap*Zm*der(y) + Vv*prov.ddph*der(P) + Vv*prov.ddhp*der(hv) = BQv; + -rhov*Ap*Zm*der(y) + Vv*ddphv*der(P) + Vv*ddhpv*der(hv) = BQv; else 0 = BQv; end if; @@ -209,18 +239,26 @@ equation Wpv = Kvp*Svpin*(Tv - Tp); /* Heat exchange between the wall and the outside */ Wpa = Kpa*Ae*(Ta - Tp); -/* Fluid composition (no balance equations) */ - Cex.ftype = ftype; - Cs.ftype = ftype; - Cs.Xco2 = 0; - Cs.Xh2o = 0; - Cs.Xo2 = 0; - Cs.Xso2 = 0; - Cex.Xco2 = 0; - Cex.Xh2o = 0; - Cex.Xo2 = 0; - Cex.Xso2 = 0; -/* Flow reversal */ + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = Cas.Q*Cas.SubC - Cex.Q*Cex.SubC + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = Qevap*SubCl - Cs.Q*Cs.SubC - Qcond*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; + + Cex.SubC = SubCl; + Cs.SubC = SubCv; + + /* Flow reversal */ if continuous_flow_reversal then Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1); Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); @@ -258,19 +296,105 @@ equation Cas.diff_on_2 = diffusion; Cex.diff_on_1 = diffusion; Cs.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - prol = ThermoSysPro.Properties.Fluid.Ph(P, hl, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - Tl = prol.T; - Tv = prov.T; - rhol = prol.d; - rhov = prov.d; - hls = lsat.h; - hvs = vsat.h; - annotation( - Icon(graphics = {Line(points = {{100, 90}, {100, 60}, {80, 60}, {80, 60}}, color = {28, 108, 200}, thickness = 1), Ellipse(extent = {{-80, -92}, {80, -42}}, lineColor = {85, 170, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Sphere, if dynamic_energy_balance then FillPattern.Sphere else FillPattern.Solid), lineThickness = 0.5), Rectangle(extent = {{-80, -14}, {80, -68}}, lineColor = {85, 170, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), lineThickness = 0.5), Ellipse(extent = {{-80, 42}, {80, 92}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, 40}, {0, 92}}, color = {28, 108, 200}, thickness = 1), Line(points = {{0, 38}, {0, 92}}, color = {255, 255, 255}), Rectangle(extent = {{-80, -14}, {80, 68}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-79, 68}, {80, 68}}, color = {255, 255, 255}), Line(points = {{80, 60}, {100, 60}, {100, 90}}, color = {255, 255, 255})}), - Diagram(graphics = {Ellipse(extent = {{-80, -92}, {80, -42}}, lineColor = {28, 108, 200}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-80, -14}, {80, -68}}, lineColor = {85, 170, 255}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-80, 42}, {80, 92}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, 40}, {0, 92}}, color = {28, 108, 200}, thickness = 1), Line(points = {{0, 38}, {0, 92}}, color = {255, 255, 255}), Rectangle(extent = {{-80, -14}, {80, 68}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-79, 68}, {80, 68}}, color = {255, 255, 255}), Text(extent = {{58, 4}, {58, -10}}, lineColor = {0, 0, 255}, textString = "Niveau"), Line(points = {{100, 90}, {100, 60}, {80, 60}, {80, 60}}, color = {28, 108, 200}, thickness = 1), Line(points = {{80, 60}, {100, 60}, {100, 90}}, color = {255, 255, 255})}), + + /* Fluid thermodynamic properties */ + state_l = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + sat = Medium.setSat_p(P); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + Tv = Medium.temperature(state_v); + rhol = Medium.density(state_l); + rhov = Medium.density(state_v); + hls = Medium.bubbleEnthalpy(sat); + hvs = Medium.dewEnthalpy(sat); + + annotation (Icon(graphics={ + Line( + points={{100,90},{100,60},{80,60},{80,60}}, + color={28,108,200}, + thickness=1), + Ellipse( + extent={{-80,-92},{80,-42}}, + lineColor={85,170,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Sphere, + if dynamic_energy_balance then FillPattern.Sphere + else FillPattern.Solid), + lineThickness=0.5), + Rectangle( + extent={{-80,-14},{80,-68}}, + lineColor={85,170,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + lineThickness=0.5), + Ellipse( + extent={{-80,42},{80,92}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{0,40},{0,92}}, + color={28,108,200}, + thickness=1), + Line(points={{0,38},{0,92}}, color={255,255,255}), + Rectangle( + extent={{-80,-14},{80,68}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-79,68},{80,68}}, color={255,255,255}), + Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}), + Diagram(graphics={ + Ellipse( + extent={{-80,-92},{80,-42}}, + lineColor={28,108,200}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-80,-14},{80,-68}}, + lineColor={85,170,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-80,42},{80,92}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{0,40},{0,92}}, + color={28,108,200}, + thickness=1), + Line(points={{0,38},{0,92}}, color={255,255,255}), + Rectangle( + extent={{-80,-14},{80,68}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-79,68},{80,68}}, color={255,255,255}), + Text( + extent={{58,4},{58,-10}}, + lineColor={0,0,255}, + textString= + "Niveau"), + Line( + points={{100,90},{100,60},{80,60},{80,60}}, + color={28,108,200}, + thickness=1), + Line(points={{80,60},{100,60},{100,90}}, color={255,255,255})}), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -282,4 +406,4 @@ Daniel Bouskela Baligh El Hefni ")); -end Pressurizer; \ No newline at end of file +end Pressurizer; diff --git a/ThermoSysPro/Fluid/Volumes/Tank.mo b/ThermoSysPro/Fluid/Volumes/Tank.mo index 876d747f..623bbc8b 100644 --- a/ThermoSysPro/Fluid/Volumes/Tank.mo +++ b/ThermoSysPro/Fluid/Volumes/Tank.mo @@ -1,61 +1,63 @@ within ThermoSysPro.Fluid.Volumes; - model Tank "Open vertical tank" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.AbsolutePressure Patm = 1.013e5 "Pressure above the fluid level"; - parameter Units.SI.Area A = 1 "Tank cross sectional area"; - parameter Units.SI.Position ze1 = 40 "Altitude of inlet 1"; - parameter Units.SI.Position ze2 = de2/2 "Altitude of inlet 2"; - parameter Units.SI.Position zs1 = 40 "Altitude of outlet 1"; - parameter Units.SI.Position zs2 = ds2/2 "Altitude of outlet 2"; - parameter Units.SI.Diameter de1 = 0.20 "Diameter of inlet 1"; - parameter Units.SI.Diameter de2 = 0.20 "Diameter of inlet 2"; - parameter Units.SI.Diameter ds1 = 0.20 "Diameter of outlet 1"; - parameter Units.SI.Diameter ds2 = 0.20 "Diameter of outlet 2"; - parameter Real ke1 = 1 "Pressure loss coefficient for inlet e1"; - parameter Real ke2 = 1 "Pressure loss coefficient for inlet e2"; - parameter Real ks1 = 1 "Pressure loss coefficient for outlet s1"; - parameter Real ks2 = 1 "Pressure loss coefficient for outlet s2"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = false "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.SpecificEnthalpy h0 = 1.e5 "Initial fluid specific enthalpy (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean steady_state_mech = false "true: start from steady state - false: start from z0"; - parameter Units.SI.Position z0 = 30 "Initial fluid level (active if steady_state_mech=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state_mech)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS (SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.AbsolutePressure Patm=1.013e5 "Pressure above the fluid level"; + parameter Units.SI.Area A=1 "Tank cross sectional area"; + parameter Units.SI.Position ze1=40 "Altitude of inlet 1"; + parameter Units.SI.Position ze2=de2/2 "Altitude of inlet 2"; + parameter Units.SI.Position zs1=40 "Altitude of outlet 1"; + parameter Units.SI.Position zs2=ds2/2 "Altitude of outlet 2"; + parameter Units.SI.Diameter de1=0.20 "Diameter of inlet 1"; + parameter Units.SI.Diameter de2=0.20 "Diameter of inlet 2"; + parameter Units.SI.Diameter ds1=0.20 "Diameter of outlet 1"; + parameter Units.SI.Diameter ds2=0.20 "Diameter of outlet 2"; + parameter Real ke1=1 "Pressure loss coefficient for inlet e1"; + parameter Real ke2=1 "Pressure loss coefficient for inlet e2"; + parameter Real ks1=1 "Pressure loss coefficient for outlet s1"; + parameter Real ks2=1 "Pressure loss coefficient for outlet s2"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium.isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=false + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.SpecificEnthalpy h0=1.e5 + "Initial fluid specific enthalpy (active if steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean steady_state_mech=false + "true: start from steady state - false: start from z0"; + parameter Units.SI.Position z0=30 + "Initial fluid level (active if steady_state_mech=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state_mech)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Real eps=1.e-0 "Small number for the square function"; + parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level"; + parameter Real pi=Modelica.Constants.pi; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Position z "Fluid level"; Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid average pressure"; @@ -63,6 +65,10 @@ model Tank "Open vertical tank" Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; ThermoSysPro.Units.SI.PressureDifference deltaP_e1 "Presure loss for e1"; ThermoSysPro.Units.SI.PressureDifference deltaP_e2 "Presure loss for e2"; ThermoSysPro.Units.SI.PressureDifference deltaP_s1 "Presure loss for s1"; @@ -77,15 +83,8 @@ model Tank "Open vertical tank" Units.SI.Angle theta_s2; Units.SI.DerDensityByPressure ddph "density derivative by pressure"; Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -99,27 +98,22 @@ model Tank "Open vertical tank" Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation( - Placement(transformation(extent = {{100, 10}, {120, 30}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, 50}, {-90, 70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{90, -70}, {110, -50}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-110, -70}, {-90, -50}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{92, 50}, {112, 70}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Real eps = 1.e-0 "Small number for the square function"; - parameter Units.SI.Position zmin = 1.e-6 "Minimum fluid level"; - parameter Real pi = Modelica.Constants.pi; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel + "Water level" annotation (Placement(transformation( + extent={{100,10},{120,30}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,50},{-90,70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-70},{110,-50}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-70},{-90,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{92,50},{112,70}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -133,19 +127,12 @@ initial equation else z = z0; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0, Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -153,24 +140,15 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(A > 0, "Cross-sectional area is non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "Tank: fluids mixing in volume are not compatible with each other"); + if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -178,11 +156,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -198,8 +173,9 @@ equation end if; /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; - if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ; + + if Medium.isCompressible and dynamic_energy_balance and dynamic_mass_balance then + A*(ddph*der(P) + ddhp*der(h))*z + A*rho*der(z) = BQ; else A*rho*der(z) = BQ; end if; @@ -220,17 +196,19 @@ equation deltaP_e2*omega_e2^2 = ke2*ThermoSysPro.Functions.ThermoSquare(Ce2.Q, eps)/2/rho; deltaP_s1*omega_s1^2 = ks1*ThermoSysPro.Functions.ThermoSquare(Cs1.Q, eps)/2/rho; deltaP_s2*omega_s2^2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho; -/* Energy balance equation */ - BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J; + + /* Energy balance equation */ + BH = Ce1.Q*((Ce1.h - h)) + Ce2.Q*((Ce2.h - h)) - Cs1.Q*((Cs1.h - h)) - Cs2.Q*((Cs2.h - h)) + Cth.W + J; + if dynamic_energy_balance then if z > zmin then if dynamic_mass_balance then - A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH; + A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h)) = BH; else - A*z*rho*der(h - Xh2o*hr) = BH; + A*z*rho*der(h) = BH; end if; else - der(h - Xh2o*hr) = 0; + der(h) = 0; end if; else BH = 0; @@ -242,40 +220,33 @@ equation Cth.T = T; /* Fluid level sensor */ yLevel.signal = z; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - if flue_gases then - if dynamic_composition_balance then - A*z*rho*der(Xco2) + Xco2*BQ = BXco2; - A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - A*z*rho*der(Xo2) + Xo2*BQ = BXo2; - A*z*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + A*z*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + Cs1.Xi = X; + Cs2.Xi = X; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + A*z*rho*der(SubC) + SubC*BQ + A*z*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + A*z*rho*SubCSaS = BSubC; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -322,23 +293,49 @@ equation Cs2.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ P = Patm + rho*g*z/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + + state = Medium.setState_phX( + p=P, + h=h, + X=X); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + rho = Medium.density(state); end if; if dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 100}, {100, 20}}), Rectangle(extent = {{-100, 20}, {100, -100}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static))}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 100}, {100, 20}}, lineColor = {28, 108, 200}), Rectangle(extent = {{-100, 20}, {100, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255})}), - Window(x = 0.16, y = 0.03, width = 0.81, height = 0.9), + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle(extent={{-100,100},{100,20}}), Rectangle( + extent={{-100,20},{100,-100}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), + fillColor=DynamicSelect({85,170,255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static))}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle(extent={{-100,100},{100,20}}, lineColor={28,108,200}), Rectangle( + extent={{-100,20},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={85,170,255})}), + Window( + x=0.16, + y=0.03, + width=0.81, + height=0.9), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -349,4 +346,4 @@ Author Daniel Bouskela ")); -end Tank; \ No newline at end of file +end Tank; diff --git a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo index ed80401f..bba3f456 100644 --- a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo +++ b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo @@ -1,58 +1,65 @@ within ThermoSysPro.Fluid.Volumes; model TankHorizontal "Open horizontal tank" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.AbsolutePressure Patm = 1.013e5 "Pressure above the fluid level"; - parameter Units.SI.Radius R = 1 "Radius of the tank cross-sectional area"; - parameter Units.SI.Length L = 10 "Tank equivalentlength"; - parameter Units.SI.Position ze1 = 2*R "Altitude of inlet 1"; - parameter Units.SI.Position ze2 = 0 "Altitude of inlet 2"; - parameter Units.SI.Position zs1 = 2*R "Altitude of outlet 1"; - parameter Units.SI.Position zs2 = 0 "Altitude of outlet 2"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke1 = 1 "Pressure loss coefficient for inlet e1"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke2 = 1 "Pressure loss coefficient for inlet e2"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks1 = 1 "Pressure loss coefficient for outlet s1"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks2 = 1 "Pressure loss coefficient for outlet s2"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = false "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.SpecificEnthalpy h0 = 1.e5 "Initial fluid specific enthalpy (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean steady_state_mech = false "true: start from steady state - false: start from z0"; - parameter Units.SI.Position z0 = 2*R "Initial fluid level (active if steady_state_mech=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state_mech)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.AbsolutePressure Patm=1.013e5 + "Pressure above the fluid level"; + parameter Units.SI.Radius R=1 "Radius of the tank cross-sectional area"; + parameter Units.SI.Length L=10 "Tank equivalentlength"; + parameter Units.SI.Position ze1=2*R "Altitude of inlet 1"; + parameter Units.SI.Position ze2=0 "Altitude of inlet 2"; + parameter Units.SI.Position zs1=2*R "Altitude of outlet 1"; + parameter Units.SI.Position zs2=0 "Altitude of outlet 2"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke1=1 + "Pressure loss coefficient for inlet e1"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ke2=1 + "Pressure loss coefficient for inlet e2"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks1=1 + "Pressure loss coefficient for outlet s1"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient ks2=1 + "Pressure loss coefficient for outlet s2"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium.isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=false + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.SpecificEnthalpy h0=1.e5 + "Initial fluid specific enthalpy (active if steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean steady_state_mech=false + "true: start from steady state - false: start from z0"; + parameter Units.SI.Position z0=2*R + "Initial fluid level (active if steady_state_mech=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state_mech)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Real pi=Modelica.Constants.pi "pi"; + parameter Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Units.SI.Thickness e=0.25 "Inlet/outlet thickness"; + parameter Real eps=1.e-0 "Small number for ths square function"; + parameter Units.SI.Position zmin=1.e-6 "Minimum fluid level"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Position z "Fluid level"; Units.SI.Area A "Surface of the liquid in the tank"; Units.SI.Angle theta "Angle"; @@ -73,15 +80,12 @@ model TankHorizontal "Open horizontal tank" Real Os2; Units.SI.DerDensityByPressure ddph "density derivative by pressure"; Units.SI.DerDensityByEnthalpy ddhp "density derivative by enthalpy"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -95,28 +99,22 @@ model TankHorizontal "Open horizontal tank" Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation( - Placement(transformation(extent = {{102, -9}, {122, 11}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, 40}, {-90, 60}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{90, -60}, {110, -40}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-110, -60}, {-90, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{92, 39}, {112, 59}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Units.SI.Thickness e = 0.25 "Inlet/outlet thickness"; - parameter Real eps = 1.e-0 "Small number for ths square function"; - parameter Units.SI.Position zmin = 1.e-6 "Minimum fluid level"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel + "Water level" annotation (Placement(transformation( + extent={{102,-9},{122,11}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,40},{-90,60}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-60},{110,-40}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-60},{-90,-40}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{92,39},{112,59}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -130,40 +128,23 @@ initial equation else z = z0; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0, Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "TankHorizontal: fluids mixing in volume are not compatible with each other"); if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -171,11 +152,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -200,8 +178,9 @@ equation V = pi*R^2*L; /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; - if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - A*(ddph*der(P) + ddhp*der(h - Xh2o*hr))*z + A*rho*der(z) = BQ; + + if Medium.isCompressible and dynamic_energy_balance and dynamic_mass_balance then + A*(ddph*der(P) + ddhp*der(h))*z + A*rho*der(z) = BQ; else A*rho*der(z) = BQ; end if; @@ -234,17 +213,19 @@ equation (Patm + rho*g*max(z - zs2, 0) - Cs2.P)*Os2 = ks2*ThermoSysPro.Functions.ThermoSquare(Cs2.Q, eps)/2/rho; Os2 = if ((Cs2.Q <= 0) or (z > zs2 + e)) then 1 else if (z < zs2) then 0 else (z - zs2)/e; end if; -/* Energy balance equation */ - BH = Ce1.Q*((Ce1.h - Ce1.Xh2o*hr) - (h - Xh2o*hr)) + Ce2.Q*((Ce2.h - Ce2.Xh2o*hr) - (h - Xh2o*hr)) - Cs1.Q*((Cs1.h - Cs1.Xh2o*hr) - (h - Xh2o*hr)) - Cs2.Q*((Cs2.h - Cs2.Xh2o*hr) - (h - Xh2o*hr)) + Cth.W + J; + + /* Energy balance equation */ + BH = Ce1.Q*(Ce1.h - h) + Ce2.Q*(Ce2.h - h) - Cs1.Q*(Cs1.h - h) - Cs2.Q*(Cs2.h - h) + Cth.W + J; + if dynamic_energy_balance then if z > zmin then if dynamic_mass_balance then - A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h - Xh2o*hr)) = BH; + A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h)) = BH; else - A*z*rho*der(h - Xh2o*hr) = BH; + A*z*rho*der(h) = BH; end if; else - der(h - Xh2o*hr) = 0; + der(h) = 0; end if; else BH = 0; @@ -256,40 +237,33 @@ equation Cth.T = T; /* Fluid level sensor */ yLevel.signal = z; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - if flue_gases then - if dynamic_composition_balance then - A*z*rho*der(Xco2) + Xco2*BQ = BXco2; - A*z*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - A*z*rho*der(Xo2) + Xo2*BQ = BXo2; - A*z*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + A*z*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.Xi = X; + Cs2.Xi = X; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + A*z*rho*der(SubC) + SubC*BQ + A*z*rho*SubCSaS = BSubC; + else + A*z*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -336,15 +310,22 @@ equation Cs2.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ P = Patm + rho*g*z/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + + state = Medium.setState_phX( + p=P, + h=h, + X=X); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + rho = Medium.density(state); end if; if dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Cs1.Xco2, Cs1.Xh2o, Cs1.Xo2, Cs1.Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; @@ -362,4 +343,4 @@ Author Baligh El Hefni ")); -end TankHorizontal; \ No newline at end of file +end TankHorizontal; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo index b1c2732d..3f42a259 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo @@ -1,57 +1,88 @@ within ThermoSysPro.Fluid.Volumes; model TwoPhaseCavity "TwoPhaseCavity for one shell pass " - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Boolean Vertical = true "true: vertical cylinder - false: horizontal cylinder"; - parameter Units.SI.Radius R = 1.05 "Radius of the Cavity cross-sectional area"; - parameter Units.SI.Length Lc = 2.5 "Support plate spacing in cooling zone(chicanes)"; - parameter Units.SI.Volume V = 50 "Cavity volume (= total volume + bleeding volume - pipe volume) "; - parameter Units.SI.Volume Vmin = 1.e-6; - parameter Integer Ns = 10 "Number of segments for one tube pass"; - parameter Integer NbTub1 = 500 "Numbers of drowned pipes in liquid; Pipe 1 (Hoizontal, Vertical Separate)"; - parameter Integer NbTub2 = 500 "Number of total pipes immersed in steam = NbTub2; Pipe 2"; - parameter Integer NbTub3 = 2000 "Number of total pipes immersed in steam ; Pipe 3"; - parameter Integer NbTubV = 15 "Numbers of pipes in a vertical row (tube bank)"; - parameter Units.SI.Length L1 = 10 "Length of drowned pipes in liquid (pipes 1)"; - parameter Units.SI.Length L2 = 10 "Length of Pipe 2 (in steam)"; - parameter Units.SI.Length L3 = 20 "Length of Pipe 3 (in steam)"; - parameter Units.SI.Diameter Dext = 0.02 "External pipe diameter"; - parameter Units.SI.Diameter DIc = 1.40 "Internal calendre diameter"; - parameter Units.SI.Length PasL = 0.025 "Longitudinal step or length bottom pipes triangular step"; - parameter Units.SI.Length PasT = 0.023 "Transverse step or pipes step"; - parameter ThermoSysPro.Units.nonSI.Angle_deg Angle = 60 "Average bend angle (deg)"; - parameter Real Ccond = 0.01 "Condensation coefficient"; - parameter Real Cevap = 0.09 "Evaporation coefficient"; - parameter Real Xlo = 0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; - parameter Real Xvo = 0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; - parameter Real COPl(start = 1) = 1 "Corrective terme for the heat exchange coefficient or the fouling coefficient of the liquid side"; - parameter Real COPv(start = 1) = 1 "Corrective terme for heat exchange coefficient or the fouling coefficient of the steam side"; - parameter Boolean Cal_hconv = true "false: heat transfer coefficient liquid and steam given by parameter COPl and COPv- true: calculated using the Nusselt correlation"; - parameter Units.SI.CoefficientOfHeatTransfer hliq = 1.5e3 "Heat transfer coefficient between the liquid and the cooling pipes "; - parameter Units.SI.CoefficientOfHeatTransfer hcond = 8e3 "Heat transfer coefficient between the vapor and the cooling pipes "; - parameter Units.SI.CoefficientOfHeatTransfer Kvl = 1000 "Heat exchange coefficient between the liquid and gas phases"; - parameter Units.SI.CoefficientOfHeatTransfer Klp = 850 "Heat exchange coefficient between the liquid phase and the wall"; - parameter Units.SI.CoefficientOfHeatTransfer Kvp = 450 "Heat exchange coefficient between the gas phase and the wall"; - parameter Units.SI.CoefficientOfHeatTransfer Kpa = 0.5 "Heat exchange coefficient between the wall and the outside ambiant"; - parameter Units.SI.Temperature Ta = 310 "External temperature"; - parameter Units.SI.Mass Mp = 100e3 "Wall mass"; - parameter Units.SI.SpecificHeatCapacity cpp = 600 "Wall specific heat"; - parameter Boolean step_square = true "true: aligned pipes - false: staggered pipes (triangular step)"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Units.SI.Length L(start = 15) "Cavity length"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; + parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; + parameter Units.SI.Length Lc=2.5 + "Support plate spacing in cooling zone(chicanes)"; + parameter Units.SI.Volume V=50 + "Cavity volume (= total volume + bleeding volume - pipe volume) "; + parameter Units.SI.Volume Vmin=1.e-6; + parameter Integer Ns=10 "Number of segments for one tube pass"; + parameter Integer NbTub1=500 "Numbers of drowned pipes in liquid; Pipe 1 (Hoizontal, Vertical Separate)"; + parameter Integer NbTub2=500 "Number of total pipes immersed in steam = NbTub2; Pipe 2"; + parameter Integer NbTub3=2000 "Number of total pipes immersed in steam ; Pipe 3"; + parameter Integer NbTubV=15 "Numbers of pipes in a vertical row (tube bank)"; + parameter Units.SI.Length L1=10 "Length of drowned pipes in liquid (pipes 1)"; + parameter Units.SI.Length L2=10 "Length of Pipe 2 (in steam)"; + parameter Units.SI.Length L3=20 "Length of Pipe 3 (in steam)"; + parameter Units.SI.Diameter Dext=0.02 "External pipe diameter"; + parameter Units.SI.Diameter DIc=1.40 "Internal calendre diameter"; + parameter Units.SI.Length PasL=0.025 + "Longitudinal step or length bottom pipes triangular step"; + parameter Units.SI.Length PasT=0.023 "Transverse step or pipes step"; + parameter ThermoSysPro.Units.nonSI.Angle_deg Angle=60 + "Average bend angle (deg)"; + parameter Real Ccond=0.01 "Condensation coefficient"; + parameter Real Cevap=0.09 "Evaporation coefficient"; + parameter Real Xlo=0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; + parameter Real Xvo=0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; + parameter Real COPl(start=1)=1 "Corrective terme for the heat exchange coefficient or the fouling coefficient of the liquid side"; + parameter Real COPv( start=1)=1 "Corrective terme for heat exchange coefficient or the fouling coefficient of the steam side"; + parameter Boolean Cal_hconv=true "false: heat transfer coefficient liquid and steam given by parameter COPl and COPv- true: calculated using the Nusselt correlation"; + parameter Units.SI.CoefficientOfHeatTransfer hliq=1.5e3 + "Heat transfer coefficient between the liquid and the cooling pipes "; + parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3 + "Heat transfer coefficient between the vapor and the cooling pipes "; + parameter Units.SI.CoefficientOfHeatTransfer Kvl=1000 + "Heat exchange coefficient between the liquid and gas phases"; + parameter Units.SI.CoefficientOfHeatTransfer Klp=850 + "Heat exchange coefficient between the liquid phase and the wall"; + parameter Units.SI.CoefficientOfHeatTransfer Kvp=450 + "Heat exchange coefficient between the gas phase and the wall"; + parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.5 + "Heat exchange coefficient between the wall and the outside ambiant"; + parameter Units.SI.Temperature Ta=310 "External temperature"; + parameter Units.SI.Mass Mp=100e3 "Wall mass"; + parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat"; + parameter Boolean step_square=true "true: aligned pipes - false: staggered pipes (triangular step)"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.5 + "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=1.e5 + "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi; + parameter Integer Ns3=2*Ns "Number of segments for half pipes"; + parameter Units.SI.CoefficientOfHeatTransfer h4=1 "Heat exchange coefficient"; + parameter Units.SI.Area S4=1 "Heat exchange surface"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.C_BiPhase C_record; + +public + Units.SI.Length L(start=15) "Cavity length"; Integer NbTubT "Number of total pipes in Cavity"; Units.SI.Pressure P "Fluid average pressure"; Units.SI.Pressure Pfond "Fluid pressure at the bottom of the cavity"; @@ -94,21 +125,27 @@ model TwoPhaseCavity "TwoPhaseCavity for one shell pass " Units.SI.Area Alp "Liquid phase surface on contact with the wall"; Units.SI.Area Avp "Gas phase surface on contact with the wall"; Units.SI.Area Ape "Wall surface on contact with the fluid"; - Units.SI.Area Surf_tot(start = 1.e4) "Total heat exchange surface"; - Units.SI.Area Surf_ext1(start = 1.e2) "Heat exchange surface for drowned section ; pipe 1"; - Units.SI.Area Surf_ext2(start = 1.e2) "Heat exchange surface for section 2 ; pipe 2 "; - Units.SI.Area Surf_ext3(start = 1.e2) "Heat exchange surface for section 3 ; pipe 3"; - Units.SI.ReynoldsNumber Rel(start = 6.e4) "liquid Reynolds number"; - Real Prl(start = 1) "liquid Prandtl number in node i"; - Units.SI.ThermalConductivity kl(start = 1) "liquid thermal conductivity"; - Units.SI.DynamicViscosity mul(start = 2.e-4) "liquid dynamic viscosity "; - Units.SI.DynamicViscosity mult[Ns](start = fill(2.e-4, Ns)) "liquid dynamic viscosity at wall temperature"; - Units.SI.CoefficientOfHeatTransfer hcond2[Ns](start = fill(1e4, Ns)) "Heat transfer coefficient between the vapor and the cooling pipes zone 2"; - Units.SI.CoefficientOfHeatTransfer hcond3[Ns3](start = fill(1e4, Ns3)) "Heat transfer coefficient between the vapor and the cooling pipes zone 3"; - Units.SI.CoefficientOfHeatTransfer hliqu[Ns](start = fill(1000, Ns)) "Heat transfer coefficient between the liquid and the cooling pipes zone 1"; - Units.SI.Diameter DH(start = 0.02) "hydraulic diameter"; - Real EE[Ns](start = fill(1, Ns)); - FluidType fluids[4] "Fluids mixing in volume"; + Units.SI.Area Surf_tot(start=1.e4) "Total heat exchange surface"; + Units.SI.Area Surf_ext1(start=1.e2) + "Heat exchange surface for drowned section ; pipe 1"; + Units.SI.Area Surf_ext2(start=1.e2) + "Heat exchange surface for section 2 ; pipe 2 "; + Units.SI.Area Surf_ext3(start=1.e2) + "Heat exchange surface for section 3 ; pipe 3"; + Units.SI.ReynoldsNumber Rel(start=6.e4) "liquid Reynolds number"; + Real Prl(start=1) "liquid Prandtl number in node i"; + Units.SI.ThermalConductivity kl(start=1) "liquid thermal conductivity"; + Units.SI.DynamicViscosity mul(start=2.e-4) "liquid dynamic viscosity "; + Units.SI.DynamicViscosity mult[Ns](start=fill(2.e-4, Ns)) + "liquid dynamic viscosity at wall temperature"; + Units.SI.CoefficientOfHeatTransfer hcond2[Ns](start=fill(1e4, Ns)) + "Heat transfer coefficient between the vapor and the cooling pipes zone 2"; + Units.SI.CoefficientOfHeatTransfer hcond3[Ns3](start=fill(1e4, Ns3)) + "Heat transfer coefficient between the vapor and the cooling pipes zone 3"; + Units.SI.CoefficientOfHeatTransfer hliqu[Ns](start=fill(1000, Ns)) + "Heat transfer coefficient between the liquid and the cooling pipes zone 1"; + Units.SI.Diameter DH(start=0.02) "hydraulic diameter"; + Real EE[Ns](start=fill(1, Ns)); Units.SI.Power Je "Thermal power diffusion from inlet Ce"; Units.SI.Power Jv "Thermal power diffusion from inlet Cv"; Units.SI.Power Jl "Thermal power diffusion from outlet Cl"; @@ -120,42 +157,59 @@ model TwoPhaseCavity "TwoPhaseCavity for one shell pass " Real re "Value of r(Q/gamma) for inlet Ce"; Real rv "Value of r(Q/gamma) for inlet Cv"; Real rl "Value of r(Q/gamma) for outlet Cl"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol "Propri鴩s de l'eau dans le ballon" annotation( - Placement(transformation(extent = {{-250, 70}, {-210, 110}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov "Propri鴩s de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{60, 70}, {100, 110}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-250, -200}, {-210, -160}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{58, -200}, {98, -160}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cv "Steam input" annotation( - Placement(transformation(extent = {{-88, 50}, {-68, 70}}, rotation = 0), iconTransformation(extent = {{-88, 50}, {-68, 70}}))); - Interfaces.Connectors.FluidOutlet Cl "Water output" annotation( - Placement(transformation(extent = {{-88, -170}, {-68, -150}}, rotation = 0), iconTransformation(extent = {{-88, -170}, {-68, -150}}))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns3] annotation( - Placement(transformation(extent = {{-85, -53}, {-73, -41}}, rotation = 0), iconTransformation(extent = {{-85, -53}, {-73, -41}}))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation( - Placement(transformation(extent = {{88, -109}, {108, -89}}, rotation = 0), iconTransformation(extent = {{88, -109}, {108, -89}}))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod annotation( - Placement(transformation(extent = {{-250, -20}, {-210, 20}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce "Water input" annotation( - Placement(transformation(extent = {{-160, 50}, {-140, 70}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth1[Ns] annotation( - Placement(transformation(extent = {{-85, -133}, {-73, -120}}, rotation = 0), iconTransformation(extent = {{-85, -133}, {-73, -120}}))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth2[Ns] annotation( - Placement(transformation(extent = {{-85, 19}, {-73, 32}}, rotation = 0), iconTransformation(extent = {{-85, 19}, {-73, 32}}))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe annotation( - Placement(transformation(extent = {{-250, -110}, {-210, -70}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph provIn "Propri鴩s de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{12, 70}, {52, 110}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi; - parameter Integer Ns3 = 2*Ns "Number of segments for half pipes"; - parameter Integer fluid = Integer(ftype) "Fluid number"; - parameter Units.SI.CoefficientOfHeatTransfer h4 = 1 "Heat exchange coefficient"; - parameter Units.SI.Area S4 = 1 "Heat exchange surface"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + + Medium.ThermodynamicState state_l "Liquid state in the cavity"; + Medium.ThermodynamicState state_v "Vapor state in the cavity"; + Medium.ThermodynamicState state_in_l "Water inlet state"; + Medium.ThermodynamicState state_out_l "Water outlet state"; + Medium.SaturationProperties sat "Saturation properties at cavity pressure"; + Medium.SaturationProperties sat_wall "Saturation properties for wall heat transfer correlations"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at cavity pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at cavity pressure"; + Units.SI.Density rholsat "Bubble density at cavity pressure"; + Units.SI.Density rhovsat "Dew density at cavity pressure"; + Units.SI.Temperature Tsat "Saturation temperature at cavity pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + + Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) "Steam input" annotation (Placement( + transformation(extent={{-88,50},{-68,70}}, rotation=0), + iconTransformation(extent={{-88,50},{-68,70}}))); + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "Water output" annotation (Placement( + transformation(extent={{-88,-170},{-68,-150}}, rotation=0), + iconTransformation(extent={{-88,-170},{-68,-150}}))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns3] + annotation (Placement(transformation( + extent={{-85,-53},{-73,-41}}, rotation=0), iconTransformation(extent= + {{-85,-53},{-73,-41}}))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel + "Water level" annotation (Placement(transformation( + extent={{88,-109},{108,-89}}, rotation=0), iconTransformation(extent={ + {88,-109},{108,-89}}))); +public + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement( + transformation(extent={{-160,50},{-140,70}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth1[Ns] + annotation (Placement(transformation( + extent={{-85,-133},{-73,-120}},rotation=0), iconTransformation(extent= + {{-85,-133},{-73,-120}}))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth2[Ns] + annotation (Placement(transformation( + extent={{-85,19},{-73,32}}, rotation=0), iconTransformation(extent={{ + -85,19},{-73,32}}))); + initial equation if dynamic_energy_balance then if steady_state then @@ -164,33 +218,27 @@ initial equation der(Vl) = 0; der(P) = 0; der(Tp) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; P = P0; der(Tp) = 0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cv.ftype; - fluids[4] = Cl.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "TwoPhaseCavity: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; Ce.h = 1.e5; Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cv) == 0) then Cv.Q = 0; @@ -198,11 +246,7 @@ equation Cv.h_vol_1 = 1.e5; Cv.diff_res_1 = 0; Cv.diff_on_1 = false; - Cv.ftype = ftype; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; + Cv.SubC = Medium.C_default; end if; if (cardinality(Cl) == 0) then Cl.Q = 0; @@ -247,36 +291,45 @@ equation Avp = if Vertical then 2*sqrt(pi/Al)*Vv + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al); /* Wall surface on contact with the outside */ Ape = Alp + Avp; -/* Pressure at the bottom of the cavity */ - Pfond = P + prod.d*g*zl; -/* Liquid phase mass balance equation */ - BQl = -Cl.Q + Qcond - Qevap + (1 - proe.x)*Ce.Q; + + /* Pressure at the bottom of the cavity */ + Pfond = P + Medium.density(state_out_l)*g*zl; + + /* Liquid phase mass balance equation */ + BQl = -Cl.Q + Qcond - Qevap + (1 - Medium.vapourQuality(state_in_l))*Ce.Q; + if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; -/* Vapor phase mass balance equation */ - BQv = Cv.Q + Qevap - Qcond + proe.x*Ce.Q; + + /* Vapor phase mass balance equation */ + BQv = Cv.Q + Qevap - Qcond + Medium.vapourQuality(state_in_l)*Ce.Q; + if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; Ce.P = P; Cv.P = P; Cl.P = Pfond; -/* Liquid phase energy balance equation */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t + Jt_l; + + /* Liquid phase energy balance equation */ + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (hl - P/rhol)) + (1 - Medium.vapourQuality(state_in_l))*Ce.Q*((if (Medium.vapourQuality(state_in_l) > 0) then hlsat else Ce.h) - (hl - P/rhol)) - Wpl + Wvl + W1t + Jt_l; + if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; -/* Gas phase energy balance equation */ - BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t + Jt_v; + + /* Gas phase energy balance equation */ + BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (hv - P/rhov)) + Medium.vapourQuality(state_in_l)*Ce.Q*((if (Medium.vapourQuality(state_in_l) < 1) then hvsat else Ce.h) - (hv - P/rhov)) - Wvl - Wpv + W2t + W3t + Jt_v; + if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -307,14 +360,19 @@ equation /* Heat transfer coefficient of liquid*/ // Sacadura DH = if step_square then 4*PasL^2/(pi*Dext) - Dext else ((2*PasL*PasT) - (pi*Dext^2*(Angle/120)))/(pi*Dext*(Angle/120)); - QS = Cl.Q/(DIc*Lc*(PasL - Dext)/PasL); - Rel = noEvent(abs(QS*DH/mul)); - Prl = mul*prol.cp/kl; + + QS = Cl.Q /(DIc*Lc*(PasL - Dext)/PasL); + + Rel = noEvent( abs(QS*DH/mul)); + Prl = mul*Medium.specificHeatCapacityCp(state_l)/kl; + assert(PasL - Dext > 0, "Error Data for TwoPhaseCavity model (PasL - Dext)<= 0 "); for i in 1:Ns loop - mult[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tp1[i], fluid); - EE[i] = max((PasT/Dext - 1/2/((((PasL/Dext)^2 + (PasT/Dext/2)^2)^0.5/Dext) - 1)), 1); -/* Heat transfer coefficient of liquid*/ + mult[i] = Medium.dynamicViscosity(Medium.setState_pTX(p=P, T=Tp1[i], X=Medium.reference_X)); + + EE[i]= max((PasT/Dext - 1/2/((((PasL/Dext)^2 + (PasT/Dext/2)^2)^0.5/Dext) - 1)), 1); + + /* Heat transfer coefficient of liquid*/ if Cal_hconv then // Kern corelation (Sacadura) hliqu[i] = noEvent(if ((Rel > 1.e-6) and (Prl > 1.e-6)) then (COPl*0.36*kl/Dext*Rel^0.55*Prl^0.3333*(mul/mult[i])^0.14) else 10); @@ -322,14 +380,14 @@ equation hliqu[i] = COPl*hliq; end if; if Cal_hconv then -/* Heat transfer coefficient of vapeur*/ - if Vertical then -// Frank P. & David P. Fundamentals of Heat Transfer For (PasL/Dext)= 1.4 - hcond2[i] = COPv*noEvent(min(1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L2, 1)*mul*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); - else -// Nusselt corelation - hcond2[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); - end if; + /* Heat transfer coefficient of vapeur*/ + if Vertical then + // Frank P. & David P. Fundamentals of Heat Transfer For (PasL/Dext)= 1.4 + hcond2[i] = COPv*noEvent(min(1.13*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(max(L2, 1)*mul*abs(Tsat - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); + else + // Nusselt corelation + hcond2[i] = COPv*noEvent(min(0.728*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*abs(Tsat - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000)); + end if; else hcond2[i] = COPv*hcond; end if; @@ -348,14 +406,14 @@ equation end for; for i in 1:Ns3 loop if Cal_hconv then -/* Heat transfer coefficient of vapeur*/ - if Vertical then -// Frank P. & David P. Fundamentals of Heat Transfer For vertical plate - hcond3[i] = COPv*noEvent(min(1.13*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(max(L3, 1)*mul*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); - else -// Nusselt corelation - hcond3[i] = COPv*noEvent(min(0.728*(max((g*lsat.rho*(lsat.rho - vsat.rho)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*abs(lsat.T - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); - end if; + /* Heat transfer coefficient of vapeur*/ + if Vertical then + // Frank P. & David P. Fundamentals of Heat Transfer For vertical plate + hcond3[i] = COPv*noEvent(min( 1.13*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(max(L3,1)*mul*abs(Tsat - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); + else + // Nusselt corelation + hcond3[i] = COPv*noEvent(min(0.728*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*abs(Tsat - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000)); + end if; else hcond3[i] = COPv*hcond; end if; @@ -369,15 +427,28 @@ equation W1t = sum(dW1); W2t = sum(dW2); W3t = sum(dW3); -/* Total power exchanged for Deheating*/ - W4t = noEvent(if (Cv.h > vsat.h) then -Cv.Q*(Cv.h - vsat.h) else -0.0001); -/* Fluid composition (no balance equations) */ - Cl.ftype = ftype; - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; -/* Flow reversal */ + + /* Total power exchanged for Deheating*/ + W4t = noEvent(if (Cv.h > hvsat) then -Cv.Q*(Cv.h - hvsat) else -0.0001); + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = (1 - Medium.vapourQuality(state_in_l))*Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = Cv.Q*Cv.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*Ce.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; + + Cl.SubC = SubCl; + + /* Flow reversal */ if continuous_flow_reversal then Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1); else @@ -413,25 +484,447 @@ equation Ce.diff_on_2 = diffusion; Cv.diff_on_2 = diffusion; Cl.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid); - prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0, fluid); - provIn = ThermoSysPro.Properties.Fluid.Ph(P, Cv.h, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid); - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - Tv = prov.T; - rhov = prov.d; - xv = prov.x; - mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid); - kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid)); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-260, -200}, {100, 100}}, grid = {2, 2}, initialScale = 0.1), graphics = {Text(extent = {{-142, 2}, {-124, -6}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 3"), Text(extent = {{-164, 55}, {-88, 19}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Horizontal_1pipe"), Rectangle(extent = {{-158, -6}, {-102, -10}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{-184, 16}, {-166, 16}}, color = {0, 0, 255}, arrow = {Arrow.Filled, Arrow.None}), Text(extent = {{-198, -6}, {-160, -24}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "in"), Line(points = {{-180, -8}, {-162, -8}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{-102, -8}, {-96, -8}, {-96, 16}, {-160, 16}, {-170, 16}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Rectangle(extent = {{-162, 28}, {-90, -44}}, lineColor = {0, 0, 255}, pattern = LinePattern.Dash), Text(extent = {{-182, -56}, {-86, -78}}, lineColor = {0, 0, 255}, textString = "Vertical Separate"), Rectangle(extent = {{-170, -100}, {-166, -152}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{-114, -76}, {-114, -94}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Rectangle(extent = {{-116, -100}, {-112, -152}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{-168, -76}, {-168, -94}}, color = {0, 0, 255}, arrow = {Arrow.Filled, Arrow.None}), Rectangle(extent = {{-166, -176}, {-120, -180}}, lineColor = {0, 0, 255}, fillColor = {85, 255, 255}, fillPattern = FillPattern.Solid), Text(extent = {{-190, -128}, {-172, -136}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 2"), Text(extent = {{-152, -180}, {-134, -188}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 1"), Text(extent = {{-111, -122}, {-93, -130}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 3"), Text(extent = {{-210, -164}, {-172, -182}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "in"), Line(points = {{-168, -150}, {-168, -160}, {-114, -160}, {-114, -150}}, color = {0, 0, 255}, pattern = LinePattern.Dash, arrow = {Arrow.Filled, Arrow.None}), Line(points = {{-183, -168}, {-105, -168}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Rectangle(extent = {{-182, -96}, {-106, -192}}, lineColor = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-114, -78}, {-114, -72}, {-92, -72}, {-92, -178}, {-120, -178}}, color = {0, 0, 255}, pattern = LinePattern.Dash, arrow = {Arrow.Filled, Arrow.None}), Line(points = {{-188, -178}, {-170, -178}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Text(extent = {{12, -54}, {54, -70}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Vertical"), Rectangle(extent = {{4, -82}, {8, -134}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{6, -58}, {6, -76}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Rectangle(extent = {{58, -82}, {62, -134}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{60, -60}, {60, -78}}, color = {0, 0, 255}, arrow = {Arrow.Filled, Arrow.None}), Rectangle(extent = {{10, -142}, {56, -146}}, lineColor = {0, 0, 255}, fillColor = {85, 255, 255}, fillPattern = FillPattern.Solid), Text(extent = {{-16, -104}, {2, -112}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 2"), Text(extent = {{16, -162}, {42, -154}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 1"), Text(extent = {{65, -112}, {83, -120}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 3"), Text(extent = {{-20, -50}, {18, -68}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "in"), Line(points = {{6, -134}, {6, -144}, {60, -144}, {60, -134}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{-7, -138}, {71, -138}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Rectangle(extent = {{-8, -78}, {70, -152}}, lineColor = {0, 0, 255}, pattern = LinePattern.Dash), Rectangle(extent = {{2, -20}, {58, -24}}, lineColor = {0, 0, 255}, fillColor = {85, 255, 255}, fillPattern = FillPattern.Solid), Text(extent = {{32, 34}, {50, 26}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 2"), Text(extent = {{16, -26}, {34, -34}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 1"), Text(extent = {{18, 10}, {36, 2}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 3"), Text(extent = {{4, 60}, {56, 34}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Horizontal"), Rectangle(extent = {{2, 2}, {58, -2}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Rectangle(extent = {{2, 26}, {58, 22}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{-24, 24}, {-6, 24}}, color = {0, 0, 255}, arrow = {Arrow.Filled, Arrow.None}), Line(points = {{-36, -22}, {-4, -22}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Text(extent = {{-58, -10}, {-20, -28}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "in"), Line(points = {{60, -22}, {72, -22}, {72, 24}, {60, 24}, {58, 24}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{-20, 0}, {-2, 0}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{-20, -22}, {-20, -3}, {-20, -1}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{58, 0}, {64, 0}, {64, 12}, {-10, 12}, {-10, 24}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Rectangle(extent = {{-2, 36}, {76, -38}}, lineColor = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-2, -16}, {76, -16}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Rectangle(extent = {{-160, 18}, {-142, 14}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{2, 26}, {20, 22}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-170, -100}, {-166, -116}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{58, -82}, {62, -98}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-234, 64}, {-164, 36}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, textString = "Pipe4=deheating pipes"), Text(extent = {{-158, 26}, {-140, 18}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 4"), Text(extent = {{0, 34}, {18, 26}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 4"), Text(extent = {{64, -86}, {82, -94}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 4"), Text(extent = {{-190, -104}, {-172, -112}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 4")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-260, -200}, {100, 100}}, grid = {2, 2}, initialScale = 0.1), graphics = {Ellipse(extent = {{-100, 50}, {100, -150}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Ellipse(extent = {{-260, 50}, {-60, -150}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Rectangle(extent = {{-160, 50}, {0, -150}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-260, -48}, {-160, -48}}, color = {0, 0, 0}), Line(points = {{-160, -48}, {100, -48}}, color = {0, 0, 0}, pattern = LinePattern.Dash), Line(points = {{-160, 50}, {-160, -150}}, color = {0, 0, 0}, thickness = 0.5), Line(points = {{-160, -98}, {88, -98}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-160, -112}, {78, -112}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-160, -126}, {66, -126}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-160, -106}, {82, -106}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-160, -120}, {72, -120}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-160, -132}, {56, -132}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-160, -150}, {0, -150}}, color = {0, 0, 255}), Line(points = {{0, 50}, {0, -150}}, color = {0, 0, 0}, thickness = 0.5), Line(points = {{-160, -140}, {44, -140}}, color = {0, 0, 255}, pattern = LinePattern.Dash)}), - Window(x = 0.11, y = 0.06, width = 0.78, height = 0.88), + + /* Fluid thermodynamic properties */ + state_in_l = Medium.setState_phX(p=P, h=Ce.h, X=Medium.reference_X); + state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + sat_wall = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + rholsat = Medium.bubbleDensity(sat_wall); + rhovsat = Medium.dewDensity(sat_wall); + Tsat = Medium.saturationTemperature(P); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); + + mul = Medium.dynamicViscosity(state_l); + kl = noEvent(Medium.thermalConductivity(state_l)); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-260,-200},{100,100}}, + grid={2,2}, + initialScale=0.1), graphics={ + Text( + extent={{-142,2},{-124,-6}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 3"), + Text( + extent={{-164,55},{-88,19}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Horizontal_1pipe"), + Rectangle( + extent={{-158,-6},{-102,-10}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{-184,16},{-166,16}}, + color={0,0,255}, + arrow={Arrow.Filled,Arrow.None}), + Text( + extent={{-198,-6},{-160,-24}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "in"), + Line( + points={{-180,-8},{-162,-8}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{-102,-8},{-96,-8},{-96,16},{-160,16},{-170,16}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Rectangle( + extent={{-162,28},{-90,-44}}, + lineColor={0,0,255}, + pattern=LinePattern.Dash), + Text( + extent={{-182,-56},{-86,-78}}, + lineColor={0,0,255}, + textString= + "Vertical Separate"), + Rectangle( + extent={{-170,-100},{-166,-152}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{-114,-76},{-114,-94}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Rectangle( + extent={{-116,-100},{-112,-152}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{-168,-76},{-168,-94}}, + color={0,0,255}, + arrow={Arrow.Filled,Arrow.None}), + Rectangle( + extent={{-166,-176},{-120,-180}}, + lineColor={0,0,255}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-190,-128},{-172,-136}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 2"), + Text( + extent={{-152,-180},{-134,-188}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 1"), + Text( + extent={{-111,-122},{-93,-130}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 3"), + Text( + extent={{-210,-164},{-172,-182}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "in"), + Line( + points={{-168,-150},{-168,-160},{-114,-160},{-114,-150}}, + color={0,0,255}, + pattern=LinePattern.Dash, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{-183,-168},{-105,-168}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Rectangle( + extent={{-182,-96},{-106,-192}}, + lineColor={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-114,-78},{-114,-72},{-92,-72},{-92,-178},{-120,-178}}, + color={0,0,255}, + pattern=LinePattern.Dash, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{-188,-178},{-170,-178}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Text( + extent={{12,-54},{54,-70}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Vertical"), + Rectangle( + extent={{4,-82},{8,-134}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{6,-58},{6,-76}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Rectangle( + extent={{58,-82},{62,-134}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{60,-60},{60,-78}}, + color={0,0,255}, + arrow={Arrow.Filled,Arrow.None}), + Rectangle( + extent={{10,-142},{56,-146}}, + lineColor={0,0,255}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-16,-104},{2,-112}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 2"), + Text( + extent={{16,-162},{42,-154}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 1"), + Text( + extent={{65,-112},{83,-120}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 3"), + Text( + extent={{-20,-50},{18,-68}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "in"), + Line( + points={{6,-134},{6,-144},{60,-144},{60,-134}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{-7,-138},{71,-138}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Rectangle( + extent={{-8,-78},{70,-152}}, + lineColor={0,0,255}, + pattern=LinePattern.Dash), + Rectangle( + extent={{2,-20},{58,-24}}, + lineColor={0,0,255}, + fillColor={85,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{32,34},{50,26}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 2"), + Text( + extent={{16,-26},{34,-34}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 1"), + Text( + extent={{18,10},{36,2}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 3"), + Text( + extent={{4,60},{56,34}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Horizontal"), + Rectangle( + extent={{2,2},{58,-2}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{2,26},{58,22}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{-24,24},{-6,24}}, + color={0,0,255}, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{-36,-22},{-4,-22}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Text( + extent={{-58,-10},{-20,-28}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "in"), + Line( + points={{60,-22},{72,-22},{72,24},{60,24},{58,24}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{-20,0},{-2,0}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{-20,-22},{-20,-3},{-20,-1}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{58,0},{64,0},{64,12},{-10,12},{-10,24}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Rectangle( + extent={{-2,36},{76,-38}}, + lineColor={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-2,-16},{76,-16}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Rectangle( + extent={{-160,18},{-142,14}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{2,26},{20,22}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-170,-100},{-166,-116}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{58,-82},{62,-98}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-234,64},{-164,36}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + textString= + "Pipe4=deheating pipes"), + Text( + extent={{-158,26},{-140,18}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 4"), + Text( + extent={{0,34},{18,26}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 4"), + Text( + extent={{64,-86},{82,-94}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 4"), + Text( + extent={{-190,-104},{-172,-112}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 4")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-260,-200},{100,100}}, + grid={2,2}, + initialScale=0.1), graphics={ + Ellipse( + extent={{-100,50},{100,-150}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-260,50},{-60,-150}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-160,50},{0,-150}}, + lineColor={28,108,200}, + fillColor=DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Line(points={{-260,-48},{-160,-48}}, color={0,0,0}), + Line( + points={{-160,-48},{100,-48}}, + color={0,0,0}, + pattern=LinePattern.Dash), + Line( + points={{-160,50},{-160,-150}}, + color={0,0,0}, + thickness=0.5), + Line( + points={{-160,-98},{88,-98}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-160,-112},{78,-112}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-160,-126},{66,-126}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-160,-106},{82,-106}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-160,-120},{72,-120}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-160,-132},{56,-132}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-160,-150},{0,-150}}, + color={0,0,255}), + Line( + points={{0,50},{0,-150}}, + color={0,0,0}, + thickness=0.5), + Line( + points={{-160,-140},{44,-140}}, + color={0,0,255}, + pattern=LinePattern.Dash)}), + Window( + x=0.11, + y=0.06, + width=0.78, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -443,4 +936,4 @@ Baligh El Hefni Daniel Bouskela ")); -end TwoPhaseCavity; \ No newline at end of file +end TwoPhaseCavity; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo index 5fbe5664..7977c081 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo @@ -1,65 +1,93 @@ within ThermoSysPro.Fluid.Volumes; model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass " - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Boolean Vertical = true "true: vertical cylinder - false: horizontal cylinder"; - parameter Units.SI.Radius R = 1.05 "Radius of the Cavity cross-sectional area"; - parameter Units.SI.Length L = 16.27 "Cavity length"; - parameter Units.SI.Length Lc = 2.5 "Support plate spacing in cooling zone(chicanes)"; - parameter Units.SI.Volume V = pi*R^2*L "Cavity volume"; - parameter Units.SI.Volume Vmin = 1.e-6; - parameter Integer Ns = 10 "Number of segments"; - parameter Integer NbTubT = 10000 "Number of total pipes in Cavity"; - parameter Integer NbTubV = 150 "Numbers of pipes in a vertical plan in Cavity"; - parameter Units.SI.Length L2 = 25 "tubes length"; - parameter Units.SI.Diameter Dext = 0.020 "External pipe diameter"; - parameter Real COP = 1 "Corrective terme for heat exchange coefficient or Fouling coefficient"; - parameter Real Kcorr = 1 "Corrective terme for heat exchange coefficient between the vapor and the liquid Kvl (with a stagnation point Kcorr = 0.5)"; - parameter Boolean Cal_hcond = false "false : condensation heat transfer coefficient = hcond (parameter) - true: calculate by Nusselt corelation"; - parameter Units.SI.CoefficientOfHeatTransfer hcond = 8e3 "Heat transfer coefficient between the vapor and the cooling pipes "; - parameter Units.SI.CoefficientOfHeatTransfer Kpa = 0.02 "Heat exchange coefficient between the wall and the outside ambiant"; - parameter Units.SI.Temperature Ta = 300 "External temperature"; - parameter Units.SI.Mass Mp = 50e3 "Wall mass"; - parameter Units.SI.SpecificHeatCapacity cpp = 600 "Wall specific heat"; - parameter Boolean step_square = true "true: Square step - false: Triangular step"; - parameter Units.SI.PathLength Ls = L2/Ns "Section length for one pipe"; - parameter Units.SI.Area Surf_exe = pi*Dext*Ls*NbTubT "Section heat exchange surface"; - parameter Units.SI.Area Surf_tot = Surf_exe*Ns "Total heat exchange surface"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Units.SI.Pressure P(start = 10000) "Fluid average pressure"; - Units.SI.Pressure Pfond(start = 11000) "Fluid pressure at the bottom of the cavity"; - Units.SI.SpecificEnthalpy hl(start = 200e3) "Liquid phase specific enthalpy"; - Units.SI.SpecificEnthalpy hv(start = 250e3) "Gas phase specific enthalpy"; - Units.SI.SpecificEnthalpy hvIn(start = 2400000) "Steam average specific enthalpy input cavity"; - Units.SI.Temperature Tl(start = 310) "Liquid phase temperature"; - Units.SI.Temperature Tv(start = 320) "Gas phase temperature"; - Units.SI.Volume Vl(start = 100) "Liquid phase volume"; - Units.SI.Volume Vv(start = 2000) "Gas phase volume"; - Real xl(start = 0.5) "Mass vapor fraction in the liquid phase"; - Real xv(start = 0) "Mass vapor fraction in the gas phase"; - Units.SI.Density rhol(start = 996) "Liquid phase density"; - Units.SI.Density rhov(start = 1.5) "Gas phase density"; - Units.SI.MassFlowRate BQl "Right hand side of the mass balance equation of the liquid phase"; - Units.SI.MassFlowRate BQv "Right hand side of the mass balance equation of the gas phaser"; - Units.SI.Power BHl "Right hand side of the energy balance equation of the liquid phase"; - Units.SI.Power BHv "Right hand side of the energy balance equation of the gas phase"; - Units.SI.MassFlowRate Qcond(start = 1000) "Condensation mass flow rate from the vapor phase"; - Units.SI.MassFlowRate QcondS(start = 100) "Splitter mass flow rate of the liquid phase from the two-phase input"; - Units.SI.Power Wvl "Thermal power exchanged from the gas phase to the liquid phase"; - Units.SI.Power Wlp "Thermal power exchanged from the liquid phase to the wall"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = CvBP.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; + parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; + parameter Units.SI.Length L=16.27 "Cavity length"; + parameter Units.SI.Length Lc=2.5 + "Support plate spacing in cooling zone(chicanes)"; + parameter Units.SI.Volume V=pi*R^2*L "Cavity volume"; + parameter Units.SI.Volume Vmin=1.e-6; + parameter Integer Ns=10 "Number of segments"; + parameter Integer NbTubT=10000 "Number of total pipes in Cavity"; + parameter Integer NbTubV=150 "Numbers of pipes in a vertical plan in Cavity"; + parameter Units.SI.Length L2=25 "tubes length"; + parameter Units.SI.Diameter Dext=0.020 "External pipe diameter"; + parameter Real COP=1 "Corrective terme for heat exchange coefficient or Fouling coefficient"; + parameter Real Kcorr=1 "Corrective terme for heat exchange coefficient between the vapor and the liquid Kvl (with a stagnation point Kcorr = 0.5)"; + parameter Boolean Cal_hcond=false "false : condensation heat transfer coefficient = hcond (parameter) - true: calculate by Nusselt corelation"; + parameter Units.SI.CoefficientOfHeatTransfer hcond=8e3 + "Heat transfer coefficient between the vapor and the cooling pipes "; + parameter Units.SI.CoefficientOfHeatTransfer Kpa=0.02 + "Heat exchange coefficient between the wall and the outside ambiant"; + parameter Units.SI.Temperature Ta=300 "External temperature"; + parameter Units.SI.Mass Mp=50e3 "Wall mass"; + parameter Units.SI.SpecificHeatCapacity cpp=600 "Wall specific heat"; + parameter Boolean step_square=true "true: Square step - false: Triangular step"; + parameter Units.SI.PathLength Ls=L2/Ns "Section length for one pipe"; + parameter Units.SI.Area Surf_exe=pi*Dext*Ls*NbTubT + "Section heat exchange surface"; + parameter Units.SI.Area Surf_tot=Surf_exe*Ns "Total heat exchange surface"; + parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=1.e5 + "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.C_BiPhase C_record; + +public + Units.SI.Pressure P(start=10000) "Fluid average pressure"; + Units.SI.Pressure Pfond(start=11000) + "Fluid pressure at the bottom of the cavity"; + Units.SI.SpecificEnthalpy hl(start=200e3) "Liquid phase specific enthalpy"; + Units.SI.SpecificEnthalpy hv(start=250e3) "Gas phase specific enthalpy"; + Units.SI.SpecificEnthalpy hvIn(start=2400000) + "Steam average specific enthalpy input cavity"; + Units.SI.Temperature Tl(start=310) "Liquid phase temperature"; + Units.SI.Temperature Tv(start=320) "Gas phase temperature"; + Units.SI.Volume Vl(start=100) "Liquid phase volume"; + Units.SI.Volume Vv(start=2000) "Gas phase volume"; + Real xl(start=0.5) "Mass vapor fraction in the liquid phase"; + Real xv(start=0) "Mass vapor fraction in the gas phase"; + Units.SI.Density rhol(start=996) "Liquid phase density"; + Units.SI.Density rhov(start=1.5) "Gas phase density"; + Units.SI.MassFlowRate BQl + "Right hand side of the mass balance equation of the liquid phase"; + Units.SI.MassFlowRate BQv + "Right hand side of the mass balance equation of the gas phaser"; + Units.SI.Power BHl + "Right hand side of the energy balance equation of the liquid phase"; + Units.SI.Power BHv + "Right hand side of the energy balance equation of the gas phase"; + Units.SI.MassFlowRate Qcond(start=1000) + "Condensation mass flow rate from the vapor phase"; + Units.SI.MassFlowRate QcondS(start=100) + "Splitter mass flow rate of the liquid phase from the two-phase input"; + Units.SI.Power Wvl + "Thermal power exchanged from the gas phase to the liquid phase"; + Units.SI.Power Wlp + "Thermal power exchanged from the liquid phase to the wall"; Units.SI.Power Wvp "Thermal power exchanged from the gas phase to the wall"; Units.SI.Power Wpa "Thermal power losses to ambiant"; Units.SI.Power dW[Ns](start = fill(10e5, Ns)) "Power exchange between the wall and the fluid in each section side 3"; @@ -74,18 +102,21 @@ model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass " Units.SI.Area Alp "Liquid phase surface on contact with the wall"; Units.SI.Area Avp "Gas phase surface on contact with the wall"; Units.SI.Area Ape "Wall surface on contact with the outside"; - Units.SI.ReynoldsNumber Rel(start = 6.e4) "Liquid phase Reynolds number"; - Units.SI.ReynoldsNumber Rev(start = 6.e3) "Steam phase Reynolds number"; - Units.SI.ReynoldsNumber Revl(start = 6.e3) "Steam liquid Reynolds number"; - Units.SI.ThermalConductivity kl(start = 1) "Liquid phase thermal conductivity"; - Units.SI.ThermalConductivity kv(start = 1) "Steam phase thermal conductivity"; - Units.SI.DynamicViscosity mul(start = 2.e-4) "Liquid phase dynamic viscosity "; - Units.SI.DynamicViscosity muv(start = 2.e-5) "Steam phase dynamic viscosity "; - Units.SI.CoefficientOfHeatTransfer hcond3[Ns](start = fill(1e4, Ns)) "Heat transfer coefficient between the vapor and the cooling pipes 2"; - Units.SI.CoefficientOfHeatTransfer Kvl(start = 10) "Heat exchange coefficient between the liquid and gas phases"; - Units.SI.CoefficientOfHeatTransfer Klp(start = 10) "Heat exchange coefficient between the liquid phase and the wall"; - Units.SI.CoefficientOfHeatTransfer Kvp(start = 10) "Heat exchange coefficient between the gas phase and the wall"; - FluidType fluids[5] "Fluids mixing in volume"; + Units.SI.ReynoldsNumber Rel(start=6.e4) "Liquid phase Reynolds number"; + Units.SI.ReynoldsNumber Rev(start=6.e3) "Steam phase Reynolds number"; + Units.SI.ReynoldsNumber Revl(start=6.e3) "Steam liquid Reynolds number"; + Units.SI.ThermalConductivity kl(start=1) "Liquid phase thermal conductivity"; + Units.SI.ThermalConductivity kv(start=1) "Steam phase thermal conductivity"; + Units.SI.DynamicViscosity mul(start=2.e-4) "Liquid phase dynamic viscosity "; + Units.SI.DynamicViscosity muv(start=2.e-5) "Steam phase dynamic viscosity "; + Units.SI.CoefficientOfHeatTransfer hcond3[Ns](start=fill(1e4, Ns)) + "Heat transfer coefficient between the vapor and the cooling pipes 2"; + Units.SI.CoefficientOfHeatTransfer Kvl(start=10) + "Heat exchange coefficient between the liquid and gas phases"; + Units.SI.CoefficientOfHeatTransfer Klp(start=10) + "Heat exchange coefficient between the liquid phase and the wall"; + Units.SI.CoefficientOfHeatTransfer Kvp(start=10) + "Heat exchange coefficient between the gas phase and the wall"; Units.SI.Power Je "Thermal power diffusion from inlet Ce"; Units.SI.Power JvGCT "Thermal power diffusion from inlet CvGCT"; Units.SI.Power JvBP "Thermal power diffusion from inlet CvBP"; @@ -100,37 +131,45 @@ model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass " Real rvGCT "Value of r(Q/gamma) for inlet CvGCT"; Real rvBP "Value of r(Q/gamma) for inlet CvBP"; Real rl "Value of r(Q/gamma) for outlet Cl"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol "Propri鴩s de l'eau dans le ballon" annotation( - Placement(transformation(extent = {{-250, 70}, {-210, 110}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov "Propri鴩s de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{60, 70}, {100, 110}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-250, -200}, {-210, -160}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{58, -200}, {98, -160}}, rotation = 0))); - Interfaces.Connectors.FluidInlet CvBP "Steam input" annotation( - Placement(transformation(extent = {{-86, 50}, {-66, 70}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cl "Water output" annotation( - Placement(transformation(extent = {{-85, -170}, {-65, -150}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns] annotation( - Placement(transformation(extent = {{-82, 0}, {-70, 12}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation( - Placement(transformation(extent = {{88, -107}, {108, -87}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod annotation( - Placement(transformation(extent = {{-250, -16}, {-210, 24}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce "Water input" annotation( - Placement(transformation(extent = {{-219, 19}, {-199, 39}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe "Propri鴩s de l'eau dans le ballon" annotation( - Placement(transformation(extent = {{-250, -106}, {-210, -66}}, rotation = 0))); - Properties.WaterSteam.Common.ThermoProperties_ph provIn "Propri鴩s de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{0, 70}, {40, 110}}, rotation = 0))); - Interfaces.Connectors.FluidInlet CvGCT "Steam input" annotation( - Placement(transformation(extent = {{-160, 50}, {-140, 70}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi; - parameter Integer fluid = Integer(ftype) "Fluid number"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + + Medium.ThermodynamicState state_l "Liquid state in the cavity"; + Medium.ThermodynamicState state_v "Vapor state in the cavity"; + Medium.ThermodynamicState state_in_l "Water inlet state"; + Medium.ThermodynamicState state_in_v "Average vapor inlet state"; + Medium.ThermodynamicState state_out_l "Water outlet state"; + Medium.SaturationProperties sat "Saturation properties at cavity pressure"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at cavity pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at cavity pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + + Interfaces.Connectors.FluidInlet CvBP(redeclare package Medium = Medium) "Steam input" annotation (Placement( + transformation(extent={{-86,50},{-66,70}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "Water output" annotation (Placement( + transformation(extent={{-85,-170},{-65,-150}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth3[Ns] + annotation (Placement(transformation( + extent={{-82,0},{-70,12}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel + "Water level" annotation (Placement(transformation( + extent={{88,-107},{108,-87}}, rotation=0))); +public + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement( + transformation(extent={{-219,19},{-199,39}}, rotation=0))); + Interfaces.Connectors.FluidInlet CvGCT(redeclare package Medium = Medium) "Steam input" annotation (Placement( + transformation(extent={{-160,50},{-140,70}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -142,35 +181,28 @@ initial equation der(P) = 0; der(Tp) = 0; der(hvIn) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; P = P0; Tp = 320; hvIn = hv; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = CvGCT.ftype; - fluids[4] = CvBP.ftype; - fluids[5] = Cl.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "TwoPhaseCavityOnePipe: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; Ce.h = 1.e5; Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.SubC = Medium.C_default; end if; if (cardinality(CvGCT) == 0) then CvGCT.Q = 0; @@ -178,11 +210,7 @@ equation CvGCT.h_vol_1 = 1.e5; CvGCT.diff_res_1 = 0; CvGCT.diff_on_1 = false; - CvGCT.ftype = ftype; - CvGCT.Xco2 = 0; - CvGCT.Xh2o = 0; - CvGCT.Xo2 = 0; - CvGCT.Xso2 = 0; + CvGCT.SubC = Medium.C_default; end if; if (cardinality(CvBP) == 0) then CvBP.Q = 0; @@ -190,11 +218,7 @@ equation CvBP.h_vol_1 = 1.e5; CvBP.diff_res_1 = 0; CvBP.diff_on_1 = false; - CvBP.ftype = ftype; - CvBP.Xco2 = 0; - CvBP.Xh2o = 0; - CvBP.Xo2 = 0; - CvBP.Xso2 = 0; + CvBP.SubC = Medium.C_default; end if; if (cardinality(Cl) == 0) then Cl.Q = 0; @@ -226,19 +250,24 @@ equation Avp = if Vertical then 2*pi*R*(L - zl) + Al else (pi + 2*theta)*R*L + 2*(pi*R^2 - Al); /* Wall surface on contact with the outside */ Ape = Alp + Avp; -/* Pressure at the bottom of the cavity */ - Pfond = P + prod.d*g*zl; -/* Liquid phase mass balance equation */ - BQl = -Cl.Q + Qcond + QcondS + (1 - proe.x)*Ce.Q; + + /* Pressure at the bottom of the cavity */ + Pfond = P + Medium.density(state_out_l)*g*zl; + + /* Liquid phase mass balance equation */ + BQl = -Cl.Q + Qcond + QcondS + (1 - Medium.vapourQuality(state_in_l))*Ce.Q; + if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; -/* Vapor phase mass balance equation */ - BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + proe.x*Ce.Q; + + /* Vapor phase mass balance equation */ + BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + Medium.vapourQuality(state_in_l)*Ce.Q; + if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; @@ -246,17 +275,21 @@ equation CvGCT.P = P; CvBP.P = P; Ce.P = P; -/* Liquid phase energy balance equation */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond + QcondS)*(lsat.h - (hl - P/rhol)) + (1 - proe.x)*Ce.Q*((if (proe.x > 0) then lsat.h else Ce.h) - (hl - P/rhol)) - Wlp + Wvl + Jt_l; + + /* Liquid phase energy balance equation */ + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond + QcondS)*(hlsat - (hl - P/rhol)) + (1 - Medium.vapourQuality(state_in_l))*Ce.Q*((if (Medium.vapourQuality(state_in_l) > 0) then hlsat else Ce.h) - (hl - P/rhol)) - Wlp + Wvl + Jt_l; + if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; -/* Gas phase energy balance equation */ - BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond + QcondS)*(lsat.h - (hv - P/rhov)) + proe.x*Ce.Q*((if (proe.x < 1) then vsat.h else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt + Jt_v; + + /* Gas phase energy balance equation */ + BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond + QcondS)*(hlsat - (hv - P/rhov)) + Medium.vapourQuality(state_in_l)*Ce.Q*((if (Medium.vapourQuality(state_in_l) < 1) then hvsat else Ce.h) - (hv - P/rhov)) - Wvl - Wvp + Wt + Jt_v; + if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -264,24 +297,39 @@ equation CvGCT.h_vol_2 = hv; CvBP.h_vol_2 = hv; Cl.h_vol_1 = hl; -/* Condensation mass flow rates */ -// Only the power used to condensate steam - Qcond = (-Wt + Wt2 + noEvent(max(Wvl, 0)) + Wvp)/(vsat.h - lsat.h); - QcondS = (1 - provIn.x)*(CvBP.Q + CvGCT.Q); -/* Steam average specific enthalpy input cavity */ -// 0 = noEvent(hvIn*(max(CvBP.Q, 1e-10) + max(CvGCT.Q, 1e-10)) - max(CvBP.Q, 1e-10)*CvBP.h - max(CvGCT.Q, 1e-10)*CvGCT.h); + + /* Condensation mass flow rates */ + // Only the power used to condensate steam + Qcond = (-Wt + Wt2 + noEvent(max(Wvl, 0)) + Wvp)/(hvsat - hlsat); + + QcondS = (1 - Medium.vapourQuality(state_in_v))*(CvBP.Q + CvGCT.Q); + + /* Steam average specific enthalpy input cavity */ + // 0 = noEvent(hvIn*(max(CvBP.Q, 1e-10) + max(CvGCT.Q, 1e-10)) - max(CvBP.Q, 1e-10)*CvBP.h - max(CvGCT.Q, 1e-10)*CvGCT.h); if dynamic_energy_balance then - 0.1*provIn.d*der(hvIn) = CvBP.Q*(CvBP.h - (hvIn - P/rhov)) + CvGCT.Q*(CvGCT.h - (hvIn - P/rhov)); + 0.1*Medium.density(state_in_v)*der(hvIn) = CvBP.Q*(CvBP.h - (hvIn - P/rhov)) + CvGCT.Q*(CvGCT.h - (hvIn - P/rhov)); else 0 = hvIn*(CvBP.Q + CvGCT.Q) - CvBP.Q*CvBP.h - CvGCT.Q*CvGCT.h; end if; -/* Fluid composition (no balance equations) */ - Cl.ftype = ftype; - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; -/* Flow reversal */ + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = (1 - Medium.vapourQuality(state_in_l))*Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + (Qcond + QcondS)*C_record.Cl; + BSubCv = CvBP.Q*CvBP.SubC + CvGCT.Q*CvGCT.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*Ce.SubC - (Qcond + QcondS)*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; + + Cl.SubC = SubCl; + + /* Flow reversal */ if continuous_flow_reversal then Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1); else @@ -325,35 +373,52 @@ equation CvGCT.diff_on_2 = diffusion; CvBP.diff_on_2 = diffusion; Cl.diff_on_1 = diffusion; -/* Fluid thermodynamic properties*/ - proe = ThermoSysPro.Properties.Fluid.Ph(P, Ce.h, 0, fluid); - prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0, fluid); - provIn = ThermoSysPro.Properties.Fluid.Ph(P, hvIn, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid); - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - Tv = prov.T; - rhov = prov.d; - xv = prov.x; - muv = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(provIn.d, provIn.T, fluid); - mul = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol, Tl, fluid); - kl = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol, Tl, P, 0, fluid)); - kv = noEvent(ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(provIn.d, provIn.T, P, 0, fluid)); -/* Heat transfer coefficient between liquid and wall*/ -/* SACADURA, Von Karman equation*/ + + /* Fluid thermodynamic properties*/ + state_in_l = Medium.setState_phX(p=P, h=Ce.h, X=Medium.reference_X); + state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X); + state_in_v = Medium.setState_phX(p=P, h=hvIn, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); + + muv = Medium.dynamicViscosity(state_in_v); + mul = Medium.dynamicViscosity(state_l); + kl = noEvent(Medium.thermalConductivity(state_l)); + kv = noEvent(Medium.thermalConductivity(state_in_v)); + + /* Heat transfer coefficient between liquid and wall*/ + /* SACADURA, Von Karman equation*/ Rel = noEvent(abs(Cl.Q*zl/(pi*R^2*mul))); - Klp = 0.037*kl*Rel^0.8*(mul*prol.cp/kl)^0.3333/zl; -/* Heat transfer coefficient between steam and wall*/ - Rev = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(L - zl)/(pi*R^2*muv))); - Revl = noEvent(abs((CvBP.Q + CvGCT.Q + proe.x*Ce.Q)*(2*R)/(pi*R^2*muv))); - Kvp = 0.037*kv*Rev^0.8*(muv*prov.cp/kv)^0.3333/(L - zl); -/* Heat transfer coefficient between steam and liquid */ - Kvl = 0.105*kv*Revl^0.68*(muv*prov.cp/kv)^0.33333*(L/2/R)^(-0.103)/(2*R); -/* Thermal power losses*/ -/* Energy balance equation at the wall */ + + Klp = 0.037*kl*Rel^0.8*(mul*Medium.specificHeatCapacityCp(state_l)/kl)^0.3333/zl; + + /* Heat transfer coefficient between steam and wall*/ + Rev = noEvent(abs((CvBP.Q + CvGCT.Q + Medium.vapourQuality(state_in_l)*Ce.Q)*(L - zl)/(pi*R^2*muv))); + Revl = noEvent(abs((CvBP.Q + CvGCT.Q + Medium.vapourQuality(state_in_l)*Ce.Q)*(2*R)/(pi*R^2*muv))); + + Kvp = 0.037*kv*Rev^0.8*(muv*Medium.specificHeatCapacityCp(state_v)/kv)^0.3333/(L - zl); + + /* Heat transfer coefficient between steam and liquid */ + Kvl = 0.105*kv*Revl^0.68*(muv*Medium.specificHeatCapacityCp(state_v)/kv)^0.33333*(L/2/R)^(-0.103)/(2*R); + + /* Thermal power losses*/ + /* Energy balance equation at the wall */ if dynamic_energy_balance then Mp*cpp*der(Tp) = Wlp + Wvp - Wpa; else @@ -370,8 +435,10 @@ equation for i in 1:Ns loop /* Heat transfer coefficient of liquid*/ if Cal_hcond then -// Nusselt corelation - hcond3[i] = ThermoSysPro.Functions.SmoothCond(Tv - Tp1[i], COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv - Tp1[i]), 0.1)))^0.25, COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(vsat.h - lsat.h))/(NbTubV*mul*Dext*0.1))^0.25); + // Nusselt corelation + hcond3[i] = ThermoSysPro.Functions.SmoothCond(Tv - Tp1[i], + COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]), 0.1)))^0.25, + COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*0.1))^0.25); else hcond3[i] = hcond; end if; @@ -379,13 +446,167 @@ equation dW[i] = -hcond3[i]*(Tv - Tp1[i])*Surf_exe + Wt2/Ns; end for; Wt = sum(dW); -/* Total power exchanged for deheating*/ -/* This equation is not valid for mass flow rate in the pipes = 0 */ - Wt2 = noEvent(if (hvIn > vsat.h) then -(CvBP.Q + CvGCT.Q)*(hvIn - vsat.h) else 0); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-250, -200}, {100, 100}}, grid = {2, 2}, initialScale = 0.1), graphics = {Text(extent = {{-96, -68}, {-78, -76}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Pipe 3"), Text(extent = {{-118, -15}, {-42, -51}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "Horizontal_1pipe"), Rectangle(extent = {{-112, -76}, {-56, -80}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{-138, -54}, {-120, -54}}, color = {0, 0, 255}, arrow = {Arrow.Filled, Arrow.None}), Text(extent = {{-152, -76}, {-114, -94}}, lineColor = {0, 0, 255}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, textString = "in"), Line(points = {{-134, -78}, {-116, -78}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{-56, -78}, {-50, -78}, {-50, -54}, {-114, -54}, {-124, -54}}, color = {0, 0, 255}, arrow = {Arrow.None, Arrow.Filled}), Rectangle(extent = {{-116, -42}, {-44, -114}}, lineColor = {0, 0, 255}, pattern = LinePattern.Dash), Rectangle(extent = {{-114, -52}, {-96, -56}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-126, 42}, {-32, 12}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, textString = "Condensation pipes"), Text(extent = {{-114, 30}, {-48, 6}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid, textString = " + Deheating pipes")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-250, -200}, {100, 100}}, grid = {2, 2}, initialScale = 0.1), graphics = {Ellipse(extent = {{-100, 50}, {100, -150}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Ellipse(extent = {{-250, 50}, {-50, -150}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Rectangle(extent = {{-160, 50}, {8, -150}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-238, -98}, {88, -98}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-228, -112}, {78, -112}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-214, -126}, {66, -126}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-196, -138}, {48, -138}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-232, -106}, {82, -106}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-222, -118}, {72, -118}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-206, -132}, {56, -132}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-182, -144}, {32, -144}}, color = {0, 0, 255}, pattern = LinePattern.Dash), Line(points = {{-160, -150}, {8, -150}}, color = {0, 0, 255}), Line(points = {{-160, 50}, {10, 50}}, color = {0, 0, 255}), Text(extent = {{-90, 84}, {-58, 70}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "Steam LP"), Text(extent = {{-164, 84}, {-132, 70}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "Steam HP"), Text(extent = {{-248, 52}, {-206, 40}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "Water/steam")}), - Window(x = 0.11, y = 0.06, width = 0.78, height = 0.88), + + /* Total power exchanged for deheating*/ + /* This equation is not valid for mass flow rate in the pipes = 0 */ + Wt2 = noEvent(if (hvIn > hvsat) then -(CvBP.Q + CvGCT.Q)*(hvIn - hvsat) else 0); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-250,-200},{100,100}}, + grid={2,2}, + initialScale=0.1), graphics={ + Text( + extent={{-96,-68},{-78,-76}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Pipe 3"), + Text( + extent={{-118,-15},{-42,-51}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "Horizontal_1pipe"), + Rectangle( + extent={{-112,-76},{-56,-80}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{-138,-54},{-120,-54}}, + color={0,0,255}, + arrow={Arrow.Filled,Arrow.None}), + Text( + extent={{-152,-76},{-114,-94}}, + lineColor={0,0,255}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid, + textString= + "in"), + Line( + points={{-134,-78},{-116,-78}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{-56,-78},{-50,-78},{-50,-54},{-114,-54},{-124,-54}}, + color={0,0,255}, + arrow={Arrow.None,Arrow.Filled}), + Rectangle( + extent={{-116,-42},{-44,-114}}, + lineColor={0,0,255}, + pattern=LinePattern.Dash), + Rectangle( + extent={{-114,-52},{-96,-56}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-126,42},{-32,12}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + textString= + "Condensation pipes"), + Text( + extent={{-114,30},{-48,6}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + textString= + " + Deheating pipes")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-250,-200},{100,100}}, + grid={2,2}, + initialScale=0.1), graphics={ + Ellipse( + extent={{-100,50},{100,-150}}, + lineColor={28,108,200}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-250,50},{-50,-150}}, + lineColor={28,108,200}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-160,50},{8,-150}}, + lineColor={28,108,200}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Line( + points={{-238,-98},{88,-98}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-228,-112},{78,-112}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-214,-126},{66,-126}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-196,-138},{48,-138}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-232,-106},{82,-106}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-222,-118},{72,-118}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-206,-132},{56,-132}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-182,-144},{32,-144}}, + color={0,0,255}, + pattern=LinePattern.Dash), + Line( + points={{-160,-150},{8,-150}}, + color={0,0,255}), + Line(points={{-160,50},{10,50}}, color={0,0,255}), + Text( + extent={{-90,84},{-58,70}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString="Steam LP"), + Text( + extent={{-164,84},{-132,70}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString= + "Steam HP"), + Text( + extent={{-248,52},{-206,40}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString="Water/steam")}), + Window( + x=0.11, + y=0.06, + width=0.78, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -396,4 +617,4 @@ Baligh El Hefni Daniel Bouskela ")); -end TwoPhaseCavityOnePipe; \ No newline at end of file +end TwoPhaseCavityOnePipe; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo index f411209e..9231e899 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo @@ -1,29 +1,49 @@ within ThermoSysPro.Fluid.Volumes; model TwoPhaseVolume "TwoPhaseVolume" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.Volume V = 1 "Cavity volume"; - parameter Units.SI.Area A = 1 "Cavity cross-sectional area"; - parameter Real Ccond = 0.01 "Condensation coefficient"; - parameter Real Cevap = 0.09 "Evaporation coefficient"; - parameter Real Xlo = 0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; - parameter Real Xvo = 0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; - parameter Units.SI.Area Avl = A "Heat exchange surface between the liquid and gas phases"; - parameter Real Kvl = 1000 "Heat exchange coefficient between the liquid and gas phases"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean steady_state = true "true: start from steady state - false: start from (Vf0, P0)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.5 "Fraction of initial water volume in the drum (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 0.1e5 "Fluid initial pressure (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Volume V=1 "Cavity volume"; + parameter Units.SI.Area A=1 "Cavity cross-sectional area"; + parameter Real Ccond=0.01 "Condensation coefficient"; + parameter Real Cevap=0.09 "Evaporation coefficient"; + parameter Real Xlo=0.0025 + "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; + parameter Real Xvo=0.9975 + "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; + parameter Units.SI.Area Avl=A + "Heat exchange surface between the liquid and gas phases"; + parameter Real Kvl=1000 + "Heat exchange coefficient between the liquid and gas phases"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean steady_state=true + "true: start from steady state - false: start from (Vf0, P0)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.5 + "Fraction of initial water volume in the drum (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=0.1e5 + "Fluid initial pressure (active if steady_state=false)" annotation ( + Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.C_BiPhase C_record; + +public Units.SI.AbsolutePressure P "Fluid average pressure"; Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity"; Units.SI.SpecificEnthalpy hl "Liquid phase spepcific enthalpy"; @@ -32,18 +52,24 @@ model TwoPhaseVolume "TwoPhaseVolume" Units.SI.Temperature Tv "Gas phase temperature"; Units.SI.Volume Vl "Liquid phase volume"; Units.SI.Volume Vv "Gas phase volume"; - Real xl(start = 0.5) "Mass vapor fraction in the liquid phase"; - Real xv(start = 0) "Mass vapor fraction in the gas phase"; - Units.SI.Density rhol(start = 996) "Liquid phase density"; - Units.SI.Density rhov(start = 1.5) "Gas phase density"; - Units.SI.MassFlowRate BQl "Right hand side of the mass balance equation of the liquid phase"; - Units.SI.MassFlowRate BQv "Right hand side of the mass balance equation of the gas phaser"; - Units.SI.Power BHl "Right hand side of the energy balance equation of the liquid phase"; - Units.SI.Power BHv "Right hand side of the energy balance equation of the gas phase"; - Units.SI.MassFlowRate Qcond "Condensation mass flow rate from the vapor phase"; - Units.SI.MassFlowRate Qevap "Evaporation mass flow rate from the liquid phase"; - Units.SI.Power Wvl "Thermal power exchanged from the gas phase to the liquid phase"; - FluidType fluids[4] "Fluids mixing in volume"; + Real xl(start=0.5) "Mass vapor fraction in the liquid phase"; + Real xv(start=0) "Mass vapor fraction in the gas phase"; + Units.SI.Density rhol(start=996) "Liquid phase density"; + Units.SI.Density rhov(start=1.5) "Gas phase density"; + Units.SI.MassFlowRate BQl + "Right hand side of the mass balance equation of the liquid phase"; + Units.SI.MassFlowRate BQv + "Right hand side of the mass balance equation of the gas phaser"; + Units.SI.Power BHl + "Right hand side of the energy balance equation of the liquid phase"; + Units.SI.Power BHv + "Right hand side of the energy balance equation of the gas phase"; + Units.SI.MassFlowRate Qcond + "Condensation mass flow rate from the vapor phase"; + Units.SI.MassFlowRate Qevap + "Evaporation mass flow rate from the liquid phase"; + Units.SI.Power Wvl + "Thermal power exchanged from the gas phase to the liquid phase"; Units.SI.Power Je "Thermal power diffusion from inlet Ce"; Units.SI.Power Jv "Thermal power diffusion from inlet Cv"; Units.SI.Power Jl "Thermal power diffusion from outlet Cl"; @@ -55,30 +81,40 @@ model TwoPhaseVolume "TwoPhaseVolume" Real re "Value of r(Q/gamma) for inlet Ce"; Real rv "Value of r(Q/gamma) for inlet Cv"; Real rl "Value of r(Q/gamma) for outlet Cl"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol "Propri鴩s de l'eau dans le ballon" annotation( - Placement(transformation(extent = {{-60, 40}, {-20, 80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov "Propri鴩s de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{0, 40}, {40, 80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-60, -80}, {-20, -40}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{0, -80}, {40, -40}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cv "Steam input" annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cl "Water output" annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, 10}, {10, 30}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel "Water level" annotation( - Placement(transformation(extent = {{100, -10}, {120, 10}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod annotation( - Placement(transformation(extent = {{-60, -20}, {-20, 20}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce "Water input" annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid = Integer(ftype) "Fluid number"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Liquid phase trace substances"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) + "Vapor phase trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state_l "Liquid state in the volume"; + Medium.ThermodynamicState state_v "Vapor state in the volume"; + Medium.ThermodynamicState state_out_l "Liquid outlet state"; + Medium.SaturationProperties sat "Saturation properties at volume pressure"; + Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at volume pressure"; + Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at volume pressure"; + Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy"; + Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure"; + Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy"; + Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure"; + Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) "Steam input" annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "Water output" annotation (Placement( + transformation(extent={{-10,-110},{10,-90}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation( + extent={{-10,10},{10,30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel + "Water level" annotation (Placement(transformation( + extent={{100,-10},{120,10}}, rotation=0))); +public + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -86,32 +122,26 @@ initial equation der(hl) = 0; der(hv) = 0; der(Vl) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else P = P0; - hl = lsat.h; - hv = vsat.h; + hl = hlsat; + hv = hvsat; Vl = Vf0*V; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cv.ftype; - fluids[4] = Cl.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "TwoPhaseVolume: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; Ce.h = 1.e5; Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cv) == 0) then Cv.Q = 0; @@ -119,11 +149,7 @@ equation Cv.h_vol_1 = 1.e5; Cv.diff_res_1 = 0; Cv.diff_on_1 = false; - Cv.ftype = ftype; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; + Cv.SubC = Medium.C_default; end if; if (cardinality(Cl) == 0) then Cl.Q = 0; @@ -133,39 +159,47 @@ equation end if; /* Volume of the cavity */ V = Vl + Vv; -/* Pressure at the bottom of the cavity */ - Pfond = P + prod.d*g*Vl/A; -/* Liquid phase mass balance equation */ + + /* Pressure at the bottom of the cavity */ + Pfond = P + Medium.density(state_out_l)*g*Vl/A; + + /* Liquid phase mass balance equation */ BQl = -Cl.Q + Qcond - Qevap + Ce.Q; if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl; else 0 = BQl; end if; /* Vapor phase mass balance equation */ BQv = Cv.Q + Qevap - Qcond; if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv; else 0 = BQv; end if; -/* Condensation and evaporation mass flow rates */ - Qcond = if (xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0; - Qevap = if (xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0; + + /* Condensation and evaporation mass flow rates */ + Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0; + Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0; + Ce.P = P; Cv.P = P; Cl.P = Pfond; -/* Liquid phase energy balance equation */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl + Jt_l; + + /* Liquid phase energy balance equation */ + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (hl - P/rhol)) + Ce.Q*(Ce.h - (hl - P/rhol)) + Wvl + Jt_l; + if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + rhol)*der(hl)) = BHl; else 0 = BHl; end if; -/* Gas phase energy balance equation */ - BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Cth.W + Jt_v; + + /* Gas phase energy balance equation */ + BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (hv - P/rhov)) - Wvl + Cth.W + Jt_v; + if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv; else 0 = BHv; end if; @@ -176,13 +210,25 @@ equation Wvl = Kvl*Avl*(Tv - Tl); /* Water leval */ yLevel.signal = Vl/A; -/* Fluid composition (no balance equations) */ - Cl.ftype = ftype; - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; -/* Flow reversal */ + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + SubCSaS = SaS(); + + BSubCl = Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_record.Cl - Qevap*SubCl; + BSubCv = Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; + rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; + end if; + + Cl.SubC = SubCl; + + /* Flow reversal */ if continuous_flow_reversal then Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1); else @@ -218,17 +264,28 @@ equation Ce.diff_on_2 = diffusion; Cv.diff_on_2 = diffusion; Cl.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - prol = ThermoSysPro.Properties.Fluid.Ph((P + Pfond)/2, hl, 0, fluid); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid); - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid); - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - Tv = prov.T; - rhov = prov.d; - xv = prov.x; + + /* Fluid thermodynamic properties */ + state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X); + state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X); + state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X); + sat = Medium.setSat_p(P); + hlsat = Medium.bubbleEnthalpy(sat); + hvsat = Medium.dewEnthalpy(sat); + + ddphl = Medium.density_derp_h(state_l); + ddhpl = Medium.density_derh_p(state_l); + ddphv = Medium.density_derp_h(state_v); + ddhpv = Medium.density_derh_p(state_v); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat)))); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat)))); + Cth.T = Tv; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), @@ -244,4 +301,4 @@ Daniel Bouskela Baligh El Hefni ")); -end TwoPhaseVolume; \ No newline at end of file +end TwoPhaseVolume; diff --git a/ThermoSysPro/Fluid/Volumes/VolumeA.mo b/ThermoSysPro/Fluid/Volumes/VolumeA.mo index b5901ab8..92936079 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeA.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeA.mo @@ -1,66 +1,65 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeA "Mixing volume with 2 inlets and 2 outlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -74,19 +73,17 @@ model VolumeA "Mixing volume with 2 inlets and 2 outlets" Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0), iconTransformation(extent = {{-10, 90}, {10, 110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0), + iconTransformation(extent={{-10,90},{10,110}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -102,19 +99,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -122,25 +112,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeA: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -148,11 +129,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -169,7 +147,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -177,13 +155,15 @@ equation P = Ce2.P; P = Cs1.P; P = Cs2.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -192,40 +172,34 @@ equation Ce2.h_vol_2 = h; Cs1.h_vol_1 = h; Cs2.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + Cs1.Xi = X; + + Cs2.Xi = X; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -270,19 +244,24 @@ equation Ce2.diff_on_2 = diffusion; Cs1.diff_on_1 = diffusion; Cs2.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + /* Fluid thermodynamic properties */ + if isCompressible and dynamic_mass_balance then + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), @@ -299,4 +278,4 @@ Daniel Bouskela Baligh El Hefni ")); -end VolumeA; \ No newline at end of file +end VolumeA; diff --git a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo index 2b40e378..b8228250 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo @@ -1,66 +1,63 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeATh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -74,21 +71,21 @@ model VolumeATh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0), iconTransformation(extent = {{-10, 90}, {10, 110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0), + iconTransformation(extent={{-10,90},{10,110}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); +public + Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -104,19 +101,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -124,25 +114,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeAth: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -150,11 +131,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -171,7 +149,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -179,13 +157,15 @@ equation P = Ce2.P; P = Cs1.P; P = Cs2.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -194,40 +174,33 @@ equation Ce2.h_vol_2 = h; Cs1.h_vol_1 = h; Cs2.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + Cs1.Xi = X; + Cs2.Xi = X; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -274,18 +247,22 @@ equation Cs2.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeB.mo b/ThermoSysPro/Fluid/Volumes/VolumeB.mo index 87664eef..361f0ceb 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeB.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeB.mo @@ -1,49 +1,49 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeB "Mixing volume with 2 inlets and 2 outlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; @@ -52,15 +52,12 @@ model VolumeB "Mixing volume with 2 inlets and 2 outlets" Units.SI.Power BH "Right hand side of the energy balance equation"; Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -74,19 +71,18 @@ model VolumeB "Mixing volume with 2 inlets and 2 outlets" Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0), iconTransformation(extent = {{90, -10}, {110, 10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0), iconTransformation(extent = {{-10, 90}, {10, 110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0), + iconTransformation(extent={{90,-10},{110,10}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,90},{10,110}}, rotation=0), + iconTransformation(extent={{-10,90},{10,110}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -102,19 +98,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -122,25 +111,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeB: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -148,11 +128,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -169,7 +146,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -177,13 +154,15 @@ equation P = Ce2.P; P = Cs1.P; P = Cs2.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -192,40 +171,34 @@ equation Ce2.h_vol_2 = h; Cs1.h_vol_1 = h; Cs2.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + Cs1.Xi = X; + + Cs2.Xi = X; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -272,17 +245,21 @@ equation Cs2.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo index b31ae04b..e998b221 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo @@ -1,66 +1,63 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeBTh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; @@ -74,21 +71,21 @@ model VolumeBTh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input" Real re2 "Value of r(Q/gamma) for inlet e2"; Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0), iconTransformation(extent = {{90, -10}, {110, 10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0), + iconTransformation(extent={{90,-10},{110,10}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,90},{10,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); +public + Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -104,19 +101,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -124,25 +114,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Cs1.ftype; - fluids[5] = Cs2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeBth: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -150,11 +131,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -171,7 +149,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q - Cs1.Q - Cs2.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -179,13 +157,15 @@ equation P = Ce2.P; P = Cs1.P; P = Cs2.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) + Cth.W + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + Cth.W + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -194,40 +174,34 @@ equation Ce2.h_vol_2 = h; Cs1.h_vol_1 = h; Cs2.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.Xi = X; + + Cs2.Xi = X; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -274,18 +248,22 @@ equation Cs2.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo index 9dae4b66..9e28a6ac 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo @@ -1,66 +1,62 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeC "Mixing volume with 3 inlets and 1 outlet" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -74,19 +70,18 @@ model VolumeC "Mixing volume with 3 inlets and 1 outlet" Real re2 "Value of r(Q/gamma) for inlet e2"; Real re3 "Value of r(Q/gamma) for inlet e3"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0), iconTransformation(extent = {{-110, -10}, {-90, 10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0), iconTransformation(extent = {{-10, 90}, {10, 110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}), iconTransformation(extent = {{-10, -110}, {10, -90}}))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0), + iconTransformation(extent={{-110,-10},{-90,10}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0), + iconTransformation(extent={{-10,90},{10,110}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{ + 10,-90}}))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -102,19 +97,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -122,25 +110,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeC: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -148,11 +127,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then Ce3.Q = 0; @@ -160,11 +136,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Cs) == 0) then Cs.Q = 0; @@ -175,7 +148,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -183,13 +156,15 @@ equation P = Ce2.P; P = Ce3.P; P = Cs.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -198,35 +173,32 @@ equation Ce2.h_vol_2 = h; Ce3.h_vol_2 = h; Cs.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q - Cs.Xi*Cs.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC - Cs.Q*Cs.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; -/* Flow reversal */ + + Cs.SubC = SubC; + + Cs.Xi = X; + + /* Flow reversal */ if continuous_flow_reversal then Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); else @@ -271,17 +243,21 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo index 8e61caa9..8e10d009 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo @@ -1,66 +1,62 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeCTh "Mixing volume with 3 inlets, 1 outlet and 1 thermal input" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -74,21 +70,22 @@ model VolumeCTh "Mixing volume with 3 inlets, 1 outlet and 1 thermal input" Real re2 "Value of r(Q/gamma) for inlet e2"; Real re3 "Value of r(Q/gamma) for inlet e3"; Real rs "Value of r(Q/gamma) for outlet s"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0), iconTransformation(extent = {{-110, -10}, {-90, 10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0), iconTransformation(extent = {{-10, 90}, {10, 110}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}), iconTransformation(extent = {{-10, -110}, {10, -90}}))); - Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0), + iconTransformation(extent={{-110,-10},{-90,10}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0), + iconTransformation(extent={{-10,90},{10,110}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{ + 10,-90}}))); +public + Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -104,19 +101,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -124,25 +114,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Cs.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeCTh: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -150,11 +131,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then Ce3.Q = 0; @@ -162,11 +140,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Cs) == 0) then Cs.Q = 0; @@ -177,7 +152,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -185,13 +160,15 @@ equation P = Ce2.P; P = Ce3.P; P = Cs.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) - Cs.Q*(Cs.h - Cs.Xh2o*hr) + Cth.W + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + Cth.W + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -200,35 +177,32 @@ equation Ce2.h_vol_2 = h; Ce3.h_vol_2 = h; Cs.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q - Cs.Xco2*Cs.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q - Cs.Xh2o*Cs.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q - Cs.Xo2*Cs.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q - Cs.Xso2*Cs.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q - Cs.Xi*Cs.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC - Cs.Q*Cs.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs.ftype = ftype; - Cs.Xco2 = Xco2; - Cs.Xh2o = Xh2o; - Cs.Xo2 = Xo2; - Cs.Xso2 = Xso2; -/* Flow reversal */ + + Cs.SubC = SubC; + + Cs.Xi = X; + + /* Flow reversal */ if continuous_flow_reversal then Cs.h = ThermoSysPro.Functions.SmoothCond(Cs.Q/gamma_s, Cs.h_vol_1, Cs.h_vol_2, 1); else @@ -273,18 +247,22 @@ equation Cs.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeD.mo b/ThermoSysPro/Fluid/Volumes/VolumeD.mo index 1856bc72..e46ca9ef 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeD.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeD.mo @@ -1,66 +1,64 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeD "Mixing volume with 1 inlet and 3 outlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; @@ -74,19 +72,16 @@ model VolumeD "Mixing volume with 1 inlet and 3 outlets" Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; Real rs3 "Value of r(Q/gamma) for outlet s3"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cs3 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,90},{10,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -102,19 +97,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -122,25 +110,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - fluids[5] = Cs3.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeD: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; Ce.h = 1.e5; Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.Xi = Medium.X_default[1:Medium.nXi]; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -163,7 +142,7 @@ equation /* Mass balance equation */ BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -171,13 +150,15 @@ equation P = Cs1.P; P = Cs2.P; P = Cs3.P; -/* Energy balance equation */ - BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + J; + + /* Energy balance equation */ + BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -186,45 +167,36 @@ equation Cs1.h_vol_1 = h; Cs2.h_vol_1 = h; Cs3.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q; - BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q; - BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q; - BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + X*BQ = BX; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; -/* Flow reversal */ + + + /* Traces composition balance equations */ + BSubC = Ce.Q*Ce.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; + else + V*rho*SubCSaS = BSubC; + end if; + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; + + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -273,17 +245,21 @@ equation Cs3.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo index 71665b1d..b3d4e8c1 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo @@ -1,66 +1,62 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeDTh "Mixing volume with 1 inlet, 3 outlets and 1 thermal input" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[5] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je "Thermal power diffusion from inlet e"; Units.SI.Power Js1 "Thermal power diffusion from outlet s1"; Units.SI.Power Js2 "Thermal power diffusion from outlet s2"; @@ -74,21 +70,19 @@ model VolumeDTh "Mixing volume with 1 inlet, 3 outlets and 1 thermal input" Real rs1 "Value of r(Q/gamma) for outlet s1"; Real rs2 "Value of r(Q/gamma) for outlet s2"; Real rs3 "Value of r(Q/gamma) for outlet s3"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cs3 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}))); - Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,90},{10,110}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -104,19 +98,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -124,25 +111,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce.ftype; - fluids[3] = Cs1.ftype; - fluids[4] = Cs2.ftype; - fluids[5] = Cs3.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeDTh: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce) == 0) then Ce.Q = 0; Ce.h = 1.e5; Ce.h_vol_1 = 1.e5; Ce.diff_res_1 = 0; Ce.diff_on_1 = false; - Ce.ftype = ftype; - Ce.Xco2 = 0; - Ce.Xh2o = 0; - Ce.Xo2 = 0; - Ce.Xso2 = 0; + Ce.Xi = Medium.X_default[1:Medium.nXi]; + Ce.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -165,7 +143,7 @@ equation /* Mass balance equation */ BQ = Ce.Q - Cs1.Q - Cs2.Q - Cs3.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -173,13 +151,15 @@ equation P = Cs1.P; P = Cs2.P; P = Cs3.P; -/* Energy balance equation */ - BH = Ce.Q*(Ce.h - Ce.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) + Cth.W + J; + + /* Energy balance equation */ + BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + Cth.W + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -188,45 +168,35 @@ equation Cs1.h_vol_1 = h; Cs2.h_vol_1 = h; Cs3.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce.Xco2*Ce.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q; - BXh2o = Ce.Xh2o*Ce.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q; - BXo2 = Ce.Xo2*Ce.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q; - BXso2 = Ce.Xso2*Ce.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + /* Traces composition balance equations */ + BSubC = Ce.Q*Ce.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; + + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -275,18 +245,22 @@ equation Cs3.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-60, 60}, {60, -60}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}, lineThickness = 0.2)}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeI.mo b/ThermoSysPro/Fluid/Volumes/VolumeI.mo index da5bb52e..485e432b 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeI.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeI.mo @@ -1,66 +1,65 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeI "Mixing volume with 4 inlets and 4 outlets" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; - Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[9] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.AbsolutePressure P(start=1.e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.MassFlowRate BQ + "Right hand side of the mass balance equation"; + Units.SI.Power BH + "Right hand side of the energy balance equation"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -86,27 +85,33 @@ model VolumeI "Mixing volume with 4 inlets and 4 outlets" Real rs2 "Value of r(Q/gamma) for outlet s2"; Real rs3 "Value of r(Q/gamma) for outlet s3"; Real rs4 "Value of r(Q/gamma) for outlet s4"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, 70}, {-90, 90}}, rotation = 0), iconTransformation(extent = {{-110, 70}, {-90, 90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0), iconTransformation(extent = {{-110, -10}, {-90, 10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{90, 70}, {110, 90}}, rotation = 0), iconTransformation(extent = {{90, 70}, {110, 90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0), iconTransformation(extent = {{90, -10}, {110, 10}}))); - Interfaces.Connectors.FluidInlet Ce3 annotation( - Placement(transformation(extent = {{-110, -90}, {-90, -70}}), iconTransformation(extent = {{-110, -90}, {-90, -70}}))); - Interfaces.Connectors.FluidInlet Ce4 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}), iconTransformation(extent = {{-10, -110}, {10, -90}}))); - Interfaces.Connectors.FluidOutlet Cs3 annotation( - Placement(transformation(extent = {{90, -90}, {110, -70}}), iconTransformation(extent = {{90, -90}, {110, -70}}))); - Interfaces.Connectors.FluidOutlet Cs4 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}), iconTransformation(extent = {{-10, 90}, {10, 110}}))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,70},{-90,90}}, rotation=0), + iconTransformation(extent={{-110,70},{-90,90}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, + rotation=0), + iconTransformation(extent={{-110,-10},{-90,10}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,70},{110,90}}, rotation=0), + iconTransformation(extent={{90,70},{110,90}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-10},{110,10}}, rotation=0), + iconTransformation(extent={{90,-10},{110,10}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}), iconTransformation( + extent={{-110,-90},{-90,-70}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,-110},{10,-90}}), iconTransformation(extent= + {{-10,-110},{10,-90}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-90},{110,-70}}), iconTransformation( + extent={{90,-90},{110,-70}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs4(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-10,90},{10,110}}), iconTransformation( + extent={{-10,90},{10,110}}))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -122,19 +127,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -142,29 +140,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Ce4.ftype; - fluids[6] = Cs1.ftype; - fluids[7] = Cs2.ftype; - fluids[8] = Cs3.ftype; - fluids[9] = Cs4.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeI: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -172,11 +157,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then Ce3.Q = 0; @@ -184,11 +166,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Ce4) == 0) then Ce4.Q = 0; @@ -196,11 +175,8 @@ equation Ce4.h_vol_1 = 1.e5; Ce4.diff_res_1 = 0; Ce4.diff_on_1 = false; - Ce4.ftype = ftype; - Ce4.Xco2 = 0; - Ce4.Xh2o = 0; - Ce4.Xo2 = 0; - Ce4.Xso2 = 0; + Ce4.Xi = Medium.X_default[1:Medium.nXi]; + Ce4.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -229,7 +205,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -241,13 +217,15 @@ equation P = Cs2.P; P = Cs3.P; P = Cs4.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -260,50 +238,38 @@ equation Cs2.h_vol_1 = h; Cs3.h_vol_1 = h; Cs4.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q - Cs4.Xi*Cs4.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + Ce4.Q*Ce4.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC - Cs4.Q*Cs4.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs4.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; - Cs4.Xco2 = Xco2; - Cs4.Xh2o = Xh2o; - Cs4.Xo2 = Xo2; - Cs4.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; + Cs4.SubC = SubC; + + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; + Cs4.Xi = X; + + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -386,17 +352,21 @@ equation Cs4.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-40, 80}, {40, 0}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}), Ellipse(extent = {{-40, 0}, {40, -80}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}), Line(points = {{-90, 80}, {-60, 80}, {-40, 46}}), Line(points = {{-90, -80}, {-60, -80}, {-40, -46}}), Line(points = {{92, 80}, {60, 80}, {40, 46}}), Line(points = {{92, -80}, {60, -80}, {40, -46}})}), diff --git a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo index 1e4eca4f..03f48d70 100644 --- a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo +++ b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo @@ -1,66 +1,63 @@ within ThermoSysPro.Fluid.Volumes; - model VolumeITh "Mixing volume with 4 inlets, 4 outlets and 1 thermal input" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; + extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.Volume V = 1 "Volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean dynamic_mass_balance = false "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.AbsolutePressure P0 = 1e5 "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance and dynamic_mass_balance and not steady_state)); - parameter Units.SI.SpecificEnthalpy h0 = 1e5 "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.Volume V=1 + "Volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean dynamic_mass_balance=false + "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=isCompressible and dynamic_energy_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from (P0, h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.AbsolutePressure P0=1e5 + "Initial fluid pressure (active if the fluid is compressible, and if dynamic_energy_balance=true and dynamic_mass_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=isCompressible and + dynamic_energy_balance and dynamic_mass_balance and not steady_state)); + parameter Units.SI.SpecificEnthalpy h0=1e5 + "Initial fluid specific enthalpy (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + + +protected + constant Boolean isCompressible = Medium.isCompressible; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure"; Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; Units.SI.Density rho(start = 998) "Fluid density"; Units.SI.MassFlowRate BQ "Right hand side of the mass balance equation"; Units.SI.Power BH "Right hand side of the energy balance equation"; - Units.SI.DerDensityByPressure ddph "density derivative wrt pressure at constant specific enthalpy"; - Units.SI.DerDensityByEnthalpy ddhp "density derivative wrt specific enthalpy at constant pressure"; - FluidType fluids[9] "Fluids mixing in volume"; - Units.SI.MassFlowRate BXco2 "Right hand side of the CO2 balance equation"; - Units.SI.MassFlowRate BXh2o "Right hand side of the H2O balance equation"; - Units.SI.MassFlowRate BXo2 "Right hand side of the O2 balance equation"; - Units.SI.MassFlowRate BXso2 "Right hand side of the SO2 balance equation"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph + "density derivative wrt pressure at constant specific enthalpy"; + Units.SI.DerDensityByEnthalpy ddhp + "density derivative wrt specific enthalpy at constant pressure"; + Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction"; + Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium.ThermodynamicState state; Units.SI.Power Je1 "Thermal power diffusion from inlet e1"; Units.SI.Power Je2 "Thermal power diffusion from inlet e2"; Units.SI.Power Je3 "Thermal power diffusion from inlet e3"; @@ -86,29 +83,35 @@ model VolumeITh "Mixing volume with 4 inlets, 4 outlets and 1 thermal input" Real rs2 "Value of r(Q/gamma) for outlet s2"; Real rs3 "Value of r(Q/gamma) for outlet s3"; Real rs4 "Value of r(Q/gamma) for outlet s4"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1 annotation( - Placement(transformation(extent = {{-110, 70}, {-90, 90}}, rotation = 0), iconTransformation(extent = {{-110, 70}, {-90, 90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0), iconTransformation(extent = {{-110, -10}, {-90, 10}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1 annotation( - Placement(transformation(extent = {{90, 70}, {110, 90}}, rotation = 0), iconTransformation(extent = {{90, 70}, {110, 90}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0), iconTransformation(extent = {{90, -10}, {110, 10}}))); - Interfaces.Connectors.FluidInlet Ce3 annotation( - Placement(transformation(extent = {{-110, -90}, {-90, -70}}), iconTransformation(extent = {{-110, -90}, {-90, -70}}))); - Interfaces.Connectors.FluidInlet Ce4 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}), iconTransformation(extent = {{-10, -110}, {10, -90}}))); - Interfaces.Connectors.FluidOutlet Cs3 annotation( - Placement(transformation(extent = {{90, -90}, {110, -70}}), iconTransformation(extent = {{90, -90}, {110, -70}}))); - Interfaces.Connectors.FluidOutlet Cs4 annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}), iconTransformation(extent = {{-10, 90}, {10, 110}}))); - Thermal.Connectors.ThermalPort Cth annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); -protected - constant Units.SI.SpecificEnthalpy hr = 2501569 "Water/steam reference specific enthalpy at 0.01°C"; - parameter Boolean flue_gases = (ftype == FluidType.FlueGases) "Flue gases"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,70},{-90,90}}, rotation=0), + iconTransformation(extent={{-110,70},{-90,90}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, + rotation=0), + iconTransformation(extent={{-110,-10},{-90,10}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,70},{110,90}}, rotation=0), + iconTransformation(extent={{90,70},{110,90}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-10},{110,10}}, rotation=0), + iconTransformation(extent={{90,-10},{110,10}}))); + Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90}, + {-90,-70}}))); + Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{ + 10,-90}}))); + Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110, + -70}}))); + Interfaces.Connectors.FluidOutlet Cs4(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}}))); + Thermal.Connectors.ThermalPort Cth + annotation (Placement(transformation(extent={{-10, + -10},{10,10}}, rotation=0))); initial equation if dynamic_energy_balance and dynamic_mass_balance then if steady_state then @@ -124,19 +127,12 @@ initial equation h = h0; end if; end if; - if flue_gases then - if dynamic_composition_balance then - if steady_state then - der(Xco2) = 0; - der(Xh2o) = 0; - der(Xo2) = 0; - der(Xso2) = 0; - else - Xco2 = Xco20; - Xh2o = Xh2o0; - Xo2 = Xo20; - Xso2 = Xso20; - end if; + + if dynamic_composition_balance then + if steady_state then + der(X) = fill(0,Medium.nX); + else + X = X0[1:Medium.nXi]; end if; end if; equation @@ -144,29 +140,16 @@ equation if dynamic_energy_balance or dynamic_mass_balance then assert(V > 0, "Volume non-positive"); end if; -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ce1.ftype; - fluids[3] = Ce2.ftype; - fluids[4] = Ce3.ftype; - fluids[5] = Ce4.ftype; - fluids[6] = Cs1.ftype; - fluids[7] = Cs2.ftype; - fluids[8] = Cs3.ftype; - fluids[9] = Cs4.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "VolumeITh: fluids mixing in volume are not compatible with each other"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Ce1) == 0) then Ce1.Q = 0; Ce1.h = 1.e5; Ce1.h_vol_1 = 1.e5; Ce1.diff_res_1 = 0; Ce1.diff_on_1 = false; - Ce1.ftype = ftype; - Ce1.Xco2 = 0; - Ce1.Xh2o = 0; - Ce1.Xo2 = 0; - Ce1.Xso2 = 0; + Ce1.Xi = Medium.X_default[1:Medium.nXi]; + Ce1.SubC = Medium.C_default; end if; if (cardinality(Ce2) == 0) then Ce2.Q = 0; @@ -174,11 +157,8 @@ equation Ce2.h_vol_1 = 1.e5; Ce2.diff_res_1 = 0; Ce2.diff_on_1 = false; - Ce2.ftype = ftype; - Ce2.Xco2 = 0; - Ce2.Xh2o = 0; - Ce2.Xo2 = 0; - Ce2.Xso2 = 0; + Ce2.Xi = Medium.X_default[1:Medium.nXi]; + Ce2.SubC = Medium.C_default; end if; if (cardinality(Ce3) == 0) then Ce3.Q = 0; @@ -186,11 +166,8 @@ equation Ce3.h_vol_1 = 1.e5; Ce3.diff_res_1 = 0; Ce3.diff_on_1 = false; - Ce3.ftype = ftype; - Ce3.Xco2 = 0; - Ce3.Xh2o = 0; - Ce3.Xo2 = 0; - Ce3.Xso2 = 0; + Ce3.Xi = Medium.X_default[1:Medium.nXi]; + Ce3.SubC = Medium.C_default; end if; if (cardinality(Ce4) == 0) then Ce4.Q = 0; @@ -198,11 +175,8 @@ equation Ce4.h_vol_1 = 1.e5; Ce4.diff_res_1 = 0; Ce4.diff_on_1 = false; - Ce4.ftype = ftype; - Ce4.Xco2 = 0; - Ce4.Xh2o = 0; - Ce4.Xo2 = 0; - Ce4.Xso2 = 0; + Ce4.Xi = Medium.X_default[1:Medium.nXi]; + Ce4.SubC = Medium.C_default; end if; if (cardinality(Cs1) == 0) then Cs1.Q = 0; @@ -231,7 +205,7 @@ equation /* Mass balance equation */ BQ = Ce1.Q + Ce2.Q + Ce3.Q + Ce4.Q - Cs1.Q - Cs2.Q - Cs3.Q - Cs4.Q; if isCompressible and dynamic_energy_balance and dynamic_mass_balance then - V*(ddph*der(P) + ddhp*der(h - Xh2o*hr)) = BQ; + V*(ddph*der(P) + ddhp*der(h)) = BQ; else 0 = BQ; end if; @@ -243,13 +217,15 @@ equation P = Cs2.P; P = Cs3.P; P = Cs4.P; -/* Energy balance equation */ - BH = Ce1.Q*(Ce1.h - Ce1.Xh2o*hr) + Ce2.Q*(Ce2.h - Ce2.Xh2o*hr) + Ce3.Q*(Ce3.h - Ce3.Xh2o*hr) + Ce4.Q*(Ce4.h - Ce4.Xh2o*hr) - Cs1.Q*(Cs1.h - Cs1.Xh2o*hr) - Cs2.Q*(Cs2.h - Cs2.Xh2o*hr) - Cs3.Q*(Cs3.h - Cs3.Xh2o*hr) - Cs4.Q*(Cs4.h - Cs4.Xh2o*hr) + Cth.W + J; + + /* Energy balance equation */ + BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + Cth.W + J; + if dynamic_energy_balance then if dynamic_mass_balance then - V*(((h - Xh2o*hr)*ddph - 1)*der(P) + ((h - Xh2o*hr)*ddhp + rho)*der(h - Xh2o*hr)) = BH; + V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH; else - V*rho*der(h - Xh2o*hr) = BH; + V*rho*der(h) = BH; end if; else BH = 0; @@ -262,50 +238,38 @@ equation Cs2.h_vol_1 = h; Cs3.h_vol_1 = h; Cs4.h_vol_1 = h; -/* Fluid composition balance equations */ - BXco2 = Ce1.Xco2*Ce1.Q + Ce2.Xco2*Ce2.Q + Ce3.Xco2*Ce3.Q + Ce4.Xco2*Ce4.Q - Cs1.Xco2*Cs1.Q - Cs2.Xco2*Cs2.Q - Cs3.Xco2*Cs3.Q - Cs4.Xco2*Cs4.Q; - BXh2o = Ce1.Xh2o*Ce1.Q + Ce2.Xh2o*Ce2.Q + Ce3.Xh2o*Ce3.Q + Ce4.Xh2o*Ce4.Q - Cs1.Xh2o*Cs1.Q - Cs2.Xh2o*Cs2.Q - Cs3.Xh2o*Cs3.Q - Cs4.Xh2o*Cs4.Q; - BXo2 = Ce1.Xo2*Ce1.Q + Ce2.Xo2*Ce2.Q + Ce3.Xo2*Ce3.Q + Ce4.Xo2*Ce4.Q - Cs1.Xo2*Cs1.Q - Cs2.Xo2*Cs2.Q - Cs3.Xo2*Cs3.Q - Cs4.Xo2*Cs4.Q; - BXso2 = Ce1.Xso2*Ce1.Q + Ce2.Xso2*Ce2.Q + Ce3.Xso2*Ce3.Q + Ce4.Xso2*Ce4.Q - Cs1.Xso2*Cs1.Q - Cs2.Xso2*Cs2.Q - Cs3.Xso2*Cs3.Q - Cs4.Xso2*Cs4.Q; - if flue_gases then - if dynamic_composition_balance then - V*rho*der(Xco2) + Xco2*BQ = BXco2; - V*rho*der(Xh2o) + Xh2o*BQ = BXh2o; - V*rho*der(Xo2) + Xo2*BQ = BXo2; - V*rho*der(Xso2) + Xso2*BQ = BXso2; - else - Xco2*BQ = BXco2; - Xh2o*BQ = BXh2o; - Xo2*BQ = BXo2; - Xso2*BQ = BXso2; - end if; + + /* Fluid composition balance equations */ + BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q - Cs4.Xi*Cs4.Q; + + if dynamic_composition_balance then + V*rho*der(X) + X*BQ = BX; + else + X*BQ = BX; + end if; + + /* Traces composition balance equations */ + BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + Ce4.Q*Ce4.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC - Cs4.Q*Cs4.SubC; + + SubCSaS = SaS(); + if dynamic_mass_balance then + V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC; else - Xco2 = 0; - Xh2o = 0; - Xo2 = 0; - Xso2 = 0; + V*rho*SubCSaS = BSubC; end if; - Cs1.ftype = ftype; - Cs2.ftype = ftype; - Cs3.ftype = ftype; - Cs4.ftype = ftype; - Cs1.Xco2 = Xco2; - Cs1.Xh2o = Xh2o; - Cs1.Xo2 = Xo2; - Cs1.Xso2 = Xso2; - Cs2.Xco2 = Xco2; - Cs2.Xh2o = Xh2o; - Cs2.Xo2 = Xo2; - Cs2.Xso2 = Xso2; - Cs3.Xco2 = Xco2; - Cs3.Xh2o = Xh2o; - Cs3.Xo2 = Xo2; - Cs3.Xso2 = Xso2; - Cs4.Xco2 = Xco2; - Cs4.Xh2o = Xh2o; - Cs4.Xo2 = Xo2; - Cs4.Xso2 = Xso2; -/* Flow reversal */ + + Cs1.SubC = SubC; + Cs2.SubC = SubC; + Cs3.SubC = SubC; + Cs4.SubC = SubC; + + Cs1.Xi = X; + Cs2.Xi = X; + Cs3.Xi = X; + Cs4.Xi = X; + + + /* Flow reversal */ if continuous_flow_reversal then Cs1.h = ThermoSysPro.Functions.SmoothCond(Cs1.Q/gamma_s1, Cs1.h_vol_1, Cs1.h_vol_2, 1); Cs2.h = ThermoSysPro.Functions.SmoothCond(Cs2.Q/gamma_s2, Cs2.h_vol_1, Cs2.h_vol_2, 1); @@ -388,18 +352,22 @@ equation Cs4.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ if isCompressible and dynamic_mass_balance then - ddph = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + ddph = Medium.density_derp_h(state); + ddhp = Medium.density_derh_p(state); else ddph = 0; ddhp = 0; end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + state = Medium.setState_phX(p=P, h=h, X=X); + + T = Medium.temperature(state); + Cth.T = T; if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + rho = Medium.density(state); end if; annotation( Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-90, 0}, {90, 0}}, color = {0, 0, 255}), Line(points = {{0, 90}, {0, -100}}, color = {0, 0, 255}, thickness = 0.2), Ellipse(extent = {{-40, 80}, {40, 0}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}), Ellipse(extent = {{-40, 0}, {40, -80}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}), Rectangle(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 170, 255}), Line(points = {{-90, 80}, {-60, 80}, {-40, 46}}), Line(points = {{-90, -80}, {-60, -80}, {-40, -46}}), Line(points = {{92, 80}, {60, 80}, {40, 46}}), Line(points = {{92, -80}, {60, -80}, {40, -46}})}), From 7d96f31accfbcd4e2c4b4ff456656fb2fc0ea549 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:22:42 +0200 Subject: [PATCH 183/213] #125 port Fluid loop breakers and sensors medium support onto develop --- .../Fluid/LoopBreakers/LoopBreakerH.mo | 78 ++++++++--- .../Fluid/LoopBreakers/LoopBreakerP.mo | 78 ++++++++--- .../Fluid/LoopBreakers/LoopBreakerQ.mo | 78 ++++++++--- .../Fluid/LoopBreakers/LoopBreakerSubC.mo | 71 ++++++++++ .../Fluid/LoopBreakers/LoopBreakerXgas.mo | 70 +++++++--- ThermoSysPro/Fluid/LoopBreakers/package.order | 1 + ThermoSysPro/Fluid/Sensors/SensorH.mo | 90 +++++++++---- ThermoSysPro/Fluid/Sensors/SensorP.mo | 84 ++++++++---- ThermoSysPro/Fluid/Sensors/SensorQ.mo | 91 +++++++++---- ThermoSysPro/Fluid/Sensors/SensorQv.mo | 125 ++++++++++++------ ThermoSysPro/Fluid/Sensors/SensorSubC.mo | 80 +++++++++++ ThermoSysPro/Fluid/Sensors/SensorT.mo | 120 +++++++++++------ ThermoSysPro/Fluid/Sensors/SensorX.mo | 80 +++++++++++ ThermoSysPro/Fluid/Sensors/package.order | 2 + 14 files changed, 815 insertions(+), 233 deletions(-) create mode 100644 ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo create mode 100644 ThermoSysPro/Fluid/Sensors/SensorSubC.mo create mode 100644 ThermoSysPro/Fluid/Sensors/SensorX.mo diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo index 796f1555..c0b914c2 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo @@ -1,36 +1,74 @@ within ThermoSysPro.Fluid.LoopBreakers; - model LoopBreakerH "Specific enthalpy loop breaker" - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation + C1.Q = C2.Q; C1.P = C2.P; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {255, 255, 0}), Text(extent = {{-38, 38}, {42, -42}}, lineColor = {0, 0, 255}, textString = "h"), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {255, 255, 0}), Text(extent = {{-38, 38}, {42, -42}}, lineColor = {0, 0, 255}, textString = "h"), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255})}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-38,38},{42,-42}}, + lineColor={0,0,255}, + textString= + "h"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-38,38},{42,-42}}, + lineColor={0,0,255}, + textString= + "h"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Baligh El Hefni -Daniel Bouskela +Baligh El Hefni +Daniel Bouskela ")); -end LoopBreakerH; \ No newline at end of file +end LoopBreakerH; diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo index f05c8d99..8f75ad67 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo @@ -1,36 +1,74 @@ within ThermoSysPro.Fluid.LoopBreakers; - model LoopBreakerP "Pressure loop breaker" - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + +replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {255, 255, 0}), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255}), Text(extent = {{-40, 38}, {40, -42}}, lineColor = {0, 0, 255}, textString = "P")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {255, 255, 0}), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255}), Text(extent = {{-38, 38}, {42, -42}}, lineColor = {0, 0, 255}, textString = "P")}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Line(points={{0,100},{0,-100}}, color={0,0,255}), + Text( + extent={{-40,38},{40,-42}}, + lineColor={0,0,255}, + textString= + "P")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Line(points={{0,100},{0,-100}}, color={0,0,255}), + Text( + extent={{-38,38},{42,-42}}, + lineColor={0,0,255}, + textString= + "P")}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Baligh El Hefni -Daniel Bouskela +Baligh El Hefni +Daniel Bouskela ")); -end LoopBreakerP; \ No newline at end of file +end LoopBreakerP; diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo index 1479dfb5..f4e7b425 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo @@ -1,36 +1,74 @@ within ThermoSysPro.Fluid.LoopBreakers; - model LoopBreakerQ "Mass flow loop breaker" - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation + C1.P = C2.P; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {255, 255, 0}), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255}), Text(extent = {{-40, 38}, {40, -42}}, lineColor = {0, 0, 255}, textString = "Q")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 255, 0}), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255}), Text(extent = {{-40, 40}, {40, -40}}, lineColor = {0, 0, 255}, textString = "Q")}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={255,255,0}), + Line(points={{0,100},{0,-100}}, color={0,0,255}), + Text( + extent={{-40,38},{40,-42}}, + lineColor={0,0,255}, + textString= + "Q")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,255,0}), + Line(points={{0,100},{0,-100}}, color={0,0,255}), + Text( + extent={{-40,40},{40,-40}}, + lineColor={0,0,255}, + textString= + "Q")}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Baligh El Hefni -Daniel Bouskela +Baligh El Hefni +Daniel Bouskela ")); -end LoopBreakerQ; \ No newline at end of file +end LoopBreakerQ; diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo new file mode 100644 index 00000000..1939a3fd --- /dev/null +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo @@ -0,0 +1,71 @@ +within ThermoSysPro.Fluid.LoopBreakers; +model LoopBreakerSubC "Fluid Traces loop breaker" + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); +equation + + C1.Q = C2.Q; + C1.P = C2.P; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.SubC = C2.SubC; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-38,38},{42,-42}}, + lineColor={0,0,255}, + textString="C"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-40,38},{40,-42}}, + lineColor={0,0,255}, + textString="C"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), + Documentation(info = " +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + ", revisions = " +Authors + +Baligh El Hefni +Daniel Bouskela + + ")); +end LoopBreakerSubC; diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo index f5fcaf65..2c222e4f 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo @@ -1,33 +1,71 @@ within ThermoSysPro.Fluid.LoopBreakers; - model LoopBreakerXgas "Fluid composition loop breaker" - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation + C1.Q = C2.Q; C1.P = C2.P; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {255, 255, 0}), Text(extent = {{-38, 38}, {42, -42}}, lineColor = {0, 0, 255}, textString = "X"), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 100}, {100, 0}, {0, -100}, {-100, 0}, {0, 100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {255, 255, 0}), Text(extent = {{-40, 38}, {40, -42}}, lineColor = {0, 0, 255}, textString = "X"), Line(points = {{0, 100}, {0, -100}}, color = {0, 0, 255})}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + C1.Xi = C2.Xi; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-38,38},{42,-42}}, + lineColor={0,0,255}, + textString="X"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,100},{100,0},{0,-100},{-100,0},{0,100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={255,255,0}), + Text( + extent={{-40,38},{40,-42}}, + lineColor={0,0,255}, + textString="X"), + Line(points={{0,100},{0,-100}}, color={0,0,255})}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Baligh El Hefni -Daniel Bouskela +Baligh El Hefni +Daniel Bouskela ")); -end LoopBreakerXgas; \ No newline at end of file +end LoopBreakerXgas; diff --git a/ThermoSysPro/Fluid/LoopBreakers/package.order b/ThermoSysPro/Fluid/LoopBreakers/package.order index 4b729fa7..82432aa5 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/package.order +++ b/ThermoSysPro/Fluid/LoopBreakers/package.order @@ -2,3 +2,4 @@ LoopBreakerH LoopBreakerP LoopBreakerQ LoopBreakerXgas +LoopBreakerSubC diff --git a/ThermoSysPro/Fluid/Sensors/SensorH.mo b/ThermoSysPro/Fluid/Sensors/SensorH.mo index 83c4e5a9..0240fa77 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorH.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorH.mo @@ -1,41 +1,85 @@ within ThermoSysPro.Fluid.Sensors; - model SensorH "Specific enthalpy sensor" - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation( - Placement(transformation(origin = {0, 102}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -90}, {-90, -70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{92, -90}, {112, -70}}, rotation = 0))); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation + C1.P = C2.P; C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; -/* Sensor signal */ + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ Measure.signal = C1.h; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{0, -28}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 60}, {60, 0}}, lineColor = {0, 0, 0}, textString = "h")}), - Window(x = 0.62, y = 0.25, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {0, 255, 0}), Line(points = {{0, -28}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 60}, {60, 0}}, lineColor = {28, 108, 200}, fillColor = {0, 255, 0}, fillPattern = FillPattern.Solid, textString = "h")}), + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text( + extent={{-60,60},{60,0}}, + lineColor={0,0,0}, + textString="h")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text( + extent={{-60,60},{60,0}}, + lineColor={28,108,200}, + fillColor={0,255,0}, + fillPattern=FillPattern.Solid, + textString="h")}), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Daniel Bouskela -Baligh El Hefni +Daniel Bouskela +Baligh El Hefni ")); -end SensorH; \ No newline at end of file +end SensorH; diff --git a/ThermoSysPro/Fluid/Sensors/SensorP.mo b/ThermoSysPro/Fluid/Sensors/SensorP.mo index d4abbf1a..286166d9 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorP.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorP.mo @@ -1,41 +1,79 @@ within ThermoSysPro.Fluid.Sensors; - model SensorP "Pressure sensor" - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation( - Placement(transformation(origin = {0, 102}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -90}, {-90, -70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{92, -90}, {112, -70}}, rotation = 0))); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation + C1.P = C2.P; C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; -/* Sensor signal */ + + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; + + /* Sensor signal */ Measure.signal = C1.P; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{0, -28}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 60}, {60, 0}}, textString = "P")}), - Window(x = 0.62, y = 0.25, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {0, 255, 0}), Line(points = {{0, -28}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 60}, {60, 0}}, textString = "P")}), + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "P")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "P")}), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Daniel Bouskela -Baligh El Hefni +Daniel Bouskela +Baligh El Hefni ")); -end SensorP; \ No newline at end of file +end SensorP; diff --git a/ThermoSysPro/Fluid/Sensors/SensorQ.mo b/ThermoSysPro/Fluid/Sensors/SensorQ.mo index 855d1616..469a96f5 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQ.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQ.mo @@ -1,41 +1,86 @@ within ThermoSysPro.Fluid.Sensors; - model SensorQ "Mass flow sensor" - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation( - Placement(transformation(origin = {0, 102}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -90}, {-90, -70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{92, -90}, {112, -70}}, rotation = 0))); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation + C1.P = C2.P; C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; -/* Sensor signal */ + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ Measure.signal = C1.Q; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{0, -28}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 60}, {60, 0}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, textString = "Q")}), - Window(x = 0.25, y = 0.19, width = 0.6, height = 0.6), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {0, 255, 0}), Line(points = {{0, -28}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 60}, {60, 0}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {120, 255, 0}, textString = "Q")}), + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text( + extent={{-60,60},{60,0}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + textString = "Q")}), + Window( + x=0.25, + y=0.19, + width=0.6, + height=0.6), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text( + extent={{-60,60},{60,0}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={120,255,0}, + textString = "Q")}), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Daniel Bouskela -Baligh El Hefni +Daniel Bouskela +Baligh El Hefni ")); -end SensorQ; \ No newline at end of file +end SensorQ; diff --git a/ThermoSysPro/Fluid/Sensors/SensorQv.mo b/ThermoSysPro/Fluid/Sensors/SensorQv.mo index 7941fb24..671464eb 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorQv.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorQv.mo @@ -1,65 +1,102 @@ within ThermoSysPro.Fluid.Sensors; - model SensorQv "Volumetric flow sensor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Integer output_unit = 1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; - Units.SI.VolumeFlowRate Qv(start = 0.5) "Volume flow rate"; - Units.SI.AbsolutePressure Pm "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - Units.SI.Density rho(start = 998) "Fluid density"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation( - Placement(transformation(origin = {0, 102}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -90}, {-90, -70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{92, -90}, {112, -70}}, rotation = 0))); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s"; + protected - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - Units.SI.Time facteur = if (output_unit == 1) then 3600 else 1 "Unit factor"; + parameter Units.SI.Time facteur=if (output_unit == 1) then 3600 else 1 "Unit factor"; + +public + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; + Units.SI.Density rho(start=998) "Fluid density"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation + C1.P = C2.P; C1.h = C2.h; C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; - ftype = C1.ftype; -/* Sensor signal */ + + /* Sensor signal */ Qv = Q/rho; Measure.signal = Qv*facteur; -/* Fluid thermodynamic properties */ - Pm = (C1.P + C2.P)/2; - h = C1.h; - rho = ThermoSysPro.Properties.Fluid.Density_Ph(C1.P, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{0, -30}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 60}, {60, 0}}, lineColor = {0, 0, 0}, textString = "Qv")}), - Window(x = 0.3, y = 0.19, width = 0.6, height = 0.6), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {0, 255, 0}), Line(points = {{0, -30}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 64}, {60, 4}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid, textString = "Qv")}), + + /* Fluid thermodynamic properties */ + rho = Medium.density_phX(p=C1.P, h=C1.h, X=C1.Xi); + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-30},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text( + extent={{-60,60},{60,0}}, + lineColor={0,0,0}, + textString="Qv")}), + Window( + x=0.3, + y=0.19, + width=0.6, + height=0.6), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-30},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text( + extent={{-60,64},{60,4}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + textString = "Qv")}), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Daniel Bouskela -Baligh El Hefni +Daniel Bouskela +Baligh El Hefni ")); -end SensorQv; \ No newline at end of file +end SensorQv; diff --git a/ThermoSysPro/Fluid/Sensors/SensorSubC.mo b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo new file mode 100644 index 00000000..603834b7 --- /dev/null +++ b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo @@ -0,0 +1,80 @@ +within ThermoSysPro.Fluid.Sensors; +model SensorSubC "SubC sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nC] Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); +equation + + C1.P = C2.P; + C1.Q = C2.Q; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ + Measure.signal = C1.SubC; + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "C")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "C")}), + Documentation(info = " +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + ", revisions = " +Authors + +Daniel Bouskela +Baligh El Hefni + + ")); +end SensorSubC; diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo index 02635062..d55b15a6 100644 --- a/ThermoSysPro/Fluid/Sensors/SensorT.mo +++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo @@ -1,63 +1,95 @@ within ThermoSysPro.Fluid.Sensors; - model SensorT "Temperature sensor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Integer output_unit = 1 "Sensor outpu unit - 1: m3/h, other: m3/s"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + +public Units.SI.Temperature T "Fluid temperature"; - Units.SI.AbsolutePressure P "Fluid average pressure"; - Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure annotation( - Placement(transformation(origin = {0, 102}, extent = {{-10, -10}, {10, 10}}, rotation = 90), iconTransformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {0, 102}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -90}, {-90, -70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{92, -90}, {112, -70}}, rotation = 0))); -protected - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate Qeps = 1.e-3 "Minimum mass flow rate for continuous flow reversal"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,102}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); equation + C1.P = C2.P; C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - Q = C1.Q; - ftype = C1.ftype; -/* Sensor signal */ + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ Measure.signal = T; -/* Fluid thermodynamic properties */ - P = (C1.P + C2.P)/2; - h = (C1.h + C2.h)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Line(points = {{0, -30}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 64}, {60, 4}}, lineColor = {28, 108, 200}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid, textString = "T")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-60, 92}, {60, -28}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{0, -30}, {0, -80}}), Line(points = {{-98, -80}, {102, -80}}), Text(extent = {{-60, 64}, {60, 4}}, textString = "T")}), - Window(x = 0.22, y = 0.21, width = 0.6, height = 0.6), + + /* Fluid thermodynamic properties */ + T = Medium.temperature_phX(p=C1.P, h=C1.h, X=C1.Xi); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0}), + Line(points={{0,-30},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text( + extent={{-60,64},{60,4}}, + lineColor={28,108,200}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid, + textString= + "T")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-30},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,64},{60,4}}, textString= + "T")}), + Window( + x=0.22, + y=0.21, + width=0.6, + height=0.6), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Authors +Authors -Daniel Bouskela -Baligh El Hefni +Daniel Bouskela +Baligh El Hefni ")); -end SensorT; \ No newline at end of file +end SensorT; diff --git a/ThermoSysPro/Fluid/Sensors/SensorX.mo b/ThermoSysPro/Fluid/Sensors/SensorX.mo new file mode 100644 index 00000000..3700c6d2 --- /dev/null +++ b/ThermoSysPro/Fluid/Sensors/SensorX.mo @@ -0,0 +1,80 @@ +within ThermoSysPro.Fluid.Sensors; +model SensorX "X sensor" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); +public + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nXi] Measure + annotation (Placement(transformation( + origin={0,102}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-90},{-90,-70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{92,-90},{112,-70}}, rotation=0))); +equation + + C1.P = C2.P; + C1.Q = C2.Q; + C1.h = C2.h; + + C1.h_vol_1 = C2.h_vol_1; + C1.h_vol_2 = C2.h_vol_2; + + C2.diff_on_1 = C1.diff_on_1; + C1.diff_on_2 = C2.diff_on_2; + + C2.diff_res_1 = C1.diff_res_1; + C1.diff_res_2 = C2.diff_res_2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + + /* Sensor signal */ + Measure.signal = C1.Xi; + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "X")}), + Window( + x=0.62, + y=0.25, + width=0.35, + height=0.49), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-60,92},{60,-28}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={0,255,0}), + Line(points={{0,-28},{0,-80}}), + Line(points={{-98,-80},{102,-80}}), + Text(extent={{-60,60},{60,0}}, textString= + "X")}), + Documentation(info = " +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + ", revisions = " +Authors + +Daniel Bouskela +Baligh El Hefni + + ")); +end SensorX; diff --git a/ThermoSysPro/Fluid/Sensors/package.order b/ThermoSysPro/Fluid/Sensors/package.order index f2873124..eefb8c73 100644 --- a/ThermoSysPro/Fluid/Sensors/package.order +++ b/ThermoSysPro/Fluid/Sensors/package.order @@ -3,3 +3,5 @@ SensorQ SensorQv SensorH SensorT +SensorSubC +SensorX From aa730d5bf256b8a6213c71ff2a0b9bfbbf2426bd Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:26:39 +0200 Subject: [PATCH 184/213] #125 port Fluid pressure losses medium support onto develop --- ThermoSysPro/Fluid/PressureLosses/Bend.mo | 211 +++++++++++---- .../Fluid/PressureLosses/CheckValve.mo | 146 ++++++---- .../Fluid/PressureLosses/ControlValve.mo | 170 ++++++++---- .../Fluid/PressureLosses/Diaphragm.mo | 138 +++++++--- .../Fluid/PressureLosses/DynamicCheckValve.mo | 197 +++++++++----- .../PressureLosses/DynamicReliefValve.mo | 231 ++++++++++------ .../Fluid/PressureLosses/IdealCheckValve.mo | 109 ++++++-- .../Fluid/PressureLosses/IdealSwitchValve.mo | 111 ++++++-- .../PressureLosses/InvSingularPressureLoss.mo | 126 ++++++--- .../PressureLosses/LumpedStraightPipe.mo | 151 +++++++---- .../Fluid/PressureLosses/PipePressureLoss.mo | 126 ++++++--- .../PressureLosses/SingularPressureLoss.mo | 127 ++++++--- .../Fluid/PressureLosses/SwitchValve.mo | 147 ++++++++--- .../Fluid/PressureLosses/ThreeWayValve.mo | 249 ++++++++++++------ 14 files changed, 1540 insertions(+), 699 deletions(-) diff --git a/ThermoSysPro/Fluid/PressureLosses/Bend.mo b/ThermoSysPro/Fluid/PressureLosses/Bend.mo index 5a0b2a03..6d13fb05 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Bend.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Bend.mo @@ -1,26 +1,33 @@ within ThermoSysPro.Fluid.PressureLosses; - model Bend "Bend" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Diameter D = 0.2 "Pipe diameter"; - parameter Units.SI.Radius R0 = 0.2 "Pipe radius"; - parameter ThermoSysPro.Units.nonSI.Angle_deg delta = 90 "Pipe angle"; - parameter Real rugosrel = 0 "Pipe roughness"; - parameter Boolean K_A1_Tabule = true "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula"; - parameter Boolean K_B1_Tabule = true "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Diameter D=0.2 "Pipe diameter"; + parameter Units.SI.Radius R0=0.2 "Pipe radius"; + parameter Units.nonSI.Angle_deg delta=90 "Pipe angle"; + parameter Real rugosrel=0 "Pipe roughness"; + parameter Boolean K_A1_Tabule=true + "true: A1 is computed using linear interpolation - false: A1 is computed using correlation formula"; + parameter Boolean K_B1_Tabule=true + "true: B1 is computed using linear interpolation - false: B1 is computed using correlation formula"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Real pi=Modelica.Constants.pi "pi"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + +public Real khi "Hydraulic pressure loss coefficient"; Real khim "Singular pressure loss coefficient"; Real khif "Friction pressure loss coefficient"; Real kdelta "Roughness factor for the singular pressure loss"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Presure loss"; + Units.SI.PressureDifference deltaP "Presure loss"; Units.SI.MassFlowRate Q "Mass flow rate"; Units.SI.ReynoldsNumber Re "Reynolds number"; Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; @@ -33,80 +40,180 @@ model Bend "Bend" Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure Pm "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TA1(Table = [0, 0; 20, 0.31; 30, 0.45; 45, 0.60; 60, 0.78; 75, 0.90; 90, 1; 110, 1.13; 130, 1.20; 150, 1.28; 180, 1.40]) annotation( - Placement(transformation(extent = {{-20, 80}, {0, 100}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TB1(Table = [0.5, 1.18; 0.6, 0.77; 0.7, 0.51; 0.8, 0.37; 0.9, 0.28; 1, 0.21; 1.25, 0.19; 1.50, 0.17; 2, 0.15; 4, 0.11; 6, 0.09; 8, 0.07; 10, 0.07; 15, 0.06; 20, 0.05; 25, 0.05; 30, 0.04; 35, 0.04; 40, 0.03; 45, 0.03; 50, 0.03]) annotation( - Placement(transformation(extent = {{20, 80}, {40, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); -protected - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + Medium.ThermodynamicState state; + +public + ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TA1( + Table=[0, 0; 20, 0.31; 30, 0.45; 45, 0.60; 60, 0.78; + 75, 0.90; 90, 1; 110, 1.13; 130, 1.20; 150, 1.28; 180, 1.40]) + annotation (Placement(transformation(extent={{-20,80},{0,100}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1D TB1( + Table=[0.5, 1.18; 0.6, 0.77; 0.7, 0.51; 0.8, 0.37; + 0.9, 0.28; 1, 0.21; 1.25, 0.19; 1.50, 0.17; 2, 0.15; 4, 0.11; 6, 0.09; + 8, 0.07; 10, 0.07; 15, 0.06; 20, 0.05; 25, 0.05; 30, 0.04; 35, 0.04; 40, + 0.03; 45, 0.03; 50, 0.03]) annotation (Placement(transformation(extent= + {{20,80},{40,100}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,-110},{10,-90}}, rotation=0))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; C1.P - C2.P = deltaP; - ftype = C1.ftype; -/* Pressure loss */ + + /* Pressure loss */ deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho); -/* Coude ࠰arois concentriques (Idel'cik p. 192). Quadratic flow regime is assumed and Re > 2e5 (Re > Relim). */ + + /* Coude ࠰arois concentriques (Idel'cik p. 192). Quadratic flow regime is assumed and Re > 2e5 (Re > Relim). */ assert(R0/D > 0.5, "Coude: on doit avoir R0/D > 0.5"); - assert((delta > 0) and not (delta > 180), "Bend: parameter delta should be such as 0ࠦlt; delta <= 180°"); + assert((delta > 0) and not (delta > 180), + "Bend: parameter delta should be such as 0ࠦlt; delta <= 180°"); + khi = kdelta*khim + khif; + khim = yA1*yB1*yC1; + TA1.u.signal = delta; + if (K_A1_Tabule) then yA1 = TA1.y.signal; else - yA1 = if (delta < 70) then 0.9*sin(delta) else if (delta > 100) then 0.7 + 0.35*delta/90 else 1.0; + yA1 = if (delta < 70) then 0.9*sin(delta) else if (delta > 100) then 0.7 + + 0.35*delta/90 else 1.0; end if; + TB1.u.signal = R0/D; + if (K_B1_Tabule) then yB1 = TB1.y.signal; else yB1 = if (R0/D < 1) then 0.21/(R0/D)^2.5 else 0.21/(R0/D)^0.5; end if; + yC1 = 1; - kdelta = if ((rugosrel < 0.001)) and (R0/D < 1.5) then 1.0 + 1.e3*rugosrel else if (rugosrel < 0.001) then 1.0 + 1.e6*rugosrel^2 else 2.0; + + kdelta = if ((rugosrel < 0.001)) and (R0/D < 1.5) then 1.0 + 1.e3*rugosrel else + if (rugosrel < 0.001) then 1.0 + 1.e6*rugosrel^2 else 2.0; + khif = 0.0175*lambda*R0*delta/D; + if (rugosrel > 0.00005) then lambda = 1/(2*Modelica.Math.log10(3.7/rugosrel))^2; else - lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0; + lambda = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else + 0; end if; + Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 2.e5; + Re = 4*abs(Q)/(pi*D*mu); -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density(state); end if; - mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {-20, -20}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Rectangle(extent = {{-20, -18}, {20, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Polygon(points = {{-20, 20}, {-12, 20}, {-2, 18}, {6, 14}, {12, 10}, {18, 2}, {20, -6}, {20, -18}, {-20, 20}}, lineColor = {28, 108, 200}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-20, 20}, {-20, -20}, {20, -18}, {-20, 20}}, lineColor = {127, 255, 0}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-30, -20}, {-24, -22}, {-22, -24}, {-20, -28}, {-20, -20}, {-30, -20}}, lineColor = {192, 192, 192}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{-30, -20}, {-24, -22}, {-22, -24}, {-20, -28}}, color = {28, 108, 200})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {-20, -20}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Rectangle(extent = {{-20, -18}, {20, -100}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Polygon(points = {{-20, 20}, {-12, 20}, {-2, 18}, {6, 14}, {12, 10}, {18, 2}, {20, -6}, {20, -20}, {-20, 20}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Polygon(points = {{-20, 20}, {-20, -20}, {20, -20}, {-20, 20}}, lineColor = {127, 255, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Polygon(points = {{-30, -20}, {-24, -22}, {-22, -24}, {-20, -28}, {-20, -20}, {-30, -20}}, lineColor = {0, 255, 0}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), lineThickness = 0.5, fillPattern = FillPattern.Solid), Line(points = {{-30, -20}, {-24, -22}, {-22, -24}, {-20, -28}})}), - Window(x = 0.04, y = 0.1, width = 0.84, height = 0.67), + + state=Medium.setState_phX(p=Pm, h=h, X=X); + mu = Medium.dynamicViscosity(state); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,20},{-20,-20}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0}), + Rectangle( + extent={{-20,-18},{20,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0}), + Polygon( + points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20, + -18},{-20,20}}, + lineColor={28,108,200}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-20,20},{-20,-20},{20,-18},{-20,20}}, + lineColor={127,255,0}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}}, + lineColor={192,192,192}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid), + Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}}, color={28,108, + 200})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,20},{-20,-20}}, + lineColor={0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Rectangle( + extent={{-20,-18},{20,-100}}, + lineColor={0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Polygon( + points={{-20,20},{-12,20},{-2,18},{6,14},{12,10},{18,2},{20,-6},{20,-20}, + {-20,20}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Polygon( + points={{-20,20},{-20,-20},{20,-20},{-20,20}}, + lineColor={127,255,0}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Polygon( + points={{-30,-20},{-24,-22},{-22,-24},{-20,-28},{-20,-20},{-30,-20}}, + lineColor={0,255,0}, + fillColor= DynamicSelect({127,255,0}, fill_color_singular), + lineThickness=0.5, + fillPattern=FillPattern.Solid), + Line(points={{-30,-20},{-24,-22},{-22,-24},{-20,-28}})}), + Window( + x=0.04, + y=0.1, + width=0.84, + height=0.67), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -118,4 +225,4 @@ Daniel Bouskela Baligh El Hefni ")); -end Bend; \ No newline at end of file +end Bend; diff --git a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo index 970bf0c6..03260ab8 100644 --- a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo @@ -1,78 +1,127 @@ within ThermoSysPro.Fluid.PressureLosses; - model CheckValve "Check valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert = 10 "Pressure difference when the valve opens"; - parameter ThermoSysPro.Units.SI.PressureDifference dPFerme = 0 "Pressure difference when the valve closes"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k = 1000 "Pressure loss coefficient"; - parameter Units.SI.MassFlowRate Qmin = 1.e-6 "Mass flow when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Boolean ouvert(start = true, fixed = true) "Valve state"; - discrete Boolean touvert(start = false, fixed = true); - discrete Boolean tferme(start = false, fixed = true); - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-120, -10}, {-100, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{100, -10}, {120, 10}}, rotation = 0))); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.PressureDifference dPOuvert=10 + "Pressure difference when the valve opens"; + parameter Units.SI.PressureDifference dPFerme=0 + "Pressure difference when the valve closes"; + parameter Units.xSI.PressureLossCoefficient k=1000 + "Pressure loss coefficient"; + parameter Units.SI.MassFlowRate Qmin=1.e-6 + "Mass flow when the valve is closed"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + +public + Boolean ouvert(start=true, fixed=true) "Valve state"; + discrete Boolean touvert(start=false, fixed=true); + discrete Boolean tferme(start=false, fixed=true); + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-120,-10},{-100,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{100,-10},{120,10}}, rotation=0))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Pressure loss */ + + /* Pressure loss */ if ouvert then deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0; else Q - Qmin = 0; end if; + touvert = (deltaP > dPOuvert); tferme = (deltaP < dPFerme); - when {pre(tferme), pre(touvert)} then + + when {pre(tferme),pre(touvert)} then ouvert = pre(touvert); end when; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-70, 70}, {-50, 50}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {0, 0, 255}), Line(points = {{-60, -60}, {-60, 60}, {60, -60}, {60, 60}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{-100, 0}, {-60, 0}}), Line(points = {{60, 0}, {100, 0}})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-60, -60}, {-60, 60}, {60, -60}, {60, 60}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{-100, 0}, {-60, 0}}), Line(points = {{60, 0}, {100, 0}}), Ellipse(extent = {{-70, 70}, {-50, 50}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular))}), - Window(x = 0.09, y = 0.05, width = 0.91, height = 0.92), + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-70,70},{-50,50}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={0,0,255}), + Line( + points={{-60,-60},{-60,60},{60,-60},{60,60}}, + color={0,203,0}, + thickness=0.5), + Line(points={{-100,0},{-60,0}}), + Line(points={{60,0},{100,0}})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line( + points={{-60,-60},{-60,60},{60,-60},{60,60}}, + color={0,203,0}, + thickness=0.5), + Line(points={{-100,0},{-60,0}}), + Line(points={{60,0},{100,0}}), + Ellipse( + extent={{-70,70},{-50,50}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular))}), + Window( + x=0.09, + y=0.05, + width=0.91, + height=0.92), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -82,6 +131,5 @@ Author Daniel Bouskela - "), - DymolaStoredErrors); -end CheckValve; \ No newline at end of file + ")); +end CheckValve; diff --git a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo index 7ee2674b..d7925da4 100644 --- a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo @@ -1,58 +1,78 @@ within ThermoSysPro.Fluid.PressureLosses; - model ControlValve "Control valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; +extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.xSI.Cv Cvmax = 8005.42 "Maximum CV [USG/min] (active if mode_caract=0)"; - parameter Real caract[:, 2] = [0, 0; 1, Cvmax] "Position vs. Cv [USG/min] characteristics (active if mode_caract=1)"; - parameter Integer mode_caract = 0 "0:linear characteristics - 1:characteristics is given by caract[]"; - parameter Integer option_interpolation = 1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)"; - parameter Integer option_rho_water = 1 "1: using (deltaP*Cv^2=A.Q^2/rho^2) - 2: using (deltaP*Cv^2=A.Q^2/(rho*rho_15)); with rho_15 is the density of the water at 15.5556 °C)"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - ThermoSysPro.Units.xSI.Cv Cv(start = 100) "Cv [USG/min]"; - Units.SI.MassFlowRate Q(start = 100) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -70}, {-90, -50}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -70}, {110, -50}}, rotation = 0))); + + parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 + "Maximum CV (active if mode_caract=0)"; + parameter Real caract[:, 2]=[0, 0; 1, Cvmax] + "Position vs. Cv characteristics (active if mode_caract=1)"; + parameter Integer mode_caract=0 + "0:linear characteristics - 1:characteristics is given by caract[]"; + parameter Integer option_interpolation=1 + "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)"; + parameter Integer option_rho_water=1 + "1: using (deltaP*Cv^2=A.Q^2/rho^2) - 2: using (deltaP*Cv^2=A.Q^2/(rho*rho_15)); with rho_15 is the density of the water at 15.5556 °C)"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; - parameter Units.SI.Density rho_15 = 999 "density of the water at 15.5556 °C"; + parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + parameter Units.SI.Density rho_15=999 "density of the water at 15.5556 °C"; + +public + ThermoSysPro.Units.xSI.Cv Cv(start=100) "Cv"; + Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; + ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Fluid average pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv + annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-70},{-90,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-70},{110,-50}}, rotation=0))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Pressure loss */ + + + + /* Pressure loss */ if (option_rho_water == 1) then deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2; elseif (option_rho_water == 2) then @@ -60,7 +80,8 @@ equation else assert(false, "ControlValve - option_rho_water: invalid option"); end if; -/* Cv as a function of the valve position */ + + /* Cv as a function of the valve position */ if (mode_caract == 0) then Cv = Ouv.signal*Cvmax; elseif (mode_caract == 1) then @@ -74,18 +95,73 @@ equation else assert(false, "ControlValve: invalid option"); end if; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{40, 40}, {-40, 40}, {-40, 56}, {-38, 74}, {-32, 84}, {-20, 94}, {0, 100}, {20, 94}, {32, 84}, {38, 72}, {40, 54}, {40, 40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {40, 40}, {-40, 40}, {0, -60}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Polygon(points = {{-100, -100}, {0, -60}, {-100, -20}, {-100, -102}, {-100, -100}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {100, -20}, {100, -102}, {0, -60}, {0, -60}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid)}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, -100}, {0, -60}, {-100, -20}, {-100, -102}, {-100, -100}}, lineColor = {0, 0, 255}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {100, -20}, {100, -102}, {0, -60}, {0, -60}}, lineColor = {0, 0, 255}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{40, 40}, {-40, 40}, {-40, 56}, {-38, 74}, {-32, 84}, {-20, 94}, {0, 100}, {20, 94}, {32, 84}, {38, 72}, {40, 54}, {40, 40}}, lineColor = {0, 0, 255}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {40, 40}, {-40, 40}, {0, -60}}, lineColor = {0, 0, 255}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid)}), - Window(x = 0.07, y = 0.13, width = 0.8, height = 0.77), + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100}, + {20,94},{32,84},{38,72},{40,54},{40,40}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{40,40},{-40,40},{0,-60}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Polygon( + points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid)}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-100,-100},{0,-60},{-100,-20},{-100,-102},{-100,-100}}, + lineColor={0,0,255}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{100,-20},{100,-102},{0,-60},{0,-60}}, + lineColor={0,0,255}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100}, + {20,94},{32,84},{38,72},{40,54},{40,40}}, + lineColor={0,0,255}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{40,40},{-40,40},{0,-60}}, + lineColor={0,0,255}, + fillColor={127,255,0}, + fillPattern=FillPattern.Solid)}), + Window( + x=0.07, + y=0.13, + width=0.8, + height=0.77), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 diff --git a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo index cef96f85..7a2ffb3f 100644 --- a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo +++ b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo @@ -1,19 +1,21 @@ within ThermoSysPro.Fluid.PressureLosses; - model Diaphragm "Diaphragm" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real Ouv = 0.5 "Diaphragm aperture"; - parameter Units.SI.Diameter D = 0.2 "Diaphragm diameter"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real Ouv=0.5 "Diaphragm aperture"; + parameter Units.SI.Diameter D=0.2 "Diaphragm diameter"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Real pi=Modelica.Constants.pi "pi"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + +public Real khi "Hydraulic pressure loss coefficient"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss"; + Units.SI.PressureDifference deltaP "Pressure loss"; Units.SI.MassFlowRate Q "Mass flow rate"; Units.SI.ReynoldsNumber Re "Reynolds number"; Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; @@ -22,54 +24,110 @@ model Diaphragm "Diaphragm" Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure Pm "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + Medium.ThermodynamicState state; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; C1.P - C2.P = deltaP; - ftype = C1.ftype; -/* Pressure loss */ + + /* Pressure loss */ deltaP = 8*khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(pi^2*D^4*rho); -/* Diaphragme avec ouvertures à arêtes vives (Idel'cik p. 103). One assumes that Re > 1.e5 (Re > Relim) */ + + /* Diaphragme avec ouvertures à arêtes vives (Idel'cik p. 103). One assumes that Re > 1.e5 (Re > Relim) */ assert((Ouv > 0) and not (Ouv > 1), "Diaphragm: parameter Ouv should be such as 0 < Ouv <= 1"); + khi = ((1.707 - Ouv)/Ouv)^2; + Relim = 1.e5; + Re = 4*abs(Q)/(pi*D*mu*Ouv); -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature(state); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density(state); end if; - mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-40, 100}, {-40, 20}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{-40, -20}, {-40, -100}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{40, 100}, {40, 18}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{40, -20}, {40, -100}}, color = {0, 203, 0}, thickness = 0.5)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-40, 100}, {-40, 20}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{-40, -20}, {-40, -100}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{40, 100}, {40, 18}}, color = {0, 203, 0}, thickness = 0.5), Line(points = {{40, -20}, {40, -100}}, color = {0, 203, 0}, thickness = 0.5)}), - Window(x = 0.13, y = 0.05, width = 0.73, height = 0.73), + + state=Medium.setState_phX(p=Pm, h=h, X=X); + mu = Medium.dynamicViscosity(state); + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line( + points={{-40,100},{-40,20}}, + color={0,203,0}, + thickness=0.5), + Line( + points={{-40,-20},{-40,-100}}, + color={0,203,0}, + thickness=0.5), + Line( + points={{40,100},{40,18}}, + color={0,203,0}, + thickness=0.5), + Line( + points={{40,-20},{40,-100}}, + color={0,203,0}, + thickness=0.5)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line( + points={{-40,100},{-40,20}}, + color= {0,203,0}, + thickness=0.5), + Line( + points={{-40,-20},{-40,-100}}, + color= {0,203,0}, + thickness=0.5), + Line( + points={{40,100},{40,18}}, + color= {0,203,0}, + thickness=0.5), + Line( + points={{40,-20},{40,-100}}, + color= {0,203,0}, + thickness=0.5)}), + Window( + x=0.13, + y=0.05, + width=0.73, + height=0.73), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -80,4 +138,4 @@ Author Daniel Bouskela ")); -end Diaphragm; \ No newline at end of file +end Diaphragm; diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo index e734b560..30fd4031 100644 --- a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo @@ -1,63 +1,64 @@ within ThermoSysPro.Fluid.PressureLosses; - model DynamicCheckValve "Dynamic check valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.xSI.Cv Cvmax = 8005.42 "Maximum CV [USG/min]"; - parameter Real caract[:, 2] = [0, 0; 1, Cvmax] "Position vs. Cv [USG/min] characteristics (active if mode_caract=1)"; - parameter Units.SI.MomentOfInertia J = 1 "Flap moment of inertia"; - parameter Real Kf1 = 0 "Flap friction law coefficient #1"; - parameter Real Kf2 = 100 "Flap friction law coefficient #2"; - parameter Real n = 5 "Flap friction law exponent"; - parameter Units.SI.Mass m = 1 "Flap mass"; - parameter Units.SI.Area A = 1 "Flap hydraulic area"; - parameter Integer mode_caract = 0 "0:linear characteristics - 1:characteristics is given by caract[]" annotation( - Evaluate = true); - parameter Integer option_interpolation = 1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation( - Evaluate = true, - Dialog(enable = (mode_caract == 1))); - parameter Boolean mech_steady_state = true "true: start from mechanical steady state - false: start from 0"; - parameter Real Ouv0 = 0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if mech_steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not mech_steady_state)); - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Boolean libre(start = true) "Indicator whether the flap is free to move in both directions"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.xSI.Cv Cvmax=8005.42 "Maximum CV"; + parameter Real caract[:, 2]=[0, 0; 1, Cvmax] + "Position vs. Cv characteristics (active if mode_caract=1)"; + parameter Units.SI.MomentOfInertia J=1 "Flap moment of inertia"; + parameter Real Kf1=0 "Flap friction law coefficient #1"; + parameter Real Kf2=100 "Flap friction law coefficient #2"; + parameter Real n=5 "Flap friction law exponent"; + parameter Units.SI.Mass m=1 "Flap mass"; + parameter Units.SI.Area A=1 "Flap hydraulic area"; + parameter Integer mode_caract=0 "0:linear characteristics - 1:characteristics is given by caract[]" annotation(Evaluate=true); + parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1))); + parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0"; + parameter Real Ouv0=0 "Initial valve position, between 0 and 1. 0:valve closed - 1: valve open (active if mech_steady_state=false)" annotation(Evaluate=true, Dialog(enable=not mech_steady_state)); + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Real pi=Modelica.Constants.pi "pi"; + parameter Units.SI.Acceleration g=Modelica.Constants.g_n + "Gravity constant"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius"; + parameter Units.SI.Angle theta_min=0 + "Minimum flap aperture angle"; + parameter Units.SI.Angle theta_max=pi/2 + "Maximum flap aperture angle"; + parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2; + +public + Boolean libre(start=true) + "Indicator whether the flap is free to move in both directions"; Units.SI.Torque Cp "Gravity torque"; Units.SI.Torque Cf "Friction torque"; Units.SI.Torque Ch "Hydraulic torque"; Units.SI.Torque Ct "Total torque"; - Units.SI.Angle theta(start = theta_m) "Flap aperture angle"; + Units.SI.Angle theta(start=theta_m) "Flap aperture angle"; Units.SI.AngularVelocity omega "Flap angular speed"; Units.SI.AngularAcceleration a "Flap angular acceleration"; Real Ouv "Valve position"; - ThermoSysPro.Units.xSI.Cv Cv(start = Cvmax) "Cv [USG/min]"; - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Fluid average pressrue"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - constant Real pi = Modelica.Constants.pi "pi"; - parameter Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; - parameter Units.SI.Radius r = sqrt(A/pi) "Flap radius"; - parameter Units.SI.Angle theta_min = 0 "Minimum flap aperture angle"; - parameter Units.SI.Angle theta_max = pi/2 "Maximum flap aperture angle"; - parameter Units.SI.Angle theta_m = (theta_min + theta_max)/2; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; + Units.xSI.Cv Cv(start=Cvmax) "Cv"; + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressrue"; + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); initial equation if mech_steady_state then der(theta) = 0; @@ -67,44 +68,61 @@ initial equation theta = acos(1 - Ouv0); omega = 0; end if; + equation + C1.h = C2.h; C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Flap angle */ + + /* Flap angle */ Ouv = 1 - cos(theta); + omega = der(theta); a = der(omega); + Cp = -m*g*r*sin(theta); Cf = -sign(omega)*(Kf1 + Kf2*abs(omega)^n); Ch = deltaP*r*A*cos(theta); + Ct = Cp + Cf + Ch; - libre = ((theta > theta_min) and (theta < theta_max)) or ((theta <= theta_min) and (Ct > 0)) or ((theta >= theta_max) and (Ct < 0)); + + libre = ((theta > theta_min) and (theta < theta_max)) or ((theta <= theta_min) + and (Ct > 0)) or ((theta >= theta_max) and (Ct < 0)); + if libre then J*a = Ct; else a = 0; end if; - when {theta <= theta_min, theta >= theta_max} then + + when {theta <= theta_min,theta >= theta_max} then reinit(omega, 0); end when; -/* Pressure loss */ - deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho^2; -/* Cv as a function of the valve position */ + + /* Pressure loss */ + deltaP*Cv*abs(Cv) = 1.733e12*ThermoSysPro.Functions.ThermoSquare(Q, eps)/ + rho^2; + + /* Cv as a function of the valve position */ if (mode_caract == 0) then Cv = Ouv*Cvmax; elseif (mode_caract == 1) then @@ -118,18 +136,57 @@ equation else assert(false, "ClapetDyn : mode de calcul du Cv incorrect"); end if; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-70, 70}, {-50, 50}}, lineColor = {170, 85, 255}, fillColor = {170, 85, 255}, fillPattern = FillPattern.Solid), Line(points = {{-60, -60}, {-60, 60}, {60, -60}, {60, 60}}, color = {170, 85, 255}, thickness = 0.5), Line(points = {{-100, 0}, {-60, 0}}), Line(points = {{60, 0}, {100, 0}}), Text(extent = {{-28, 80}, {32, 20}}, textString = "D")}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-70, 70}, {-50, 50}}, lineColor = {170, 85, 255}, fillColor = {170, 85, 255}, fillPattern = FillPattern.Solid), Line(points = {{-60, -60}, {-60, 60}, {60, -60}, {60, 60}}, color = {170, 85, 255}, thickness = 0.5), Line(points = {{-100, 0}, {-60, 0}}), Line(points = {{60, 0}, {100, 0}}), Text(extent = {{-28, 80}, {32, 20}}, textString = "D")}), - Window(x = 0.08, y = 0.01, width = 0.81, height = 0.87), + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-70,70},{-50,50}}, + lineColor={170,85,255}, + fillColor={170,85,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-60,-60},{-60,60},{60,-60},{60,60}}, + color={170,85,255}, + thickness=0.5), + Line(points={{-100,0},{-60,0}}), + Line(points={{60,0},{100,0}}), + Text(extent={{-28,80},{32,20}}, textString= + "D")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-70,70},{-50,50}}, + lineColor={170,85,255}, + fillColor={170,85,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-60,-60},{-60,60},{60,-60},{60,60}}, + color={170,85,255}, + thickness=0.5), + Line(points={{-100,0},{-60,0}}), + Line(points={{60,0},{100,0}}), + Text(extent={{-28,80},{32,20}}, textString= + "D")}), + Window( + x=0.08, + y=0.01, + width=0.81, + height=0.87), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo index 6579b727..0cbf2b52 100644 --- a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo @@ -1,75 +1,81 @@ within ThermoSysPro.Fluid.PressureLosses; - model DynamicReliefValve "Dynamic relief valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.AbsolutePressure Popen = 3e5 "Pressure that opens the valve"; - parameter Units.SI.AbsolutePressure Pout = 1e5 "Pressure at the valve outlet (for sizing)"; - parameter ThermoSysPro.Units.xSI.Cv Cvmax = 8005.42 "Maximum Cv [USG/min]"; - parameter Real caract[:, 2] = [0, 0; 1, Cvmax] "Position vs. Cv [USG/min] characteristics (active if mode_caract=1)"; - parameter Units.SI.Area A1 = 0.1 "Hydraulic area upstream the clapper"; - parameter Units.SI.Area A2 = 0.125 "Hydraulic area downstream the clapper"; - parameter Units.SI.Area clapper_area[:, 2] = [0, A1; 0.01, A2; 1, A2] "Clapper area as a function of the clapper elevation"; - parameter Real D = 1 "Damping"; - parameter Units.SI.Mass m = 1 "Valve mass"; - parameter Units.SI.Length z_max = 0.1 "Maximum clapper elevation"; - parameter Real Ke = 62500 "Valve spring stiffness"; - parameter Real Cd = 0 "Drag coefficient of the clapper"; - parameter Integer mode_caract = 0 "0:linear characteristics - 1:characteristics is given by caract[] - 2:characteristics for conic clapper" annotation( - Evaluate = true); - parameter Integer option_interpolation = 1 "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation( - Evaluate = true, - Dialog(enable = (mode_caract == 1))); - parameter Boolean mech_steady_state = true "true: start from mechanical steady state - false: start from 0" annotation( - Evaluate = true); - parameter Units.SI.Length z0 = 0 "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if mech_steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not mech_steady_state)); - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Boolean clapper_is_free(start = true) "true if clapper is free to move in both directions, false otherwise"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.AbsolutePressure Popen=3e5 + "Pressure that opens the valve"; + parameter Units.SI.AbsolutePressure Pout=1e5 + "Pressure at the valve outlet (for sizing)"; + parameter Units.xSI.Cv Cvmax=8005.42 "Maximum Cv"; + parameter Real caract[:, 2]=[0, 0; 1, Cvmax] "Position vs. Cv characteristics (active if mode_caract=1)"; + parameter Units.SI.Area A1=0.1 + "Hydraulic area upstream the clapper"; + parameter Units.SI.Area A2=0.125 + "Hydraulic area downstream the clapper"; + parameter Units.SI.Area clapper_area[:,2]=[0,A1; 0.01,A2; 1,A2] + "Clapper area as a function of the clapper elevation"; + parameter Real D=1 "Damping"; + parameter Units.SI.Mass m=1 "Valve mass"; + parameter Units.SI.Length z_max=0.1 "Maximum clapper elevation"; + parameter Real Ke=62500 "Valve spring stiffness"; + parameter Real Cd=0 "Drag coefficient of the clapper"; + parameter Integer mode_caract=0 + "0:linear characteristics - 1:characteristics is given by caract[] - 2:characteristics for conic clapper" annotation(Evaluate=true); + parameter Integer option_interpolation=1 + "1: linear interpolation - 2: spline interpolation (active if mode_caract=1)" annotation(Evaluate=true, Dialog(enable=(mode_caract == 1))); + parameter Boolean mech_steady_state=true "true: start from mechanical steady state - false: start from 0" annotation(Evaluate=true); + parameter Units.SI.Length z0=0 + "Initial clapper elevation, between 0 and z_max. 0:valve closed - z_max: valve fully open (active if mech_steady_state=false)" + annotation (Evaluate=true, Dialog(enable=not mech_steady_state)); + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n + "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + constant Units.SI.Density rho60F=998.98 "Water density at 60°F"; + constant Real K=1.733e12 "Valve constant"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + parameter Units.SI.Length z_min=0 "Minimum clapper elevation"; + +public + Boolean clapper_is_free(start=true) "true if clapper is free to move in both directions, false otherwise"; Units.SI.Force Fp "Gravity force"; Units.SI.Force Fr "Spring force"; Units.SI.Force Fd "Damping force"; Units.SI.Force Fh "Hydraulic force"; Units.SI.Force Fdyn "Dynamic pressure force"; Units.SI.Force Ft "Total force"; - Units.SI.Length z(start = z_min) "Clapper elevation"; - Units.SI.Velocity v = der(z) "Clapper velocity"; - Units.SI.Acceleration a = der(v) "Clapper acceleration"; + Units.SI.Length z(start=z_min) "Clapper elevation"; + Units.SI.Velocity v=der(z) "Clapper velocity"; + Units.SI.Acceleration a=der(v) "Clapper acceleration"; Real Ouv "Valve position"; Units.SI.Area A "Hydraulic area upstream the clapper"; Units.SI.Force Fr_min "Spring force when valve is closed"; - ThermoSysPro.Units.xSI.Cv Cv "Cv [USG/min]"; - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; + Units.xSI.Cv Cv "Cv"; + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; Units.SI.AbsolutePressure Pdyn "Dynamic pressure on the clapper"; Units.SI.Velocity vh "Fluid velocity through the valve"; Units.SI.Energy Wdyn "Dissipated fluid kinetic energy"; - Real Re = rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-10, -108}, {10, -88}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0), iconTransformation(extent = {{90, -10}, {110, 10}}))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - constant Units.SI.Density rho60F = 998.98 "Water density at 60°F"; - constant Real K = 1.733e12 "Valve constant"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; - parameter Units.SI.Length z_min = 0 "Minimum clapper elevation"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; + Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-10,-108},{10,-88}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0), + iconTransformation(extent={{90,-10},{110,10}}))); initial equation if mech_steady_state then der(z) = 0; @@ -78,58 +84,78 @@ initial equation z = z0; der(z) = 0; end if; + Wdyn = 0; + equation C1.h = C2.h; C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Hydraulic area upstream the clapper. It varies as a function of the valve elevation + + + /* Hydraulic area upstream the clapper. It varies as a function of the valve elevation between A1 (valve closed) and A2 (valve open) with a hysteresis */ A = ThermoSysPro.Functions.SplineInterpolation(clapper_area[:, 1], clapper_area[:, 2], z - z_min); -/* Dynamic pressure on the valve */ + + /* Dynamic pressure on the valve */ Pdyn = Cd*rho/2*(vh - v)^2; -/* Dissipated kinetic energy */ + + /* Dissipated kinetic energy */ der(Wdyn) = Fdyn*v; -/* Fluid velocity through the valve */ + + /* Fluid velocity through the valve */ rho*vh*A = Q; -/* Force balance */ + + /* Force balance */ Fp = -m*g; Fr = -Ke*(z - z_min) + Fr_min; Fd = -D*v; Fh = C1.P*A - C2.P*A2; Fdyn = sign(vh - v)*Pdyn*A; Ft = Fp + Fr + Fd + Fh + Fdyn; -/* Newton's law */ + + /* Newton's law */ clapper_is_free = ((z > z_min) and (z < z_max)) or ((z <= z_min) and (Ft > 0)) or ((z >= z_max) and (Ft < 0)); + if clapper_is_free then m*a = Ft; else a = 0; end if; - when {z <= z_min, z >= z_max} then + + when {z <= z_min,z >= z_max} then reinit(v, 0); end when; -/* Pressure that opens the valve */ + + /* Pressure that opens the valve */ m*g - Fr_min = Popen*A1 - Pout*A2; -/* Valve position */ + + /* Valve position */ Ouv = (z - z_min)/(z_max - z_min); -/* Pressure loss */ + + /* Pressure loss */ deltaP*Cv*abs(Cv) = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho60F); -/* Cv as a function of the valve position */ + + /* Cv as a function of the valve position */ if (mode_caract == 0) then Cv = Ouv*Cvmax; elseif (mode_caract == 1) then @@ -145,18 +171,59 @@ equation else assert(false, "DynamicReliefValve : incorrect Cv computation mode"); end if; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 0}, {-30, -60}, {30, -60}, {0, 0}}, lineColor = {28, 108, 200}, fillColor = {170, 85, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{0, 0}, {60, -30}, {60, 30}, {0, 0}}, lineColor = {28, 108, 200}, fillColor = {170, 85, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, -60}, {0, -98}}), Line(points = {{60, 0}, {90, 0}}), Line(points = {{0, 0}, {10, 10}, {-10, 20}, {10, 28}, {-10, 40}, {10, 50}, {-10, 60}, {10, 70}}, color = {170, 85, 255})}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{0, 0}, {-30, -60}, {30, -60}, {0, 0}}, lineColor = {28, 108, 200}, fillColor = {170, 85, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{0, 0}, {60, -30}, {60, 30}, {0, 0}}, lineColor = {28, 108, 200}, fillColor = {170, 85, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, -60}, {0, -98}}), Line(points = {{60, 0}, {90, 0}}), Line(points = {{0, 0}, {10, 10}, {-10, 20}, {10, 28}, {-10, 40}, {10, 50}, {-10, 60}, {10, 70}})}), - Window(x = 0.12, y = 0.05, width = 0.8, height = 0.77), + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,0},{-30,-60},{30,-60},{0,0}}, + lineColor={28,108,200}, + fillColor={170,85,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,0},{60,-30},{60,30},{0,0}}, + lineColor={28,108,200}, + fillColor={170,85,255}, + fillPattern=FillPattern.Solid), + Line(points={{0,-60},{0,-98}}), + Line(points={{60,0},{90,0}}), + Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{ + 10,70}}, color={170,85,255})}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{0,0},{-30,-60},{30,-60},{0,0}}, + lineColor={28,108,200}, + fillColor={170,85,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,0},{60,-30},{60,30},{0,0}}, + lineColor={28,108,200}, + fillColor={170,85,255}, + fillPattern=FillPattern.Solid), + Line(points={{0,-60},{0,-98}}), + Line(points={{60,0},{90,0}}), + Line(points={{0,0},{10,10},{-10,20},{10,28},{-10,40},{10,50},{-10,60},{ + 10,70}})}), + Window( + x=0.12, + y=0.05, + width=0.8, + height=0.77), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo index 0578d3df..ac2d1c71 100644 --- a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo @@ -1,53 +1,106 @@ within ThermoSysPro.Fluid.PressureLosses; - model IdealCheckValve "Ideal check valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.SI.PressureDifference dPOuvert = 0.01 "Pressure difference when the valve opens"; - parameter Units.SI.MassFlowRate Qmin = 1.e-6 "Mass flow trhough the valve when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - Boolean ouvert(start = true, fixed = true) "Valve state"; - discrete Boolean touvert(start = false, fixed = true); - discrete Boolean tferme(start = false, fixed = true); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.PressureDifference dPOuvert=0.01 + "Pressure difference when the valve opens"; + parameter Units.SI.MassFlowRate Qmin=1.e-6 + "Mass flow trhough the valve when the valve is closed"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + +public + Boolean ouvert(start=true, fixed=true) "Valve state"; + discrete Boolean touvert(start=false, fixed=true); + discrete Boolean tferme(start=false, fixed=true); Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure difference between the inlet and the outlet"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Units.SI.PressureDifference deltaP + "Pressure difference between the inlet and the outlet"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; -/* Pressure loss */ + + /* Pressure loss */ if ouvert then deltaP = 0; else - Q - Qmin = 0; + Q - Qmin = 0; end if; + touvert = (deltaP > dPOuvert); tferme = (not (Q > 0)); - when {pre(tferme), pre(touvert)} then + + when {pre(tferme),pre(touvert)} then ouvert = pre(touvert); end when; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-70, 70}, {-50, 50}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Sphere, fillColor = {0, 0, 255}), Line(points = {{-90, 0}, {-60, 0}}), Line(points = {{60, 0}, {100, 0}}), Text(extent = {{-96, -56}, {96, -112}}, textString = "DP=0"), Line(points = {{-60, -60}, {-60, 60}, {60, -60}, {60, 60}}, color = {0, 203, 0}, thickness = 0.5)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-70, 70}, {-50, 50}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{-100, 0}, {-60, 0}}), Line(points = {{60, 0}, {100, 0}}), Text(extent = {{-96, -56}, {96, -112}}, textString = "DP=0"), Line(points = {{-60, -60}, {-60, 60}, {60, -60}, {60, 60}}, color = {0, 203, 0}, thickness = 0.5)}), - Window(x = 0.08, y = 0.02, width = 0.84, height = 0.9), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-70,70},{-50,50}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Sphere, + fillColor={0,0,255}), + Line(points={{-90,0},{-60,0}}), + Line(points={{60,0},{100,0}}), + Text(extent={{-96,-56},{96,-112}}, textString= + "DP=0"), + Line( + points={{-60,-60},{-60,60},{60,-60},{60,60}}, + color={0,203,0}, + thickness=0.5)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-70,70},{-50,50}}, + lineColor={0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{-100,0},{-60,0}}), + Line(points={{60,0},{100,0}}), + Text(extent={{-96,-56},{96,-112}}, textString= + "DP=0"), + Line( + points={{-60,-60},{-60,60},{60,-60},{60,60}}, + color={0,203,0}, + thickness=0.5)}), + Window( + x=0.08, + y=0.02, + width=0.84, + height=0.9), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -58,4 +111,4 @@ Daniel Bouskela Baligh El Hefni ")); -end IdealCheckValve; \ No newline at end of file +end IdealCheckValve; diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo index 608b6f5a..4d33f8b8 100644 --- a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo @@ -1,45 +1,110 @@ within ThermoSysPro.Fluid.PressureLosses; - model IdealSwitchValve "Ideal switch valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.MassFlowRate Qmin = 1.e-6 "Mass flow when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.MassFlowRate Qmin=1.e-6 + "Mass flow when the valve is closed"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + +public Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure difference between the inlet and the outlet"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv annotation( - Placement(transformation(origin = {0, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -70}, {-90, -50}}, rotation = 0), iconTransformation(extent = {{-110, -70}, {-90, -50}}))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -70}, {110, -50}}, rotation = 0))); + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Units.SI.PressureDifference deltaP + "Pressure difference between the inlet and the outlet"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv + annotation (Placement(transformation( + origin={0,70}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-70},{-90,-50}}, rotation=0), + iconTransformation(extent={{-110,-70},{-90,-50}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-70},{110,-50}}, rotation=0))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; + if Ouv.signal then deltaP = 0; else Q - Qmin = 0; end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, -100}, {0, -60}, {-100, -20}, {-100, -100}, {-100, -100}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {100, -20}, {100, -100}, {0, -60}, {0, -60}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{-40, 60}, {40, 60}}, color = {28, 108, 200}, thickness = 1), Line(points = {{0, 60}, {0, -60}}), Text(extent = {{-104, 34}, {88, -22}}, textString = "DP=0")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, -100}, {0, -60}, {-100, -20}, {-100, -100}, {-100, -100}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {100, -20}, {100, -100}, {0, -60}, {0, -60}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Line(points = {{-40, 60}, {40, 60}}, color = {28, 108, 200}, thickness = 1), Line(points = {{0, 60}, {0, -60}}), Text(extent = {{-104, 34}, {88, -22}}, textString = "DP=0")}), - Window(x = 0.22, y = 0.12, width = 0.72, height = 0.74), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}}, + lineColor={0,0,255}, + fillColor={0,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}}, + lineColor={0,0,255}, + fillColor={0,255,0}, + fillPattern=FillPattern.Solid), + Line( + points={{-40,60},{40,60}}, + color={28,108,200}, + thickness=1), + Line(points={{0,60},{0,-60}}), + Text(extent={{-104,34},{88,-22}}, textString= + "DP=0")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Line( + points={{-40,60},{40,60}}, + color={28,108,200}, + thickness=1), + Line(points={{0,60},{0,-60}}), + Text(extent={{-104,34},{88,-22}}, textString= + "DP=0")}), + Window( + x=0.22, + y=0.12, + width=0.72, + height=0.74), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -49,4 +114,4 @@ Author Daniel Bouskela ")); -end IdealSwitchValve; \ No newline at end of file +end IdealSwitchValve; diff --git a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo index 33a68c82..f56d1b00 100644 --- a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo @@ -1,65 +1,107 @@ within ThermoSysPro.Fluid.PressureLosses; - model InvSingularPressureLoss "Inverse singular pressure loss" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Real K(start = 1.e3) "Pressure loss coefficient"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Average fluid pressure"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Units.SI.MassFlowRate Qeps = 1.e-3 "Small mass flow rate"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Units.SI.MassFlowRate Qeps=1.e-3 "Small mass flow rate"; + +public + Real K(start=1.e3) "Pressure loss coefficient"; + ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); equation + C2.Q = C1.Q; C2.h = C1.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Pressure loss */ + + /* Pressure loss */ deltaP = if noEvent(abs(Q) < Qeps) then 1.e-10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 40}, {-40, 20}, {-20, 10}, {0, 8}, {20, 10}, {40, 20}, {60, 40}, {-60, 40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 255, 0}), Polygon(points = {{-60, -40}, {-40, -20}, {-20, -12}, {0, -10}, {20, -12}, {40, -20}, {60, -40}, {-60, -40}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 40}, {-40, 20}, {-20, 10}, {0, 8}, {20, 10}, {40, 20}, {60, 40}, {-60, 40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-60, -40}, {-40, -20}, {-20, -12}, {0, -10}, {20, -12}, {40, -20}, {60, -40}, {-60, -40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, fill_color_static), fillPattern = FillPattern.Solid)}), - Window(x = 0.33, y = 0.09, width = 0.71, height = 0.88), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60, + 40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,255,0}), + Polygon( + points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60, + -40},{-60,-40}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60, + 40}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({255,255,0}, fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60, + -40},{-60,-40}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({255,255,0}, fill_color_static), + fillPattern=FillPattern.Solid)}), + Window( + x=0.33, + y=0.09, + width=0.71, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -70,4 +112,4 @@ Baligh El Hefni Daniel Bouskela ")); -end InvSingularPressureLoss; \ No newline at end of file +end InvSingularPressureLoss; diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo index 4410eacc..2b705551 100644 --- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo @@ -1,28 +1,38 @@ within ThermoSysPro.Fluid.PressureLosses; - model LumpedStraightPipe "Lumped straight pipe (circular duct)" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 10. "Pipe length"; - parameter Units.SI.Diameter D = 0.2 "Pipe internal hydraulic diameter"; - parameter Real ntubes = 1 "Number of pipes in parallel"; - parameter Real lambda = 0.03 "Friction pressure loss coefficient (active if lambda_fixed=true)"; - parameter Real rugosrel = 0.0001 "Pipe roughness (active if lambda_fixed=false)"; - parameter Units.SI.Position z1 = 0 "Inlet altitude"; - parameter Units.SI.Position z2 = 0 "Outlet altitude"; - parameter Boolean lambda_fixed = true "true: lambda given by parameter - false: lambde computed using Idel'Cik correlation"; - parameter Boolean inertia = false "true: momentum balance equation with inertia - false: without inertia"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Length L=10. "Pipe length"; + parameter Units.SI.Diameter D=0.2 "Pipe internal hydraulic diameter"; + parameter Real ntubes=1 "Number of pipes in parallel"; + parameter Real lambda=0.03 + "Friction pressure loss coefficient (active if lambda_fixed=true)"; + parameter Real rugosrel=0.0001 + "Pipe roughness (active if lambda_fixed=false)"; + parameter Units.SI.Position z1=0 "Inlet altitude"; + parameter Units.SI.Position z2=0 "Outlet altitude"; + parameter Boolean lambda_fixed=true + "true: lambda given by parameter - false: lambde computed using Idel'Cik correlation"; + parameter Boolean inertia=false + "true: momentum balance equation with inertia - false: without inertia"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + parameter Units.SI.Area A=ntubes*pi*D^2/4 + "Pipe cross-sectional area (circular duct is assumed)"; + parameter Units.SI.Area Pw=pi*D*ntubes + "Pipe wetted perimeter (circular duct is assumed)"; + +public Real khi "Hydraulic pressure loss coefficient"; ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss"; ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss"; - Units.SI.MassFlowRate Q(start = 100) "Mass flow rate"; + Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; Units.SI.ReynoldsNumber Re "Reynolds number"; Units.SI.ReynoldsNumber Relim "Limit Reynolds number"; Real lam "Friction pressure loss coefficient"; @@ -31,55 +41,60 @@ model LumpedStraightPipe "Lumped straight pipe (circular duct)" Units.SI.Temperature T "Fluid temperature"; Units.SI.AbsolutePressure Pm "Fluid average pressure"; Units.SI.SpecificEnthalpy h "Fluid specific enthalpy"; - Units.SI.SpecificHeatCapacity cp(start = 4200) "Fluid specific heat capacity"; - Units.SI.ThermalConductivity k(start = 0.05) "Fluid thermal conductivity"; - Units.SI.MassFlowRate gamma_diff(start = 1.e-4) "Diffusion conductance"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; - parameter Units.SI.Area A = ntubes*pi*D^2/4 "Pipe cross-sectional area (circular duct is assumed)"; - parameter Units.SI.Area Pw = pi*D*ntubes "Pipe wetted perimeter (circular duct is assumed)"; + Units.SI.SpecificHeatCapacity cp(start=4200) "Fluid specific heat capacity"; + Units.SI.ThermalConductivity k(start=0.05) "Fluid thermal conductivity"; + Units.SI.MassFlowRate gamma_diff(start=1.e-4) "Diffusion conductance"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + Medium.ThermodynamicState state "Fluid thermodynamic state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); initial equation if inertia then der(Q) = 0; end if; + equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = C1.diff_on_1; C1.diff_on_2 = C2.diff_on_2; + C2.diff_res_1 = C1.diff_res_1 + 1/gamma_diff; C1.diff_res_2 = C2.diff_res_2 + 1/gamma_diff; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Diffusion resistance */ + + /* Diffusion resistance */ gamma_diff = A*k/cp/L; -/* Pressure loss */ + + /* Pressure loss */ if inertia then deltaP = deltaPf + rho*g*(z2 - z1) + L/A*der(Q); else deltaP = deltaPf + rho*g*(z2 - z1); end if; + deltaPf = khi*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(2*A^2*rho); -/* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */ + + /* Darcy-Weisbach formula (Idel'cik p. 55). Quadratic flow regime is assumed and Re > 4000 (Re > Relim). */ khi = lam*L/D; + if lambda_fixed then lam = lambda; else @@ -89,23 +104,49 @@ equation lam = if noEvent(Re > 0) then 1/(1.8*Modelica.Math.log10(Re) - 1.64)^2 else 0; end if; end if; + Relim = if (rugosrel > 0.00005) then max(560/rugosrel, 2.e5) else 4000; Re = 4*abs(Q)/(Pw*mu); -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; + state = Medium.setState_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density(state); end if; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - mu = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - k = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {28, 108, 200}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, if inertia then fill_color_dynamic else fill_color_singular))}), - Window(x = 0.06, y = 0.08, width = 0.82, height = 0.65), + + T = Medium.temperature(state); + mu = Medium.dynamicViscosity(state); + k = Medium.thermalConductivity(state); + cp = Medium.specificHeatCapacityCp(state); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={28,108,200}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({127,255,0}, + if inertia then fill_color_dynamic + else fill_color_singular))}), + Window( + x=0.06, + y=0.08, + width=0.82, + height=0.65), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -117,4 +158,4 @@ Daniel Bouskela Baligh El Hefni ")); -end LumpedStraightPipe; \ No newline at end of file +end LumpedStraightPipe; diff --git a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo index 8c9b250f..5d13a8c4 100644 --- a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo @@ -1,70 +1,110 @@ within ThermoSysPro.Fluid.PressureLosses; - model PipePressureLoss "Pipe generic pressure loss" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real K = 10 "Friction pressure loss coefficient"; - parameter Units.SI.Position z1 = 0 "Inlet altitude"; - parameter Units.SI.Position z2 = 0 "Outlet altitude"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Real K=10 "Friction pressure loss coefficient"; + parameter Units.SI.Position z1=0 "Inlet altitude"; + parameter Units.SI.Position z2=0 "Outlet altitude"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + +public ThermoSysPro.Units.SI.PressureDifference deltaPf "Friction pressure loss"; ThermoSysPro.Units.SI.PressureDifference deltaPg "Gravity pressure loss"; ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss"; - Units.SI.MassFlowRate Q(start = 100) "Mass flow rate"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Average fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; + Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + equation C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; + X = C1.Xi; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Pressure loss */ + + /* Pressure loss */ deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho; deltaPg = rho*g*(z2 - z1); deltaP = deltaPf + deltaPg; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {85, 255, 85}), Text(extent = {{-12, 14}, {16, -14}}, lineColor = {0, 0, 255}, fillColor = {85, 255, 85}, fillPattern = FillPattern.Solid, textString = "K")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Text(extent = {{-14, 10}, {14, -8}}, lineColor = {0, 0, 255}, fillColor = {85, 255, 85}, fillPattern = FillPattern.Solid, textString = "K")}), - Window(x = 0.11, y = 0.04, width = 0.71, height = 0.88), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={85,255,85}), Text( + extent={{-12,14},{16,-14}}, + lineColor={0,0,255}, + fillColor={85,255,85}, + fillPattern=FillPattern.Solid, + textString= + "K")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Text( + extent={{-14,10},{14,-8}}, + lineColor={0,0,255}, + fillColor={85,255,85}, + fillPattern=FillPattern.Solid, + textString= + "K")}), + Window( + x=0.11, + y=0.04, + width=0.71, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -76,4 +116,4 @@ Daniel Bouskela Baligh El Hefni ")); -end PipePressureLoss; \ No newline at end of file +end PipePressureLoss; diff --git a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo index 4220477e..f863a184 100644 --- a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo @@ -1,63 +1,110 @@ within ThermoSysPro.Fluid.PressureLosses; - model SingularPressureLoss "Singular pressure loss" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real K = 1.e-4 "Pressure loss coefficient"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.MassFlowRate Q(start = 100) "Mass flow rate"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Average fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); +extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real K=1.e-4 "Pressure loss coefficient"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + +public + ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) "Average fluid pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Pressure loss */ + + + /* Pressure loss */ deltaP = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 40}, {-40, 20}, {-20, 10}, {0, 8}, {20, 10}, {40, 20}, {60, 40}, {-60, 40}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-60, -40}, {-40, -20}, {-20, -12}, {0, -10}, {20, -12}, {40, -20}, {60, -40}, {-60, -40}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 40}, {-40, 20}, {-20, 10}, {0, 8}, {20, 10}, {40, 20}, {60, 40}, {-60, 40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Polygon(points = {{-60, -40}, {-40, -20}, {-20, -12}, {0, -10}, {20, -12}, {40, -20}, {60, -40}, {-60, -40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid)}), - Window(x = 0.09, y = 0.2, width = 0.66, height = 0.69), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60, + 40}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60, + -40},{-60,-40}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,40},{-40,20},{-20,10},{0,8},{20,10},{40,20},{60,40},{-60, + 40}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Polygon( + points={{-60,-40},{-40,-20},{-20,-12},{0,-10},{20,-12},{40,-20},{60, + -40},{-60,-40}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid)}), + Window( + x=0.09, + y=0.2, + width=0.66, + height=0.69), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -69,4 +116,4 @@ Baligh El Hefni Daniel Bouskela ")); -end SingularPressureLoss; \ No newline at end of file +end SingularPressureLoss; diff --git a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo index 39728c09..fdaded47 100644 --- a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo @@ -1,70 +1,131 @@ within ThermoSysPro.Fluid.PressureLosses; - model SwitchValve "Switch valve" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient k = 1000 "Pressure loss coefficient"; - parameter Units.SI.MassFlowRate Qmin = 1.e-6 "Mass flow when the valve is closed"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.MassFlowRate Q(start = 100) "Mass flow rate"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Singular pressure loss"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.Temperature T(start = 290) "Fluid temperature"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv annotation( - Placement(transformation(origin = {0, 72}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -70}, {-90, -50}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -70}, {110, -50}}, rotation = 0), iconTransformation(extent = {{90, -70}, {110, -50}}))); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.xSI.PressureLossCoefficient k=1000 + "Pressure loss coefficient"; + parameter Units.SI.MassFlowRate Qmin=1.e-6 + "Mass flow when the valve is closed"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + +public + Units.SI.MassFlowRate Q(start=100) "Mass flow rate"; + Units.SI.PressureDifference deltaP "Singular pressure loss"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.Temperature T(start=290) "Fluid temperature"; + Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv + annotation (Placement(transformation( + origin={0,72}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-70},{-90,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-70},{110,-50}}, rotation=0), + iconTransformation(extent={{90,-70},{110,-50}}))); equation + C1.Q = C2.Q; C1.h = C2.h; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + + C1.SubC = C2.SubC; + Q = C1.Q; h = C1.h; deltaP = C1.P - C2.P; - ftype = C1.ftype; -/* Pressure loss */ + + /* Pressure loss */ if Ouv.signal then deltaP - k*ThermoSysPro.Functions.ThermoSquare(Q, eps)/2/rho = 0; else Q - Qmin = 0; end if; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + + T = Medium.temperature_phX(p=Pm, h=h, X=X); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, -100}, {0, -60}, {-100, -20}, {-100, -100}, {-100, -100}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {100, -20}, {100, -100}, {0, -60}, {0, -60}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Line(points = {{-40, 60}, {40, 60}}, color = {28, 108, 200}, thickness = 1), Line(points = {{0, 60}, {0, -60}})}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, -100}, {0, -60}, {-100, -20}, {-100, -100}, {-100, -100}}, lineColor = {28, 108, 200}, fillColor = {0, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{0, -60}, {100, -20}, {100, -100}, {0, -60}, {0, -60}}, lineColor = {28, 108, 200}, fillColor = {0, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{-40, 60}, {40, 60}}, color = {28, 108, 200}, thickness = 1), Line(points = {{0, 60}, {0, -60}})}), - Window(x = 0.1, y = 0.04, width = 0.79, height = 0.84), + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Line( + points={{-40,60},{40,60}}, + color={28,108,200}, + thickness=1), + Line(points={{0,60},{0,-60}})}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-100,-100},{0,-60},{-100,-20},{-100,-100},{-100,-100}}, + lineColor={28,108,200}, + fillColor={0,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-60},{100,-20},{100,-100},{0,-60},{0,-60}}, + lineColor={28,108,200}, + fillColor={0,255,0}, + fillPattern=FillPattern.Solid), + Line( + points={{-40,60},{40,60}}, + color={28,108,200}, + thickness=1), + Line(points={{0,60},{0,-60}})}), + Window( + x=0.1, + y=0.04, + width=0.79, + height=0.84), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -75,4 +136,4 @@ Author Daniel Bouskela ")); -end SwitchValve; \ No newline at end of file +end SwitchValve; diff --git a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo index 23c7a6d8..f8c78285 100644 --- a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo @@ -1,90 +1,122 @@ within ThermoSysPro.Fluid.PressureLosses; - model ThreeWayValve "Three way valve" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.xSI.Cv Cvmax1 = 8005.42 "Valve 1 max CV [USG/min]"; - parameter ThermoSysPro.Units.xSI.Cv Cvmax2 = 8005.42 "Valve 2 max CV [USG/min]"; - parameter Real caract1[:, 2] = [0, 0; 1, Cvmax1] "Valve 1 - Position vs. Cv [USG/min] characteristics (active if mode_caract1=true)"; - parameter Real caract2[:, 2] = [0, 0; 1, Cvmax2] "Valve 2 - Position vs. Cv [USG/min] characteristics (active if mode_caract2=true)"; - parameter Integer mode_caract1 = 0 "Valve 1 - 0:linear characteristics - 1:characteristics is given by caract1[]"; - parameter Integer mode_caract2 = 0 "Valve 2 - 0:linear characteristics - 1:characteristics is given by caract2[]"; - parameter Units.SI.Volume V = 1 "Three way valve volume (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Boolean dynamic_energy_balance = false "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = true "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Boolean dynamic_composition_balance = false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation (active for flue gases)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.FlueGases), tab = "Fluid", group = "Fluid properties")); - parameter ThermoSysPro.Units.SI.MassFraction Xco20 = 0.0 "Initial CO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xh2o0 = if ftype == FluidType.FlueGases then 0.05 else 0 "Initial H20 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xo20 = 0.23 "Initial O2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - parameter ThermoSysPro.Units.SI.MassFraction Xso20 = 0 "Initial SO2 mass fraction" annotation( - Evaluate = true, - Dialog(enable = dynamic_composition_balance, tab = "Fluid", group = "Initial composition values (active for flue gases only if dynamic_composition_balance=true)")); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - Interfaces.Connectors.FluidInlet C1 annotation( - layer = "icon", - Placement(transformation(extent = {{-110, -50}, {-90, -30}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - layer = "icon", - Placement(transformation(extent = {{90, -50}, {110, -30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Valve1(Cvmax = Cvmax1, caract = caract1, mode_caract = mode_caract1, p_rho = p_rho, region = region, gamma_diff = gamma_diff) annotation( - Placement(transformation(origin = {-6, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); - Interfaces.Connectors.FluidOutlet C3 annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Valve2(Cvmax = Cvmax2, caract = caract2, mode_caract = mode_caract2, p_rho = p_rho, region = region, gamma_diff = gamma_diff) annotation( - Placement(transformation(extent = {{40, -4}, {60, 16}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1 annotation( - Placement(transformation(extent = {{-80, 60}, {-60, 80}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add Add1(k2 = -1) annotation( - Placement(transformation(extent = {{-40, 40}, {-20, 60}}, rotation = 0))); - Volumes.VolumeA VolumeA1(V = V, p_rho = p_rho, dynamic_energy_balance = dynamic_energy_balance, diffusion = diffusion, continuous_flow_reversal = continuous_flow_reversal, ftype = ftype, region = region, dynamic_composition_balance = dynamic_composition_balance, Xco20 = Xco20, Xh2o0 = Xh2o0, Xo20 = Xo20, Xso20 = Xso20) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1(K = 0, region = region, gamma_diff = gamma_diff) annotation( - Placement(transformation(extent = {{-60, -10}, {-40, 10}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter ThermoSysPro.Units.xSI.Cv Cvmax1=8005.42 "Valve 1 max CV"; + parameter ThermoSysPro.Units.xSI.Cv Cvmax2=8005.42 "Valve 2 max CV"; + parameter Real caract1[:, 2]=[0, 0; 1, Cvmax1] + "Valve 1 - Position vs. Cv characteristics (active if mode_caract1=true)"; + parameter Real caract2[:, 2]=[0, 0; 1, Cvmax2] + "Valve 2 - Position vs. Cv characteristics (active if mode_caract2=true)"; + parameter Integer mode_caract1=0 + "Valve 1 - 0:linear characteristics - 1:characteristics is given by caract1[]"; + parameter Integer mode_caract2=0 + "Valve 2 - 0:linear characteristics - 1:characteristics is given by caract2[]"; + parameter Units.SI.Volume V=1 + "Three way valve volume (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Boolean dynamic_energy_balance=false + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=true + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean dynamic_composition_balance=false + "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default + "Initial composition values" annotation (Evaluate=true, Dialog( + enable=dynamic_composition_balance, + tab="Fluid", + group="Medium")); + + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv + annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (layer="icon", Placement( + transformation(extent={{-110,-50},{-90,-30}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (layer="icon", Placement( + transformation(extent={{90,-50},{110,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve Valve1( + redeclare package Medium = Medium, + Cvmax=Cvmax1, + caract=caract1, + mode_caract=mode_caract1, + p_rho=p_rho, + region=region, + gamma_diff=gamma_diff) + annotation (Placement(transformation( + origin={-6,-50}, + extent={{10,-10},{-10,10}}, + rotation=90))); + Interfaces.Connectors.FluidOutlet C3(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-110},{10,-90}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve Valve2( + redeclare package Medium = Medium, + Cvmax=Cvmax2, + caract=caract2, + mode_caract=mode_caract2, + p_rho=p_rho, + region=region, + gamma_diff=gamma_diff) + annotation (Placement(transformation(extent={{40,-4},{60,16}}, + rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1 + annotation (Placement(transformation( + extent={{-80,60},{-60,80}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Math.Add Add1(k2=-1) annotation (Placement(transformation( + extent={{-40,40},{-20,60}}, rotation=0))); + Volumes.VolumeA VolumeA1( + redeclare package Medium = Medium, + V=V, + p_rho=p_rho, + dynamic_energy_balance=dynamic_energy_balance, + diffusion=diffusion, + continuous_flow_reversal=continuous_flow_reversal, + dynamic_composition_balance=dynamic_composition_balance, + X0=X0) annotation (Placement(transformation(extent={{-10, + -10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1(redeclare package Medium = Medium, K=0, gamma_diff=gamma_diff) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation= + 0))); equation - connect(Ouv, Valve2.Ouv) annotation( - Line(points = {{0, 110}, {0, 60}, {50, 60}, {50, 17}})); - connect(Constante1.y, Add1.u1) annotation( - Line(points = {{-59, 70}, {-50, 70}, {-50, 56}, {-41, 56}}, color = {0, 0, 255})); - connect(Ouv, Add1.u2) annotation( - Line(points = {{0, 110}, {0, 90}, {-90, 90}, {-90, 44}, {-41, 44}})); - connect(Add1.y, Valve1.Ouv) annotation( - Line(points = {{-19, 50}, {-10, 50}, {-10, 26}, {-28, 26}, {-28, -50}, {-17, -50}}, color = {0, 0, 255})); - connect(VolumeA1.Cs1, Valve2.C1) annotation( - Line(points = {{10, 0}, {40, 0}}, color = {0, 0, 255})); - connect(VolumeA1.Cs2, Valve1.C1) annotation( - Line(points = {{0, -10}, {0, -40}, {8.88178e-016, -40}}, color = {0, 0, 255})); - connect(Valve1.C2, C3) annotation( - Line(points = {{-8.88178e-016, -60}, {-8.88178e-016, -78}, {0, -78}, {0, -100}}, color = {0, 0, 255})); - connect(PerteDP1.C2, VolumeA1.Ce1) annotation( - Line(points = {{-40, 0}, {-10, 0}}, color = {0, 0, 255})); - connect(Valve2.C2, C2) annotation( - Line(points = {{60, 0}, {80, 0}, {80, -40}, {100, -40}}, color = {0, 0, 255})); - connect(PerteDP1.C1, C1) annotation( - Line(points = {{-60, 0}, {-80, 0}, {-80, -40}, {-100, -40}}, color = {0, 0, 255})); - annotation( - structurallyIncomplete, - Documentation(info = " + connect(Ouv, Valve2.Ouv) + annotation (Line(points={{0,110},{0,60},{50,60},{50,17}})); + connect(Constante1.y, Add1.u1) + annotation (Line(points={{-59,70},{-50,70},{-50,56},{-41,56}}, color={0,0, + 255})); + connect(Ouv, Add1.u2) + annotation (Line(points={{0,110},{0,90},{-90,90},{-90,44},{-41,44}})); + connect(Add1.y, Valve1.Ouv) + annotation (Line(points={{-19,50},{-10,50},{-10,26},{-28,26},{-28,-50},{-17, + -50}}, color={0,0, + 255})); + connect(VolumeA1.Cs1, Valve2.C1) + annotation (Line(points={{10,0},{40,0}}, color={0,0,255})); + connect(VolumeA1.Cs2, Valve1.C1) + annotation (Line(points={{0,-10},{0,-40},{8.88178e-016,-40}}, color={0,0, + 255})); + connect(Valve1.C2, C3) + annotation (Line(points={{-8.88178e-016,-60},{-8.88178e-016,-78},{0,-78},{0, + -100}}, color={0,0,255})); + connect(PerteDP1.C2, VolumeA1.Ce1) + annotation (Line(points={{-40,0},{-10,0}}, color={0,0,255})); + connect(Valve2.C2, C2) + annotation (Line(points={{60,0},{80,0},{80,-40},{100,-40}}, color={0,0,255})); + connect(PerteDP1.C1, C1) + annotation (Line(points={{-60,0},{-80,0},{-80,-40},{-100,-40}}, color={0,0, + 255})); + annotation(structurallyIncomplete, Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 This component model is documented in Sect. 13.9 of the ThermoSysPro book. @@ -94,7 +126,54 @@ Author Daniel Bouskela "), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Text(extent = {{12, -40}, {46, -62}}, textString = "Valve 1"), Text(extent = {{36, -6}, {70, -28}}, textString = "Valve 2")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 0}, {-100, -80}, {100, 0}, {100, -80}, {-100, 0}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-20, -100}, {0, -40}, {20, -100}, {-20, -100}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{40, 40}, {-40, 40}, {-40, 56}, {-38, 74}, {-32, 84}, {-20, 94}, {0, 100}, {20, 94}, {32, 84}, {38, 72}, {40, 54}, {40, 40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{0, -40}, {40, 40}, {-40, 40}, {0, -40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid)}), - Window(x = 0.09, y = 0.11, width = 0.7, height = 0.66)); + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), + graphics={Text(extent={{12,-40},{46,-62}}, textString= + "Valve 1"), Text(extent={{36, + -6},{70,-28}}, textString = "Valve 2")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), + graphics={ + Polygon( + points={{-100,0},{-100,-80},{100,0},{100,-80},{-100,0}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-20,-100},{0,-40},{20,-100},{-20,-100}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{40,40},{-40,40},{-40,56},{-38,74},{-32,84},{-20,94},{0,100}, + {20,94},{32,84},{38,72},{40,54},{40,40}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-40},{40,40},{-40,40},{0,-40}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({127,255,0}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid)}), + Window( + x=0.09, + y=0.11, + width=0.7, + height=0.66)); end ThreeWayValve; From 6100585cc1d97545697635368edecef733516320 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:31:44 +0200 Subject: [PATCH 185/213] #125 port Fluid machine components medium support onto develop --- .../Fluid/Machines/CentrifugalPump.mo | 296 +++++++---- .../Fluid/Machines/CombustionTurbine.mo | 167 ++++--- ThermoSysPro/Fluid/Machines/Compressor.mo | 182 ++++--- .../Fluid/Machines/HeatPumpCompressor.mo | 133 +++-- .../Machines/InternalCombustionEngine.mo | 471 ++++++++++++------ .../Fluid/Machines/StaticCentrifugalPump.mo | 195 +++++--- ThermoSysPro/Fluid/Machines/StaticFan.mo | 187 ++++--- ThermoSysPro/Fluid/Machines/SteamEngine.mo | 183 ++++--- ThermoSysPro/Fluid/Machines/StodolaTurbine.mo | 238 +++++---- 9 files changed, 1328 insertions(+), 724 deletions(-) diff --git a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo index 8a386b11..4aa6dc1f 100644 --- a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo @@ -1,38 +1,83 @@ within ThermoSysPro.Fluid.Machines; - model CentrifugalPump "Centrifugal pump" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N = 1400 "Pump angular velocity in rpm (active if input M is not connected)"; - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N_nom = 1400 "Nominal angular velocity in rpm"; - parameter Units.SI.MomentOfInertia J = 10 "Rotating masses moment of inertia (active if dynamic_mech_equation=true)"; - parameter Units.SI.Volume V = 1 "Pump volume (active if dynamic_energy_balance=true)"; - parameter Boolean dynamic_mech_equation = false "true: dynamic mechanical equation - false: static mechanical equation (active if input M is connected)"; - parameter Boolean dynamic_energy_balance = false "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Integer mode_car = 2 "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics"; - parameter Integer mode_car_hn = 2 "1:complete pump head characteristics - 2:semi-parabolic pump head characteristics"; - parameter Integer mode_car_Cr = 2 "1:complete torque characteristics - 2:analytic formula"; - parameter Units.SI.VolumeFlowRate Qv_nom_p = 0.4781 "Nominal volumetric flow (active if mode_car=1)"; - parameter Units.SI.Height hn_nom_p = 22.879 "Nominal pump head (active if mode_car=1)"; - parameter Units.SI.Height rh_nom_p = 0.863 "Nominal pump efficiency (active if mode_car=1)"; - parameter Real F_t[:] = {0.634, 0.643, 0.646, 0.640, 0.629, 0.613, 0.595, 0.575, 0.552, 0.533, 0.516, 0.505, 0.504, 0.510, 0.512, 0.522, 0.539, 0.559, 0.580, 0.601, 0.630, 0.662, 0.692, 0.722, 0.753, 0.782, 0.808, 0.832, 0.857, 0.879, 0.904, 0.930, 0.959, 0.996, 1.027, 1.060, 1.090, 1.124, 1.165, 1.204, 1.238, 1.258, 1.271, 1.282, 1.288, 1.281, 1.260, 1.225, 1.172, 1.107, 1.031, 0.942, 0.842, 0.733, 0.617, 0.500, 0.368, 0.240, 0.125, 0.011, -0.102, -0.168, -0.255, -0.342, -0.423, -0.494, -0.556, -0.620, -0.655, -0.670, -0.670, -0.660, -0.655, -0.640, -0.600, -0.570, -0.520, -0.470, -0.430, -0.360, -0.275, -0.160, -0.040, 0.130, 0.295, 0.430, 0.550, 0.620, 0.634} "Head characteristics (active if mode_car_hn=1)"; - parameter Real G_t[:] = {-0.684, -0.547, -0.414, -0.292, -0.187, -0.105, -0.053, -0.012, 0.042, 0.097, 0.156, 0.227, 0.300, 0.371, 0.444, 0.522, 0.596, 0.672, 0.738, 0.763, 0.797, 0.837, 0.865, 0.883, 0.886, 0.877, 0.859, 0.838, 0.804, 0.758, 0.703, 0.645, 0.583, 0.520, 0.454, 0.408, 0.370, 0.343, 0.331, 0.329, 0.338, 0.354, 0.372, 0.405, 0.450, 0.486, 0.520, 0.552, 0.579, 0.603, 0.616, 0.617, 0.606, 0.582, 0.546, 0.500, 0.432, 0.360, 0.288, 0.214, 0.123, 0.037, -0.053, -0.161, -0.248, -0.314, -0.372, -0.580, -0.740, -0.880, -1.000, -1.120, -1.250, -1.370, -1.490, -1.590, -1.660, -1.690, -1.770, -1.650, -1.590, -1.520, -1.420, -1.320, -1.230, -1.100, -0.980, -0.820, -0.684} "Torque characteristics (active if mode_car_Cr=1)"; - parameter Real c_p = 1.288 "Dimensionless coef. of the semi-parabolic pump head characteristics (active if mode_car=1 and mode_car_hn=2)"; - constant Real b = 2 "Dimensionless coef. of the parabolic pump efficiency characteristics"; - parameter Real hn_coef[2] = {-88.67, 43.15} "Coef. of the semi-parabolic pump head characteristics (active if mode_car=2)"; - parameter Real rh_coef[2] = {-3.7751, 3.61} "Coef. of the parabolic pump efficiency characteristics (active if mode_car=2)"; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N=1400 + "Pump angular velocity in rpm (active if input M is not connected)"; + parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm N_nom=1400 + "Nominal angular velocity in rpm"; + parameter Units.SI.MomentOfInertia J=10 + "Rotating masses moment of inertia (active if dynamic_mech_equation=true)"; + parameter Units.SI.Volume V=1 + "Pump volume (active if dynamic_energy_balance=true)"; + parameter Boolean dynamic_mech_equation=false + "true: dynamic mechanical equation - false: static mechanical equation (active if input M is connected)"; + parameter Boolean dynamic_energy_balance=false + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Integer mode_car=2 + "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics"; + parameter Integer mode_car_hn=2 + "1:complete pump head characteristics - 2:semi-parabolic pump head characteristics"; + parameter Integer mode_car_Cr=2 + "1:complete torque characteristics - 2:analytic formula"; + + parameter Units.SI.VolumeFlowRate Qv_nom_p=0.4781 + "Nominal volumetric flow (active if mode_car=1)"; + parameter Units.SI.Height hn_nom_p=22.879 + "Nominal pump head (active if mode_car=1)"; + parameter Units.SI.Height rh_nom_p=0.863 + "Nominal pump efficiency (active if mode_car=1)"; + + parameter Real F_t[:]={ 0.634, 0.643, 0.646, 0.640, 0.629, 0.613, 0.595, 0.575, 0.552, 0.533, 0.516, 0.505, + 0.504, 0.510, 0.512, 0.522, 0.539, 0.559, 0.580, 0.601, 0.630, 0.662, 0.692, 0.722, + 0.753, 0.782, 0.808, 0.832, 0.857, 0.879, 0.904, 0.930, 0.959, 0.996, 1.027, 1.060, + 1.090, 1.124, 1.165, 1.204, 1.238, 1.258, 1.271, 1.282, 1.288, 1.281, 1.260, 1.225, + 1.172, 1.107, 1.031, 0.942, 0.842, 0.733, 0.617, 0.500, 0.368, 0.240, 0.125, 0.011, + -0.102,-0.168,-0.255,-0.342,-0.423,-0.494,-0.556,-0.620,-0.655,-0.670,-0.670,-0.660, + -0.655,-0.640,-0.600,-0.570,-0.520,-0.470,-0.430,-0.360,-0.275,-0.160,-0.040, 0.130, + 0.295, 0.430, 0.550, 0.620, 0.634} + "Head characteristics (active if mode_car_hn=1)"; + + parameter Real G_t[:]={-0.684,-0.547,-0.414,-0.292,-0.187,-0.105,-0.053,-0.012, 0.042, 0.097, 0.156, 0.227, + 0.300, 0.371, 0.444, 0.522, 0.596, 0.672, 0.738, 0.763, 0.797, 0.837, 0.865, 0.883, + 0.886, 0.877, 0.859, 0.838, 0.804, 0.758, 0.703, 0.645, 0.583, 0.520, 0.454, 0.408, + 0.370, 0.343, 0.331, 0.329, 0.338, 0.354, 0.372, 0.405, 0.450, 0.486, 0.520, 0.552, + 0.579, 0.603, 0.616, 0.617, 0.606, 0.582, 0.546, 0.500, 0.432, 0.360, 0.288, 0.214, + 0.123, 0.037,-0.053,-0.161,-0.248,-0.314,-0.372,-0.580,-0.740,-0.880,-1.000,-1.120, + -1.250,-1.370,-1.490,-1.590,-1.660,-1.690,-1.770,-1.650,-1.590,-1.520,-1.420,-1.320, + -1.230,-1.100,-0.980,-0.820, -0.684} + "Torque characteristics (active if mode_car_Cr=1)"; + + parameter Real c_p=1.288 + "Dimensionless coef. of the semi-parabolic pump head characteristics (active if mode_car=1 and mode_car_hn=2)"; + constant Real b=2 + "Dimensionless coef. of the parabolic pump efficiency characteristics"; + + parameter Real hn_coef[2]={-88.67, 43.15} + "Coef. of the semi-parabolic pump head characteristics (active if mode_car=2)"; + parameter Real rh_coef[2]={-3.7751, 3.61} + "Coef. of the parabolic pump efficiency characteristics (active if mode_car=2)"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Units.SI.AngularVelocity w_a_min=1.e-4 "Small angular velocity"; + parameter Units.SI.VolumeFlowRate Qv_a_min=1.e-4 "Small volume flow rate"; + parameter Real rh_min=0.05 "Minimum efficiency"; + +public Real w_a "Dimensionless angular velocity"; - Real Qv_a(start = 1) "Dimensionless volumetric flow"; - Real hn_a(start = 1) "Dimensionless head"; - Real Cr_a(start = 1) "Dimensionless resistive torque"; - Real rh_a(start = 1) "Dimensionless pump efficiency"; + Real Qv_a(start=1) "Dimensionless volumetric flow"; + Real hn_a(start=1) "Dimensionless head"; + Real Cr_a(start=1) "Dimensionless resistive torque"; + Real rh_a(start=1) "Dimensionless pump efficiency"; Units.SI.AngularVelocity w_nom "Nominal angular velocity"; Units.SI.VolumeFlowRate Qv_nom "Nominal volumetric flow"; Units.SI.Height hn_nom "Nominal pump head"; @@ -42,82 +87,95 @@ model CentrifugalPump "Centrifugal pump" ThermoSysPro.Units.nonSI.Angle_deg theta_deg "Angle arctan(Qv_a/w_a) (deg)"; Units.SI.AngularVelocity w "Angular velocity in rad"; ThermoSysPro.Units.nonSI.AngularVelocity_rpm w_rpm "Angular velocity in rpm"; - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; - Units.SI.VolumeFlowRate Qv(start = 0.5) "Volumetric flow rate"; - Units.SI.Pressure deltaP "Pressure variation between the outlet and the inlet"; - Units.SI.Height hn(start = 10) "Pump head"; + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow rate"; + Units.SI.Pressure deltaP + "Pressure variation between the outlet and the inlet"; + Units.SI.Height hn(start=10) "Pump head"; Units.SI.Torque Cm "Motor torque"; Units.SI.Torque Cr "Resistive hydraulic torque"; Real rh "Pump efficiency"; Units.SI.Power Wr "Resistive power"; Units.SI.Power Wm "Motor power"; Units.SI.Energy Ec "Kinetic energy of the rotating masses"; - Units.SI.Density rho(start = 998) "Fluid density"; - Units.SI.SpecificEnthalpy deltaH "Specific enthalpy variation between the outlet and the inlet"; - Units.SI.Pressure Pm(start = 1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid average specific enthalpy"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.SpecificEnthalpy deltaH + "Specific enthalpy variation between the outlet and the inlet"; + Units.SI.Pressure Pm(start=1.e5) "Fluid average pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy"; Real c "Dimensionless coef. of the semi-parabolic pump head characteristics"; Real F "Function F"; Real G "Function G"; Real Z "Function Z"; Real i_h "Index in head characteristics table"; Real i_t "Index in torque characteristics table"; - Real alpha = hn_coef[1] "Coef. alpha of the characteristics for hn"; - Real beta = hn_coef[2] "Coef. beta of the characteristics for hn"; - Real gamma = rh_coef[1] "Coef. gamma of the characteristics for rh"; - Real delta = rh_coef[2] "Coef. delta of the characteristics for rh"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ElectroMechanics.Connectors.MechanichalTorque M annotation( - Placement(transformation(origin = {0, -110}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.AngularVelocity w_a_min = 1.e-4 "Small angular velocity"; - parameter Units.SI.VolumeFlowRate Qv_a_min = 1.e-4 "Small volume flow rate"; - parameter Real rh_min = 0.05 "Minimum efficiency"; + Real alpha=hn_coef[1] "Coef. alpha of the characteristics for hn"; + Real beta=hn_coef[2] "Coef. beta of the characteristics for hn"; + Real gamma=rh_coef[1] "Coef. gamma of the characteristics for rh"; + Real delta=rh_coef[2] "Coef. delta of the characteristics for rh"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ElectroMechanics.Connectors.MechanichalTorque M + annotation (Placement(transformation( + origin={0,-110}, + extent={{-10,-10},{10,10}}, + rotation=90))); initial equation if (cardinality(M) <> 0) and dynamic_mech_equation then der(w) = 0; end if; + if dynamic_energy_balance then der(h) = 0; end if; + equation + if (cardinality(M) == 0) then M.w = pi/30*N; end if; + C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; deltaP = C2.P - C1.P; deltaH = C2.h - C1.h; + deltaP = rho*g*hn; Q = Qv*rho; - ftype = C1.ftype; -/* Energy balance equation */ + + /* Energy balance equation */ if dynamic_energy_balance then V*rho*der(h) = -Q*deltaH + Wr; else - deltaH = ThermoSysPro.Functions.SmoothCond(Q, g*hn/ThermoSysPro.Functions.SmoothMax(rh, rh_min), g*hn/ThermoSysPro.Functions.SmoothMin(rh, -rh_min)); + deltaH = ThermoSysPro.Functions.SmoothCond( + Q, + g*hn/ThermoSysPro.Functions.SmoothMax(rh, rh_min), + g*hn/ThermoSysPro.Functions.SmoothMin(rh, -rh_min)); end if; -/* Nominal quantities */ + + /* Nominal quantities */ w_nom = pi/30*N_nom; + if (mode_car == 1) then Qv_nom = Qv_nom_p; hn_nom = hn_nom_p; @@ -129,14 +187,17 @@ equation else assert(false, "CentrifugalPump: invalid option"); end if; + Cr_nom = rho*g*Qv_nom*hn_nom/rh_nom/w_nom; -/* Dimensionless quantities */ + + /* Dimensionless quantities */ w_a = w/w_nom; Qv_a = Qv/Qv_nom; hn_a = hn/hn_nom; rh_a = rh/rh_nom; Cr_a = Cr/Cr_nom; -/* Dimensionless coef. c */ + + /* Dimensionless coef. c */ if (mode_car == 1) then c = c_p; elseif (mode_car == 2) then @@ -144,24 +205,38 @@ equation else assert(false, "CentrifugalPump: invalid option"); end if; -/* Angle theta */ - theta = noEvent(if (abs(w_a) > w_a_min) then atan(Qv_a/w_a) else if (abs(Qv_a) < Qv_a_min) then (if (w_a > 0) then 0 else -pi) else if (Qv_a > 0) then pi/2 else -pi/2); + + /* Angle theta */ + theta = noEvent(if (abs(w_a) > w_a_min) then atan(Qv_a/w_a) else + if (abs(Qv_a) < Qv_a_min) then (if (w_a > 0) then 0 else -pi) else + if (Qv_a > 0) then pi/2 else + - pi/2); theta_deg = 180/pi*theta; + i_h = (theta + pi)/(2*pi)*(size(F_t, 1) - 1) + 1; i_t = (theta + pi)/(2*pi)*(size(G_t, 1) - 1) + 1; -/* Pump head */ + + /* Pump head */ if (mode_car_hn == 1) then - F = ThermoSysPro.Functions.SplineInterpolation(1:size(F_t, 1), F_t[:], i_h); + F = ThermoSysPro.Functions.SplineInterpolation( + 1:size(F_t, 1), + F_t[:], + i_h); hn_a = (w_a^2 + Qv_a^2)*F; elseif (mode_car_hn == 2) then - F = ((1 - c)*ThermoSysPro.Functions.SmoothSign(w_a)*tan(theta)*ThermoSysPro.Functions.SmoothAbs(tan(theta)) + c)/(1 + tan(theta)^2); + F = ((1 - c)*ThermoSysPro.Functions.SmoothSign(w_a)*tan(theta)* + ThermoSysPro.Functions.SmoothAbs(tan(theta)) + c)/(1 + tan(theta)^2); hn_a = (1 - c)*Qv_a*abs(Qv_a) + c*w_a^2; else assert(false, "CentrifugalPump: invalid option"); end if; -/* Pump resistive torque */ + + /* Pump resistive torque */ if (mode_car_Cr == 1) then - G = ThermoSysPro.Functions.SplineInterpolation(1:size(G_t, 1), G_t[:], i_t); + G = ThermoSysPro.Functions.SplineInterpolation( + 1:size(G_t, 1), + G_t[:], + i_t); Z = 0; Cr_a = (w_a^2 + Qv_a^2)*G; elseif (mode_car_Cr == 2) then @@ -171,35 +246,73 @@ equation else assert(false, "CentrifugalPump: invalid option"); end if; -/* Pump efficiency */ - rh_a = if noEvent(abs(w_a) > w_a_min) then -(b - 1)*(Qv_a/w_a)^2 + b*Qv_a/w_a else -(b - 1)*(Qv_a/w_a_min)^2 + b*Qv_a/w_a_min; -/* Motor power */ + + /* Pump efficiency */ + rh_a = if noEvent(abs(w_a) > w_a_min) then + -(b - 1)*(Qv_a/w_a)^2 + b*Qv_a/w_a else + -(b - 1)*(Qv_a/w_a_min)^2 + b*Qv_a/w_a_min; + + /* Motor power */ Wm = Cm*w; -/* Resistive hydraulic power */ + + /* Resistive hydraulic power */ Wr = Cr*w; -/* Kinetic energy of the rotating masses */ + + /* Kinetic energy of the rotating masses */ Ec = 1/2*J*w^2; -/* Rotating mass equation */ + + /* Rotating mass equation */ if (cardinality(M) <> 0) and dynamic_mech_equation then J*der(w) = Cm - Cr; else 0 = Cm - Cr; end if; + w_rpm = 30/pi*w; + w = M.w; Cm = M.Ctr; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; h = (C1.h + C2.h)/2; + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Polygon(points = {{-30, 40}, {60, 0}, {-30, -40}, {-30, 40}}, lineColor = {0, 0, 255}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid)}), - Window(x = 0.03, y = 0.02, width = 0.95, height = 0.95), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Polygon(points = {{-30, 40}, {60, 0}, {-30, -40}, {-30, 40}}, lineColor = {0, 0, 255}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid)}), + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0}), Polygon( + points={{-30,40},{60,0},{-30,-40},{-30,40}}, + lineColor={0,0,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid)}), + Window( + x=0.03, + y=0.02, + width=0.95, + height=0.95), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Polygon( + points={{-30,40},{60,0},{-30,-40},{-30,40}}, + lineColor={0,0,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid)}), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -210,6 +323,5 @@ Authors Daniel Bouskela Baligh El Hefni - "), - DymolaStoredErrors); -end CentrifugalPump; \ No newline at end of file + ")); +end CentrifugalPump; diff --git a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo index cb9c16bc..0bcad5a2 100644 --- a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo @@ -1,91 +1,128 @@ within ThermoSysPro.Fluid.Machines; - model CombustionTurbine "Combustion turbine" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Real A3 = 0 "X^3 coefficient of the efficiency curve"; - parameter Real A2 = -0.04778 "X^2 coefficient of the efficiency curve"; - parameter Real A1 = 0.09555 "X^1 coefficient of the efficiency curve"; - parameter Real A0 = 0.95223 "X^0 coefficient of the efficiency curve"; - parameter Real tau_n = 0.07 "Nominal expansion rate"; - parameter Real is_eff_n = 0.8600 "Nominal isentropic efficiency"; - parameter Real Qred = 0.01 "Reduced mass flow rate"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - Real tau(start = 0.07) "Expansion rate"; - Real is_eff(start = 0.85) "Isentropic efficiency"; - Units.SI.Power Wcp(start = 1e9) "Compressor power"; - Units.SI.Power Wturb(start = 2e9) "Turbine power"; - Units.SI.Power Wmech(start = 1e9) "Mechanical power"; - Units.SI.AbsolutePressure Pe(start = 1e5) "Flue gases pressure at the inlet"; - Units.SI.AbsolutePressure Ps(start = 1e5) "Flue gases pressure at the outlet"; - Real Xtau(start = 1) "Ratio between the actual and nominal expansion rate"; - Units.SI.MassFlowRate Q(start = 500) "Flue gases mass flow rate"; - Units.SI.Temperature Te(start = 1.4e3) "Flue gases temperature at the inlet"; - Units.SI.Temperature Ts(start = 900) "Flue gases temperature at the outlet"; - Units.SI.Temperature Tis(start = 750) "Isentropic air temperature at the outlet"; - Units.SI.SpecificEnthalpy He(start = 1.2e6) "Flue gases specific enthalpy at the inlet"; - Units.SI.SpecificEnthalpy Hs(start = 6e5) "Flue gases specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy His(start = 6e5) "Flue gases specific enthalpy after the isentropic expansion"; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Real A3=0 "X^3 coefficient of the efficiency curve"; + parameter Real A2=-0.04778 "X^2 coefficient of the efficiency curve"; + parameter Real A1=0.09555 "X^1 coefficient of the efficiency curve"; + parameter Real A0=0.95223 "X^0 coefficient of the efficiency curve"; + parameter Real tau_n=0.07 "Nominal expansion rate"; + parameter Real is_eff_n=0.8600 "Nominal isentropic efficiency"; + parameter Real Qred=0.01 "Reduced mass flow rate"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + +public + Real tau(start=0.07) "Expansion rate"; + Real is_eff(start=0.85) "Isentropic efficiency"; + Units.SI.Power Wcp(start=1e9) "Compressor power"; + Units.SI.Power Wturb(start=2e9) "Turbine power"; + Units.SI.Power Wmech(start=1e9) "Mechanical power"; + Units.SI.AbsolutePressure Pe(start=1e5) "Flue gases pressure at the inlet"; + Units.SI.AbsolutePressure Ps(start=1e5) "Flue gases pressure at the outlet"; + Real Xtau(start=1) "Ratio between the actual and nominal expansion rate"; + Units.SI.MassFlowRate Q(start=500) "Flue gases mass flow rate"; + Units.SI.Temperature Te(start=1.4e3) "Flue gases temperature at the inlet"; + Units.SI.Temperature Ts(start=900) "Flue gases temperature at the outlet"; + Units.SI.Temperature Tis(start=750) + "Isentropic air temperature at the outlet"; + Units.SI.SpecificEnthalpy He(start=1.2e6) + "Flue gases specific enthalpy at the inlet"; + Units.SI.SpecificEnthalpy Hs(start=6e5) + "Flue gases specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy His(start=6e5) + "Flue gases specific enthalpy after the isentropic expansion"; Units.SI.SpecificEntropy Se "Flue gases specific entropy at the inlet"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower annotation( - Placement(transformation(extent = {{-120, -50}, {-100, -30}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower annotation( - Placement(transformation(extent = {{100, -100}, {120, -80}}, rotation = 0))); + +public + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower annotation (Placement(transformation(extent={{-120,-50},{-100,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + + Medium.ThermodynamicState state_e; equation -/* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "CombustionTurbine: the fluid type must be flue gases"); + Ce.Q = Cs.Q; + Ce.h_vol_1 = Cs.h_vol_1; Ce.h_vol_2 = Cs.h_vol_2; + Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false; Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false; + Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - Ce.ftype = Cs.ftype; - Ce.Xco2 = Cs.Xco2; - Ce.Xh2o = Cs.Xh2o; - Ce.Xo2 = Cs.Xo2; - Ce.Xso2 = Cs.Xso2; + + Ce.SubC = Cs.SubC; + + Ce.Xi = Cs.Xi; + Q = Ce.Q; + Pe = Ce.P; Ps = Cs.P; + He = Ce.h; Hs = Cs.h; - ftype = Ce.ftype; -/* Input compressor power (negative value) */ + + /* Input compressor power (negative value) */ Wcp = CompressorPower.signal; -/* Expansion rate */ + + /* Expansion rate */ tau = Ps/Pe; -/* Expansion rates ratio */ + + /* Expansion rates ratio */ Xtau = tau/tau_n; -/* Isentropic efficiency */ + + /* Isentropic efficiency */ is_eff = (A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n; -/* Reduced mass flow rate */ + + /* Reduced mass flow rate */ Qred = (Q*sqrt(Te))/Pe; -/* Turbine power */ + + /* Turbine power */ Wturb = Q*(He - Hs); -/* Mechanical power */ + + /* Mechanical power */ Wmech = Wturb + Wcp; MechPower.signal = Wmech; -/* Temperature at the inlet */ - Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -/* Specific entropy at the inlet */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -/* Specific enthalpy after the isentropic expansion */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -/* Specific enthalpy at the outlet */ - Hs = is_eff*(His - He) + He; -/* Temperature at the outlet */ - Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Polygon(points = {{-100, 40}, {-100, -40}, {100, -100}, {100, 100}, {-100, 40}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Backward)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Polygon(points = {{-100, 40}, {-100, -40}, {100, -100}, {100, 100}, {-100, 40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Backward)}), + + /* Temperature at the inlet */ + state_e = Medium.setState_phX(Pe,He,Ce.Xi); + Te=Medium.temperature(state_e); + + /* Specific entropy at the inlet */ + Se = Medium.specificEntropy(state_e); + + /* Specific enthalpy after the isentropic expansion */ + Tis=Medium.temperature(Medium.setState_psX(Ps,Se,Ce.Xi)); + His = Medium.specificEnthalpy_pTX(Ps,Tis,Ce.Xi); + + /* Specific enthalpy at the outlet */ + Hs = is_eff*(His - He) + He; + + /* Temperature at the outlet */ + Ts = Medium.temperature_phX(Ps,Hs,Ce.Xi); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={Polygon( + points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Backward)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={Polygon( + points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Backward)}), Documentation(revisions = " Author @@ -96,4 +133,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 11.4 of the ThermoSysPro book. ")); -end CombustionTurbine; \ No newline at end of file +end CombustionTurbine; diff --git a/ThermoSysPro/Fluid/Machines/Compressor.mo b/ThermoSysPro/Fluid/Machines/Compressor.mo index a1a72a35..6afeb328 100644 --- a/ThermoSysPro/Fluid/Machines/Compressor.mo +++ b/ThermoSysPro/Fluid/Machines/Compressor.mo @@ -1,101 +1,133 @@ within ThermoSysPro.Fluid.Machines; - model Compressor "Gas compressor" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Integer mass_flow_rate_comp = 1 "Ways for computing the mass flow rate - 1: Q = rho*Qv - 2: Q = rho*f(T)"; - parameter Units.SI.Temperature Tmax = 284.16 "Air transition temperature between f1 = a*x + b and f2 = c*x + d for the computation of Q (active if mass_flow_rate_comp == 2)"; - parameter Real coef1_1 = 0.1164 "Coefficient a for f1 = a*x + b"; - parameter Real coef2_1 = 38.643 "Coefficient b for f1 = a*x + b"; - parameter Real coef1_2 = -0.2324 "Coefficient c for f2 = c*x + d"; - parameter Real coef2_2 = 137.49 "Coefficient d for f2 = c*x + d"; - parameter Real A4 = -1.2362 "Coefficient of X^4 for the computation of the isentropic efficiency"; - parameter Real A3 = 3.6721 "Coefficient of X^3 for the computation of the isentropic efficiency"; - parameter Real A2 = -4.2434 "Coefficient of X^2 for the computation of the isentropic efficiency"; - parameter Real A1 = 2.3957 "Coefficient of X^1 for the computation of the isentropic efficiency"; - parameter Real A0 = 0.4118 "Coefficient of X^0 for the computation of the isentropic efficiency"; - parameter Real tau_n = 14.149 "Nominal compression rate"; - parameter Real is_eff_n = 0.84752 "Nominal isentropic efficiency"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - Real tau(start = 15) "Compression rate"; - Real is_eff(start = 0.85) "Isentropic efficiency"; - Units.SI.Power Wcp(start = 1e9) "Compressor power"; - Units.SI.AbsolutePressure Pe(start = 1e5) "Air pressure at the inlet"; - Units.SI.AbsolutePressure Ps(start = 15e5) "Air pressure at the outlet"; - Real Xtau(start = 1) "Normal and nominal compression rates ratio"; - Units.SI.MassFlowRate Q(start = 500) "Air mass flow rate"; - Units.SI.VolumeFlowRate Qv(start = 500) "Air volume flow rate"; - Units.SI.Temperature Te(start = 300) "Air temperature at the inlet"; - Units.SI.Temperature Ts(start = 750) "Air temperature at the outlet"; - Units.SI.Temperature Tis(start = 750) "Isentropic air temperature at the outlet"; - Units.SI.SpecificEnthalpy He(start = 80e3) "Air specific enthalpy at the inlet"; - Units.SI.SpecificEnthalpy Hs(start = 500e3) "Air specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy His(start = 450e3) "Air specific enthalpy after the isentropic compression"; - Units.SI.SpecificEntropy Se "Air specific entropy at the inlet"; - Units.SI.Density rho_e(start = 1) "Air density at the inlet"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-100, -10}, {-80, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power annotation( - Placement(transformation(extent = {{80, -40}, {100, -20}}, rotation = 0))); + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Integer mass_flow_rate_comp=1 "Ways for computing the mass flow rate - 1: Q = rho*Qv - 2: Q = rho*f(T)"; + parameter Units.SI.Temperature Tmax=284.16 + "Air transition temperature between f1 = a*x + b and f2 = c*x + d for the computation of Q (active if mass_flow_rate_comp == 2)"; + parameter Real coef1_1=0.1164 "Coefficient a for f1 = a*x + b"; + parameter Real coef2_1=38.643 "Coefficient b for f1 = a*x + b"; + parameter Real coef1_2=-0.2324 "Coefficient c for f2 = c*x + d"; + parameter Real coef2_2=137.49 "Coefficient d for f2 = c*x + d"; + parameter Real A4=-1.2362 "Coefficient of X^4 for the computation of the isentropic efficiency"; + parameter Real A3=3.6721 "Coefficient of X^3 for the computation of the isentropic efficiency"; + parameter Real A2=-4.2434 "Coefficient of X^2 for the computation of the isentropic efficiency"; + parameter Real A1=2.3957 "Coefficient of X^1 for the computation of the isentropic efficiency"; + parameter Real A0=0.4118 "Coefficient of X^0 for the computation of the isentropic efficiency"; + parameter Real tau_n=14.149 "Nominal compression rate"; + parameter Real is_eff_n=0.84752 "Nominal isentropic efficiency"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + protected - Units.SI.VolumeFlowRate Qv_cal(start = 500) "Intermediate variable for the computation of Qv"; + Units.SI.VolumeFlowRate Qv_cal(start=500) + "Intermediate variable for the computation of Qv"; + +public + Real tau(start=15) "Compression rate"; + Real is_eff(start=0.85) "Isentropic efficiency"; + Units.SI.Power Wcp(start=1e9) "Compressor power"; + Units.SI.AbsolutePressure Pe(start=1e5) "Air pressure at the inlet"; + Units.SI.AbsolutePressure Ps(start=15e5) "Air pressure at the outlet"; + Real Xtau( start=1) "Normal and nominal compression rates ratio"; + Units.SI.MassFlowRate Q(start=500) "Air mass flow rate"; + Units.SI.VolumeFlowRate Qv(start=500) "Air volume flow rate"; + Units.SI.Temperature Te(start=300) "Air temperature at the inlet"; + Units.SI.Temperature Ts(start=750) "Air temperature at the outlet"; + Units.SI.Temperature Tis(start=750) + "Isentropic air temperature at the outlet"; + Units.SI.SpecificEnthalpy He(start=80e3) "Air specific enthalpy at the inlet"; + Units.SI.SpecificEnthalpy Hs(start=500e3) + "Air specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy His(start=450e3) + "Air specific enthalpy after the isentropic compression"; + Units.SI.SpecificEntropy Se "Air specific entropy at the inlet"; + Units.SI.Density rho_e(start=1) "Air density at the inlet"; + +public + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation=0))); + + Medium.ThermodynamicState state_e; + Medium.ThermodynamicState state_s; equation -/* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "Compressor: the fluid type must be flue gases"); Ce.Q = Cs.Q; + Ce.h_vol_1 = Cs.h_vol_1; Ce.h_vol_2 = Cs.h_vol_2; + Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false; Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false; + Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - Ce.ftype = Cs.ftype; - Ce.Xco2 = Cs.Xco2; - Ce.Xh2o = Cs.Xh2o; - Ce.Xo2 = Cs.Xo2; - Ce.Xso2 = Cs.Xso2; + + Ce.SubC = Cs.SubC; + + Ce.Xi = Cs.Xi; + Q = Ce.Q; + Pe = Ce.P; Ps = Cs.P; + He = Ce.h; Hs = Cs.h; - ftype = Ce.ftype; -/* Compression rate */ + + /* Compression rate */ tau = Ps/Pe; -/* Compression rates ratio */ + + /* Compression rates ratio */ Xtau = tau/tau_n; -/* Isentropic efficiency */ + + /* Isentropic efficiency */ is_eff = (A4*Xtau^4 + A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n; -/* Compressor power */ + + /* Compressor power */ Wcp = Q*(He - Hs); Power.signal = Wcp; -/* Volume flow rate at the inlet */ + + /* Volume flow rate at the inlet */ Qv_cal = if (Te < Tmax) then coef1_1*Te + coef2_1 else coef1_2*Te + coef2_2; Q = if (mass_flow_rate_comp == 1) then Qv*rho_e else Qv_cal*rho_e; -/* Specific enthalpy at the inlet */ -//Te = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -// Call implicitly to avoid function that cannot be differentiated. - He = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -/* Specific entropy at the inlet */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -/* Specific enthalpy after the isentropic compression */ - Se = ThermoSysPro.Properties.FlueGases.FlueGases_s(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - His = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Tis, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -/* Fluid density at the inlet */ -//rho_e = ThermoSysPro.Properties.Fluid.Density_Ph(Pe, He, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - rho_e = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pe, Te, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -/* Specific enthalpy at the outlet */ + + /* Specific enthalpy at the inlet */ + // Call implicitly to avoid function that cannot be differentiated. + state_e = Medium.setState_pTX(Pe,Te,Ce.Xi); + He = Medium.specificEnthalpy_pTX(Pe,Te,Ce.Xi); + /* Specific entropy at the inlet */ + Se = Medium.specificEntropy(state_e); + + /* Specific enthalpy after the isentropic compression */ + state_s= Medium.setState_psX(Ps,Se,Ce.Xi); + Tis = Medium.temperature(state_s); + His = Medium.specificEnthalpy(state_s); + + /* Fluid density at the inlet */ + rho_e = Medium.density(state_e); + + /* Specific enthalpy at the outlet */ Hs = (His - He + is_eff*He)/is_eff; -/* Temperature at the outlet */ -// Ts = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ps, Hs, fluid, 0, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); -// Call implicitly to avoid function that cannot be differentiated. - Hs = ThermoSysPro.Properties.FlueGases.FlueGases_h(Ps, Ts, Ce.Xco2, Ce.Xh2o, Ce.Xo2, Ce.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-120, -100}, {120, 100}}), graphics = {Polygon(points = {{-80, 80}, {-80, -80}, {80, -40}, {80, 40}, {-80, 80}}, lineColor = {0, 0, 0}, fillColor = {0, 255, 0}, fillPattern = FillPattern.Backward)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-120, -100}, {120, 100}}), graphics = {Polygon(points = {{-80, 80}, {-80, -80}, {80, -40}, {80, 40}, {-80, 80}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Backward)}), + + /* Temperature at the outlet */ + // Call implicitly to avoid function that cannot be differentiated. + Hs= Medium.specificEnthalpy_pTX(Ps,Ts,Ce.Xi); + annotation ( + + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{ + 120,100}}), graphics={Polygon( + points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}}, + lineColor={0,0,0}, + fillColor={0,255,0}, + fillPattern=FillPattern.Backward)}), + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120, + 100}}), graphics={Polygon( + points={{-80,80},{-80,-80},{80,-40},{80,40},{-80,80}}, + lineColor={0,0,0}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Backward)}), Documentation(revisions = " Author @@ -106,4 +138,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 11.3 of the ThermoSysPro book. ")); -end Compressor; \ No newline at end of file +end Compressor; diff --git a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo index 36bc9dc9..065776b9 100644 --- a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo +++ b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo @@ -1,72 +1,103 @@ within ThermoSysPro.Fluid.Machines; - model HeatPumpCompressor "Heat pump compressor " - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real pi = 10.0 "Compression factor (Ps/Pe)"; - parameter Real eta = 0.85 "Isentropic efficiency"; - parameter Units.SI.Power W_fric = 0.0 "Power losses due to hydrodynamic friction (percent)"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + replaceable package Medium = ThermoSysPro.Properties.Media.C3H3F5 constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium + "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real pi=10.0 "Compression factor (Ps/Pe)"; + parameter Real eta=0.85 "Isentropic efficiency"; + parameter Units.SI.Power W_fric=0.0 + "Power losses due to hydrodynamic friction (percent)"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + +public Units.SI.Power W "Mechanical power delivered to the compressor"; Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.SpecificEnthalpy His "Fluid specific enthalpy after isentropic compression"; - Units.SI.AbsolutePressure Pe(start = 10e5) "Inlet pressure"; - Units.SI.AbsolutePressure Ps(start = 10e5) "Outlet pressure"; + Units.SI.SpecificEnthalpy His + "Fluid specific enthalpy after isentropic compression"; + Units.SI.AbsolutePressure Pe(start=10e5) "Inlet pressure"; + Units.SI.AbsolutePressure Ps(start=10e5) "Outlet pressure"; Units.SI.Temperature Te "Inlet temperature"; Units.SI.Temperature Ts "Outlet temperature"; - Real xm(start = 1.0) "Average vapor mass fraction"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); + Real xm(start=1.0) "Average vapor mass fraction"; + + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); +public + Medium.ThermodynamicState state_e "Fluid thermodynamic state before the compression"; + Medium.ThermodynamicState state_s "Fluid thermodynamic state after the compression"; + Medium.ThermodynamicState state_is + "Fluid thermodynamic state after the isentropic compression"; equation -/* Check that the fluid type is C3H3F5 */ - assert(ftype == FluidType.C3H3F5, "HeatPumpCompressor: the fluid type must be C3H3F5"); + C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.SubC = C2.SubC; + C1.Xi = C2.Xi; + Q = C1.Q; Pe = C1.P; Ps = C2.P; - ftype = C1.ftype; -/* Mechnical power delivered to the compressor */ - W = Q*(C2.h - C1.h)/(1 - W_fric/100); -/* Compression factor */ + + /* Mechnical power delivered to the compressor */ + W = Q*(C2.h - C1.h) / (1 - W_fric/100); + + /* Compression factor */ pi = Ps/Pe; -/* Average vapor mass fraction */ - xm = (proe.x + pros.x)/2.0; -/* Compression efficiency */ + + /* Average vapor mass fraction */ + xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s))/2.0; + + /* Compression efficiency */ His - C1.h = max(xm, 0.01)*eta*(C2.h - C1.h); -/* Fluid thermodynamic properties before the compression */ - proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, 0, fluid); - Te = proe.T; -/* Fluid thermodynamic properties after the compression */ - pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, 0, fluid); - Ts = pros.T; -/* Fluid thermodynamic properties after the identropic compression */ - props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, 0, fluid); - His = props.h; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{-60, 80}, {60, 20}, {60, -20}, {-60, -80}}, color = {0, 0, 255})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Line(points = {{-60, 80}, {60, 20}, {60, -20}, {-60, -80}}, color = {0, 0, 255})}), - Window(x = 0.17, y = 0.1, width = 0.76, height = 0.76), + + /* Fluid thermodynamic properties before the compression */ + state_e = Medium.setState_phX(Pe, C1.h, C1.Xi); + Te = Medium.temperature(state_e); + + /* Fluid thermodynamic properties after the compression */ + state_s = Medium.setState_phX(Ps, C2.h, C2.Xi); + Ts = Medium.temperature(state_s); + + /* Fluid thermodynamic properties after the identropic compression */ + state_is = Medium.setState_psX(Ps, Medium.specificEntropy(state_e), C1.Xi); + His = Medium.specificEnthalpy(state_is); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid), Line(points={{-60,80},{60,20},{60,-20}, + {-60,-80}}, color={0,0,255})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid),Line(points={{-60,80},{60,20},{60,-20}, + {-60,-80}}, color={0,0,255})}), + Window( + x=0.17, + y=0.1, + width=0.76, + height=0.76), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -77,4 +108,4 @@ Benoît Bride Daniel Bouskela ")); -end HeatPumpCompressor; \ No newline at end of file +end HeatPumpCompressor; diff --git a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo index 9fc0d703..b2a953da 100644 --- a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo +++ b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo @@ -1,85 +1,119 @@ -within ThermoSysPro.Fluid.Machines; - +within ThermoSysPro.Fluid.Machines; model InternalCombustionEngine "Internal combustion engine with electrical output" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Integer mechanical_efficiency_type = 1 "1: fixed nominal efficiency - 2: Linear efficiency using Coef_Rm_a, Coef_Rm_b and Coef_Rm_c - 3: Beau de Rochas cycle efficiency"; - parameter Real Rmeca_nom = 0.40 "Fixed nominal mechanical efficiency (active if mechanical_efficiency_type=1)"; - parameter Real Coef_Rm_a = -5.727E-09 "Coefficient a for the linear mechanical efficiency (active if mechanical_efficiency_type=2)"; - parameter Real Coef_Rm_b = 4.5267E-05 "Coefficient b for the linear mechanical efficiency (active if mechanical_efficiency_type=2)"; - parameter Real Coef_Rm_c = 0.312412946 "Coefficient c for the linear mechanical efficiency (active if mechanical_efficiency_type=2)"; - parameter Real Relec = 0.97 "Engine electrical efficiency"; - parameter Real Cosphi = 1 "Cos(phi) of the electrical grid"; - parameter Real Xpth = 0.03 "Thermal loss fraction - cooling (0-1 sur Q.PCI)"; - parameter Real Xref = 0.2 "Cooling power fraction (0-1 sur Q.PCI)"; - parameter Real MMg = 30 "Gas average molar mass (g/mol)"; - parameter Real DPe = 0 "Water pressure loss as percent of the pressure at the inlet"; - parameter ThermoSysPro.Units.SI.PressureDifference DPaf = 0 "Pressure difference between the air pressure at the inlet and the flue gases pressure at the outlet"; - parameter Real RV = 6 "Engine volume ratio (> 1)"; - parameter Real Kc = 1.2 "Compression polytropic coefficient"; - parameter Real Kd = 1.4 "Expansion polytropic coefficient"; - parameter Real Gamma = 1.3333 "Flue gases gamma = Cp/Cv"; - parameter Units.SI.MassFlowRate gamma_diff_ws = 1e-4 "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Units.SI.MassFlowRate Qsf(start = 400) "Flue gases mass flow rate at the outlet"; - Units.SI.AbsolutePressure Psf(start = 12e5) "Flue gases pressure at the outlet"; - Units.SI.Temperature Tsf(start = 1500) "Flue gases temperature at the outlet"; - Real XsfCO2(start = 0.5) "Flue gases CO2 mass fraction at the outlet"; - Real XsfH2O(start = 0.1) "Flue gases H2O mass fraction at the outlet"; - Real XsfO2(start = 0) "Flue gases O2 mass fraction at the outlet"; - Real XsfSO2(start = 0) "Flue gases SO2 mass fraction at the outlet"; - Real Rmeca(start = 0.3) "Engine mechanical efficiency"; - Units.SI.Power Wmeca(start = 5e8) "Engine mechanical power"; - Units.SI.Power Welec(start = 5e8) "Engine electrical power"; - Units.SI.Power Wact(start = 5e8) "Active power"; - Units.SI.Power Wcomb(start = 5e8) "Fuel power available (Q.PCS)"; - Units.SI.Power Wpth_ref(start = 1e6) "Power of thermal losses + cooling"; - Real exc(start = 1) "Combustion air ratio"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Integer mechanical_efficiency_type=1 "1: fixed nominal efficiency - 2: Linear efficiency using Coef_Rm_a, Coef_Rm_b and Coef_Rm_c - 3: Beau de Rochas cycle efficiency"; + parameter Real Rmeca_nom=0.40 "Fixed nominal mechanical efficiency (active if mechanical_efficiency_type=1)"; + parameter Real Coef_Rm_a=-5.727E-09 "Coefficient a for the linear mechanical efficiency (active if mechanical_efficiency_type=2)"; + parameter Real Coef_Rm_b=4.5267E-05 "Coefficient b for the linear mechanical efficiency (active if mechanical_efficiency_type=2)"; + parameter Real Coef_Rm_c=0.312412946 "Coefficient c for the linear mechanical efficiency (active if mechanical_efficiency_type=2)"; + parameter Real Relec=0.97 "Engine electrical efficiency"; + parameter Real Cosphi=1 "Cos(phi) of the electrical grid"; + parameter Real Xpth=0.03 "Thermal loss fraction - cooling (0-1 sur Q.PCI)"; + parameter Real Xref=0.2 "Cooling power fraction (0-1 sur Q.PCI)"; + parameter Real MMg=30 "Gas average molar mass (g/mol)"; + parameter Real DPe=0 "Water pressure loss as percent of the pressure at the inlet"; + parameter ThermoSysPro.Units.SI.PressureDifference DPaf=0 + "Pressure difference between the air pressure at the inlet and the flue gases pressure at the outlet"; + parameter Real RV=6 "Engine volume ratio (> 1)"; + parameter Real Kc=1.2 "Compression polytropic coefficient"; + parameter Real Kd=1.4 "Expansion polytropic coefficient"; + parameter Real Gamma=1.3333 "Flue gases gamma = Cp/Cv"; + parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4 + "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Real amC=12.01115 "Carbon atomic mass"; + constant Real amH=1.00797 "Hydrogen atomic mass"; + constant Real amO=15.9994 "Oxygen atomic mass"; + constant Real amS=32.064 "Sulfur atomic mass"; + constant Real amCO2=amC+2*amO "CO2 molecular mass"; + constant Real amH2O=2*amH+amO "H2O molecular mass"; + constant Real amSO2=amS+2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.MassFlowRate Qsf(start=400) + "Flue gases mass flow rate at the outlet"; + Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet"; + Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet"; + Real XsfCO2(start=0.5) "Flue gases CO2 mass fraction at the outlet"; + Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet"; + Real XsfO2(start=0) "Flue gases O2 mass fraction at the outlet"; + Real XsfSO2(start=0) "Flue gases SO2 mass fraction at the outlet"; + Real Rmeca(start=0.3) "Engine mechanical efficiency"; + Units.SI.Power Wmeca(start=5e8) "Engine mechanical power"; + Units.SI.Power Welec(start=5e8) "Engine electrical power"; + Units.SI.Power Wact(start=5e8) "Active power"; + Units.SI.Power Wcomb(start=5e8) "Fuel power available (Q.PCS)"; + Units.SI.Power Wpth_ref(start=1e6) "Power of thermal losses + cooling"; + Real exc(start=1) "Combustion air ratio"; Real PCScomb "Pouvoir Calorifique Supérieur du combustible sur brut(en J/kg)"; - Units.SI.Temperature Tm(start = 500) "Air-gas mixture temperature"; - Units.SI.Temperature Tfcp(start = 500) "Temperature at the end of the compression phase"; - Units.SI.AbsolutePressure Pfcp(start = 12e5) "Pressure at the end of the compression phase"; - Units.SI.Temperature Tfcb(start = 500) "Temperature at the end of the combustion phase"; - Units.SI.AbsolutePressure Pfcb(start = 12e5) "Pressure at the end of the combustion phase"; - Units.SI.Temperature Tfd(start = 500) "Temperature at the end of the expansion phase"; - Units.SI.AbsolutePressure Pfd(start = 12e5) "Pressure at the end of the expansion phase"; - Units.SI.Temperature Tfe(start = 500) "Temperature at the exhaust"; - Units.SI.SpecificEnthalpy Hea(start = 50e3) "Air specific enthalpy at the inlet"; - Units.SI.SpecificEnthalpy Hsf(start = 50e4) "Flue gases specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy Hcomb(start = 10e3) "Fuel specific enthalpy at the inlet"; - Units.SI.SpecificEnthalpy Hrfum(start = 10e3) "Flue gases reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrair(start = 10e3) "Air reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrcomb(start = 10e3) "Fuel reference specific enthalpy"; - Units.SI.MassFlowRate Qea(start = 400) "Air mass flow rate at the inlet"; - Units.SI.AbsolutePressure Pea(start = 1e5) "Air pressure at the inlet"; - Units.SI.Temperature Tea(start = 600) "Air temperature at the inlet"; - Real XeaCO2(start = 0) "Air CO2 mass fraction at the inlet"; - Real XeaH2O(start = 0.1) "Air H2O mass fraction at the inlet"; - Real XeaO2(start = 0.2) "Air O2 mass fraction at the inlet"; - Real XeaSO2(start = 0) "Air SO2 mass fraction at the inlet"; - Units.SI.SpecificHeatCapacity Cpair(start = 1000) "Air specific heat capacity"; - Units.SI.MassFlowRate Qcomb(start = 5) "Fuel mass flow rate"; - Units.SI.Temperature Tcomb(start = 300) "Fuel temperature"; - Real XCcomb(start = 0.8) "Fuel carbon fraction"; - Real XHcomb(start = 0.2) "Fuel hydrogen fraction"; - Real XOcomb(start = 0) "Fuel oxygen fraction"; - Real XScomb(start = 0) "Fuel sulfur fraction"; - Real XEAUcomb(start = 0) "Fuel H2O fraction"; - Real XCDcomb(start = 0) "Fuel ashes fraction"; - Real PCIcomb(start = 5e7) "Fuel PCI (J/kg)"; - Units.SI.SpecificHeatCapacity Cpcomb(start = 1000) "Fuel specific heat capacity"; - Units.SI.MassFlowRate Qe(start = 1) "Water mass flow rate"; - Units.SI.SpecificEnthalpy Hev(start = 10e3) "Water specific enthalpy at the inlet"; - Units.SI.Density rhoea(start = 0.001) "Air density at the inlet"; - Units.SI.Density rhosf(start = 0.001) "Flue gases density at the outlet"; - Units.SI.SpecificEnthalpy Hsv(start = 10e3) "Water specific enthalpy at the outlet"; - Real MMairgaz(start = 30) "Air/gas mixture molecular mass (g/mol)"; - Real MMfumees(start = 30) "Flue gases molecular mass (g/mol)"; - FluidType fluids[2] "Fluids mixing in volume"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Flue gases specific enthalpy"; + Units.SI.Temperature Tm(start=500) "Air-gas mixture temperature"; + Units.SI.Temperature Tfcp(start=500) + "Temperature at the end of the compression phase"; + Units.SI.AbsolutePressure Pfcp(start=12e5) + "Pressure at the end of the compression phase"; + Units.SI.Temperature Tfcb(start=500) + "Temperature at the end of the combustion phase"; + Units.SI.AbsolutePressure Pfcb(start=12e5) + "Pressure at the end of the combustion phase"; + Units.SI.Temperature Tfd(start=500) + "Temperature at the end of the expansion phase"; + Units.SI.AbsolutePressure Pfd(start=12e5) + "Pressure at the end of the expansion phase"; + Units.SI.Temperature Tfe(start=500) "Temperature at the exhaust"; + Units.SI.SpecificEnthalpy Hea(start=50e3) + "Air specific enthalpy at the inlet"; + Units.SI.SpecificEnthalpy Hsf(start=50e4) + "Flue gases specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy Hcomb(start=10e3) + "Fuel specific enthalpy at the inlet"; + Units.SI.SpecificEnthalpy Hrfum(start=10e3) + "Flue gases reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrcomb(start=10e3) + "Fuel reference specific enthalpy"; + Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet"; + Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet"; + Units.SI.Temperature Tea(start=600) "Air temperature at the inlet"; + Real XeaCO2(start=0) "Air CO2 mass fraction at the inlet"; + Real XeaH2O(start=0.1) "Air H2O mass fraction at the inlet"; + Real XeaO2(start=0.2) "Air O2 mass fraction at the inlet"; + Real XeaSO2(start=0) "Air SO2 mass fraction at the inlet"; + Units.SI.SpecificHeatCapacity Cpair(start=1000) "Air specific heat capacity"; + Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate"; + Units.SI.Temperature Tcomb(start=300) "Fuel temperature"; + Real XCcomb(start=0.8) "Fuel carbon fraction"; + Real XHcomb(start=0.2) "Fuel hydrogen fraction"; + Real XOcomb(start=0) "Fuel oxygen fraction"; + Real XScomb(start=0) "Fuel sulfur fraction"; + Real XEAUcomb(start=0) "Fuel H2O fraction"; + Real XCDcomb(start=0) "Fuel ashes fraction"; + Real PCIcomb(start=5e7) "Fuel PCI (J/kg)"; + Units.SI.SpecificHeatCapacity Cpcomb(start=1000) + "Fuel specific heat capacity"; + Units.SI.MassFlowRate Qe(start=1) "Water mass flow rate"; + Units.SI.SpecificEnthalpy Hev(start=10e3) + "Water specific enthalpy at the inlet"; + Units.SI.Density rhoea(start=0.001) "Air density at the inlet"; + Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet"; + Units.SI.SpecificEnthalpy Hsv(start=10e3) + "Water specific enthalpy at the outlet"; + Real MMairgaz(start=30) "Air/gas mixture molecular mass (g/mol)"; + Real MMfumees(start=30) "Flue gases molecular mass (g/mol)"; + Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy"; Units.SI.Power Jair "Thermal power diffusion from inlet Cair"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; Units.SI.Power J "Total thermal power diffusion"; @@ -87,54 +121,60 @@ model InternalCombustionEngine "Internal combustion engine with electrical outpu Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg"; Real rair "Value of r(Q/gamma) for inlet Cair"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws = Integer(ftype_ws) "Water/steam fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation( - Placement(transformation(extent = {{-80, -100}, {-60, -80}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cair "Air inlet" annotation( - Placement(transformation(extent = {{-10, -100}, {10, -80}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" annotation( - Placement(transformation(extent = {{-10, 80}, {10, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 "Water inlet" annotation( - Placement(transformation(extent = {{-100, -10}, {-80, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 "Water/steam outlet" annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}, rotation = 0))); -protected - constant Real amC = 12.01115 "Carbon atomic mass"; - constant Real amH = 1.00797 "Hydrogen atomic mass"; - constant Real amO = 15.9994 "Oxygen atomic mass"; - constant Real amS = 32.064 "Sulfur atomic mass"; - constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; - constant Real amH2O = 2*amH + amO "H2O molecular mass"; - constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" + annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cair(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation ( + Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation ( + Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) "Water inlet" + annotation ( + Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) + "Water/steam outlet" annotation ( + Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cair.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other"); -// ---------------- -// Water/steam side - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam"); + + assert(Medium_FlueGases.nX > 1, "InternalCombustionEngine: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "InternalCombustionEngine: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + // ---------------- + // Water/steam side + Cws1.Q = Cws2.Q; + Cws1.h_vol_1 = Cws2.h_vol_1; Cws1.h_vol_2 = Cws2.h_vol_2; + Cws2.diff_on_1 = if (gamma_diff_ws > 0) then Cws1.diff_on_1 else false; Cws1.diff_on_2 = if (gamma_diff_ws > 0) then Cws2.diff_on_2 else false; + Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); - Cws1.ftype = Cws2.ftype; - Cws1.Xco2 = Cws2.Xco2; - Cws1.Xh2o = Cws2.Xh2o; - Cws1.Xo2 = Cws2.Xo2; - Cws1.Xso2 = Cws2.Xso2; - ftype_ws = Cws1.ftype; + + Cws1.Xi = Cws2.Xi; + Cws1.SubC = Cws2.SubC; + Xws = Cws1.Xi; + SubCws = Cws1.SubC; + Qe = Cws1.Q; Hev = Cws1.h; Hsv = Cws2.h; -// --------------- -// Combustion side -/* Fuel inlet */ + + // --------------- + // Combustion side + + /* Fuel inlet */ Qcomb = Cfuel.Q; Tcomb = Cfuel.T; XCcomb = Cfuel.Xc; @@ -145,115 +185,226 @@ equation XCDcomb = Cfuel.Xashes; PCIcomb = Cfuel.LHV; Cpcomb = Cfuel.cp; -/* Air inlet */ + + /* Air inlet */ Qea = Cair.Q; Pea = Cair.P; - Hea = Cair.h; -/***/ - XeaCO2 = Cair.Xco2; - XeaH2O = Cair.Xh2o; - XeaO2 = Cair.Xo2; - XeaSO2 = Cair.Xso2; -/* Flue gases outlet */ + Hea = Cair.h; /***/ + + Xea[1:Medium_FlueGases.nXi] = Cair.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Cair.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; -/* Mass balance equation for the flue gases */ + + /* Mass balance equation for the flue gases */ 0 = Qcomb + Qea - Qsf; -/* Energy balance equation for the flue gases */ + + /* Energy balance equation for the flue gases */ 0 = Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair) - Qsf*(Hsf - Hrfum) - Wpth_ref - Wmeca + J; + Hcomb = Cpcomb*(Tcomb - 273.15); + Cair.h_vol_2 = h; Cfg.h_vol_1 = h; -/* Thermal losses */ + + /* Thermal losses */ Wpth_ref = Qcomb*PCIcomb*(Xpth + Xref); Qe*(Hsv - Hev) = Qcomb*PCIcomb*Xref; -/* Fuel thermal power available */ + + /* Fuel thermal power available */ PCScomb = PCIcomb + 224.3e5*XHcomb + 25.1e5*XEAUcomb; Wcomb = Qcomb*PCIcomb; -/* Flue gases composition balance equations */ + + /* Flue gases composition balance equations */ 0 = Qcomb*XCcomb*amCO2/amC + Qea*XeaCO2 - Qsf*XsfCO2; 0 = Qcomb*XHcomb*(amH2O/2)/amH + Qea*XeaH2O - XsfH2O*Qsf; 0 = Qea*XeaO2 - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - XsfO2*Qsf; 0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - XsfSO2*Qsf; - Cfg.ftype = ftype; - Cfg.Xco2 = XsfCO2; - Cfg.Xh2o = XsfH2O; - Cfg.Xo2 = XsfO2; - Cfg.Xso2 = XsfSO2; -/* No flow reversal */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Cair.SubC; + SubCfg = Cfg.SubC; + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then rair = if Cair.diff_on_1 then exp(-0.033*(Cair.Q*Cair.diff_res_1)^2) else 0; rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0; + gamma_air = if Cair.diff_on_1 then 1/Cair.diff_res_1 else gamma0; gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0; + Jair = if Cair.diff_on_1 then rair*gamma_air*(Cair.h_vol_1 - Cair.h_vol_2) else 0; Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0; else rair = 0; rfg = 0; + gamma_air = gamma0; gamma_fg = gamma0; + Jair = 0; Jfg = 0; end if; + J = Jair + Jfg; + Cair.diff_res_2 = 0; Cfg.diff_res_1 = 0; + Cair.diff_on_2 = diffusion; Cfg.diff_on_1 = diffusion; -/* Air thermodynamic properties at the inlet */ + + /* Air thermodynamic properties at the inlet */ Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); Cpair = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); -/* Flue gases thermodynamic properties at the outlet */ + + /* Flue gases thermodynamic properties at the outlet */ Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); -// -------------------- -// BEAU DE ROCHAS CYCLE -/* (1) Air and gas mixing at constant pressure Pea */ + + // -------------------- + // BEAU DE ROCHAS CYCLE + + /* (1) Air and gas mixing at constant pressure Pea */ Tm = (Qcomb*Cpcomb*Tcomb + Qea*Cpair*Tea)/(Qcomb*Cpcomb + Qea*Cpair); -/* (2) Polytropic compression */ + + /* (2) Polytropic compression */ Tfcp = Tm*RV^(Kc - 1); Pfcp = Pea*RV^Kc; -/* (3) Constant volume combustion (point mort haut) */ + + /* (3) Constant volume combustion (point mort haut) */ MMairgaz = (Qea*28.9 + Qcomb*MMg)/(Qea + Qcomb); MMfumees = (1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2)*28 + XsfCO2*44 + XsfH2O*18 + XsfO2*32 + XsfSO2*64; Pfcb = Pfcp*Tfcb/Tfcp*MMairgaz/MMfumees; -//Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp; + //Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp; Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp; -/* (4) Polytropic expansion */ - Tfd = Tfcb*(1/RV)^(Kd - 1); - Pfd = Pfcb*(1/RV)^Kd; -/* (5) Echappement */ + + /* (4) Polytropic expansion */ + Tfd = Tfcb *(1/RV)^(Kd - 1); + Pfd = Pfcb *(1/RV)^Kd; + + /* (5) Echappement */ Tfe = Tfd*(Psf/Pfd)^((Gamma - 1)/Gamma); -// -------------------- -/* Efficiency and mechanical power */ + + // -------------------- + + /* Efficiency and mechanical power */ if (mechanical_efficiency_type == 1) then Rmeca = Rmeca_nom; elseif (mechanical_efficiency_type == 2) then - Rmeca = Coef_Rm_a*Wcomb/1000*Wcomb/1000 + Coef_Rm_b*Wcomb/1000 + Coef_Rm_c; + Rmeca = Coef_Rm_a * Wcomb/1000*Wcomb/1000 + Coef_Rm_b*Wcomb/1000 + Coef_Rm_c; else - Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair)) - (Qsf*(ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfe, XsfCO2, XsfH2O, XsfO2, XsfSO2) - Hrfum) + Wpth_ref))/Wcomb; + Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair)) + -(Qsf*(ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfe, XsfCO2, XsfH2O, XsfO2, XsfSO2) + -Hrfum) + Wpth_ref))/Wcomb; end if; + Wmeca = Rmeca*Wcomb; -/* Combustion air ratio */ + + /* Combustion air ratio */ exc = Qea*(1 - XeaH2O)/((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO))/(XeaO2/(1 - XeaH2O))); -/* Pressure losses */ + + /* Pressure losses */ Pea - Psf = DPaf; Cws2.P = if (Qe > 0) then Cws1.P - DPe*Cws1.P/100 else Cws1.P + DPe*Cws1.P/100; -/* Electrical power produced and active power*/ + + /* Electrical power produced and active power*/ Welec = Wmeca*Relec; Wact = Welec*Cosphi; -/* Reference specific enthalpies */ + + /* Reference specific enthalpies */ Hrair = 2501.569e3*XeaH2O; Hrcomb = 0; Hrfum = 2501.569e3*XsfH2O; - annotation( - Diagram(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{-10, -64}, {4, -46}, {0, -56}, {18, -54}, {2, -60}, {22, -66}, {6, -64}, {-10, -76}, {-2, -66}, {-10, -64}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-46, -42}, {-46, 0}, {-6, 0}, {-6, 58}, {0, 50}, {6, 58}, {6, 0}, {48, 0}, {48, -42}, {-46, -42}}, lineColor = {0, 0, 0}, fillColor = {170, 255, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{-80, 30}, {-34, 30}, {-34, 54}, {38, 54}, {38, 30}, {80, 30}, {80, 38}, {46, 38}, {46, 62}, {-42, 62}, {-42, 38}, {-80, 38}, {-80, 30}}, lineColor = {28, 108, 200}, pattern = LinePattern.None, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-112, 32}, {-82, 4}}, lineColor = {28, 108, 200}, textString = "Water inlet"), Text(extent = {{82, 34}, {116, 2}}, lineColor = {238, 46, 47}, textString = "Water outlet"), Text(extent = {{14, -80}, {38, -100}}, lineColor = {28, 108, 200}, textString = "Air inlet"), Text(extent = {{14, 112}, {62, 76}}, lineColor = {238, 46, 47}, textString = "Flue gases outlet"), Text(extent = {{-112, -76}, {-82, -104}}, lineColor = {28, 108, 200}, textString = "Fuel inlet")}), - Icon(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{-10, -64}, {4, -46}, {0, -56}, {18, -54}, {2, -60}, {22, -66}, {6, -64}, {-10, -76}, {-2, -66}, {-10, -64}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-46, -42}, {-46, 0}, {-6, 0}, {-6, 58}, {0, 50}, {6, 58}, {6, 0}, {48, 0}, {48, -42}, {-46, -42}}, lineColor = {0, 0, 0}, fillColor = {170, 255, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{-80, 30}, {-34, 30}, {-34, 54}, {38, 54}, {38, 30}, {80, 30}, {80, 38}, {46, 38}, {46, 62}, {-42, 62}, {-42, 38}, {-80, 38}, {-80, 30}}, lineColor = {28, 108, 200}, pattern = LinePattern.None, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid)}), + + annotation (Diagram(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{ + -10,-76},{-2,-66},{-10,-64}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{ + 48,-42},{-46,-42}}, + lineColor={0,0,0}, + fillColor={170,255,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{ + 46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}}, + lineColor={28,108,200}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-112,32},{-82,4}}, + lineColor={28,108,200}, + textString="Water inlet"), + Text( + extent={{82,34},{116,2}}, + lineColor={238,46,47}, + textString="Water outlet"), + Text( + extent={{14,-80},{38,-100}}, + lineColor={28,108,200}, + textString="Air inlet"), + Text( + extent={{14,112},{62,76}}, + lineColor={238,46,47}, + textString="Flue gases outlet"), + Text( + extent={{-112,-76},{-82,-104}}, + lineColor={28,108,200}, + textString="Fuel inlet")}), + Icon(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-10,-64},{4,-46},{0,-56},{18,-54},{2,-60},{22,-66},{6,-64},{ + -10,-76},{-2,-66},{-10,-64}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-46,-42},{-46,0},{-6,0},{-6,58},{0,50},{6,58},{6,0},{48,0},{ + 48,-42},{-46,-42}}, + lineColor={0,0,0}, + fillColor={170,255,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-80,30},{-34,30},{-34,54},{38,54},{38,30},{80,30},{80,38},{ + 46,38},{46,62},{-42,62},{-42,38},{-80,38},{-80,30}}, + lineColor={28,108,200}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid)}), Documentation(revisions = " Author @@ -264,4 +415,4 @@ Benoît Bride ## ThermoSysPro Version 4.2 This component model is documented in Chapter 15 of the ThermoSysPro book. ")); -end InternalCombustionEngine; \ No newline at end of file +end InternalCombustionEngine; diff --git a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo index 75948fb9..f527ac45 100644 --- a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo @@ -1,53 +1,77 @@ within ThermoSysPro.Fluid.Machines; - model StaticCentrifugalPump "Static centrifugal pump" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot = 1400 "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)"; - parameter Units.SI.Power MPower = 0.1e6 "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)"; - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn = 1400 "Nominal rotational speed"; - parameter Real rm = 0.85 "Product of the pump mechanical and electrical efficiencies"; - parameter Integer fixed_rot_or_power = 1 "1: fixed rotational speed - 2: fixed mechanical power"; - parameter Boolean adiabatic_compression = false "true: compression at constant enthalpy - false: compression with varying enthalpy"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter Real a1 = -88.67 "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)"; - parameter Real a2 = 0 "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)"; - parameter Real a3 = 43.15 "Constant coef. of the pump characteristics hn = f(vol_flow) (m)"; - parameter Real b1 = -3.7751 "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)"; - parameter Real b2 = 3.61 "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)"; - parameter Real b3 = -0.0075464 "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)"; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.nonSI.AngularVelocity_rpm VRot=1400 + "Fixed rotational speed (active if fixed_rot_or_power=1 and rpm_or_mpower connector not connected)"; + parameter Units.SI.Power MPower=0.1e6 + "Fixed mechanical power (active if fixed_rot_or_power=2 and rpm_or_mpower connector not connected)"; + parameter Units.nonSI.AngularVelocity_rpm VRotn=1400 + "Nominal rotational speed"; + parameter Real rm=0.85 + "Product of the pump mechanical and electrical efficiencies"; + parameter Integer fixed_rot_or_power=1 + "1: fixed rotational speed - 2: fixed mechanical power"; + parameter Boolean adiabatic_compression=false + "true: compression at constant enthalpy - false: compression with varying enthalpy"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Real a1=-88.67 + "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)"; + parameter Real a2=0 + "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)"; + parameter Real a3=43.15 + "Constant coef. of the pump characteristics hn = f(vol_flow) (m)"; + + parameter Real b1=-3.7751 + "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)"; + parameter Real b2=3.61 + "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)"; + parameter Real b3=-0.0075464 + "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n + "Gravity constant"; + parameter Real eps=1.e-6 "Small number"; + parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings"; + +public Real rh "Hydraulic efficiency"; - Units.SI.Height hn(start = 10) "Pump head"; - Real R(start = VRot/VRotn) "Reduced rotational speed"; - Units.SI.MassFlowRate Q(start = 500) "Mass flow rate"; - Units.SI.VolumeFlowRate Qv(start = 0.5) "Volume flow rate"; + Units.SI.Height hn(start=10) "Pump head"; + Real R(start=VRot/VRotn) "Reduced rotational speed"; + Units.SI.MassFlowRate Q(start=500) "Mass flow rate"; + Units.SI.VolumeFlowRate Qv(start=0.5) "Volume flow rate"; Units.SI.Power Wh "Hydraulic power"; Units.SI.Power Wm "Mechanical power"; - ThermoSysPro.Units.nonSI.AngularVelocity_rpm Vr "Rotational speed"; - Units.SI.Density rho(start = 998) "Fluid density"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure variation between the outlet and the inlet"; - Units.SI.SpecificEnthalpy deltaH "Specific enthalpy variation between the outlet and the inlet"; - Units.SI.AbsolutePressure Pm(start = 1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid average specific enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal rpm_or_mpower annotation( - Placement(transformation(origin = {0, -110}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-6 "Small number"; - parameter Real rhmin = 0.20 "Minimum efficiency to avoid zero crossings"; + Units.nonSI.AngularVelocity_rpm Vr "Rotational speed"; + Units.SI.Density rho(start=998) "Fluid density"; + Units.SI.PressureDifference deltaP + "Pressure variation between the outlet and the inlet"; + Units.SI.SpecificEnthalpy deltaH + "Specific enthalpy variation between the outlet and the inlet"; + Units.SI.AbsolutePressure Pm(start=1.e5) + "Fluid average pressure"; + Units.SI.SpecificEnthalpy h(start=100000) + "Fluid average specific enthalpy"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package + Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package + Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal rpm_or_mpower + annotation (Placement(transformation( + origin={0,-110}, + extent={{-10,-10},{10,10}}, + rotation=90))); equation if (cardinality(rpm_or_mpower) == 0) then if (fixed_rot_or_power == 1) then @@ -58,25 +82,32 @@ equation assert(false, "StaticCentrifugalPump: incorrect option"); end if; end if; + C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; deltaP = C2.P - C1.P; deltaH = C2.h - C1.h; + deltaP = rho*g*hn; Q = Qv*rho; - ftype = C1.ftype; -/* Fixed rotational speed or fixed mechanical power */ + + /* Fixed rotational speed or fixed mechanical power */ if (fixed_rot_or_power == 1) then Vr = rpm_or_mpower.signal; elseif (fixed_rot_or_power == 2) then @@ -84,33 +115,66 @@ equation else assert(false, "StaticCentrifugalPump: incorrect option"); end if; -/* Energy balance equation */ + + /* Energy balance equation */ if adiabatic_compression then deltaH = 0; else deltaH = g*hn/rh; end if; -/* Reduced rotational speed */ + + /* Reduced rotational speed */ R = Vr/VRotn; -/* Pump characteristics */ + + /* Pump characteristics */ hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2); rh = noEvent(max(if (abs(R) > eps) then b1*Qv*abs(Qv)/R^2 + b2*Qv/R + b3 else b3, rhmin)); -/* Mechanical power */ + + /* Mechanical power */ Wm = Q*deltaH/rm; -/* Hydraulic power */ + + /* Hydraulic power */ Wh = Qv*deltaP/rh; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (C1.P + C2.P)/2; h = (C1.h + C2.h)/2; + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.Fluid.Density_Ph(Pm, h, fluid, mode, C1.Xco2, C1.Xh2o, C1.Xo2, C1.Xso2); + rho = Medium.density_phX(p=Pm, h=h, X=X); end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Line(points = {{-80, 0}, {80, 0}}), Line(points = {{80, 0}, {2, 60}}), Line(points = {{80, 0}, {0, -60}})}), - Window(x = 0.03, y = 0.02, width = 0.95, height = 0.95), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 255}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular)), Line(points = {{-80, 0}, {80, 0}}), Line(points = {{80, 0}, {2, 60}}), Line(points = {{80, 0}, {0, -60}})}), + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0}), + Line(points={{-80,0},{80,0}}), + Line(points={{80,0},{2,60}}), + Line(points={{80,0},{0,-60}})}), + Window( + x=0.03, + y=0.02, + width=0.95, + height=0.95), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({127,255,0}, fill_color_singular)), + Line(points={{-80,0},{80,0}}), + Line(points={{80,0},{2,60}}), + Line(points={{80,0},{0,-60}})}), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -121,6 +185,5 @@ Authors Daniel Bouskela Baligh El Hefni - "), - DymolaStoredErrors); -end StaticCentrifugalPump; \ No newline at end of file + ")); +end StaticCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Machines/StaticFan.mo b/ThermoSysPro/Fluid/Machines/StaticFan.mo index 3a2ebb0c..c1f94568 100644 --- a/ThermoSysPro/Fluid/Machines/StaticFan.mo +++ b/ThermoSysPro/Fluid/Machines/StaticFan.mo @@ -1,103 +1,165 @@ within ThermoSysPro.Fluid.Machines; - model StaticFan "Static fan" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot = 1400 "Rotational speed"; - parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn = 1400 "Nominal rotational speed"; - parameter Real rm = 0.85 "Product of the pump mechanical and electrical efficiencies"; - parameter Boolean adiabatic_compression = false "true: adiabatic compression - false: non adiabatic compression"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter Real a1 = -52.04 "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)"; - parameter Real a2 = -71.735 "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)"; - parameter Real a3 = 45.59 "Constant coef. of the pump characteristics hn = f(vol_flow) (m)"; - parameter Real b1 = -8.4818 "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)"; - parameter Real b2 = 4.6593 "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)"; - parameter Real b3 = -0.1533 "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)"; - Real rh(start = 0.5) "Hydraulic efficiency"; - Units.SI.Length hn(start = 10) "Pump head"; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRot=1400 + "Rotational speed"; + parameter ThermoSysPro.Units.nonSI.AngularVelocity_rpm VRotn=1400 + "Nominal rotational speed"; + parameter Real rm=0.85 "Product of the pump mechanical and electrical efficiencies"; + parameter Boolean adiabatic_compression=false "true: adiabatic compression - false: non adiabatic compression"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + parameter Real a1=-52.04 "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)"; + parameter Real a2=-71.735 "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)"; + parameter Real a3=45.59 "Constant coef. of the pump characteristics hn = f(vol_flow) (m)"; + + parameter Real b1=-8.4818 "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)"; + parameter Real b2=4.6593 "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)"; + parameter Real b3=-0.1533 "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Real eps=1.e-6 "Small number"; + parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings"; + +public + Real rh( start=0.5) "Hydraulic efficiency"; + Units.SI.Length hn(start=10) "Pump head"; Real R "Ratio VRot/VRotn (s.u.)"; - Units.SI.MassFlowRate Q(start = 500) "Mass flow"; - Units.SI.VolumeFlowRate Qv(start = 0.5) "Volumetric flow"; + Units.SI.MassFlowRate Q(start=500) "Mass flow"; + Units.SI.VolumeFlowRate Qv(start=0.5) "Volumetric flow"; Units.SI.Power Wh "Hydraulic power"; Units.SI.Power Wm "Motor power"; - Units.SI.Density rho(start = 998) "Fluid density"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure variation between the outlet and the inlet"; - Units.SI.SpecificEnthalpy deltaH "Specific enthalpy variation between the outlet and the inlet"; - Units.SI.AbsolutePressure P(start = 1.e5) "Fluid average pressure"; - Units.SI.SpecificEnthalpy h(start = 100000) "Fluid average specific enthalpy"; - Units.SI.Temperature T(start = 500) "Fluid temperature"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan annotation( - Placement(transformation(origin = {0, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation annotation( - Placement(transformation(origin = {0, -110}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Real eps = 1.e-6 "Small number"; - parameter Real rhmin = 0.20 "Minimum efficiency to avoid zero crossings"; + Units.SI.Density rho(start=998) "Fluid density"; + ThermoSysPro.Units.SI.PressureDifference deltaP + "Pressure variation between the outlet and the inlet"; + Units.SI.SpecificEnthalpy deltaH + "Specific enthalpy variation between the outlet and the inlet"; + Units.SI.AbsolutePressure P(start=1.e5) "Fluid average pressure"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid average specific enthalpy"; + Units.SI.Temperature T(start=500) "Fluid temperature"; + +public + ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan + annotation (Placement(transformation( + origin={0,110}, + extent={{-10,-10},{10,10}}, + rotation=270))); + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal VRotation + annotation (Placement(transformation( + origin={0,-110}, + extent={{-10,-10},{10,10}}, + rotation=90))); equation -/* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "StaticFan: the fluid type must be flue gases"); + if (cardinality(commandeFan) == 0) then commandeFan.signal = true; end if; + if (cardinality(VRotation) == 0) then VRotation.signal = VRot; end if; + C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - ftype = C1.ftype; + + C1.SubC = C2.SubC; + + C1.Xi = C2.Xi; + Q = C1.Q; Q = Qv*rho; + deltaP = C2.P - C1.P; deltaH = C2.h - C1.h; + deltaP = rho*g*hn; + if adiabatic_compression then deltaH = 0; else deltaH = g*hn/rh; end if; -/* Pump position (started or stopped) */ + + /* Pump position (started or stopped) */ R = if commandeFan.signal then VRotation.signal/VRotn else 0; -/* Pump characteristics */ + + /* Pump characteristics */ hn = noEvent(a1*Qv*abs(Qv) + a2*Qv*R + a3*R^2); rh = noEvent(max(if (abs(R) > eps) then b1*Qv^2/R^2 + b2*Qv/R + b3 else b3, rhmin)); -/* Mechanical power */ + + /* Mechanical power */ Wm = Q*deltaH/rm; -/* Hydraulic power */ + + /* Hydraulic power */ Wh = Qv*deltaP/rh; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ P = (C1.P + C2.P)/2; h = (C2.h + C1.h)/2; -// Temperature - h = ThermoSysPro.Properties.FlueGases.FlueGases_h(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2); + + // Temperature + h = Medium.specificEnthalpy_pTX(P, T, C2.Xi); + if (p_rho > 0) then rho = p_rho; else - rho = ThermoSysPro.Properties.FlueGases.FlueGases_rho(P, T, C2.Xco2, C2.Xh2o, C2.Xo2, C2.Xso2); + rho = Medium.density_pTX(P, T, C2.Xi); end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}), Polygon(points = {{-40, 92}, {40, 92}, {-40, -92}, {40, -92}, {-40, 92}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Backward), Polygon(points = {{-92, 40}, {-92, -40}, {92, 40}, {92, -40}, {-92, 40}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Backward)}), - Window(x = 0.03, y = 0.02, width = 0.95, height = 0.95), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}), Polygon(points = {{-40, 92}, {40, 92}, {-40, -92}, {40, -92}, {-40, 92}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Backward), Polygon(points = {{-92, 40}, {-92, -40}, {92, 40}, {92, -40}, {-92, 40}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Backward)}), + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}), + Polygon( + points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Backward), + Polygon( + points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Backward)}), + Window( + x=0.03, + y=0.02, + width=0.95, + height=0.95), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse(extent={{-100,100},{100,-100}}, lineColor={0,0,0}), + Polygon( + points={{-40,92},{40,92},{-40,-92},{40,-92},{-40,92}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Backward), + Polygon( + points={{-92,40},{-92,-40},{92,40},{92,-40},{-92,40}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Backward)}), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -107,6 +169,5 @@ Authors Daniel Bouskela Baligh El Hefni - "), - DymolaStoredErrors); -end StaticFan; \ No newline at end of file + ")); +end StaticFan; diff --git a/ThermoSysPro/Fluid/Machines/SteamEngine.mo b/ThermoSysPro/Fluid/Machines/SteamEngine.mo index 5edf52fd..22366c7f 100644 --- a/ThermoSysPro/Fluid/Machines/SteamEngine.mo +++ b/ThermoSysPro/Fluid/Machines/SteamEngine.mo @@ -1,68 +1,71 @@ within ThermoSysPro.Fluid.Machines; - model SteamEngine "Steam engine" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; + extends ThermoSysPro.Fluid.Interfaces.IconColors; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real caract[:, 2] = [0, 0; 15e5, 20.0] "Engine charateristics Q=f(deltaP)"; - parameter Real eta_is = 0.85 "Isentropic efficiency"; - parameter Real W_frot = 0.0 "Power losses due to hydrodynamic friction (percent)"; - parameter Real eta_stato = 1.0 "Efficiency to account for cinetic losses (<= 1) (s.u.)"; - parameter Integer option_interpolation = 1 "1: linear interpolation - 2: spline interpolation"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_e = IF97Region.All_regions "Inlet IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_s = IF97Region.All_regions "Outlet IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + parameter Real caract[:, 2]=[0, 0; 15e5, 20.0] "Engine charateristics Q=f(deltaP)"; + parameter Real eta_is=0.85 "Isentropic efficiency"; + parameter Real W_frot=0.0 "Power losses due to hydrodynamic friction (percent)"; + parameter Real eta_stato=1.0 "Efficiency to account for cinetic losses (<= 1) (s.u.)"; + parameter Integer option_interpolation=1 "1: linear interpolation - 2: spline interpolation"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter IF97Region region_e=IF97Region.All_regions "Inlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region_s=IF97Region.All_regions "Outlet IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + + Integer phase_e=if Integer(region_e) == 0 then 0 else if Integer(region_e)==4 then 2 else 1; + Integer phase_s=if Integer(region_s) == 0 then 0 else if Integer(region_s)==4 then 2 else 1; + +public Units.SI.Power W "Power produced by the engine"; Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.SpecificEnthalpy His "Fluid specific enthalpy after isentropic expansion"; + Units.SI.SpecificEnthalpy His + "Fluid specific enthalpy after isentropic expansion"; ThermoSysPro.Units.SI.PressureDifference deltaP "Pressure loss"; - Units.SI.AbsolutePressure Pe(start = 10e5) "Pressure at the inlet"; - Units.SI.AbsolutePressure Ps(start = 10e5) "Pressure at the outlet"; + Units.SI.AbsolutePressure Pe(start=10e5) "Pressure at the inlet"; + Units.SI.AbsolutePressure Ps(start=10e5) "Pressure at the outlet"; Units.SI.Temperature Te "Temperature at the inlet"; Units.SI.Temperature Ts "Temperature at the outlet"; - Real xm(start = 1.0, min = 0) "Average vapor mass fraction (n.u.)"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe annotation( - Placement(transformation(extent = {{-80, 80}, {-60, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros annotation( - Placement(transformation(extent = {{60, 80}, {80, 100}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-80, -10}, {-60, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{60, -10}, {80, 10}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props annotation( - Placement(transformation(extent = {{-80, 40}, {-60, 60}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_e = Integer(region_e) - 1 "Inlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_s = Integer(region_s) - 1 "Outlet IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Real xm(start=1.0,min=0) "Average vapor mass fraction (n.u.)"; + + + Medium.ThermodynamicState state_e; + Medium.ThermodynamicState state_s; + Medium.ThermodynamicState state_ps; + +public + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); equation -/* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "SteamEngine: the fluid type must be water/steam"); + C1.Q = C2.Q; + C1.h_vol_1 = C2.h_vol_1; C1.h_vol_2 = C2.h_vol_2; + C2.diff_on_1 = if (gamma_diff > 0) then C1.diff_on_1 else false; C1.diff_on_2 = if (gamma_diff > 0) then C2.diff_on_2 else false; + C2.diff_res_1 = C1.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); C1.diff_res_2 = C2.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; + + C1.SubC = C2.SubC; + + C1.Xi = C2.Xi; Q = C1.Q; Pe = C1.P; Ps = C2.P; deltaP = Pe - Ps; - ftype = C1.ftype; -/* Average vapor mass fraction during the expansion */ - xm = (proe.x + pros.x)/2.0; -/* Mass flow */ + + /* Average vapor mass fraction during the expansion */ + xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s)) /2.0; + + /* Mass flow */ if (option_interpolation == 1) then Q = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], deltaP); elseif (option_interpolation == 2) then @@ -70,23 +73,81 @@ equation else assert(false, "SteamEngine: incorrect interpolation option"); end if; -/* Fluid specific enthalpy at the outlet */ + + /* Fluid specific enthalpy at the outlet */ C2.h - C1.h = xm*eta_is*(His - C1.h); -/* Mechanical power produced by the engine */ + + /* Mechanical power produced by the engine */ W = Q*eta_stato*(C1.h - C2.h)*(1 - W_frot/100); -/* Fluid thermodynamic properties before the expansion */ - proe = ThermoSysPro.Properties.Fluid.Ph(Pe, C1.h, mode_e, fluid); - Te = proe.T; -/* Fluid thermodynamic properties after the expansion */ - pros = ThermoSysPro.Properties.Fluid.Ph(Ps, C2.h, mode_s, fluid); - Ts = pros.T; -/* Fluid thermodynamic properties after the isentropic expansion */ - props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_s, fluid); - His = props.h; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 100}, {-60, -100}, {60, -100}, {60, 100}, {-60, 100}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 100}, {20, 12}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-22, -16}, {30, -66}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, 60}, {24, -42}}, color = {0, 0, 255}), Rectangle(extent = {{-20, 80}, {20, 40}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Forward)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-60, 100}, {-60, -100}, {60, -100}, {60, 100}, {-60, 100}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 100}, {20, 20}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-22, -16}, {30, -66}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, 60}, {24, -42}}, color = {0, 0, 255}), Rectangle(extent = {{-20, 80}, {20, 40}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Forward)}), - Window(x = 0.17, y = 0.1, width = 0.76, height = 0.76), + + /* Fluid thermodynamic properties before the expansion */ + state_e = Medium.setState_ph(Pe,C1.h, phase=phase_e); + Te=Medium.temperature(state_e); + + /* Fluid thermodynamic properties after the expansion */ + state_s = Medium.setState_ph(Ps, C2.h, phase=phase_s); + Ts=Medium.temperature(state_s); + + /* Fluid thermodynamic properties after the isentropic expansion */ + state_ps = Medium.setState_ps(Ps, Medium.specificEntropy(state_e), phase=phase_s); + His=Medium.specificEnthalpy(state_ps); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,100},{20,12}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-22,-16},{30,-66}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{0,60},{24,-42}}, color={0,0,255}), + Rectangle( + extent={{-20,80},{20,40}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Forward)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{-60,100},{-60,-100},{60,-100},{60,100},{-60,100}}, + lineColor={28,108,200}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,100},{20,20}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-22,-16},{30,-66}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{0,60},{24,-42}}, color={0,0,255}), + Rectangle( + extent={{-20,80},{20,40}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Forward)}), + Window( + x=0.17, + y=0.1, + width=0.76, + height=0.76), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -97,4 +158,4 @@ Benoît Bride Daniel Bouskela ")); -end SteamEngine; \ No newline at end of file +end SteamEngine; diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo index 977d23f3..3bd92400 100644 --- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo @@ -1,130 +1,186 @@ within ThermoSysPro.Fluid.Machines; - model StodolaTurbine "Multistage turbine group using Stodola's ellipse" - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; +extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real Cst = 1.e7 "Stodola's ellipse coefficient"; - parameter Real W_fric = 0.0 "Power losses due to hydrodynamic friction (percent)"; - parameter Real eta_stato = 1.0 "Efficiency to account for cinetic losses (<= 1) (s.u.)"; - parameter Units.SI.Area area_nz = 1 "Nozzle area"; - parameter Real eta_nz = 1.0 "Nozzle efficency (eta_nz < 1 - turbine with nozzle - eta_nz = 1 - turbine without nozzle)"; - parameter Units.SI.MassFlowRate Qmax = 1 "Maximum mass flow through the turbine"; - parameter Real eta_is_nom = 0.8 "Nominal isentropic efficiency"; - parameter Real eta_is_min = 0.35 "Minimum isentropic efficiency"; - parameter Real a = -1.3889 "x^2 coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)"; - parameter Real b = 2.6944 "x coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)"; - parameter Real c = -0.5056 "Constant coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_e = IF97Region.All_regions "IF97 region before expansion (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_s = IF97Region.All_regions "IF97 region after expansion (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_ps = IF97Region.All_regions "IF97 region after isentropic expansion (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Real eta_is(start = 0.85) "Isentropic efficiency"; - Real eta_is_wet(start = 0.83) "Isentropic efficiency for wet steam"; + + parameter Real Cst=1.e7 "Stodola's ellipse coefficient"; + parameter Real W_fric=0.0 + "Power losses due to hydrodynamic friction (percent)"; + parameter Real eta_stato=1.0 + "Efficiency to account for cinetic losses (<= 1) (s.u.)"; + parameter Units.SI.Area area_nz=1 "Nozzle area"; + parameter Real eta_nz=1.0 + "Nozzle efficency (eta_nz < 1 - turbine with nozzle - eta_nz = 1 - turbine without nozzle)"; + parameter Units.SI.MassFlowRate Qmax=1 + "Maximum mass flow through the turbine"; + parameter Real eta_is_nom=0.8 "Nominal isentropic efficiency"; + parameter Real eta_is_min=0.35 "Minimum isentropic efficiency"; + parameter Real a=-1.3889 + "x^2 coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)"; + parameter Real b=2.6944 + "x coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)"; + parameter Real c=-0.5056 + "Constant coefficient of the isentropic efficiency characteristics eta_is=f(Q/Qmax)"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter IF97Region region_e=IF97Region.All_regions "IF97 region before expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region_s=IF97Region.All_regions "IF97 region after expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter IF97Region region_ps=IF97Region.All_regions "IF97 region after isentropic expansion (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + + +protected + Integer phase_e=if Integer(region_e) == 0 then 0 else if Integer(region_e)==4 then 2 else 1; + Integer phase_s=if Integer(region_s) == 0 then 0 else if Integer(region_s)==4 then 2 else 1; + Integer phase_ps=if Integer(region_ps) == 0 then 0 else if Integer(region_ps)==4 then 2 else 1; + parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT + "Critical pressure"; + parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT + "Critical temperature"; + +public + Real eta_is(start=0.85) "Isentropic efficiency"; + Real eta_is_wet(start=0.83) "Isentropic efficiency for wet steam"; Units.SI.Power W "Mechanical power produced by the turbine"; Units.SI.MassFlowRate Q "Mass flow rate"; - Units.SI.SpecificEnthalpy His "Fluid specific enthalpy after isentropic expansion"; - Units.SI.SpecificEnthalpy Hrs "Fluid specific enthalpy after the real expansion"; - Units.SI.AbsolutePressure Pe(start = 10e5, min = 0) "Pressure at the inlet"; - Units.SI.AbsolutePressure Ps(start = 10e5, min = 0) "Pressure at the outlet"; - Units.SI.Temperature Te(min = 0) "Temperature at the inlet"; - Units.SI.Temperature Ts(min = 0) "Temperature at the outlet"; + Units.SI.SpecificEnthalpy His + "Fluid specific enthalpy after isentropic expansion"; + Units.SI.SpecificEnthalpy Hrs + "Fluid specific enthalpy after the real expansion"; + Units.SI.AbsolutePressure Pe(start=10e5, min=0) "Pressure at the inlet"; + Units.SI.AbsolutePressure Ps(start=10e5, min=0) "Pressure at the outlet"; + Units.SI.Temperature Te(min=0) "Temperature at the inlet"; + Units.SI.Temperature Ts(min=0) "Temperature at the outlet"; Units.SI.Velocity Vs "Fluid velocity at the outlet"; - Units.SI.Density rhos(start = 200) "Fluid density at the outlet"; - Real xm(start = 1.0, min = 0) "Average vapor mass fraction"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce annotation( - Placement(transformation(extent = {{-111, -10}, {-91, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cs annotation( - Placement(transformation(extent = {{91, -10}, {111, 10}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps props annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); - ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M annotation( - Placement(transformation(origin = {0, -100}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower annotation( - Placement(transformation(origin = {110, -90}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros1 annotation( - Placement(transformation(extent = {{-20, 80}, {0, 100}}, rotation = 0))); -protected - parameter Integer mode_e = Integer(region_e) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_s = Integer(region_s) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_ps = Integer(region_ps) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.AbsolutePressure pcrit = ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT "Critical pressure"; - parameter Units.SI.Temperature Tcrit = ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT "Critical temperature"; + Units.SI.Density rhos(start=200) "Fluid density at the outlet"; + Real xm(start=1.0,min=0) "Average vapor mass fraction"; + +public + Medium.ThermodynamicState state_e; + Medium.ThermodynamicState state_s1; + Medium.ThermodynamicState state_s; + Medium.ThermodynamicState state_ps; + Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-111,-10},{-91,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{91,-10},{111,10}}, rotation=0))); + ThermoSysPro.ElectroMechanics.Connectors.MechanichalTorque M + annotation (Placement(transformation( + origin={0,-100}, + extent={{10,-10},{-10,10}}, + rotation=90))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower + annotation (Placement(transformation( + origin={110,-90}, + extent={{10,-10},{-10,10}}, + rotation=180))); equation -/* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "StodolaTurbine: the fluid type must be water/steam"); + if (cardinality(M) == 0) then M.Ctr = 0; M.w = 0; else M.Ctr*M.w = W; end if; + Ce.Q = Cs.Q; + Ce.h_vol_1 = Cs.h_vol_1; Ce.h_vol_2 = Cs.h_vol_2; + Cs.diff_on_1 = if (gamma_diff > 0) then Ce.diff_on_1 else false; Ce.diff_on_2 = if (gamma_diff > 0) then Cs.diff_on_2 else false; + Cs.diff_res_1 = Ce.diff_res_1 + (if (gamma_diff > 0) then 1/gamma_diff else 0); Ce.diff_res_2 = Cs.diff_res_2 + (if (gamma_diff > 0) then 1/gamma_diff else 0); - Ce.ftype = Cs.ftype; - Ce.Xco2 = Cs.Xco2; - Ce.Xh2o = Cs.Xh2o; - Ce.Xo2 = Cs.Xo2; - Ce.Xso2 = Cs.Xso2; + + /* Fluid composition balance equations*/ + Ce.Xi = Cs.Xi; + + + Ce.SubC = Cs.SubC; + Q = Ce.Q; Pe = Ce.P; Ps = Cs.P; - ftype = Ce.ftype; -/* Isentropic efficiency */ - eta_is = if (Q < Qmax) then (max(eta_is_min, (a*(Q/Qmax)^2 + b*(Q/Qmax) + c))) else eta_is_nom; + + + /* Isentropic efficiency */ + eta_is = if (Q < Qmax) then (max(eta_is_min,(a*(Q/Qmax)^2 + b*(Q/Qmax) + c))) else eta_is_nom; eta_is_wet = xm*eta_is; -/* Average vapor mass fraction during the expansion */ + + /* Average vapor mass fraction during the expansion */ if noEvent((Pe > pcrit) or (Te > Tcrit)) then xm = 1; else - xm = (proe.x + pros1.x)/2.0; + xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s1))/2.0; end if; -/* Stodola's ellipse law */ + + /* Stodola's ellipse law */ if noEvent((Pe > pcrit) or (Te > Tcrit)) then Q = sqrt((Pe^2 - Ps^2)/(Cst*Te)); else - Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*proe.x)); + Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*Medium.vapourQuality(state_e))); end if; -/* Fluid specific enthalpy after the expansion */ + + /* Fluid specific enthalpy after the expansion */ Hrs - Ce.h = xm*eta_is*(His - Ce.h); -/* Fluid specific enthalpy at the outlet of the nozzle */ + + /* Fluid specific enthalpy at the outlet of the nozzle */ Vs = Q/rhos/area_nz; Cs.h - Hrs = (1 - eta_nz)*Vs^2/2; -/* Mechanical power produced by the turbine */ + + /* Mechanical power produced by the turbine */ W = Q*eta_stato*(Ce.h - Cs.h)*(1 - W_fric/100); MechPower.signal = W; -/* Fluid thermodynamic properties before the expansion */ - proe = ThermoSysPro.Properties.Fluid.Ph(Pe, Ce.h, mode_e, fluid); - Te = proe.T; -/* Fluid thermodynamic properties after the expansion */ - pros1 = ThermoSysPro.Properties.Fluid.Ph(Ps, Hrs, mode_s, fluid); -/* Fluid thermodynamic properties at the outlet of the nozzle */ - pros = ThermoSysPro.Properties.Fluid.Ph(Ps, Cs.h, mode_s, fluid); - Ts = pros.T; - rhos = pros.d; -/* Fluid thermodynamic properties after the isentropic expansion */ - props = ThermoSysPro.Properties.Fluid.Ps(Ps, proe.s, mode_ps, fluid); - His = props.h; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 40}, {-100, -40}, {100, -100}, {100, 100}, {-100, 40}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{0, -70}, {0, -90}}, color = {0, 0, 0}, thickness = 0.5)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{-100, 40}, {-100, -40}, {100, -100}, {100, 100}, {-100, 40}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Line(points = {{0, -70}, {0, -90}}, color = {0, 0, 0}, thickness = 0.5)}), - Window(x = 0.17, y = 0.1, width = 0.76, height = 0.76), + + /* Fluid thermodynamic properties before the expansion */ + state_e=Medium.setState_ph(p=Pe, h=Ce.h, phase=phase_e); + + Te = state_e.T; + + /* Fluid thermodynamic properties after the expansion */ + state_s1 = Medium.setState_ph(p=Ps, h=Hrs, phase=phase_s); + + /* Fluid thermodynamic properties at the outlet of the nozzle */ + state_s = Medium.setState_ph(p=Ps, h=Cs.h, phase=phase_s); + + Ts = state_s.T; + rhos = state_s.d; + + /* Fluid thermodynamic properties after the isentropic expansion */ + state_ps = Medium.setState_ps(p=Ps, s=Medium.specificEntropy(state_e), phase=phase_ps); + His = state_ps.h; + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid), Line( + points={{0,-70},{0,-90}}, + color={0,0,0}, + thickness=0.5)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Polygon( + points={{-100,40},{-100,-40},{100,-100},{100,100},{-100,40}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), Line( + points={{0,-70},{0,-90}}, + color={0,0,0}, + thickness=0.5)}), + Window( + x=0.17, + y=0.1, + width=0.76, + height=0.76), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -136,4 +192,4 @@ Daniel Bouskela Baligh El Hefni ")); -end StodolaTurbine; \ No newline at end of file +end StodolaTurbine; From 3e986067263de6fb246e049d9d4d6a6ba004187c Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:36:02 +0200 Subject: [PATCH 186/213] #125 fix loop breaker composition isolation --- ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo | 2 +- ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo index 1939a3fd..e0f4a410 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo @@ -22,7 +22,7 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.SubC = C2.SubC; + C1.Xi = C2.Xi; annotation ( Diagram(coordinateSystem( diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo index 2c222e4f..5ba82ceb 100644 --- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo +++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo @@ -22,7 +22,7 @@ equation C2.diff_res_1 = C1.diff_res_1; C1.diff_res_2 = C2.diff_res_2; - C1.Xi = C2.Xi; + C1.SubC = C2.SubC; annotation ( Diagram(coordinateSystem( From 571ca9a8e1612b7899574499610a91c638af8045 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:37:44 +0200 Subject: [PATCH 187/213] #125 port Fluid combustion chambers and gas turbine medium support onto develop --- .../CombustionChambers/GTCombustionChamber.mo | 400 ++++--- .../CombustionChambers/GenericCombustion.mo | 378 ++++--- .../CombustionChambers/GenericCombustion1D.mo | 508 ++++++--- .../CombustionChambers/GridFurnace.mo | 981 ++++++++++-------- .../CombustionChambers/PostCombustionGas.mo | 587 ++++++----- ThermoSysPro/Fluid/Machines/GasTurbine.mo | 195 ++-- 6 files changed, 1914 insertions(+), 1135 deletions(-) diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo index 067ac40c..a2123400 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo @@ -1,74 +1,93 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; - model GTCombustionChamber "Gas turbine combustion chamber" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real kcham = 1 "Pressure loss coefficient in the combustion chamber"; - parameter Units.SI.Area Acham = 1 "Average cross-sectional area of the combustion chamber"; - parameter Real eta_comb = 1 "Combustion efficiency"; - parameter Units.SI.Power Wpth = 1e6 "Thermal loss fraction in the body of the combustion chamber"; - parameter Boolean air_atomisation = false "true: computation with air atomisation - false: computation without air atomisation"; - parameter Units.SI.Temperature Tecpat = 293 "Temperature at the inlet of the atomisation compressor"; - parameter Real kat = 0 "Atomisation pressure loss coefficient"; - parameter Real XQat = 0 "Atomisation air mass flow rate coefficient"; - parameter Real Xspat = 0 "Atomisation over-pressure coefficient"; - parameter Real eta_is = 1 "Atomisation compressor isentropic efficiency"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Units.SI.MassFlowRate Qea(start = 400) "Air mass flow rate"; - Units.SI.AbsolutePressure Pea(start = 1e5) "Air pressure at the inlet"; - Units.SI.Temperature Tea(start = 600) "Air temperature at the inlet"; - Units.SI.SpecificEnthalpy Hea(start = 50e3) "Air specific enthalpy at the inlet"; - Real XeaCO2(start = 0) "CO2 mass fraction at the air inlet"; - Real XeaH2O(start = 0.1) "H2O mass fraction at the air inlet"; - Real XeaO2(start = 0.2) "O2 mass fraction at the air inlet"; - Real XeaSO2(start = 0) "SO2 mass fraction at the air inlet"; - Units.SI.MassFlowRate Qfuel(start = 5) "Fuel mass flow rate"; - Units.SI.Temperature Tfuel(start = 300) "Fuel temperature"; - Units.SI.SpecificEnthalpy Hfuel(start = 10e3) "Fuel specific enthalpy"; - Real XCfuel(start = 0.8) "C mass fraction in the fuel"; - Real XHfuel(start = 0.2) "H mass fraction in the fuel"; - Real XOfuel(start = 0) "O mass fraction in the fuel"; - Real XSfuel(start = 0) "S mass fraction in the fuel"; - Units.SI.SpecificEnergy LHVfuel(start = 5e7) "Fuel lower heating value"; - Units.SI.SpecificHeatCapacity Cpfuel(start = 1000) "Fuel specific heat capacity"; - Units.SI.MassFlowRate Qews(start = 1) "Water/steam mass flow rate"; - Units.SI.SpecificEnthalpy Hews(start = 10e3) "Water/steam specific enthalpy at the inlet"; - Units.SI.MassFlowRate Qsf(start = 400) "Flue gases mass flow rate"; - Units.SI.AbsolutePressure Psf(start = 12e5) "Flue gases pressure at the outlet"; - Units.SI.Temperature Tsf(start = 1500) "Flue gases temperature at the outlet"; - Units.SI.SpecificEnthalpy Hsf(start = 50e4) "Flue gases specific enthalpy at the outlet"; - Real XsfCO2(start = 0.5) "CO2 mass fraction in the flue gases"; - Real XsfH2O(start = 0.1) "H2O mass fraction in the flue gases"; - Real XsfO2(start = 0) "O2 mass fraction in the flue gases"; - Real XsfSO2(start = 0) "SO2 mass fraction in the flue gases"; - Units.SI.Power Wfuel(start = 5e8) "LHV power available in the fuel"; - Real exc(start = 1) "Combustion air ratio"; - ThermoSysPro.Units.SI.PressureDifference deltaPccb(start = 1e3) "Pressure loss in the combusiton chamber"; - Units.SI.SpecificEnthalpy Hrair(start = 10e3) "Air reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrws(start = 10e4) "Water/steam reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrfuel(start = 10e3) "Fuel reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrfg(start = 10e3) "Flue gases reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hecpat(start = 10e3) "Air specific enthalpy at the inlet of the atomisaiton compressor"; - Units.SI.SpecificEnthalpy Hiscpat(start = 10e3) "Air specific enthalpy after isentropic expansion at the outlet of the atomisaiotn compressor"; - Units.SI.AbsolutePressure Pecpat(start = 1e5) "Pressure at the inlet of the atomisation compressor"; - Units.SI.AbsolutePressure Pscpat(start = 1e5) "Pressure at the outlet of the atomisation compressor"; - Units.SI.SpecificEntropy Secpat(start = 1e3) "Entropy at the inlet of the atomisation compressor"; - Units.SI.MassFlowRate Qm(start = 400) "Average mass flow rate in the combustion chamber"; - Real Vea(start = 0.001) "Air volume mass (m3/kg)"; - Real Vsf(start = 0.001) "Flue gases volume mass (m3/kg)"; - Units.SI.Density rhoea(start = 0.001) "Air density at the inlet"; - Units.SI.Density rhosf(start = 0.001) "Flue gases density at the outlet"; - Real Vccbm(start = 0.001) "Average volume mass in the combustion chamber"; - Units.SI.Velocity v(start = 100) "Flue gases reference velocity in the combusiton chamber"; - Units.SI.Power Wcpat(start = 1e3) "Power of the atomisation compressor"; - Units.SI.Power Wrfat(start = 1e3) "Thermal power extracted by the atomisaiton refrigerant"; - Real eta_isc(start = 1) "Intermediate variable for the computation of the isentropic efficiency of the atomisaiton compressor"; - Units.SI.Area Achamc(start = 1) "Intermediate variable for the computation of the average corss-section aera of the combusion chamber"; - Real XeaO2c(start = 0.2) "Intermediate variable for the computation of the O2 mass fraction"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - FluidType fluids[3] "Fluids mixing in volume"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real kcham=1 "Pressure loss coefficient in the combustion chamber"; + parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber"; + parameter Real eta_comb=1 "Combustion efficiency"; + parameter Units.SI.Power Wpth=1e6 "Thermal loss fraction in the body of the combustion chamber"; + parameter Boolean air_atomisation=false "true: computation with air atomisation - false: computation without air atomisation"; + parameter Units.SI.Temperature Tecpat=293 "Temperature at the inlet of the atomisation compressor"; + parameter Real kat=0 "Atomisation pressure loss coefficient"; + parameter Real XQat=0 "Atomisation air mass flow rate coefficient"; + parameter Real Xspat=0 "Atomisation over-pressure coefficient"; + parameter Real eta_is=1 "Atomisation compressor isentropic efficiency"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Real amC=12.01115 "Carbon atomic mass"; + constant Real amH=1.00797 "Hydrogen atomic mass"; + constant Real amO=15.9994 "Oxygen atomic mass"; + constant Real amS=32.064 "Sulfur atomic mass"; + constant Real eps_a=1e-6 "Zero criterion for a-dimensional numbers"; + constant Real eps_s=1e-6 "Zero criterion for surface numbers"; + constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; + constant Real amH2O = 2*amH + amO "H2O molecular mass"; + constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate"; + Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet"; + Units.SI.Temperature Tea(start=600) "Air temperature at the inlet"; + Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet"; + Real XeaCO2(start=0) "CO2 mass fraction at the air inlet"; + Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet"; + Real XeaO2(start=0.2) "O2 mass fraction at the air inlet"; + Real XeaSO2(start=0) "SO2 mass fraction at the air inlet"; + Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate"; + Units.SI.Temperature Tfuel(start=300) "Fuel temperature"; + Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy"; + Real XCfuel(start=0.8) "C mass fraction in the fuel"; + Real XHfuel(start=0.2) "H mass fraction in the fuel"; + Real XOfuel(start=0) "O mass fraction in the fuel"; + Real XSfuel(start=0) "S mass fraction in the fuel"; + Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value"; + Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity"; + Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate"; + Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet"; + Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate"; + Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet"; + Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet"; + Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet"; + Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases"; + Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases"; + Real XsfO2(start=0) "O2 mass fraction in the flue gases"; + Real XsfSO2(start=0) "SO2 mass fraction in the flue gases"; + Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel"; + Real exc(start=1) "Combustion air ratio"; + ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combusiton chamber"; + Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hecpat(start=10e3) "Air specific enthalpy at the inlet of the atomisaiton compressor"; + Units.SI.SpecificEnthalpy Hiscpat(start=10e3) "Air specific enthalpy after isentropic expansion at the outlet of the atomisaiotn compressor"; + Units.SI.AbsolutePressure Pecpat(start=1e5) "Pressure at the inlet of the atomisation compressor"; + Units.SI.AbsolutePressure Pscpat(start=1e5) "Pressure at the outlet of the atomisation compressor"; + Units.SI.SpecificEntropy Secpat(start=1e3) "Entropy at the inlet of the atomisation compressor"; + Units.SI.MassFlowRate Qm(start=400) "Average mass flow rate in the combustion chamber"; + Real Vea(start=0.001) "Air volume mass (m3/kg)"; + Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)"; + Units.SI.Density rhoea(start=0.001) "Air density at the inlet"; + Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet"; + Real Vccbm(start=0.001) "Average volume mass in the combustion chamber"; + Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber"; + Units.SI.Power Wcpat(start=1e3) "Power of the atomisation compressor"; + Units.SI.Power Wrfat(start=1e3) "Thermal power extracted by the atomisaiton refrigerant"; + Real eta_isc(start=1) "Intermediate variable for the computation of the isentropic efficiency of the atomisaiton compressor"; + Units.SI.Area Achamc(start=1) "Intermediate variable for the computation of the average corss-section aera of the combusion chamber"; + Real XeaO2c(start=0.2) "Intermediate variable for the computation of the O2 mass fraction"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jws "Thermal power diffusion from inlet Cws"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -79,34 +98,33 @@ model GTCombustionChamber "Gas turbine combustion chamber" Real ra "Value of r(Q/gamma) for inlet Ca"; Real rws "Value of r(Q/gamma) for inlet Cws"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws = Integer(ftype_ws) "Water/steam fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation( - Placement(transformation(extent = {{-10, -100}, {10, -80}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" annotation( - Placement(transformation(extent = {{-100, -10}, {-80, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet" annotation( - Placement(transformation(extent = {{-70, 80}, {-50, 100}}, rotation = 0))); -protected - constant Real amC = 12.01115 "Carbon atomic mass"; - constant Real amH = 1.00797 "Hydrogen atomic mass"; - constant Real amO = 15.9994 "Oxygen atomic mass"; - constant Real amS = 32.064 "Sulfur atomic mass"; - constant Real eps_a = 1e-6 "Zero criterion for a-dimensional numbers"; - constant Real eps_s = 1e-6 "Zero criterion for surface numbers"; - constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; - constant Real amH2O = 2*amH + amO "H2O molecular mass"; - constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_atom_in "Atomisation compressor inlet state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" + annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "Water/steam inlet" + annotation (Placement(transformation(extent={{-70,80},{-50,100}}, rotation= + 0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); -/* Fuel inlet */ + + assert(Medium_FlueGases.nX > 1, "GTCombustionChamber: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GTCombustionChamber: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Fuel inlet */ Qfuel = Cfuel.Q; Tfuel = Cfuel.T; XCfuel = Cfuel.Xc; @@ -115,63 +133,78 @@ equation XSfuel = Cfuel.Xs; LHVfuel = Cfuel.LHV; Cpfuel = Cfuel.cp; -/* Water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam"); + + /* Water inlet */ Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; + Qews = Cws.Q; Hews = Cws.h; -/* Air inlet */ + Xws = Cws.Xi; + SubCws = Cws.SubC; + + /* Air inlet */ Qea = Ca.Q; Pea = Ca.P; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; -/* Flue gases outlet */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; -/* Mass balance equation */ + + /* Mass balance equation */ 0 = Qea + Qews + Qfuel - Qsf; -/* Energy balance equation */ + + /* Energy balance equation */ if air_atomisation then 0 = ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wrfat + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws) + Wcpat) + J; -/* Atomisation power */ + + /* Atomisation power */ Pecpat = Pea*(1 - kat); Pscpat = (1 + Xspat)*Pea; Wcpat = Qea*XQat*(Hiscpat - Hecpat)*eta_isc; -/* Heat extracted by the atomisation refrigerant */ + + /* Heat extracted by the atomisation refrigerant */ Wrfat = Qea*XQat*(Hea - Hecpat); else 0 = ((Qea + Qews + Qfuel)*(Hsf - Hrfg) + Wpth) - (Qfuel*(Hfuel - Hrfuel + LHVfuel*eta_comb) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + J; -/* Atomisation power */ + + /* Atomisation power */ Pecpat = Pea; Pscpat = Pea; Wcpat = 0; -/* Heat extracted by the atomisation refrigerant */ + + /* Heat extracted by the atomisation refrigerant */ Wrfat = 0; end if; + Cws.h_vol_2 = h; Ca.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; -/* No flow reversal */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0; rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0; rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0; + gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0; gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0; gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0; + Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0; Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0; Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0; @@ -179,69 +212,144 @@ equation ra = 0; rws = 0; rfg = 0; + gamma_a = gamma0; gamma_ws = gamma0; gamma_fg = gamma0; + Ja = 0; Jws = 0; Jfg = 0; end if; + J = Ja + Jws + Jfg; + Ca.diff_res_2 = 0; Cfg.diff_res_1 = 0; + Ca.diff_on_2 = diffusion; Cfg.diff_on_1 = diffusion; -/* Specific enthalpy and entropy at the inlet of the atomisation compressor */ + + /* Specific enthalpy and entropy at the inlet of the atomisation compressor */ if air_atomisation then - Hecpat = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2); - Secpat = ThermoSysPro.Properties.FlueGases.FlueGases_s(Pecpat, Tecpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2); - Hiscpat = ThermoSysPro.Properties.FlueGases.FlueGases_h_Ps(Pscpat, Secpat, XeaCO2, XeaH2O, XeaO2c, XeaSO2); + Hecpat = Medium_FlueGases.specificEnthalpy_pTX(p=Pecpat, T=Tecpat, X=Xea); + state_atom_in = Medium_FlueGases.setState_pTX(p=Pecpat, T=Tecpat, X=Xea); + Secpat = Medium_FlueGases.specificEntropy(state_atom_in); + Hiscpat = Medium_FlueGases.isentropicEnthalpy(p_downstream=Pscpat, refState=state_atom_in); else - Hecpat = 60000; - Secpat = -2000; - Hiscpat = 60000; + Hecpat = 60000; + state_atom_in = Medium_FlueGases.setState_pTX(p=Pecpat, T=Tecpat, X=Xea); + Secpat = -2000; + Hiscpat = 60000; end if; -/* Reference specific enthalpies */ + + /* Reference specific enthalpies */ Hrair = 2501.569e3*XeaH2O; Hrfuel = 0; Hrws = 2501.569e3; Hrfg = 2501.569e3*XsfH2O; -/* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2); -/* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); -/* Air density at the inlet */ - rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2); + + /* Air specific enthalpy at the inlet */ + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); + + /* Air density at the inlet */ + rhoea = Medium_FlueGases.density(state_air_in); Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1; -/* Flue gases density at the outlet */ - rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + + /* Flue gases density at the outlet */ + rhosf = Medium_FlueGases.density(state_fg_out); Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1; + 0 = if (eta_is > eps_a) then (eta_isc - eta_is) else (eta_isc - eps_a); 0 = if (Acham > eps_s) then (Achamc - Acham) else (Achamc - eps_s); 0 = if (XeaO2 > eps_a) then (XeaO2c - XeaO2) else (XeaO2c - eps_a); -/* CO2 flue gases mass fraction */ + + /* CO2 flue gases mass fraction */ XsfCO2*(Qea + Qews + Qfuel) = (Qea*XeaCO2) + (Qfuel*XCfuel*amCO2/amC); -/* H2O flue gases mass fraction */ - XsfH2O*(Qea + Qews + Qfuel) = (Qews) + (Qea*XeaH2O + Qfuel*XHfuel*amH2O/2/amH); -/* O2 flue gases mass fraction */ + + /* H2O flue gases mass fraction */ + XsfH2O*(Qea + Qews + Qfuel) = (Qews) + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2/amH); + + /* O2 flue gases mass fraction */ XsfO2*(Qea + Qews + Qfuel) = (Qea*XeaO2c) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel); -/* SO2 flue gases mass fraction */ + + /* SO2 flue gases mass fraction */ XsfSO2*(Qea + Qews + Qfuel) = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); -/* Fuel thermal power */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + + /* Fuel thermal power */ Wfuel = Qfuel*LHVfuel; -/* Combustion air ratio */ + + /* Combustion air ratio */ exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O))); -/* Pressure losses */ + + /* Pressure losses */ Pea - Psf = deltaPccb; Qm = Qea + (Qfuel + Qews)/2; Vccbm = (Vea + Vsf)/2; v = Qm*Vccbm/Achamc; deltaPccb = (kcham*(v^2))/(2*Vccbm); -/* Fuel specific enthalpy at the inlet */ + + /* Fuel specific enthalpy at the inlet */ Hfuel = Cpfuel*(Tfuel - 273.16); - annotation( - Diagram(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = {120, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{-20, 80}, {-20, -80}}, color = {0, 0, 255}), Polygon(points = {{-20, 62}, {46, 46}, {2, 30}, {58, 18}, {6, 0}, {48, -16}, {2, -32}, {54, -44}, {-20, -60}, {-20, 62}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.CrossDiag)}), - Icon(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-20, 80}, {-20, -80}}, color = {0, 0, 255}), Polygon(points = {{-20, 62}, {46, 46}, {2, 30}, {58, 18}, {6, 0}, {48, -16}, {2, -32}, {54, -44}, {-20, -60}, {-20, 62}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.CrossDiag), Text(extent = {{-98, 104}, {-72, 76}}, lineColor = {28, 108, 200}, textString = "Water in"), Text(extent = {{62, 34}, {110, -2}}, lineColor = {238, 46, 47}, textString = "Flue gases out"), Text(extent = {{18, -78}, {44, -106}}, lineColor = {28, 108, 200}, textString = "Fuel in"), Text(extent = {{-100, -6}, {-74, -30}}, lineColor = {28, 108, 200}, textString = "Air in")}), + + annotation (Diagram(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor={120,255,0}, + fillPattern=FillPattern.Solid), + Line(points={{-20,80},{-20,-80}}, color={0,0,255}), + Polygon( + points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54, + -44},{-20,-60},{-20,62}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.CrossDiag)}), + Icon(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Line(points={{-20,80},{-20,-80}}, color={0,0,255}), + Polygon( + points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54, + -44},{-20,-60},{-20,62}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.CrossDiag), + Text( + extent={{-98,104},{-72,76}}, + lineColor={28,108,200}, + textString="Water in"), + Text( + extent={{62,34},{110,-2}}, + lineColor={238,46,47}, + textString="Flue gases out"), + Text( + extent={{18,-78},{44,-106}}, + lineColor={28,108,200}, + textString="Fuel in"), + Text( + extent={{-100,-6},{-74,-30}}, + lineColor={28,108,200}, + textString="Air in")}), Documentation(revisions = " Author @@ -252,4 +360,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 8.1 of the ThermoSysPro book. ")); -end GTCombustionChamber; \ No newline at end of file +end GTCombustionChamber; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo index a04ef380..4b51fa9a 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo @@ -1,71 +1,91 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; - model GenericCombustion "Generic combustion chamber" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham = 1 "Pressure loss coefficient in the combustion chamber"; - parameter Units.SI.Area Acham = 1 "Average corss-sectional area of the combusiton chamber"; - parameter Real Xpth = 0.01 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)"; - parameter Real ImbCV = 0 "Unburnt particles ratio in the volatile ashes (0-1)"; - parameter Real ImbBF = 0 "Unburnt particle ratio in the low furnace ashes (0-1)"; - parameter Units.SI.SpecificHeatCapacity Cpcd = 500 "Ashes specific heat capacity"; - parameter Units.SI.Temperature Tbf = 500 "Ashes temperature at the outlet of the low furnace"; - parameter Real Xbf = 0.1 "Ashes ration in the low furnace (0-1)"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Units.SI.MassFlowRate Qea(start = 400) "Air mass flow rate"; - Units.SI.AbsolutePressure Pea(start = 1e5) "Air pressure at the inlet"; - Units.SI.Temperature Tea(start = 600) "Air temperature at the inlet"; - Units.SI.SpecificEnthalpy Hea(start = 50e3) "Air specific enthalpy at the inlet"; - Real XeaCO2(start = 0) "CO2 mass fraction at the air inlet"; - Real XeaH2O(start = 0.1) "H2O mass fraction at the air inlet"; - Real XeaO2(start = 0.2) "O2 mass fraction at the air inlet"; - Real XeaSO2(start = 0) "SO2 mass fraction at the air inlet"; - Units.SI.MassFlowRate Qfuel(start = 5) "Fuel mass flow rate"; - Units.SI.Temperature Tfuel(start = 300) "Fuel temperature"; - Units.SI.SpecificEnthalpy Hfuel(start = 10e3) "Fuel specific enthalpy"; - Real XCfuel(start = 0.8) "C mass fraction in the fuel"; - Real XHfuel(start = 0.2) "H mass fraction in the fuel"; - Real XOfuel(start = 0) "O mass fraction in the fuel"; - Real XSfuel(start = 0) "S mass fraction in the fuel"; - Real Xwfuel(start = 0) "H2O mass fraction in the fuel"; - Real XCDfuel(start = 0) "Ashes mass fraction in the fuel"; - Units.SI.SpecificEnergy LHVfuel(start = 5e7) "Fuel lower heating value"; - Units.SI.SpecificHeatCapacity Cpfuel(start = 1000) "Fuel specific heat capacity"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=1 "Pressure loss coefficient in the combustion chamber"; + parameter Units.SI.Area Acham=1 "Average corss-sectional area of the combusiton chamber"; + parameter Real Xpth=0.01 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)"; + parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)"; + parameter Real ImbBF=0 "Unburnt particle ratio in the low furnace ashes (0-1)"; + parameter Units.SI.SpecificHeatCapacity Cpcd=500 "Ashes specific heat capacity"; + parameter Units.SI.Temperature Tbf=500 "Ashes temperature at the outlet of the low furnace"; + parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Real amC=12.01115 "Carbon atomic mass"; + constant Real amH=1.00797 "Hydrogen atomic mass"; + constant Real amO=15.9994 "Oxygen atomic mass"; + constant Real amS=32.064 "Sulfur atomic mass"; + constant Units.SI.SpecificEnergy HHVcarbone=32.8e6 "Unburnt carbon higher heating value"; + constant Real amCO2=amC + 2*amO "CO2 molecular mass"; + constant Real amH2O=2*amH + amO "H2O molecular mass"; + constant Real amSO2=amS + 2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate"; + Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet"; + Units.SI.Temperature Tea(start=600) "Air temperature at the inlet"; + Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet"; + Real XeaCO2(start=0) "CO2 mass fraction at the air inlet"; + Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet"; + Real XeaO2(start=0.2) "O2 mass fraction at the air inlet"; + Real XeaSO2(start=0) "SO2 mass fraction at the air inlet"; + Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate"; + Units.SI.Temperature Tfuel(start=300) "Fuel temperature"; + Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy"; + Real XCfuel(start=0.8) "C mass fraction in the fuel"; + Real XHfuel(start=0.2) "H mass fraction in the fuel"; + Real XOfuel(start=0) "O mass fraction in the fuel"; + Real XSfuel(start=0) "S mass fraction in the fuel"; + Real Xwfuel(start=0) "H2O mass fraction in the fuel"; + Real XCDfuel(start=0) "Ashes mass fraction in the fuel"; + Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value"; + Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity"; Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value"; - Units.SI.MassFlowRate Qews(start = 1) "Water/steam mass flow rate"; - Units.SI.SpecificEnthalpy Hews(start = 10e3) "Water/steam specific enthalpy at the inlet"; - Units.SI.MassFlowRate Qsf(start = 400) "Flue gases mass flow rate"; - Units.SI.AbsolutePressure Psf(start = 12e5) "Flue gases pressure at the outlet"; - Units.SI.Temperature Tsf(start = 1500) "Flue gases temperature at the outlet"; - Units.SI.SpecificEnthalpy Hsf(start = 50e4) "Flue gases specific enthalpy at the outlet"; - Real XsfCO2(start = 0.5) "CO2 mass fraction in the flue gases"; - Real XsfH2O(start = 0.1) "H2O mass fraction in the flue gases"; - Real XsfO2(start = 0) "O2 mass fraction in the flue gases"; - Real XsfSO2(start = 0) "SO2 mass fraction in the flue gases"; - Units.SI.Power Wfuel(start = 5e8) "LHV power available in the fuel"; - Units.SI.Power Wpth(start = 1e6) "Thermal losses power"; - Real exc(start = 1) "Combustion air ratio"; - Units.SI.MassFlowRate Qcv(start = 1) "Volatile ashes mass flow rate"; - Units.SI.MassFlowRate Qbf(start = 1) "Low furnace ashes mass flow rate"; - Units.SI.SpecificEnthalpy Hcv(start = 10e3) "Volatile ashes specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy Hbf(start = 10e3) "Low furnace ashes specific enthalpy at the outlet"; - ThermoSysPro.Units.SI.PressureDifference deltaPccb(start = 1e3) "Pressure loss in the combustion chamber"; - Units.SI.SpecificEnthalpy Hrair(start = 10e3) "Air reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrws(start = 10e4) "Water/steam reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrfuel(start = 10e3) "Fuel reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrcd(start = 10e3) "Ashes reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrfg(start = 10e3) "Flue gases reference specific enthalpy"; - Real Vea(start = 0.001) "Air volume mass (m3/kg)"; - Real Vsf(start = 0.001) "Flue gases volume mass (m3/kg)"; - Units.SI.Density rhoea(start = 0.001) "Air density at the inlet"; - Units.SI.Density rhosf(start = 0.001) "Flue gases density at the outlet"; - Units.SI.MassFlowRate Qm(start = 400) "Average mlass flow rate in the combusiton chamber"; - Real Vccbm(start = 0.001) "Average volume mass in the combustion chamber"; - Units.SI.Velocity v(start = 100) "Flue gases reference velocity in the combusiton chamber"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - FluidType fluids[3] "Fluids mixing in volume"; + Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate"; + Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet"; + Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate"; + Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet"; + Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet"; + Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet"; + Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases"; + Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases"; + Real XsfO2(start=0) "O2 mass fraction in the flue gases"; + Real XsfSO2(start=0) "SO2 mass fraction in the flue gases"; + Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel"; + Units.SI.Power Wpth(start=1e6) "Thermal losses power"; + Real exc(start=1) "Combustion air ratio"; + Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate"; + Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate"; + Units.SI.SpecificEnthalpy Hcv(start=10e3) + "Volatile ashes specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy Hbf(start=10e3) + "Low furnace ashes specific enthalpy at the outlet"; + ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combustion chamber"; + Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrcd(start=10e3) "Ashes reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy"; + Real Vea(start=0.001) "Air volume mass (m3/kg)"; + Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)"; + Units.SI.Density rhoea(start=0.001) "Air density at the inlet"; + Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet"; + Units.SI.MassFlowRate Qm(start=400) "Average mlass flow rate in the combusiton chamber"; + Real Vccbm(start=0.001) "Average volume mass in the combustion chamber"; + Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jws "Thermal power diffusion from inlet Cws"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -76,89 +96,104 @@ model GenericCombustion "Generic combustion chamber" Real ra "Value of r(Q/gamma) for inlet Ca"; Real rws "Value of r(Q/gamma) for inlet Cws"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws = Integer(ftype_ws) "Water/steam fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation( - Placement(transformation(extent = {{60, -100}, {80, -80}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" annotation( - Placement(transformation(extent = {{-40, -100}, {-20, -80}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" annotation( - Placement(transformation(extent = {{-40, 80}, {-20, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet" annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}, rotation = 0))); -protected - constant Real amC = 12.01115 "Carbon atomic mass"; - constant Real amH = 1.00797 "Hydrogen atomic mass"; - constant Real amO = 15.9994 "Oxygen atomic mass"; - constant Real amS = 32.064 "Sulfur atomic mass"; - constant Units.SI.SpecificEnergy HHVcarbone = 32.8e6 "Unburnt carbon higher heating value"; - constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; - constant Real amH2O = 2*amH + amO "H2O molecular mass"; - constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" + annotation (Placement(transformation(extent={{60,-100},{80,-80}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "Water/steam inlet" + annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); -/* Fuel inlet */ + + assert(Medium_FlueGases.nX > 1, "GenericCombustion: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GenericCombustion: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Fuel inlet */ Qfuel = Cfuel.Q; Tfuel = Cfuel.T; + XCfuel = Cfuel.Xc; XHfuel = Cfuel.Xh; XOfuel = Cfuel.Xo; XSfuel = Cfuel.Xs; Xwfuel = Cfuel.hum; XCDfuel = Cfuel.Xashes; + LHVfuel = Cfuel.LHV; Cpfuel = Cfuel.cp; -/* Water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam"); + + /* Water inlet */ Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; + Qews = Cws.Q; Hews = Cws.h; -/* Air inlet */ + Xws = Cws.Xi; + SubCws = Cws.SubC; + + /* Air inlet */ Qea = Ca.Q; Pea = Ca.P; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; -/* Flue gases outlet */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; -/* Mass balance equation */ + + /* Mass balance equation */ 0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf; + Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV); Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF); -/* Energy balance equation */ - 0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd) + Qbf*(Hbf - Hrcd) + (Qcv*ImbCV + Qbf*ImbBF)*HHVcarbone) - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + J; + + /* Energy balance equation */ + 0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone) + - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + J; + Hfuel = Cpfuel*(Tfuel - 273.16); Hcv = Cpcd*(Tsf - 273.16); Hbf = Cpcd*(Tbf - 273.16); + Cws.h_vol_2 = h; Ca.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; -/* No flow reversal */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0; rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0; rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0; + gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0; gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0; gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0; + Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0; Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0; Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0; @@ -166,57 +201,138 @@ equation ra = 0; rws = 0; rfg = 0; + gamma_a = gamma0; gamma_ws = gamma0; gamma_fg = gamma0; + Ja = 0; Jws = 0; Jfg = 0; end if; + J = Ja + Jws + Jfg; + Ca.diff_res_2 = 0; Cfg.diff_res_1 = 0; + Ca.diff_on_2 = diffusion; Cfg.diff_on_1 = diffusion; -/* Reference specific enthalpies */ + + /* Reference specific enthalpies */ Hrair = 2501.569e3*XeaH2O; Hrfuel = 0; Hrws = 2501.569e3; Hrfg = 2501.569e3*XsfH2O; Hrcd = 0; -/* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); -/* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); -/* Air density at the inlet */ - rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); + + /* Air specific enthalpy at the inlet */ + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); + + /* Air density at the inlet */ + rhoea = Medium_FlueGases.density(state_air_in); Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1; -/* Flue gases density at the outlet */ - rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + + /* Flue gases density at the outlet */ + rhosf = Medium_FlueGases.density(state_fg_out); Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1; -/* CO2 flue gases mass fraction */ + + /* CO2 flue gases mass fraction */ XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC); -/* H2O flue gases mass fraction */ - XsfH2O*Qsf = Qews + (Qea*XeaH2O + Qfuel*XHfuel*amH2O/2/amH); -/* O2 flue gases mass fraction */ + + /* H2O flue gases mass fraction */ + XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel*amH2O/2 /amH); + + /* O2 flue gases mass fraction */ XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel); -/* SO2 flue gases mass fraction */ + + /* SO2 flue gases mass fraction */ XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); -/* Fuel thermal power */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + + /* Fuel thermal power */ HHVfuel = LHVfuel + 224.3e5*XHfuel + 25.1e5*Xwfuel; Wfuel = Qfuel*HHVfuel; Wpth = Qfuel*LHVfuel*Xpth; -/* Combustion air ratio */ - exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O))); -/* Pressure losses */ + + /* Combustion air ratio */ + exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) + - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O))); + + /* Pressure losses */ Pea - Psf = deltaPccb; Qm = Qea + (Qfuel + Qews)/2; Vccbm = (Vea + Vsf)/2; v = Qm*Vccbm/Acham; deltaPccb = (kcham*(v^2))/(2*Vccbm); - annotation( - Diagram(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-50, -36}, {-44, 30}, {-34, -2}, {-10, 66}, {10, -4}, {44, 54}, {66, -44}, {38, -80}, {-34, -80}, {-50, -36}}, lineColor = {0, 0, 0}, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-32, -36}, {-18, -44}, {-26, -16}, {-16, 6}, {4, -44}, {8, -28}, {36, -72}, {16, -80}, {-16, -80}, {-32, -36}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid)}), - Icon(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-50, -36}, {-44, 30}, {-34, -2}, {-10, 66}, {10, -4}, {44, 54}, {66, -44}, {38, -80}, {-34, -80}, {-50, -36}}, lineColor = {0, 0, 0}, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-32, -36}, {-18, -44}, {-26, -16}, {-16, 6}, {4, -44}, {8, -28}, {36, -72}, {16, -80}, {-16, -80}, {-32, -36}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Text(extent = {{82, -76}, {108, -104}}, lineColor = {28, 108, 200}, textString = "Fuel inlet"), Text(extent = {{-66, -78}, {-42, -102}}, lineColor = {28, 108, 200}, textString = "Air inlet"), Text(extent = {{-110, 42}, {-82, 14}}, lineColor = {28, 108, 200}, textString = "Water inlet"), Text(extent = {{-18, 106}, {30, 70}}, lineColor = {238, 46, 47}, textString = "Flue gases outlet")}), + + annotation (Diagram(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44}, + {38,-80},{-34,-80},{-50,-36}}, + lineColor={0,0,0}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72}, + {16,-80},{-16,-80},{-32,-36}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid)}), + Icon(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-50,-36},{-44,30},{-34,-2},{-10,66},{10,-4},{44,54},{66,-44}, + {38,-80},{-34,-80},{-50,-36}}, + lineColor={0,0,0}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-32,-36},{-18,-44},{-26,-16},{-16,6},{4,-44},{8,-28},{36,-72}, + {16,-80},{-16,-80},{-32,-36}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{82,-76},{108,-104}}, + lineColor={28,108,200}, + textString="Fuel inlet"), + Text( + extent={{-66,-78},{-42,-102}}, + lineColor={28,108,200}, + textString="Air inlet"), + Text( + extent={{-110,42},{-82,14}}, + lineColor={28,108,200}, + textString="Water inlet"), + Text( + extent={{-18,106},{30,70}}, + lineColor={238,46,47}, + textString="Flue gases outlet")}), Documentation(revisions = " Authors @@ -227,4 +343,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end GenericCombustion; \ No newline at end of file +end GenericCombustion; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo index ae758232..e909e4b6 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo @@ -1,82 +1,102 @@ within ThermoSysPro.Fluid.Combustion.CombustionChambers; - model GenericCombustion1D "Generic combustion chamber 1D" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Integer NCEL = 7; - parameter Units.SI.Area Acham = 1 "Average cross-sectional area of the combustion chamber"; - // parameter ThermoSysPro.Units.SI.Area SM[NCEL] = {639.92,198.58,466.48,466.48,466.48,523.79,523.79} - parameter Units.SI.Area SM[NCEL] = fill(100, NCEL) "Heat exchange area for the node i = projetee )"; - parameter Real RSURF[NCEL] = cat(1, {1.321}, fill(1.409, NCEL - 1)) "Real surface/projected surface"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham = 0.01 "Pressure loss coefficient in the combustion chamber"; - parameter Real Xpth = 0.00 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)"; - parameter Real ImbCV = 0 "Unburnt particles ratio in the volatile ashes (0-1)"; - parameter Real ImbBF = 0 "Unburnt particle ratio in the low furnace ashes (0-1)"; - parameter Units.SI.SpecificHeatCapacity Cpcd = 500 "Ashes specific heat capacity"; - parameter Units.SI.Temperature Tbf = 500 "Ashes temperature at the outlet of the low furnace"; - parameter Real Xbf = 0.1 "Ashes ration in the low furnace (0-1)"; - parameter Units.SI.CoefficientOfHeatTransfer Kec = 50 "Convection and conduction(fouling) heat exchange coefficient"; + parameter Units.SI.Area Acham=1 "Average cross-sectional area of the combustion chamber"; + // parameter Modelica.SIunits.Area SM[NCEL] = {639.92,198.58,466.48,466.48,466.48,523.79,523.79} + parameter Units.SI.Area SM[NCEL]=fill(100, NCEL) "Heat exchange area for the node i = projetee )"; + parameter Real RSURF[NCEL] = cat(1,{1.321},fill(1.409,NCEL - 1)) "Real surface/projected surface"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient kcham=0.01 "Pressure loss coefficient in the combustion chamber"; + parameter Real Xpth=0.00 "Thermal loss fraction in the body of the combustion chamber (0-1 over Q.HHV)"; + parameter Real ImbCV=0 "Unburnt particles ratio in the volatile ashes (0-1)"; + parameter Real ImbBF=0 "Unburnt particle ratio in the low furnace ashes (0-1)"; + parameter Units.SI.SpecificHeatCapacity Cpcd=500 "Ashes specific heat capacity"; + parameter Units.SI.Temperature Tbf=500 "Ashes temperature at the outlet of the low furnace"; + parameter Real Xbf=0.1 "Ashes ration in the low furnace (0-1)"; + parameter Units.SI.CoefficientOfHeatTransfer Kec=50 "Convection and conduction(fouling) heat exchange coefficient"; parameter Real EPSPAR = 0.6 "Combustion chamber walls emissivity"; //parameter Real hrCorr=1.00 "Corrective term for ratiation heat exchange"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Units.SI.MassFlowRate Qea(start = 400) "Air mass flow rate"; - Units.SI.AbsolutePressure Pea(start = 1e5) "Air pressure at the inlet"; - Units.SI.Temperature Tea(start = 600) "Air temperature at the inlet"; - Units.SI.SpecificEnthalpy Hea(start = 50e3) "Air specific enthalpy at the inlet"; - Real XeaCO2(start = 0) "CO2 mass fraction at the air inlet"; - Real XeaH2O(start = 0.1) "H2O mass fraction at the air inlet"; - Real XeaO2(start = 0.2) "O2 mass fraction at the air inlet"; - Real XeaSO2(start = 0) "SO2 mass fraction at the air inlet"; - Units.SI.MassFlowRate Qfuel(start = 5) "Fuel mass flow rate"; - Units.SI.Temperature Tfuel(start = 300) "Fuel temperature"; - Units.SI.SpecificEnthalpy Hfuel(start = 10e3) "Fuel specific enthalpy"; - Real XCfuel(start = 0.8) "C mass fraction in the fuel /pur"; - Real XHfuel(start = 0.2) "H mass fraction in the fuel /pur"; - Real XOfuel(start = 0) "O mass fraction in the fuel /pur"; - Real XSfuel(start = 0) "S mass fraction in the fuel /pur"; - Real Xwfuel(start = 0) "H2O mass fraction in the fuel"; - Real XCDfuel(start = 0) "Ashes mass fraction in the fuel /Dryer"; - Units.SI.SpecificEnergy LHVfuel_D(start = 5e7) "Fuel lower heating value /Dryer"; - Units.SI.SpecificEnergy LHVfuel(start = 5e7) "Fuel lower heating value /Brut"; - Units.SI.SpecificHeatCapacity Cpfuel(start = 1000) "Fuel specific heat capacity"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Real SIGMA = 5.669e-8 "Boltzman constant W/m^2/K^4"; + constant Real amC=12.01115 "Carbon atomic mass"; + constant Real amH=1.00797 "Hydrogen atomic mass"; + constant Real amO=15.9994 "Oxygen atomic mass"; + constant Real amS=32.064 "Sulfur atomic mass"; + constant Units.SI.SpecificEnergy HHVcarbone=32.8e6 "Unburnt carbon higher heating value, CO2 = 3.2791664E+07"; + constant Real RAD = 0.017453293 "pi/180"; + constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; + constant Real amH2O = 2*amH + amO "H2O molecular mass"; + constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate"; + Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet"; + Units.SI.Temperature Tea(start=600) "Air temperature at the inlet"; + Units.SI.SpecificEnthalpy Hea(start=50e3) "Air specific enthalpy at the inlet"; + Real XeaCO2(start=0) "CO2 mass fraction at the air inlet"; + Real XeaH2O(start=0.1) "H2O mass fraction at the air inlet"; + Real XeaO2(start=0.2) "O2 mass fraction at the air inlet"; + Real XeaSO2(start=0) "SO2 mass fraction at the air inlet"; + Units.SI.MassFlowRate Qfuel(start=5) "Fuel mass flow rate"; + Units.SI.Temperature Tfuel(start=300) "Fuel temperature"; + Units.SI.SpecificEnthalpy Hfuel(start=10e3) "Fuel specific enthalpy"; + Real XCfuel(start=0.8) "C mass fraction in the fuel /pur"; + Real XHfuel(start=0.2) "H mass fraction in the fuel /pur"; + Real XOfuel(start=0) "O mass fraction in the fuel /pur"; + Real XSfuel(start=0) "S mass fraction in the fuel /pur"; + Real Xwfuel(start=0) "H2O mass fraction in the fuel"; + Real XCDfuel(start=0) "Ashes mass fraction in the fuel /Dryer"; + Units.SI.SpecificEnergy LHVfuel_D(start=5e7) "Fuel lower heating value /Dryer"; + Units.SI.SpecificEnergy LHVfuel(start=5e7) "Fuel lower heating value /Brut"; + Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity"; Units.SI.SpecificEnergy HHVfuel "Fuel higher heating value"; - Units.SI.MassFlowRate Qews(start = 1) "Water/steam mass flow rate"; - Units.SI.SpecificEnthalpy Hews(start = 10e3) "Water/steam specific enthalpy at the inlet"; - Units.SI.MassFlowRate Qsf(start = 400) "Flue gases mass flow rate"; - Units.SI.AbsolutePressure Psf(start = 12e5) "Flue gases pressure at the outlet"; - Units.SI.Temperature Tsf(start = 1500) "Flue gases temperature at the outlet"; - Units.SI.SpecificEnthalpy Hsf(start = 50e4) "Flue gases specific enthalpy at the outlet"; - Real XsfCO2(start = 0.5) "CO2 mass fraction in the flue gases"; - Real XsfH2O(start = 0.1) "H2O mass fraction in the flue gases"; - Real XsfO2(start = 0) "O2 mass fraction in the flue gases"; - Real XsfSO2(start = 0) "SO2 mass fraction in the flue gases"; - //////////////////////ThermoSysPro.Units.SI.Power Wfuel(start=5e8) "LHV power available in the fuel"; - Units.SI.Power Wpth(start = 1e6) "Thermal losses power"; - Real exc(start = 1) "Combustion air ratio"; - Units.SI.MassFlowRate Qcv(start = 1) "Volatile ashes mass flow rate"; - Units.SI.MassFlowRate Qbf(start = 1) "Low furnace ashes mass flow rate"; - Units.SI.SpecificEnthalpy Hcv(start = 10e3) "Volatile ashes specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy Hbf(start = 10e3) "Low furnace ashes specific enthalpy at the outlet"; - ThermoSysPro.Units.SI.PressureDifference deltaPccb(start = 1e3) "Pressure loss in the combustion chamber"; - Units.SI.SpecificEnthalpy Hrair(start = 10e3) "Air reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrws(start = 10e4) "Water/steam reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrfuel(start = 10e3) "Fuel reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrcd(start = 10e3) "Ashes reference specific enthalpy"; - Units.SI.SpecificEnthalpy Hrfg(start = 10e3) "Flue gases reference specific enthalpy"; - Real Vea(start = 0.001) "Air volume mass (m3/kg)"; - Real Vsf(start = 0.001) "Flue gases volume mass (m3/kg)"; - Units.SI.Density rhoea(start = 0.001) "Air density at the inlet"; - Units.SI.Density rhosf(start = 0.001) "Flue gases density at the outlet"; - Units.SI.MassFlowRate Qm(start = 400) "Average mlass flow rate in the combusiton chamber"; - Real Vccbm(start = 0.001) "Average volume mass in the combustion chamber"; - Units.SI.Velocity v(start = 100) "Flue gases reference velocity in the combusiton chamber"; - Units.SI.Temperature Tpi[NCEL](start = fill(400, NCEL)) "Wall temperature for node i"; - Units.SI.Power Ws[NCEL](start = fill(10e6, NCEL)) "Power delivered to each segment"; - Units.SI.Power Wst(start = 50.e6) "Total power exchanged on all segment"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - FluidType fluids[3] "Fluids mixing in volume"; + Units.SI.MassFlowRate Qews(start=1) "Water/steam mass flow rate"; + Units.SI.SpecificEnthalpy Hews(start=10e3) "Water/steam specific enthalpy at the inlet"; + Units.SI.MassFlowRate Qsf(start=400) "Flue gases mass flow rate"; + Units.SI.AbsolutePressure Psf(start=12e5) "Flue gases pressure at the outlet"; + Units.SI.Temperature Tsf(start=1500) "Flue gases temperature at the outlet"; + Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet"; + Real XsfCO2(start=0.5) "CO2 mass fraction in the flue gases"; + Real XsfH2O(start=0.1) "H2O mass fraction in the flue gases"; + Real XsfO2(start=0) "O2 mass fraction in the flue gases"; + Real XsfSO2(start=0) "SO2 mass fraction in the flue gases"; + //////////////////////Modelica.SIunits.Power Wfuel(start=5e8) "LHV power available in the fuel"; + Units.SI.Power Wpth(start=1e6) "Thermal losses power"; + Real exc(start=1) "Combustion air ratio"; + Units.SI.MassFlowRate Qcv(start=1) "Volatile ashes mass flow rate"; + Units.SI.MassFlowRate Qbf(start=1) "Low furnace ashes mass flow rate"; + Units.SI.SpecificEnthalpy Hcv(start=10e3) "Volatile ashes specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy Hbf(start=10e3) "Low furnace ashes specific enthalpy at the outlet"; + ThermoSysPro.Units.SI.PressureDifference deltaPccb(start=1e3) "Pressure loss in the combustion chamber"; + Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrws(start=10e4) "Water/steam reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrfuel(start=10e3) "Fuel reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrcd(start=10e3) "Ashes reference specific enthalpy"; + Units.SI.SpecificEnthalpy Hrfg(start=10e3) "Flue gases reference specific enthalpy"; + Real Vea(start=0.001) "Air volume mass (m3/kg)"; + Real Vsf(start=0.001) "Flue gases volume mass (m3/kg)"; + Units.SI.Density rhoea(start=0.001) "Air density at the inlet"; + Units.SI.Density rhosf(start=0.001) "Flue gases density at the outlet"; + Units.SI.MassFlowRate Qm(start=400) "Average mlass flow rate in the combusiton chamber"; + Real Vccbm(start=0.001) "Average volume mass in the combustion chamber"; + Units.SI.Velocity v(start=100) "Flue gases reference velocity in the combusiton chamber"; + Units.SI.Temperature Tpi[NCEL](start=fill(400, NCEL)) "Wall temperature for node i"; + Units.SI.Power Ws[NCEL](start=fill(10e6, NCEL)) "Power delivered to each segment"; + Units.SI.Power Wst(start=50.e6) "Total power exchanged on all segment"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jws "Thermal power diffusion from inlet Cws"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; @@ -87,40 +107,38 @@ model GenericCombustion1D "Generic combustion chamber 1D" Real ra "Value of r(Q/gamma) for inlet Ca"; Real rws "Value of r(Q/gamma) for inlet Cws"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws = Integer(ftype_ws) "Water/steam fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation( - Placement(transformation(extent = {{-100, -60}, {-80, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" annotation( - Placement(transformation(extent = {{-10, -100}, {10, -80}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" annotation( - Placement(transformation(extent = {{-10, 80}, {10, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws "Water/steam inlet" annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}, rotation = 0))); - Thermal.Connectors.ThermalPort Cth[NCEL] "Thermal W T" annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}, rotation = 0))); -protected - constant Real SIGMA = 5.669e-8 "Boltzman constant W/m^2/K^4"; - constant Real amC = 12.01115 "Carbon atomic mass"; - constant Real amH = 1.00797 "Hydrogen atomic mass"; - constant Real amO = 15.9994 "Oxygen atomic mass"; - constant Real amS = 32.064 "Sulfur atomic mass"; - constant Units.SI.SpecificEnergy HHVcarbone = 32.8e6 "Unburnt carbon higher heating value, CO2 = 3.2791664E+07"; - constant Real RAD = 0.017453293 "pi/180"; - constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; - constant Real amH2O = 2*amH + amO "H2O molecular mass"; - constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" + annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "Water/steam inlet" + annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation= + 0))); + Thermal.Connectors.ThermalPort Cth[NCEL] "Thermal W T" + annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); -/* Heat transfer */ + + assert(Medium_FlueGases.nX > 1, "GenericCombustion1D: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GenericCombustion1D: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Heat transfer */ Cth.W = -Ws; Cth.T = Tpi; -/* Fuel inlet */ + + /* Fuel inlet */ Qfuel = Cfuel.Q; Tfuel = Cfuel.T; XCfuel = Cfuel.Xc; @@ -131,52 +149,66 @@ equation XCDfuel = Cfuel.Xashes; LHVfuel_D = Cfuel.LHV; Cpfuel = Cfuel.cp; -/* Water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GenericCombustion: the fluid type for the water/steam inlet must be water/steam"); + + /* Water inlet */ Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; + Qews = Cws.Q; Hews = Cws.h; -/* Air inlet */ + Xws = Cws.Xi; + SubCws = Cws.SubC; + + /* Air inlet */ Qea = Ca.Q; Pea = Ca.P; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; -/* Flue gases outlet */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; -/* Mass balance equation */ + + /* Mass balance equation */ 0 = Qea + Qews + Qfuel*(1 - XCDfuel) - Qcv*ImbCV - Qbf*ImbBF - Qsf; + Qcv = Qfuel*XCDfuel*(1 - Xbf)/(1 - ImbCV); Qbf = Qfuel*XCDfuel*Xbf/(1 - ImbBF); -/* Energy balance equation */ - 0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd) + Qbf*(Hbf - Hrcd) + (Qcv*ImbCV + Qbf*ImbBF)*HHVcarbone) - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + Wst + J; - Hfuel = Cpfuel*(Tfuel - 273.16); - Hcv = Cpcd*(Tsf - 273.16); - Hbf = Cpcd*(Tbf - 273.16); + + /* Energy balance equation */ + 0 = ((Qea + Qews + Qfuel*(1 - XCDfuel))*(Hsf - Hrfg) + Wpth + Qcv*(Hcv - Hrcd)+ Qbf*(Hbf - Hrcd)+(Qcv*ImbCV+Qbf*ImbBF)*HHVcarbone) + - (Qfuel*(Hfuel - Hrfuel + LHVfuel) + Qea*(Hea - Hrair) + Qews*(Hews - Hrws)) + Wst + J; + + Hfuel = Cpfuel*(Tfuel-273.16); + Hcv = Cpcd*(Tsf-273.16); + Hbf = Cpcd*(Tbf-273.16); + Cws.h_vol_2 = h; Ca.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; -/* No flow reversal */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0; rws = if Cws.diff_on_1 then exp(-0.033*(Cws.Q*Cws.diff_res_1)^2) else 0; rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0; + gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0; gamma_ws = if Cws.diff_on_1 then 1/Cws.diff_res_1 else gamma0; gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0; + Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0; Jws = if Cws.diff_on_1 then rws*gamma_ws*(Cws.h_vol_1 - Cws.h_vol_2) else 0; Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0; @@ -184,66 +216,232 @@ equation ra = 0; rws = 0; rfg = 0; + gamma_a = gamma0; gamma_ws = gamma0; gamma_fg = gamma0; + Ja = 0; Jws = 0; Jfg = 0; end if; + J = Ja + Jws + Jfg; + Ca.diff_res_2 = 0; Cfg.diff_res_1 = 0; + Ca.diff_on_2 = diffusion; Cfg.diff_on_1 = diffusion; -/* Reference specific enthalpies */ + + /* Reference specific enthalpies */ Hrair = 2501.569e3*XeaH2O; Hrfuel = 0; Hrws = 2501.569e3; Hrfg = 2501.569e3*XsfH2O; Hrcd = 0; -/* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); -/* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); -/* Air density at the inlet */ - rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); - Vea = if (rhoea > 0.001) then 1/rhoea else 1/1.1; -/* Flue gases density at the outlet */ - rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); - Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1; -/* CO2 flue gases mass fraction */ + + /* Air specific enthalpy at the inlet */ + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); + + /* Air density at the inlet */ + rhoea = Medium_FlueGases.density(state_air_in); + Vea = if (rhoea >0.001) then 1/rhoea else 1/1.1; + + /* Flue gases density at the outlet */ + rhosf = Medium_FlueGases.density(state_fg_out); + Vsf = if (rhosf >0.001) then 1/rhosf else 1/0.1; + + /* CO2 flue gases mass fraction */ XsfCO2*Qsf = (Qea*XeaCO2) + ((Qfuel*XCfuel - Qcv*ImbCV - Qbf*ImbBF)*amCO2/amC); -/* H2O flue gases mass fraction */ -//XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH); - XsfH2O*Qsf = Qews + (Qea*XeaH2O + Qfuel*XHfuel*amH2O/2/amH) + Xwfuel*Qfuel; -/* O2 flue gases mass fraction */ + + /* H2O flue gases mass fraction */ + //XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH); + XsfH2O*Qsf = Qews + (Qea*XeaH2O+Qfuel*XHfuel* amH2O/2 /amH)+Xwfuel*Qfuel; + + /* O2 flue gases mass fraction */ XsfO2*Qsf = (Qea*XeaO2) - (Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS)) + (Qfuel*XOfuel); -/* SO2 flue gases mass fraction */ + + /* SO2 flue gases mass fraction */ XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); -/* LHV conversion from dryer to crude*/ - LHVfuel = -2510000.0*Xwfuel + LHVfuel_D*(1 - Xwfuel); -/* Fuel higher heating value */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + + /* LHV conversion from dryer to crude*/ + LHVfuel = -2510000.0*Xwfuel + LHVfuel_D*(1-Xwfuel); + + /* Fuel higher heating value */ HHVfuel = LHVfuel_D + 224.3e5*XHfuel + 25.1e5*Xwfuel; -/* Thermal losses power */ + + /* Thermal losses power */ Wpth = Qfuel*LHVfuel*Xpth; -/* Combustion air ratio */ - exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O))); + + /* Combustion air ratio */ + exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO) + - Qfuel*amO*2*(Qcv*ImbCV + Qbf*ImbBF)/amC)/(XeaO2/(1 - XeaH2O))); // exc = Qea*(1 - XeaH2O)/((Qfuel*amO*(2*XCfuel/amC + 0.5*XHfuel/amH + 2*XSfuel/amS - XOfuel/amO))/(XeaO2c/(1 - XeaH2O))); -/* Pressure losses */ + + /* Pressure losses */ Pea - Psf = deltaPccb; Qm = (Qea + Qfuel + Qews)/2; Vccbm = (Vea + Vsf)/2; v = Qm*Vccbm/Acham; deltaPccb = (kcham*(v^2))/(2*Vccbm); -/* Power delivered to each segment*/ + + /* Power delivered to each segment*/ for i in 1:NCEL loop - Ws[i] = SIGMA*EPSPAR*RSURF[i]*SM[i]*(Tsf^4 - Tpi[i]^4) + Kec*RSURF[i]*SM[i]*(Tsf - Tpi[i]); + Ws[i] = SIGMA*EPSPAR*RSURF[i]*SM[i]*(Tsf^4 - Tpi[i]^4) + Kec*RSURF[i]*SM[i]*(Tsf - Tpi[i]); end for; + Wst = sum(Ws); - annotation( - Diagram(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, lineThickness = 0.5, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-56, 45}, {-54, 53}, {-50, 57}, {-44, 59}, {-36, 61}, {-26, 61}, {-16, 59}, {-8, 55}, {0, 51}, {2, 48}, {0, 46}, {-2, 45}, {-6, 43}, {-6, 42}, {-4, 42}, {4, 44}, {10, 44}, {16, 43}, {28, 41}, {44, 37}, {28, 29}, {16, 25}, {2, 21}, {-8, 19}, {-16, 17}, {-28, 17}, {-42, 19}, {-50, 21}, {-56, 27}, {-56, 33}, {-52, 37}, {-56, 45}}, lineColor = {255, 0, 0}, lineThickness = 1, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-56, 45}, {-54, 51}, {-48, 55}, {-40, 57}, {-32, 57}, {-22, 55}, {-14, 51}, {-10, 47}, {-14, 43}, {-18, 41}, {-22, 39}, {-22, 37}, {-18, 35}, {-12, 36}, {-8, 36}, {-2, 37}, {2, 37}, {10, 37}, {22, 35}, {-4, 25}, {-18, 21}, {-26, 19}, {-36, 19}, {-42, 21}, {-50, 23}, {-54, 27}, {-56, 33}, {-54, 39}, {-56, 45}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 213, 170}), Polygon(points = {{-51, 39}, {-53, 45}, {-49, 49}, {-45, 51}, {-41, 51}, {-36, 47}, {-33, 43}, {-33, 39}, {-34, 35}, {-37, 31}, {-39, 29}, {-43, 27}, {-47, 27}, {-51, 29}, {-53, 31}, {-53, 33}, {-51, 39}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 255, 170}), Polygon(points = {{-56, -30}, {-54, -22}, {-50, -18}, {-44, -16}, {-36, -14}, {-26, -14}, {-16, -16}, {-8, -20}, {-2, -24}, {0, -26}, {0, -28}, {0, -28}, {-2, -30}, {-6, -32}, {-4, -32}, {4, -30}, {10, -30}, {20, -32}, {28, -34}, {44, -38}, {28, -46}, {16, -50}, {2, -54}, {-8, -56}, {-16, -58}, {-28, -58}, {-42, -56}, {-50, -54}, {-56, -48}, {-56, -42}, {-52, -38}, {-56, -30}}, lineColor = {255, 0, 0}, lineThickness = 1, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-56, -30}, {-54, -24}, {-48, -20}, {-40, -18}, {-32, -18}, {-22, -20}, {-14, -24}, {-10, -28}, {-14, -32}, {-18, -34}, {-22, -36}, {-22, -38}, {-18, -40}, {-12, -40}, {-8, -40}, {-2, -38}, {2, -38}, {10, -38}, {22, -40}, {-4, -50}, {-18, -54}, {-26, -56}, {-36, -56}, {-42, -54}, {-50, -52}, {-54, -48}, {-56, -42}, {-54, -36}, {-56, -30}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 213, 170}), Polygon(points = {{-51, -36}, {-53, -30}, {-49, -26}, {-45, -24}, {-41, -24}, {-36, -28}, {-33, -32}, {-33, -36}, {-34, -40}, {-37, -44}, {-39, -46}, {-43, -48}, {-47, -48}, {-51, -46}, {-53, -44}, {-53, -42}, {-51, -36}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 255, 170})}), - Icon(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, lineThickness = 0.5, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-54, 45}, {-52, 53}, {-48, 57}, {-42, 59}, {-34, 61}, {-24, 61}, {-14, 59}, {-6, 55}, {2, 51}, {4, 48}, {2, 46}, {0, 45}, {-4, 43}, {-4, 42}, {-2, 42}, {6, 44}, {12, 44}, {18, 43}, {30, 41}, {46, 37}, {30, 29}, {18, 25}, {4, 21}, {-6, 19}, {-14, 17}, {-26, 17}, {-40, 19}, {-48, 21}, {-54, 27}, {-54, 33}, {-50, 37}, {-54, 45}}, lineColor = {255, 0, 0}, lineThickness = 1, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-54, 45}, {-52, 51}, {-46, 55}, {-38, 57}, {-30, 57}, {-20, 55}, {-12, 51}, {-8, 47}, {-12, 43}, {-16, 41}, {-20, 39}, {-20, 37}, {-16, 35}, {-10, 36}, {-6, 36}, {0, 37}, {4, 37}, {12, 37}, {24, 35}, {-2, 25}, {-16, 21}, {-24, 19}, {-34, 19}, {-40, 21}, {-48, 23}, {-52, 27}, {-54, 33}, {-52, 39}, {-54, 45}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 213, 170}), Polygon(points = {{-49, 39}, {-51, 45}, {-47, 49}, {-43, 51}, {-39, 51}, {-34, 47}, {-31, 43}, {-31, 39}, {-32, 35}, {-35, 31}, {-37, 29}, {-41, 27}, {-45, 27}, {-49, 29}, {-51, 31}, {-51, 33}, {-49, 39}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 255, 170}), Polygon(points = {{-54, -30}, {-52, -22}, {-48, -18}, {-42, -16}, {-34, -14}, {-24, -14}, {-14, -16}, {-6, -20}, {0, -24}, {2, -26}, {2, -28}, {2, -28}, {0, -30}, {-4, -32}, {-2, -32}, {6, -30}, {12, -30}, {22, -32}, {30, -34}, {46, -38}, {30, -46}, {18, -50}, {4, -54}, {-6, -56}, {-14, -58}, {-26, -58}, {-40, -56}, {-48, -54}, {-54, -48}, {-54, -42}, {-50, -38}, {-54, -30}}, lineColor = {255, 0, 0}, lineThickness = 1, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-54, -30}, {-52, -24}, {-46, -20}, {-38, -18}, {-30, -18}, {-20, -20}, {-12, -24}, {-8, -28}, {-12, -32}, {-16, -34}, {-20, -36}, {-20, -38}, {-16, -40}, {-10, -40}, {-6, -40}, {0, -38}, {4, -38}, {12, -38}, {24, -40}, {-2, -50}, {-16, -54}, {-24, -56}, {-34, -56}, {-40, -54}, {-48, -52}, {-52, -48}, {-54, -42}, {-52, -36}, {-54, -30}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 213, 170}), Polygon(points = {{-49, -36}, {-51, -30}, {-47, -26}, {-43, -24}, {-39, -24}, {-34, -28}, {-31, -32}, {-31, -36}, {-32, -40}, {-35, -44}, {-37, -46}, {-41, -48}, {-45, -48}, {-49, -46}, {-51, -44}, {-51, -42}, {-49, -36}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 255, 170}), Text(extent = {{-114, 46}, {-82, 18}}, lineColor = {28, 108, 200}, textString = "Water inlet"), Text(extent = {{14, 104}, {62, 68}}, lineColor = {238, 46, 47}, textString = "Flue gases outlet"), Text(extent = {{-108, -54}, {-82, -82}}, lineColor = {28, 108, 200}, textString = "Fuel inlet"), Text(extent = {{-40, -80}, {-14, -104}}, lineColor = {28, 108, 200}, textString = "Air inlet")}), + + annotation (Diagram(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + lineThickness=0.5, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-56,45},{-54,53},{-50,57},{-44,59},{-36,61},{-26,61},{-16,59}, + {-8,55},{0,51},{2,48},{0,46},{-2,45},{-6,43},{-6,42},{-4,42},{4, + 44},{10,44},{16,43},{28,41},{44,37},{28,29},{16,25},{2,21},{-8,19}, + {-16,17},{-28,17},{-42,19},{-50,21},{-56,27},{-56,33},{-52,37},{ + -56,45}}, + lineColor={255,0,0}, + lineThickness=1, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-56,45},{-54,51},{-48,55},{-40,57},{-32,57},{-22,55},{-14,51}, + {-10,47},{-14,43},{-18,41},{-22,39},{-22,37},{-18,35},{-12,36},{ + -8,36},{-2,37},{2,37},{10,37},{22,35},{-4,25},{-18,21},{-26,19},{ + -36,19},{-42,21},{-50,23},{-54,27},{-56,33},{-54,39},{-56,45}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,213,170}), + Polygon( + points={{-51,39},{-53,45},{-49,49},{-45,51},{-41,51},{-36,47},{-33,43}, + {-33,39},{-34,35},{-37,31},{-39,29},{-43,27},{-47,27},{-51,29},{ + -53,31},{-53,33},{-51,39}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,255,170}), + Polygon( + points={{-56,-30},{-54,-22},{-50,-18},{-44,-16},{-36,-14},{-26,-14},{ + -16,-16},{-8,-20},{-2,-24},{0,-26},{0,-28},{0,-28},{-2,-30},{-6, + -32},{-4,-32},{4,-30},{10,-30},{20,-32},{28,-34},{44,-38},{28,-46}, + {16,-50},{2,-54},{-8,-56},{-16,-58},{-28,-58},{-42,-56},{-50,-54}, + {-56,-48},{-56,-42},{-52,-38},{-56,-30}}, + lineColor={255,0,0}, + lineThickness=1, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-56,-30},{-54,-24},{-48,-20},{-40,-18},{-32,-18},{-22,-20},{ + -14,-24},{-10,-28},{-14,-32},{-18,-34},{-22,-36},{-22,-38},{-18, + -40},{-12,-40},{-8,-40},{-2,-38},{2,-38},{10,-38},{22,-40},{-4, + -50},{-18,-54},{-26,-56},{-36,-56},{-42,-54},{-50,-52},{-54,-48}, + {-56,-42},{-54,-36},{-56,-30}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,213,170}), + Polygon( + points={{-51,-36},{-53,-30},{-49,-26},{-45,-24},{-41,-24},{-36,-28},{ + -33,-32},{-33,-36},{-34,-40},{-37,-44},{-39,-46},{-43,-48},{-47, + -48},{-51,-46},{-53,-44},{-53,-42},{-51,-36}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,255,170})}), Icon(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + lineThickness=0.5, + fillColor=DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-54,45},{-52,53},{-48,57},{-42,59},{-34,61},{-24,61},{-14,59}, + {-6,55},{2,51},{4,48},{2,46},{0,45},{-4,43},{-4,42},{-2,42},{6,44}, + {12,44},{18,43},{30,41},{46,37},{30,29},{18,25},{4,21},{-6,19},{ + -14,17},{-26,17},{-40,19},{-48,21},{-54,27},{-54,33},{-50,37},{ + -54,45}}, + lineColor={255,0,0}, + lineThickness=1, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-54,45},{-52,51},{-46,55},{-38,57},{-30,57},{-20,55},{-12,51}, + {-8,47},{-12,43},{-16,41},{-20,39},{-20,37},{-16,35},{-10,36},{-6, + 36},{0,37},{4,37},{12,37},{24,35},{-2,25},{-16,21},{-24,19},{-34, + 19},{-40,21},{-48,23},{-52,27},{-54,33},{-52,39},{-54,45}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,213,170}), + Polygon( + points={{-49,39},{-51,45},{-47,49},{-43,51},{-39,51},{-34,47},{-31,43}, + {-31,39},{-32,35},{-35,31},{-37,29},{-41,27},{-45,27},{-49,29},{ + -51,31},{-51,33},{-49,39}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,255,170}), + Polygon( + points={{-54,-30},{-52,-22},{-48,-18},{-42,-16},{-34,-14},{-24,-14},{ + -14,-16},{-6,-20},{0,-24},{2,-26},{2,-28},{2,-28},{0,-30},{-4,-32}, + {-2,-32},{6,-30},{12,-30},{22,-32},{30,-34},{46,-38},{30,-46},{18, + -50},{4,-54},{-6,-56},{-14,-58},{-26,-58},{-40,-56},{-48,-54},{ + -54,-48},{-54,-42},{-50,-38},{-54,-30}}, + lineColor={255,0,0}, + lineThickness=1, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-54,-30},{-52,-24},{-46,-20},{-38,-18},{-30,-18},{-20,-20},{ + -12,-24},{-8,-28},{-12,-32},{-16,-34},{-20,-36},{-20,-38},{-16, + -40},{-10,-40},{-6,-40},{0,-38},{4,-38},{12,-38},{24,-40},{-2,-50}, + {-16,-54},{-24,-56},{-34,-56},{-40,-54},{-48,-52},{-52,-48},{-54, + -42},{-52,-36},{-54,-30}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,213,170}), + Polygon( + points={{-49,-36},{-51,-30},{-47,-26},{-43,-24},{-39,-24},{-34,-28},{ + -31,-32},{-31,-36},{-32,-40},{-35,-44},{-37,-46},{-41,-48},{-45, + -48},{-49,-46},{-51,-44},{-51,-42},{-49,-36}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,255,170}), + Text( + extent={{-114,46},{-82,18}}, + lineColor={28,108,200}, + textString="Water inlet"), + Text( + extent={{14,104},{62,68}}, + lineColor={238,46,47}, + textString="Flue gases outlet"), + Text( + extent={{-108,-54},{-82,-82}}, + lineColor={28,108,200}, + textString="Fuel inlet"), + Text( + extent={{-40,-80},{-14,-104}}, + lineColor={28,108,200}, + textString="Air inlet")}), Documentation(revisions = " Author @@ -254,4 +452,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 8.2 of the ThermoSysPro book. ")); -end GenericCombustion1D; \ No newline at end of file +end GenericCombustion1D; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo index 9d7a8c67..56463713 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo @@ -1,305 +1,321 @@ -within ThermoSysPro.Fluid.Combustion.CombustionChambers; - +within ThermoSysPro.Fluid.Combustion.CombustionChambers; model GridFurnace "Combustion furnace" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real X2eap = 0.1 "Primary air fraction in zone 2"; - parameter Real X3eap = 0.1 "Primary air fraction in zone 3"; - parameter Real XCleom = 0 "Cl mass fraction in the biomass"; - parameter Real XFeom = 0 "F mass fraction in the biomass"; - parameter Real XMACHeom = 0 "machefers mass fraction in the biomass"; - parameter Units.SI.Density rhoCENDom = 0.5 "Density of the ashes in the biomass"; - parameter Units.SI.Temperature Tfrecirc = 600 "Temperature of the recirculated flue gases"; - parameter Real XfCO2recirc = 0.3 "CO2 mass fraction in the recirculated flue gases"; - parameter Real XfH2Orecirc = 0.1 "H2O mass fraction in the recirculated flue gases"; - parameter Real XfO2recirc = 0.2 "O2 mass fraction in the recirculated flue gases"; - parameter Real XfSO2recirc = 0 "SO2 mass fraction in the recirculated flue gases"; - parameter Real Xrecirc = 0.1 "Recirculated flue gases fraction in Qsf"; - parameter Units.SI.SpecificHeatCapacity CpMACH = 500 "Clinker average specific heat capacity"; - parameter Units.SI.SpecificHeatCapacity CpMACHs2 = 500 "Clinker specific heat capacity at the outlet of zone 2"; - parameter Units.SI.SpecificHeatCapacity CpMACHs3 = 500 "Clinker specific heat capacity at the outlet of zone 3"; - parameter Units.SI.SpecificHeatCapacity CpMACHs4 = 500 "Clinker specific heat capacity at the outlet of zone 4"; - parameter Units.SI.Temperature TsjeMACH = 293 "Clinker temperature at the outlet of the water seal"; - parameter Units.SI.Temperature Teeje = 293 "Water temperature at the outlet of the water seal"; - parameter Real XsjeH2OMACH = 0.2 "Clinker humidity at the outlet of the water seal"; - parameter Real rendje = 1 "Water seal efficiency"; - parameter Integer jointeau = 0 "1: with water seal - 0: without water seal"; - parameter Real XCvol = 0 "Volatile carbon fraction"; - parameter Real XCimb = 0 "Unburnt carbon fraction"; - parameter Units.SI.Temperature T1sfm = 500 "Flue gases temperature at the outlet of zone 1"; - parameter Real Eray2 = 0.1 "Energy fraction radiated towards zone 2 of the furnace"; - parameter Real Eray5 = 0.1 "Energy fraction radiated towards zone 5 of the furnac"; - parameter Real perte = 0 "Loss percent of LHV"; - parameter Units.SI.SpecificHeatCapacity Cp3CO = 500 "CO specific heat capacity in zone 3"; - Units.SI.MassFlowRate Qsf(start = 10) "Flue gases mass flow rate at the outlet"; - Units.SI.AbsolutePressure Psf(start = 1e5) "Flue gases pressure at the outlet"; - Units.SI.Temperature Tsf(start = 1000) "Flue gases temperature at the outlet"; - Real XsfN2(start = 0.6) "Flue gases N2 mass fraction at the outlet"; - Real XsfCO2(start = 0.1) "Flue gases CO2 mass fraction at the outlet"; - Real XsfH2O(start = 0.1) "Flue gases H2O mass fraction at the outlet"; - Real XsfO2(start = 0.1) "Flue gases O2 mass fraction at the outlet"; - Real XsfSO2(start = 0.1) "Flue gases SO2 mass fraction at the outlet"; - Units.SI.MassFlowRate Qeap(start = 10) "Primary air mass flow rate"; - Units.SI.AbsolutePressure Peap(start = 1e5) "Primary air pressure"; - Units.SI.Temperature Teap(start = 300) "Primary air temperature"; - Real XeapN2(start = 0.6) "Primary air N2 mass fraction"; - Real XeapCO2(start = 0.1) "Primary air CO2 mass fraction"; - Real XeapH2O(start = 0.1) "Primary air H2O mass fraction"; - Real XeapO2(start = 0.1) "Primary air O2 mass fraction"; - Real XeapSO2(start = 0.1) "Primary air SO2 mass fraction"; - Units.SI.MassFlowRate Qeas(start = 10) "Secondary air mass flow rate"; - Units.SI.AbsolutePressure Peas(start = 1e5) "Secondary air pressure"; - Units.SI.Temperature Teas(start = 300) "Secondary air temperature"; - Real XeasN2(start = 0.6) "Secondary air N2 mass fraction"; - Real XeasCO2(start = 0.1) "Secondary air CO2 mass fraction"; - Real XeasH2O(start = 0.1) "Secondary air H2O mass fraction"; - Real XeasO2(start = 0.1) "Secondaryr O2 mass fraction"; - Real XeasSO2(start = 0.1) "Secondary SO2 mass fraction"; - Units.SI.MassFlowRate Qeom(start = 10) "Biomass mass flow rate"; - Units.SI.Temperature Teom(start = 300) "Biomass temperature"; - Real PCIom(start = 1e6) "Biomass LHV (J/kg)"; - Real XCeom(start = 0.1) "Biomass C mass fraction"; - Real XHeom(start = 0.1) "Biomass H mass fraction"; - Real XOeom(start = 0.1) "Biomass O mass fraction"; - Real XNeom(start = 0.01) "Biomass N mass fraction"; - Real XSeom(start = 0.1) "Biomass S mass fraction"; - Real XCENDeom(start = 0.1) "Biomass ashes mass fraction"; - Real XH2Oeom(start = 0.1) "Biomass humidity"; - Units.SI.SpecificHeatCapacity Cpom(start = 1000) "Biomass specific heat capacity"; - Units.SI.MassFlowRate Qerefo(start = 10) "Cooling water mass flow rate"; - Units.SI.SpecificEnthalpy Herefo(start = 10e3) "Cooling water specific enthalpy"; - Units.SI.MassFlowRate Qfrecirc(start = 10) "Recirculated flue gases mass flow rate"; - Real XsfN2recirc(start = 0.1) "Recirculated flue gases N2 mass fraction"; - Real PCIMACH(start = 10e6) "Clinker LHV"; - Units.SI.MassFlowRate QsMACH(start = 10) "Clinker mass flow rate"; - Units.SI.Temperature TsMACH(start = 500) "Clinket temperature"; - Real FVN(start = 0.1) "Volatile ashes mass fraction"; - Units.SI.Density rhocend(start = 500) "Ashes density in the flue gases"; - Units.SI.Power Wsr(start = 10e6) "Radiated power"; - Real excair(start = 0.1) "Combustion excess air"; - Real X1eap(start = 0.1) "Primary air fraction in zone 1"; - Units.SI.MassFlowRate Q1eap(start = 10) "Primary mass flow rate in zone 1"; - Units.SI.MassFlowRate Q2eap(start = 10) "Primary mass flow rate in zone 2"; - Units.SI.MassFlowRate Q3eap(start = 10) "Primary mass flow rate in zone 3"; - Real XCvol2(start = 0.1) "C mass fraction burnt in zone 2"; - Real XMACHimb(start = 0.1) "C mass raction unburnt in the clinker"; - Real XCvol3(start = 0.1) "C mass fraction burnt in zone 3"; - //Zone1 - Units.SI.SpecificEnthalpy Heap(start = 1e3) "Humid air specific enthalpy at the primary air temperature"; - Units.SI.SpecificEnthalpy Heas(start = 1e3) "Humid air specific enthalpy at the secondary air temperature"; - Units.SI.SpecificEnthalpy H1a(start = 1e3) "Primary air specific enthalpy at T1sfm"; - Units.SI.SpecificEnthalpy Hefrecirc(start = 1e3) "Specific enthalpy of the incoming recirculated flue gases"; - Units.SI.MassFlowRate Qeasm(start = 10) "Mass flow rate of the secondary air / recirculated flue gases mixture"; - Units.SI.SpecificEnthalpy Heasm(start = 1e3) "Specific enthalpy of the secondary air / recirculated flue gases mixture"; - Units.SI.Temperature Teasm(start = 500) "Temperature of the secondary air / recirculated flue gases mixture"; - Real XeasmO2(start = 0.1) "O2 mass fraction in the secondary air / recirculated flue gases mixture"; - Real XeasmCO2(start = 0.1) "CO2 mass fraction in the secondary air / recirculated flue gases mixture"; - Real XeasmH2O(start = 0.1) "H2O mass fraction in the secondary air / recirculated flue gases mixture"; - Real XeasmSO2(start = 0.1) "SO2 mass fraction in the secondary air / recirculated flue gases mixture"; - Real XeasmN2(start = 0.1) "N2 mass fraction in the secondary air / recirculated flue gases mixture"; - Units.SI.SpecificEnthalpy Heauom(start = 1e3) "Biomass water specific enthalpy"; - Units.SI.AbsolutePressure Psateom(start = 1e5) "Water saturation presure at Teom"; - Units.SI.SpecificEnthalpy Hvteom(start = 10e3) "Steam saturation specific enthalpy at Teom"; - Units.SI.SpecificEnthalpy Hlteom(start = 10e3) "Water saturation specific enthalpy at Teom"; - Units.SI.SpecificEnthalpy Hvapteom(start = 10e3) "Phase transition energy at Teom"; - Units.SI.SpecificEnthalpy Hs1vom(start = 1e3) "Water specific enthalpy of the outgoing biomass at T1sfm vapor"; - Units.SI.SpecificEnthalpy Heom(start = 1e3) "Biomass specific enthalpy at the inlet"; - Units.SI.Power Wff(start = 1e6) "Flue gases formation energy"; - Units.SI.Power Wp(start = 1e6) "Biomass pyrolysis power"; - Units.SI.Power Wimbp(start = 1e6) "Power saved in the combustion flue gases due to the non-destruction of unburnt C"; - Units.SI.Power Wimbm(start = 1e6) "Power lost by the combustion flue gases due to the non-combustion of unburnt C"; - Units.SI.SpecificEnthalpy Hpyr(start = 1e3) "Pyrolysis specific enthalpy"; - Units.SI.SpecificEnthalpy H1om(start = 1e3) "Specific enthalpy of the dry biomass at the pyrolysis temperature of the biomass"; - Units.SI.MassFlowRate Q1H2O(start = 10) "H2O mass flow rate at the oultet of zone 1"; - Units.SI.MassFlowRate Q1O2(start = 10) "O2 mass flow rate at the oultet of zone 1"; - Units.SI.MassFlowRate Q1N2(start = 10) "N2 mass flow rate at the oultet of zone 1"; - Units.SI.MassFlowRate Q1CO2(start = 10) "CO2 mass flow rate at the oultet of zone 1"; - Units.SI.MassFlowRate Q1SO2(start = 10) "SO2 mass flow rate at the oultet of zone 1"; - Units.SI.MassFlowRate Q1g(start = 10) "Total mass flow rate at the oultet of zone 1"; - Units.SI.MassFlowRate Q2eom(start = 10) "Biomass mass flow rate at the inlet of zone 2"; - Real PCI1om(start = 1e6) "LHV after drying"; - Real X1MACHom(start = 0.1) "Clinker mass fraction in the biomass after drying"; - Real XC1vol2(start = 0.1) "Burnt C mass fraction in zone 2 after drying"; - Real XC1vol3(start = 0.1) "Burnt C mass fraction in zone 3 after drying"; - Real X1MACHimb(start = 0.1) "Unburnt C mass fraction in the clinker after drying"; - Real X1H(start = 0.1) "H mass fraction in the biomass after drying"; - Real X1O(start = 0.1) "O mass fraction in the biomass after drying"; - Real X1N(start = 0.1) "N mass fraction in the biomass after drying"; - Real X1Cl(start = 0.1) "Cl mass fraction in the biomass after drying"; - Real X1F(start = 0.1) "F mass fraction in the biomass after drying"; - Real X1S(start = 0.1) "S mass fraction in the biomass after drying"; - Real X1CEND(start = 0.1) "Ashes mass fraction in the biomass after drying"; - Units.SI.MassFlowRate Qcendom(start = 10) "Ashes mass flow rate"; - Real Xfcend(start = 0.1) "Ashes mass fraction in the flue gases"; - Units.SI.Power P1g(start = 1e6) "Power saved in zone 1"; - //Zone 2 - Units.SI.MassFlowRate Q2eo(start = 10) "Mass flow rate of the oxygen carried by the air and the biomass at the inlet of zone 2"; - Units.SI.MassFlowRate Q2HCl(start = 10) "Combustion HCl mass fraction in zone 2"; - Units.SI.MassFlowRate Q2HF(start = 10) "Combustion HF mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2SO2(start = 10) "Combustion SO2 mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2H2O(start = 10) "Combustion H2O mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2CO(start = 10) "Combustion CO mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2N2(start = 10) "Combustion N2 mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2O2(start = 10) "Combustion O2 mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2cend(start = 10) "Combustion ashes mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2CO2(start = 10) "Combustion CO2 mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q2g(start = 10) "Elements total mass flow rate after combustion"; - Real Epsivol(start = 0.1) "Volatile matter mass fraction produced in zone 2"; - Units.SI.MassFlowRate Q3eom(start = 10) "Solid matter at the inlet of zone 3"; - Real X2MACHom(start = 0.1) "Clinker mass fraction of the biomass after volatilisation"; - Real XC2vol3(start = 0.1) "C mass fraction burnt in zone 3 after volatilisation"; - Real X2MACHimb(start = 0.1) "Unburnt C mas fraction in the clinker after volatilisation"; - Real PCICsol(start = 1e6) "LHV of the solid outgoing carbon"; - Real PCICvol(start = 1e6) "LHV of the volatile carbon transformed into CO"; - Units.SI.SpecificEnthalpy H2(start = 1e3) "Enthalpy released in zone 2"; - Units.SI.Power P2g(start = 1e6) "Power released by the combustion in zone 2"; - Units.SI.Power P1o(start = 1e6) "Power captured by the biomass"; - Units.SI.Power P1v(start = 1e6) "Power captured by the steam"; - Units.SI.Power P1a(start = 1e6) "Power captured by the air"; - Units.SI.Power P1r(start = 1e6) "Power captured by the cooling water"; - Real Eray0(start = 0.2) "Fraction of the radiated power from zone 2 unused for the drying"; - Real X2O2(start = 0.1) "O2 mass fraction at the oultet of zone 2"; - Real X2SO2(start = 0.1) "SO2 mass fraction at the oultet of zone 2"; - Real X2CO2(start = 0.1) "CO2 mass fraction at the oultet of zone 2"; - Real X2H2O(start = 0.1) "H2O mass fraction at the oultet of zone 2"; - Real X2N2(start = 0.1) "N2 mass fraction at the oultet of zone 2"; - Units.SI.SpecificEnthalpy H2g(start = 1200000) "Flue gases specific enthalpy at the oultet of zone 2"; - Units.SI.Temperature T2(start = 1000) "Flue gases temperature at the oultet of zone 2"; - //Zone 3 - Units.SI.MassFlowRate Q3od(start = 10) "O mass flow rate available for the oxydation of the clinker in CO and/or CO2"; - Units.SI.MassFlowRate Q3cd(start = 10) "C mass flow rate available for the oxydation of the clinker in CO and/or CO2"; - Real taux3oc(start = 0.1) "Ratio of the mass flow rates O/C available for the oxydation of the clinker"; - Units.SI.MassFlowRate Q3CO2(start = 10) "CO2 mass flow rate at the outlet of zone 3"; - Units.SI.MassFlowRate Q3CO(start = 10) "CO mass flow rate at the outlet of zone 3"; - Units.SI.MassFlowRate Q3O2(start = 10) "O2 mass flow rate at the outlet of zone 3"; - Units.SI.MassFlowRate Q3N2(start = 10) "N2 mass flow rate at the outlet of zone 3"; - Units.SI.MassFlowRate Q3H2O(start = 10) "H2O mass flow rate at the outlet of zone 3"; - Units.SI.MassFlowRate Q3SO2(start = 10) "SO2 mass flow rate at the outlet of zone 3"; - Units.SI.Power P3s(start = 1e6) "Power captured by solid matter in zone 3"; - Units.SI.Power P3g(start = 1e6) "Power captured by gaseous matter in zone 3"; - Units.SI.SpecificEnthalpy H3s(start = 1e3) "Gaseous matter specific enthalpy at T3g"; - Units.SI.SpecificEnthalpy H3g(start = 1e3) "Solid matter specific enthalpy at T3o"; - Real XC2vol31(start = 0.1) "C mass fraction burnt in zone 3 after volatilisation"; - Real XC2vol4(start = 0.1) "C mass fraction burnt at the inlet of zone 4"; - Units.SI.MassFlowRate Q3g(start = 10) "Flue gases mass flow rate at the outlet of zone 3"; - Units.SI.MassFlowRate Q4eom(start = 10) "Clinker mass flow rate at the inlet of zone 4"; - Real X4MACHom(start = 0.1) "Mass flow rate of the biomass clinker after C volatilisation in zone 3"; - Real X4MACHimb(start = 0.1) "Unburnt C mass fraction in the clinker after C volatilisation in zone 3"; - Units.SI.SpecificHeatCapacity Cp3a(start = 1000) "Average specific heat capacity at the inlet of zone 3"; - Units.SI.Temperature T3o(start = 500) "Clinker temperature at the outlet of zone 3"; - Units.SI.Power P3ac(start = 1e6) "Air power heated at (T2 + T3o)/2"; - Units.SI.Power P3co(start = 1e6) "CO power heated at (T2 + T3o)/2"; - Units.SI.Power P3(start = 1e6) "Total flue gases power at the outlet of zone 3"; - //Zone 4 - Units.SI.Temperature T4o(start = 600) "Clinker temperature at the outlet for the water seal"; - Units.SI.Temperature T4er(start = 600) "Water temperature at the inlet of the water seal"; - Real X4H2O(start = 0.1) "H2O mass fraction in the clinker at the outlet of the water seal"; - Units.SI.SpecificHeatCapacity Cp4liq(start = 1000) "Water specific heat capacity at TEej"; - Units.SI.Power P4m(start = 1e6) "Power lost by the clinker during vaporisation"; - Units.SI.Power P4h(start = 1e6) "Power associated to the clinker humidity"; - Units.SI.MassFlowRate Q4v(start = 10) "Steam mass flow rate generated by the water seal"; - Units.SI.SpecificEnthalpy H4(start = 1e3) "Enthalpy in zone 4"; - Units.SI.Power P4v(start = 1e6) "Power captured by the steam in zone 4"; - constant Units.SI.SpecificEnthalpy Hvapo = 2501600 "Vaporisation energy"; - //Zone 5 - Units.SI.MassFlowRate QO2p(start = 10) "Flue gases O2 mass flow rate at the outlet"; - Units.SI.MassFlowRate Qairp(start = 10) "Excess air mass flow rate for data Qo2p"; - Units.SI.MassFlowRate Qairs(start = 10) "Stoechiometric air mass flow rate"; - Units.SI.MassFlowRate Q5eH2O(start = 10) "Steam mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eCO(start = 10) "CO mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eCO2(start = 10) "CO2 mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eO2(start = 10) "O2 mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eN2(start = 10) "N2 mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eSO2(start = 10) "SO2 mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eHCl(start = 10) "HCl mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eHF(start = 10) "HF mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5ecend(start = 10) "Ashes mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5eam(start = 10) "Total mass flow rate at the inlet of zone 5"; - Units.SI.MassFlowRate Q5od(start = 10) "O mass flow rate available in zone 5"; - Units.SI.MassFlowRate Q5cd(start = 10) "C mass flow rate available in zone 5"; - Units.SI.MassFlowRate Q5hd(start = 10) "H mass flow rate available in zone 5"; - Units.SI.MassFlowRate Q5ost(start = 10) "Stoechiometric O mass flow rate for zone 5"; - Real exc5(start = 0.1) "Air excess for zone 5"; - Units.SI.Power P5(start = 1e6) "Power released by oxydation in zone 5"; - Units.SI.MassFlowRate Q5sCO2(start = 10) "CO2 mass flow rate at the outlet of zone 5"; - Units.SI.MassFlowRate Q5sO2(start = 10) "O2 mass flow rate at the outlet of zone 5"; - Units.SI.MassFlowRate Q5sCO(start = 10) "CO mass flow rate at the outlet of zone 5"; - Units.SI.Power P5s(start = 1e6) "Power released by oxydation in zone 5"; - Real XsfCO(start = 0.1) "Flue gases CO mass fraction at the outlet of zone 5"; - Real XsfN21(start = 0.1) "Flue gases N2 mass fraction at the outlet of zone 5"; - Real XsfHCl(start = 0.1) "Flue gases HCl mass fraction at the outlet of zone 5"; - Real XsfHF(start = 0.1) "Flue gases HF mass fraction at the outlet of zone 5"; - Real XsfCEND(start = 0.1) "Ashes mass fraction at the outlet of zone 5"; - Units.SI.Power P5a(start = 1e6) "Power brought by secondary air"; - Units.SI.Power P5t(start = 1e6) "Power accumulated in the flue gases"; - Real Xcor(start = 0.1) "Corrective factor for the flue gases mass fractions"; - Real X5sH2OC(start = 0.1) "Corrected flue gases H2O mass fraction"; - Real X5sCO2C(start = 0.1) "Corrected flue gases CO2 mass fraction"; - Real X5sO2C(start = 0.1) "Corrected flue gases O2 mass fraction"; - Real X5sSO2C(start = 0.1) "Corrected flue gases SO2 mass fraction"; - Real X5sN2C(start = 0.1) "Corrected flue gases N2 mass fraction"; - Units.SI.Density rhonorm(start = 1000) "Density of the outgoing flue gases mass at 0 deg C and 1 atm"; - Real FVN0(start = 0.1) "Ashes normal volume fraction for the computation of FVN"; - Units.SI.SpecificEnthalpy Hsf(start = 50e4) "Flue gases specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - FluidType fluids[4] "Fluids mixing in volume"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws = Integer(ftype_ws) "Water/steam fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2 annotation( - Placement(transformation(extent = {{-60, 50}, {-40, 70}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Com annotation( - Placement(transformation(extent = {{-100, -20}, {-80, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet port_eau_refroid annotation( - Placement(transformation(extent = {{70, 20}, {90, 40}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1 annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro2 annotation( - Placement(transformation(extent = {{-100, 60}, {-80, 80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro3 annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro4 annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro5 annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1 annotation( - Placement(transformation(extent = {{-10, -100}, {10, -80}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" annotation( - Placement(transformation(extent = {{-10, 80}, {10, 100}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real X2eap=0.1 "Primary air fraction in zone 2"; + parameter Real X3eap=0.1 "Primary air fraction in zone 3"; + parameter Real XCleom=0 "Cl mass fraction in the biomass"; + parameter Real XFeom=0 "F mass fraction in the biomass"; + parameter Real XMACHeom=0 "machefers mass fraction in the biomass"; + parameter Units.SI.Density rhoCENDom=0.5 "Density of the ashes in the biomass"; + parameter Units.SI.Temperature Tfrecirc=600 "Temperature of the recirculated flue gases"; + parameter Real XfCO2recirc=0.3 "CO2 mass fraction in the recirculated flue gases"; + parameter Real XfH2Orecirc=0.1 "H2O mass fraction in the recirculated flue gases"; + parameter Real XfO2recirc=0.2 "O2 mass fraction in the recirculated flue gases"; + parameter Real XfSO2recirc=0 "SO2 mass fraction in the recirculated flue gases"; + parameter Real Xrecirc=0.1 "Recirculated flue gases fraction in Qsf"; + parameter Units.SI.SpecificHeatCapacity CpMACH=500 "Clinker average specific heat capacity"; + parameter Units.SI.SpecificHeatCapacity CpMACHs2=500 "Clinker specific heat capacity at the outlet of zone 2"; + parameter Units.SI.SpecificHeatCapacity CpMACHs3=500 "Clinker specific heat capacity at the outlet of zone 3"; + parameter Units.SI.SpecificHeatCapacity CpMACHs4=500 "Clinker specific heat capacity at the outlet of zone 4"; + parameter Units.SI.Temperature TsjeMACH=293 "Clinker temperature at the outlet of the water seal"; + parameter Units.SI.Temperature Teeje=293 "Water temperature at the outlet of the water seal"; + parameter Real XsjeH2OMACH=0.2 "Clinker humidity at the outlet of the water seal"; + parameter Real rendje=1 "Water seal efficiency"; + parameter Integer jointeau=0 "1: with water seal - 0: without water seal"; + parameter Real XCvol=0 "Volatile carbon fraction"; + parameter Real XCimb=0 "Unburnt carbon fraction"; + parameter Units.SI.Temperature T1sfm=500 "Flue gases temperature at the outlet of zone 1"; + parameter Real Eray2=0.1 "Energy fraction radiated towards zone 2 of the furnace"; + parameter Real Eray5=0.1 "Energy fraction radiated towards zone 5 of the furnac"; + parameter Real perte=0 "Loss percent of LHV"; + parameter Units.SI.SpecificHeatCapacity Cp3CO=500 "CO specific heat capacity in zone 3"; + protected - constant Units.SI.SpecificEnthalpy H0v = 2501551.43 "Vaporisation energy at 0°C"; - constant Units.SI.SpecificEnthalpy HfCO2 = 3.2791664e7 "CO2 formation enthalpy"; - constant Units.SI.SpecificEnthalpy HfCO = 9.201e6 "CO formation enthalpy"; - constant Units.SI.SpecificEnthalpy HfH2Og = 13.433333e6 "H2Og formation enthalpy"; - constant Units.SI.SpecificEnthalpy HfSO2 = 4.6302650e6 "SO2 formation enthalpy"; - constant Units.SI.SpecificEnthalpy HfH2Ol = 15.883300e6 "H2Ol formation enthalpy"; - constant Units.SI.SpecificHeatCapacity Cp3g = 1100 "Average flue gases specific heat capacity at T3g"; - parameter Integer mode = 0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + constant Units.SI.SpecificEnthalpy H0v=2501551.43 "Vaporisation energy at 0°C"; + constant Units.SI.SpecificEnthalpy HfCO2=3.2791664e7 "CO2 formation enthalpy"; + constant Units.SI.SpecificEnthalpy HfCO=9.201e6 "CO formation enthalpy"; + constant Units.SI.SpecificEnthalpy HfH2Og=13.433333e6 "H2Og formation enthalpy"; + constant Units.SI.SpecificEnthalpy HfSO2=4.6302650e6 "SO2 formation enthalpy"; + constant Units.SI.SpecificEnthalpy HfH2Ol=15.883300e6 "H2Ol formation enthalpy"; + constant Units.SI.SpecificHeatCapacity Cp3g=1100 "Average flue gases specific heat capacity at T3g"; + parameter Integer mode=0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet"; + Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet"; + Units.SI.Temperature Tsf(start=1000) "Flue gases temperature at the outlet"; + Real XsfN2(start=0.6) "Flue gases N2 mass fraction at the outlet"; + Real XsfCO2(start=0.1) "Flue gases CO2 mass fraction at the outlet"; + Real XsfH2O(start=0.1) "Flue gases H2O mass fraction at the outlet"; + Real XsfO2(start=0.1) "Flue gases O2 mass fraction at the outlet"; + Real XsfSO2(start=0.1) "Flue gases SO2 mass fraction at the outlet"; + Units.SI.MassFlowRate Qeap(start=10) "Primary air mass flow rate"; + Units.SI.AbsolutePressure Peap(start=1e5) "Primary air pressure"; + Units.SI.Temperature Teap(start=300) "Primary air temperature"; + Real XeapN2(start=0.6) "Primary air N2 mass fraction"; + Real XeapCO2(start=0.1) "Primary air CO2 mass fraction"; + Real XeapH2O(start=0.1) "Primary air H2O mass fraction"; + Real XeapO2(start=0.1) "Primary air O2 mass fraction"; + Real XeapSO2(start=0.1) "Primary air SO2 mass fraction"; + Units.SI.MassFlowRate Qeas(start=10) "Secondary air mass flow rate"; + Units.SI.AbsolutePressure Peas(start=1e5) "Secondary air pressure"; + Units.SI.Temperature Teas(start=300) "Secondary air temperature"; + Real XeasN2(start=0.6) "Secondary air N2 mass fraction"; + Real XeasCO2(start=0.1) "Secondary air CO2 mass fraction"; + Real XeasH2O(start=0.1) "Secondary air H2O mass fraction"; + Real XeasO2(start=0.1) "Secondaryr O2 mass fraction"; + Real XeasSO2(start=0.1) "Secondary SO2 mass fraction"; + Units.SI.MassFlowRate Qeom(start=10) "Biomass mass flow rate"; + Units.SI.Temperature Teom(start=300) "Biomass temperature"; + Real PCIom(start=1e6) "Biomass LHV (J/kg)"; + Real XCeom(start=0.1) "Biomass C mass fraction"; + Real XHeom(start=0.1) "Biomass H mass fraction"; + Real XOeom(start=0.1) "Biomass O mass fraction"; + Real XNeom(start=0.01) "Biomass N mass fraction"; + Real XSeom(start=0.1) "Biomass S mass fraction"; + Real XCENDeom(start=0.1) "Biomass ashes mass fraction"; + Real XH2Oeom(start=0.1) "Biomass humidity"; + Units.SI.SpecificHeatCapacity Cpom(start=1000) "Biomass specific heat capacity"; + Units.SI.MassFlowRate Qerefo(start=10) "Cooling water mass flow rate"; + Units.SI.SpecificEnthalpy Herefo(start=10e3) "Cooling water specific enthalpy"; + Units.SI.MassFlowRate Qfrecirc(start=10) "Recirculated flue gases mass flow rate"; + Real XsfN2recirc(start=0.1) "Recirculated flue gases N2 mass fraction"; + Real PCIMACH(start=10e6) "Clinker LHV"; + Units.SI.MassFlowRate QsMACH(start=10) "Clinker mass flow rate"; + Units.SI.Temperature TsMACH(start=500) "Clinket temperature"; + Real FVN(start=0.1) "Volatile ashes mass fraction"; + Units.SI.Density rhocend(start=500) "Ashes density in the flue gases"; + Units.SI.Power Wsr(start=10e6) "Radiated power"; + Real excair(start=0.1) "Combustion excess air"; + Real X1eap(start=0.1) "Primary air fraction in zone 1"; + Units.SI.MassFlowRate Q1eap(start=10) "Primary mass flow rate in zone 1"; + Units.SI.MassFlowRate Q2eap(start=10) "Primary mass flow rate in zone 2"; + Units.SI.MassFlowRate Q3eap(start=10) "Primary mass flow rate in zone 3"; + Real XCvol2(start=0.1) "C mass fraction burnt in zone 2"; + Real XMACHimb(start=0.1) "C mass raction unburnt in the clinker"; + Real XCvol3(start=0.1) "C mass fraction burnt in zone 3"; + +//Zone1 + Units.SI.SpecificEnthalpy Heap(start=1e3) "Humid air specific enthalpy at the primary air temperature"; + Units.SI.SpecificEnthalpy Heas(start=1e3) "Humid air specific enthalpy at the secondary air temperature"; + Units.SI.SpecificEnthalpy H1a(start=1e3) "Primary air specific enthalpy at T1sfm"; + Units.SI.SpecificEnthalpy Hefrecirc(start=1e3) "Specific enthalpy of the incoming recirculated flue gases"; + Units.SI.MassFlowRate Qeasm(start=10) "Mass flow rate of the secondary air / recirculated flue gases mixture"; + Units.SI.SpecificEnthalpy Heasm(start=1e3) "Specific enthalpy of the secondary air / recirculated flue gases mixture"; + Units.SI.Temperature Teasm(start=500) "Temperature of the secondary air / recirculated flue gases mixture"; + Real XeasmO2(start=0.1) "O2 mass fraction in the secondary air / recirculated flue gases mixture"; + Real XeasmCO2(start=0.1) "CO2 mass fraction in the secondary air / recirculated flue gases mixture"; + Real XeasmH2O(start=0.1) "H2O mass fraction in the secondary air / recirculated flue gases mixture"; + Real XeasmSO2(start=0.1) "SO2 mass fraction in the secondary air / recirculated flue gases mixture"; + Real XeasmN2(start=0.1) "N2 mass fraction in the secondary air / recirculated flue gases mixture"; + Units.SI.SpecificEnthalpy Heauom(start=1e3) "Biomass water specific enthalpy"; + Units.SI.AbsolutePressure Psateom(start=1e5) "Water saturation presure at Teom"; + Units.SI.SpecificEnthalpy Hvteom(start=10e3) "Steam saturation specific enthalpy at Teom"; + Units.SI.SpecificEnthalpy Hlteom(start=10e3) "Water saturation specific enthalpy at Teom"; + Units.SI.SpecificEnthalpy Hvapteom(start=10e3) "Phase transition energy at Teom"; + Units.SI.SpecificEnthalpy Hs1vom(start=1e3) "Water specific enthalpy of the outgoing biomass at T1sfm vapor"; + Units.SI.SpecificEnthalpy Heom(start=1e3) "Biomass specific enthalpy at the inlet"; + Units.SI.Power Wff(start=1e6) "Flue gases formation energy"; + Units.SI.Power Wp(start=1e6) "Biomass pyrolysis power"; + Units.SI.Power Wimbp(start=1e6) "Power saved in the combustion flue gases due to the non-destruction of unburnt C"; + Units.SI.Power Wimbm(start=1e6) "Power lost by the combustion flue gases due to the non-combustion of unburnt C"; + Units.SI.SpecificEnthalpy Hpyr(start=1e3) "Pyrolysis specific enthalpy"; + Units.SI.SpecificEnthalpy H1om(start=1e3) "Specific enthalpy of the dry biomass at the pyrolysis temperature of the biomass"; + Units.SI.MassFlowRate Q1H2O(start=10) "H2O mass flow rate at the oultet of zone 1"; + Units.SI.MassFlowRate Q1O2(start=10) "O2 mass flow rate at the oultet of zone 1"; + Units.SI.MassFlowRate Q1N2(start=10) "N2 mass flow rate at the oultet of zone 1"; + Units.SI.MassFlowRate Q1CO2(start=10) "CO2 mass flow rate at the oultet of zone 1"; + Units.SI.MassFlowRate Q1SO2(start=10) "SO2 mass flow rate at the oultet of zone 1"; + Units.SI.MassFlowRate Q1g(start=10) "Total mass flow rate at the oultet of zone 1"; + Units.SI.MassFlowRate Q2eom(start=10) "Biomass mass flow rate at the inlet of zone 2"; + Real PCI1om(start=1e6) "LHV after drying"; + Real X1MACHom(start=0.1) "Clinker mass fraction in the biomass after drying"; + Real XC1vol2(start=0.1) "Burnt C mass fraction in zone 2 after drying"; + Real XC1vol3(start=0.1) "Burnt C mass fraction in zone 3 after drying"; + Real X1MACHimb(start=0.1) "Unburnt C mass fraction in the clinker after drying"; + Real X1H(start=0.1) "H mass fraction in the biomass after drying"; + Real X1O(start=0.1) "O mass fraction in the biomass after drying"; + Real X1N(start=0.1) "N mass fraction in the biomass after drying"; + Real X1Cl(start=0.1) "Cl mass fraction in the biomass after drying"; + Real X1F(start=0.1) "F mass fraction in the biomass after drying"; + Real X1S(start=0.1) "S mass fraction in the biomass after drying"; + Real X1CEND(start=0.1) "Ashes mass fraction in the biomass after drying"; + Units.SI.MassFlowRate Qcendom(start=10) "Ashes mass flow rate"; + Real Xfcend(start=0.1) "Ashes mass fraction in the flue gases"; + Units.SI.Power P1g(start=1e6) "Power saved in zone 1"; + +//Zone 2 + Units.SI.MassFlowRate Q2eo(start=10) "Mass flow rate of the oxygen carried by the air and the biomass at the inlet of zone 2"; + Units.SI.MassFlowRate Q2HCl(start=10) "Combustion HCl mass fraction in zone 2"; + Units.SI.MassFlowRate Q2HF(start=10) "Combustion HF mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2SO2(start=10) "Combustion SO2 mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2H2O(start=10) "Combustion H2O mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2CO(start=10) "Combustion CO mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2N2(start=10) "Combustion N2 mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2O2(start=10) "Combustion O2 mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2cend(start=10) "Combustion ashes mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2CO2(start=10) "Combustion CO2 mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q2g(start=10) "Elements total mass flow rate after combustion"; + Real Epsivol(start=0.1) "Volatile matter mass fraction produced in zone 2"; + Units.SI.MassFlowRate Q3eom(start=10) "Solid matter at the inlet of zone 3"; + Real X2MACHom(start=0.1) "Clinker mass fraction of the biomass after volatilisation"; + Real XC2vol3(start=0.1) "C mass fraction burnt in zone 3 after volatilisation"; + Real X2MACHimb(start=0.1) "Unburnt C mas fraction in the clinker after volatilisation"; + Real PCICsol(start=1e6) "LHV of the solid outgoing carbon"; + Real PCICvol(start=1e6) "LHV of the volatile carbon transformed into CO"; + Units.SI.SpecificEnthalpy H2(start=1e3) "Enthalpy released in zone 2"; + Units.SI.Power P2g(start=1e6) "Power released by the combustion in zone 2"; + Units.SI.Power P1o(start=1e6) "Power captured by the biomass"; + Units.SI.Power P1v(start=1e6) "Power captured by the steam"; + Units.SI.Power P1a(start=1e6) "Power captured by the air"; + Units.SI.Power P1r(start=1e6) "Power captured by the cooling water"; + Real Eray0(start=0.2) "Fraction of the radiated power from zone 2 unused for the drying"; + Real X2O2(start=0.1) "O2 mass fraction at the oultet of zone 2"; + Real X2SO2(start=0.1) "SO2 mass fraction at the oultet of zone 2"; + Real X2CO2(start=0.1) "CO2 mass fraction at the oultet of zone 2"; + Real X2H2O(start=0.1) "H2O mass fraction at the oultet of zone 2"; + Real X2N2(start=0.1) "N2 mass fraction at the oultet of zone 2"; + Units.SI.SpecificEnthalpy H2g(start=1200000) "Flue gases specific enthalpy at the oultet of zone 2"; + Units.SI.Temperature T2(start=1000) "Flue gases temperature at the oultet of zone 2"; + +//Zone 3 + Units.SI.MassFlowRate Q3od(start=10) "O mass flow rate available for the oxydation of the clinker in CO and/or CO2"; + Units.SI.MassFlowRate Q3cd(start=10) "C mass flow rate available for the oxydation of the clinker in CO and/or CO2"; + Real taux3oc(start=0.1) "Ratio of the mass flow rates O/C available for the oxydation of the clinker"; + Units.SI.MassFlowRate Q3CO2(start=10) "CO2 mass flow rate at the outlet of zone 3"; + Units.SI.MassFlowRate Q3CO(start=10) "CO mass flow rate at the outlet of zone 3"; + Units.SI.MassFlowRate Q3O2(start=10) "O2 mass flow rate at the outlet of zone 3"; + Units.SI.MassFlowRate Q3N2(start=10) "N2 mass flow rate at the outlet of zone 3"; + Units.SI.MassFlowRate Q3H2O(start=10) "H2O mass flow rate at the outlet of zone 3"; + Units.SI.MassFlowRate Q3SO2(start=10) "SO2 mass flow rate at the outlet of zone 3"; + Units.SI.Power P3s(start=1e6) "Power captured by solid matter in zone 3"; + Units.SI.Power P3g(start=1e6) "Power captured by gaseous matter in zone 3"; + Units.SI.SpecificEnthalpy H3s(start=1e3) "Gaseous matter specific enthalpy at T3g"; + Units.SI.SpecificEnthalpy H3g(start=1e3) "Solid matter specific enthalpy at T3o"; + Real XC2vol31(start=0.1) "C mass fraction burnt in zone 3 after volatilisation"; + Real XC2vol4(start=0.1) "C mass fraction burnt at the inlet of zone 4"; + Units.SI.MassFlowRate Q3g(start=10) "Flue gases mass flow rate at the outlet of zone 3"; + Units.SI.MassFlowRate Q4eom(start=10) "Clinker mass flow rate at the inlet of zone 4"; + Real X4MACHom(start=0.1) "Mass flow rate of the biomass clinker after C volatilisation in zone 3"; + Real X4MACHimb(start=0.1) "Unburnt C mass fraction in the clinker after C volatilisation in zone 3"; + Units.SI.SpecificHeatCapacity Cp3a(start=1000) "Average specific heat capacity at the inlet of zone 3"; + Units.SI.Temperature T3o(start=500) "Clinker temperature at the outlet of zone 3"; + Units.SI.Power P3ac(start=1e6) "Air power heated at (T2 + T3o)/2"; + Units.SI.Power P3co(start=1e6) "CO power heated at (T2 + T3o)/2"; + Units.SI.Power P3(start=1e6) "Total flue gases power at the outlet of zone 3"; + +//Zone 4 + Units.SI.Temperature T4o(start=600) "Clinker temperature at the outlet for the water seal"; + Units.SI.Temperature T4er(start=600) "Water temperature at the inlet of the water seal"; + Real X4H2O(start=0.1) "H2O mass fraction in the clinker at the outlet of the water seal"; + Units.SI.SpecificHeatCapacity Cp4liq(start=1000) "Water specific heat capacity at TEej"; + Units.SI.Power P4m(start=1e6) "Power lost by the clinker during vaporisation"; + Units.SI.Power P4h(start=1e6) "Power associated to the clinker humidity"; + Units.SI.MassFlowRate Q4v(start=10) "Steam mass flow rate generated by the water seal"; + Units.SI.SpecificEnthalpy H4(start=1e3) "Enthalpy in zone 4"; + Units.SI.Power P4v(start=1e6) "Power captured by the steam in zone 4"; + constant Units.SI.SpecificEnthalpy Hvapo=2501600 "Vaporisation energy"; + +//Zone 5 + Units.SI.MassFlowRate QO2p(start=10) "Flue gases O2 mass flow rate at the outlet"; + Units.SI.MassFlowRate Qairp(start=10) "Excess air mass flow rate for data Qo2p"; + Units.SI.MassFlowRate Qairs(start=10) "Stoechiometric air mass flow rate"; + Units.SI.MassFlowRate Q5eH2O(start=10) "Steam mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eCO(start=10) "CO mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eCO2(start=10) "CO2 mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eO2(start=10) "O2 mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eN2(start=10) "N2 mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eSO2(start=10) "SO2 mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eHCl(start=10) "HCl mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eHF(start=10) "HF mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5ecend(start=10) "Ashes mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5eam(start=10) "Total mass flow rate at the inlet of zone 5"; + Units.SI.MassFlowRate Q5od(start=10) "O mass flow rate available in zone 5"; + Units.SI.MassFlowRate Q5cd(start=10) "C mass flow rate available in zone 5"; + Units.SI.MassFlowRate Q5hd(start=10) "H mass flow rate available in zone 5"; + Units.SI.MassFlowRate Q5ost(start=10) "Stoechiometric O mass flow rate for zone 5"; + Real exc5(start=0.1) "Air excess for zone 5"; + Units.SI.Power P5(start=1e6) "Power released by oxydation in zone 5"; + Units.SI.MassFlowRate Q5sCO2(start=10) "CO2 mass flow rate at the outlet of zone 5"; + Units.SI.MassFlowRate Q5sO2(start=10) "O2 mass flow rate at the outlet of zone 5"; + Units.SI.MassFlowRate Q5sCO(start=10) "CO mass flow rate at the outlet of zone 5"; + Units.SI.Power P5s(start=1e6) "Power released by oxydation in zone 5"; + Real XsfCO(start=0.1) "Flue gases CO mass fraction at the outlet of zone 5"; + Real XsfN21(start=0.1) "Flue gases N2 mass fraction at the outlet of zone 5"; + Real XsfHCl(start=0.1) "Flue gases HCl mass fraction at the outlet of zone 5"; + Real XsfHF(start=0.1) "Flue gases HF mass fraction at the outlet of zone 5"; + Real XsfCEND(start=0.1) "Ashes mass fraction at the outlet of zone 5"; + Units.SI.Power P5a(start=1e6) "Power brought by secondary air"; + Units.SI.Power P5t(start=1e6) "Power accumulated in the flue gases"; + Real Xcor(start=0.1) "Corrective factor for the flue gases mass fractions"; + Real X5sH2OC(start=0.1) "Corrected flue gases H2O mass fraction"; + Real X5sCO2C(start=0.1) "Corrected flue gases CO2 mass fraction"; + Real X5sO2C(start=0.1) "Corrected flue gases O2 mass fraction"; + Real X5sSO2C(start=0.1) "Corrected flue gases SO2 mass fraction"; + Real X5sN2C(start=0.1) "Corrected flue gases N2 mass fraction"; + Units.SI.Density rhonorm(start=1000) "Density of the outgoing flue gases mass at 0 deg C and 1 atm"; + Real FVN0(start=0.1) "Ashes normal volume fraction for the computation of FVN"; + Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xeap[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Primary air mass fractions"; + Medium_FlueGases.MassFraction Xeas[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Secondary air mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium.ThermodynamicState state_biomass_water "Water in biomass thermodynamic state"; + Medium.ThermodynamicState state_biomass_water_sat_v "Saturated vapor state of water in biomass"; + Medium.ThermodynamicState state_biomass_water_sat_l "Saturated liquid state of water in biomass"; + Medium.ThermodynamicState state_dried_water "Water vapor state after drying"; + Medium.ThermodynamicState state_water_seal_vapor "Water seal vapor state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2(redeclare package Medium = Medium_FlueGases) annotation (Placement( + transformation(extent={{-60,50},{-40,70}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Com + annotation (Placement(transformation(extent={{-100,-20},{-80,0}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet port_eau_refroid(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0))); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1(redeclare package Medium = Medium_FlueGases) annotation (Placement( + transformation(extent={{-10,-100},{10,-80}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca1.ftype; - fluids[3] = Ca2.ftype; - fluids[4] = Cfg.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "GenericCombustion1D: fluids mixing in volume are not compatible with each other"); -/* Mixing specific enthalpy */ + + assert(Medium_FlueGases.nX > 1, "GridFurnace: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GridFurnace: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Mixing specific enthalpy */ port_eau_refroid.h_vol_2 = h; Ca1.h_vol_2 = h; Ca2.h_vol_2 = h; Cfg.h_vol_1 = h; - Cfg.ftype = ftype; -/* No flow reversal */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; + Ca1.diff_res_2 = 0; Ca2.diff_res_2 = 0; Cfg.diff_res_1 = 0; + Ca1.diff_on_2 = diffusion; Ca2.diff_on_2 = diffusion; Cfg.diff_on_1 = diffusion; -/* Fuel inlet (biomass) */ + + /* Fuel inlet (biomass) */ Qeom = Com.Q; Teom = Com.T; PCIom = Com.LHV; @@ -311,67 +327,88 @@ equation XCENDeom = Com.Xashes; XH2Oeom = Com.hum; Cpom = Com.cp; -/* Cooling water inlet */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "GridFurnace: the fluid type for the water/steam inlet must be water/steam"); + + /* Cooling water inlet */ port_eau_refroid.diff_res_2 = 0; port_eau_refroid.diff_on_2 = diffusion; - ftype_ws = port_eau_refroid.ftype; + Qerefo = port_eau_refroid.Q; Herefo = port_eau_refroid.h; -/* Primary air inlet */ + Xws = port_eau_refroid.Xi; + SubCws = port_eau_refroid.SubC; + + /* Primary air inlet */ Qeap = Ca1.Q; Peap = Ca1.P; Peap = Psf; Heap = Ca1.h; - XeapCO2 = Ca1.Xco2; - XeapH2O = Ca1.Xh2o; - XeapO2 = Ca1.Xo2; - XeapSO2 = Ca1.Xso2; - XeapN2 = 1 - Ca1.Xco2 - Ca1.Xh2o - Ca1.Xo2 - Ca1.Xso2; -/* Secondary air inlet */ + + Xeap[1:Medium_FlueGases.nXi] = Ca1.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xeap[Medium_FlueGases.nX] = 1 - sum(Ca1.Xi); + end if; + XeapCO2 = Xeap[iCO2]; + XeapH2O = Xeap[iH2O]; + XeapO2 = Xeap[iO2]; + XeapSO2 = Xeap[iSO2]; + XeapN2 = Xeap[iN2]; + + /* Secondary air inlet */ Qeas = Ca2.Q; Peas = Ca2.P; Peas = Psf; Heas = Ca2.h; - XeasCO2 = Ca2.Xco2; - XeasH2O = Ca2.Xh2o; - XeasO2 = Ca2.Xo2; - XeasSO2 = Ca2.Xso2; - XeasN2 = 1 - Ca2.Xco2 - Ca2.Xh2o - Ca2.Xo2 - Ca2.Xso2; -/* Flue gases outlet */ + + Xeas[1:Medium_FlueGases.nXi] = Ca2.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xeas[Medium_FlueGases.nX] = 1 - sum(Ca2.Xi); + end if; + XeasCO2 = Xeas[iCO2]; + XeasH2O = Xeas[iH2O]; + XeasO2 = Xeas[iO2]; + XeasSO2 = Xeas[iSO2]; + XeasN2 = Xeas[iN2]; + + /* Flue gases outlet */ Qsf = Cfg.Q; Hsf = Cfg.h; Psf = Cfg.P; - XsfCO2 = Cfg.Xco2; - XsfH2O = Cfg.Xh2o; - XsfO2 = Cfg.Xo2; - XsfSO2 = Cfg.Xso2; -/* Primary air mass flow rates */ + + /* Primary air mass flow rates */ X1eap = 1 - X2eap - X3eap; Q1eap = Qeap*X1eap; Q2eap = Qeap*X2eap; Q3eap = Qeap*X3eap; -/* Recirculated flue gases fow rates */ + + /* Recirculated flue gases fow rates */ Qfrecirc = Qsf*Xrecirc; -/* Carbon distribution */ + + /* Carbon distribution */ XCvol2 = XCeom*XCvol; XMACHimb = XCeom*XCimb; XCvol3 = XCeom*(1 - XCvol - XCimb); -//-------------------------------------------------------------------- -// 1st zone : Drying -//------------------ -/* Primary air specific enthalpy at Teap */ + + //-------------------------------------------------------------------- + // 1st zone : Drying + //------------------ + + /* Primary air specific enthalpy at Teap */ Heap = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teap, XeapCO2, XeapH2O, XeapO2, XeapSO2); -/* Secondary air specific enthalpy at Teas */ + + /* Secondary air specific enthalpy at Teas */ Heas = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teas, XeasCO2, XeasH2O, XeasO2, XeasSO2); -/* Primary air specific enthalpy at T1sfm */ + + /* Primary air specific enthalpy at T1sfm */ H1a = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T1sfm, XeapCO2, XeapH2O, XeapO2, XeapSO2); -/* Specific enthalpy of the incoming recirculated flue gases */ + + /* Specific enthalpy of the incoming recirculated flue gases */ XsfN2recirc = 1 - XfCO2recirc - XfH2Orecirc - XfO2recirc - XfSO2recirc; Hefrecirc = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfrecirc, XfCO2recirc, XfH2Orecirc, XfO2recirc, XfSO2recirc); -/* Mass flow rate of the secondary air / flue gases recirculated mixture */ + + /* Mass flow rate of the secondary air / flue gases recirculated mixture */ Qeasm = Qeas + Qfrecirc; -/* Mixture */ + + /* Mixture */ if (Qeasm <= 0) then XeasmO2 = 0; XeasmCO2 = 0; @@ -386,38 +423,62 @@ equation XeasmH2O = (XfH2Orecirc*Qfrecirc + XeasH2O*Qeas)/Qeasm; XeasmSO2 = (XfSO2recirc*Qfrecirc)/Qeasm; XeasmN2 = 1 - XeasmO2 - XeasmSO2 - XeasmH2O - XeasmSO2; - Heasm = (Qeasm*Heas + Qfrecirc*Hefrecirc)/Qeasm; -// Changed from FlueGases_T to FlueGases_h to provide a differentiable function + Heasm = (Qeasm*Heas+Qfrecirc*Hefrecirc)/Qeasm; + // Changed from FlueGases_T to FlueGases_h to provide a differentiable function Heasm = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Teasm, XeasmCO2, XeasmH2O, XeasmO2, XeasmSO2); end if; -/* Specific enthalpy of the water in the biomass */ - pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, Teom, mode); - Heauom = pro1.h; -/* Water phase transition energy at Teom */ + + /* Specific enthalpy of the water in the biomass */ + state_biomass_water = Medium.setState_pTX( + p=Peap, + T=Teom, + region=mode); + Heauom = Medium.specificEnthalpy(state_biomass_water); + + /* Water phase transition energy at Teom */ Psateom = ThermoSysPro.Properties.WaterSteam.BaseIF97.Basic.psat(Teom); - pro2 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 2); - Hvteom = pro2.h; - pro3 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psateom, Teom, 1); - Hlteom = pro3.h; + state_biomass_water_sat_v = Medium.setState_pTX( + p=Psateom, + T=Teom, + region=2); + Hvteom = Medium.specificEnthalpy(state_biomass_water_sat_v); + state_biomass_water_sat_l = Medium.setState_pTX( + p=Psateom, + T=Teom, + region=1); + Hlteom = Medium.specificEnthalpy(state_biomass_water_sat_l); + Hvapteom = Hvteom - Hlteom; -/* Specific enthalpy of the water in the biomass */ - pro4 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Psf, T1sfm, 0); - Hs1vom = pro4.h; -/* Specific enthalpy of the biomass at Teom */ + + /* Specific enthalpy of the water in the biomass */ + state_dried_water = Medium.setState_pTX( + p=Psf, + T=T1sfm, + region=0); + Hs1vom = Medium.specificEnthalpy(state_dried_water); + + /* Specific enthalpy of the biomass at Teom */ Heom = Cpom*(Teom - 273.15); -/* Flue gases formation energy */ + + /* Flue gases formation energy */ Wff = Qeom*(HfCO2*XCeom + HfH2Og*XHeom*9 + HfSO2*XSeom/32.1*64.1 + HfH2Og*XH2Oeom); -/* Pyrolisis power of the biomass */ + + /* Pyrolisis power of the biomass */ Wp = Wff - Qeom*PCIom/(1 - perte) - Qeom*HfH2Ol*XH2Oeom; -/* Power saved by the combustion gases due to the non-destruction of unburnty particles */ + + /* Power saved by the combustion gases due to the non-destruction of unburnty particles */ Wimbp = Wp*XCimb; -/* Power lost by the combustion gases due to the non-combusiton of C */ + + /* Power lost by the combustion gases due to the non-combusiton of C */ Wimbm = Qeom*XCeom*HfCO2*XCimb; -/* Pyrolisis enthalpy */ + + /* Pyrolisis enthalpy */ Hpyr = Wp/(Qeom*(1 - XH2Oeom)); -/* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */ + + /* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */ H1om = Hpyr + Heom; -/* Mass flow rates at the outlet of zone 1 */ + + /* Mass flow rates at the outlet of zone 1 */ Q1H2O = Qeom*XH2Oeom + Q1eap*XeapH2O + Qerefo; Q1O2 = Q1eap*XeapO2; Q1N2 = Q1eap*XeapN2; @@ -425,7 +486,8 @@ equation Q1SO2 = Q1eap*XeapSO2; Q1g = Q1H2O + Q1O2 + Q1N2 + Q1CO2 + Q1SO2; Q2eom = Qeom*(1 - XH2Oeom); -/* Correction after drying */ + + /* Correction after drying */ PCI1om = PCIom/(1 - XH2Oeom); X1MACHom = XMACHeom/(1 - XH2Oeom); XC1vol2 = XCvol2/(1 - XH2Oeom); @@ -438,19 +500,25 @@ equation X1F = XFeom/(1 - XH2Oeom); X1S = XSeom/(1 - XH2Oeom); X1CEND = XCENDeom/(1 - XH2Oeom); -/* Ashes mass flow rate in the biomass */ + + /* Ashes mass flow rate in the biomass */ Qcendom = XCENDeom*Qeom; -/* Ashes mass fraction in the flue gases */ + + /* Ashes mass fraction in the flue gases */ Xfcend = Qcendom/Qsf; -/* Power captured in zone 1 */ + + /* Power captured in zone 1 */ P1g = Qeom*XH2Oeom*Hs1vom + Qeom*XH2Oeom*Hvapteom + Q1eap*H1a + Qerefo*Hs1vom; -//-------------------------------------------------------------------- -// 2nd zone : Combustion -//---------------------- -/* Outgoing flue gases mass flow rate after combustion */ -/* Oxygen brought by air and the biomass */ + + //-------------------------------------------------------------------- + // 2nd zone : Combustion + //---------------------- + + /* Outgoing flue gases mass flow rate after combustion */ + /* Oxygen brought by air and the biomass */ Q2eo = Q2eom*X1O + Q2eap*XeapO2; -/* Outgoing mass flow rates */ + + /* Outgoing mass flow rates */ Q2HCl = 36.5/35.5*Q2eom*X1Cl; Q2HF = 20/19*Q2eom*X1F; Q2SO2 = 64/32*Q2eom*X1S + Q2eap*XeapSO2; @@ -460,109 +528,134 @@ equation Q2O2 = Q2eo - Q2eom*(X1S + 16/2*(X1H - 1/35.5*X1Cl - 1/19*X1F) + 16/12*XC1vol2); Q2cend = Q2eom*X1CEND; Q2CO2 = Q2eap*XeapCO2; -/* Total mass flow rate after combustion */ + + /* Total mass flow rate after combustion */ Q2g = Q2HCl + Q2HF + Q2SO2 + Q2H2O + Q2CO + Q2N2 + Q2O2 + Q2cend + Q2CO2; -/* Correction after combustion */ + + /* Correction after combustion */ Epsivol = XC1vol2 + X1H + X1O + X1S + X1Cl + X1F + X1N + X1CEND; Q3eom = Q2eom*(1 - Epsivol); X2MACHom = X1MACHom/(1 - Epsivol); XC2vol3 = XC1vol3/(1 - Epsivol); X2MACHimb = X1MACHimb/(1 - Epsivol); -/* Power released by the combustion */ + + /* Power released by the combustion */ PCICsol = (XC1vol3 + X1MACHimb)*HfCO2; PCICvol = XC1vol2*(HfCO2 - HfCO); H2 = PCI1om - PCICsol - PCICvol; - P2g = H2*Q2eom + (Q2H2O - (Q2eap*XeapH2O))*H0v + Wimbp; + P2g = H2*Q2eom+(Q2H2O - (Q2eap*XeapH2O))*H0v + Wimbp; + P1o = Qeom*(1 - XH2Oeom)*(H1om - Heom); P1v = Qeom*XH2Oeom*(Hs1vom - Hlteom); P1a = Q1eap*(H1a - Heap); P1r = Qerefo*(Hs1vom - Herefo); + Eray0 = (P1o + P1v + P1a + P1r)/P2g; -/* Temperature at the outlet of zone 2 */ -/* Mass fraction at the outlet */ + + /* Temperature at the outlet of zone 2 */ + /* Mass fraction at the outlet */ X2O2 = Q2O2/Q2g; X2SO2 = Q2SO2/Q2g; X2CO2 = Q2CO/Q2g; X2H2O = Q2H2O/Q2g; X2N2 = 1 - (X2O2 + X2SO2 + X2CO2 + X2H2O); -/* Specific enthalpy and temperature at the outlet of zone 2 */ + + /* Specific enthalpy and temperature at the outlet of zone 2 */ H2g = (Q2eap*Heap + Q2eom*H1om + P2g*(1 - Eray0 - Eray2) - Q3eom*CpMACHs2*(T2 - 273.15))/Q2g; -// Changed from FlueGases_T to FlueGases_h to provide a differentiable function + // Changed from FlueGases_T to FlueGases_h to provide a differentiable function H2g = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, T2, X2CO2, X2H2O, X2O2, X2SO2); -//-------------------------------------------------------------------- -// 3rd zone : Clinker cooling -//--------------------------- -/* Oxydation of the clinkler carbon into CO and/or CO2 */ + + //-------------------------------------------------------------------- + // 3rd zone : Clinker cooling + //--------------------------- + + /* Oxydation of the clinkler carbon into CO and/or CO2 */ Q3od = Q3eap*XeapO2; Q3cd = Q3eom*XC2vol3; taux3oc = Q3od/Q3cd; -/* taux3oc >= 32/12 => all C is transformed into CO2 */ + + /* taux3oc >= 32/12 => all C is transformed into CO2 */ if (taux3oc >= 32/12) then -/* Mass flow rates */ + /* Mass flow rates */ Q3CO2 = 44/12*Q3cd + Q3eap*XeapCO2; Q3CO = 0; Q3O2 = Q3od - 32/12*Q3cd; Q3N2 = Q3eap*XeapN2; Q3H2O = Q3eap*XeapH2O; Q3SO2 = Q3eap*XeapSO2; -/* Power released */ + + /* Power released */ P3s = Q3cd*HfCO; P3g = Q3cd*(HfCO2 - HfCO); -/* Enthalpy released */ + + /* Enthalpy released */ H3s = P3s/Q3eom; H3g = P3g/Q3eom; XC2vol31 = XC2vol3; XC2vol4 = XC2vol3; -/* 16/12 <= taux3oc <= 32/12 => all C is transformed into CO plus a fraction into CO2 */ + + /* 16/12 <= taux3oc <= 32/12 => all C is transformed into CO plus a fraction into CO2 */ elseif ((taux3oc >= 16/12) and (taux3oc < 32/12)) then -/* Mass flow rates */ + /* Mass flow rates */ Q3CO2 = 44/12*(Q3od - 16/12*Q3cd) + Q3eap*XeapCO2; Q3CO = 28/12*Q3cd - 28/16*(Q3od - 16/12*Q3cd); Q3O2 = 0; Q3N2 = Q3eap*XeapN2; Q3H2O = Q3eap*XeapH2O; Q3SO2 = Q3eap*XeapSO2; -/* Power released */ + + /* Power released */ P3s = Q3cd*HfCO; P3g = (12/16*Q3od - Q3cd)*(HfCO2 - HfCO); -/* Enthalpy released */ + + /* Enthalpy released */ H3s = P3s/Q3eom; H3g = P3g/Q3eom; XC2vol31 = XC2vol3; XC2vol4 = XC2vol3; -/* taux3oc < 16/12 => partial oxydation into CO */ + + /* taux3oc < 16/12 => partial oxydation into CO */ else -/* Mass flow rates */ + /* Mass flow rates */ Q3CO2 = 0; Q3CO = 28/16*Q3od; Q3O2 = 0; Q3N2 = Q3eap*XeapN2; Q3H2O = Q3eap*XeapH2O; Q3SO2 = Q3eap*XeapSO2; -/* Power released */ + + /* Power released */ P3s = 12/16*Q3od*HfCO; P3g = 0; -/* Enthalpy released */ + + /* Enthalpy released */ H3s = P3s/Q3eom; H3g = P3g/Q3eom; XC2vol31 = XC2vol3*12/16*taux3oc; XC2vol4 = XC2vol3; - end if; -/* Correction after coke combustion */ +end if; + + /* Correction after coke combustion */ Q3g = Q3CO2 + Q3CO + Q3H2O + Q3O2 + Q3N2 + Q3SO2; Q4eom = Q3eom*(1 - XC2vol31); X4MACHom = X2MACHom/(1 - XC2vol31); X4MACHimb = X2MACHimb/(1 - XC2vol31) + (XC2vol4 - XC2vol31)/(1 - XC2vol31); -/* Clinker temperature at the outlet of zone 3 */ + + /* Clinker temperature at the outlet of zone 3 */ Cp3a = (ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, (T2 + Teap)/2, X2CO2, X2H2O, X2O2, X2SO2))/((T2 + Teap)/2); - T3o - 273.15 = (Q3eap*Heap + Q3eom*CpMACHs2*(T2 - 273.15) - (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*(T2 - 273.15)/2 - (28/12)*Q3eom*XC2vol31*Cp3CO*(T2 - 273.15)/2 + P3s)/(Q3eap*Cp3a/2 + (28/12)*Q3eom*XC2vol31*Cp3CO/2 + Q4eom*CpMACHs3); + T3o - 273.15 = (Q3eap*Heap + Q3eom*CpMACHs2*(T2 - 273.15)- + (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*(T2 - 273.15)/2- + (28/12)*Q3eom*XC2vol31*Cp3CO*(T2 - 273.15)/2 + P3s)/ + (Q3eap*Cp3a/2 + (28/12)*Q3eom*XC2vol31*Cp3CO/2 + Q4eom*CpMACHs3); P3ac = (Q3eap - (16/12)*Q3eom*XC2vol31)*Cp3a*((T2 - 273.15) + (T3o - 273.15))/2; P3co = (28/12)*Q3eom*XC2vol31*Cp3CO*((T2 - 273.15) + (T3o - 273.15))/2; P3 = P3g + P3ac + P3co; -//-------------------------------------------------------------------- -// 4th zone : Water seal -//---------------------- -/* Steam mass flow rate generated by the water seal */ + + //-------------------------------------------------------------------- + // 4th zone : Water seal + //---------------------- + + /* Steam mass flow rate generated by the water seal */ if (jointeau == 1) then T4o = TsjeMACH; TsMACH = TsjeMACH; @@ -572,9 +665,12 @@ equation P4m = Q4eom*CpMACHs4*((T3o - 273.15) - (T4o - 273.15)); P4h = Q4eom*X4H2O*Cp4liq*((T4o - 273.15) - (T4er - 273.15)); Q4v = rendje*(P4m - P4h)/(Cp4liq*(373.15 - (T4er - 273.15)) + Hvapo); - pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2); - H4 = pro5.h; - P4v = Q4v*pro5.h; + state_water_seal_vapor = Medium.setState_pTX( + p=Peap, + T=373.15, + region=2); + H4 = Medium.specificEnthalpy(state_water_seal_vapor); + P4v = Q4v*Medium.specificEnthalpy(state_water_seal_vapor); else T4o = 273.15; TsMACH = T3o; @@ -584,23 +680,31 @@ equation P4m = 0; P4h = 0; Q4v = 0; - pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2); - H4 = pro5.h; + state_water_seal_vapor = Medium.setState_pTX( + p=Peap, + T=373.15, + region=2); + H4 = Medium.specificEnthalpy(state_water_seal_vapor); P4v = 0; end if; -/* Clinker mass flow rate at the outlet */ + + /* Clinker mass flow rate at the outlet */ QsMACH = Q4eom; -/* Clinker LHV at the outlet */ + + /* Clinker LHV at the outlet */ PCIMACH = (Wimbm - Wimbp)/QsMACH; -//-------------------------------------------------------------------- -// 5th zone : Post-combustion -//--------------------------- -/* Excess air of the combustion */ + + //-------------------------------------------------------------------- + // 5th zone : Post-combustion + //--------------------------- + + /* Excess air of the combustion */ QO2p = Qsf*XsfO2; Qairp = QO2p/XeapO2*(1 - XeapH2O); Qairs = (Qeap + Qeas) - Qairp; excair = (Qairp/Qairs)*100; -/* Gases mass flow rates before mixing in zone 5 */ + + /* Gases mass flow rates before mixing in zone 5 */ Q5eH2O = Q1H2O + Q2H2O + Q3H2O + Q4v + Qeasm*XeasmH2O; Q5eCO = Q2CO + Q3CO; Q5eCO2 = Q3CO2 + Q1CO2 + Q2CO2 + Qeasm*XeasmCO2; @@ -611,30 +715,36 @@ equation Q5eHF = Q2HF; Q5ecend = Q2cend; Q5eam = Q5eH2O + Q5eCO + Q5eCO2 + Q5eO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend; -/* Oxydation of the CO remaining in zone 5 */ + + /* Oxydation of the CO remaining in zone 5 */ Q5od = Q5eO2 + 16/18*Q5eH2O + 32/44*Q5eCO2 + 16/28*Q5eCO; Q5cd = 12/44*Q5eCO2 + 12/28*Q5eCO; Q5hd = 2/18*Q5eH2O; Q5ost = 16/2*Q5hd + 32/12*Q5cd; exc5 = Q5od/Q5ost; -/* Total oxydation of the remaining CO */ + + /* Total oxydation of the remaining CO */ if (exc5 > 1) then P5 = 12/28*Q5eCO*(HfCO2 - HfCO); Q5sCO2 = Q5eCO2 + 44/28*Q5eCO; Q5sO2 = Q5eO2 - 16/28*Q5eCO; Q5sCO = 0; -/* Partial oxydation of the remaining CO */ + + /* Partial oxydation of the remaining CO */ else P5 = Q5eO2*12/16*(HfCO2 - HfCO); Q5sCO2 = Q5eCO2 + 44/16*Q5eO2; Q5sO2 = 0; Q5sCO = Q5eCO - 28/16*Q5eO2; end if; -/* Flue gases total mass flow rate at the outlet */ + + /* Flue gases total mass flow rate at the outlet */ Qsf = Q5eH2O + Q5sCO + Q5sCO2 + Q5sO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend; -/* Power available in the flue gases */ + + /* Power available in the flue gases */ P5s = P5*(1 - Eray5); -/* Flue gases mass fractions at the outlet */ + + /* Flue gases mass fractions at the outlet */ XsfH2O = Q5eH2O/Qsf; XsfCO = Q5sCO/Qsf; XsfCO2 = Q5sCO2/Qsf; @@ -645,18 +755,31 @@ equation XsfHF = Q5eHF/Qsf; XsfCEND = Q5ecend/Qsf; XsfN2 = 1 - (XsfCO2 + XsfH2O + XsfO2 + XsfSO2); -/* Power accumulated by the flue gases in zone 5 */ + Xsf[iN2] = XsfN2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca1.SubC; + SubCfg = Cfg.SubC; + + /* Power accumulated by the flue gases in zone 5 */ P5a = Qeasm*Heasm; P5t = P1g + H2g*Q2g + P3 + P4v + P5s + P5a; -/* Power radiated */ + + /* Power radiated */ Wsr = P5s*Eray5/(1 - Eray5) + P2g*Eray2; -/* Flue gases temperature at the outlet */ -// Changed from FlueGases_T to FlueGases_h to provide a differentiable function + + /* Flue gases temperature at the outlet */ + // Changed from FlueGases_T to FlueGases_h to provide a differentiable function P5t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); P5t/Qsf = Hsf; -/* Ashes volume mass */ + + /* Ashes volume mass */ rhocend = rhoCENDom; -/* Normal voulme fraction of the volatile ashes */ + + /* Normal voulme fraction of the volatile ashes */ Xcor = 1/(1 - XsfH2O); X5sH2OC = 0; X5sCO2C = XsfCO2*Xcor; @@ -666,9 +789,47 @@ equation rhonorm = ThermoSysPro.Properties.FlueGases.FlueGases_rho(1.01325e5, 273.15, X5sCO2C, X5sH2OC, X5sO2C, X5sSO2C); FVN0 = (Qcendom/rhocend)/(Qsf/rhonorm); 0 = if ((FVN0 < 0) or (FVN0 > 0.1)) then (FVN - 0.001) else (FVN - FVN0); - annotation( - Diagram(graphics = {Polygon(points = {{-80, 20}, {-80, -80}, {100, -80}, {100, 20}, {62, 20}, {20, 40}, {20, 80}, {-40, 80}, {-40, 40}, {-80, 20}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-80, 0}, {60, -40}, {80, -80}, {-80, -80}, {-80, 0}}, lineColor = {0, 0, 255}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid)}), - Icon(graphics = {Polygon(points = {{-80, 20}, {-80, -80}, {100, -80}, {100, 20}, {62, 20}, {20, 40}, {20, 80}, {-40, 80}, {-40, 40}, {-80, 20}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-80, 0}, {60, -40}, {80, -80}, {-80, -80}, {-80, 0}}, lineColor = {0, 0, 255}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid), Text(extent = {{66, 60}, {92, 32}}, lineColor = {28, 108, 200}, textString = "Water inlet"), Text(extent = {{14, 106}, {62, 70}}, lineColor = {238, 46, 47}, textString = "Flue gases outlet"), Text(extent = {{-98, -14}, {-72, -42}}, lineColor = {28, 108, 200}, textString = "Fuel inlet"), Text(extent = {{12, -70}, {54, -114}}, lineColor = {28, 108, 200}, textString = "Primary air inlet"), Text(extent = {{-100, 100}, {-54, 52}}, lineColor = {28, 108, 200}, textString = "Secondary air inlet")}), + + annotation (Diagram(graphics={Polygon( + points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80}, + {-40,80},{-40,40},{-80,20}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), Polygon( + points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}}, + lineColor={0,0,255}, + fillColor={175,175,175}, + fillPattern=FillPattern.Solid)}), + Icon(graphics={Polygon( + points={{-80,20},{-80,-80},{100,-80},{100,20},{62,20},{20,40},{20,80}, + {-40,80},{-40,40},{-80,20}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), Polygon( + points={{-80,0},{60,-40},{80,-80},{-80,-80},{-80,0}}, + lineColor={0,0,255}, + fillColor={175,175,175}, + fillPattern=FillPattern.Solid), + Text( + extent={{66,60},{92,32}}, + lineColor={28,108,200}, + textString="Water inlet"), + Text( + extent={{14,106},{62,70}}, + lineColor={238,46,47}, + textString="Flue gases outlet"), + Text( + extent={{-98,-14},{-72,-42}}, + lineColor={28,108,200}, + textString="Fuel inlet"), + Text( + extent={{12,-70},{54,-114}}, + lineColor={28,108,200}, + textString="Primary air inlet"), + Text( + extent={{-100,100},{-54,52}}, + lineColor={28,108,200}, + textString="Secondary air inlet")}), DymolaStoredErrors, Documentation(revisions = " Author @@ -679,4 +840,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end GridFurnace; \ No newline at end of file +end GridFurnace; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo index 78b1c4f1..9d3e24e5 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo @@ -1,130 +1,141 @@ -within ThermoSysPro.Fluid.Combustion.CombustionChambers; - +within ThermoSysPro.Fluid.Combustion.CombustionChambers; model PostCombustionGas "Post-combustion" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real XClfuel = 0 "Chloride mass fraction in fuel"; - parameter Real XFfuel = 0 "Fluoride mass fraction in fuel"; - parameter Real Xrad = 0 "Fraction of radiated power"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.MassFlowRate Qef(start = 10) "Flue gases mass flow rate at the inlet"; - Units.SI.Temperature Tef(start = 1700) "Flue gases temperature at the inlet"; - Real XefCO2(start = 0.5) "CO2 mass fraction at the flue gases inlet"; - Real XefH2O(start = 0) "H2O mass fraction at the flue gases inlet"; - Real XefO2(start = 0.5) "O2 mass fraction at the flue gases inlet"; - Real XefSO2(start = 0) "SO2 mass fraction at the flue gases inlet"; - Units.SI.MassFlowRate Qsf(start = 10) "Flue gases mass flow rate at the outlet"; - Units.SI.Temperature Tsf(start = 1700) "Flue gases temperature at the outlet"; - Units.SI.AbsolutePressure Psf(start = 1e5) "Flue gases pressure at the outlet"; - Real XsfCO2(start = 0.2) "CO2 mass fraction at the flue gases outlet"; - Real XsfCO(start = 0.1) "CO mass fraction at the flue gases outlet"; - Real XsfH2O(start = 0.2) "H2O mass fraction at the flue gases outlet"; - Real XsfH2(start = 0.1) "H2 mass fraction at the flue gases outlet"; - Real XsfO2(start = 0.1) "O2 mass fraction at the flue gases outlet"; - Real XsfN2(start = 0.2) "N2 mass fraction at the flue gases outlet"; - Real XsfSO2(start = 0.1) "SO2 mass fraction at the flue gases outlet"; - Units.SI.MassFlowRate Qea(start = 0.2) "Air mass flow rate at the inlet"; - Units.SI.Temperature Tea(start = 300) "Air temperature at the inlet"; - Units.SI.AbsolutePressure Pea(start = 1e5) "Air pressure at the inlet"; - Real XeaCO2(start = 0.2) "CO2 mass fraction at the air inlet"; - Real XeaH2O(start = 0.2) "H20 mass fraction at the air inlet"; - Real XeaO2(start = 0.2) "O2 mass fraction at the air inlet"; - Real XeaSO2(start = 0.2) "SO2 mass fraction at the air inlet"; - Units.SI.MassFlowRate Qec(start = 0.1) "Fuel mass flow rate at the inlet"; - Units.SI.Temperature Tec(start = 1700) "Fuel temperature at the inlet"; - Units.SI.SpecificHeatCapacity Cpfuel(start = 1000) "Fuel specific heat capacity"; - Units.SI.SpecificEnergy LHVfuel(start = 1e6) "Fuel LHV"; - Real XH2Ofuel(start = 0) "H2O mass fraction in fuel"; - Real XCfuel(start = 0.25) "C mass fraction in fuel"; - Real XHfuel(start = 0.75) "H mass fraction in fuel"; - Real XOfuel(start = 0) "O mass fraction in fuel"; - Real XNfuel(start = 0) "N mass fraction in fuel"; - Real XSfuel(start = 0) "S mass fraction in fuel"; - Units.SI.Power Wrad(start = 1e6) "Power radiated"; - Units.SI.SpecificEnthalpy Hea(start = 1e3) "Humid air specific enthalpy at the temperature of the input air"; - Units.SI.SpecificEnthalpy Hef(start = 1e3) "Flue gases specific enthalpy at the inlet"; - Units.SI.MassFlowRate Qmel(start = 10) "Mass flow rate of the air/flue gas mixture"; - Real XmelO2(start = 0.1) "O2 pass fraction in the air/flue gas mixture"; - Real XmelCO2(start = 0.1) "CO2 pass fraction in the air/flue gas mixture"; - Real XmelH2O(start = 0.1) "H2O pass fraction in the air/flue gas mixture"; - Real XmelSO2(start = 0.1) "SO2 pass fraction in the air/flue gas mixture"; - Real XmelN2(start = 0.1) "N2 pass fraction in the air/flue gas mixture"; - Units.SI.SpecificEnthalpy Hmel(start = 1e3) "Specific enthalpy of the air/flue gas mixture"; - Units.SI.Temperature Tmel(start = 500) "Temperature of the air/flue gas mixture"; - Units.SI.SpecificEnthalpy Hwfuel(start = 1e3) "Specific enthalpy of the water in fuel"; - Units.SI.SpecificEnthalpy Hfuel(start = 1e3) "Fuel specific enthalpy"; - Units.SI.MassFlowRate Q1H2O(start = 10) "H2O mass flow rate at the outlet of zone 1"; - Units.SI.MassFlowRate Q1O2(start = 10) "O2 mass flow rate at the outlet of zone 1"; - Units.SI.MassFlowRate Q1N2(start = 10) "N2 mass flow rate at the outlet of zone 1"; - Units.SI.MassFlowRate Q1CO2(start = 10) "CO2 mass flow rate at the outlet of zone 1"; - Units.SI.MassFlowRate Q1SO2(start = 10) "SO2 mass flow rate at the outlet of zone 1"; - Real X1Cfuel(start = 0.1) "C mass fraction in fuel after drying"; - Real X1Hfuel(start = 0.1) "H mass fraction in fuel after drying"; - Real X1Ofuel(start = 0.1) "O mass fraction in fuel after drying"; - Real X1Nfuel(start = 0.1) "N mass fraction in fuel after drying"; - Real X1Clfuel(start = 0.1) "Cl mass fraction in fuel after drying"; - Real X1Ffuel(start = 0.1) "F mass fraction in fuel after drying"; - Real X1Sfuel(start = 0.1) "S mass fraction in fuel after drying"; - Units.SI.MassFlowRate Q1ec(start = 10) "Fuel mass flow rate after drying"; - Units.SI.SpecificEnergy LHVfuel1(start = 1e6) "Fuel LHV after drying"; - Units.SI.MassFlowRate Q2eO(start = 10) "O2 mass flow rate at the inlet of zone 2"; - Units.SI.MassFlowRate Q21HCl(start = 10) "HCl mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q21HF(start = 10) "HF mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q21SO2(start = 10) "SO2 mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q21N2(start = 10) "N2 mass flow rate at the outlet of zone 2"; - Units.SI.MassFlowRate Q22CO(start = 10) "CO mass flow rate produced in stage 2"; - Units.SI.MassFlowRate Q22O2(start = 10) "O2 mass flow rate left after stage 2"; - Units.SI.MassFlowRate Q22H2(start = 10) "H2 mass flow rate produced at stage 2"; - Real etaO2(start = 0.1) "O2 fraction at the end of the combustion"; - Units.SI.MassFlowRate Q23CO2(start = 10) "CO2 mass flow rate at the end of stage 3"; - Units.SI.MassFlowRate Q23H2O(start = 10) "H2O mass flow rate at the end of stage 3"; - Units.SI.MassFlowRate Q23CO(start = 10) "CO mass flow rate at the end of stage 3"; - Units.SI.MassFlowRate Q23H2(start = 10) "H2 mass flow rate at the end of stage 3"; - Units.SI.MassFlowRate Q23O2(start = 10) "O2 mass flow rate at the end of stage 3"; - Units.SI.MassFlowRate Q24eg(start = 10) "Mass flow rate of the volatile elements at the end of zone 2"; - Units.SI.MassFlowRate Q24sg(start = 10) "Mass flow rate of the volatile elements at the outlet of zone 2"; - Real X24O2(start = 0.1) "O2 mass fraction in flue gases of zone 4"; - Real X24SO2(start = 0.1) "SO2 mass fraction in flue gases of zone 4"; - Real X24H2O(start = 0.1) "H2O mass fraction in flue gases of zone 4"; - Real X24CO(start = 0.1) "CO mass fraction in flue gases of zone 4"; - Real X24CO2(start = 0.1) "CO2 mass fraction in flue gases of zone 4"; - Real X24C(start = 0.1) "C mass fraction in flue gases of zone 4"; - Real X24N2(start = 0.1) "N2 mass fraction in flue gases of zone 4"; - Real Keq(start = 0.1) "Equilibrium constant for stage 4"; - Real Mm4e(start = 0.1) "Molar mass of the gases entering stage 4"; - Real Mm4s(start = 0.1) "Molar mass of the gases leaving stage 4"; - Real X24eCOvol(start = 0.1) "CO volume fraction before stage 4"; - Real X24eCO2vol(start = 0.1) "CO2 volume fraction before stage 4"; - Real X24eH2vol(start = 0.1) "H2 volume fraction before stage 4"; - Real X24eH2Ovol(start = 0.1) "H2 volume fraction before stage 4"; - Real X24eN2vol(start = 0.1) "N2 volume fraction before stage 4"; - Real X24eHClvol(start = 0.1) "HCl volume fraction before stage 4"; - Real X24eHFvol(start = 0.1) "HF volume fraction before stage 4"; - Real X24eSO2vol(start = 0.1) "SO2 volume fraction before stage 4"; - Real X24sCOvol(start = 0.1) "CO volume fraction after stage 4"; - Real X24sCO2vol(start = 0.1) "CO2 volume fraction after stage 4"; - Real X24sH2vol(start = 0.1) "H2 volume fraction after stage 4"; - Real X24sH2Ovol(start = 0.1) "H2O volume fraction after stage 4"; - Real AVE(start = 0.1) "Progress of stage 4"; - Units.SI.MassFlowRate Q24H2O(start = 10) "H2O mass flow rate at the ned of stage 4"; - Units.SI.MassFlowRate Q24H2(start = 10) "H2 mass flow rate at the ned of stage 4"; - Units.SI.MassFlowRate Q24CO(start = 10) "CO mass flow rate at the ned of stage 4"; - Units.SI.MassFlowRate Q24CO2(start = 10) "CO2 mass flow rate at the ned of stage 4"; - Real PciCvol(start = 1e6) "Power released by the combustion"; - Units.SI.Power P2g(start = 1e6) "Power released by the combustion"; - Real XsfC(start = 0.1) "C mass fraction in the flue gases"; - Units.SI.Power P2t(start = 1e6) "Total flue gases power at the outlet"; - Units.SI.SpecificEnthalpy Hsf(start = 50e4) "Flue gases specific enthalpy at the outlet"; - Real Keq0(start = 0.1) "Intermediate variable for the compuation of Keq"; - Real delta(start = 0.1) "Intermediate variable to compute the progress of stage 4"; - FluidType fluids[4] "Fluids mixing in volume"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid mixture specific enthalpy"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam properties" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real XClfuel=0 "Chloride mass fraction in fuel"; + parameter Real XFfuel=0 "Fluoride mass fraction in fuel"; + parameter Real Xrad=0 "Fraction of radiated power"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Real HfCO2=3.275e+07 "CO2 formation specific enthalpy"; + constant Real HfCO=9.201e+06 "CO formation specific enthalpy"; + constant Real HfH2O=2.418e+08 "H2O steam formation specific enthalpy"; + constant Units.SI.SpecificEnthalpy H0v=2501551.43 "Vaporisation specific enthalpy at 0°C"; + parameter Integer mode=0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.MassFlowRate Qef(start=10) "Flue gases mass flow rate at the inlet"; + Units.SI.Temperature Tef(start=1700) "Flue gases temperature at the inlet"; + Real XefCO2(start=0.5) "CO2 mass fraction at the flue gases inlet"; + Real XefH2O(start=0) "H2O mass fraction at the flue gases inlet"; + Real XefO2(start=0.5) "O2 mass fraction at the flue gases inlet"; + Real XefSO2(start=0) "SO2 mass fraction at the flue gases inlet"; + Units.SI.MassFlowRate Qsf(start=10) "Flue gases mass flow rate at the outlet"; + Units.SI.Temperature Tsf(start=1700) "Flue gases temperature at the outlet"; + Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet"; + Real XsfCO2(start=0.2) "CO2 mass fraction at the flue gases outlet"; + Real XsfCO(start=0.1) "CO mass fraction at the flue gases outlet"; + Real XsfH2O(start=0.2) "H2O mass fraction at the flue gases outlet"; + Real XsfH2(start=0.1) "H2 mass fraction at the flue gases outlet"; + Real XsfO2(start=0.1) "O2 mass fraction at the flue gases outlet"; + Real XsfN2(start=0.2) "N2 mass fraction at the flue gases outlet"; + Real XsfSO2(start=0.1) "SO2 mass fraction at the flue gases outlet"; + Units.SI.MassFlowRate Qea(start=0.2) "Air mass flow rate at the inlet"; + Units.SI.Temperature Tea(start=300) "Air temperature at the inlet"; + Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet"; + Real XeaCO2(start=0.2) "CO2 mass fraction at the air inlet"; + Real XeaH2O(start=0.2) "H20 mass fraction at the air inlet"; + Real XeaO2(start=0.2) "O2 mass fraction at the air inlet"; + Real XeaSO2(start=0.2) "SO2 mass fraction at the air inlet"; + Units.SI.MassFlowRate Qec(start=0.1) "Fuel mass flow rate at the inlet"; + Units.SI.Temperature Tec(start=1700) "Fuel temperature at the inlet"; + Units.SI.SpecificHeatCapacity Cpfuel(start=1000) "Fuel specific heat capacity"; + Units.SI.SpecificEnergy LHVfuel(start=1e6) "Fuel LHV"; + Real XH2Ofuel(start=0) "H2O mass fraction in fuel"; + Real XCfuel(start=0.25) "C mass fraction in fuel"; + Real XHfuel(start=0.75) "H mass fraction in fuel"; + Real XOfuel(start=0) "O mass fraction in fuel"; + Real XNfuel(start=0) "N mass fraction in fuel"; + Real XSfuel(start=0) "S mass fraction in fuel"; + Units.SI.Power Wrad(start=1e6) "Power radiated"; + Units.SI.SpecificEnthalpy Hea(start=1e3) "Humid air specific enthalpy at the temperature of the input air"; + Units.SI.SpecificEnthalpy Hef(start=1e3) "Flue gases specific enthalpy at the inlet"; + Units.SI.MassFlowRate Qmel(start=10) "Mass flow rate of the air/flue gas mixture"; + Real XmelO2(start=0.1) "O2 pass fraction in the air/flue gas mixture"; + Real XmelCO2(start=0.1) "CO2 pass fraction in the air/flue gas mixture"; + Real XmelH2O(start=0.1) "H2O pass fraction in the air/flue gas mixture"; + Real XmelSO2(start=0.1) "SO2 pass fraction in the air/flue gas mixture"; + Real XmelN2(start=0.1) "N2 pass fraction in the air/flue gas mixture"; + Units.SI.SpecificEnthalpy Hmel(start=1e3) "Specific enthalpy of the air/flue gas mixture"; + Units.SI.Temperature Tmel(start=500) "Temperature of the air/flue gas mixture"; + Units.SI.SpecificEnthalpy Hwfuel(start=1e3) "Specific enthalpy of the water in fuel"; + Units.SI.SpecificEnthalpy Hfuel(start=1e3) "Fuel specific enthalpy"; + Units.SI.MassFlowRate Q1H2O(start=10) "H2O mass flow rate at the outlet of zone 1"; + Units.SI.MassFlowRate Q1O2(start=10) "O2 mass flow rate at the outlet of zone 1"; + Units.SI.MassFlowRate Q1N2(start=10) "N2 mass flow rate at the outlet of zone 1"; + Units.SI.MassFlowRate Q1CO2(start=10) "CO2 mass flow rate at the outlet of zone 1"; + Units.SI.MassFlowRate Q1SO2(start=10) "SO2 mass flow rate at the outlet of zone 1"; + Real X1Cfuel(start=0.1) "C mass fraction in fuel after drying"; + Real X1Hfuel(start=0.1) "H mass fraction in fuel after drying"; + Real X1Ofuel(start=0.1) "O mass fraction in fuel after drying"; + Real X1Nfuel(start=0.1) "N mass fraction in fuel after drying"; + Real X1Clfuel(start=0.1) "Cl mass fraction in fuel after drying"; + Real X1Ffuel(start=0.1) "F mass fraction in fuel after drying"; + Real X1Sfuel(start=0.1) "S mass fraction in fuel after drying"; + Units.SI.MassFlowRate Q1ec(start=10) "Fuel mass flow rate after drying"; + Units.SI.SpecificEnergy LHVfuel1(start=1e6) "Fuel LHV after drying"; + Units.SI.MassFlowRate Q2eO(start=10) "O2 mass flow rate at the inlet of zone 2"; + Units.SI.MassFlowRate Q21HCl(start=10) "HCl mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q21HF(start=10) "HF mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q21SO2(start=10) "SO2 mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q21N2(start=10) "N2 mass flow rate at the outlet of zone 2"; + Units.SI.MassFlowRate Q22CO(start=10) "CO mass flow rate produced in stage 2"; + Units.SI.MassFlowRate Q22O2(start=10) "O2 mass flow rate left after stage 2"; + Units.SI.MassFlowRate Q22H2(start=10) "H2 mass flow rate produced at stage 2"; + Real etaO2(start=0.1) "O2 fraction at the end of the combustion"; + Units.SI.MassFlowRate Q23CO2(start=10) "CO2 mass flow rate at the end of stage 3"; + Units.SI.MassFlowRate Q23H2O(start=10) "H2O mass flow rate at the end of stage 3"; + Units.SI.MassFlowRate Q23CO(start=10) "CO mass flow rate at the end of stage 3"; + Units.SI.MassFlowRate Q23H2(start=10) "H2 mass flow rate at the end of stage 3"; + Units.SI.MassFlowRate Q23O2(start=10) "O2 mass flow rate at the end of stage 3"; + Units.SI.MassFlowRate Q24eg(start=10) "Mass flow rate of the volatile elements at the end of zone 2"; + Units.SI.MassFlowRate Q24sg(start=10) "Mass flow rate of the volatile elements at the outlet of zone 2"; + Real X24O2(start=0.1) "O2 mass fraction in flue gases of zone 4"; + Real X24SO2(start=0.1) "SO2 mass fraction in flue gases of zone 4"; + Real X24H2O(start=0.1) "H2O mass fraction in flue gases of zone 4"; + Real X24CO(start=0.1) "CO mass fraction in flue gases of zone 4"; + Real X24CO2(start=0.1) "CO2 mass fraction in flue gases of zone 4"; + Real X24C(start=0.1) "C mass fraction in flue gases of zone 4"; + Real X24N2(start=0.1) "N2 mass fraction in flue gases of zone 4"; + Real Keq(start=0.1) "Equilibrium constant for stage 4"; + Real Mm4e(start=0.1) "Molar mass of the gases entering stage 4"; + Real Mm4s(start=0.1) "Molar mass of the gases leaving stage 4"; + Real X24eCOvol(start=0.1) "CO volume fraction before stage 4"; + Real X24eCO2vol(start=0.1) "CO2 volume fraction before stage 4"; + Real X24eH2vol(start=0.1) "H2 volume fraction before stage 4"; + Real X24eH2Ovol(start=0.1) "H2 volume fraction before stage 4"; + Real X24eN2vol(start=0.1) "N2 volume fraction before stage 4"; + Real X24eHClvol(start=0.1) "HCl volume fraction before stage 4"; + Real X24eHFvol(start=0.1) "HF volume fraction before stage 4"; + Real X24eSO2vol(start=0.1) "SO2 volume fraction before stage 4"; + Real X24sCOvol(start=0.1) "CO volume fraction after stage 4"; + Real X24sCO2vol(start=0.1) "CO2 volume fraction after stage 4"; + Real X24sH2vol(start=0.1) "H2 volume fraction after stage 4"; + Real X24sH2Ovol(start=0.1) "H2O volume fraction after stage 4"; + Real AVE(start=0.1) "Progress of stage 4"; + Units.SI.MassFlowRate Q24H2O(start=10) "H2O mass flow rate at the ned of stage 4"; + Units.SI.MassFlowRate Q24H2(start=10) "H2 mass flow rate at the ned of stage 4"; + Units.SI.MassFlowRate Q24CO(start=10) "CO mass flow rate at the ned of stage 4"; + Units.SI.MassFlowRate Q24CO2(start=10) "CO2 mass flow rate at the ned of stage 4"; + Real PciCvol(start=1e6) "Power released by the combustion"; + Units.SI.Power P2g(start=1e6) "Power released by the combustion"; + Real XsfC(start=0.1) "C mass fraction in the flue gases"; + Units.SI.Power P2t(start=1e6) "Total flue gases power at the outlet"; + Units.SI.SpecificEnthalpy Hsf(start=50e4) "Flue gases specific enthalpy at the outlet"; + Real Keq0(start=0.1) "Intermediate variable for the compuation of Keq"; + Real delta(start=0.1) "Intermediate variable to compute the progress of stage 4"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid mixture specific enthalpy"; Units.SI.Power Ja "Thermal power diffusion from inlet Ca"; Units.SI.Power Jfg1 "Thermal power diffusion from inlet Cfg1"; Units.SI.Power Jfg2 "Thermal power diffusion from outlet Cfg2"; @@ -135,31 +146,28 @@ model PostCombustionGas "Post-combustion" Real ra "Value of r(Q/gamma) for inlet Ca"; Real rfg1 "Value of r(Q/gamma) for inlet Cfg1"; Real rfg2 "Value of r(Q/gamma) for outlet Cfg2"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca "Air inlet" annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 "Flue gases outlet" annotation( - Placement(transformation(extent = {{80, 0}, {100, 20}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 "Flue gases inlet" annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation( - Placement(transformation(extent = {{-40, -100}, {-20, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro1 annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); -protected - constant Real HfCO2 = 3.275e+07 "CO2 formation specific enthalpy"; - constant Real HfCO = 9.201e+06 "CO formation specific enthalpy"; - constant Real HfH2O = 2.418e+08 "H2O steam formation specific enthalpy"; - constant Units.SI.SpecificEnthalpy H0v = 2501551.43 "Vaporisation specific enthalpy at 0°C"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xef[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ThermodynamicState state_fuel_water "Water in fuel thermodynamic state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) "Flue gases inlet" + annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" + annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}, + rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ca.ftype; - fluids[3] = Cfg1.ftype; - fluids[4] = Cfg2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "PostCombustionGas: fluids mixing in volume are not compatible with each other"); -/* Fuel inlet */ + + assert(Medium_FlueGases.nX > 1, "PostCombustionGas: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "PostCombustionGas: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Fuel inlet */ Qec = Cfuel.Q; Tec = Cfuel.T; LHVfuel = Cfuel.LHV; @@ -170,67 +178,87 @@ equation XNfuel = Cfuel.Xn; XSfuel = Cfuel.Xs; Cpfuel = Cfuel.cp; -/* Air inlet */ + + /* Air inlet */ Qea = Ca.Q; Pea = Ca.P; Pea = 1.01e+5; Hea = Ca.h; - XeaCO2 = Ca.Xco2; - XeaH2O = Ca.Xh2o; - XeaO2 = Ca.Xo2; - XeaSO2 = Ca.Xso2; -/* Flue gases inlet */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* Flue gases inlet */ Qef = Cfg1.Q; Hef = Cfg1.h; Cfg1.P = Cfg2.P; - XefCO2 = Cfg1.Xco2; - XefH2O = Cfg1.Xh2o; - XefO2 = Cfg1.Xo2; - XefSO2 = Cfg1.Xso2; -/* Flue gases outlet */ + + Xef[1:Medium_FlueGases.nXi] = Cfg1.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xef[Medium_FlueGases.nX] = 1 - sum(Cfg1.Xi); + end if; + XefCO2 = Xef[iCO2]; + XefH2O = Xef[iH2O]; + XefO2 = Xef[iO2]; + XefSO2 = Xef[iSO2]; + + /* Flue gases outlet */ Qsf = Cfg2.Q; Hsf = Cfg2.h; Psf = Cfg2.P; - XsfCO2 = Cfg2.Xco2; - XsfH2O = Cfg2.Xh2o; - XsfO2 = Cfg2.Xo2; - XsfSO2 = Cfg2.Xso2; -// 1st zone : Mixing air - flue gases - water in fuel -// -------------------------------------------------- -/* Humid air specific enthalpy at the temperature of the input air */ + + // 1st zone : Mixing air - flue gases - water in fuel + // -------------------------------------------------- + + /* Humid air specific enthalpy at the temperature of the input air */ Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); -/* Flue gases specific enthalpy at the inlet */ + + /* Flue gases specific enthalpy at the inlet */ Hef = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tef, XefCO2, XefH2O, XefO2, XefSO2); -// Air - flue gases mixing -// - - - - - - - - - - - - -/* Mass balance equation */ + + // Air - flue gases mixing + // - - - - - - - - - - - - + + /* Mass balance equation */ 0 = Qea + Qef - Qmel; -/* Energy balance equation */ + + /* Energy balance equation */ 0 = Qea*Hea + Hef*Qef - Qmel*Hmel + J; + Ca.h_vol_2 = h; Cfg1.h_vol_2 = h; Cfg2.h_vol_1 = h; - Cfg2.ftype = ftype; -/* Mixture composition */ + + /* Mixture composition */ XmelO2 = (XefO2*Qef + XeaO2*Qea)/Qmel; XmelCO2 = (XefCO2*Qef)/Qmel; XmelH2O = (XefH2O*Qef + XeaH2O*Qea)/Qmel; XmelSO2 = (XefSO2*Qef)/Qmel; XmelN2 = 1 - XmelO2 - XmelCO2 - XmelH2O - XmelSO2; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then Cfg2.h = ThermoSysPro.Functions.SmoothCond(Cfg2.Q/gamma_fg2, Cfg2.h_vol_1, Cfg2.h_vol_2, 1); else Cfg2.h = if (Cfg2.Q > 0) then Cfg2.h_vol_1 else Cfg2.h_vol_2; end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then ra = if Ca.diff_on_1 then exp(-0.033*(Ca.Q*Ca.diff_res_1)^2) else 0; rfg1 = if Cfg1.diff_on_1 then exp(-0.033*(Cfg1.Q*Cfg1.diff_res_1)^2) else 0; rfg2 = if Cfg2.diff_on_2 then exp(-0.033*(Cfg2.Q*Cfg2.diff_res_2)^2) else 0; + gamma_a = if Ca.diff_on_1 then 1/Ca.diff_res_1 else gamma0; gamma_fg1 = if Cfg1.diff_on_1 then 1/Cfg1.diff_res_1 else gamma0; gamma_fg2 = if Cfg2.diff_on_2 then 1/Cfg2.diff_res_2 else gamma0; + Ja = if Ca.diff_on_1 then ra*gamma_a*(Ca.h_vol_1 - Ca.h_vol_2) else 0; Jfg1 = if Cfg1.diff_on_1 then rfg1*gamma_fg1*(Cfg1.h_vol_1 - Cfg1.h_vol_2) else 0; Jfg2 = if Cfg2.diff_on_2 then rfg2*gamma_fg2*(Cfg2.h_vol_2 - Cfg2.h_vol_1) else 0; @@ -238,38 +266,52 @@ equation ra = 0; rfg1 = 0; rfg2 = 0; + gamma_a = gamma0; gamma_fg1 = gamma0; gamma_fg2 = gamma0; + Ja = 0; Jfg1 = 0; Jfg2 = 0; end if; + J = Ja + Jfg1 + Jfg2; + Ca.diff_res_2 = 0; Cfg1.diff_res_2 = 0; Cfg2.diff_res_1 = 0; + Ca.diff_on_2 = diffusion; Cfg1.diff_on_2 = diffusion; Cfg2.diff_on_1 = diffusion; -/* Mixture temperature */ -// Changed from FlueGases_T to FlueGases_h to provide a differentiable function + + /* Mixture temperature */ + // Changed from FlueGases_T to FlueGases_h to provide a differentiable function Hmel = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tmel, XmelCO2, XmelH2O, XmelO2, XmelSO2); -// Fuel -// - - -/* Specific enthalpy of the water in fuel */ - pro1 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Pea, Tec, mode); - Hwfuel = pro1.h; -/* Fuel specific enthalpy */ + + // Fuel + // - - + + /* Specific enthalpy of the water in fuel */ + state_fuel_water = Medium.setState_pTX( + p=Pea, + T=Tec, + region=mode); + Hwfuel = Medium.specificEnthalpy(state_fuel_water); + + /* Fuel specific enthalpy */ Hfuel = Cpfuel*(Tec - 273.16); -// Mass flow rates leaving zone 1 -// - - - - - - - - - - - - - - - - + + // Mass flow rates leaving zone 1 + // - - - - - - - - - - - - - - - - Q1H2O = Qec*XH2Ofuel + Qmel*XmelH2O; Q1O2 = Qmel*XmelO2; Q1N2 = Qmel*XmelN2; Q1CO2 = Qmel*XmelCO2; Q1SO2 = Qmel*XmelSO2; -/* After fuel drying */ + + /* After fuel drying */ Q1ec = Qec*(1 - XH2Ofuel); LHVfuel1 = LHVfuel*(1 - XH2Ofuel); X1Cfuel = XCfuel*(1 - XH2Ofuel); @@ -279,43 +321,57 @@ equation X1Clfuel = XClfuel*(1 - XH2Ofuel); X1Ffuel = XFfuel*(1 - XH2Ofuel); X1Sfuel = XSfuel*(1 - XH2Ofuel); -// 2nd zone : Combustion -// --------------------- -// Stage 1 : Combustion of trace elements -// - - - - - - - - - - - - - - - - - - - - -/* Oxygen mass flow rate */ + + // 2nd zone : Combustion + // --------------------- + + // Stage 1 : Combustion of trace elements + // - - - - - - - - - - - - - - - - - - - - + + /* Oxygen mass flow rate */ Q2eO = Q1ec*X1Ofuel + Qmel*XmelO2; -/* Other exiting mass flow rates */ + + /* Other exiting mass flow rates */ Q21HCl = 36.5/35.5*Q1ec*X1Clfuel; Q21HF = 20/19*Q1ec*X1Ffuel; Q21SO2 = 64.06/32.06*Q1ec*X1Sfuel + Qmel*XmelSO2; Q21N2 = Q1N2 + Q1ec*X1Nfuel; -// Etape 2 : CH4 oxydation into CO : CH4+1/2O2=>2H2+CO -// - - - - - - - - - - - - - - - - - - - - - - - - - - -/* Mass flow rate of CO produced */ + + // Etape 2 : CH4 oxydation into CO : CH4+1/2O2=>2H2+CO + // - - - - - - - - - - - - - - - - - - - - - - - - - - + + /* Mass flow rate of CO produced */ Q22CO = 28/12*Q1ec*X1Cfuel; -/* Oxygen mass flow rate */ + + /* Oxygen mass flow rate */ Q22O2 = Q2eO - Q1ec*(X1Sfuel/32.06*32.06 + 32/12/2*X1Cfuel); -/* Mass flow rate of H2 produced */ + + /* Mass flow rate of H2 produced */ Q22H2 = Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel); -/* O2 fraction */ + + /* O2 fraction */ etaO2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2); + if (etaO2 < 1e-6) then -//--------------- -// Lack of oxygen -//--------------- -// Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - + //--------------- + // Lack of oxygen + //--------------- + + // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - Q23CO2 = Q1CO2 + 2/3*Q22O2/32*44; Q23H2O = Qmel*XmelH2O + 4/3*Q22O2/32*18 + Qec*XH2Ofuel; Q23CO = Q22CO - 2/3*Q22O2/32*28; Q23H2 = Q22H2 - 4/3*Q22O2/32*2; Q23O2 = 0; -// Stage 4 :Equilibrium reaction CO/CO2 -// - - - - - - - - - - - - - - - - - - - -/* Total mass flow rate of the volatile elements in zone 2 */ + + // Stage 4 :Equilibrium reaction CO/CO2 + // - - - - - - - - - - - - - - - - - - - + + /* Total mass flow rate of the volatile elements in zone 2 */ Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2; -/* Composition */ + + /* Composition */ X24O2 = Q23O2/Q24eg; X24SO2 = Q21SO2/Q24eg; X24H2O = Q23H2O/Q24eg; @@ -323,12 +379,15 @@ equation X24CO2 = Q23CO2/Q24eg; X24C = X24CO + X24CO2; X24N2 = 1 - (X24O2 + X24SO2 + X24H2O + X24CO + X24CO2); -/* Equilibrium constant */ + + /* Equilibrium constant */ Keq0 = 0.0042*(Tmel - 273.15) - 2.4555; 0 = if (Keq0 > 0) then (Keq - Keq0) else Keq; -/* Molar mass of the incoming gases */ + + /* Molar mass of the incoming gases */ Mm4e = (Q23CO/28 + Q23H2O/18 + Q23CO2/44 + Q23H2/2 + Q21N2/28)/Q24eg; -/* Volume fractions at the inlet of stage 4 */ + + /* Volume fractions at the inlet of stage 4 */ X24eCOvol = Q23CO/Q24eg/Mm4e/28; X24eCO2vol = Q23CO2/Q24eg/Mm4e/44; X24eH2vol = Q23H2/Q24eg/Mm4e/2; @@ -337,35 +396,42 @@ equation X24eHClvol = Q21HCl/Q24eg/Mm4e/36.5; X24eHFvol = Q21HF/Q24eg/Mm4e/20; X24eSO2vol = Q21SO2/Q24eg/Mm4e/64.06; -/* Reaction progress */ + + /* Reaction progress */ delta = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol))^2 - 4*(Keq - 1)*(Keq*X24eCO2vol*X24eH2vol - X24eCOvol*X24eH2Ovol); AVE = ((X24eCOvol + X24eH2Ovol) + Keq*(X24eCO2vol + X24eH2vol) - (delta)^0.5)/2/(Keq - 1); -/* Volume fractions at the outlet of stage 4 */ + + /* Volume fractions at the outlet of stage 4 */ X24sCOvol = X24eCOvol + AVE; X24sCO2vol = X24eCO2vol - AVE; X24sH2vol = X24eH2vol - AVE; X24sH2Ovol = X24eH2Ovol + AVE; -/* Molar mass of the outgoing gases */ + + /* Molar mass of the outgoing gases */ Mm4s = X24sCOvol*28 + X24sCO2vol*44 + X24sH2vol*2 + X24sH2Ovol*18 + X24eN2vol*28; -/* Mass flow rates */ + + /* Mass flow rates */ Q24CO = X24sCOvol*28/Mm4s*Q24eg; Q24CO2 = X24sCO2vol*44/Mm4s*Q24eg; Q24H2O = X24sH2Ovol*18/Mm4s*Q24eg; Q24H2 = X24sH2vol*2/Mm4s*Q24eg; + Q24sg = Q24H2 + Q21HCl + Q21HF + Q21SO2 + Q24H2O + Q24CO + Q21N2 + Q23O2 + Q24CO2; else -//----------------- -// Excess of oxygen -//----------------- -// Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + //----------------- + // Excess of oxygen + //----------------- + + // Stage 3 : CO oxydation into CO2 : 2H2+CO+3/2O2=>CO2+2H2O + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Q23CO2 = Q1CO2 + Q1ec*X1Cfuel/12*44; - Q23H2O = Qmel*XmelH2O + Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel)*18/2 + Qec*XH2Ofuel; + Q23H2O = Qmel*XmelH2O+Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel)*18/2 + Qec*XH2Ofuel; Q23CO = 0; Q23H2 = 0; Q23O2 = Q2eO - Q1ec*(X1Sfuel + 16/2*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel) + 16/12*X1Cfuel*2); -// Stage 4 : Eaquilibrium reaction CO/CO2 -// - - - - - - - - - - - - - - - - - - - + + // Stage 4 : Eaquilibrium reaction CO/CO2 + // - - - - - - - - - - - - - - - - - - - Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2; X24O2 = 0; X24SO2 = 0; @@ -398,13 +464,17 @@ equation Q24H2 = Q23H2; Q24sg = Q24eg; end if; -/* Mass flow rate at the outlet */ + + /* Mass flow rate at the outlet */ Qsf = Q24sg; -/* Power released by the combustion */ + + /* Power released by the combustion */ 0 = if (Q1ec >= 1e-6) then PciCvol - (Q24CO/28/Q1ec*12*(HfCO2 - HfCO) + Q24H2/2*(HfH2O)/Q1ec) else PciCvol; -/* Power released by the combustion in zone 2 */ + + /* Power released by the combustion in zone 2 */ P2g = (LHVfuel1 - PciCvol)*Q1ec; -/* Composition at the outlet */ + + /* Composition at the outlet */ XsfO2 = Q23O2/Qsf; XsfSO2 = Q21SO2/Qsf; XsfH2O = Q24H2O/Qsf; @@ -413,15 +483,66 @@ equation XsfCO2 = Q24CO2/Qsf; XsfC = XsfCO2 + XsfCO; XsfN2 = 1 - (XsfO2 + XsfSO2 + XsfH2O + XsfCO2 + XsfCO); -/* Power accumukated by the gases in zone 2 */ + Xsf[iN2] = 1 - XsfO2 - XsfH2O - XsfCO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg2.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg2.SubC = Cfg1.SubC; + + /* Power accumukated by the gases in zone 2 */ P2t = ((Q24H2O - (Qmel*XmelH2O))*H0v + Qmel*Hmel + Q1ec*Hfuel + P2g)*(1 - Xrad); -// Changed from FlueGases_T to FlueGases_h to provide a differentiable function + // Changed from FlueGases_T to FlueGases_h to provide a differentiable function P2t/Qsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfC, XsfH2O, XsfO2, XsfSO2); P2t/Qsf = Hsf; + Wrad = P2t*Xrad; - annotation( - Diagram(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = {120, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-20, 62}, {46, 46}, {2, 30}, {58, 18}, {6, 0}, {48, -16}, {2, -32}, {54, -44}, {-20, -60}, {-20, 62}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.CrossDiag), Line(points = {{-20, 80}, {-20, -80}}, color = {0, 0, 255})}), - Icon(graphics = {Rectangle(extent = {{-80, 80}, {80, -80}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-20, 62}, {46, 46}, {2, 30}, {58, 18}, {6, 0}, {48, -16}, {2, -32}, {54, -44}, {-20, -60}, {-20, 62}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.CrossDiag), Line(points = {{-20, 80}, {-20, -80}}, color = {0, 0, 255}), Text(extent = {{-92, 100}, {-66, 76}}, lineColor = {28, 108, 200}, textString = "Air inlet"), Text(extent = {{52, 44}, {100, 8}}, lineColor = {238, 46, 47}, textString = "Flue gases outlet"), Text(extent = {{-12, -78}, {20, -108}}, lineColor = {28, 108, 200}, textString = "Fuel inlet"), Text(extent = {{-100, 44}, {-52, 8}}, lineColor = {238, 46, 47}, textString = "Flue gases inlet")}), + + annotation (Diagram(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor={120,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54, + -44},{-20,-60},{-20,62}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.CrossDiag), + Line(points={{-20,80},{-20,-80}}, color={0,0,255})}), + Icon(graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-20,62},{46,46},{2,30},{58,18},{6,0},{48,-16},{2,-32},{54, + -44},{-20,-60},{-20,62}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.CrossDiag), + Line(points={{-20,80},{-20,-80}}, color={0,0,255}), + Text( + extent={{-92,100},{-66,76}}, + lineColor={28,108,200}, + textString="Air inlet"), + Text( + extent={{52,44},{100,8}}, + lineColor={238,46,47}, + textString="Flue gases outlet"), + Text( + extent={{-12,-78},{20,-108}}, + lineColor={28,108,200}, + textString="Fuel inlet"), + Text( + extent={{-100,44},{-52,8}}, + lineColor={238,46,47}, + textString="Flue gases inlet")}), Documentation(revisions = " Author @@ -431,4 +552,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end PostCombustionGas; \ No newline at end of file +end PostCombustionGas; diff --git a/ThermoSysPro/Fluid/Machines/GasTurbine.mo b/ThermoSysPro/Fluid/Machines/GasTurbine.mo index 7d1e4138..a387d09f 100644 --- a/ThermoSysPro/Fluid/Machines/GasTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/GasTurbine.mo @@ -1,65 +1,140 @@ within ThermoSysPro.Fluid.Machines; - model GasTurbine "Combustion turbine for CICO and Barilla plants" - parameter Real comp_tau_n = 15 "Nominal compression nominal rate"; - parameter Real comp_eff_n = 0.9 "Compressor nominal efficiency"; - parameter Real A0 = 0.1725914; - parameter Real A1 = 1.46222; - parameter Real A2 = -0.634857; - parameter Real A3 = 0; - parameter Real A4 = 0; - parameter Real exp_tau_n = 0.05 "Turbine nominal expansion rate"; - parameter Real exp_eff_n = 0.9 "Turbine nominal efficiency"; - parameter Real TurbQred = 0.01 "Turbine reduced mass flow rate"; - parameter Real B0 = 0.95223; - parameter Real B1 = 0.09555; - parameter Real B2 = -0.04778; - parameter Real Kcham = 1 "Chamber pressure loss coefficient"; - parameter Units.SI.Power Wpth = 1e5 "Combustion chamber thermal losses"; - ThermoSysPro.Fluid.BoundaryConditions.AirHumidity xAIR annotation( - Placement(transformation(origin = {-84, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Machines.Compressor Compresseur(A4 = A4, A3 = A3, A2 = A2, A1 = A1, A0 = A0, tau_n = comp_tau_n, is_eff_n = comp_eff_n) annotation( - Placement(transformation(extent = {{-82, -28}, {-32, 28}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber chambreCombustionTAC(Acham = 1, eta_comb = 1, kcham = Kcham, Pea(start = 13.8e5), Wpth = Wpth, Qsf(start = 500), Qfuel(start = 10), Psf(start = 13.2e5), Tsf(start = 1495)) annotation( - Placement(transformation(extent = {{-25, 31}, {25, 83}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.CombustionTurbine TurbineAgaz(Te(start = 1495), Pe(start = 13.2e5), A2 = B2, A1 = B1, A0 = B0, tau_n = exp_tau_n, Qred = TurbQred, Ps(fixed = false, start = 1.013e5), is_eff_n = exp_eff_n, Ts(start = 894.518, fixed = false)) annotation( - Placement(transformation(extent = {{47, -22}, {79, 22}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Entree_air annotation( - Placement(transformation(extent = {{-104, -4}, {-96, 4}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sortie_fumees annotation( - Placement(transformation(extent = {{96, -4}, {104, 4}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Entree_eau_combustion annotation( - Placement(transformation(extent = {{-64, 96}, {-56, 104}}, rotation = 0))); - Interfaces.Connectors.FuelInlet Entree_combustible annotation( - Placement(transformation(extent = {{56, 96}, {64, 104}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide annotation( - Placement(transformation(extent = {{-108, 56}, {-100, 64}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca annotation( - Placement(transformation(extent = {{100, -44}, {108, -36}}, rotation = 0))); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real comp_tau_n=15 "Nominal compression nominal rate"; + parameter Real comp_eff_n=0.9 "Compressor nominal efficiency"; + parameter Real A0=0.1725914; + parameter Real A1=1.46222; + parameter Real A2=-0.634857; + parameter Real A3=0; + parameter Real A4=0; + parameter Real exp_tau_n=0.05 "Turbine nominal expansion rate"; + parameter Real exp_eff_n=0.9 "Turbine nominal efficiency"; + parameter Real TurbQred=0.01 "Turbine reduced mass flow rate"; + parameter Real B0=0.95223; + parameter Real B1=0.09555; + parameter Real B2=-0.04778; + parameter Real Kcham=1 "Chamber pressure loss coefficient"; + parameter Units.SI.Power Wpth=1e5 "Combustion chamber thermal losses"; + + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity xAIR( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation( + origin={-84,30}, + extent={{-10,-10},{10,10}}, + rotation=270))); + ThermoSysPro.Fluid.Machines.Compressor Compresseur( + redeclare package Medium = Medium_FlueGases, + A4=A4, + A3=A3, + A2=A2, + A1=A1, + A0=A0, + tau_n=comp_tau_n, + is_eff_n=comp_eff_n) annotation (Placement(transformation( + extent={{-82,-28},{-32,28}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber chambreCombustionTAC( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Acham=1, + eta_comb=1, + kcham=Kcham, + Pea(start=13.8e5), + Wpth=Wpth, + Qsf(start=500), + Qfuel(start=10), + Psf(start=13.2e5), + Tsf(start=1495)) annotation (Placement(transformation(extent={{-25,31},{ + 25,83}}, rotation=0))); + ThermoSysPro.Fluid.Machines.CombustionTurbine TurbineAgaz( + redeclare package Medium = Medium_FlueGases, + Te(start=1495), + Pe(start=13.2e5), + A2=B2, + A1=B1, + A0=B0, + tau_n=exp_tau_n, + Qred=TurbQred, + Ps(fixed=false, start=1.013e5), + is_eff_n=exp_eff_n, + Ts(start=894.518, fixed=false)) + annotation (Placement(transformation(extent= + {{47,-22},{79,22}}, rotation=0))); + Interfaces.Connectors.FluidInlet Entree_air(redeclare package Medium = + Medium_FlueGases) annotation (Placement( + transformation(extent={{-104,-4},{-96,4}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sortie_fumees(redeclare package Medium = + Medium_FlueGases) annotation (Placement( + transformation(extent={{96,-4},{104,4}}, rotation=0))); + Interfaces.Connectors.FluidInlet Entree_eau_combustion(redeclare package + Medium = Medium) annotation (Placement( + transformation(extent={{-64,96},{-56,104}}, rotation=0))); + Interfaces.Connectors.FuelInlet Entree_combustible + annotation (Placement(transformation(extent={{56,96},{64,104}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Huminide + annotation (Placement(transformation(extent={{-108,56},{-100,64}}, rotation= + 0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal PuissanceMeca + annotation (Placement(transformation(extent={{100,-44},{108,-36}}, rotation= + 0))); equation - connect(Huminide, xAIR.humidity) annotation( - Line(points = {{-104, 60}, {-56, 60}, {-56, 30}, {-73, 30}})); - connect(TurbineAgaz.MechPower, PuissanceMeca) annotation( - Line(points = {{80.6, -19.8}, {90, -19.8}, {90, -40}, {104, -40}})); - connect(Compresseur.Power, TurbineAgaz.CompressorPower) annotation( - Line(points = {{-38.25, -8.4}, {46, -8.4}, {46, -8}, {45.4, -8.8}})); - connect(xAIR.C2, Compresseur.Ce) annotation( - Line(points = {{-84, 20}, {-84, 3.55271e-015}, {-75.75, 3.55271e-015}}, color = {0, 0, 0}, thickness = 1)); - connect(TurbineAgaz.Cs, Sortie_fumees) annotation( - Line(points = {{79, 0}, {100, 0}}, color = {0, 0, 0}, thickness = 1)); - connect(xAIR.C1, Entree_air) annotation( - Line(points = {{-84, 40}, {-100, 40}, {-100, 0}}, color = {0, 0, 0}, thickness = 1)); - connect(Compresseur.Cs, chambreCombustionTAC.Ca) annotation( - Line(points = {{-38.25, 3.55271e-015}, {-32, 3.55271e-015}, {-32, 57}, {-22.5, 57}}, color = {0, 0, 0}, thickness = 1)); - connect(chambreCombustionTAC.Cfg, TurbineAgaz.Ce) annotation( - Line(points = {{22.5, 57}, {32, 57}, {32, 0}, {47, 0}}, color = {0, 0, 0}, thickness = 1)); - connect(Entree_eau_combustion, chambreCombustionTAC.Cws) annotation( - Line(points = {{-60, 100}, {-60, 90}, {-15, 90}, {-15, 80.4}})); - connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation( - Line(points = {{0, 33.6}, {0, 20}, {60, 20}, {60, 100}}, color = {0, 0, 0})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Polygon(points = {{-100, 72}, {-100, -70}, {-20, -20}, {-20, 20}, {-100, 72}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 20}, {20, -20}}, lineColor = {0, 0, 0}, fillColor = {170, 255, 213}, fillPattern = FillPattern.Solid), Polygon(points = {{20, 20}, {20, -20}, {100, -70}, {100, 70}, {20, 20}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), fillPattern = FillPattern.Solid), Line(points = {{-60, 96}, {-60, 60}, {-10, 60}, {-10, 20}}, color = {0, 0, 255}), Line(points = {{60, 96}, {60, 60}, {8, 60}, {8, 20}}, color = {0, 0, 127})}), + connect(Huminide, xAIR.humidity) annotation (Line(points={{-104,60},{-56,60}, + {-56,30},{-73,30}})); + connect(TurbineAgaz.MechPower, PuissanceMeca) annotation (Line(points={{80.6, + -19.8},{90,-19.8},{90,-40},{104,-40}})); + connect(Compresseur.Power, TurbineAgaz.CompressorPower) + annotation (Line(points={{-38.25,-8.4},{46,-8.4},{46,-8},{45.4,-8.8}})); + connect(xAIR.C2, Compresseur.Ce) annotation (Line( + points={{-84,20},{-84,3.55271e-015},{-75.75,3.55271e-015}}, + color={0,0,0}, + thickness=1)); + connect(TurbineAgaz.Cs, Sortie_fumees) annotation (Line( + points={{79,0},{100,0}}, + color={0,0,0}, + thickness=1)); + connect(xAIR.C1, Entree_air) annotation (Line( + points={{-84,40},{-100,40},{-100,0}}, + color={0,0,0}, + thickness=1)); + connect(Compresseur.Cs, chambreCombustionTAC.Ca) annotation (Line( + points={{-38.25,3.55271e-015},{-32,3.55271e-015},{-32,57},{-22.5,57}}, + color={0,0,0}, + thickness=1)); + connect(chambreCombustionTAC.Cfg, TurbineAgaz.Ce) annotation (Line( + points={{22.5,57},{32,57},{32,0},{47,0}}, + color={0,0,0}, + thickness=1)); + connect(Entree_eau_combustion, chambreCombustionTAC.Cws) + annotation (Line(points={{-60,100},{-60,90},{-15,90},{-15,80.4}})); + connect(chambreCombustionTAC.Cfuel, Entree_combustible) annotation (Line( + points={{0,33.6},{0,20},{60,20},{60,100}}, color={0,0,0})); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={ + Polygon( + points={{-100,72},{-100,-70},{-20,-20},{-20,20},{-100,72}}, + lineColor={0,0,0}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,20},{20,-20}}, + lineColor={0,0,0}, + fillColor={170,255,213}, + fillPattern=FillPattern.Solid), + Polygon( + points={{20,20},{20,-20},{100,-70},{100,70},{20,20}}, + lineColor={0,0,0}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + fillPattern=FillPattern.Solid), + Line(points={{-60,96},{-60,60},{-10,60},{-10,20}}, color={0,0,255}), + Line(points={{60,96},{60,60},{8,60},{8,20}}, color={0,0,127})}), Documentation(revisions = " Author @@ -69,4 +144,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end GasTurbine; \ No newline at end of file +end GasTurbine; From d6d460a417f31cdc83d60b97c803c5348b14b6e2 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:45:59 +0200 Subject: [PATCH 188/213] #125 port static Fluid heat exchangers medium support onto develop --- .../HeatExchangers/FixedPowerHeatExchanger.mo | 214 ++++-- .../Fluid/HeatExchangers/NTUWaterHeater.mo | 698 +++++++++++++----- .../HeatExchangers/SimpleStaticCondenser.mo | 317 +++++--- .../HeatExchangers/StaticAerocondenser.mo | 512 +++++++++---- .../Fluid/HeatExchangers/StaticCondenser.mo | 497 +++++++++---- .../HeatExchangers/StaticCondenserHEI.mo | 670 ++++++++++------- .../StaticExchangerDTorWorEff.mo | 434 ++++++++--- .../Fluid/HeatExchangers/StaticExchangerKS.mo | 294 +++++--- .../StaticPlateHeatExchanger.mo | 366 +++++---- .../StaticWallFlueGasesExchanger.mo | 349 +++++---- 10 files changed, 2978 insertions(+), 1373 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo index 1886832c..8be65437 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo @@ -1,99 +1,175 @@ within ThermoSysPro.Fluid.HeatExchangers; - model FixedPowerHeatExchanger "Heat exchanger with fixed delta power" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Power DW = 0 "Power exchanged between the hot and the cold fluid"; - parameter Real DPc = 10 "Total pressure loss for the hot fluid (percent of the fluid pressure at the inlet)"; - parameter Real DPf = 10 "Total pressure loss for the cold fluid (percent of the fluid pressure at the inlet)"; - parameter Units.SI.MassFlowRate gamma_diff_c = 1e-4 "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.MassFlowRate gamma_diff_f = 1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_c = IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_f = IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Power DW=0 + "Power exchanged between the hot and the cold fluid"; + parameter Real DPc=10 "Total pressure loss for the hot fluid (percent of the fluid pressure at the inlet)"; + parameter Real DPf=10 "Total pressure loss for the cold fluid (percent of the fluid pressure at the inlet)"; + parameter Units.SI.MassFlowRate gamma_diff_c=1e-4 + "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 + "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; + +public Units.SI.Temperature Tec "Fluid temperature at the inlet of the hot side"; Units.SI.Temperature Tsc "Fluid temperature at the outlet of the hot side"; Units.SI.Temperature Tef "Fluid temperature at the inlet of the cold side"; Units.SI.Temperature Tsf "Fluid temperature at the outlet of the cold side"; - Units.SI.MassFlowRate Qc(start = 100) "Hot fluid mass flow rate"; - Units.SI.MassFlowRate Qf(start = 100) "Cold fluid mass flow rate"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c = Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f = Integer(ftype_f) "Fluid number for the cold fluid"; - Interfaces.Connectors.FluidInlet Ec annotation( - Placement(transformation(extent = {{-68, -70}, {-48, -50}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ef annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sf annotation( - Placement(transformation(extent = {{88, -9}, {108, 11}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sc annotation( - Placement(transformation(extent = {{48, -70}, {68, -50}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce annotation( - Placement(transformation(extent = {{-20, 80}, {0, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs annotation( - Placement(transformation(extent = {{20, 80}, {40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); -protected - parameter Integer mode_c = Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f = Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate"; + Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; + +public + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{-68,-70},{-48,-50}}, rotation=0))); + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{88,-9},{108,11}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{48,-70},{68,-50}}, rotation=0))); equation -/* Mass flow rates */ + + /* Mass flow rates */ Ec.Q = Sc.Q; + Ec.h_vol_1 = Sc.h_vol_1; Ec.h_vol_2 = Sc.h_vol_2; + Sc.diff_on_1 = Ec.diff_on_1; Ec.diff_on_2 = Sc.diff_on_2; + Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - ftype_c = Ec.ftype; + + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; + Ef.Q = Sf.Q; + Ef.h_vol_1 = Sf.h_vol_1; Ef.h_vol_2 = Sf.h_vol_2; + Sf.diff_on_1 = Ef.diff_on_1; Ef.diff_on_2 = Sf.diff_on_2; + Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - ftype_f = Ef.ftype; + + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; + Qc = Ec.Q; Qf = Ef.Q; -/* Power exchanged between the hot and cold fluid */ + Xc = Ec.Xi; + Xf = Ef.Xi; + + /* Power exchanged between the hot and cold fluid */ DW = Qf*(Sf.h - Ef.h); DW = Qc*(Ec.h - Sc.h); -/* Pressure losses */ + + /* Pressure losses */ Sc.P = if (Qc > 0) then Ec.P - DPc*Ec.P/100 else Ec.P + DPc*Ec.P/100; Sf.P = if (Qf > 0) then Ef.P - DPf*Ef.P/100 else Ef.P + DPf*Ef.P/100; -/* Fluid thermodynamic properties for the hot fluid */ - proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c); - procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_c); - Tec = proce.T; - Tsc = procs.T; -/* Fluid thermodynamic properties for the cold fluid */ - profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f); - profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f); - Tef = profe.T; - Tsf = profs.T; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 62}, {100, -62}}, lineColor = {255, 255, 170}, fillColor = DynamicSelect({127, 255, 0}, fill_color_singular), lineThickness = 0, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 62}, {100, -62}}, lineColor = {0, 0, 0}, fillColor = {127, 255, 0}, fillPattern = FillPattern.CrossDiag), Line(points = {{-58, -50}, {-58, 4}, {-2, -28}, {58, 6}, {58, -50}}, color = {0, 0, 255}, thickness = 0.5), Text(extent = {{-126, 24}, {-106, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold inlet"), Text(extent = {{-88, -70}, {-68, -80}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot inlet"), Text(extent = {{70, -72}, {94, -82}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot outlet"), Text(extent = {{104, 24}, {128, 10}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold outlet")}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {28, 108, 200}, fillColor = {127, 255, 0}, fillPattern = FillPattern.CrossDiag), Line(points = {{-58, -50}, {-58, 2}, {-2, -34}, {58, 2}, {58, -50}}, color = {0, 0, 255}, thickness = 0.5), Text(extent = {{-104, 28}, {-60, 10}}, lineColor = {0, 0, 0}, textString = "Cold inlet"), Text(extent = {{62, 30}, {106, 12}}, lineColor = {0, 0, 0}, textString = "Cold outlet"), Text(extent = {{62, -36}, {106, -54}}, lineColor = {238, 46, 47}, textString = "Hot outlet"), Text(extent = {{-106, -34}, {-62, -52}}, lineColor = {238, 46, 47}, textString = "Hot inlet")}), - Window(x = 0.05, y = 0.01, width = 0.93, height = 0.87), + + /* Fluid thermodynamic properties for the hot fluid */ + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); + + /* Fluid thermodynamic properties for the cold fluid */ + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + + Tef = Medium_f.temperature(state_fe); + Tsf = Medium_f.temperature(state_fs); + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,62},{100,-62}}, + lineColor={255,255,170}, + fillColor=DynamicSelect({127,255,0}, fill_color_singular), + lineThickness=0, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,62},{100,-62}}, + lineColor={0,0,0}, + fillColor={127,255,0}, + fillPattern=FillPattern.CrossDiag), + Line( + points={{-58,-50},{-58,4},{-2,-28},{58,6},{58,-50}}, + color={0,0,255}, + thickness=0.5), + Text( + extent={{-126,24},{-106,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold inlet"), + Text( + extent={{-88,-70},{-68,-80}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot inlet"), + Text( + extent={{70,-72},{94,-82}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot outlet"), + Text( + extent={{104,24},{128,10}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold outlet")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={28,108,200}, + fillColor={127,255,0}, + fillPattern=FillPattern.CrossDiag), Line( + points={{-58,-50},{-58,2},{-2,-34},{58,2},{58,-50}}, + color={0,0,255}, + thickness=0.5), + Text( + extent={{-104,28},{-60,10}}, + lineColor={0,0,0}, + textString="Cold inlet"), + Text( + extent={{62,30},{106,12}}, + lineColor={0,0,0}, + textString="Cold outlet"), + Text( + extent={{62,-36},{106,-54}}, + lineColor={238,46,47}, + textString="Hot outlet"), + Text( + extent={{-106,-34},{-62,-52}}, + lineColor={238,46,47}, + textString="Hot inlet")}), + Window( + x=0.05, + y=0.01, + width=0.93, + height=0.87), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -103,4 +179,4 @@ Author Baligh El Hefni ")); -end FixedPowerHeatExchanger; \ No newline at end of file +end FixedPowerHeatExchanger; diff --git a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo index 615f7377..772fcd33 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo @@ -1,255 +1,249 @@ within ThermoSysPro.Fluid.HeatExchangers; - model NTUWaterHeater "NTU water heater" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real lambdaE = 0 "Pressure loss coefficient on the water side"; - parameter Units.SI.Area SCondDes = 3000 "Exchange surface for the condensation and deheating"; - parameter Units.SI.CoefficientOfHeatTransfer KCond = 1 "Heat transfer coefficient for the condensation"; - parameter Units.SI.Area SPurge = 0 "Drain surface - if > 0: with drain cooling"; - parameter Units.SI.CoefficientOfHeatTransfer KPurge = 1 "Heat transfer coefficient for the drain cooling"; - parameter Units.SI.MassFlowRate gamma_diff_e = 1e-4 "Diffusion conductance for the water side (active if diffusion=true in neighbouring volumes)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_eeF = IF97Region.All_regions "IF97 region at the inlet of the water side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_seF = IF97Region.All_regions "IF97 region at the outlet of the water side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_evC = IF97Region.All_regions "IF97 region at the inlet of the vapor side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_mF = IF97Region.All_regions "IF97 region in the drain (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_epC = IF97Region.All_regions "IF97 region at the inlet of the drain (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_spC = IF97Region.All_regions "IF97 region at the outlet of the drain (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_flash = IF97Region.All_regions "IF97 region in the flash zone of the drain (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy"; - Units.SI.SpecificEnthalpy HsateC(start = 300e3, min = 0) "Saturation specific enthalpy of the water at the pressure of the vapor inlet"; - Units.SI.SpecificEnthalpy HsatvC(start = 2500e3, min = 0) "Saturation specific enthalpy of the vapor at the pressure of the vapor inlet"; - Units.SI.Area SDes(start = 0) "Heat exchange surface for deheating"; - Units.SI.SpecificEnthalpy HeiF(start = 200e3) "Fluid specific enthalpy after drain cooling"; - Units.SI.SpecificEnthalpy HDesF(start = 200e3) "Fluid specific enthalpy after deheating"; - Units.SI.Temperature TeiF(start = 400, min = 0) "Fluid temperature after drain cooling"; - Units.SI.Temperature TsatC(start = 400, min = 0) "Saturation temperature"; - Units.SI.Power W(start = 1) "Total heat power transfered to the cooling water"; - Units.SI.Power Wdes(start = 1) "Energy transfer during deheating"; - Units.SI.Power Wcond(start = 1) "Energy transfer during condensation"; - Units.SI.Power Wflash(start = 1) "Energy transfer during partial vaporisation in the drain"; - Units.SI.Power Wpurge(start = 1) "Energy transfer during drain cooling"; - Units.SI.SpecificEnthalpy Hep(start = 3e5) "Mixing specific enthalpy of the drain and the condensate"; - Units.SI.Density rho(start = 1e3, min = 0) "Average water density"; - FluidType fluids[4] "Fluids mixing in volume"; - FluidType ftype_e "Fluid type for the water side"; - Integer fluid_e = Integer(ftype_e) "Fluid number for the water side"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H20 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + + replaceable package Medium_e = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real lambdaE=0 "Pressure loss coefficient on the water side"; + parameter Units.SI.Area SCondDes=3000 + "Exchange surface for the condensation and deheating"; + parameter Units.SI.CoefficientOfHeatTransfer KCond=1 + "Heat transfer coefficient for the condensation"; + parameter Units.SI.Area SPurge=0 "Drain surface - if > 0: with drain cooling"; + parameter Units.SI.CoefficientOfHeatTransfer KPurge=1 + "Heat transfer coefficient for the drain cooling"; + parameter Units.SI.MassFlowRate gamma_diff_e=1e-4 + "Diffusion conductance for the water side (active if diffusion=true in neighbouring volumes)"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Real eps=1.e-3 "Small number for pressure loss equation"; + +public + Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; + Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy"; + Units.SI.SpecificEnthalpy HsateC(start=300e3, min=0) + "Saturation specific enthalpy of the water at the pressure of the vapor inlet"; + Units.SI.SpecificEnthalpy HsatvC(start=2500e3, min=0) + "Saturation specific enthalpy of the vapor at the pressure of the vapor inlet"; + Units.SI.Area SDes(start=0) "Heat exchange surface for deheating"; + Units.SI.SpecificEnthalpy HeiF(start=200e3) + "Fluid specific enthalpy after drain cooling"; + Units.SI.SpecificEnthalpy HDesF(start=200e3) + "Fluid specific enthalpy after deheating"; + Units.SI.Temperature TeiF(start=400, min=0) + "Fluid temperature after drain cooling"; + Units.SI.Temperature TsatC(start=400, min=0) "Saturation temperature"; + Units.SI.Power W(start=1) "Total heat power transfered to the cooling water"; + Units.SI.Power Wdes(start=1) "Energy transfer during deheating"; + Units.SI.Power Wcond(start=1) "Energy transfer during condensation"; + Units.SI.Power Wflash(start=1) + "Energy transfer during partial vaporisation in the drain"; + Units.SI.Power Wpurge(start=1) "Energy transfer during drain cooling"; + Units.SI.SpecificEnthalpy Hep(start=3e5) + "Mixing specific enthalpy of the drain and the condensate"; + Units.SI.Density rho(start=1e3, min=0) "Average water density"; + Medium_e.MassFraction Xe[Medium_e.nXi](start=Medium_e.X_default[1:Medium_e.nXi]) "Mass fractions on the water side"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions in the condensing volume"; + Medium_c.ExtraProperty SubCc[Medium_c.nC](quantity=Medium_c.extraPropertiesNames, start=Medium_c.C_default) "Trace substances in the condensing volume"; Units.SI.Power Jep "Thermal power diffusion from the inlet of the drain"; Units.SI.Power Jev "Thermal power diffusion from the inlet of the vapor side"; Units.SI.Power Jsp "Thermal power diffusion from the outlet of the drain"; Units.SI.Power J "Total thermal power diffusion"; - Units.SI.MassFlowRate gamma_ep "Diffusion conductance for the inlet of the drain"; - Units.SI.MassFlowRate gamma_ev "Diffusion conductance for the inlet of the vapor side"; - Units.SI.MassFlowRate gamma_sp "Diffusion conductance for the outlet of the drain"; + Units.SI.MassFlowRate gamma_ep + "Diffusion conductance for the inlet of the drain"; + Units.SI.MassFlowRate gamma_ev + "Diffusion conductance for the inlet of the vapor side"; + Units.SI.MassFlowRate gamma_sp + "Diffusion conductance for the outlet of the drain"; Real rep "Value of r(Q/gamma) for the inlet of the drain"; Real rev "Value of r(Q/gamma) for inlet for the inlet of the vapor side"; Real rsp "Value of r(Q/gamma) for the outlet of the drain"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proeeF "Water inlet fluid properties (4F)" annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proseF "Water outlet fluid properties (1F)" annotation( - Placement(transformation(extent = {{-70, -100}, {-50, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prospC "Drain outlet fluid properties (4C)" annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ee "Water inlet" annotation( - Placement(transformation(extent = {{-90, -10}, {-110, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Se "Water outlet" annotation( - Placement(transformation(extent = {{110, -10}, {90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ep "Drain inlet" annotation( - Placement(transformation(extent = {{-50, 24}, {-70, 44}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sp "Drain outlet" annotation( - Placement(transformation(extent = {{-50, -43}, {-70, -23}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ev "Vapor inlet" annotation( - Placement(transformation(extent = {{70, 24}, {50, 44}}, rotation = 0), iconTransformation(extent = {{70, 24}, {50, 44}}))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proevC "Vapor inlet fluid properties (1C)" annotation( - Placement(transformation(extent = {{-70, 80}, {-50, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsatC "Saturation conditions for the liquid phase" annotation( - Placement(transformation(extent = {{10, 40}, {30, 60}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsatC "Saturation conditions for the vapor phase" annotation( - Placement(transformation(extent = {{-30, 40}, {-10, 60}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promeF "Average water fluid properties (between 4F and 3F)" annotation( - Placement(transformation(extent = {{-40, -100}, {-20, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmC "Deheating average fluid properties (between 1C and 2C)" annotation( - Placement(transformation(extent = {{50, 80}, {70, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promcF "Average deheating fluid properties (between 3F and 2F)" annotation( - Placement(transformation(extent = {{50, -100}, {70, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesF "Deheating inlet fluid properties (2F)" annotation( - Placement(transformation(extent = {{-10, -100}, {10, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prodesmF "Average deheating fluid properties (between 2F and 1F)" annotation( - Placement(transformation(extent = {{20, -100}, {40, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prosp "Drain outlet fluid properties before cooling (near 3C)" annotation( - Placement(transformation(extent = {{-40, 80}, {-20, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompC "Average fluid properties in the drain (between 3C and 4C)" annotation( - Placement(transformation(extent = {{20, 80}, {40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prompF "Average water fluid properties (between 4F and 3F)" annotation( - Placement(transformation(extent = {{-100, -60}, {-80, -40}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proecF "Water fluid properties (3F)" annotation( - Placement(transformation(extent = {{80, -100}, {100, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph flashepC "Flash fluid properties (near 4C)" annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); -protected - parameter Integer fluid = Integer(ftype) "Fluid number"; - parameter Integer mode_eeF = Integer(region_eeF) "IF97 region at the inlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_seF = Integer(region_seF) "IF97 region at the outlet of the water side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_evC = Integer(region_evC) "IF97 region at the inlet of the vapor side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_mF = Integer(region_mF) "IF97 region in the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_epC = Integer(region_epC) "IF97 region at the inlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_spC = Integer(region_spC) "IF97 region at the outlet of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_flash = Integer(region_flash) "IF97 region in the flash zone of the drain. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Real eps = 1.e-3 "Small number for pressure loss equation"; + + Medium_e.ThermodynamicState state_eeF "Water inlet fluid state (4F)"; + Medium_e.ThermodynamicState state_seF "Water outlet fluid state (1F)"; + Medium_c.ThermodynamicState state_spC "Drain outlet fluid state (4C)"; + Interfaces.Connectors.FluidInlet Ee(redeclare package Medium = Medium_e) "Water inlet" + annotation (Placement(transformation(extent={{-90,-10},{-110,10}}, rotation= + 0))); + Interfaces.Connectors.FluidOutlet Se(redeclare package Medium = Medium_e) "Water outlet" annotation (Placement( + transformation(extent={{110,-10},{90,10}}, rotation=0))); + Interfaces.Connectors.FluidInlet Ep(redeclare package Medium = Medium_c) "Drain inlet" + annotation (Placement(transformation(extent={{-50,24},{-70,44}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sp(redeclare package Medium = Medium_c) "Drain outlet" annotation (Placement( + transformation(extent={{-50,-43},{-70,-23}}, rotation=0))); + Interfaces.Connectors.FluidInlet Ev(redeclare package Medium = Medium_c) "Vapor inlet" + annotation (Placement(transformation(extent={{70,24},{50,44}}, rotation=0), + iconTransformation(extent={{70,24},{50,44}}))); + Medium_c.ThermodynamicState state_evC "Vapor inlet fluid state (1C)"; + Medium_c.SaturationProperties satC "Saturation conditions at the vapor inlet pressure"; + Medium_c.ThermodynamicState state_lsatC "Saturated liquid state"; + Medium_c.ThermodynamicState state_vsatC "Saturated vapor state"; + Medium_e.ThermodynamicState state_meF "Average water fluid state (between 4F and 3F)"; + Medium_c.ThermodynamicState state_desmC "Deheating average fluid state (between 1C and 2C)"; + Medium_e.ThermodynamicState state_mcF "Average deheating fluid state (between 3F and 2F)"; + Medium_e.ThermodynamicState state_desF "Deheating inlet fluid state (2F)"; + Medium_e.ThermodynamicState state_desmF "Average deheating fluid state (between 2F and 1F)"; + Medium_c.ThermodynamicState state_sp "Drain outlet fluid state before cooling (near 3C)"; + Medium_c.ThermodynamicState state_mpC "Average fluid state in the drain (between 3C and 4C)"; + Medium_e.ThermodynamicState state_mpF "Average water fluid state (between 4F and 3F)"; + Medium_e.ThermodynamicState state_ecF "Water fluid state (3F)"; + Units.SI.SpecificHeatCapacity cp_desmC; + Units.SI.SpecificHeatCapacity cp_mcF; + Units.SI.SpecificHeatCapacity cp_desmF; + Units.SI.SpecificHeatCapacity cp_mpC; + Units.SI.SpecificHeatCapacity cp_mpF; + Units.SI.Temperature T_evC; + Units.SI.Temperature T_desF; + Units.SI.Temperature T_sp; + Units.SI.Temperature T_eeF; + Real x_flashepC "Steam mass fraction in the flash state"; equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Ev.ftype; - fluids[3] = Ep.ftype; - fluids[4] = Sp.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "NTUWaterHeater: fluids mixing in water heater volume are not compatible with each other"); -/* Check that the fluid type is water/steam for the water side */ - assert((ftype_e == FluidType.WaterSteam) or (ftype_e == FluidType.WaterSteamSimple), "NTUWaterHeater: the fluid type for the water side must be water/steam"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if cardinality(Ep) == 0 then Ep.Q = 0; Ep.h = 1.e5; Ep.h_vol_1 = 1.e5; Ep.diff_res_1 = 0; Ep.diff_on_1 = false; - Ep.ftype = ftype; - Ep.Xco2 = 0; - Ep.Xh2o = 0; - Ep.Xo2 = 0; - Ep.Xso2 = 0; + Ep.Xi = Medium_c.X_default[1:Medium_c.nXi]; + Ep.SubC = fill(0, Medium_c.nC); end if; -// Cooling pipe -//------------- + + // Cooling pipe + //------------- + Ee.Q = Se.Q; + Ee.h_vol_1 = Se.h_vol_1; Ee.h_vol_2 = Se.h_vol_2; + Se.diff_on_1 = Ee.diff_on_1; Ee.diff_on_2 = Se.diff_on_2; + Se.diff_res_1 = Ee.diff_res_1 + 1/gamma_diff_e; Ee.diff_res_2 = Se.diff_res_2 + 1/gamma_diff_e; - Ee.ftype = Se.ftype; - Ee.Xco2 = Se.Xco2; - Ee.Xh2o = Se.Xh2o; - Ee.Xo2 = Se.Xo2; - Ee.Xso2 = Se.Xso2; - ftype_e = Ee.ftype; -/* Pressure loss equation in the water pipe */ + + Ee.Xi = Se.Xi; + Ee.SubC = Se.SubC; + + Xe = Ee.Xi; + + /* Pressure loss equation in the water pipe */ Ee.P - Se.P = lambdaE*ThermoSysPro.Functions.ThermoSquare(Ee.Q, eps)/rho; -/* Heating power released to the cooling pipe */ + + /* Heating power released to the cooling pipe */ W = Se.Q*(Se.h - Ee.h); -// Water/steam cavity -//------------------- -/* Fluid pressure */ + + // Water/steam cavity + //------------------- + + /* Fluid pressure */ P = Ep.P; P = Ev.P; P = Sp.P; -/* Fluid specific enthalpy (singular if all flows = 0) */ + + /* Fluid specific enthalpy (singular if all flows = 0) */ Ep.h_vol_2 = h; Ev.h_vol_2 = h; Sp.h_vol_1 = h; -/* Mass balance equation */ + + /* Mass balance equation */ 0 = Ep.Q + Ev.Q - Sp.Q; -/* Energy balance equations */ -// Deheating zone -//--------------- -/* Heat power, fluid specific enthalpy on the cold side and deheating surface */ -/* If deheating is present */ + + /* Energy balance equations */ + + // Deheating zone + //--------------- + + /* Heat power, fluid specific enthalpy on the cold side and deheating surface */ + /* If deheating is present */ if (HsatvC < Ev.h) then 0 = Ev.Q*(Ev.h - HsatvC) - Ee.Q*(Se.h - HDesF) + J/3; Wdes = Ee.Q*(Se.h - HDesF); - Wdes = noEvent(min(Ev.Q*prodesmC.cp, Ee.Q*prodesmF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, prodesmC.cp, prodesmF.cp, KCond/2, SDes, 1)*(proevC.T - prodesF.T)); -/* If deheating is absent */ + Wdes = noEvent(min(Ev.Q*cp_desmC, Ee.Q*cp_desmF)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, cp_desmC, cp_desmF, KCond/2, SDes, 1)*(T_evC - T_desF)); + /* If deheating is absent */ else Wdes = 1e-9; HDesF = Se.h; SDes = 1e-9; end if; -// Condensation zone -//------------------ -/* Heat power, fluid specific enthalpy at the outlet of the condensation zone and vapor mass flow rate at the inlet */ + + // Condensation zone + //------------------ + + /* Heat power, fluid specific enthalpy at the outlet of the condensation zone and vapor mass flow rate at the inlet */ if noEvent(Ev.h < HsatvC) then 0 = Ev.Q*(Ev.h - HsateC) + Wflash - Ee.Q*(HDesF - HeiF) + J/3; else 0 = Ev.Q*(HsatvC - HsateC) + Wflash - Ee.Q*(HDesF - HeiF) + J/3; end if; + Wcond = Ee.Q*(HDesF - HeiF); - Wcond = Ee.Q*promcF.cp*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, promcF.cp, KCond, (SCondDes - SDes), 0.5)*(TsatC - TeiF); -// Flash zone -//----------- -/* Heat power in case of partial vaporization in the drain */ - if (flashepC.x > 0) then + Wcond = Ee.Q*cp_mcF*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, cp_mcF, KCond, (SCondDes - SDes), 0.5)*(TsatC - TeiF); + + // Flash zone + //----------- + + /* Heat power in case of partial vaporization in the drain */ + if (x_flashepC > 0) then Wflash = Ep.Q*(Ep.h - HsateC); else Wflash = 0; end if; -/* Condition for partial vaporisation in the drain (flash) */ - if (flashepC.x > 0) then + + /* Condition for partial vaporisation in the drain (flash) */ + if (x_flashepC > 0) then Hep = HsateC; else Sp.Q*Hep = HsateC*Ev.Q + Ep.h*Ep.Q; end if; -// Drain cooling zone -//------------------- -/* Power, fluid specific enthalpy at the cold outlet and temperature of the drain outlet */ + + // Drain cooling zone + //------------------- + + /* Power, fluid specific enthalpy at the cold outlet and temperature of the drain outlet */ if noEvent(SPurge > 0) then 0 = Sp.Q*(Hep - Sp.h) - Ee.Q*(HeiF - Ee.h) + J/3; Wpurge = Ee.Q*(HeiF - Ee.h); - Wpurge = noEvent(min(Sp.Q*prompC.cp, Ee.Q*prompF.cp)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, prompC.cp, prompF.cp, KPurge, SPurge, 0)*(prosp.T - proeeF.T)); - TeiF = proecF.T; + Wpurge = noEvent(min(Sp.Q*cp_mpC, Ee.Q*cp_mpF)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, cp_mpC, cp_mpF, KPurge, SPurge, 0)*(T_sp - T_eeF)); + TeiF = Medium_e.temperature(state_ecF); else HeiF = Ee.h; Wpurge = 0; Hep = Sp.h; - TeiF = proeeF.T; + TeiF = T_eeF; end if; -/* Fluid composition balance equations */ - 0 = Ep.Xco2*Ep.Q + Ev.Xco2*Ev.Q - Sp.Xco2*Sp.Q; - 0 = Ep.Xh2o*Ep.Q + Ev.Xh2o*Ev.Q - Sp.Xh2o*Sp.Q; - 0 = Ep.Xo2*Ep.Q + Ev.Xo2*Ev.Q - Sp.Xo2*Sp.Q; - 0 = Ep.Xso2*Ep.Q + Ev.Xso2*Ev.Q - Sp.Xso2*Sp.Q; - Sp.ftype = ftype; - Sp.Xco2 = Xco2; - Sp.Xh2o = Xh2o; - Sp.Xo2 = Xo2; - Sp.Xso2 = Xso2; -/* Flow reversal */ + + /* Fluid composition balance equations */ + zeros(Medium_c.nXi) = Ep.Xi*Ep.Q + Ev.Xi*Ev.Q - Sp.Xi*Sp.Q; + zeros(Medium_c.nC) = Ep.SubC*Ep.Q + Ev.SubC*Ev.Q - Sp.SubC*Sp.Q; + + Xc = Sp.Xi; + SubCc = Sp.SubC; + + /* Flow reversal */ if continuous_flow_reversal then Sp.h = ThermoSysPro.Functions.SmoothCond(Sp.Q/gamma_sp, Sp.h_vol_1, Sp.h_vol_2, 1); else Sp.h = if (Sp.Q > 0) then Sp.h_vol_1 else Sp.h_vol_2; end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then rep = if Ep.diff_on_1 then exp(-0.033*(Ep.Q*Ep.diff_res_1)^2) else 0; rev = if Ev.diff_on_1 then exp(-0.033*(Ev.Q*Ev.diff_res_1)^2) else 0; rsp = if Sp.diff_on_2 then exp(-0.033*(Sp.Q*Sp.diff_res_2)^2) else 0; + gamma_ep = if Ep.diff_on_1 then 1/Ep.diff_res_1 else gamma0; gamma_ev = if Ev.diff_on_1 then 1/Ev.diff_res_1 else gamma0; gamma_sp = if Sp.diff_on_2 then 1/Sp.diff_res_2 else gamma0; + Jep = if Ep.diff_on_1 then rep*gamma_ep*(Ep.h_vol_1 - Ep.h_vol_2) else 0; Jev = if Ev.diff_on_1 then rev*gamma_ev*(Ev.h_vol_1 - Ev.h_vol_2) else 0; Jsp = if Sp.diff_on_2 then rsp*gamma_sp*(Sp.h_vol_2 - Sp.h_vol_1) else 0; @@ -257,46 +251,344 @@ equation rep = 0; rev = 0; rsp = 0; + gamma_ep = gamma0; gamma_ev = gamma0; gamma_sp = gamma0; + Jep = 0; Jev = 0; Jsp = 0; end if; + J = Jep + Jev + Jsp; + Ep.diff_res_2 = 0; Ev.diff_res_2 = 0; Sp.diff_res_1 = 0; + Ep.diff_on_2 = diffusion; Ev.diff_on_2 = diffusion; Sp.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ - proeeF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, Ee.h, mode_eeF, fluid_e); - proseF = ThermoSysPro.Properties.Fluid.Ph(Se.P, Se.h, mode_seF, fluid_e); - promeF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2, (Ee.h + Se.h)/2, mode_eeF, fluid_e); - proevC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ev.h, mode_evC, fluid); - prospC = ThermoSysPro.Properties.Fluid.Ph(Sp.P, Sp.h, mode_spC, fluid); - prosp = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Hep, mode_spC, fluid); - prodesF = ThermoSysPro.Properties.Fluid.Ph(Se.P, HDesF, mode_seF, fluid_e); - prompC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (Hep + Sp.h)/2, mode_spC, fluid); - prodesmC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, (vsatC.h + Ev.h)/2, mode_evC, fluid); - prompF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, (Ee.h + HeiF)/2, mode_eeF, fluid_e); - promcF = ThermoSysPro.Properties.Fluid.Ph((Ee.P + Se.P)/2, (HeiF + HDesF)/2, mode_mF, fluid_e); - prodesmF = ThermoSysPro.Properties.Fluid.Ph(Se.P, (HDesF + Se.h)/2, mode_seF, fluid_e); - proecF = ThermoSysPro.Properties.Fluid.Ph(Ee.P, HeiF, mode_eeF, fluid_e); - flashepC = ThermoSysPro.Properties.Fluid.Ph(Ev.P, Ep.h, mode_flash, fluid); -/* Fluid density */ - rho = promeF.d; -/* Saturation point at the vapor inlet pressure */ - (lsatC, vsatC) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ev.P, fluid); - TsatC = lsatC.T; - HsateC = lsatC.h; - HsatvC = vsatC.h; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}, initialScale = 0.01), graphics = {Ellipse(extent = {{-100, -30}, {-36, 32}}, lineColor = {0, 0, 0}, lineThickness = 0, fillColor = DynamicSelect({85, 170, 255}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Ellipse(extent = {{38, -30}, {102, 32}}, lineColor = {0, 0, 0}, lineThickness = 0, fillColor = DynamicSelect({85, 170, 255}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Rectangle(extent = {{-68, 32}, {74, -30}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({85, 170, 255}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-70, 32}, {74, 32}, {74, 32}}, color = {0, 0, 0}), Line(points = {{-70, -30}, {74, -30}, {74, -30}}, color = {0, 0, 0}, thickness = 0), Line(points = {{74, 32}, {74, -30}}, color = {0, 0, 0}, thickness = 0), Line(points = {{74, 0}, {102, 0}}, color = {0, 0, 0}, thickness = 0), Rectangle(extent = {{-58, -14}, {74, -16}}, lineColor = {0, 0, 0}, lineThickness = 0, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-58, 16}, {74, 14}}, lineColor = {0, 0, 0}, lineThickness = 0, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-78, -16}, {-44, 16}}, lineColor = {0, 0, 0}, lineThickness = 0, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-76, -14}, {-48, 14}}, lineColor = {0, 0, 0}, lineThickness = 0, fillColor = DynamicSelect({85, 170, 255}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Rectangle(extent = {{-62, 14}, {72, -14}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({85, 170, 255}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-96, -12}, {74, -12}}, color = {0, 0, 127}, pattern = LinePattern.Dash), Line(points = {{-92, -18}, {74, -18}}, color = {0, 0, 127}, pattern = LinePattern.Dash), Line(points = {{-86, -24}, {74, -24}}, color = {0, 0, 127}, pattern = LinePattern.Dash), Text(extent = {{-112, 22}, {-90, 12}}, lineColor = {0, 0, 0}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water inlet"), Text(extent = {{88, 22}, {112, 8}}, lineColor = {0, 0, 0}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water outlet"), Text(extent = {{48, 58}, {72, 44}}, lineColor = {0, 0, 0}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Steam inlet"), Text(extent = {{-72, 56}, {-50, 44}}, lineColor = {0, 0, 0}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Drain inlet"), Text(extent = {{-70, -46}, {-46, -58}}, lineColor = {0, 0, 0}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Drain outlet")}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}, initialScale = 0.01), graphics = {Line(points = {{-40, -40}, {20, -24}}, color = {0, 0, 255}, thickness = 0.5, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{-40, -20}, {-20, 0}}, color = {255, 0, 0}, thickness = 0.5), Line(points = {{-20, 0}, {20, 0}}, color = {255, 0, 0}, thickness = 0.5), Line(points = {{60, 0}, {80, 20}}, color = {255, 0, 0}, thickness = 0.5), Text(extent = {{76, 28}, {84, 20}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "1C"), Text(extent = {{56, 10}, {64, 2}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "2C"), Text(extent = {{-24, 8}, {-16, 0}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "3C"), Text(extent = {{-44, -10}, {-36, -18}}, lineColor = {255, 0, 0}, lineThickness = 0, textString = "4C"), Text(extent = {{76, -10}, {82, -16}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "1F"), Text(extent = {{58, -18}, {64, -24}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "2F"), Text(extent = {{-22, -38}, {-16, -44}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "3F"), Text(extent = {{-42, -44}, {-36, -50}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "4F"), Line(points = {{20, 0}, {60, 0}}, color = {255, 0, 0}, thickness = 0.5, arrow = {Arrow.Filled, Arrow.None}), Line(points = {{20, -24}, {80, -8}}, color = {0, 0, 255}, thickness = 0.5), Text(extent = {{-40, 8}, {-24, 2}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "Drain"), Text(extent = {{66, -18}, {82, -24}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "Deheating"), Text(extent = {{-36, -18}, {-16, -24}}, lineColor = {0, 0, 0}, lineThickness = 0, textString = "Drain cooling"), Line(points = {{-26, 4}, {-22, 0}}, color = {0, 0, 0}, thickness = 0.5, arrow = {Arrow.None, Arrow.Filled}), Line(points = {{-40, -20}, {-40, -40}}, color = {0, 0, 0}, pattern = LinePattern.Dot), Line(points = {{-20, 0}, {-20, -34}}, color = {0, 0, 0}, pattern = LinePattern.Dot), Line(points = {{60, 0}, {60, -14}}, color = {0, 0, 0}, pattern = LinePattern.Dot), Line(points = {{80, 20}, {80, -8}}, color = {0, 0, 0}, pattern = LinePattern.Dot), Text(extent = {{48, 50}, {74, 44}}, lineColor = {0, 0, 255}, textString = "Vapor inlet"), Text(extent = {{-74, 52}, {-48, 46}}, lineColor = {0, 0, 255}, textString = "Drain inlet"), Text(extent = {{-74, -16}, {-48, -22}}, lineColor = {0, 0, 255}, textString = "Drain outlet"), Text(extent = {{-114, 18}, {-88, 12}}, lineColor = {0, 0, 255}, textString = "Water inlet"), Text(extent = {{86, 18}, {112, 12}}, lineColor = {0, 0, 255}, textString = "Water outlet"), Text(extent = {{12, -10}, {34, -18}}, lineColor = {0, 0, 255}, lineThickness = 0, textString = "Condensation"), Text(extent = {{-26, -4}, {-12, -8}}, lineColor = {0, 0, 255}, lineThickness = 0, textString = "Flash")}), - Window(x = 0.05, y = 0.01, width = 0.93, height = 0.87), + + /* Fluid thermodynamic properties */ + state_eeF = Medium_e.setState_phX(p=Ee.P, h=Ee.h, X=Xe); + state_seF = Medium_e.setState_phX(p=Se.P, h=Se.h, X=Xe); + state_meF = Medium_e.setState_phX(p=(Ee.P + Se.P)/2, h=(Ee.h + Se.h)/2, X=Xe); + state_evC = Medium_c.setState_phX(p=Ev.P, h=Ev.h, X=Ev.Xi); + state_spC = Medium_c.setState_phX(p=Sp.P, h=Sp.h, X=Xc); + state_sp = Medium_c.setState_phX(p=Ev.P, h=Hep, X=Xc); + state_desF = Medium_e.setState_phX(p=Se.P, h=HDesF, X=Xe); + state_mpC = Medium_c.setState_phX(p=Ev.P, h=(Hep + Sp.h)/2, X=Xc); + state_desmC = Medium_c.setState_phX(p=Ev.P, h=(HsatvC + Ev.h)/2, X=Ev.Xi); + state_mpF = Medium_e.setState_phX(p=Ee.P, h=(Ee.h + HeiF)/2, X=Xe); + state_mcF = Medium_e.setState_phX(p=(Ee.P + Se.P)/2, h=(HeiF + HDesF)/2, X=Xe); + state_desmF = Medium_e.setState_phX(p=Se.P, h=(HDesF + Se.h)/2, X=Xe); + state_ecF = Medium_e.setState_phX(p=Ee.P, h=HeiF, X=Xe); + cp_desmC = Medium_c.specificHeatCapacityCp(state_desmC); + cp_mcF = Medium_e.specificHeatCapacityCp(state_mcF); + cp_desmF = Medium_e.specificHeatCapacityCp(state_desmF); + cp_mpC = Medium_c.specificHeatCapacityCp(state_mpC); + cp_mpF = Medium_e.specificHeatCapacityCp(state_mpF); + + T_evC = Medium_c.temperature(state_evC); + T_desF = Medium_e.temperature(state_desF); + T_sp = Medium_c.temperature(state_sp); + T_eeF = Medium_e.temperature(state_eeF); + + x_flashepC = noEvent(if (Ep.h <= HsateC) then 0 else if (Ep.h >= HsatvC) then 1 else (Ep.h - HsateC)/(HsatvC - HsateC)); + + /* Fluid density */ + rho = Medium_e.density(state_meF); + + /* Saturation point at the vapor inlet pressure */ + satC = Medium_c.setSat_p(Ev.P); + state_lsatC = Medium_c.setBubbleState(satC); + state_vsatC = Medium_c.setDewState(satC); + + TsatC = Medium_c.saturationTemperature(Ev.P); + HsateC = Medium_c.specificEnthalpy(state_lsatC); + HsatvC = Medium_c.specificEnthalpy(state_vsatC); + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}, + initialScale=0.01), graphics={ + Ellipse( + extent={{-100,-30},{-36,32}}, + lineColor={0,0,0}, + lineThickness=0, + fillColor= DynamicSelect({85,170,255}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Ellipse( + extent={{38,-30},{102,32}}, + lineColor={0,0,0}, + lineThickness=0, + fillColor= DynamicSelect({85,170,255}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-68,32},{74,-30}}, + lineColor={0,0,0}, + fillColor=DynamicSelect({85,170,255}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Line( + points={{-70,32},{74,32},{74,32}}, + color={0,0,0}), + Line( + points={{-70,-30},{74,-30},{74,-30}}, + color={0,0,0}, + thickness=0), + Line( + points={{74,32},{74,-30}}, + color={0,0,0}, + thickness=0), + Line( + points={{74,0},{102,0}}, + color={0,0,0}, + thickness=0), + Rectangle( + extent={{-58,-14},{74,-16}}, + lineColor={0,0,0}, + lineThickness=0, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-58,16},{74,14}}, + lineColor={0,0,0}, + lineThickness=0, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-78,-16},{-44,16}}, + lineColor={0,0,0}, + lineThickness=0, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-76,-14},{-48,14}}, + lineColor={0,0,0}, + lineThickness=0, + fillColor= DynamicSelect({85,170,255}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-62,14},{72,-14}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({85,170,255}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Line( + points={{-96,-12},{74,-12}}, + color={0,0,127}, + pattern=LinePattern.Dash), + Line( + points={{-92,-18},{74,-18}}, + color={0,0,127}, + pattern=LinePattern.Dash), + Line( + points={{-86,-24},{74,-24}}, + color={0,0,127}, + pattern=LinePattern.Dash), + Text( + extent={{-112,22},{-90,12}}, + lineColor={0,0,0}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water inlet"), + Text( + extent={{88,22},{112,8}}, + lineColor={0,0,0}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water outlet"), + Text( + extent={{48,58},{72,44}}, + lineColor={0,0,0}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Steam inlet"), + Text( + extent={{-72,56},{-50,44}}, + lineColor={0,0,0}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Drain inlet"), + Text( + extent={{-70,-46},{-46,-58}}, + lineColor={0,0,0}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Drain outlet")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}, + initialScale=0.01), graphics={ + Line( + points={{-40,-40},{20,-24}}, + color={0,0,255}, + thickness=0.5, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{-40,-20},{-20,0}}, + color={255,0,0}, + thickness=0.5), + Line( + points={{-20,0},{20,0}}, + color={255,0,0}, + thickness=0.5), + Line( + points={{60,0},{80,20}}, + color={255,0,0}, + thickness=0.5), + Text( + extent={{76,28},{84,20}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "1C"), + Text( + extent={{56,10},{64,2}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "2C"), + Text( + extent={{-24,8},{-16,0}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "3C"), + Text( + extent={{-44,-10},{-36,-18}}, + lineColor={255,0,0}, + lineThickness=0, + textString= + "4C"), + Text( + extent={{76,-10},{82,-16}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "1F"), + Text( + extent={{58,-18},{64,-24}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "2F"), + Text( + extent={{-22,-38},{-16,-44}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "3F"), + Text( + extent={{-42,-44},{-36,-50}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "4F"), + Line( + points={{20,0},{60,0}}, + color={255,0,0}, + thickness=0.5, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{20,-24},{80,-8}}, + color={0,0,255}, + thickness=0.5), + Text( + extent={{-40,8},{-24,2}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "Drain"), + Text( + extent={{66,-18},{82,-24}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "Deheating"), + Text( + extent={{-36,-18},{-16,-24}}, + lineColor={0,0,0}, + lineThickness=0, + textString= + "Drain cooling"), + Line( + points={{-26,4},{-22,0}}, + color={0,0,0}, + thickness=0.5, + arrow={Arrow.None,Arrow.Filled}), + Line( + points={{-40,-20},{-40,-40}}, + color={0,0,0}, + pattern=LinePattern.Dot), + Line( + points={{-20,0},{-20,-34}}, + color={0,0,0}, + pattern=LinePattern.Dot), + Line( + points={{60,0},{60,-14}}, + color={0,0,0}, + pattern=LinePattern.Dot), + Line( + points={{80,20},{80,-8}}, + color={0,0,0}, + pattern=LinePattern.Dot), + Text( + extent={{48,50},{74,44}}, + lineColor={0,0,255}, + textString= + "Vapor inlet"), + Text( + extent={{-74,52},{-48,46}}, + lineColor={0,0,255}, + textString= + "Drain inlet"), + Text( + extent={{-74,-16},{-48,-22}}, + lineColor={0,0,255}, + textString= + "Drain outlet"), + Text( + extent={{-114,18},{-88,12}}, + lineColor={0,0,255}, + textString= + "Water inlet"), + Text( + extent={{86,18},{112,12}}, + lineColor={0,0,255}, + textString= + "Water outlet"), + Text( + extent={{12,-10},{34,-18}}, + lineColor={0,0,255}, + lineThickness=0, + textString= + "Condensation"), + Text( + extent={{-26,-4},{-12,-8}}, + lineColor={0,0,255}, + lineThickness=0, + textString= + "Flash")}), + Window( + x=0.05, + y=0.01, + width=0.93, + height=0.87), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -308,4 +600,4 @@ Baligh El Hefni "), DymolaStoredErrors); -end NTUWaterHeater; \ No newline at end of file +end NTUWaterHeater; diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo index a66bcfca..19e87ac9 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo @@ -1,152 +1,243 @@ within ThermoSysPro.Fluid.HeatExchangers; - model SimpleStaticCondenser "Simple static condenser" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real Kc = 10 "Friction pressure loss coefficient for the hot side"; - parameter Real Kf = 10 "Friction pressure loss coefficient for the cold side"; - parameter Units.SI.Position z1c = 0 "Hot inlet altitude"; - parameter Units.SI.Position z2c = 0 "Hot outlet altitude"; - parameter Units.SI.Position z1f = 0 "Cold inlet altitude"; - parameter Units.SI.Position z2f = 0 "Cold outlet altitude"; - parameter Units.SI.Density p_rhoc = 0 "If > 0, fixed fluid density for the hot side"; - parameter Units.SI.Density p_rhof = 0 "If > 0, fixed fluid density for the cold side"; - parameter Units.SI.MassFlowRate gamma_diff_c = 1e-4 "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.MassFlowRate gamma_diff_f = 1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region_c = IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_cs = IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_f = IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.Power W(start = 1e6) "Power exchanged from the hot side to the cold side"; - Units.SI.Temperature Tec(start = 500) "Fluid temperature at the inlet of the hot side"; - Units.SI.Temperature Tsc(start = 400) "Fluid temperature at the outlet of the hot side"; - Units.SI.Temperature Tef(start = 350) "Fluid temperature at the inlet of the cold side"; - Units.SI.Temperature Tsf(start = 350) "Fluid temperature at the outlet of the cold side"; - ThermoSysPro.Units.SI.PressureDifference DPfc(start = 1e3) "Friction pressure loss in the hot side"; - ThermoSysPro.Units.SI.PressureDifference DPgc(start = 1e2) "Gravity pressure loss in the hot side"; - ThermoSysPro.Units.SI.PressureDifference DPc(start = 1e3) "Total pressure loss in the hot side"; - ThermoSysPro.Units.SI.PressureDifference DPff(start = 1e3) "Friction pressure loss in the cold side"; - ThermoSysPro.Units.SI.PressureDifference DPgf(start = 1e2) "Gravity pressure loss in the cold side"; - ThermoSysPro.Units.SI.PressureDifference DPf(start = 1e3) "Total pressure loss in the cold side"; - Units.SI.Density rhoc(start = 998) "Density of the fluid in the hot side"; - Units.SI.Density rhof(start = 998) "Density of the fluid in the cold side"; - Units.SI.MassFlowRate Qc(start = 100) "Hot fluid mass flow rate"; - Units.SI.MassFlowRate Qf(start = 100) "Cold fluid mass flow rate"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c = Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f = Integer(ftype_f) "Fluid number for the cold fluid"; - Interfaces.Connectors.FluidInlet Ec annotation( - Placement(transformation(extent = {{-70, -110}, {-50, -90}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ef annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sf annotation( - Placement(transformation(extent = {{90, -11}, {110, 9}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sc annotation( - Placement(transformation(extent = {{50, -110}, {70, -90}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs annotation( - Placement(transformation(extent = {{80, -100}, {100, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf annotation( - Placement(transformation(extent = {{-20, 80}, {0, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{40, 80}, {60, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promc annotation( - Placement(transformation(extent = {{0, -100}, {20, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real Kc=10 "Friction pressure loss coefficient for the hot side"; + parameter Real Kf=10 "Friction pressure loss coefficient for the cold side"; + parameter Units.SI.Position z1c=0 "Hot inlet altitude"; + parameter Units.SI.Position z2c=0 "Hot outlet altitude"; + parameter Units.SI.Position z1f=0 "Cold inlet altitude"; + parameter Units.SI.Position z2f=0 "Cold outlet altitude"; + parameter Units.SI.Density p_rhoc=0 + "If > 0, fixed fluid density for the hot side"; + parameter Units.SI.Density p_rhof=0 + "If > 0, fixed fluid density for the cold side"; + parameter Units.SI.MassFlowRate gamma_diff_c=1e-4 + "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 + "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_c = Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_cs = Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f = Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public + Units.SI.Power W(start=1e6) + "Power exchanged from the hot side to the cold side"; + Units.SI.Temperature Tec(start=500) + "Fluid temperature at the inlet of the hot side"; + Units.SI.Temperature Tsc(start=400) + "Fluid temperature at the outlet of the hot side"; + Units.SI.Temperature Tef(start=350) + "Fluid temperature at the inlet of the cold side"; + Units.SI.Temperature Tsf(start=350) + "Fluid temperature at the outlet of the cold side"; + ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3) + "Friction pressure loss in the hot side"; + ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2) + "Gravity pressure loss in the hot side"; + ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3) + "Total pressure loss in the hot side"; + ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3) + "Friction pressure loss in the cold side"; + ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2) + "Gravity pressure loss in the cold side"; + ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3) + "Total pressure loss in the cold side"; + Units.SI.Density rhoc(start=998) "Density of the fluid in the hot side"; + Units.SI.Density rhof(start=998) "Density of the fluid in the cold side"; + Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate"; + Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate"; + Medium.MassFraction Xc[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condensing side"; + Medium_Cooling.MassFraction Xf[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling side"; + Medium.ThermodynamicState state_ce "Thermodynamic state at the condensing-side inlet"; + Medium.ThermodynamicState state_cs "Thermodynamic state at the condensing-side outlet"; + Medium.ThermodynamicState state_mc "Average thermodynamic state in the condensing side"; + Medium_Cooling.ThermodynamicState state_fe "Thermodynamic state at the cooling-side inlet"; + Medium_Cooling.ThermodynamicState state_fs "Thermodynamic state at the cooling-side outlet"; + Medium_Cooling.ThermodynamicState state_mf "Average thermodynamic state in the cooling side"; + Medium.SaturationProperties sat_c "Saturation properties at the condensing-side inlet pressure"; + +public + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-70,-110},{-50,-90}}, rotation=0))); + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( + extent={{90,-11},{110,9}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{50,-110},{70,-90}}, rotation=0))); equation -/* Check that the fluid type for both sides is water/steam */ - assert((ftype_c == FluidType.WaterSteam) or (ftype_c == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the hot side"); - assert((ftype_f == FluidType.WaterSteam) or (ftype_f == FluidType.WaterSteamSimple), "SimpleStaticCondenser: the fluid type must be water/steam for the cold side"); -/* Mass flow rates */ + + /* Mass flow rates */ Ec.Q = Sc.Q; + Ec.h_vol_1 = Sc.h_vol_1; Ec.h_vol_2 = Sc.h_vol_2; + Sc.diff_on_1 = Ec.diff_on_1; Ec.diff_on_2 = Sc.diff_on_2; + Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - ftype_c = Ec.ftype; + + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; + Ef.Q = Sf.Q; + Ef.h_vol_1 = Sf.h_vol_1; Ef.h_vol_2 = Sf.h_vol_2; + Sf.diff_on_1 = Ef.diff_on_1; Ef.diff_on_2 = Sf.diff_on_2; + Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - ftype_f = Ef.ftype; + + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; + Qc = Ec.Q; Qf = Ef.Q; -/* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */ - Sc.h = lsat.h; -/* Power exchanged between the two sides */ + Xc = Ec.Xi; + Xf = Ef.Xi; + + /* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */ + Sc.h = Medium.bubbleEnthalpy(sat_c); + + /* Power exchanged between the two sides */ W = Qf*(Sf.h - Ef.h); W = Qc*(Ec.h - Sc.h); -/* Pressure losses in the hot side */ + + /* Pressure losses in the hot side */ Ec.P - Sc.P = DPc; + DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc; DPgc = rhoc*g*(z2c - z1c); - DPc = DPfc + DPgc; -/* Pressure losses in the cold side */ + DPc = DPfc + DPgc; + + /* Pressure losses in the cold side */ Ef.P - Sf.P = DPf; + DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof; DPgf = rhof*g*(z2f - z1f); - DPf = DPff + DPgf; -/* Fluid thermodynamic properties at the hot side */ - proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c); - procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_cs, fluid_c); - promc = ThermoSysPro.Properties.Fluid.Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, mode_c, fluid_c); - Tec = proce.T; - Tsc = procs.T; - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Ec.P, fluid_c); + DPf = DPff + DPgf; + + /* Fluid thermodynamic properties at the hot side */ + sat_c = Medium.setSat_p(Ec.P); + state_ce = Medium.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + state_mc = Medium.setState_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc); + + Tec = Medium.temperature(state_ce); + Tsc = Medium.temperature(state_cs); + if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = promc.d; + rhoc = Medium.density(state_mc); end if; -/* Fluid thermodynamic properties at the cold side */ - profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_f); - profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f); - promf = ThermoSysPro.Properties.Fluid.Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, mode_f, fluid_f); - Tef = profe.T; - Tsf = profs.T; + + /* Fluid thermodynamic properties at the cold side */ + state_fe = Medium_Cooling.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_Cooling.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + state_mf = Medium_Cooling.setState_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf); + + Tef = Medium_Cooling.temperature(state_fe); + Tsf = Medium_Cooling.temperature(state_fs); + if (p_rhof > 0) then rhof = p_rhof; else - rhof = promf.d; + rhof = Medium_Cooling.density(state_mf); end if; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Line(points = {{-60, -90}, {-60, 38}, {0, -8}, {60, 40}, {60, -90}}, color = {0, 0, 255}, thickness = 0), Text(extent = {{-104, -90}, {-76, -110}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Steam inlet"), Text(extent = {{-132, 28}, {-106, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold inlet"), Text(extent = {{104, 28}, {134, 12}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold outlet"), Text(extent = {{78, -90}, {106, -110}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Steam outlet")}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {255, 255, 0}), Line(points = {{-60, -90}, {-60, 38}, {0, -8}, {60, 40}, {60, -90}}, color = {0, 0, 255}, thickness = 0.5), Text(extent = {{-110, 21}, {-90, 11}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold inlet"), Text(extent = {{-46, -93}, {-26, -103}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot inlet"), Text(extent = {{28, -93}, {48, -103}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot outlet"), Text(extent = {{88, 20}, {110, 9}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold outlet")}), - Window(x = 0.05, y = 0.01, width = 0.93, height = 0.87), + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0}), + Line( + points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}}, + color={0,0,255}, + thickness=0), + Text( + extent={{-104,-90},{-76,-110}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Steam inlet"), + Text( + extent={{-132,28},{-106,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold inlet"), + Text( + extent={{104,28},{134,12}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold outlet"), + Text( + extent={{78,-90},{106,-110}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Steam outlet")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={255,255,0}), + Line( + points={{-60,-90},{-60,38},{0,-8},{60,40},{60,-90}}, + color={0,0,255}, + thickness=0.5), + Text( + extent={{-110,21},{-90,11}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString= + "Cold inlet"), + Text( + extent={{-46,-93},{-26,-103}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString= + "Hot inlet"), + Text( + extent={{28,-93},{48,-103}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString= + "Hot outlet"), + Text( + extent={{88,20},{110,9}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString= + "Cold outlet")}), + Window( + x=0.05, + y=0.01, + width=0.93, + height=0.87), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -157,4 +248,4 @@ Baligh El Hefni "), DymolaStoredErrors); -end SimpleStaticCondenser; \ No newline at end of file +end SimpleStaticCondenser; diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo index ab8ea84b..d5246afd 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo @@ -1,46 +1,58 @@ -within ThermoSysPro.Fluid.HeatExchangers; - +within ThermoSysPro.Fluid.HeatExchangers; model StaticAerocondenser "Static aerocondenser" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.CoefficientOfHeatTransfer Uref = 50 "Reference heat transfer coefficient between the air and the condenser external wall"; - parameter Real UCOR = 1. "Heat transfer corrective coefficient"; - parameter Units.SI.Area Se = 1.e4 "Condenser external wall area"; - parameter Units.SI.Height z = 0 "Water level in the condenser"; - parameter Real K = 0.02 "Pressure loss coefficient for the water/steam pipe (Pa.s²/(kg.m**3))"; - parameter Real Ka = 0.00 "Pressure loss coefficient for the air (Pa.s²/(kg.m**3))"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e = IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_s = IF97Region.All_regions "IF97 region at the outlet (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.SpecificEnthalpy he(start = 370000) "Water specific enthalpy at the outlet of the condenser"; - Units.SI.SpecificEnthalpy hae(start = 75000) "Air specific enthalpy at the inlet of the condenser"; - Units.SI.SpecificEnthalpy has(start = 100000) "Air specific enthalpy at the outlet of the condenser"; - Units.SI.MassFlowRate Q(start = 1.5e2) "Fluid mass flow rate in the water/steam pipe"; - Units.SI.MassFlowRate Qa(start = 1.4e3) "Air mass flow rate in the condenser"; - Units.SI.Temperature Tae(start = 290) "Air temperature at the inlet of the condenser"; - Units.SI.Temperature Tas(start = 360) "Air temperature at the outlet of the condenser"; - Units.SI.AbsolutePressure Pae(start = 1.e5) "Air pressure at the inlet of the condenser"; - Units.SI.AbsolutePressure Pas(start = 1.e5) "Air pressure at the outlet of the condenser"; - Units.SI.AbsolutePressure Pfond(start = 30000) "Water pressure at the bottom of the condenser"; - Units.SI.AbsolutePressure Pcond(start = 17000) "Condensation pressure (vacuum)"; - Units.SI.Temperature Tcond(start = 360) "Condensation temperature"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the air side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.CoefficientOfHeatTransfer Uref=50 + "Reference heat transfer coefficient between the air and the condenser external wall"; + parameter Real UCOR=1. "Heat transfer corrective coefficient"; + parameter Units.SI.Area Se=1.e4 "Condenser external wall area"; + parameter Units.SI.Height z=0 "Water level in the condenser"; + parameter Real K=0.02 "Pressure loss coefficient for the water/steam pipe (Pa.s2/(kg.m3))"; + parameter Real Ka=0.00 "Pressure loss coefficient for the air (Pa.s2/(kg.m3))"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + +public + Units.SI.SpecificEnthalpy he(start=370000) + "Water specific enthalpy at the outlet of the condenser"; + Units.SI.SpecificEnthalpy hae(start=75000) + "Air specific enthalpy at the inlet of the condenser"; + Units.SI.SpecificEnthalpy has(start=100000) + "Air specific enthalpy at the outlet of the condenser"; + Units.SI.MassFlowRate Q(start=1.5e2) + "Fluid mass flow rate in the water/steam pipe"; + Units.SI.MassFlowRate Qa(start=1.4e3) "Air mass flow rate in the condenser"; + Units.SI.Temperature Tae(start=290) + "Air temperature at the inlet of the condenser"; + Units.SI.Temperature Tas(start=360) + "Air temperature at the outlet of the condenser"; + Units.SI.AbsolutePressure Pae(start=1.e5) + "Air pressure at the inlet of the condenser"; + Units.SI.AbsolutePressure Pas(start=1.e5) + "Air pressure at the outlet of the condenser"; + Units.SI.AbsolutePressure Pfond(start=30000) + "Water pressure at the bottom of the condenser"; + Units.SI.AbsolutePressure Pcond(start=17000) "Condensation pressure (vacuum)"; + Units.SI.Temperature Tcond(start=360) "Condensation temperature"; ThermoSysPro.Units.SI.PressureDifference deltaP "Total air pressure loss"; - Units.SI.CoefficientOfHeatTransfer U(start = 50) "Heat transfer coefficient"; - Units.SI.SpecificHeatCapacity cp_a(start = 1000) "Air specific heat capacity at constant pressure"; - Real Nut(start = 2.) "Number of transfer units"; - Real Ef(start = 0.8) "Efficiency in two-phase flow regime"; + Units.SI.CoefficientOfHeatTransfer U(start=50) "Heat transfer coefficient"; + Units.SI.SpecificHeatCapacity cp_a(start=1000) + "Air specific heat capacity at constant pressure"; + Real Nut(start=2.) "Number of transfer units"; + Real Ef(start=0.8) "Efficiency in two-phase flow regime"; Units.SI.Power W "Heat power transfered to the cooling air"; - Units.SI.Density rho_e(start = 998) "Water density at the outlet of the condenser"; - Units.SI.Density rho_a(start = 1) "Air density"; - FluidType fluids[4] "Fluids mixing in volume"; + Units.SI.Density rho_e(start=998) + "Water density at the outlet of the condenser"; + Units.SI.Density rho_a(start=1) "Air density"; Units.SI.Power Jws1 "Thermal power diffusion from inlet Cws1"; Units.SI.Power Jw "Thermal power diffusion from inlet Cw"; Units.SI.Power Jws2 "Thermal power diffusion from outlet Cws2"; @@ -51,118 +63,117 @@ model StaticAerocondenser "Static aerocondenser" Real rws1 "Value of r(Q/gamma) for inlet Cws1"; Real rw "Value of r(Q/gamma) for inlet Cw"; Real rws2 "Value of r(Q/gamma) for outlet Cws1"; - FluidType ftype_a "Air fluid type"; - Integer fluid_a = Integer(ftype_a) "Air fluid number"; - Interfaces.Connectors.FluidInlet Cws1 annotation( - Placement(transformation(extent = {{-10, 100}, {10, 120}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation( - Placement(transformation(extent = {{-10, -120}, {10, -100}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cair1 annotation( - Placement(transformation(extent = {{100, -119}, {120, -99}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cair2 annotation( - Placement(transformation(extent = {{100, 100}, {120, 120}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cw annotation( - Placement(transformation(extent = {{-120, -100}, {-100, -80}}, rotation = 0), iconTransformation(extent = {{-120, -100}, {-100, -80}}))); - Properties.WaterSteam.Common.ThermoProperties_ph proe "Water properties" annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); - Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer fluid_w = Integer(ftype) "Water fluid number"; - parameter Integer mode_e = Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_s = Integer(region_s) - 1 "IF97 region at the outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Units.SI.MassFlowRate Qeps = 1.e-3 "Small mass flow rate for continuous flow reversal"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity"; + Medium_Air.MassFraction X_Air[Medium_Air.nXi](start=Medium_Air.X_default[1:Medium_Air.nXi]) "Air mass fractions"; + Medium.SaturationProperties sat "Saturation properties inside the condenser"; + +public + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,100},{10,120}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-120},{10,-100}}, rotation=0))); + Interfaces.Connectors.FluidInlet Cair1(redeclare package Medium = Medium_Air) annotation (Placement(transformation( + extent={{100,-119},{120,-99}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cair2(redeclare package Medium = Medium_Air) annotation (Placement(transformation( + extent={{100,100},{120,120}}, rotation=0))); +public + Interfaces.Connectors.FluidInlet Cw(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-120,-100},{-100,-80}}, rotation=0), iconTransformation( + extent={{-120,-100},{-100,-80}}))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cws1.ftype; - fluids[3] = Cw.ftype; - fluids[4] = Cws2.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticAerocondenser: fluids mixing in condenser volume are not compatible with each other"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Cw) == 0) then Cw.Q = 0; Cw.h = 1.e5; Cw.h_vol_1 = 1.e5; Cw.diff_res_1 = 0; Cw.diff_on_1 = false; - Cw.ftype = ftype; - Cw.Xco2 = 0; - Cw.Xh2o = 0; - Cw.Xo2 = 0; - Cw.Xso2 = 0; + Cw.Xi = Medium.X_default[1:Medium.nXi]; + Cw.SubC = Medium.C_default; end if; -/* Pressure at the bottom of the condenser*/ + + /* Pressure at the bottom of the condenser*/ Pfond = Pcond + rho_e*g*z; -/* Water/steam mass balance equation */ + + /* Water/steam mass balance equation */ 0 = Cws1.Q + Cw.Q - Cws2.Q; + Q = Cws2.Q; + Pcond = Cws1.P; Pcond = Cw.P; Pfond = Cws2.P; -/* Water/steam energy balance equation */ + + /* Water/steam energy balance equation */ 0 = (Cws1.h - he)*Cws1.Q + (Cw.h - he)*Cw.Q - (Cws2.h - he)*Cws2.Q - W + J; -// if noEvent(Qa > 0) then -// (has - hae)*Qa - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0; -// else -// (has - hae)*1.e-6 - ((Cws1.h - he)*Q + (Cw.h - he)*Cw.Q) = 0; -// end if; + Cws1.h_vol_2 = he; Cw.h_vol_2 = he; Cws2.h_vol_1 = he; -/* Fluid composition in the cavity (no balance equations) */ - Cws2.ftype = ftype; - Cws2.Xco2 = 0; - Cws2.Xh2o = 0; - Cws2.Xo2 = 0; - Cws2.Xso2 = 0; -/* Air inlet and outlet */ + + /* Fluid composition in the cavity (no balance equations) */ + X = Cws1.Xi; + SubC = Cws1.SubC; + Cws2.Xi = X; + Cws2.SubC = SubC; + + /* Air inlet and outlet */ Cair1.Q = Cair2.Q; + Cair1.h_vol_1 = Cair2.h_vol_1; Cair1.h_vol_2 = Cair2.h_vol_2; + Cair2.diff_on_1 = Cair1.diff_on_1; Cair1.diff_on_2 = Cair2.diff_on_2; + Cair2.diff_res_1 = Cair1.diff_res_1 + 1/gamma_diff; Cair1.diff_res_2 = Cair2.diff_res_2 + 1/gamma_diff; - Cair1.ftype = Cair2.ftype; - Cair1.Xco2 = Cair2.Xco2; - Cair1.Xh2o = Cair2.Xh2o; - Cair1.Xo2 = Cair2.Xo2; - Cair1.Xso2 = Cair2.Xso2; - ftype_a = Cair1.ftype; + + Cair1.Xi = Cair2.Xi; + Cair1.SubC = Cair2.SubC; + X_Air = Cair1.Xi; + Qa = Cair1.Q; Pae = Cair1.P; Pas = Cair2.P; hae = Cair1.h; has = Cair2.h; + deltaP = Cair1.P - Cair2.P; -/* Air pressure loss */ + + /* Air pressure loss */ deltaP = Ka*Qa*abs(Qa)/rho_a; -/* Heat power transferred to the cooling water */ + + /* Heat power transferred to the cooling water */ W = Qa*(has - hae); -/* Heat exchange coefficient */ + + /* Heat exchange coefficient */ U = UCOR*Uref*(-2.e-4*(Tae - 273.16)^2 + 0.0187*(Tae - 273.16) + 0.5007); -/* Number of transfer units */ + + /* Number of transfer units */ Nut = if noEvent(Qa*cp_a > 0) then Se*U/(Qa*cp_a) else 2.; -/* Efficiency in the two-phase flow regime */ + + /* Efficiency in the two-phase flow regime */ Ef = 1 - exp(-Nut); -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then Cws2.h = ThermoSysPro.Functions.SmoothCond(Cws2.Q/gamma_ws2, Cws2.h_vol_1, Cws2.h_vol_2, 1); else Cws2.h = if (Cws2.Q > 0) then Cws2.h_vol_1 else Cws2.h_vol_2; end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then rws1 = if Cws1.diff_on_1 then exp(-0.033*(Cws1.Q*Cws1.diff_res_1)^2) else 0; rw = if Cw.diff_on_1 then exp(-0.033*(Cw.Q*Cw.diff_res_1)^2) else 0; rws2 = if Cws2.diff_on_2 then exp(-0.033*(Cws2.Q*Cws2.diff_res_2)^2) else 0; + gamma_ws1 = if Cws1.diff_on_1 then 1/Cws1.diff_res_1 else gamma0; gamma_w = if Cw.diff_on_1 then 1/Cw.diff_res_1 else gamma0; gamma_ws2 = if Cws2.diff_on_2 then 1/Cws2.diff_res_2 else gamma0; + Jws1 = if Cws1.diff_on_1 then rws1*gamma_ws1*(Cws1.h_vol_1 - Cws1.h_vol_2) else 0; Jw = if Cw.diff_on_1 then rw*gamma_w*(Cw.h_vol_1 - Cw.h_vol_2) else 0; Jws2 = if Cws2.diff_on_2 then rws2*gamma_ws2*(Cws2.h_vol_2 - Cws2.h_vol_1) else 0; @@ -170,40 +181,293 @@ equation rws1 = 0; rw = 0; rws2 = 0; + gamma_ws1 = gamma0; gamma_w = gamma0; gamma_ws2 = gamma0; + Jws1 = 0; Jw = 0; Jws2 = 0; - end if; + end if; + J = Jws1 + Jw + Jws2; + Cws1.diff_res_2 = 0; Cw.diff_res_2 = 0; Cws2.diff_res_1 = 0; + Cws1.diff_on_2 = diffusion; Cw.diff_on_2 = diffusion; Cws2.diff_on_1 = diffusion; -/* Condensation temperature */ + + /* Condensation temperature */ Tcond = ((Tas + Tae*(Ef - 1.0))/Ef); -/* Condensation pressure */ - Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tcond, fluid_w); -/* Water/steam thermodynamic properties */ - proe = ThermoSysPro.Properties.Fluid.Ph((Pfond + Pcond)/2, he, mode_s, fluid_w); - rho_e = proe.d; -/* Water specific enthalpy at the saturation point with pressure Pcond */ - lsat = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid_w); - he = lsat.h; -/* Air thermodynamic properties */ - hae = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pae, Tae, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - has = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pas, Tas, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - rho_a = ThermoSysPro.Properties.Fluid.Density_Ph(Pae, hae, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - cp_a = ThermoSysPro.Properties.FlueGases.FlueGases_cp((Pae + Pas)/2, (Tae + Tas)/2, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); -//cp_a = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_PT((Pae + Pas)/2, (Tae + Tas)/2, fluid_a, 0, Cair1.Xco2, Cair1.Xh2o, Cair1.Xo2, Cair1.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-120, -120}, {120, 120}}, grid = {2, 2}), graphics = {Text(extent = {{86, 112}, {98, 102}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Air"), Text(extent = {{82, -106}, {94, -116}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Air"), Text(extent = {{-36, -112}, {-12, -120}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Water"), Text(extent = {{-38, 114}, {-12, 106}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Steam"), Polygon(points = {{100, -62}, {0, 100}, {0, 100}, {-100, -62}, {100, -62}}, lineColor = {28, 108, 200}, fillColor = {0, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{89, 40}, {79, 20}, {99, 20}, {89, 40}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}), Line(points = {{89, 20}, {89, 4}}, color = {0, 0, 0}, thickness = 1), Ellipse(extent = {{-20, 100}, {20, 60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {255, 0, 0}), Ellipse(extent = {{60, -39}, {100, -79}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 128, 255}), Ellipse(extent = {{-100, -39}, {-60, -79}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 128, 255}), Polygon(points = {{-28, 30}, {-36, 34}, {-16, 68}, {-8, 64}, {-28, 30}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 0, 0}), Polygon(points = {{-49, -6}, {-57, -2}, {-36, 34}, {-28, 30}, {-49, -6}}, lineColor = {255, 128, 0}, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-71, -44}, {-79, -40}, {-57, -2}, {-49, -6}, {-71, -44}}, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{38, 33}, {30, 29}, {9, 64}, {16, 69}, {38, 33}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 0, 0}), Polygon(points = {{60, -6}, {52, -10}, {30, 29}, {38, 33}, {60, -6}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 128, 0}), Polygon(points = {{80, -40}, {70, -42}, {52, -10}, {60, -6}, {80, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {0, 128, 255}), Polygon(points = {{-5, -48}, {55, -38}, {55, -58}, {-5, -48}, {-5, -48}}, lineColor = {28, 108, 200}, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{5, -48}, {-55, -58}, {-55, -38}, {5, -48}, {5, -48}}, lineColor = {28, 108, 200}, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-100, -79}, {-80, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 255, 255}), Ellipse(extent = {{80, -79}, {100, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 255, 255}), Rectangle(extent = {{-89, -79}, {90, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 255, 255}), Text(extent = {{-38, 22}, {36, -38}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {255, 255, 0}, textString = "Volume")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-120, -120}, {120, 120}}, grid = {2, 2}), graphics = {Polygon(points = {{100, -62}, {0, 100}, {0, 100}, {-100, -62}, {100, -62}}, lineColor = {0, 255, 0}, fillColor = DynamicSelect({85, 170, 255}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid, lineThickness = 0), Line(points = {{110, 20}, {110, -8}}, color = {0, 0, 0}, thickness = 0), Ellipse(extent = {{-20, 100}, {20, 60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {255, 0, 0}), Ellipse(extent = {{60, -39}, {100, -79}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 128, 255}), Ellipse(extent = {{-100, -39}, {-60, -79}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 128, 255}), Polygon(points = {{-28, 30}, {-36, 34}, {-16, 68}, {-8, 64}, {-28, 30}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 0, 0}), Polygon(points = {{-49, -6}, {-57, -2}, {-36, 34}, {-28, 30}, {-49, -6}}, lineColor = {255, 128, 0}, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-71, -44}, {-79, -40}, {-57, -2}, {-49, -6}, {-71, -44}}, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{38, 33}, {30, 29}, {9, 64}, {16, 69}, {38, 33}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 0, 0}), Polygon(points = {{60, -6}, {52, -10}, {30, 29}, {38, 33}, {60, -6}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {255, 128, 0}), Polygon(points = {{80, -40}, {70, -42}, {52, -10}, {60, -6}, {80, -40}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.VerticalCylinder, fillColor = {0, 128, 255}), Polygon(points = {{-5, -48}, {55, -38}, {55, -58}, {-5, -48}, {-5, -48}}, lineColor = {28, 108, 200}, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{5, -48}, {-55, -58}, {-55, -38}, {5, -48}, {5, -48}}, lineColor = {28, 108, 200}, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Ellipse(extent = {{80, -79}, {100, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 255, 255}), Ellipse(extent = {{-100, -79}, {-80, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 255, 255}), Rectangle(extent = {{-89, -79}, {90, -100}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {0, 255, 255}), Text(extent = {{20, 120}, {54, 100}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Steam inlet"), Text(extent = {{126, 116}, {154, 100}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Air outlet"), Text(extent = {{126, -104}, {150, -116}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Air inlet"), Line(points = {{110, -99}, {110, 104}}, color = {28, 108, 200}, thickness = 1), Polygon(points = {{110, 12}, {100, -8}, {120, -8}, {110, 12}}, lineColor = {0, 0, 0}, lineThickness = 0, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0})}), - Window(x = 0.09, y = 0.08, width = 0.76, height = 0.76), + + /* Condensation pressure */ + Pcond = Medium.saturationPressure(Tcond); + + /* Water/steam thermodynamic properties */ + rho_e = Medium.density_phX(p=(Pfond + Pcond)/2, h=he, X=X); + + /* Water specific enthalpy at the saturation point with pressure Pcond */ + sat = Medium.setSat_p(Pcond); + he = Medium.bubbleEnthalpy(sat); + + /* Air thermodynamic properties */ + Tae = Medium_Air.temperature_phX(p=Pae, h=hae, X=X_Air); + has = Medium_Air.specificEnthalpy_pTX(p=Pas, T=Tas, X=X_Air); + rho_a = Medium_Air.density_phX(p=Pae, h=hae, X=X_Air); + cp_a = Medium_Air.specificHeatCapacityCp(Medium_Air.setState_pTX(p=(Pae + Pas)/2, T=(Tae + Tas)/2, X=X_Air)); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-120,-120},{120,120}}, + grid={2,2}), graphics={ + Text( + extent={{86,112},{98,102}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Air"), + Text( + extent={{82,-106},{94,-116}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Air"), + Text( + extent={{-36,-112},{-12,-120}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Water"), + Text( + extent={{-38,114},{-12,106}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Steam"), + Polygon( + points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}}, + lineColor={28,108,200}, + fillColor={0,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{89,40},{79,20},{99,20},{89,40}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}), + Line( + points={{89,20},{89,4}}, + color={0,0,0}, + thickness=1), + Ellipse( + extent={{-20,100},{20,60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={255,0,0}), + Ellipse( + extent={{60,-39},{100,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Ellipse( + extent={{-100,-39},{-60,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}}, + lineColor={255,128,0}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}}, + lineColor={0,128,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{38,33},{30,29},{9,64},{16,69},{38,33}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,128,0}), + Polygon( + points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-100,-79},{-80,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Ellipse( + extent={{80,-79},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Rectangle( + extent={{-89,-79},{90,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Text( + extent={{-38,22},{36,-38}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={255,255,0}, + textString= + "Volume")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-120,-120},{120,120}}, + grid={2,2}), graphics={ + Polygon( + points={{100,-62},{0,100},{0,100},{-100,-62},{100,-62}}, + lineColor={0,255,0}, + fillColor= DynamicSelect({85,170,255}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid, + lineThickness=0), + Line( + points={{110,20},{110,-8}}, + color={0,0,0}, + thickness=0), + Ellipse( + extent={{-20,100},{20,60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={255,0,0}), + Ellipse( + extent={{60,-39},{100,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Ellipse( + extent={{-100,-39},{-60,-79}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-28,30},{-36,34},{-16,68},{-8,64},{-28,30}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{-49,-6},{-57,-2},{-36,34},{-28,30},{-49,-6}}, + lineColor={255,128,0}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-71,-44},{-79,-40},{-57,-2},{-49,-6},{-71,-44}}, + lineColor={0,128,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{38,33},{30,29},{9,64},{16,69},{38,33}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,0,0}), + Polygon( + points={{60,-6},{52,-10},{30,29},{38,33},{60,-6}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={255,128,0}), + Polygon( + points={{80,-40},{70,-42},{52,-10},{60,-6},{80,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.VerticalCylinder, + fillColor={0,128,255}), + Polygon( + points={{-5,-48},{55,-38},{55,-58},{-5,-48},{-5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{5,-48},{-55,-58},{-55,-38},{5,-48},{5,-48}}, + lineColor={28,108,200}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{80,-79},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Ellipse( + extent={{-100,-79},{-80,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Rectangle( + extent={{-89,-79},{90,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,255,255}), + Text( + extent={{20,120},{54,100}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Steam inlet"), + Text( + extent={{126,116},{154,100}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Air outlet"), + Text( + extent={{126,-104},{150,-116}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Air inlet"), + Line( + points={{110,-99},{110,104}}, + color={28,108,200}, + thickness=1), + Polygon( + points={{110,12},{100,-8},{120,-8},{110,12}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0})}), + Window( + x=0.09, + y=0.08, + width=0.76, + height=0.76), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -213,4 +477,4 @@ Author Baligh El Hefni ")); -end StaticAerocondenser; \ No newline at end of file +end StaticAerocondenser; diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo index 1f050e36..c9c862de 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo @@ -1,58 +1,76 @@ -within ThermoSysPro.Fluid.HeatExchangers; - +within ThermoSysPro.Fluid.HeatExchangers; model StaticCondenser "Static condenser" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Area SCO = 10000 "Heat exchange surface"; - parameter Real CPCE = 0.02 "Pressure loss coefficient for the water side (Pa.s²/(kg.m**3))"; - parameter Units.SI.Height z = 0.5 "Water level in the condenser"; - parameter Units.SI.CoefficientOfHeatTransfer KCO = 1 "Reference heat exchange coefficient"; - parameter Units.SI.MassFlowRate QC0 = 100 "Reference mass flow rate"; - parameter Units.SI.Temperature Tref = 293 "Reference temperature"; - parameter Real COPR = 1 "Reference fouling coefficient"; - parameter Real COP = 1 "Actual fouling coefficient"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_ee = IF97Region.All_regions "IF97 region at the water inlet (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_se = IF97Region.All_regions "IF97 region at the water outlet (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_ex = IF97Region.All_regions "IF97 region at the extraction point (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.MassFlowRate Qee(start = 10) "Cooling water mass flow rate at the inlet"; - Units.SI.SpecificEnthalpy Hee(start = 250000) "Cooling water specific anthalpy at the inlet"; - Units.SI.AbsolutePressure Pee(start = 1.e5) "Cooling water pressure at the inlet"; - Units.SI.MassFlowRate Qep(start = 10) "Drain mass flow rate at the inlet"; - Units.SI.SpecificEnthalpy Hep(start = 1000000) "Drain specific enthalpy at the inlet"; - Units.SI.MassFlowRate Qev(start = 10) "Vapor mass flow rate at the inlet"; - Units.SI.SpecificEnthalpy Hev(start = 2500000) "Vapor specific enthalpy at the inlet"; - Units.SI.MassFlowRate Qvt(start = 10) "Vapor mass flow rate leaving the turbine"; - Units.SI.SpecificEnthalpy Hvt(start = 2500000) "Vapor specific enthalpy leaving the turbine"; - Units.SI.MassFlowRate Qse(start = 10) "Cooling water mass flow rate at the outlet"; - Units.SI.SpecificEnthalpy Hse(start = 500000) "Cooling water specific enthalpy at the outlet"; - Units.SI.AbsolutePressure Pse(start = 1.e5) "Cooling water pressure at the outlet"; - Units.SI.MassFlowRate Qex(start = 10) "Drain mass flow rate at the outlet"; - Units.SI.SpecificEnthalpy Hex(start = 500000) "Drain specific enthalpy at the outlet"; - Units.SI.AbsolutePressure Pex(start = 1.e5) "Drain pressure at the outlet"; - Units.SI.SpecificEnthalpy Hsate(start = 200000) "Water specific enthalpy at the saturation point"; - Units.SI.AbsolutePressure Pcond(start = 17000) "Vapor pressure inside the condenser"; - Units.SI.Temperature Tsat(start = 500) "Water temperature at the saturation point"; - Units.SI.Temperature Tee(start = 300) "Cooling water temperature at the inlet"; - Units.SI.Temperature Tse(start = 400) "Cooling water temperature at the outlet"; - Units.SI.Density rho_ee(start = 900) "Cooling water density at the inlet"; - Units.SI.Density rho_ex(start = 900) "Water density at the extraction point"; - Units.SI.CoefficientOfHeatTransfer KT1(start = 50) "First reference value for the exchange coefficient"; - Units.SI.CoefficientOfHeatTransfer KT2(start = 50) "Second reference value for the exchange coefficient"; - Units.SI.CoefficientOfHeatTransfer XKCO(start = 200) "Heat transfer coefficient"; - Units.SI.SpecificEnthalpy Hml(start = 250000) "Extraction water average specific enthalpy"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Area SCO=10000 "Heat exchange surface"; + parameter Real CPCE=0.02 "Pressure loss coefficient for the water side (Pa.s²/(kg.m**3))"; + parameter Units.SI.Height z=0.5 "Water level in the condenser"; + parameter Units.SI.CoefficientOfHeatTransfer KCO=1 + "Reference heat exchange coefficient"; + parameter Units.SI.MassFlowRate QC0=100 "Reference mass flow rate"; + parameter Units.SI.Temperature Tref=293 "Reference temperature"; + parameter Real COPR=1 "Reference fouling coefficient"; + parameter Real COP=1 "Actual fouling coefficient"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public + Units.SI.MassFlowRate Qee(start=10) + "Cooling water mass flow rate at the inlet"; + Units.SI.SpecificEnthalpy Hee(start=250000) + "Cooling water specific anthalpy at the inlet"; + Units.SI.AbsolutePressure Pee(start=1.e5) + "Cooling water pressure at the inlet"; + Units.SI.MassFlowRate Qep(start=10) "Drain mass flow rate at the inlet"; + Units.SI.SpecificEnthalpy Hep(start=1000000) + "Drain specific enthalpy at the inlet"; + Units.SI.MassFlowRate Qev(start=10) "Vapor mass flow rate at the inlet"; + Units.SI.SpecificEnthalpy Hev(start=2500000) + "Vapor specific enthalpy at the inlet"; + Units.SI.MassFlowRate Qvt(start=10) + "Vapor mass flow rate leaving the turbine"; + Units.SI.SpecificEnthalpy Hvt(start=2500000) + "Vapor specific enthalpy leaving the turbine"; + Units.SI.MassFlowRate Qse(start=10) + "Cooling water mass flow rate at the outlet"; + Units.SI.SpecificEnthalpy Hse(start=500000) + "Cooling water specific enthalpy at the outlet"; + Units.SI.AbsolutePressure Pse(start=1.e5) + "Cooling water pressure at the outlet"; + Units.SI.MassFlowRate Qex(start=10) "Drain mass flow rate at the outlet"; + Units.SI.SpecificEnthalpy Hex(start=500000) + "Drain specific enthalpy at the outlet"; + Units.SI.AbsolutePressure Pex(start=1.e5) "Drain pressure at the outlet"; + Units.SI.SpecificEnthalpy Hsate(start=200000) + "Water specific enthalpy at the saturation point"; + Units.SI.AbsolutePressure Pcond(start=17000) + "Vapor pressure inside the condenser"; + Units.SI.Temperature Tsat(start=500) + "Water temperature at the saturation point"; + Units.SI.Temperature Tee(start=300) "Cooling water temperature at the inlet"; + Units.SI.Temperature Tse(start=400) "Cooling water temperature at the outlet"; + Units.SI.Density rho_ee(start=900) "Cooling water density at the inlet"; + Units.SI.Density rho_ex(start=900) "Water density at the extraction point"; + Units.SI.CoefficientOfHeatTransfer KT1(start=50) + "First reference value for the exchange coefficient"; + Units.SI.CoefficientOfHeatTransfer KT2(start=50) + "Second reference value for the exchange coefficient"; + Units.SI.CoefficientOfHeatTransfer XKCO(start=200) + "Heat transfer coefficient"; + Units.SI.SpecificEnthalpy Hml(start=250000) + "Extraction water average specific enthalpy"; Units.SI.Power W "Heat power released to the cold source"; - FluidType fluids[5] "Fluids mixing in volume"; Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt"; Units.SI.Power Jev "Thermal power diffusion from inlet Cev"; Units.SI.Power Jep "Thermal power diffusion from inlet Cep"; @@ -66,134 +84,132 @@ model StaticCondenser "Static condenser" Real rev "Value of r(Q/gamma) for inlet Cev"; Real rep "Value of r(Q/gamma) for inlet Cep"; Real rex "Value of r(Q/gamma) for outlet Cex"; - FluidType ftype_p "Cooling pipe fluid type"; - Integer fluid_p = Integer(ftype_p) "Cooling pipe fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet" annotation( - Placement(transformation(extent = {{-112, -72}, {-88, -50}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse "Cooling water outlet" annotation( - Placement(transformation(extent = {{90, -72}, {114, -50}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water" annotation( - Placement(transformation(extent = {{-12, -112}, {14, -88}}, rotation = 0), iconTransformation(extent = {{-12, -112}, {14, -88}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet" annotation( - Placement(transformation(extent = {{-13, 88}, {13, 114}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proex "Propriétés de l'eau" annotation( - Placement(transformation(extent = {{60, 80}, {80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee "Propriétés de l'eau" annotation( - Placement(transformation(extent = {{20, 80}, {40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prose "Propriétés de l'eau" annotation( - Placement(transformation(extent = {{80, -100}, {100, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1 annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1 annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet" annotation( - Placement(transformation(extent = {{-112, 8}, {-88, 30}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet" annotation( - Placement(transformation(extent = {{-112, 50}, {-88, 72}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer fluid = Integer(ftype) "Water fluid number"; - parameter Integer mode_ee = Integer(region_ee) - 1 "IF97 region at the water inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_se = Integer(region_se) - 1 "IF97 region at the water outlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_ex = Integer(region_ex) - 1 "IF97 region at the extraction point. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity"; + Medium_Cooling.MassFraction X_Cooling[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipe"; + Medium.ThermodynamicState state_ex "Thermodynamic state at the extraction point"; + Medium_Cooling.ThermodynamicState state_ee "Thermodynamic state at the cooling water inlet"; + Medium_Cooling.ThermodynamicState state_se "Thermodynamic state at the cooling water outlet"; + Medium.SaturationProperties sat "Saturation properties inside the condenser"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) "Cooling water inlet" + annotation (Placement(transformation(extent={{-112,-72},{-88,-50}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling) + "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72}, + {114,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction water" + annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation= + 0), iconTransformation(extent={{-12,-112},{14,-88}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt(redeclare package Medium = Medium) "Turbine outlet" + annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0))); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep(redeclare package Medium = Medium) "Drain inlet" + annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0))); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) "Vapor inlet" + annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation= + 0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cvt.ftype; - fluids[3] = Cev.ftype; - fluids[4] = Cep.ftype; - fluids[5] = Cex.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "StaticCondenser: fluids mixing in condenser volume are not compatible with each other"); -/* Check that the fluid type for the cooling pipe is water/steam */ - assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenser: the fluid type for the cooling pipe must be water/steam"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Cev) == 0) then Cev.Q = 0; Cev.h = 1.e5; Cev.h_vol_1 = 1.e5; Cev.diff_res_1 = 0; Cev.diff_on_1 = false; - Cev.ftype = ftype; - Cev.Xco2 = 0; - Cev.Xh2o = 0; - Cev.Xo2 = 0; - Cev.Xso2 = 0; + Cev.Xi = Medium.X_default[1:Medium.nXi]; + Cev.SubC = Medium.C_default; end if; + if (cardinality(Cep) == 0) then Cep.Q = 0; Cep.h = 1.e5; Cep.h_vol_1 = 1.e5; Cep.diff_res_1 = 0; Cep.diff_on_1 = false; - Cep.ftype = ftype; - Cep.Xco2 = 0; - Cep.Xh2o = 0; - Cep.Xo2 = 0; - Cep.Xso2 = 0; + Cep.Xi = Medium.X_default[1:Medium.nXi]; + Cep.SubC = Medium.C_default; end if; -// Water/steam cavity -//------------------- -/* Mass balance equation */ + + // Water/steam cavity + //------------------- + + /* Mass balance equation */ 0 = Cvt.Q + Cev.Q + Cep.Q - Cex.Q; + Qvt = Cvt.Q; Qev = Cev.Q; Qep = Cep.Q; Qex = Cex.Q; -/* Extraction water pressure */ + + /* Extraction water pressure */ Pex = Pcond + rho_ex*g*z; -/* Fluid pressure */ + + /* Fluid pressure */ Pcond = Cvt.P; Pcond = Cev.P; Pcond = Cep.P; Pex = Cex.P; -/* Energy balance equation */ - 0 = Cvt.Q*Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J; -// 0 = Qvt*(Hvt - Hsate) + Qev*(Hev - Hsate) + Qep*(Hep - Hsate) - W + J; -/* Extraction water average specific enthalpy */ + + /* Energy balance equation */ + 0 = Cvt.Q* Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J; + // 0 = Qvt*(Hvt - Hsate) + Qev*(Hev - Hsate) + Qep*(Hep - Hsate) - W + J; + + /* Extraction water average specific enthalpy */ Hml = Hsate; -// Hml = (Hsate + Hex)/2; + // Hml = (Hsate + Hex)/2; + Cvt.h_vol_2 = Hml; Cev.h_vol_2 = Hml; Cep.h_vol_2 = Hml; Cex.h_vol_1 = Hml; -/* Fluid specific enthalpies */ + + /* Fluid specific enthalpies */ Hvt = Cvt.h; Hev = Cev.h; Hep = Cep.h; Hex = Cex.h; -// Hex = noEvent(if (rho_ex > 0) then Hsate + ((Pex - Pcond)/rho_ex) else Hsate); -/* First reference value for the exchange coefficient */ + // Hex = noEvent(if (rho_ex > 0) then Hsate + ((Pex - Pcond)/rho_ex) else Hsate); + + /* First reference value for the exchange coefficient */ KT1 = -0.05*(Tref - 273.16)^2 + 3.3*(Tref - 273.16) + 52; -/* Second reference value for the exchange coefficient */ + + /* Second reference value for the exchange coefficient */ KT2 = -0.05*(Tee - 273.16)^2 + 3.3*(Tee - 273.16) + 52; -/* Heat exchange coefficient */ + + /* Heat exchange coefficient */ XKCO = KCO*(COP/COPR)*(KT2/KT1)*ThermoSysPro.Functions.ThermoRoot(Qee/QC0, Modelica.Constants.eps); -/* Fluid saturation temperature */ + + /* Fluid saturation temperature */ 0 = Tsat - Tse - (Tsat - Tee)*exp(XKCO*SCO*((Tee - Tse)/W)); -/* Fluid composition in the cavity (no balance equations) */ - Cex.ftype = ftype; - Cex.Xco2 = 0; - Cex.Xh2o = 0; - Cex.Xo2 = 0; - Cex.Xso2 = 0; -/* Flow reversal */ + + /* Fluid composition in the cavity (no balance equations) */ + X = Cvt.Xi; + SubC = Cvt.SubC; + Cex.Xi = X; + Cex.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1); else Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2; end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then rvt = if Cvt.diff_on_1 then exp(-0.033*(Cvt.Q*Cvt.diff_res_1)^2) else 0; rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0; rep = if Cep.diff_on_1 then exp(-0.033*(Cep.Q*Cep.diff_res_1)^2) else 0; rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0; + gamma_vt = if Cvt.diff_on_1 then 1/Cvt.diff_res_1 else gamma0; gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0; gamma_ep = if Cep.diff_on_1 then 1/Cep.diff_res_1 else gamma0; gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0; + Jvt = if Cvt.diff_on_1 then rvt*gamma_vt*(Cvt.h_vol_1 - Cvt.h_vol_2) else 0; Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0; Jep = if Cep.diff_on_1 then rep*gamma_ep*(Cep.h_vol_1 - Cep.h_vol_2) else 0; @@ -203,67 +219,230 @@ equation rev = 0; rep = 0; rex = 0; + gamma_vt = gamma0; gamma_ev = gamma0; gamma_ep = gamma0; gamma_ex = gamma0; + Jvt = 0; Jev = 0; Jep = 0; Jex = 0; - end if; + end if; + J = Jvt + Jev + Jep + Jex; + Cvt.diff_res_2 = 0; Cev.diff_res_2 = 0; Cep.diff_res_2 = 0; Cex.diff_res_1 = 0; + Cvt.diff_on_2 = diffusion; Cev.diff_on_2 = diffusion; Cep.diff_on_2 = diffusion; Cex.diff_on_1 = diffusion; -// Cooling pipe -//------------- -/* Cooling pipe inlet and outlet */ + + // Cooling pipe + //------------- + + /* Cooling pipe inlet and outlet */ Cee.Q = Cse.Q; + Cee.h_vol_1 = Cse.h_vol_1; Cee.h_vol_2 = Cse.h_vol_2; + Cse.diff_on_1 = Cee.diff_on_1; Cee.diff_on_2 = Cse.diff_on_2; + Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff; Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff; - Cee.ftype = Cse.ftype; - Cee.Xco2 = Cse.Xco2; - Cee.Xh2o = Cse.Xh2o; - Cee.Xo2 = Cse.Xo2; - Cee.Xso2 = Cse.Xso2; - ftype_p = Cee.ftype; + + Cee.Xi = Cse.Xi; + Cee.SubC = Cse.SubC; + Qee = Cee.Q; Qse = Cse.Q; + X_Cooling = Cee.Xi; + Pee = Cee.P; Pse = Cse.P; + Hee = Cee.h; Hse = Cse.h; -/* Pressure loss equation in the water pipe */ - Pse = noEvent(if (rho_ee > 0) then Pee - (CPCE*ThermoSysPro.Functions.ThermoSquare(Qee, eps)/rho_ee) else Pee); -/* Heating power released to the cooling pipe */ + + /* Pressure loss equation in the water pipe */ + Pse = noEvent(if (rho_ee > 0) then Pee - (CPCE * ThermoSysPro.Functions.ThermoSquare(Qee, eps)/ rho_ee) else Pee); + + /* Heating power released to the cooling pipe */ W = Qee*(Hse - Hee); -/* Fluid thermodynamic properties */ - proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode_ee, fluid_p); - proex = ThermoSysPro.Properties.Fluid.Ph(Pex, Hex, mode_ex, fluid); - prose = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode_se, fluid_p); - rho_ee = proee.d; - rho_ex = proex.d; - Tee = proee.T; - Tse = prose.T; -/* Vapor pressure inside the condenser */ - Pcond = ThermoSysPro.Properties.Fluid.P_sat(Tsat, fluid); -/* Fluid thermodynamic properties at the saturation point */ - (lsat1, vsat1) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid); - Hsate = lsat1.h; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{100, -82}, {100, 80}, {-100, 80}, {-100, -82}, {100, -82}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-22, 88}, {20, 70}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Turbine outlet"), Text(extent = {{-82, 24}, {-52, 16}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Drain inlet"), Text(extent = {{-24, -52}, {26, -72}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Extraction water"), Text(extent = {{38, -58}, {86, -66}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Cooling water outlet"), Text(extent = {{-86, -52}, {-32, -74}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Cooling water inlet"), Text(extent = {{-86, 66}, {-50, 54}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Vapor inlet"), Line(points = {{0, 8}, {0, -70}}, color = {0, 0, 0}, thickness = 0), Polygon(points = {{0, -90}, {-11, -70}, {11, -70}, {0, -90}}, lineColor = {0, 0, 0}, lineThickness = 0, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}), Line(points = {{-100, 8}, {100, 8}}, color = {0, 0, 255}, thickness = 0), Line(points = {{-100, -14}, {80, -14}, {80, -20}, {-90, -20}, {-90, -26}, {80, -26}, {80, -32}, {-90, -32}, {-90, -38}, {100, -38}}, color = {28, 108, 200}, thickness = 0)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{100, -86}, {100, 100}, {-100, 100}, {-100, -86}, {100, -86}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid, lineThickness = 0), Text(extent = {{20, 122}, {48, 94}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Steam inlet"), Text(extent = {{-128, -36}, {-104, -46}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water inlet"), Text(extent = {{106, -36}, {132, -52}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water outlet"), Text(extent = {{-104, 44}, {-74, 36}}, lineColor = {0, 0, 0}, lineThickness = 0, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Drain inlet"), Text(extent = {{-18, 92}, {24, 74}}, lineColor = {0, 0, 0}, lineThickness = 0, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Turbine outlet"), Line(points = {{0, 8}, {0, -66}}, color = {0, 0, 0}, thickness = 1), Line(points = {{-100, 8}, {100, 8}}, color = {0, 0, 255}, thickness = 0.5), Line(points = {{-100, -14}, {80, -14}, {80, -20}, {-90, -20}, {-90, -26}, {80, -26}, {80, -32}, {-90, -32}, {-90, -38}, {100, -38}}, color = {28, 108, 200}, thickness = 0.5), Polygon(points = {{0, -86}, {-11, -66}, {11, -66}, {0, -86}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0})}), - Window(x = 0.09, y = 0.08, width = 0.76, height = 0.76), + + /* Fluid thermodynamic properties */ + state_ee = Medium_Cooling.setState_phX(p=Pee, h=Hee, X=X_Cooling); + state_ex = Medium.setState_phX(p=Pex, h=Hex, X=X); + state_se = Medium_Cooling.setState_phX(p=Pse, h=Hse, X=X_Cooling); + + rho_ee = Medium_Cooling.density(state_ee); + rho_ex = Medium.density(state_ex); + + Tee = Medium_Cooling.temperature(state_ee); + Tse = Medium_Cooling.temperature(state_se); + + /* Vapor pressure inside the condenser */ + Pcond = Medium.saturationPressure(Tsat); + + /* Fluid thermodynamic properties at the saturation point */ + sat = Medium.setSat_p(Pcond); + + Hsate = Medium.bubbleEnthalpy(sat); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-22,88},{20,70}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Turbine outlet"), + Text( + extent={{-82,24},{-52,16}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Drain inlet"), + Text( + extent={{-24,-52},{26,-72}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Extraction water"), + Text( + extent={{38,-58},{86,-66}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Cooling water outlet"), + Text( + extent={{-86,-52},{-32,-74}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Cooling water inlet"), + Text( + extent={{-86,66},{-50,54}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Vapor inlet"), + Line( + points={{0,8},{0,-70}}, + color={0,0,0}, + thickness=0), + Polygon( + points={{0,-90},{-11,-70},{11,-70},{0,-90}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}), + Line( + points={{-100,8},{100,8}}, + color={0,0,255}, + thickness=0), + Line( + points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80, + -32},{-90,-32},{-90,-38},{100,-38}}, + color={28,108,200}, + thickness=0)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid, + lineThickness=0), + Text( + extent={{20,122},{48,94}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Steam inlet"), + Text( + extent={{-128,-36},{-104,-46}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water inlet"), + Text( + extent={{106,-36},{132,-52}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water outlet"), + Text( + extent={{-104,44},{-74,36}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Drain inlet"), + Text( + extent={{-18,92},{24,74}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Turbine outlet"), + Line( + points={{0,8},{0,-66}}, + color={0,0,0}, + thickness=1), + Line( + points={{-100,8},{100,8}}, + color={0,0,255}, + thickness=0.5), + Line( + points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80, + -32},{-90,-32},{-90,-38},{100,-38}}, + color={28,108,200}, + thickness=0.5), + Polygon( + points={{0,-86},{-11,-66},{11,-66},{0,-86}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0})}), + Window( + x=0.09, + y=0.08, + width=0.76, + height=0.76), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -274,4 +453,4 @@ Author Baligh El Hefni ")); -end StaticCondenser; \ No newline at end of file +end StaticCondenser; diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo index 4f105a77..ac85f0c7 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo @@ -1,124 +1,147 @@ within ThermoSysPro.Fluid.HeatExchangers; - model StaticCondenserHEI "HEI static condenser" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real Kf = 0 "Friction pressure loss coefficient for the cold side"; - parameter Units.SI.Position z1c = 0 "Hot inlet altitude"; - parameter Units.SI.Position z2c = 0 "Hot outlet altitude"; - parameter Units.SI.Position z1f = 0 "Cold inlet altitude"; - parameter Units.SI.Position z2f = 0 "Cold outlet altitude"; - parameter Real Ucorr = 1.00 "Corrective term for the heat transfert coefficient (U) for calibration"; - parameter Units.SI.Density p_rhoc = 0 "If > 0, fixed fluid density for the hot side"; - parameter Units.SI.Density p_rhof = 0 "If > 0, fixed fluid density for the cold side"; - parameter Integer Tube_Material1 = 1 "Material of the tubes type 1. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel - - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) - - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; - parameter Integer Tube_Material2 = 1 "Material of the tubes type 2. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel - - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) - - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; - parameter Integer Tube_Material3 = 1 "Material of the tubes type 3. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel - - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) - - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; - parameter Integer Tube_Material4 = 1 "Material of the tubes type 4. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel - - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) - - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; - parameter Integer Tube_Material5 = 1 "Material of the tubes type 5. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel - - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) - - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; - parameter Integer Tube_Material6 = 1 "Material of the tubes type 6. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel - - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) - - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; - parameter Real nb_pass = 2 "Number of water passes"; - parameter Real nb_tube1 = 12000 "Number of tubes type 1. For exemple tubes of the condensing zone"; - parameter Real nb_tube2 = 900 "Number of tubes type 2. For exemple gaz removal tubes"; - parameter Real nb_tube3 = 700 "Number of tubes type 3. For exemple impingement tubes"; - parameter Real nb_tube4 = 200 "Number of tubes type 4"; - parameter Real nb_tube5 = 200 "Number of tubes type 5"; - parameter Real nb_tube6 = 200 "Number of tubes type 6"; - parameter Units.SI.Thickness e_tube1 = 0.7e-3 "Tubes thickness type 1"; - parameter Units.SI.Thickness e_tube2 = 0.7e-3 "Tubes thickness type 2"; - parameter Units.SI.Thickness e_tube3 = 1e-3 "Tubes thickness type 3"; - parameter Units.SI.Thickness e_tube4 = 1e-3 "Tubes thickness type 4"; - parameter Units.SI.Thickness e_tube5 = 1e-3 "Tubes thickness type 5"; - parameter Units.SI.Thickness e_tube6 = 1e-3 "Tubes thickness type 6"; - parameter Units.SI.Diameter D_tube1 = 25.4e-3 "External diameter of tubes type 1"; - parameter Units.SI.Diameter D_tube2 = 25.4e-3 "External diameter of tubes type 2"; - parameter Units.SI.Diameter D_tube3 = 25.4e-3 "External diameter of tubes type 3"; - parameter Units.SI.Diameter D_tube4 = 25.4e-3 "External diameter of tubes type 4"; - parameter Units.SI.Diameter D_tube5 = 25.4e-3 "External diameter of tubes type 5"; - parameter Units.SI.Diameter D_tube6 = 25.4e-3 "External diameter of tubes type 6"; - parameter Units.SI.Length L_tube1 = 10 "Tubes length type 1"; - parameter Units.SI.Length L_tube2 = 10 "Tubes length type 2"; - parameter Units.SI.Length L_tube3 = 10 "Tubes length type 3"; - parameter Units.SI.Length L_tube4 = 10 "Tubes length type 4"; - parameter Units.SI.Length L_tube5 = 10 "Tubes length type 5"; - parameter Units.SI.Length L_tube6 = 10 "Tubes length type 6"; - parameter Real FC = 0.95 "Correction factor for cleanless"; - parameter Units.SI.Pressure Poffset = 0 "Offset applied on the pressure provided by HEI"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_c = IF97Region.All_regions "IF97 region for the hot side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_cs = IF97Region.All_regions "IF97 region at the outlet of the hot side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_f = IF97Region.All_regions "IF97 region for the cold side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real Kf=0 "Friction pressure loss coefficient for the cold side"; + parameter Units.SI.Position z1c=0 "Hot inlet altitude"; + parameter Units.SI.Position z2c=0 "Hot outlet altitude"; + parameter Units.SI.Position z1f=0 "Cold inlet altitude"; + parameter Units.SI.Position z2f=0 "Cold outlet altitude"; + parameter Real Ucorr=1.00 "Corrective term for the heat transfert coefficient (U) for calibration"; + parameter Units.SI.Density p_rhoc=0 + "If > 0, fixed fluid density for the hot side"; + parameter Units.SI.Density p_rhof=0 + "If > 0, fixed fluid density for the cold side"; + parameter Integer Tube_Material1=1 "Material of the tubes type 1. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel + - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) + - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; + parameter Integer Tube_Material2=1 "Material of the tubes type 2. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel + - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) + - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; + parameter Integer Tube_Material3=1 "Material of the tubes type 3. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel + - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) + - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; + parameter Integer Tube_Material4=1 "Material of the tubes type 4. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel + - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) + - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; + parameter Integer Tube_Material5=1 "Material of the tubes type 5. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel + - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) + - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; + parameter Integer Tube_Material6=1 "Material of the tubes type 6. 1:Cu Fe 194 - 2:Arsenical Cu - 3:Admiralty - 4:Al Brass - 5:Al Bronze - 6:Carbon Steel + - 7:Cu Ni 90-10 - 8:Cu Ni 70-30 - 9:SS (UNS S43035) - 10:Titanium Grades 1 & 2 - 11:SS (UNS S44660) + - 12:SS (UNS S44735) - 13:SS TP 304 - 14:SS TP 316/317 - 15:SS (UNS N08367)"; + parameter Real nb_pass=2 "Number of water passes"; + parameter Real nb_tube1=12000 "Number of tubes type 1. For exemple tubes of the condensing zone"; + parameter Real nb_tube2=900 "Number of tubes type 2. For exemple gaz removal tubes"; + parameter Real nb_tube3=700 "Number of tubes type 3. For exemple impingement tubes"; + parameter Real nb_tube4=200 "Number of tubes type 4"; + parameter Real nb_tube5=200 "Number of tubes type 5"; + parameter Real nb_tube6=200 "Number of tubes type 6"; + parameter Units.SI.Thickness e_tube1=0.7e-3 "Tubes thickness type 1"; + parameter Units.SI.Thickness e_tube2=0.7e-3 "Tubes thickness type 2"; + parameter Units.SI.Thickness e_tube3=1e-3 "Tubes thickness type 3"; + parameter Units.SI.Thickness e_tube4=1e-3 "Tubes thickness type 4"; + parameter Units.SI.Thickness e_tube5=1e-3 "Tubes thickness type 5"; + parameter Units.SI.Thickness e_tube6=1e-3 "Tubes thickness type 6"; + parameter Units.SI.Diameter D_tube1=25.4e-3 + "External diameter of tubes type 1"; + parameter Units.SI.Diameter D_tube2=25.4e-3 + "External diameter of tubes type 2"; + parameter Units.SI.Diameter D_tube3=25.4e-3 + "External diameter of tubes type 3"; + parameter Units.SI.Diameter D_tube4=25.4e-3 + "External diameter of tubes type 4"; + parameter Units.SI.Diameter D_tube5=25.4e-3 + "External diameter of tubes type 5"; + parameter Units.SI.Diameter D_tube6=25.4e-3 + "External diameter of tubes type 6"; + parameter Units.SI.Length L_tube1=10 "Tubes length type 1"; + parameter Units.SI.Length L_tube2=10 "Tubes length type 2"; + parameter Units.SI.Length L_tube3=10 "Tubes length type 3"; + parameter Units.SI.Length L_tube4=10 "Tubes length type 4"; + parameter Units.SI.Length L_tube5=10 "Tubes length type 5"; + parameter Units.SI.Length L_tube6=10 "Tubes length type 6"; + parameter Real FC=0.95 "Correction factor for cleanless"; + parameter Units.SI.Pressure Poffset=0 + "Offset applied on the pressure provided by HEI"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Air diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public Units.SI.Diameter D_tubes "Weight average diameter of the tubes"; Units.SI.Thickness e_tubes "Weight average thickness of the tubes"; - Units.SI.Area S_pass(start = 3) "Passage section of the cold water"; - Units.SI.Area S_ech1(start = 10000) "Heat exchange surface of tubes type 1"; - Units.SI.Area S_ech2(start = 10000) "Heat exchange surface of tubes type 2"; - Units.SI.Area S_ech3(start = 10000) "Heat exchange surface of tubes type 3"; - Units.SI.Area S_ech4(start = 10000) "Heat exchange surface of tubes type 4"; - Units.SI.Area S_ech5(start = 10000) "Heat exchange surface of tubes type 5"; - Units.SI.Area S_ech6(start = 10000) "Heat exchange surface of tubes type 6"; + Units.SI.Area S_pass(start=3) "Passage section of the cold water"; + Units.SI.Area S_ech1(start=10000) "Heat exchange surface of tubes type 1"; + Units.SI.Area S_ech2(start=10000) "Heat exchange surface of tubes type 2"; + Units.SI.Area S_ech3(start=10000) "Heat exchange surface of tubes type 3"; + Units.SI.Area S_ech4(start=10000) "Heat exchange surface of tubes type 4"; + Units.SI.Area S_ech5(start=10000) "Heat exchange surface of tubes type 5"; + Units.SI.Area S_ech6(start=10000) "Heat exchange surface of tubes type 6"; Real FM1 "Correction factor for material and gauge of tubes type 1"; Real FM2 "Correction factor for material and gauge of tubes type 2"; Real FM3 "Correction factor for material and gauge of tubes type 3"; Real FM4 "Correction factor for material and gauge of tubes type 4"; Real FM5 "Correction factor for material and gauge of tubes type 5"; Real FM6 "Correction factor for material and gauge of tubes type 6"; - Units.SI.Power W(start = 1e6) "Power exchanged from the hot side to the cold side"; - Units.SI.Temperature Tec(start = 500) "Fluid temperature at the inlet of the hot side"; - Units.SI.Temperature Tsc(start = 400) "Fluid temperature at the outlet of the hot side"; - Units.SI.Temperature Tef(start = 350) "Fluid temperature at the inlet of the cold side"; - Units.SI.Temperature Tsf(start = 350) "Fluid temperature at the outlet of the cold side"; - Units.SI.Pressure DPgc(start = 1e2) "Gravity pressure loss in the hot side"; - Units.SI.Pressure DPff(start = 1e3) "Friction pressure loss in the cold side"; - Units.SI.Pressure DPgf(start = 1e2) "Gravity pressure loss in the cold side"; - Units.SI.Pressure DPf(start = 1e3) "Total pressure loss in the cold side"; - Units.SI.Density rhof(start = 998) "Density of the fluid in the cold side"; - Units.SI.Density rho_ex(start = 950) "Water density at the extraction point"; - Units.SI.MassFlowRate Qc(start = 100) "Hot fluid mass flow rate"; - Units.SI.MassFlowRate Qf(start = 100) "Cold fluid mass flow rate"; - Units.SI.Area S_ech(start = 10000) "Heat exchange surface"; + Units.SI.Power W(start=1e6) + "Power exchanged from the hot side to the cold side"; + Units.SI.Temperature Tec(start=500) + "Fluid temperature at the inlet of the hot side"; + Units.SI.Temperature Tsc(start=400) + "Fluid temperature at the outlet of the hot side"; + Units.SI.Temperature Tef(start=350) + "Fluid temperature at the inlet of the cold side"; + Units.SI.Temperature Tsf(start=350) + "Fluid temperature at the outlet of the cold side"; + Units.SI.Pressure DPgc(start=1e2) "Gravity pressure loss in the hot side"; + Units.SI.Pressure DPff(start=1e3) "Friction pressure loss in the cold side"; + Units.SI.Pressure DPgf(start=1e2) "Gravity pressure loss in the cold side"; + Units.SI.Pressure DPf(start=1e3) "Total pressure loss in the cold side"; + Units.SI.Density rhof(start=998) "Density of the fluid in the cold side"; + Units.SI.Density rho_ex(start=950) "Water density at the extraction point"; + Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate"; + Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate"; + Units.SI.Area S_ech(start=10000) "Heat exchange surface"; Units.SI.Velocity Vf "Velocity of the cold water"; Real Fw "Correction factor for water"; - Units.SI.CoefficientOfHeatTransfer U1 "Uncorrected heat transfert coefficient"; + Units.SI.CoefficientOfHeatTransfer U1 + "Uncorrected heat transfert coefficient"; Real FM "Overall correction factor for material and gauge"; Units.SI.CoefficientOfHeatTransfer U "Heat transfert coefficient"; Units.SI.Temperature Tcut_off "Saturation temperature at pressure cut-off"; - Units.SI.Pressure Psat_att(start = 6000) "Expected HEI saturation pressure"; + Units.SI.Pressure Psat_att(start=6000) "Expected HEI saturation pressure"; Units.SI.Pressure Pcut_off "Pressure cut-off"; Units.SI.Pressure Pzero_load "Zero-load pressure "; - Units.SI.Pressure Pcond(start = 6000) "Expected corrected HEI saturation pressure"; - Units.SI.Temperature Tsat(start = 310) "Expected corrected HEI saturation temperature"; - Units.SI.Power Wcut_off(start = 5e5) "Power exchanged from the hot side to the cold side at Pcut_off"; + Units.SI.Pressure Pcond(start=6000) + "Expected corrected HEI saturation pressure"; + Units.SI.Temperature Tsat(start=310) + "Expected corrected HEI saturation temperature"; + Units.SI.Power Wcut_off(start=5e5) + "Power exchanged from the hot side to the cold side at Pcut_off"; Units.SI.Temperature TTD "Terminal Temperature Difference"; Integer HEI "Applicability of the HEI standard. 0:No - 1:Yes"; - Units.SI.Temperature Tsat_att(start = 310) "Expected HEI saturation temperature"; - Units.SI.SpecificHeatCapacity Cpmf(start = 950) "Average specific heat capacity of the cold water"; - Units.SI.SpecificEnthalpy Hmv(start = 2500000) "Fluid inlets average specific enthalpy"; - Units.SI.SpecificEnthalpy Hml(start = 100000) "Extraction water average specific enthalpy"; - Units.SI.SpecificEnthalpy Hex(start = 100000) "Drain specific enthalpy at the outlet"; - FluidType fluids[5] "Fluids mixing in volume"; + Units.SI.Temperature Tsat_att(start=310) + "Expected HEI saturation temperature"; + Units.SI.SpecificHeatCapacity Cpmf(start=950) + "Average specific heat capacity of the cold water"; + Units.SI.SpecificEnthalpy Hmv(start=2500000) + "Fluid inlets average specific enthalpy"; + Units.SI.SpecificEnthalpy Hml(start=100000) + "Extraction water average specific enthalpy"; + Units.SI.SpecificEnthalpy Hex(start=100000) + "Drain specific enthalpy at the outlet"; Units.SI.Power Jvt "Thermal power diffusion from inlet Cvt"; Units.SI.Power Jev "Thermal power diffusion from inlet Cev"; Units.SI.Power Jep "Thermal power diffusion from inlet Cep"; @@ -132,130 +155,126 @@ model StaticCondenserHEI "HEI static condenser" Real rev "Value of r(Q/gamma) for inlet Cev"; Real rep "Value of r(Q/gamma) for inlet Cep"; Real rex "Value of r(Q/gamma) for outlet Cex"; - FluidType ftype_p "Cooling pipe fluid type"; - Integer fluid_p = Integer(ftype_p) "Cooling pipe fluid number"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee "Cooling water inlet" annotation( - Placement(transformation(extent = {{-112, -72}, {-88, -50}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse "Cooling water outlet" annotation( - Placement(transformation(extent = {{90, -72}, {114, -50}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex "Extraction water" annotation( - Placement(transformation(extent = {{-12, -112}, {14, -88}}, rotation = 0), iconTransformation(extent = {{-12, -112}, {14, -88}}))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt "Turbine outlet" annotation( - Placement(transformation(extent = {{-13, 88}, {13, 114}}, rotation = 0), iconTransformation(extent = {{-13, 88}, {13, 114}}))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs "Proprietes eau" annotation( - Placement(transformation(extent = {{50, 80}, {70, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe "Proprietes eau" annotation( - Placement(transformation(extent = {{20, 80}, {40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce "Proprietes eau" annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet" annotation( - Placement(transformation(extent = {{-112, 8}, {-88, 30}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet" annotation( - Placement(transformation(extent = {{-112, 50}, {-88, 72}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs "Proprietes eau" annotation( - Placement(transformation(extent = {{80, -100}, {100, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph promf "Proprietes eau" annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer fluid = Integer(ftype) "Water fluid number"; - parameter Integer mode_c = Integer(region_c) - 1 "IF97 region for the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_cs = Integer(region_cs) - 1 "IF97 region at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f = Integer(region_f) - 1 "IF97 region for the cold side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity"; + Medium_Cooling.MassFraction X_Cooling[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipe"; + Medium.ThermodynamicState state_ce "Thermodynamic state at the condensing-side inlet average enthalpy"; + Medium.ThermodynamicState state_cs "Thermodynamic state at the extraction outlet"; + Medium_Cooling.ThermodynamicState state_fe "Thermodynamic state at the cooling water inlet"; + Medium_Cooling.ThermodynamicState state_fs "Thermodynamic state at the cooling water outlet"; + Medium_Cooling.ThermodynamicState state_mf "Average thermodynamic state of the cooling water"; + Medium.SaturationProperties sat "Saturation properties inside the condenser"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) "Cooling water inlet" + annotation (Placement(transformation(extent={{-112,-72},{-88,-50}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling) + "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72}, + {114,-50}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction water" + annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation= + 0), iconTransformation(extent={{-12,-112},{14,-88}}))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt(redeclare package Medium = Medium) "Turbine outlet" + annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0), + iconTransformation(extent={{-13,88},{13,114}}))); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep(redeclare package Medium = Medium) "Drain inlet" + annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0))); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) "Vapor inlet" + annotation (Placement(transformation(extent={{-112,50},{-88,72}}, rotation= + 0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cvt.ftype; - fluids[3] = Cev.ftype; - fluids[4] = Cep.ftype; - fluids[5] = Cex.ftype; -/* Check that the fluid type for the cooling pipe is water/steam */ - assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "StaticCondenserHEI: the fluid type for the cooling pipe must be water/steam"); -/* Unconnected connectors */ + /* Unconnected connectors */ if (cardinality(Cev) == 0) then Cev.Q = 0; Cev.h = 1.e5; Cev.h_vol_1 = 1.e5; Cev.diff_res_1 = 0; Cev.diff_on_1 = false; - Cev.ftype = ftype; - Cev.Xco2 = 0; - Cev.Xh2o = 0; - Cev.Xo2 = 0; - Cev.Xso2 = 0; + Cev.Xi = Medium.X_default[1:Medium.nXi]; + Cev.SubC = Medium.C_default; end if; + if (cardinality(Cep) == 0) then Cep.Q = 0; Cep.h = 1.e5; Cep.h_vol_1 = 1.e5; Cep.diff_res_1 = 0; Cep.diff_on_1 = false; - Cep.ftype = ftype; - Cep.Xco2 = 0; - Cep.Xh2o = 0; - Cep.Xo2 = 0; - Cep.Xso2 = 0; + Cep.Xi = Medium.X_default[1:Medium.nXi]; + Cep.SubC = Medium.C_default; end if; -// Water/steam cavity -//------------------- -/* Mixer: mass balance equation */ + + // Water/steam cavity + //------------------- + + /* Mixer: mass balance equation */ 0 = Cvt.Q + Cev.Q + Cep.Q - Cex.Q; + Qc = Cex.Q; -/* Extraction water pressure */ + + /* Extraction water pressure */ Cex.P = Pcond + rho_ex*g*(z2c - z1c); -/* Fluid pressure */ + + /* Fluid pressure */ Pcond = Cvt.P; Pcond = Cev.P; Pcond = Cep.P; -/* Energy balance equation */ - 0 = Cvt.Q*Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J; -// 0 = Cvt.Q*(Cvt.h - lsat.h) + Cev.Q*(Cev.h - lsat.h) + Cep.Q*(Cep.h - lsat.h) - W; -/* Extraction water average specific enthalpy */ - Hml = lsat.h; -// Hml = (lsat.h + Hex)/2; + + /* Energy balance equation */ + 0 = Cvt.Q* Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h - Cex.Q*Cex.h - W + J; + // 0 = Cvt.Q*(Cvt.h - lsat.h) + Cev.Q*(Cev.h - lsat.h) + Cep.Q*(Cep.h - lsat.h) - W; + + /* Extraction water average specific enthalpy */ + Hml = Medium.bubbleEnthalpy(sat); + // Hml = (lsat.h + Hex)/2; + Cvt.h_vol_2 = Hml; Cev.h_vol_2 = Hml; Cep.h_vol_2 = Hml; Cex.h_vol_1 = Hml; -/* Average specific enthalpies of the inlets */ + + /* Average specific enthalpies of the inlets */ Hmv = (Cvt.Q*Cvt.h + Cev.Q*Cev.h + Cep.Q*Cep.h)/Qc; -// Cvt.h_vol_2 = Hmv; -// Cev.h_vol_2 = Hmv; -// Cep.h_vol_2 = Hmv; -// Cex.h_vol_1 = Hex; -/* Extraction water specific enthalpy */ - Hex = noEvent(if (rho_ex > 0) then lsat.h + ((Cex.P - Pcond)/rho_ex) else lsat.h); -/* Gravity pressure losses in the hot side */ + + // Cvt.h_vol_2 = Hmv; + // Cev.h_vol_2 = Hmv; + // Cep.h_vol_2 = Hmv; + // Cex.h_vol_1 = Hex; + + /* Extraction water specific enthalpy */ + Hex = noEvent(if (rho_ex > 0) then Medium.bubbleEnthalpy(sat) + ((Cex.P - Pcond)/rho_ex) else Medium.bubbleEnthalpy(sat)); + + /* Gravity pressure losses in the hot side */ DPgc = rho_ex*g*(z2c - z1c); -/* Fluid composition in the cavity (no balance equations) */ - Cex.ftype = ftype; - Cex.Xco2 = 0; - Cex.Xh2o = 0; - Cex.Xo2 = 0; - Cex.Xso2 = 0; -/* Flow reversal */ + + /* Fluid composition in the cavity (no balance equations) */ + X = Cvt.Xi; + SubC = Cvt.SubC; + Cex.Xi = X; + Cex.SubC = SubC; + + /* Flow reversal */ if continuous_flow_reversal then Cex.h = ThermoSysPro.Functions.SmoothCond(Cex.Q/gamma_ex, Cex.h_vol_1, Cex.h_vol_2, 1); else Cex.h = if (Cex.Q > 0) then Cex.h_vol_1 else Cex.h_vol_2; end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then rvt = if Cvt.diff_on_1 then exp(-0.033*(Cvt.Q*Cvt.diff_res_1)^2) else 0; rev = if Cev.diff_on_1 then exp(-0.033*(Cev.Q*Cev.diff_res_1)^2) else 0; rep = if Cep.diff_on_1 then exp(-0.033*(Cep.Q*Cep.diff_res_1)^2) else 0; rex = if Cex.diff_on_2 then exp(-0.033*(Cex.Q*Cex.diff_res_2)^2) else 0; + gamma_vt = if Cvt.diff_on_1 then 1/Cvt.diff_res_1 else gamma0; gamma_ev = if Cev.diff_on_1 then 1/Cev.diff_res_1 else gamma0; gamma_ep = if Cep.diff_on_1 then 1/Cep.diff_res_1 else gamma0; gamma_ex = if Cex.diff_on_2 then 1/Cex.diff_res_2 else gamma0; + Jvt = if Cvt.diff_on_1 then rvt*gamma_vt*(Cvt.h_vol_1 - Cvt.h_vol_2) else 0; Jev = if Cev.diff_on_1 then rev*gamma_ev*(Cev.h_vol_1 - Cev.h_vol_2) else 0; Jep = if Cep.diff_on_1 then rep*gamma_ep*(Cep.h_vol_1 - Cep.h_vol_2) else 0; @@ -265,72 +284,92 @@ equation rev = 0; rep = 0; rex = 0; + gamma_vt = gamma0; gamma_ev = gamma0; gamma_ep = gamma0; gamma_ex = gamma0; + Jvt = 0; Jev = 0; Jep = 0; Jex = 0; - end if; + end if; + J = Jvt + Jev + Jep + Jex; + Cvt.diff_res_2 = 0; Cev.diff_res_2 = 0; Cep.diff_res_2 = 0; Cex.diff_res_1 = 0; + Cvt.diff_on_2 = diffusion; Cev.diff_on_2 = diffusion; Cep.diff_on_2 = diffusion; Cex.diff_on_1 = diffusion; -// Cooling pipe -//------------- -/* Cooling pipe inlet and outlet */ + + // Cooling pipe + //------------- + + /* Cooling pipe inlet and outlet */ Cee.Q = Cse.Q; + Cee.h_vol_1 = Cse.h_vol_1; Cee.h_vol_2 = Cse.h_vol_2; + Cse.diff_on_1 = Cee.diff_on_1; Cee.diff_on_2 = Cse.diff_on_2; + Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff; Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff; - Cee.ftype = Cse.ftype; - Cee.Xco2 = Cse.Xco2; - Cee.Xh2o = Cse.Xh2o; - Cee.Xo2 = Cse.Xo2; - Cee.Xso2 = Cse.Xso2; - ftype_p = Cee.ftype; + + Cee.Xi = Cse.Xi; + Cee.SubC = Cse.SubC; + Qf = Cee.Q; -/* Pressure losses in the cold side */ + X_Cooling = Cee.Xi; + + /* Pressure losses in the cold side */ Cee.P - Cse.P = DPf; + DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof; DPgf = rhof*g*(z2f - z1f); DPf = DPff + DPgf; -/* Power released from the hot side to the cold side */ + + /* Power released from the hot side to the cold side */ W = Qf*(Cse.h - Cee.h); -/* Fluid thermodynamic properties of the hot side */ - proce = ThermoSysPro.Properties.Fluid.Ph(Cvt.P, Hmv, mode_c, fluid); - procs = ThermoSysPro.Properties.Fluid.Ph(Cex.P, Cex.h, mode_cs, fluid); -//procs = ThermoSysPro.Properties.Fluid.Ph(Pcond + Cex.P)/2, (lsat.h + Cex.h)/2, modecs); - Tec = proce.T; - Tsc = procs.T; - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pcond, fluid); + + /* Fluid thermodynamic properties of the hot side */ + state_ce = Medium.setState_phX(p=Cvt.P, h=Hmv, X=X); + state_cs = Medium.setState_phX(p=Cex.P, h=Cex.h, X=X); + // state_cs could alternatively use an average pressure and enthalpy between saturation and extraction outlet. + + Tec = Medium.temperature(state_ce); + Tsc = Medium.temperature(state_cs); + + sat = Medium.setSat_p(Pcond); + if (p_rhoc > 0) then rho_ex = p_rhoc; else - rho_ex = procs.d; + rho_ex = Medium.density(state_cs); end if; -/* Fluid thermodynamic properties of the cold side */ - profe = ThermoSysPro.Properties.Fluid.Ph(Cee.P, Cee.h, mode_f, fluid_p); - profs = ThermoSysPro.Properties.Fluid.Ph(Cse.P, Cse.h, mode_f, fluid_p); - promf = ThermoSysPro.Properties.Fluid.Ph((Cee.P + Cse.P)/2, (Cee.h + Cse.h)/2, mode_f, fluid_p); - Tef = profe.T; - Tsf = profs.T; + + /* Fluid thermodynamic properties of the cold side */ + state_fe = Medium_Cooling.setState_phX(p=Cee.P, h=Cee.h, X=X_Cooling); + state_fs = Medium_Cooling.setState_phX(p=Cse.P, h=Cse.h, X=X_Cooling); + state_mf = Medium_Cooling.setState_phX(p=(Cee.P + Cse.P)/2, h=(Cee.h + Cse.h)/2, X=X_Cooling); + + Tef = Medium_Cooling.temperature(state_fe); + Tsf = Medium_Cooling.temperature(state_fs); + if (p_rhof > 0) then rhof = p_rhof; else - rhof = promf.d; + rhof = Medium_Cooling.density(state_mf); end if; -/* Calculation of the heat exchange surface */ + + /* Calculation of the heat exchange surface */ S_ech1 = pi*D_tube1*L_tube1*nb_tube1; S_ech2 = pi*D_tube2*L_tube2*nb_tube2; S_ech3 = pi*D_tube3*L_tube3*nb_tube3; @@ -338,19 +377,26 @@ equation S_ech5 = pi*D_tube5*L_tube5*nb_tube5; S_ech6 = pi*D_tube6*L_tube6*nb_tube6; S_ech = S_ech1 + S_ech2 + S_ech3 + S_ech4 + S_ech5 + S_ech6; -/* Calculation of the passage section of the cold water */ - S_pass = (D_tube1/2 - e_tube1)^2*pi*nb_tube1/nb_pass + (D_tube2/2 - e_tube2)^2*pi*nb_tube2/nb_pass + (D_tube3/2 - e_tube3)^2*pi*nb_tube3/nb_pass + (D_tube4/2 - e_tube4)^2*pi*nb_tube4/nb_pass + (D_tube5/2 - e_tube5)^2*pi*nb_tube5/nb_pass + (D_tube6/2 - e_tube6)^2*pi*nb_tube6/nb_pass; -/* Calculation of the velocity of the cold water */ + + /* Calculation of the passage section of the cold water */ + S_pass = (D_tube1/2 - e_tube1)^2*pi*nb_tube1/nb_pass + (D_tube2/2 - e_tube2)^2*pi*nb_tube2/nb_pass + (D_tube3/2 - e_tube3)^2*pi*nb_tube3/nb_pass + (D_tube4/2 - e_tube4)^2*pi*nb_tube4/nb_pass + (D_tube5/2 - e_tube5)^2*pi*nb_tube5/nb_pass +(D_tube6/2 - e_tube6)^2*pi*nb_tube6/nb_pass; + + /* Calculation of the velocity of the cold water */ Vf = Qf/rhof/S_pass; -/* Calculation of the correction factor for the water according to the HEI standard, 10th edition */ + + /* Calculation of the correction factor for the water according to the HEI standard, 10th edition */ Fw = -2.104072e-04*(Tef - 273.15)^2 + 1.974994e-02*(Tef - 273.15) + 6.639699e-01; -/* Calculation of the weight average diameter of the tubes */ + + /* Calculation of the weight average diameter of the tubes */ D_tubes = (D_tube1*nb_tube1 + D_tube2*nb_tube2 + D_tube3*nb_tube3 + D_tube4*nb_tube4 + D_tube5*nb_tube5 + D_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6); -/* Calculation of the uncorrected heat transfert coefficient according to the HEI standard, 10th edition */ + + /* Calculation of the uncorrected heat transfert coefficient according to the HEI standard, 10th edition */ U1 = ThermoSysPro.Correlations.Thermal.Function_U1(D_tubes, Vf); -/* Calculation of the weight average thickness of the tubes */ + + /* Calculation of the weight average thickness of the tubes */ e_tubes = (e_tube1*nb_tube1 + e_tube2*nb_tube2 + e_tube3*nb_tube3 + e_tube4*nb_tube4 + e_tube5*nb_tube5 + e_tube6*nb_tube6)/(nb_tube1 + nb_tube2 + nb_tube3 + nb_tube4 + nb_tube5 + nb_tube6); -/* Calculation of the correction factor for material and gauge according to the HEI standard, 10th edition */ + + /* Calculation of the correction factor for material and gauge according to the HEI standard, 10th edition */ FM1 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube1, Tube_Material1); FM2 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube2, Tube_Material2); FM3 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube3, Tube_Material3); @@ -358,49 +404,179 @@ equation FM5 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube5, Tube_Material5); FM6 = ThermoSysPro.Correlations.Misc.Function_FM(e_tube6, Tube_Material6); FM = (FM1*S_ech1 + FM2*S_ech2 + FM3*S_ech3 + FM4*S_ech4 + FM5*S_ech5 + FM6*S_ech6)/S_ech; -/* Calculation of the heat transfert coefficient according to the HEI standard, 10th edition */ + + /* Calculation of the heat transfert coefficient according to the HEI standard, 10th edition */ U = Ucorr*U1*FM*FC*Fw; -/* Calculation of the average specific heat capacity of the cold water */ - Cpmf = promf.cp; -/* Calculation of the expected HEI saturation temperature */ + + /* Calculation of the average specific heat capacity of the cold water */ + Cpmf = Medium_Cooling.specificHeatCapacityCp(state_mf); + + /* Calculation of the expected HEI saturation temperature */ Tsat_att = Tef + (W/(Qf*Cpmf))*(1/(1 - Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf)))); -/* Calculation of expected HEI saturation pressure */ - Psat_att = ThermoSysPro.Properties.Fluid.P_sat(Tsat_att, fluid); -/* Calculation of the HEI pressure cut-off */ - Pcut_off = (5.752433E-04*(Tef - 273.15)^3 + 1.735162E-02*(Tef - 273.15)^2 + 8.052739E-02*(Tef - 273.15) + 2.109159E+01)*100; -/* Calculation of the HEI saturation temperature at pressure cut-off */ - Tcut_off = ThermoSysPro.Properties.Fluid.T_sat(Pcut_off, fluid); -/* Calculation of HEI zero-load pressure */ + + /* Calculation of expected HEI saturation pressure */ + Psat_att = Medium.saturationPressure(Tsat_att); + + /* Calculation of the HEI pressure cut-off */ + Pcut_off = (5.752433E-04*(Tef-273.15)^3 + 1.735162E-02*(Tef-273.15)^2 + 8.052739E-02*(Tef-273.15) + 2.109159E+01)*100; + + /* Calculation of the HEI saturation temperature at pressure cut-off */ + Tcut_off = Medium.saturationTemperature(Pcut_off); + + /* Calculation of HEI zero-load pressure */ Pzero_load = (5.008000E-04*(Tef - 273.15)^3 + 2.039549E-02*(Tef - 273.15)^2 + 2.277566E-01*(Tef - 273.15) + 1.027824E+01)*100; -/* Calculation of power exchanged from the hot side to the cold side at Pcut_off */ - Tcut_off = Tef + (Wcut_off/(Qf*Cpmf))*(1/(1 - Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf)))); -/* Calculation of the expected HEI corrected saturation pressure*/ + + /* Calculation of power exchanged from the hot side to the cold side at Pcut_off */ + Tcut_off = Tef + (Wcut_off/(Qf*Cpmf))*(1/(1-Modelica.Math.exp(-(U*S_ech)/(Qf*Cpmf)))); + + /* Calculation of the expected HEI corrected saturation pressure*/ if (Psat_att < Pcut_off) then Pcond = (Pcut_off - Pzero_load)/Wcut_off*W + Pzero_load + Poffset; else Pcond = Psat_att + Poffset; end if; -/* Calculation of the expected HEI corrected saturation pressure */ - Tsat = ThermoSysPro.Properties.Fluid.T_sat(Pcond, fluid); -/* Calculation of the Terminal Temperature Difference */ + + /* Calculation of the expected HEI corrected saturation pressure */ + Tsat = Medium.saturationTemperature(Pcond); + + /* Calculation of the Terminal Temperature Difference */ TTD = Tsat - Tsf; -/* The standards HEI are not applicable if the terminal temperature difference is less than 2,78 K */ + + /* The standards HEI are not applicable if the terminal temperature difference is less than 2,78 K */ if (TTD > 2.78) then HEI = 1; else HEI = 0; end if; - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{100, -82}, {100, 80}, {-100, 80}, {-100, -82}, {100, -82}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-22, 88}, {20, 70}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Turbine outlet"), Text(extent = {{-82, 24}, {-52, 16}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Drain inlet"), Text(extent = {{-24, -52}, {26, -72}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Extraction water"), Text(extent = {{38, -58}, {86, -66}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Cooling water outlet"), Text(extent = {{-86, -52}, {-32, -74}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Cooling water inlet"), Text(extent = {{-86, 66}, {-50, 54}}, lineColor = {0, 0, 0}, lineThickness = 1, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Vapor inlet"), Line(points = {{0, 8}, {0, -70}}, color = {0, 0, 0}, thickness = 1), Polygon(points = {{0, -90}, {-11, -70}, {11, -70}, {0, -90}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}), Line(points = {{-100, 8}, {100, 8}}, color = {0, 0, 255}, thickness = 0.5), Line(points = {{-100, -14}, {80, -14}, {80, -20}, {-90, -20}, {-90, -26}, {80, -26}, {80, -32}, {-90, -32}, {-90, -38}, {100, -38}}, color = {28, 108, 200}, thickness = 0.5), Text(extent = {{-80, 60}, {72, 12}}, lineColor = {28, 108, 200}, textString = "HEI")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Polygon(points = {{100, -86}, {100, 100}, {-100, 100}, {-100, -86}, {100, -86}}, lineColor = {0, 0, 0}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid, lineThickness = 0), Line(points = {{-100, -14}, {80, -14}, {80, -20}, {-90, -20}, {-90, -26}, {80, -26}, {80, -32}, {-90, -32}, {-90, -38}, {100, -38}}, color = {28, 108, 200}, thickness = 0.5), Polygon(points = {{0, -86}, {-11, -66}, {11, -66}, {0, -86}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}), Line(points = {{0, 8}, {0, -66}}, color = {0, 0, 0}, thickness = 1), Line(points = {{-100, 8}, {100, 8}}, color = {0, 0, 255}, thickness = 0.5), Text(extent = {{-78, 74}, {74, 26}}, lineColor = {28, 108, 200}, textString = "HEI")}), - Window(x = 0.09, y = 0.08, width = 0.76, height = 0.76), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{100,-82},{100,80},{-100,80},{-100,-82},{100,-82}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-22,88},{20,70}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Turbine outlet"), + Text( + extent={{-82,24},{-52,16}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Drain inlet"), + Text( + extent={{-24,-52},{26,-72}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Extraction water"), + Text( + extent={{38,-58},{86,-66}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Cooling water outlet"), + Text( + extent={{-86,-52},{-32,-74}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Cooling water inlet"), + Text( + extent={{-86,66},{-50,54}}, + lineColor={0,0,0}, + lineThickness=1, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Vapor inlet"), + Line( + points={{0,8},{0,-70}}, + color={0,0,0}, + thickness=1), + Polygon( + points={{0,-90},{-11,-70},{11,-70},{0,-90}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}), + Line( + points={{-100,8},{100,8}}, + color={0,0,255}, + thickness=0.5), + Line( + points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80, + -32},{-90,-32},{-90,-38},{100,-38}}, + color={28,108,200}, + thickness=0.5), + Text( + extent={{-80,60},{72,12}}, + lineColor={28,108,200}, + textString="HEI")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Polygon( + points={{100,-86},{100,100},{-100,100},{-100,-86},{100,-86}}, + lineColor={0,0,0}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid, + lineThickness=0), + Line( + points={{-100,-14},{80,-14},{80,-20},{-90,-20},{-90,-26},{80,-26},{80, + -32},{-90,-32},{-90,-38},{100,-38}}, + color={28,108,200}, + thickness=0.5), + Polygon( + points={{0,-86},{-11,-66},{11,-66},{0,-86}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}), + Line( + points={{0,8},{0,-66}}, + color={0,0,0}, + thickness=1), + Line( + points={{-100,8},{100,8}}, + color={0,0,255}, + thickness=0.5), + Text( + extent={{-78,74},{74,26}}, + lineColor={28,108,200}, + textString="HEI")}), + Window( + x=0.09, + y=0.08, + width=0.76, + height=0.76), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 ", revisions = " -Author +Author -Baligh El Hefni +Baligh El Hefni ")); -end StaticCondenserHEI; \ No newline at end of file +end StaticCondenserHEI; diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo index 9a8bde44..2b4c4417 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo @@ -1,150 +1,390 @@ within ThermoSysPro.Fluid.HeatExchangers; - model StaticExchangerDTorWorEff "Static heat exchanger with fixed delta temperature, delta power or efficiency" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Integer exchanger_type = 1 "Exchanger type - 1: delta temperature is fixed - 2: delta power is fixed - 3: efficiency is fixed"; - parameter ThermoSysPro.Units.SI.TemperatureDifference DTfroid = 0 "Temperature difference between the cold inlet and the cold outlet (active if exchanger_type=1)"; - parameter Units.SI.Power DW = 0 "Power increase on the cold side (active if exchanger_type=2)"; - parameter Real EffEch = 0.9 "Thermal exchange efficiency (=W/Wmax) (active if exchanger_type=3)"; - parameter Real Kc = 1e-4 "Pressure loss coefficient for the hot fluid"; - parameter Real Kf = 1e-4 "Pressure loss coefficient for the cold fluid"; - parameter Units.SI.Position z1c = 0 "Hot inlet altitude"; - parameter Units.SI.Position z2c = 0 "Hot outlet altitude"; - parameter Units.SI.Position z1f = 0 "Cold inlet altitude"; - parameter Units.SI.Position z2f = 0 "Cold outlet altitude"; - parameter Units.SI.MassFlowRate gamma_diff_c = 1e-4 "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.MassFlowRate gamma_diff_f = 1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rhoc = 0 "If > 0, fixed fluid density for the hot fluid"; - parameter Units.SI.Density p_rhof = 0 "If > 0, fixed fluid density for the cold fluid"; - parameter IF97Region region_c = IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_cs = IF97Region.All_regions "IF97 region of the water at the outlet of the hot side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_f = IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.Power W(start = 1e6) "Power exchanged from the hot fluid to the cold fluid"; - Units.SI.Temperature Tec(start = 500) "Fluid temperature at the inlet of the hot side"; - Units.SI.Temperature Tsc(start = 400) "Fluid temperature at the outlet of the hot side"; - Units.SI.Temperature Tef(start = 350) "Fluid temperature at the inlet of the cold side"; - Units.SI.Temperature Tsf(start = 450) "Fluid temperature at the outlet of the cold side"; - ThermoSysPro.Units.SI.PressureDifference DPfc(start = 1e3) "Friction pressure loss for the hot fluid"; - ThermoSysPro.Units.SI.PressureDifference DPgc(start = 1e2) "Gravity pressure loss for the hot fluid"; - ThermoSysPro.Units.SI.PressureDifference DPc(start = 1e3) "Total pressure loss for the hot fluid"; - ThermoSysPro.Units.SI.PressureDifference DPff(start = 1e3) "Friction pressure loss for the cold fluid"; - ThermoSysPro.Units.SI.PressureDifference DPgf(start = 1e2) "Gravity pressure loss for the cold fluid"; - ThermoSysPro.Units.SI.PressureDifference DPf(start = 1e3) "Total pressure loss for the cold fluid"; - Units.SI.Density rhoc(start = 998) "Hot fluid density"; - Units.SI.Density rhof(start = 998) "Cold fluid density"; + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Integer exchanger_type=1 "Exchanger type - 1: delta temperature is fixed - 2: delta power is fixed - 3: efficiency is fixed"; + parameter ThermoSysPro.Units.SI.TemperatureDifference DTfroid=0 + "Temperature difference between the cold inlet and the cold outlet (active if exchanger_type=1)"; + parameter Units.SI.Power DW=0 + "Power increase on the cold side (active if exchanger_type=2)"; + parameter Real EffEch=0.9 "Thermal exchange efficiency (=W/Wmax) (active if exchanger_type=3)"; + parameter Real Kc=1e-4 "Pressure loss coefficient for the hot fluid"; + parameter Real Kf=1e-4 "Pressure loss coefficient for the cold fluid"; + parameter Units.SI.Position z1c=0 "Hot inlet altitude"; + parameter Units.SI.Position z2c=0 "Hot outlet altitude"; + parameter Units.SI.Position z1f=0 "Cold inlet altitude"; + parameter Units.SI.Position z2f=0 "Cold outlet altitude"; + parameter Units.SI.MassFlowRate gamma_diff_c=1e-4 + "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 + "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rhoc=0 + "If > 0, fixed fluid density for the hot fluid"; + parameter Units.SI.Density p_rhof=0 + "If > 0, fixed fluid density for the cold fluid"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public + Units.SI.Power W(start=1e6) + "Power exchanged from the hot fluid to the cold fluid"; + Units.SI.Temperature Tec(start=500) + "Fluid temperature at the inlet of the hot side"; + Units.SI.Temperature Tsc(start=400) + "Fluid temperature at the outlet of the hot side"; + Units.SI.Temperature Tef(start=350) + "Fluid temperature at the inlet of the cold side"; + Units.SI.Temperature Tsf(start=450) + "Fluid temperature at the outlet of the cold side"; + ThermoSysPro.Units.SI.PressureDifference DPfc(start=1e3) + "Friction pressure loss for the hot fluid"; + ThermoSysPro.Units.SI.PressureDifference DPgc(start=1e2) + "Gravity pressure loss for the hot fluid"; + ThermoSysPro.Units.SI.PressureDifference DPc(start=1e3) + "Total pressure loss for the hot fluid"; + ThermoSysPro.Units.SI.PressureDifference DPff(start=1e3) + "Friction pressure loss for the cold fluid"; + ThermoSysPro.Units.SI.PressureDifference DPgf(start=1e2) + "Gravity pressure loss for the cold fluid"; + ThermoSysPro.Units.SI.PressureDifference DPf(start=1e3) + "Total pressure loss for the cold fluid"; + Units.SI.Density rhoc(start=998) "Hot fluid density"; + Units.SI.Density rhof(start=998) "Cold fluid density"; Units.SI.SpecificHeatCapacity Cpf "Specific heat capacity of the cold fluid"; Units.SI.SpecificHeatCapacity Cpc "Specific heat capacity of the hot fluid"; - Units.SI.MassFlowRate Qc(start = 100) "Hot fluid mass flow rate"; - Units.SI.MassFlowRate Qf(start = 100) "Cold fluid mass flow rate"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c = Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f = Integer(ftype_f) "Fluid number for the cold fluid"; - Interfaces.Connectors.FluidInlet Ec "Hot inlet" annotation( - Placement(transformation(extent = {{-50, 31}, {-30, 51}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ef "Cold inlet" annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sf "Cold outlet" annotation( - Placement(transformation(extent = {{90, -9}, {110, 11}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sc "Hot outlet" annotation( - Placement(transformation(extent = {{30, 31}, {50, 51}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_c = Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_cs = Integer(region_cs) - 1 "IF97 region of the water at the outlet of the hot side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f = Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate"; + Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_c.ThermodynamicState state_cm "Average thermodynamic state of the hot fluid"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; + Medium_f.ThermodynamicState state_fm "Average thermodynamic state of the cold fluid"; + +public + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) "Hot inlet" annotation (Placement( + transformation(extent={{-50,31},{-30,51}}, rotation=0))); + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) "Cold inlet" annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) "Cold outlet" annotation (Placement( + transformation(extent={{90,-9},{110,11}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) "Hot outlet" annotation (Placement( + transformation(extent={{30,31},{50,51}}, rotation=0))); equation -/* Mass flow rates */ + + /* Mass flow rates */ Ec.Q = Sc.Q; + Ec.h_vol_1 = Sc.h_vol_1; Ec.h_vol_2 = Sc.h_vol_2; + Sc.diff_on_1 = Ec.diff_on_1; Ec.diff_on_2 = Sc.diff_on_2; + Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - ftype_c = Ec.ftype; + + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; + Ef.Q = Sf.Q; + Ef.h_vol_1 = Sf.h_vol_1; Ef.h_vol_2 = Sf.h_vol_2; + Sf.diff_on_1 = Ef.diff_on_1; Ef.diff_on_2 = Sf.diff_on_2; + Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - ftype_f = Ef.ftype; + + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; + Qc = Ec.Q; Qf = Ef.Q; -/* Power exchanged between the hot and cold fluids */ + Xc = Ec.Xi; + Xf = Ef.Xi; + + /* Power exchanged between the hot and cold fluids */ if (exchanger_type == 1) then W = Qf*(Sf.h - Ef.h); W = Qc*(Ec.h - Sc.h); - Sf.h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Sf.P, Tsf, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + Sf.h = Medium_f.specificEnthalpy_pTX(p=Sf.P, T=Tsf, X=Xf); Tsf = Tef + DTfroid; elseif (exchanger_type == 2) then W = Qf*(Sf.h - Ef.h); DW = Qf*(Sf.h - Ef.h); DW = Qc*(Ec.h - Sc.h); - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + Tsf = Medium_f.temperature(state_fs); elseif (exchanger_type == 3) then W = noEvent(min(Qc*Cpc, Qf*Cpf)*EffEch*(Tec - Tef)); Sf.h = Ef.h + W/Qf; Sc.h = Ec.h - W/Qc; - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + Tsf = Medium_f.temperature(state_fs); else assert(false, "StaticWaterWaterExchangerDTorWorEff: invalid option"); end if; -/* Pressure losses for the hot fluid */ + + /* Pressure losses for the hot fluid */ Ec.P - Sc.P = DPc; + DPfc = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc; DPgc = rhoc*g*(z2c - z1c); - DPc = DPfc + DPgc; -/* Pressure losses for the cold fluid */ + DPc = DPfc + DPgc; + + /* Pressure losses for the cold fluid */ Ef.P - Sf.P = DPf; + DPff = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof; DPgf = rhof*g*(z2f - z1f); - DPf = DPff + DPgf; -/* Hot fluid Temperature at the inlet and at the outlet */ - Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); - Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_cs, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); -/* Hot fluid density */ + DPf = DPff + DPgf; + + /* Hot fluid Temperature at the inlet and at the outlet */ + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + state_cm = Medium_c.setState_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc); + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); + + /* Hot fluid density */ if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + rhoc = Medium_c.density(state_cm); end if; -/* Cold fluid Temperature at the inlet */ - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); -/* Cold fluid density */ + + /* Cold fluid Temperature at the inlet */ + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + state_fm = Medium_f.setState_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf); + Tef = Medium_f.temperature(state_fe); + + /* Cold fluid density */ if (p_rhof > 0) then rhof = p_rhof; else - rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + rhof = Medium_f.density(state_fm); end if; -/* Average specific heat capacities */ - Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, mode_f, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); - Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, mode_c, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Ellipse(extent = {{36, -31}, {100, 31}}, lineColor = {0, 0, 0}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-102, -31}, {-38, 31}}, lineColor = {0, 0, 0}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-68, 31}, {72, -31}}, lineColor = {255, 255, 0}, fillColor = DynamicSelect({255, 255, 0}, fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-72, 31}, {72, 31}, {72, 31}}, color = {0, 0, 0}), Line(points = {{-72, -31}, {72, -31}, {72, -31}}, color = {0, 0, 0}), Line(points = {{68, -17}, {100, -1}}, color = {0, 255, 255}, thickness = 0), Rectangle(extent = {{-64, 2}, {68, 2}}, lineColor = {0, 255, 255}, lineThickness = 0, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-96, 5}, {-64, 21}}, color = {0, 255, 255}, thickness = 0), Line(points = {{-66, -17}, {-66, -7}}, color = {0, 255, 255}, thickness = 0), Line(points = {{-66, -8}, {-66, 2}}, color = {0, 255, 255}, thickness = 0), Line(points = {{70, 11}, {70, 21}}, color = {0, 255, 255}, thickness = 0), Line(points = {{70, 2}, {70, 12}}, color = {0, 255, 255}, thickness = 0), Line(points = {{0, 31}, {0, -23}}, color = {0, 0, 0}, thickness = 0), Rectangle(extent = {{-64, 21}, {68, 21}}, lineColor = {0, 255, 255}, lineThickness = 0, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-64, -17}, {68, -17}}, lineColor = {0, 255, 255}, lineThickness = 0, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{0, 31}, {0, -23}}, color = {0, 0, 0}, thickness = 0), Text(extent = {{-126, 26}, {-96, 18}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold inlet"), Text(extent = {{94, 30}, {124, 16}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold outlet"), Text(extent = {{-88, 56}, {-60, 44}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot inlet"), Text(extent = {{56, 56}, {88, 44}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot outlet")}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Text(extent = {{-108, 28}, {-92, 22}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "E_Froid"), Text(extent = {{96, 28}, {112, 22}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "S_Froid"), Ellipse(extent = {{38, -31}, {102, 31}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-102, -31}, {-38, 31}}, lineColor = {0, 0, 0}, lineThickness = 0.5, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-70, 31}, {70, -31}}, lineColor = {255, 255, 0}, lineThickness = 0.5, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Line(points = {{-72, 31}, {72, 31}, {72, 31}}, color = {0, 0, 0}, thickness = 0.5), Line(points = {{-72, -31}, {72, -31}, {72, -31}}, color = {0, 0, 0}, thickness = 0.5), Line(points = {{68, -17}, {100, -1}}, color = {0, 255, 255}, thickness = 1), Rectangle(extent = {{-64, -15}, {68, -17}}, lineColor = {0, 255, 255}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-64, 2}, {68, 0}}, lineColor = {0, 255, 255}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-64, 21}, {68, 19}}, lineColor = {0, 255, 255}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-64, -7}, {68, -9}}, lineColor = {0, 255, 255}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-96, 5}, {-64, 21}}, color = {0, 255, 255}, thickness = 1), Rectangle(extent = {{-64, 11}, {68, 9}}, lineColor = {0, 255, 255}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-64, -17}, {-64, -7}}, color = {0, 255, 255}, thickness = 1), Line(points = {{68, -9}, {68, 1}}, color = {0, 255, 255}, thickness = 1), Line(points = {{68, 10}, {68, 20}}, color = {0, 255, 255}, thickness = 1), Line(points = {{-64, 1}, {-64, 11}}, color = {0, 255, 255}, thickness = 1), Line(points = {{0, 31}, {0, -23}}, color = {0, 0, 0}, thickness = 0.5)}), - Window(x = 0.05, y = 0.01, width = 0.93, height = 0.87), + + /* Average specific heat capacities */ + Cpf = Medium_f.specificHeatCapacityCp(state_fe); + Cpc = Medium_c.specificHeatCapacityCp(state_ce); + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Ellipse( + extent={{36,-31},{100,31}}, + lineColor={0,0,0}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-102,-31},{-38,31}}, + lineColor={0,0,0}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-68,31},{72,-31}}, + lineColor={255,255,0}, + fillColor= DynamicSelect({255,255,0}, fill_color_static), + fillPattern=FillPattern.Solid), + Line( + points={{-72,31},{72,31},{72,31}}, + color={0,0,0}), + Line( + points={{-72,-31},{72,-31},{72,-31}}, + color={0,0,0}), + Line( + points={{68,-17},{100,-1}}, + color={0,255,255}, + thickness=0), + Rectangle( + extent={{-64,2},{68,2}}, + lineColor={0,255,255}, + lineThickness=0, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-96,5},{-64,21}}, + color={0,255,255}, + thickness=0), + Line( + points={{-66,-17},{-66,-7}}, + color={0,255,255}, + thickness=0), + Line( + points={{-66,-8},{-66,2}}, + color={0,255,255}, + thickness=0), + Line( + points={{70,11},{70,21}}, + color={0,255,255}, + thickness=0), + Line( + points={{70,2},{70,12}}, + color={0,255,255}, + thickness=0), + Line( + points={{0,31},{0,-23}}, + color={0,0,0}, + thickness=0), + Rectangle( + extent={{-64,21},{68,21}}, + lineColor={0,255,255}, + lineThickness=0, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-64,-17},{68,-17}}, + lineColor={0,255,255}, + lineThickness=0, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{0,31},{0,-23}}, + color={0,0,0}, + thickness=0), + Text( + extent={{-126,26},{-96,18}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold inlet"), + Text( + extent={{94,30},{124,16}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold outlet"), + Text( + extent={{-88,56},{-60,44}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot inlet"), + Text( + extent={{56,56},{88,44}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot outlet")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Text( + extent={{-108,28},{-92,22}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString= + "E_Froid"), + Text( + extent={{96,28},{112,22}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString= + "S_Froid"), + Ellipse( + extent={{38,-31},{102,31}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-102,-31},{-38,31}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-70,31},{70,-31}}, + lineColor={255,255,0}, + lineThickness=0.5, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Line( + points={{-72,31},{72,31},{72,31}}, + color={0,0,0}, + thickness=0.5), + Line( + points={{-72,-31},{72,-31},{72,-31}}, + color={0,0,0}, + thickness=0.5), + Line( + points={{68,-17},{100,-1}}, + color={0,255,255}, + thickness=1), + Rectangle( + extent={{-64,-15},{68,-17}}, + lineColor={0,255,255}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-64,2},{68,0}}, + lineColor={0,255,255}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-64,21},{68,19}}, + lineColor={0,255,255}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-64,-7},{68,-9}}, + lineColor={0,255,255}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-96,5},{-64,21}}, + color={0,255,255}, + thickness=1), + Rectangle( + extent={{-64,11},{68,9}}, + lineColor={0,255,255}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-64,-17},{-64,-7}}, + color={0,255,255}, + thickness=1), + Line( + points={{68,-9},{68,1}}, + color={0,255,255}, + thickness=1), + Line( + points={{68,10},{68,20}}, + color={0,255,255}, + thickness=1), + Line( + points={{-64,1},{-64,11}}, + color={0,255,255}, + thickness=1), + Line( + points={{0,31},{0,-23}}, + color={0,0,0}, + thickness=0.5)}), + Window( + x=0.05, + y=0.01, + width=0.93, + height=0.87), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -155,4 +395,4 @@ Baligh El Hefni "), DymolaStoredErrors); -end StaticExchangerDTorWorEff; \ No newline at end of file +end StaticExchangerDTorWorEff; diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo index e73dd292..8ee3569d 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo @@ -1,140 +1,244 @@ within ThermoSysPro.Fluid.HeatExchangers; - model StaticExchangerKS "Static heat exchanger with fixed K and S (Coefficient of heat transfer and Heat exchanger surface)" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.CoefficientOfHeatTransfer K = 100 "Global heat exchange coefficient"; - parameter Units.SI.Area S = 10 "Heat exchange surface"; - parameter Real Kc = 1e-4 "Pressure loss coefficient for the hot fluid"; - parameter Real Kf = 1e-4 "Pressure loss coefficient for the cold fluid"; - parameter Integer exchanger_conf = 1 "Exchanger configuration - 1: counter-current. 2: co-current"; - parameter Units.SI.MassFlowRate gamma_diff_c = 1e-4 "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.MassFlowRate gamma_diff_f = 1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rhoc = 0 "If > 0, fixed fluid density for the hot fluid" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter Units.SI.Density p_rhof = 0 "If > 0, fixed fluid density for the cold fluid" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_c = IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_f = IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.CoefficientOfHeatTransfer K=100 + "Global heat exchange coefficient"; + parameter Units.SI.Area S=10 "Heat exchange surface"; + parameter Real Kc=1e-4 "Pressure loss coefficient for the hot fluid"; + parameter Real Kf=1e-4 "Pressure loss coefficient for the cold fluid"; + parameter Integer exchanger_conf=1 "Exchanger configuration - 1: counter-current. 2: co-current"; + parameter Units.SI.MassFlowRate gamma_diff_c=1e-4 + "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 + "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rhoc=0 + "If > 0, fixed fluid density for the hot fluid" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Units.SI.Density p_rhof=0 + "If > 0, fixed fluid density for the cold fluid" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public Units.SI.Power W "Power exchanged"; - Units.SI.Temperature Tec(start = 400) "Temperature of the hot fluid at the inlet"; - Units.SI.Temperature Tsc(start = 300) "Temperature of the hot fluid at the outlet"; - Units.SI.Temperature Tef(start = 300) "Temperature of the cold fluid at the inlet"; - Units.SI.Temperature Tsf(start = 400) "Temperature of the cold fluid at the outlet"; + Units.SI.Temperature Tec(start=400) + "Temperature of the hot fluid at the inlet"; + Units.SI.Temperature Tsc(start=300) + "Temperature of the hot fluid at the outlet"; + Units.SI.Temperature Tef(start=300) + "Temperature of the cold fluid at the inlet"; + Units.SI.Temperature Tsf(start=400) + "Temperature of the cold fluid at the outlet"; ThermoSysPro.Units.SI.TemperatureDifference DT1 "Delta T at the inlet"; ThermoSysPro.Units.SI.TemperatureDifference DT2 "Delta T at the outlet"; - Units.SI.SpecificHeatCapacity Cpf(start = 2000) "Specific heat capacity of the cold fluid"; - Units.SI.SpecificHeatCapacity Cpc(start = 2000) "Specific heat capacity of the hot fluid"; - Units.SI.Density rhoc(start = 998) "Hot fluid density"; - Units.SI.Density rhof(start = 998) "Cold fluid density"; - Units.SI.MassFlowRate Qc(start = 100) "Mass flow rate of the hot fluid"; - Units.SI.MassFlowRate Qf(start = 100) "Mass flow rate of the cold fluid"; + Units.SI.SpecificHeatCapacity Cpf(start=2000) + "Specific heat capacity of the cold fluid"; + Units.SI.SpecificHeatCapacity Cpc(start=2000) + "Specific heat capacity of the hot fluid"; + Units.SI.Density rhoc(start=998) "Hot fluid density"; + Units.SI.Density rhof(start=998) "Cold fluid density"; + Units.SI.MassFlowRate Qc(start=100) "Mass flow rate of the hot fluid"; + Units.SI.MassFlowRate Qf(start=100) "Mass flow rate of the cold fluid"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_c "Thermodynamic state of the hot fluid"; + Medium_f.ThermodynamicState state_f "Thermodynamic state of the cold fluid"; Real Kcor "Corrective term for the global heat exchange coefficient"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c = Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f = Integer(ftype_f) "Fluid number for the cold fluid"; - Interfaces.Connectors.FluidOutlet Sc annotation( - Placement(transformation(extent = {{90, -40}, {110, -20}}, rotation = 0), iconTransformation(extent = {{90, -40}, {110, -20}}))); - Interfaces.Connectors.FluidInlet Ec annotation( - Placement(transformation(extent = {{-110, -40}, {-90, -20}}, rotation = 0), iconTransformation(extent = {{-110, -40}, {-90, -20}}))); - Interfaces.Connectors.FluidInlet Ef annotation( - Placement(transformation(extent = {{-110, 20}, {-90, 40}}, rotation = 0), iconTransformation(extent = {{-110, 20}, {-90, 40}}))); - Interfaces.Connectors.FluidOutlet Sf annotation( - Placement(transformation(extent = {{90, 20}, {110, 40}}, rotation = 0), iconTransformation(extent = {{90, 20}, {110, 40}}))); - InstrumentationAndControl.Connectors.InputReal Kcorr "K_correction" annotation( - Placement(transformation(origin = {0, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer mode_c = Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f = Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{90,-40},{110,-20}}, rotation=0), iconTransformation(extent={ + {90,-40},{110,-20}}))); + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{-110,-40},{-90,-20}}, rotation=0), iconTransformation(extent= + {{-110,-40},{-90,-20}}))); + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{-110,20},{-90,40}}, rotation=0), iconTransformation(extent={ + {-110,20},{-90,40}}))); + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{90,20},{110,40}}, rotation=0), iconTransformation(extent={{ + 90,20},{110,40}}))); + InstrumentationAndControl.Connectors.InputReal Kcorr "K_correction" + annotation (Placement(transformation( + origin={0,70}, + extent={{-10,-10},{10,10}}, + rotation=270))); equation + if (cardinality(Kcorr) == 0) then Kcorr.signal = 1; end if; + Kcor = Kcorr.signal; -/* Mass flow rates */ + + /* Mass flow rates */ Ec.Q = Sc.Q; + Ec.h_vol_1 = Sc.h_vol_1; Ec.h_vol_2 = Sc.h_vol_2; + Sc.diff_on_1 = Ec.diff_on_1; Ec.diff_on_2 = Sc.diff_on_2; + Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - ftype_c = Ec.ftype; + + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; + Ef.Q = Sf.Q; + Ef.h_vol_1 = Sf.h_vol_1; Ef.h_vol_2 = Sf.h_vol_2; + Sf.diff_on_1 = Ef.diff_on_1; Ef.diff_on_2 = Sf.diff_on_2; + Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - ftype_f = Ef.ftype; + + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; + Qc = Ec.Q; Qf = Ef.Q; -/* Presure losses */ + Xc = Ec.Xi; + Xf = Ef.Xi; + + /* Presure losses */ Ec.P - Sc.P = Kc*ThermoSysPro.Functions.ThermoSquare(Qc, eps)/rhoc; Ef.P - Sf.P = Kf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof; + if (exchanger_conf == 1) then -/* Counter-current exchanger */ - DT1 = Tec - Tsf; - DT2 = Tsc - Tef; + /* Counter-current exchanger */ + DT1 = Tec - Tsf; + DT2 = Tsc - Tef; elseif (exchanger_conf == 2) then -/* Co-current exchanger */ - DT1 = Tec - Tef; - DT2 = Tsc - Tsf; + /* Co-current exchanger */ + DT1 = Tec - Tef; + DT2 = Tsc - Tsf; else - DT1 = 0; - DT2 = 0; - assert(false, "StaticExchangerFlueGasesWaterSteam: incorrect exchanger configuration"); + DT1 = 0; + DT2 = 0; + assert(false, "StaticExchangerFlueGasesWaterSteam: incorrect exchanger configuration"); end if; - DT2 = if (exchanger_conf == 1) then DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) - 1/(Qf*Cpf))) else DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) + 1/(Qf*Cpf))); -/* Power exchanged */ - W = Qc*(Ec.h - Sc.h); + + DT2 = if (exchanger_conf == 1) then DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) - 1/(Qf*Cpf))) + else DT1*Modelica.Math.exp(-Kcor*K*S*(1/(Qc*Cpc) + 1/(Qf*Cpf))); + + /* Power exchanged */ + W = Qc*(Ec.h-Sc.h); W = Qf*(Sf.h - Ef.h); -/* Fluid specific enthalpy at the inlet */ - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); -/* Fluid specific enthalpy at the outlet */ - Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); - Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); -/* Specific heat capacities */ - Cpf = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ef.P, Ef.h, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); - Cpc = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Ec.P, Ec.h, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); -/* Hot fluid density */ + + /* Cold fluid temperatures */ + Tef = Medium_f.temperature_phX(p=Ef.P, h=Ef.h, X=Xf); + Tsf = Medium_f.temperature_phX(p=Sf.P, h=Sf.h, X=Xf); + + /* Hot fluid temperatures */ + Tec = Medium_c.temperature_phX(p=Ec.P, h=Ec.h, X=Xc); + Tsc = Medium_c.temperature_phX(p=Sc.P, h=Sc.h, X=Xc); + + /* Specific heat capacities */ + state_f = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_c = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + Cpf = Medium_f.specificHeatCapacityCp(state_f); + Cpc = Medium_c.specificHeatCapacityCp(state_c); + + /* Hot fluid density */ if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = ThermoSysPro.Properties.Fluid.Density_Ph((Ec.P + Sc.P)/2, (Ec.h + Sc.h)/2, fluid_c, 0, Ec.Xco2, Ec.Xh2o, Ec.Xo2, Ec.Xso2); + rhoc = Medium_c.density_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc); end if; -/* Cold fluid density */ + + /* Cold fluid density */ if (p_rhof > 0) then rhof = p_rhof; else - rhof = ThermoSysPro.Properties.Fluid.Density_Ph((Ef.P + Sf.P)/2, (Ef.h + Sf.h)/2, fluid_f, 0, Ef.Xco2, Ef.Xh2o, Ef.Xo2, Ef.Xso2); + rhof = Medium_f.density_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf); end if; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, -54}, {100, -61}}, lineColor = {175, 175, 175}, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 0}, {100, -60}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({255, 255, 0}, fill_color_static), fillPattern = FillPattern.Backward), Rectangle(extent = {{-100, 61}, {100, 54}}, lineColor = {175, 175, 175}, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 60}, {100, 0}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({255, 255, 0}, fill_color_static), fillPattern = FillPattern.Backward), Line(points = {{-50, -31}, {48, -31}}, color = {255, 0, 0}), Line(points = {{46, -29}, {50, -31}}, color = {255, 0, 0}), Line(points = {{46, -33}, {50, -31}}, color = {255, 0, 0}), Line(points = {{-100, 0}, {-42, 0}, {-26, 0}, {10, 0}, {38, 0}, {100, 0}}, color = {0, 0, 0}, thickness = 0.5)}), - Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Backward), Line(points = {{-100, 0}, {-42, 0}, {-22, 48}, {18, -46}, {38, 0}, {100, 0}}, color = {0, 0, 0}, thickness = 1), Text(extent = {{-114, 32}, {-78, 0}}, lineColor = {28, 108, 200}, textString = "Cold fluid inlet"), Text(extent = {{-116, 56}, {-90, 36}}, lineColor = {28, 108, 200}, textString = " Fluid 2"), Text(extent = {{-112, 0}, {-84, -28}}, lineColor = {238, 46, 47}, textString = " Fluid 1"), Text(extent = {{-110, -30}, {-74, -66}}, lineColor = {238, 46, 47}, textString = "Hot fluid inlet"), Text(extent = {{84, 32}, {124, -4}}, lineColor = {28, 108, 200}, textString = "Cold fluid outlet"), Text(extent = {{87, -29}, {124, -64}}, lineColor = {238, 46, 47}, textString = "Hot fluid outlet")}), - Window(x = 0.05, y = 0.01, width = 0.93, height = 0.87), + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,-54},{100,-61}}, + lineColor={175,175,175}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,0},{100,-60}}, + lineColor={28,108,200}, + fillColor= DynamicSelect({255,255,0}, fill_color_static), + fillPattern=FillPattern.Backward), + Rectangle( + extent={{-100,61},{100,54}}, + lineColor={175,175,175}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,60},{100,0}}, + lineColor={28,108,200}, + fillColor=DynamicSelect({255,255,0}, fill_color_static), + fillPattern=FillPattern.Backward), + Line(points={{-50,-31},{48,-31}}, + color={255,0,0}), + Line(points={{46,-29},{50,-31}}, + color={255,0,0}), + Line(points={{46,-33},{50,-31}}, + color={255,0,0}), + Line( + points={{-100,0},{-42,0},{-26,0},{10,0},{38,0},{100,0}}, + color={0,0,0}, + thickness=0.5)}), + Diagram(coordinateSystem( + preserveAspectRatio=true, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Backward), + Line( + points={{-100,0},{-42,0},{-22,48},{18,-46},{38,0},{100,0}}, + color={0,0,0}, + thickness=1), + Text( + extent={{-114,32},{-78,0}}, + lineColor={28,108,200}, + textString="Cold fluid inlet"), + Text( + extent={{-116,56},{-90,36}}, + lineColor={28,108,200}, + textString=" Fluid 2"), + Text( + extent={{-112,0},{-84,-28}}, + lineColor={238,46,47}, + textString=" Fluid 1"), + Text( + extent={{-110,-30},{-74,-66}}, + lineColor={238,46,47}, + textString="Hot fluid inlet"), + Text( + extent={{84,32},{124,-4}}, + lineColor={28,108,200}, + textString="Cold fluid outlet"), + Text( + extent={{87,-29},{124,-64}}, + lineColor={238,46,47}, + textString="Hot fluid outlet")}), + Window( + x=0.05, + y=0.01, + width=0.93, + height=0.87), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -144,4 +248,4 @@ Author Baligh El Hefni ")); -end StaticExchangerKS; \ No newline at end of file +end StaticExchangerKS; diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo index 75382a2c..bf61196b 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo @@ -1,154 +1,168 @@ -within ThermoSysPro.Fluid.HeatExchangers; - +within ThermoSysPro.Fluid.HeatExchangers; model StaticPlateHeatExchanger "Static plate heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.ThermalConductivity lambdam = 15.0 "Metal thermal conductivity"; - parameter Units.SI.CoefficientOfHeatTransfer p_hc = 6000 "Heat transfer coefficient for the hot side if not computed by the correlations"; - parameter Units.SI.CoefficientOfHeatTransfer p_hf = 3000 "Heat transfer coefficient for the cold side if not computed by the correlations"; - parameter Real p_Kc = 100 "Pressure loss coefficient for the hot side if not computed by the correlations"; - parameter Real p_Kf = 100 "Pressure loss coefficient for the cold side if not computed by the correlations"; - parameter Units.SI.Thickness emetal = 0.0006 "Wall thickness"; - parameter Units.SI.Area Sp = 2 "Plate area"; - parameter Real nbp = 499 "Number of plates"; - parameter Real c1 = 1.12647 "Correction coefficient"; - parameter Integer exchanger_type = 1 "Exchanger type - 1: counter-current. 2: co-current"; - parameter Integer heat_exchange_correlation = 1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations"; - parameter Integer pressure_loss_correlation = 1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations"; - parameter Units.SI.MassFlowRate gamma_diff_c = 1e-4 "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.MassFlowRate gamma_diff_f = 1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rhoc = 0 "If > 0, fixed fluid density for the hot fluid" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter Units.SI.Density p_rhof = 0 "If > 0, fixed fluid density for the cold fluid" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_c = IF97Region.All_regions "IF97 region for the hot fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_f = IF97Region.All_regions "IF97 region for the cold fluid (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.ThermalConductivity lambdam=15.0 + "Metal thermal conductivity"; + parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000 + "Heat transfer coefficient for the hot side if not computed by the correlations"; + parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000 + "Heat transfer coefficient for the cold side if not computed by the correlations"; + parameter Real p_Kc=100 "Pressure loss coefficient for the hot side if not computed by the correlations"; + parameter Real p_Kf=100 "Pressure loss coefficient for the cold side if not computed by the correlations"; + parameter Units.SI.Thickness emetal=0.0006 "Wall thickness"; + parameter Units.SI.Area Sp=2 "Plate area"; + parameter Real nbp=499 "Number of plates"; + parameter Real c1=1.12647 "Correction coefficient"; + parameter Integer exchanger_type=1 "Exchanger type - 1: counter-current. 2: co-current"; + parameter Integer heat_exchange_correlation=1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations"; + parameter Integer pressure_loss_correlation=1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations"; + parameter Units.SI.MassFlowRate gamma_diff_c=1e-4 + "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 + "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rhoc=0 + "If > 0, fixed fluid density for the hot fluid" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Units.SI.Density p_rhof=0 + "If > 0, fixed fluid density for the cold fluid" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +public Units.SI.Power W "Thermal power exchanged between the two sides"; - ThermoSysPro.Units.SI.PressureDifference DPc "Pressure loss of the hot fluid"; - ThermoSysPro.Units.SI.PressureDifference DPf "Pressure loss of the cold fluid"; - Units.SI.CoefficientOfHeatTransfer hc "Heat transfer coefficient of the hot fluid"; - Units.SI.CoefficientOfHeatTransfer hf "Heat transfer coefficient of the cold fluid"; + ThermoSysPro.Units.SI.PressureDifference DPc + "Pressure loss of the hot fluid"; + ThermoSysPro.Units.SI.PressureDifference DPf + "Pressure loss of the cold fluid"; + Units.SI.CoefficientOfHeatTransfer hc + "Heat transfer coefficient of the hot fluid"; + Units.SI.CoefficientOfHeatTransfer hf + "Heat transfer coefficient of the cold fluid"; Units.SI.CoefficientOfHeatTransfer K "Global heat transfer coefficient"; Units.SI.Area S "Heat exchange surface"; Units.SI.Temperature Tec "Fluid temperature at the hot inlet"; Units.SI.Temperature Tsc "Fluid temperature at the hot outlet"; Units.SI.Temperature Tef "Fluid temperature at the cold inlet"; Units.SI.Temperature Tsf "Fluid temperature at the cold outlet"; - ThermoSysPro.Units.SI.TemperatureDifference DTm "Difference in average temperature"; - ThermoSysPro.Units.SI.TemperatureDifference DT1 "Temperature difference at the inlet of the exchanger"; - ThermoSysPro.Units.SI.TemperatureDifference DT2 "Temperature difference at the outlet of the exchanger"; + ThermoSysPro.Units.SI.TemperatureDifference DTm + "Difference in average temperature"; + ThermoSysPro.Units.SI.TemperatureDifference DT1 + "Temperature difference at the inlet of the exchanger"; + ThermoSysPro.Units.SI.TemperatureDifference DT2 + "Temperature difference at the outlet of the exchanger"; Real DT12 "DT1/DT2 (s.u.)"; - Units.SI.MassFlowRate Qc(start = 500) "Mass flow rate of the hot fluid"; - Units.SI.MassFlowRate Qf(start = 500) "Mass flow rate of the cold fluid"; + Units.SI.MassFlowRate Qc(start=500) "Mass flow rate of the hot fluid"; + Units.SI.MassFlowRate Qf(start=500) "Mass flow rate of the cold fluid"; Real qmc; Real qmf; Real quc; Real quf; Real N; - Units.SI.Density rhoc(start = 998) "Hot fluid density"; - Units.SI.Density rhof(start = 998) "Cold fluid density"; - Units.SI.DynamicViscosity muc(start = 1.e-3) "Hot fluid dynamic viscosity"; - Units.SI.DynamicViscosity muf(start = 1.e-3) "Cold fluid dynamic viscosity"; - Units.SI.ThermalConductivity lambdac(start = 0.602698) "Hot fluid thermal conductivity"; - Units.SI.ThermalConductivity lambdaf(start = 0.597928) "Cold fluid thermal conductivity"; - Units.SI.Temperature Tmc(start = 290) "Hot fluid average temperature"; - Units.SI.Temperature Tmf(start = 290) "Cold fluid average temperature"; - Units.SI.AbsolutePressure Pmc(start = 1.e5) "Hot fluid average pressure"; - Units.SI.AbsolutePressure Pmf(start = 1.e5) "Cold fluid average pressure"; - Units.SI.SpecificEnthalpy Hmc(start = 100000) "Hot fluid average specific enthalpy"; - Units.SI.SpecificEnthalpy Hmf(start = 100000) "Cold fluid average specific enthalpy"; - FluidType ftype_c "Fluid type for the hot fluid"; - Integer fluid_c = Integer(ftype_c) "Fluid number for the hot fluid"; - FluidType ftype_f "Fluid type for the cold fluid"; - Integer fluid_f = Integer(ftype_f) "Fluid number for the cold fluid"; - Interfaces.Connectors.FluidInlet Ec annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ef annotation( - Placement(transformation(extent = {{-60, -70}, {-40, -50}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sf annotation( - Placement(transformation(extent = {{40, -70}, {60, -50}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sc annotation( - Placement(transformation(extent = {{90, -8}, {110, 12}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proce annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph procs annotation( - Placement(transformation(extent = {{-20, 80}, {0, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe annotation( - Placement(transformation(extent = {{-60, -100}, {-40, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profs annotation( - Placement(transformation(extent = {{-20, -100}, {0, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prof annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); -protected - parameter Integer mode_c = Integer(region_c) - 1 "IF97 region for the hot fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f = Integer(region_f) - 1 "IF97 region for the cold fluid. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Units.SI.Density rhoc(start=998) "Hot fluid density"; + Units.SI.Density rhof(start=998) "Cold fluid density"; + Units.SI.DynamicViscosity muc(start=1.e-3) "Hot fluid dynamic viscosity"; + Units.SI.DynamicViscosity muf(start=1.e-3) "Cold fluid dynamic viscosity"; + Units.SI.ThermalConductivity lambdac(start=0.602698) + "Hot fluid thermal conductivity"; + Units.SI.ThermalConductivity lambdaf(start=0.597928) + "Cold fluid thermal conductivity"; + Units.SI.Temperature Tmc(start=290) "Hot fluid average temperature"; + Units.SI.Temperature Tmf(start=290) "Cold fluid average temperature"; + Units.SI.AbsolutePressure Pmc(start=1.e5) "Hot fluid average pressure"; + Units.SI.AbsolutePressure Pmf(start=1.e5) "Cold fluid average pressure"; + Units.SI.SpecificEnthalpy Hmc(start=100000) + "Hot fluid average specific enthalpy"; + Units.SI.SpecificEnthalpy Hmf(start=100000) + "Cold fluid average specific enthalpy"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_c "Average thermodynamic state of the hot fluid"; + Medium_f.ThermodynamicState state_f "Average thermodynamic state of the cold fluid"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; + +public + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{-60,-70},{-40,-50}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{40,-70},{60,-50}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{90,-8},{110,12}}, rotation=0))); equation -/* Mass flow rates */ + + /* Mass flow rates */ Ec.Q = Sc.Q; + Ec.h_vol_1 = Sc.h_vol_1; Ec.h_vol_2 = Sc.h_vol_2; + Sc.diff_on_1 = Ec.diff_on_1; Ec.diff_on_2 = Sc.diff_on_2; + Sc.diff_res_1 = Ec.diff_res_1 + 1/gamma_diff_c; Ec.diff_res_2 = Sc.diff_res_2 + 1/gamma_diff_c; - Ec.ftype = Sc.ftype; - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - ftype_c = Ec.ftype; + + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; + Ef.Q = Sf.Q; + Ef.h_vol_1 = Sf.h_vol_1; Ef.h_vol_2 = Sf.h_vol_2; + Sf.diff_on_1 = Ef.diff_on_1; Ef.diff_on_2 = Sf.diff_on_2; + Sf.diff_res_1 = Ef.diff_res_1 + 1/gamma_diff_f; Ef.diff_res_2 = Sf.diff_res_2 + 1/gamma_diff_f; - Ef.ftype = Sf.ftype; - Ef.Xco2 = Sf.Xco2; - Ef.Xh2o = Sf.Xh2o; - Ef.Xo2 = Sf.Xo2; - Ef.Xso2 = Sf.Xso2; - ftype_f = Ef.ftype; + + Ef.Xi = Sf.Xi; + Ef.SubC = Sf.SubC; + Qc = Ec.Q; Qf = Ef.Q; -/* Pressures */ + Xc = Ec.Xi; + Xf = Ef.Xi; + + /* Pressures */ Sc.P = if Qc > 0 then Ec.P - DPc else Ec.P + DPc; Sf.P = if Qf > 0 then Ef.P - DPf else Ef.P + DPf; -/* Heat exchanges between the hot and cold fluids */ + + /* Heat exchanges between the hot and cold fluids */ K = hc*hf/(hc + hf + hc*hf*emetal/lambdam); W = K*S*DTm; + if (abs(Qc) > 1.e-3) then - W = Qc*proc.cp*(Tec - Tsc); + W = Qc*Medium_c.specificHeatCapacityCp(state_c)*(Tec - Tsc); else Tec = Tsc; end if; + if (abs(Qf) > 1.e-3) then - W = Qf*prof.cp*(Tsf - Tef); + W = Qf*Medium_f.specificHeatCapacityCp(state_f)*(Tsf - Tef); else Tef = Tsf; end if; -/* Difference in average temperatures */ + + /* Difference in average temperatures */ if noEvent(((DT1 > DT2) and (DT2 > 0)) or ((DT1 < DT2) and (DT2 < 0))) then DTm = (DT1 - DT2)/Modelica.Math.log(DT1/DT2); else DTm = (DT1 + DT2)/2; end if; + if (exchanger_type == 1) then -/* Counter-current heat exchanger */ + /* Counter-current heat exchanger */ DT1 = Tec - Tsf; DT2 = Tsc - Tef; elseif (exchanger_type == 2) then -/* Co-current heat exchanger */ + /* Co-current heat exchanger */ DT1 = Tec - Tef; DT2 = Tsc - Tsf; else @@ -156,27 +170,33 @@ equation DT2 = 0; assert(false, "StaticWaterWaterExchanger: incorrect exchanger type"); end if; + DT12 = if noEvent(abs(DT2) > Modelica.Constants.eps) then DT1/DT2 else 0; -/* Heat exchange area (for the plate heat exchanger) */ + + /* Heat exchange area (for the plate heat exchanger) */ S = (nbp - 2)*Sp; N = (nbp - 1)/2; -/* Heat exchange coefficients */ + + /* Heat exchange coefficients */ qmc = noEvent(abs(Qc)/(muc*N)); qmf = noEvent(abs(Qf)/(muf*N)); + if (heat_exchange_correlation == 0) then hc = p_hc; hf = p_hf; elseif (heat_exchange_correlation == 1) then - hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*proc.cp/lambdac)^0.4*lambdac); - hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*prof.cp/lambdaf)^0.4*lambdaf); + hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*Medium_c.specificHeatCapacityCp(state_c)/lambdac)^0.4*lambdac); + hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*Medium_f.specificHeatCapacityCp(state_f)/lambdaf)^0.4*lambdaf); else hc = 0; hf = 0; assert(false, "StaticWaterWaterExchanger: incorrect heat exchange correlation number"); end if; -/* Pressure losses */ + + /* Pressure losses */ quc = noEvent(abs(Qc)/N); quf = noEvent(abs(Qf)/N); + if (pressure_loss_correlation == 0) then DPc = p_Kc*Qc^2/rhoc; DPf = p_Kf*Qf^2/rhof; @@ -186,44 +206,132 @@ equation else DPc = 0; DPf = 0; - assert(false, "StaticWaterWaterExchanger: incorrect pressure loss correlation number"); + assert(false, + "StaticWaterWaterExchanger: incorrect pressure loss correlation number"); end if; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pmc = (Ec.P + Sc.P)/2; Pmf = (Ef.P + Sf.P)/2; Hmc = (Ec.h + Sc.h)/2; Hmf = (Ef.h + Sf.h)/2; - proc = ThermoSysPro.Properties.Fluid.Ph(Pmc, Hmc, mode_c, fluid_c); - prof = ThermoSysPro.Properties.Fluid.Ph(Pmf, Hmf, mode_f, fluid_f); - Tmc = proc.T; - Tmf = prof.T; + + state_c = Medium_c.setState_phX(p=Pmc, h=Hmc, X=Xc); + state_f = Medium_f.setState_phX(p=Pmf, h=Hmf, X=Xf); + + Tmc = Medium_c.temperature(state_c); + Tmf = Medium_f.temperature(state_f); + if (p_rhoc > 0) then rhoc = p_rhoc; else - rhoc = proc.d; + rhoc = Medium_c.density(state_c); end if; + if (p_rhof > 0) then rhof = p_rhof; else - rhof = prof.d; + rhof = Medium_f.density(state_f); end if; - muc = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhoc, Tmc, fluid_c); - muf = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhof, Tmf, fluid_f); - lambdac = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc, Tmc, Pmc, 0, fluid_c); - lambdaf = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof, Tmf, Pmf, 0, fluid_f); -/* Calcul des températures en entrée et en sortie de l'échangeur */ - proce = ThermoSysPro.Properties.Fluid.Ph(Ec.P, Ec.h, mode_c, fluid_c); - procs = ThermoSysPro.Properties.Fluid.Ph(Sc.P, Sc.h, mode_c, fluid_f); - profe = ThermoSysPro.Properties.Fluid.Ph(Ef.P, Ef.h, mode_f, fluid_c); - profs = ThermoSysPro.Properties.Fluid.Ph(Sf.P, Sf.h, mode_f, fluid_f); - Tec = proce.T; - Tsc = procs.T; - Tef = profe.T; - Tsf = profs.T; - annotation( - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({255, 255, 0}, fill_color_static)), Line(points = {{-80, 60}, {-80, -60}}), Line(points = {{80, 60}, {80, -60}}), Line(points = {{-80, 0}, {-60, 0}, {-40, 20}, {40, -20}, {60, 0}, {80, 0}}, color = {28, 108, 200}), Text(extent = {{-126, 24}, {-106, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot inlet"), Text(extent = {{-82, -66}, {-62, -76}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold inlet"), Text(extent = {{66, -66}, {90, -76}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold outlet"), Text(extent = {{104, 24}, {128, 10}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot outlet")}), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {255, 255, 0}), Line(points = {{-80, 60}, {-80, -60}}), Line(points = {{80, 60}, {80, -60}}), Line(points = {{-80, 0}, {-60, 0}, {-40, 20}, {40, -20}, {60, 0}, {80, 0}}, color = {28, 108, 200}), Text(extent = {{-122, 22}, {-102, 12}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot inlet"), Text(extent = {{100, 24}, {124, 10}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot outlet"), Text(extent = {{-86, -66}, {-62, -76}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold inlet"), Text(extent = {{64, -66}, {92, -80}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold outlet")}), - Window(x = 0.05, y = 0.01, width = 0.93, height = 0.87), + + muc = Medium_c.dynamicViscosity(state_c); + muf = Medium_f.dynamicViscosity(state_f); + + lambdac = Medium_c.thermalConductivity(state_c); + lambdaf = Medium_f.thermalConductivity(state_f); + + /* Fluid temperatures at the inlet and outlet of the exchanger */ + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); + Tef = Medium_f.temperature(state_fe); + Tsf = Medium_f.temperature(state_fs); + + annotation ( + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor=DynamicSelect({255,255,0}, fill_color_static)), + Line(points={{-80,60},{-80,-60}}), + Line(points={{80,60},{80,-60}}), + Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={ + 28,108,200}), + Text( + extent={{-126,24},{-106,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot inlet"), + Text( + extent={{-82,-66},{-62,-76}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold inlet"), + Text( + extent={{66,-66},{90,-76}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold outlet"), + Text( + extent={{104,24},{128,10}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot outlet")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={255,255,0}), + Line(points={{-80,60},{-80,-60}}), + Line(points={{80,60},{80,-60}}), + Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={ + 28,108,200}), + Text( + extent={{-122,22},{-102,12}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot inlet"), + Text( + extent={{100,24},{124,10}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot outlet"), + Text( + extent={{-86,-66},{-62,-76}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold inlet"), + Text( + extent={{64,-66},{92,-80}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold outlet")}), + Window( + x=0.05, + y=0.01, + width=0.93, + height=0.87), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -234,4 +342,4 @@ Author Daniel Bouskela ")); -end StaticPlateHeatExchanger; \ No newline at end of file +end StaticPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo index bbe2ae3d..9b807b2d 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo @@ -1,190 +1,229 @@ within ThermoSysPro.Fluid.HeatExchangers; - model StaticWallFlueGasesExchanger "Static wall - flue gases exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Integer Ns = 10 "Number of segments"; - parameter Integer NbTub = 100 "Number of pipes"; - parameter Real DPc = 0 "Pressure loss coefficient"; - parameter Units.SI.Length L = 2 "Exchanger length"; - parameter Units.SI.Diameter Dext = 0.022 "External pipe diameter"; - parameter Units.SI.PathLength step_L = 0.033 "Longitudinal length step"; - parameter Units.SI.PathLength step_T = 0.066 "Transverse length step"; - parameter Units.SI.Area St = 100 "Cross-sectional area"; - parameter Units.SI.Area Surf_ext = pi*Dext*Ls*NbTub*CSailettes "Heat exchange surface for one section"; - parameter Real Encras = 1.00 "Corrective term for the heat exchange coefficient"; - parameter Real Fa = 0.7 "Fouling factor (0.3 - 1.1)"; - parameter Units.SI.MassFlowRate Qmin = 1e-3 "Minimum flue gases mass flow rate"; - parameter Integer exchanger_type = 1 "Exchanger type - 1:crossed flux - 2:longitudinal flux"; - parameter Units.SI.Temperature Tp0 = 500 "Wall temperature (active if the thermal connector is not connected)"; - parameter Real CSailettes = 1 "Increase factor of the heat exchange surface to to the fins"; - parameter Real Coeff = 1 "Corrective coeffeicient"; - parameter Units.SI.MassFlowRate gamma_diff = 1e-4 "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.Density p_rho = 0 "If > 0, fixed fluid density" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Units.SI.AbsolutePressure P[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Fluid pressure in node i"; - Units.SI.MassFlowRate Q[N](start = fill(10, N), nominal = fill(10, N)) "Mass flow rate in node i"; - Units.SI.SpecificEnthalpy h[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e6, N + 1)) "Fluid specific enthalpy in node i"; - Units.SI.SpecificEnthalpy hb[N] "Fluid specific enthalpy at the boundary of node i"; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Mixture gas medium" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Integer Ns=10 "Number of segments"; + parameter Integer NbTub=100 "Number of pipes"; + parameter Real DPc=0 "Pressure loss coefficient"; + parameter Units.SI.Length L=2 "Exchanger length"; + parameter Units.SI.Diameter Dext=0.022 "External pipe diameter"; + parameter Units.SI.PathLength step_L=0.033 "Longitudinal length step"; + parameter Units.SI.PathLength step_T=0.066 "Transverse length step"; + parameter Units.SI.Area St=100 "Cross-sectional area"; + parameter Units.SI.Area Surf_ext=pi*Dext*Ls*NbTub*CSailettes + "Heat exchange surface for one section"; + parameter Real Encras=1.00 "Corrective term for the heat exchange coefficient"; + parameter Real Fa=0.7 "Fouling factor (0.3 - 1.1)"; + parameter Units.SI.MassFlowRate Qmin=1e-3 "Minimum flue gases mass flow rate"; + parameter Integer exchanger_type=1 "Exchanger type - 1:crossed flux - 2:longitudinal flux"; + parameter Units.SI.Temperature Tp0=500 + "Wall temperature (active if the thermal connector is not connected)"; + parameter Real CSailettes=1 "Increase factor of the heat exchange surface to to the fins"; + parameter Real Coeff=1 "Corrective coeffeicient"; + parameter Units.SI.MassFlowRate gamma_diff=1e-4 + "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Real pi=Modelica.Constants.pi; + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; + parameter Units.SI.PathLength Ls=L/Ns "Section length"; + parameter Units.SI.Area Surf_tot=Ns*Surf_ext "Total heat exchange surface"; + parameter Units.SI.Area Sgaz=St*(1 - Dext/step_T) "Geometrical parameter"; + parameter Real PasLD=step_L/Dext "Geometrical parameter"; + parameter Real PasTD=step_T/Dext "Geometrical parameter"; + parameter Real Optl=ThermoSysPro.Correlations.Misc.WBCorrectiveDiameterCoefficient(PasTD,PasLD,Dext) "Geometrical parameter"; + parameter Units.SI.Length Deq=4*Sgaz/Perb + "Equivalent diameter for longitudinal flux"; + parameter Units.SI.Length Perb=Surf_ext/Ls "Geometrical parameter"; + parameter Units.SI.CoefficientOfHeatTransfer Kdef=50 + "Heat exchange coefficient in case of zero flow"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the medium composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the medium composition"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + parameter Real eps=1.e-1 "Small number for the computation of the pressure losses"; + +public + Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5, + N + 1)) "Fluid pressure in node i"; + Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N)) + "Mass flow rate in node i"; + Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6, + N + 1)) "Fluid specific enthalpy in node i"; + Units.SI.SpecificEnthalpy hb[N] + "Fluid specific enthalpy at the boundary of node i"; Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i"; Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i"; - Units.SI.Density rho2[N](start = fill(998, N), nominal = fill(1, N)) "Fluid density in hydraulic node i"; - Units.SI.Temperature Tp[N - 1](start = fill(500, N - 1)) "Wall temperature in thermal node i"; - Units.SI.AbsolutePressure Pco2[N - 1] "CO2 partial pressure in thermal node i"; - Units.SI.AbsolutePressure Ph2o[N - 1] "H2O partial pressure in thermal node i"; + Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N)) + "Fluid density in hydraulic node i"; + Units.SI.Temperature Tp[N - 1](start=fill(500, N - 1)) + "Wall temperature in thermal node i"; + Units.SI.AbsolutePressure Pco2[N - 1] + "CO2 partial pressure in thermal node i"; + Units.SI.AbsolutePressure Ph2o[N - 1] + "H2O partial pressure in thermal node i"; ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xn2 "N2 mass fraction"; ThermoSysPro.Units.SI.MassFraction Xvh2o "H2O volume fraction"; ThermoSysPro.Units.SI.MassFraction Xvco2 "CO2 volume fraction"; - ThermoSysPro.Units.SI.MassFraction Xvo2 "O2 volume fraction"; - ThermoSysPro.Units.SI.MassFraction Xvn2 "N2 volume fraction"; - ThermoSysPro.Units.SI.MassFraction Xvso2 "SO2 volume fraction"; - Units.SI.CoefficientOfHeatTransfer K(start = 0) "Total heat exchange coefficient"; - Units.SI.CoefficientOfHeatTransfer Kc(start = 0) "Convective heat exchange coefficient"; - Units.SI.CoefficientOfHeatTransfer Kr(start = 0) "Radiative heat exchange coefficient"; - Units.SI.CoefficientOfHeatTransfer Kcc[N - 1](start = fill(0, N - 1)) "Intermediate variable for the computation of the convective heat exchange coefficient"; - Units.SI.CoefficientOfHeatTransfer Krr[N - 1](start = fill(0, N - 1)) "Intermediate variable for the computation of the radiative heat exchange coefficient"; - Units.SI.Power dW1[N - 1](start = fill(0, N - 1)) "Power exchange between the wall and the fluid in each thermal node"; - Units.SI.Power W(start = 0) "Total power exchanged"; - ThermoSysPro.Units.SI.TemperatureDifference deltaT[N - 1](start = fill(50, N - 1)) "Temperature difference between the fluid and the wall"; + Units.SI.CoefficientOfHeatTransfer K(start=0) + "Total heat exchange coefficient"; + Units.SI.CoefficientOfHeatTransfer Kc(start=0) + "Convective heat exchange coefficient"; + Units.SI.CoefficientOfHeatTransfer Kr(start=0) + "Radiative heat exchange coefficient"; + Units.SI.CoefficientOfHeatTransfer Kcc[N - 1](start=fill(0, N - 1)) + "Intermediate variable for the computation of the convective heat exchange coefficient"; + Units.SI.CoefficientOfHeatTransfer Krr[N - 1](start=fill(0, N - 1)) + "Intermediate variable for the computation of the radiative heat exchange coefficient"; + Units.SI.Power dW1[N - 1](start=fill(0, N - 1)) + "Power exchange between the wall and the fluid in each thermal node"; + Units.SI.Power W(start=0) "Total power exchanged"; + ThermoSysPro.Units.SI.TemperatureDifference deltaT[N - 1](start=fill(50, N + - 1)) "Temperature difference between the fluid and the wall"; Units.SI.Temperature TFilm[N - 1] "Film temperature"; Real Mmt "Total flue gases molar mass"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; + parameter Units.SI.MolarMass MM[Medium.nX]={Medium.fluidConstants[j].molarMass for j in 1:Medium.nX} "Component molar masses"; + Medium.ThermodynamicState state1[N - 1] "Thermodynamic state in thermal node i"; + Medium.ThermodynamicState state2[N] "Thermodynamic state in hydraulic node i"; Real diff_res[N] "Diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i"; - Units.SI.MassFlowRate gamma[N] "Total diffusion conductance in hydraulic node i"; - Units.SI.MassFlowRate gamma_e[N - 1] "Diffusion conductance at inlet of thermal node i"; - Units.SI.MassFlowRate gamma_s[N - 1] "Diffusion conductance at outlet of thermal node i"; - Units.SI.Power Je[N - 1] "Thermal power diffusion from inlet of thermal node i"; - Units.SI.Power Js[N - 1] "Thermal power diffusion from outlet of thermal node i"; + Units.SI.MassFlowRate gamma[N] + "Total diffusion conductance in hydraulic node i"; + Units.SI.MassFlowRate gamma_e[N - 1] + "Diffusion conductance at inlet of thermal node i"; + Units.SI.MassFlowRate gamma_s[N - 1] + "Diffusion conductance at outlet of thermal node i"; + Units.SI.Power Je[N - 1] + "Thermal power diffusion from inlet of thermal node i"; + Units.SI.Power Js[N - 1] + "Thermal power diffusion from outlet of thermal node i"; Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i"; Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i"; Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation( - Placement(transformation(extent = {{-10, 20}, {10, 40}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - constant Real Mco2 = 44.009 "CO2 molar mass"; - constant Real Mh2o = 18.0148 "H2O molar mass"; - constant Real Mo2 = 31.998 "O2 molar mass"; - constant Real Mn2 = 28.014 "N2 molar mass"; - constant Real Mso2 = 64.063 "SO2 molar mass"; - constant Real pi = Modelica.Constants.pi; - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - parameter Integer N = Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; - parameter Units.SI.PathLength Ls = L/Ns "Section length"; - parameter Units.SI.Area Surf_tot = Ns*Surf_ext "Total heat exchange surface"; - parameter Units.SI.Area Sgaz = St*(1 - Dext/step_T) "Geometrical parameter"; - parameter Real PasLD = step_L/Dext "Geometrical parameter"; - parameter Real PasTD = step_T/Dext "Geometrical parameter"; - parameter Real Optl = ThermoSysPro.Correlations.Misc.WBCorrectiveDiameterCoefficient(PasTD, PasLD, Dext) "Geometrical parameter"; - parameter Units.SI.Length Deq = 4*Sgaz/Perb "Equivalent diameter for longitudinal flux"; - parameter Units.SI.Length Perb = Surf_ext/Ls "Geometrical parameter"; - parameter Units.SI.CoefficientOfHeatTransfer Kdef = 50 "Heat exchange coefficient in case of zero flow"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; - parameter Real eps = 1.e-1 "Small number for the computation of the pressure losses"; + +public + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] + annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); equation -/* Check that the fluid type is flue gases */ - assert(ftype == FluidType.FlueGases, "StaticWallFlueGasesExchanger: the fluid type must be flue gases"); -/* Wall boundary */ + + assert(Medium.nX > 1, "StaticWallFlueGasesExchanger: Medium must be a gas mixture"); + assert(iH2O > 0, "StaticWallFlueGasesExchanger: Medium.substanceNames must contain H2O/Water for radiative heat transfer"); + assert(iCO2 > 0, "StaticWallFlueGasesExchanger: Medium.substanceNames must contain CO2/Carbondioxide for radiative heat transfer"); + + /* Wall boundary */ CTh.W = -dW1; - CTh.T = Tp; -/* Pipe boundaries */ + Tp = CTh.T; + + /* Pipe boundaries */ P[1] = C1.P; P[N + 1] = C2.P; + Q[1] = C1.Q; Q[N] = C2.Q; + hb[1] = C1.h; hb[N] = C2.h; + h[1] = C1.h_vol_1; h[N + 1] = C2.h_vol_2; + C1.h_vol_2 = h[2]; C2.h_vol_1 = h[N]; + C2.diff_on_1 = diffusion; C1.diff_on_2 = diffusion; + C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - ftype = C1.ftype; - Xh2o = C1.Xh2o; - Xco2 = C1.Xco2; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; - Xn2 = 1 - C1.Xco2 - C1.Xh2o - C1.Xo2 - C1.Xso2; -/* Volume fractions */ - Xvco2 = (Xco2/Mco2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvh2o = (Xh2o/Mh2o)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvo2 = (Xo2/Mo2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvn2 = (Xn2/Mn2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); - Xvso2 = (Xso2/Mso2)/(Xco2/Mco2 + Xh2o/Mh2o + Xo2/Mo2 + Xn2/Mn2 + Xso2/Mso2); -/* Total molar mass */ - Mmt = Xvco2*Mco2 + Xvh2o*Mh2o + Xvo2*Mo2 + Xvn2*Mn2 + Xvso2*Mso2; -/* Mass and energy balance equations (thermal nodes) */ + + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; + + Xh2o = C1.Xi[iH2O]; + Xco2 = C1.Xi[iCO2]; + + /* Volume fractions */ + Xvco2 = Xco2/MM[iCO2]/sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX}); + Xvh2o = Xh2o/MM[iH2O]/sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX}); + + /* Total molar mass */ + Mmt = sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX})^(-1); + + /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop -/* Mass balance equation */ + /* Mass balance equation */ 0 = Q[i] - Q[i + 1]; -/* Energy balance equation */ + + /* Energy balance equation */ 0 = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] - dW1[i] + J[i]; -/* Temperature difference between the fluid and the wall */ + + /* Temperature difference between the fluid and the wall */ deltaT[i] = T1[i] - Tp[i]; -/* Partial gas pressures */ - Ph2o[i] = P[i + 1]*Xh2o*Mmt/Mh2o; - Pco2[i] = P[i + 1]*Xco2*Mmt/Mco2; + + /* Partial gas pressures */ + Ph2o[i] = P[i + 1]*Xvh2o; + Pco2[i] = P[i + 1]*Xvco2; + if (abs(Q[i]) >= Qmin) then -/* Convective heat exchange coefficient */ + /* Convective heat exchange coefficient */ if (exchanger_type == 1) then -/* Crossed flux */ + /* Crossed flux */ Kcc[i] = ThermoSysPro.Correlations.Thermal.WBCrossedCurrentConvectiveHeatTransferCoefficient(TFilm[i], abs(Q[i]), Xh2o*100, Sgaz, Dext, Fa); else -/* Longitudinal flux */ + /* Longitudinal flux */ Kcc[i] = ThermoSysPro.Correlations.Thermal.WBLongitudinalCurrentConvectiveHeatTransferCoefficient(TFilm[i], T1[i], abs(Q[i]), Xh2o*100, Sgaz, Deq); end if; -/* Radiative heat exchange coefficient */ + + /* Radiative heat exchange coefficient */ Krr[i] = ThermoSysPro.Correlations.Thermal.WBRadiativeHeatTransferCoefficient(deltaT[i], Tp[i], Ph2o[i]/P[i + 1], Pco2[i]/P[i + 1], Optl); else Krr[i] = 0; Kcc[i] = 0; end if; -/* Film temperature */ + + /* Film temperature */ TFilm[i] = (T1[i] + Tp[i])/2; -/* Power exchanged for each section */ + + /* Power exchanged for each section */ dW1[i] = Coeff*K*(T1[i] - Tp[i])*Surf_ext; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1); else hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2]; end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2); rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2); + gamma_e[i] = 1/diff_res_e[i]; gamma_s[i] = 1/diff_res_s[i]; + if i == 1 then diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i]; Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0; - else + else diff_res_e[i] = diff_res[i]; Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]); end if; + if i == N - 1 then diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1]; Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0; @@ -195,44 +234,80 @@ equation else diff_res_e[i] = 1/gamma0; diff_res_s[i] = 1/gamma0; + re[i] = 0; rs[i] = 0; + gamma_e[i] = gamma0; gamma_s[i] = gamma0; + Je[i] = 0; Js[i] = 0; end if; + J[i] = Je[i] + Js[i]; -/* Fluid thermodynamic properties */ - T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, 0, Xco2, Xh2o, Xo2, Xso2); + + /* Fluid thermodynamic properties */ + state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=C1.Xi); + T1[i] = Medium.temperature(state1[i]); end for; -/* Momentum balance equations (hydraulic nodes) */ + + /* Momentum balance equations (hydraulic nodes) */ for i in 1:N loop -/* Pressure losses */ - P[i] - P[i + 1] = DPc/N*ThermoSysPro.Functions.ThermoSquare(Q[i], eps)/rho2[i]; -/* Diffusion resistance */ + /* Pressure losses */ + P[i] - P[i + 1] = DPc/N*ThermoSysPro.Functions.ThermoSquare(Q[i],eps)/rho2[i]; + + /* Diffusion resistance */ diff_res[i] = 1/gamma_diff/N; gamma[i] = if diffusion then 1/diff_res[i] else gamma0; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ + state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=C1.Xi); + if (p_rho > 0) then rho2[i] = p_rho; else - rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2); + rho2[i] = Medium.density(state2[i]); end if; - T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2); + + T2[i] = Medium.temperature(state2[i]); end for; -/* Total heat exchange coefficient ??? */ + + /* Total heat exchange coefficient ??? */ 0 = noEvent(if (abs(Q[1]) >= Qmin) then K - (Kc + Kr)*Encras else K - Kdef); -/* Convective and radiative heat exchange coefficients */ + + /* Convective and radiative heat exchange coefficients */ Kc = sum(Kcc)*Surf_ext/Surf_tot; Kr = sum(Krr)*Surf_ext/Surf_tot; -/* Total power exchanged */ + + /* Total power exchanged */ W = sum(dW1); -/* Total fluid diffusion resistance */ + + /* Total fluid diffusion resistance */ diff_res_t = sum(diff_res); - annotation( - Diagram(graphics = {Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Backward), Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}})}), - Icon(graphics = {Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Backward), Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}})}), + + annotation (Diagram(graphics={ + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Backward), + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}})}), + Icon(graphics={ + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Backward), + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}})}), Documentation(revisions = " Author @@ -242,4 +317,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end StaticWallFlueGasesExchanger; \ No newline at end of file +end StaticWallFlueGasesExchanger; From 6d8a58e4faeefbb4e37beabafba21a02bcd823bb Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:50:52 +0200 Subject: [PATCH 189/213] #125 port dynamic Fluid heat exchanger core medium support onto develop --- .../HeatExchangers/DynamicOnePhaseFlowPipe.mo | 416 +++++++---- .../DynamicOnePhaseFlowShell.mo | 538 ++++++++++---- .../HeatExchangers/DynamicTwoPhaseFlowPipe.mo | 604 ++++++++++------ .../DynamicTwoPhaseFlowRiser.mo | 680 ++++++++++++------ 4 files changed, 1486 insertions(+), 752 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo index eac7d57c..9b6e13a9 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo @@ -1,116 +1,152 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicOnePhaseFlowPipe "Dynamic one-phase flow pipe" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 10. "Pipe length"; - parameter Units.SI.Diameter D = 0.2 "Internal pipe diameter"; - parameter Real rugosrel = 0.0007 "Pipe relative roughness"; - parameter Integer ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.Position z1 = 0 "Pipe inlet altitude"; - parameter Units.SI.Position z2 = 0 "Pipe outlet altitude"; - parameter Real CSailettes = 1 "Increase/decrease factor of the heat exchange surface for solar receiver or boiler "; - parameter Real dpfCorr = 1.00 "Corrective term for the friction pressure loss (dpf) for each node"; - parameter Real hcCorr = 1.00 "Corrective term for the heat exchange coefficient (hc) for each node"; - parameter Integer Ns = 10 "Number of segments"; - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fluid initial pressure (active if steady_state = false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Units.SI.Temperature T0[Ns] = fill(290, Ns) "Initial fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Fluid pressure in node i"; - Units.SI.MassFlowRate Q[N](start = fill(10, N), nominal = fill(10, N)) "Mass flow rate in node i"; - Units.SI.SpecificEnthalpy h[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e6, N + 1)) "Fluid specific enthalpy in node i"; - Units.SI.SpecificEnthalpy hb[N] "Fluid specific enthalpy at the boundary of node i"; - Units.SI.Density rho1[N - 1](start = fill(998, N - 1), nominal = fill(1, N - 1)) "Fluid density in thermal node i"; - Units.SI.Density rho2[N](start = fill(998, N), nominal = fill(1, N)) "Fluid density in hydraulic node i"; - Units.SI.Density rhoc[N + 1](start = fill(998, N + 1), nominal = fill(1, N + 1)) "Fluid density at the boudary of node i"; - Units.SI.MassFlowRate BQ[N - 1] "Right hand side of the mass balance equation for thermal node i"; - Units.SI.Power BH[N - 1] "Right hand side of the energy balance equation for thermal node i"; - Units.SI.Power dW1_conv[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Convection thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1_diff[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Diffusion thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Thermal power exchanged on the water side for node i"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Units.SI.Length L=10. "Pipe length"; + parameter Units.SI.Diameter D=0.2 "Internal pipe diameter"; + parameter Real rugosrel=0.0007 "Pipe relative roughness"; + parameter Integer ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.Position z1=0 "Pipe inlet altitude"; + parameter Units.SI.Position z2=0 "Pipe outlet altitude"; + parameter Real CSailettes=1 "Increase/decrease factor of the heat exchange surface for solar receiver or boiler "; + parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node"; + parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node"; + parameter Integer Ns=10 "Number of segments"; + parameter Units.SI.AbsolutePressure P0=1.e5 + "Fluid initial pressure (active if steady_state = false)" + annotation (Evaluate=true, Dialog(enable=not steady_state)); + parameter Units.SI.Temperature T0[Ns]=fill(290, Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; + parameter Units.SI.Area A=ntubes*pi*D^2/4 + "Internal cross sectional pipe area"; + parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter"; + parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node"; + parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node"; + parameter Units.SI.Area dSi=pi*Di*dx1*CSailettes + "Internal heat exchange area for a node"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5, + N + 1)) "Fluid pressure in node i"; + Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N)) + "Mass flow rate in node i"; + Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6, + N + 1)) "Fluid specific enthalpy in node i"; + Units.SI.SpecificEnthalpy hb[N] + "Fluid specific enthalpy at the boundary of node i"; + Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1)) + "Fluid density in thermal node i"; + Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N)) + "Fluid density in hydraulic node i"; + Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1)) + "Fluid density at the boudary of node i"; + Units.SI.MassFlowRate BQ[N - 1] + "Right hand side of the mass balance equation for thermal node i"; + Units.SI.Power BH[N - 1] + "Right hand side of the energy balance equation for thermal node i"; + Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Convection thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Diffusion thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1)) + "Thermal power exchanged on the water side for node i"; Units.SI.Power W1t "Total power exchanged on the water side"; - Units.SI.Temperature Tp[N - 1](start = T0) "Wall temperature in node i"; - Units.SI.CoefficientOfHeatTransfer hc[N - 1](start = fill(2000, N - 1), nominal = fill(200, N - 1)) "Fluid heat exchange coefficient in node i"; - Units.SI.ReynoldsNumber Re1[N - 1](start = fill(6.e4, N - 1), nominal = fill(0.5e4, N - 1)) "Fluid Reynolds number in thermal node i"; - Units.SI.ReynoldsNumber Re2[N](start = fill(6.e4, N), nominal = fill(0.5e4, N)) "Fluid Reynolds number in hydraulic node i"; - Real Pr[N - 1](start = fill(4, N - 1), nominal = fill(1, N - 1)) "Fluid Prandtl number in node i"; - Units.SI.ThermalConductivity k1[N - 1](start = fill(0.6, N - 1), nominal = fill(0.6, N - 1)) "Fluid thermal conductivity in thermal node i"; - Units.SI.ThermalConductivity k2[N](start = fill(0.6, N), nominal = fill(0.6, N)) "Fluid thermal conductivity in hydraulic node i"; - Units.SI.DynamicViscosity mu1[N - 1](start = fill(2.e-4, N - 1), nominal = fill(2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i"; - Units.SI.DynamicViscosity mu2[N](start = fill(2.e-4, N), nominal = fill(2.e-4, N)) "Fluid dynamic viscosity in hydraulic node i"; - Units.SI.SpecificHeatCapacity cp1[N - 1](start = fill(4000, N - 1), nominal = fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i"; - Units.SI.SpecificHeatCapacity cp2[N](start = fill(4000, N), nominal = fill(4000, N)) "Fluid specific heat capacity in hydraulic node i"; + Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i"; + Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal= + fill(200, N - 1)) "Fluid heat exchange coefficient in node i"; + Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill( + 0.5e4, N - 1)) "Fluid Reynolds number in thermal node i"; + Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N)) + "Fluid Reynolds number in hydraulic node i"; + Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1)) + "Fluid Prandtl number in node i"; + Units.SI.ThermalConductivity k1[N - 1](start=fill(0.6, N - 1), nominal=fill( + 0.6, N - 1)) "Fluid thermal conductivity in thermal node i"; + Units.SI.ThermalConductivity k2[N](start=fill(0.6, N), nominal=fill(0.6, N)) + "Fluid thermal conductivity in hydraulic node i"; + Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill( + 2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i"; + Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N)) + "Fluid dynamic viscosity in hydraulic node i"; + Units.SI.SpecificHeatCapacity cp1[N - 1](start=fill(4000, N - 1), nominal= + fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i"; + Units.SI.SpecificHeatCapacity cp2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Fluid specific heat capacity in hydraulic node i"; Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i"; Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i"; - ThermoSysPro.Units.SI.PressureDifference dpa[N] "Advection term for the mass balance equation in node i"; - ThermoSysPro.Units.SI.PressureDifference dpf[N] "Friction pressure loss in node i"; - ThermoSysPro.Units.SI.PressureDifference dpg[N] "Gravity pressure loss in node i"; + ThermoSysPro.Units.SI.PressureDifference dpa[N] + "Advection term for the mass balance equation in node i"; + ThermoSysPro.Units.SI.PressureDifference dpf[N] + "Friction pressure loss in node i"; + ThermoSysPro.Units.SI.PressureDifference dpg[N] + "Gravity pressure loss in node i"; Real khi[N] "Hydraulic pressure loss coefficient in node i"; - Real lambda[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Friction pressure loss coefficient in node i"; + Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Friction pressure loss coefficient in node i"; Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative srt. enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res[N] "Diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i"; - Units.SI.MassFlowRate gamma[N] "Total diffusion conductance in hydraulic node i"; - Units.SI.MassFlowRate gamma_e[N - 1] "Diffusion conductance at inlet of thermal node i"; - Units.SI.MassFlowRate gamma_s[N - 1] "Diffusion conductance at outlet of thermal node i"; - Units.SI.Power Je[N - 1] "Thermal power diffusion from inlet of thermal node i"; - Units.SI.Power Js[N - 1] "Thermal power diffusion from outlet of thermal node i"; + Units.SI.MassFlowRate gamma[N] + "Total diffusion conductance in hydraulic node i"; + Units.SI.MassFlowRate gamma_e[N - 1] + "Diffusion conductance at inlet of thermal node i"; + Units.SI.MassFlowRate gamma_s[N - 1] + "Diffusion conductance at outlet of thermal node i"; + Units.SI.Power Je[N - 1] + "Thermal power diffusion from inlet of thermal node i"; + Units.SI.Power Js[N - 1] + "Thermal power diffusion from outlet of thermal node i"; Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i"; Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i"; Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation( - Placement(transformation(extent = {{-10, 20}, {10, 40}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer N = Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; - parameter Units.SI.Area A = ntubes*pi*D^2/4 "Internal cross sectional pipe area"; - parameter Units.SI.Diameter Di = ntubes*D "Internal pipe diameter"; - parameter Units.SI.PathLength dx1 = L/(N - 1) "Length of a thermal node"; - parameter Units.SI.PathLength dx2 = L/N "Length of a hydraulic node"; - parameter Units.SI.Area dSi = pi*Di*dx1*CSailettes "Internal heat exchange area for a node"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] + annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -120,7 +156,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P0, T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(P0, T0[i-1], X); end for; else for i in 2:N loop @@ -128,57 +164,68 @@ initial equation end for; end if; end if; + if dynamic_mass_balance then for i in 2:N loop der(P[i]) = 0; end for; end if; end if; + if inertia then for i in 1:N loop der(Q[i]) = 0; end for; end if; + equation -/* Wall temperature */ + + /* Wall temperature */ Tp = CTh.T; CTh.W = dW1; -/* Pipe boundaries */ + + /* Pipe boundaries */ P[1] = C1.P; P[N + 1] = C2.P; + Q[1] = C1.Q; Q[N] = C2.Q; + hb[1] = C1.h; hb[N] = C2.h; + h[1] = C1.h_vol_1; h[N + 1] = C2.h_vol_2; + C1.h_vol_2 = h[2]; C2.h_vol_1 = h[N]; + C2.diff_on_1 = diffusion; C1.diff_on_2 = diffusion; + C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - ftype = C1.ftype; - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; -/* Mass and energy balance equations (thermal nodes) */ + + C1.SubC = C2.SubC; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop -/* Mass balance equation */ + /* Mass balance equation */ BQ[i] = Q[i] - Q[i + 1]; + if dynamic_energy_balance and dynamic_mass_balance then A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i]; else 0 = BQ[i]; end if; -/* Energy balance equation */ + + /* Energy balance equation */ BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i]; + if dynamic_energy_balance then if dynamic_mass_balance then if simplified_dynamic_energy_balance then @@ -192,32 +239,40 @@ equation else 0 = BH[i]; end if; -/* Heat transfer at the wall */ + + /* Heat transfer at the wall */ dW1_conv[i] = hc[i]*dSi*(Tp[i] - T1[i]); dW1_diff[i] = 2*pi*dx1*ntubes*k1[i]*(Tp[i] - T1[i]); + dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0); -/* Heat exchange coefficient (using the Dittus-Boelter correlation) */ + + /* Heat exchange coefficient (using the Dittus-Boelter correlation) */ if noEvent(Re1[i] > 2000) then hc[i] = hcCorr*0.023*k1[i]/D*Re1[i]^0.8*Pr[i]^0.4; else -// Dittus-Boelter correlation or Lévêque correlation for constant temperature - hc[i] = hcCorr*k1[i]/D*max(4.36, 0.023*Re1[i]^0.8*Pr[i]^0.4); + // Dittus-Boelter correlation or Lévêque correlation for constant temperature + hc[i] = hcCorr*k1[i]/D*max(4.36,0.023*Re1[i]^0.8*Pr[i]^0.4); end if; + Pr[i] = mu1[i]*cp1[i]/k1[i]; Re1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2/(pi*Di*mu1[i]))); -/* Diffusion power */ + + /* Diffusion power */ if diffusion then re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2); rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2); + gamma_e[i] = 1/diff_res_e[i]; gamma_s[i] = 1/diff_res_s[i]; + if i == 1 then diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i]; Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0; - else + else diff_res_e[i] = diff_res[i]; Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]); end if; + if i == N - 1 then diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1]; Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0; @@ -228,73 +283,136 @@ equation else diff_res_e[i] = 1/gamma0; diff_res_s[i] = 1/gamma0; + re[i] = 0; rs[i] = 0; + gamma_e[i] = gamma0; gamma_s[i] = gamma0; + Je[i] = 0; Js[i] = 0; end if; + J[i] = Je[i] + Js[i]; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1); else hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2]; end if; -/* Fluid thermodynamic properties */ - ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + /* Fluid thermodynamic properties */ + state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=X); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); + + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + cp1[i] = Medium.specificHeatCapacityCp(state1[i]); + mu1[i] = Medium.dynamicViscosity(state1[i]); + k1[i] = Medium.thermalConductivity(state1[i]); end for; -/* Momentum balance equations (hydraulic nodes) */ + + /* Momentum balance equations (hydraulic nodes) */ for i in 1:N loop -/* Momentum balance equation */ + /* Momentum balance equation */ if inertia then 1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i]; else P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0; end if; -/* Advection term */ + + /* Advection term */ if advection then dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2; else dpa[i] = 0; end if; -/* Gravity pressure losses */ + + /* Gravity pressure losses */ dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L; -/* Friction pressure losses */ + + /* Friction pressure losses */ dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rho2[i])); + khi[i] = lambda[i]*dx2/D; lambda[i] = if noEvent(Re2[i] > 1) then 0.25*(Modelica.Math.log10(13/Re2[i] + rugosrel/3.7/D))^(-2) else 0.01; Re2[i] = noEvent(abs(4*Q[i]/(pi*Di*mu2[i]))); -/* Diffusion resistance */ + + /* Diffusion resistance */ diff_res[i] = cp2[i]*dx2/A/k2[i]; gamma[i] = if diffusion then 1/diff_res[i] else gamma0; -/* Fluid thermodynamic properties */ - rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + /* Fluid thermodynamic properties */ + state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=X); + + rho2[i] = Medium.density(state2[i]); + T2[i] = Medium.temperature(state2[i]); + cp2[i] = Medium.specificHeatCapacityCp(state2[i]); + mu2[i] = Medium.dynamicViscosity(state2[i]); + k2[i] = Medium.thermalConductivity(state2[i]); end for; -/* Fluid densities at the boundaries of the nodes */ + + /* Fluid densities at the boundaries of the nodes */ for i in 2:N loop rhoc[i] = rho1[i - 1]; end for; - rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1], h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + rhoc[1] = Medium.density_phX(p=P[1],h=h[1],X=X); + rhoc[N + 1] = Medium.density_phX(p=P[N + 1],h=h[N + 1],X=X); + W1t = sum(dW1); -/* Total fluid diffusion resistance */ + + /* Total fluid diffusion resistance */ diff_res_t = sum(diff_res); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}}), Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}}), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {28, 108, 200}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Line(points = {{60, 20}, {60, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{-60, 20}, {-60, -20}})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere else FillPattern.Solid)), Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}})}), - Window(x = 0.18, y = 0.05, width = 0.68, height = 0.94), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}}), + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}}), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={28,108,200}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Line(points={{60,20},{60,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{-60,20},{-60,-20}})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor= {0,0,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.Sphere + else FillPattern.Solid)), + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}})}), + Window( + x=0.18, + y=0.05, + width=0.68, + height=0.94), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -305,4 +423,4 @@ Daniel Bouskela Baligh El Hefni ")); -end DynamicOnePhaseFlowPipe; \ No newline at end of file +end DynamicOnePhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo index 6895fe61..53d1544a 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo @@ -1,115 +1,147 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicOnePhaseFlowShell "Dynamic one-phase flow shell" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Integer option_arrangement = 1 "1:triangle - 2: square"; - parameter Units.SI.Length L = 12 "Shell length"; - parameter Units.SI.Diameter Ds = 1 "Shell internal diameter"; - parameter Units.SI.Diameter De = 0.019 "Tube external diameter"; - parameter Units.SI.Distance dc = 0.03 "Central distance of two tubes"; - parameter Units.SI.Length B = 1.2 "Distance between two plates in the shell"; - parameter Real rugosrel = 0.0007 "Pipe relative roughness"; - parameter Integer ntubes = 500 "Number of pipes in parallel"; - parameter Units.SI.Position z1 = 0 "Pipe inlet altitude"; - parameter Units.SI.Position z2 = 0 "Pipe outlet altitude"; - parameter Real CSailettes = 1 "Increase/Decrease factor of the heat exchange surface for Solar Receiver or Boiler "; - parameter Real dpfCorr = 1.00 "Corrective term for the friction pressure loss (dpf) for each node"; - parameter Real hcCorr = 1.00 "Corrective term for the heat exchange coefficient (hc) for each node"; - parameter Integer Ns = 10 "Number of segments"; - parameter Units.SI.Temperature T0[Ns] = fill(290, Ns) "Initial fluid temperature (active if steady_state = false and option_temperature = 1)"; - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)"; - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Fluid pressure in node i"; - Units.SI.MassFlowRate Q[N](start = fill(10, N), nominal = fill(10, N)) "Mass flow rate in node i"; - Units.SI.SpecificEnthalpy h[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e6, N + 1)) "Fluid specific enthalpy in node i"; - Units.SI.SpecificEnthalpy hb[N] "Fluid specific enthalpy at the boundary of node i"; - Units.SI.Density rho1[N - 1](start = fill(998, N - 1), nominal = fill(1, N - 1)) "Fluid density in thermal node i"; - Units.SI.Density rho2[N](start = fill(998, N), nominal = fill(1, N)) "Fluid density in hydraulic node i"; - Units.SI.Density rhoc[N + 1](start = fill(998, N + 1), nominal = fill(1, N + 1)) "Fluid density at the boundary of node i"; - Units.SI.MassFlowRate BQ[N - 1] "Right hand side of the mass balance equation for thermal node i"; - Units.SI.Power BH[N - 1] "Right hand side of the energy balance equation for thermal node i"; - Units.SI.Power dW1_conv[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Convection thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1_diff[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Diffusion thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Thermal power exchanged on the water side for node i"; + parameter Units.SI.Length L=12 "Shell length"; + parameter Units.SI.Diameter Ds=1 "Shell internal diameter"; + parameter Units.SI.Diameter De=0.019 "Tube external diameter"; + parameter Units.SI.Distance dc=0.03 "Central distance of two tubes"; + parameter Units.SI.Length B=1.2 "Distance between two plates in the shell"; + parameter Real rugosrel=0.0007 "Pipe relative roughness"; + parameter Integer ntubes=500 "Number of pipes in parallel"; + parameter Units.SI.Position z1=0 "Pipe inlet altitude"; + parameter Units.SI.Position z2=0 "Pipe outlet altitude"; + parameter Real CSailettes=1 "Increase/Decrease factor of the heat exchange surface for Solar Receiver or Boiler "; + parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node"; + parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node"; + parameter Integer Ns=10 "Number of segments"; + parameter Units.SI.Temperature T0[Ns]=fill(290, Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature = 1)"; + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature = 2)"; + parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Integer Nb = integer(floor(L/B)); + parameter Units.SI.Distance dt=dc - De "Distance between two tubes"; + parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; + parameter Units.SI.Area As=B*Ds*dt/dc + "Maximum cross sectional area of flow in shell"; + parameter Units.SI.Area A=pi*Ds^2/4 - ntubes*pi*De^2/4 + "Liquid cross sectional in shell"; + parameter Units.SI.Diameter Deq=if (option_arrangement == 1) then (3.464*dc^2 + - pi*De^2)/(pi*De) else if (option_arrangement == 2) then (4*dc^2 - pi* + De^2)/(pi*De) else De + "Equivalent diameter of triangle arrangement between tubes"; + parameter Units.SI.Area dSi=pi*De*ntubes*dx1*CSailettes + "Internal heat exchange area for a node"; + parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node"; + parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5, + N + 1)) "Fluid pressure in node i"; + Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N)) + "Mass flow rate in node i"; + Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6, + N + 1)) "Fluid specific enthalpy in node i"; + Units.SI.SpecificEnthalpy hb[N] + "Fluid specific enthalpy at the boundary of node i"; + Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1)) + "Fluid density in thermal node i"; + Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N)) + "Fluid density in hydraulic node i"; + Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1)) + "Fluid density at the boundary of node i"; + Units.SI.MassFlowRate BQ[N - 1] + "Right hand side of the mass balance equation for thermal node i"; + Units.SI.Power BH[N - 1] + "Right hand side of the energy balance equation for thermal node i"; + Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Convection thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Diffusion thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1)) + "Thermal power exchanged on the water side for node i"; Units.SI.Power W1t "Total power exchanged on the water side"; - Units.SI.Temperature Tp[N - 1](start = T0) "Wall temperature in node i"; - Units.SI.CoefficientOfHeatTransfer hc[N - 1](start = fill(2000, N - 1), nominal = fill(200, N - 1)) "Fluid heat exchange coefficient in node i"; - Units.SI.ReynoldsNumber Re1[N - 1](start = fill(6.e4, N - 1), nominal = fill(0.5e4, N - 1)) "Fluid Reynolds number in thermal node i"; - Units.SI.ReynoldsNumber Re2[N](start = fill(6.e4, N), nominal = fill(0.5e4, N)) "Fluid Reynolds number in hydraulic node i"; - Real Pr[N - 1](start = fill(4, N - 1), nominal = fill(1, N - 1)) "Fluid Prandtl number in node i"; - Units.SI.ThermalConductivity k1[N - 1](start = fill(0.6, N - 1), nominal = fill(0.6, N - 1)) "Fluid thermal conductivity in thermal node i"; - Units.SI.ThermalConductivity k2[N](start = fill(0.6, N), nominal = fill(0.6, N)) "Fluid thermal conductivity in hydraulic node i"; - Units.SI.DynamicViscosity mu1[N - 1](start = fill(2.e-4, N - 1), nominal = fill(2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i"; - Units.SI.DynamicViscosity mu2[N](start = fill(2.e-4, N), nominal = fill(2.e-4, N)) "Fluid dynamic viscosity in hydraulic node i"; - Units.SI.SpecificHeatCapacity cp1[N - 1](start = fill(4000, N - 1), nominal = fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i"; - Units.SI.SpecificHeatCapacity cp2[N](start = fill(4000, N), nominal = fill(4000, N)) "Fluid specific heat capacity in hydraulic node i"; + Units.SI.Temperature Tp[N - 1](start=T0) "Wall temperature in node i"; + Units.SI.CoefficientOfHeatTransfer hc[N - 1](start=fill(2000, N - 1), nominal= + fill(200, N - 1)) "Fluid heat exchange coefficient in node i"; + Units.SI.ReynoldsNumber Re1[N - 1](start=fill(6.e4, N - 1), nominal=fill( + 0.5e4, N - 1)) "Fluid Reynolds number in thermal node i"; + Units.SI.ReynoldsNumber Re2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N)) + "Fluid Reynolds number in hydraulic node i"; + Real Pr[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1)) + "Fluid Prandtl number in node i"; + Units.SI.ThermalConductivity k1[N - 1](start=fill(0.6, N - 1), nominal=fill( + 0.6, N - 1)) "Fluid thermal conductivity in thermal node i"; + Units.SI.ThermalConductivity k2[N](start=fill(0.6, N), nominal=fill(0.6, N)) + "Fluid thermal conductivity in hydraulic node i"; + Units.SI.DynamicViscosity mu1[N - 1](start=fill(2.e-4, N - 1), nominal=fill( + 2.e-4, N - 1)) "Fluid dynamic viscosity in thermal node i"; + Units.SI.DynamicViscosity mu2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N)) + "Fluid dynamic viscosity in hydraulic node i"; + Units.SI.SpecificHeatCapacity cp1[N - 1](start=fill(4000, N - 1), nominal= + fill(4000, N - 1)) "Fluid specific heat capacity in thermal node i"; + Units.SI.SpecificHeatCapacity cp2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Fluid specific heat capacity in hydraulic node i"; Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i"; Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i"; - ThermoSysPro.Units.SI.PressureDifference dpa[N] "Advection term for the mass balance equation in node i"; - ThermoSysPro.Units.SI.PressureDifference dpf[N] "Friction pressure loss in node i"; - ThermoSysPro.Units.SI.PressureDifference dpg[N] "Gravity pressure loss in node i"; - Real lambda[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Friction pressure loss coefficient in node i"; + ThermoSysPro.Units.SI.PressureDifference dpa[N] + "Advection term for the mass balance equation in node i"; + ThermoSysPro.Units.SI.PressureDifference dpf[N] + "Friction pressure loss in node i"; + ThermoSysPro.Units.SI.PressureDifference dpg[N] + "Gravity pressure loss in node i"; + Real lambda[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Friction pressure loss coefficient in node i"; Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res[N] "Diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i"; - Units.SI.MassFlowRate gamma[N] "Total diffusion conductance in hydraulic node i"; - Units.SI.MassFlowRate gamma_e[N - 1] "Diffusion conductance at inlet of thermal node i"; - Units.SI.MassFlowRate gamma_s[N - 1] "Diffusion conductance at outlet of thermal node i"; - Units.SI.Power Je[N - 1] "Thermal power diffusion from inlet of thermal node i"; - Units.SI.Power Js[N - 1] "Thermal power diffusion from outlet of thermal node i"; + Units.SI.MassFlowRate gamma[N] + "Total diffusion conductance in hydraulic node i"; + Units.SI.MassFlowRate gamma_e[N - 1] + "Diffusion conductance at inlet of thermal node i"; + Units.SI.MassFlowRate gamma_s[N - 1] + "Diffusion conductance at outlet of thermal node i"; + Units.SI.Power Je[N - 1] + "Thermal power diffusion from inlet of thermal node i"; + Units.SI.Power Js[N - 1] + "Thermal power diffusion from outlet of thermal node i"; Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i"; Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i"; Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation( - Placement(transformation(extent = {{-10, 20}, {10, 40}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer Nb = integer(floor(L/B)); - parameter Units.SI.Distance dt = dc - De "Distance between two tubes"; - parameter Integer N = Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; - parameter Units.SI.Area As = B*Ds*dt/dc "Maximum cross sectional area of flow in shell"; - parameter Units.SI.Area A = pi*Ds^2/4 - ntubes*pi*De^2/4 "Liquid cross sectional in shell"; - parameter Units.SI.Diameter Deq = if (option_arrangement == 1) then (3.464*dc^2 - pi*De^2)/(pi*De) else if (option_arrangement == 2) then (4*dc^2 - pi*De^2)/(pi*De) else De "Equivalent diameter of triangle arrangement between tubes"; - parameter Units.SI.Area dSi = pi*De*ntubes*dx1*CSailettes "Internal heat exchange area for a node"; - parameter Units.SI.PathLength dx1 = L/(N - 1) "Length of a thermal node"; - parameter Units.SI.PathLength dx2 = L/N "Length of a hydraulic node"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] + annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -119,7 +151,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(P[i], T0[i - 1], X); end for; else for i in 2:N loop @@ -127,59 +159,71 @@ initial equation end for; end if; end if; + if dynamic_mass_balance then for i in 2:N loop der(P[i]) = 0; end for; end if; end if; + if inertia then for i in 1:N loop der(Q[i]) = 0; end for; end if; + equation -/* dt must be positive */ - assert(dt > 0, "DynamicOnePhaseFlowShell: dt = dc - De must be positive"); -/* Wall temperature */ + + /* dt must be positive */ + assert( dt > 0, "DynamicOnePhaseFlowShell: dt = dc - De must be positive"); + + /* Wall temperature */ Tp = CTh.T; CTh.W = dW1; -/* Pipe boundaries */ + + /* Pipe boundaries */ P[1] = C1.P; P[N + 1] = C2.P; + Q[1] = C1.Q; Q[N] = C2.Q; + hb[1] = C1.h; hb[N] = C2.h; + h[1] = C1.h_vol_1; h[N + 1] = C2.h_vol_2; + C1.h_vol_2 = h[2]; C2.h_vol_1 = h[N]; + C2.diff_on_1 = diffusion; C1.diff_on_2 = diffusion; + C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - ftype = C1.ftype; - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; -/* Mass and energy balance equations (thermal nodes) */ + + C1.SubC = C2.SubC; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop -/* Mass balance equation */ + /* Mass balance equation */ BQ[i] = Q[i] - Q[i + 1]; + if dynamic_energy_balance and dynamic_mass_balance then A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i]; else 0 = BQ[i]; end if; -/* Energy balance equation */ + + /* Energy balance equation */ BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i]; + if dynamic_energy_balance then if dynamic_mass_balance then if simplified_dynamic_energy_balance then @@ -193,27 +237,35 @@ equation else 0 = BH[i]; end if; -/* Heat transfer at the wall */ + + /* Heat transfer at the wall */ dW1_conv[i] = hc[i]*dSi*(Tp[i] - T1[i]); dW1_diff[i] = 2*pi*dx1*ntubes*k1[i]*(Tp[i] - T1[i]); + dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0); -/* Heat exchange coefficient (using the Dittus-Boelter correlation) */ + + /* Heat exchange coefficient (using the Dittus-Boelter correlation) */ Pr[i] = mu1[i]*cp1[i]/k1[i]; Re1[i] = noEvent(abs(De*(Q[i] + Q[i + 1])/(2*As*mu1[i]))); + hc[i] = hcCorr*(noEvent(if (Re1[i] < 2000) then 0.5*(k1[i]/De)*Re1[i]^0.507*Pr[i]^0.33 else if ((Re1[i] > 2000) and (Re1[i] < 1e6)) then 0.36*(k1[i]/De)*Re1[i]^0.55*Pr[i]^0.33 else 0.023*k1[i]/De*Re1[i]^0.8*Pr[i]^0.4)); -/* Diffusion power */ + + /* Diffusion power */ if diffusion then re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2); rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2); + gamma_e[i] = 1/diff_res_e[i]; gamma_s[i] = 1/diff_res_s[i]; + if i == 1 then diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i]; Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0; - else + else diff_res_e[i] = diff_res[i]; Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]); end if; + if i == N - 1 then diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1]; Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0; @@ -224,72 +276,258 @@ equation else diff_res_e[i] = 1/gamma0; diff_res_s[i] = 1/gamma0; + re[i] = 0; rs[i] = 0; + gamma_e[i] = gamma0; gamma_s[i] = gamma0; + Je[i] = 0; Js[i] = 0; end if; + J[i] = Je[i] + Js[i]; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1); else hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2]; end if; -/* Fluid thermodynamic properties */ - ddph[i] = ThermoSysPro.Properties.Fluid.Density_derp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - ddhp[i] = ThermoSysPro.Properties.Fluid.Density_derh_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - rho1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - mu1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(P[i + 1], h[i + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + /* Fluid thermodynamic properties */ + state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=X); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); + + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + cp1[i] = Medium.specificHeatCapacityCp(state1[i]); + + mu1[i] = Medium.dynamicViscosity(state1[i]); + k1[i] = Medium.thermalConductivity(state1[i]); end for; -/* Momentum balance equations (hydraulic nodes) */ + + /* Momentum balance equations (hydraulic nodes) */ for i in 1:N loop -/* Momentum balance equation */ + /* Momentum balance equation */ if inertia then 1/As*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i]; else P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0; end if; -/* Advection term */ + + /* Advection term */ if advection then dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/As^2; else dpa[i] = 0; end if; -/* Gravity pressure losses */ + + /* Gravity pressure losses */ dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L; -/* Friction pressure losses */ - dpf[i] = noEvent(dpfCorr*Ds/dc*(Nb + 1)*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i])/N); - lambda[i] = Modelica.Math.exp(0.576 - 0.19*Modelica.Math.log(Re2[i])); + + /* Friction pressure losses */ + dpf[i] = noEvent(dpfCorr*Ds/dc*(Nb +1)*lambda[i]*Q[i]*abs(Q[i])/(2*As^2*rho2[i])/N); + lambda[i] = Modelica.Math.exp(0.576-0.19*Modelica.Math.log(Re2[i])); Re2[i] = noEvent(De*abs(Q[i])/(As*mu2[i])); -/* Diffusion resistance */ + + /* Diffusion resistance */ diff_res[i] = cp2[i]*dx2/A/k2[i]; gamma[i] = if diffusion then 1/diff_res[i] else gamma0; -/* Fluid thermodynamic properties */ - rho2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - cp2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - mu2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - k2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((P[i] + P[i + 1])/2, hb[i], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + /* Fluid thermodynamic properties */ + state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=X); + + rho2[i] = Medium.density(state2[i]); + T2[i] = Medium.temperature(state2[i]); + cp2[i] = Medium.specificHeatCapacityCp(state2[i]); + mu2[i] = Medium.dynamicViscosity(state2[i]); + k2[i] = Medium.thermalConductivity(state2[i]); end for; -/* Fluid densities at the boundaries of the nodes */ + + /* Fluid densities at the boundaries of the nodes */ for i in 2:N loop rhoc[i] = rho1[i - 1]; end for; - rhoc[1] = ThermoSysPro.Properties.Fluid.Density_Ph(P[1], h[1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); - rhoc[N + 1] = ThermoSysPro.Properties.Fluid.Density_Ph((P[N + 1]), h[N + 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + + rhoc[1] = Medium.density(Medium.setState_phX(p=P[1], h=h[1], X=X)); + rhoc[N + 1] = Medium.density(Medium.setState_phX(p=P[N + 1], h=h[N + 1], X=X)); + W1t = sum(dW1); -/* Total fluid diffusion resistance */ + + /* Total fluid diffusion resistance */ diff_res_t = sum(diff_res); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}}), Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}}), Rectangle(extent = {{-100, 30}, {100, -30}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {85, 170, 255}), Line(points = {{60, 10}, {60, -30}}, color = {0, 0, 0}, thickness = 1), Line(points = {{20, 30}, {20, -10}}, color = {0, 0, 0}, thickness = 1), Line(points = {{-20, 10}, {-20, -30}}, color = {0, 0, 0}, thickness = 1), Line(points = {{-60, 30}, {-60, -10}}, color = {0, 0, 0}, thickness = 1), Ellipse(extent = {{-31, -35}, {31, -95}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{14, -47}, {24, -57}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-24, -74}, {-14, -84}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{14, -73}, {24, -83}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-14, -60}, {-4, -70}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{6, -60}, {16, -70}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{18, -60}, {28, -70}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-12, -81}, {-2, -91}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{2, -82}, {12, -92}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-5, -50}, {5, -60}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{2, -39}, {12, -49}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-29, -61}, {-19, -71}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-12, -39}, {-2, -49}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Line(points = {{-20, 29}, {-20, 11}}, color = {255, 255, 255}), Line(points = {{-60, -10}, {-60, -30}}, color = {255, 255, 255}), Line(points = {{20, -10}, {20, -30}}, color = {255, 255, 255}), Line(points = {{60, 30}, {60, 11}}, color = {255, 255, 255}), Ellipse(extent = {{-4, -69}, {6, -79}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Ellipse(extent = {{-24, -47}, {-14, -57}}, lineColor = {0, 0, 0}, lineThickness = 1, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 30}, {100, -30}}, lineColor = {0, 0, 255}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), lineThickness = 0), Line(points = {{-60, 30}, {-60, -10}}, color = {0, 0, 0}, thickness = 1), Line(points = {{-20, 11}, {-20, -29}}, color = {0, 0, 0}, thickness = 1), Line(points = {{20, 30}, {20, -10}}, color = {0, 0, 0}, thickness = 1), Line(points = {{60, 10}, {60, -30}}, color = {0, 0, 0}, thickness = 1), Line(points = {{-60, -10}, {-60, -30}}, color = {255, 255, 255}), Line(points = {{-20, 29}, {-20, 11}}, color = {255, 255, 255}), Line(points = {{20, -10}, {20, -30}}, color = {255, 255, 255}), Line(points = {{60, 30}, {60, 11}}, color = {255, 255, 255})}), - Window(x = 0.18, y = 0.05, width = 0.68, height = 0.94), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}}), + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}}), + Rectangle( + extent={{-100,30},{100,-30}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={85,170,255}), + Line( + points={{60,10},{60,-30}}, + color={0,0,0}, + thickness=1), + Line( + points={{20,30},{20,-10}}, + color={0,0,0}, + thickness=1), + Line( + points={{-20,10},{-20,-30}}, + color={0,0,0}, + thickness=1), + Line( + points={{-60,30},{-60,-10}}, + color={0,0,0}, + thickness=1), + Ellipse( + extent={{-31,-35},{31,-95}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{14,-47},{24,-57}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-24,-74},{-14,-84}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{14,-73},{24,-83}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-14,-60},{-4,-70}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{6,-60},{16,-70}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{18,-60},{28,-70}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-12,-81},{-2,-91}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{2,-82},{12,-92}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-5,-50},{5,-60}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{2,-39},{12,-49}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-29,-61},{-19,-71}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-12,-39},{-2,-49}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-20,29},{-20,11}}, color={255,255,255}), + Line(points={{-60,-10},{-60,-30}}, color={255,255,255}), + Line(points={{20,-10},{20,-30}}, color={255,255,255}), + Line(points={{60,30},{60,11}}, color={255,255,255}), + Ellipse( + extent={{-4,-69},{6,-79}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-24,-47},{-14,-57}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,30},{100,-30}}, + lineColor={0,0,255}, + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + fillColor = DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + lineThickness=0), + Line( + points={{-60,30},{-60,-10}}, + color={0,0,0}, + thickness=1), + Line( + points={{-20,11},{-20,-29}}, + color={0,0,0}, + thickness=1), + Line( + points={{20,30},{20,-10}}, + color={0,0,0}, + thickness=1), + Line( + points={{60,10},{60,-30}}, + color={0,0,0}, + thickness=1), + Line(points={{-60,-10},{-60,-30}}, color={255,255,255}), + Line(points={{-20,29},{-20,11}}, color={255,255,255}), + Line(points={{20,-10},{20,-30}}, color={255,255,255}), + Line(points={{60,30},{60,11}}, color={255,255,255})}), + Window( + x=0.18, + y=0.05, + width=0.68, + height=0.94), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -303,4 +541,4 @@ Daniel Bouskela Jiahui LU ")); -end DynamicOnePhaseFlowShell; \ No newline at end of file +end DynamicOnePhaseFlowShell; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo index 858abb61..1d39b2fa 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo @@ -1,161 +1,218 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicTwoPhaseFlowPipe "Dynamic two-phase flow pipe" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 10. "Pipe length"; - parameter Units.SI.Diameter D = 0.2 "Internal pipe diameter"; - parameter Units.SI.Length rugosrel = 0.0007 "Pipe relative roughness"; - parameter Integer ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.Position z1 = 0 "Pipe inlet altitude"; - parameter Units.SI.Position z2 = 0 "Pipe outlet altitude"; - parameter Real rgliss = 1 "Phase slip coefficient"; - parameter Integer a = 4200 "Phase pressure loss coefficient"; - parameter Real dpfCorr = 1.00 "Corrective term for the friction pressure loss (dpf) for each node"; - parameter Integer Ns = 10 "Number of segments"; - parameter Units.SI.Temperature T0[Ns] = fill(300, Ns) "Initial fluid temperature (active if steady_state=false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection term - false: without advection term"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Fluid pressure in node i"; - Units.SI.MassFlowRate Q[N](start = fill(10, N), nominal = fill(10, N)) "Mass flow rate in node i"; - Units.SI.SpecificEnthalpy h[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e6, N + 1)) "Fluid specific enthalpy in node i"; - Units.SI.SpecificEnthalpy hb[N] "Fluid specific enthalpy at the boundary of node i"; - Units.SI.AbsolutePressure Pb[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Bounded fluid pressure in node i"; - Units.SI.Density rho1[N - 1](start = fill(998, N - 1), nominal = fill(1, N - 1)) "Fluid density in thermal node i"; - Units.SI.Density rho2[N](start = fill(998, N), nominal = fill(1, N)) "Fluid density in hydraulic node i"; - Units.SI.Density rhoc[N + 1](start = fill(998, N + 1), nominal = fill(1, N + 1)) "Fluid density at the boudary of node i"; - Units.SI.MassFlowRate BQ[N - 1] "Right hand side of the mass balance equation for thermal node i"; - Units.SI.Power BH[N - 1] "Right hand side of the energy balance equation for thermal node i"; - Units.SI.Power dW1_conv[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Convection thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1_diff[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Diffusion thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Thermal power exchanged on the liquid side for node i"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Length L=10. "Pipe length"; + parameter Units.SI.Diameter D=0.2 "Internal pipe diameter"; + parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness"; + parameter Integer ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.Position z1=0 "Pipe inlet altitude"; + parameter Units.SI.Position z2=0 "Pipe outlet altitude"; + parameter Real rgliss=1 "Phase slip coefficient"; + parameter Integer a=4200 "Phase pressure loss coefficient"; + parameter Real dpfCorr=1.00 + "Corrective term for the friction pressure loss (dpf) for each node"; + parameter Integer Ns=10 "Number of segments"; + parameter Units.SI.Temperature T0[Ns]=fill(300, Ns) + "Initial fluid temperature (active if steady_state=false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection term - false: without advection term"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Integer N=Ns + 1 + "Number of hydraulic nodes (= number of thermal nodes + 1)"; + parameter Units.SI.Area A=ntubes*pi*D^2/4 + "Internal cross sectional pipe area"; + parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter"; + parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node"; + parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node"; + parameter Units.SI.Area dSi=pi*Di*dx1 + "Internal heat exchange area for a node"; + parameter Real Mmol=18.015 "Water molar mass"; + parameter Units.SI.AbsolutePressure pcrit=Medium.fluidConstants[1].criticalPressure "Critical pressure"; + parameter Units.SI.Temperature Tcrit=Medium.fluidConstants[1].criticalTemperature "Critical temperature"; + parameter Units.SI.AbsolutePressure ptriple=Medium.fluidConstants[1].triplePointPressure "Triple point pressure"; + parameter Real xb1=0.0002 "Min value for vapor mass fraction"; + parameter Real xb2=0.85 "Max value for vapor mass fraction"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5, + N + 1)) "Fluid pressure in node i"; + Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N)) + "Mass flow rate in node i"; + Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6, + N + 1)) "Fluid specific enthalpy in node i"; + Units.SI.SpecificEnthalpy hb[N] + "Fluid specific enthalpy at the boundary of node i"; + Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill( + 1.e5, N + 1)) "Bounded fluid pressure in node i"; + Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1)) + "Fluid density in thermal node i"; + Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N)) + "Fluid density in hydraulic node i"; + Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1)) + "Fluid density at the boudary of node i"; + Units.SI.MassFlowRate BQ[N - 1] + "Right hand side of the mass balance equation for thermal node i"; + Units.SI.Power BH[N - 1] + "Right hand side of the energy balance equation for thermal node i"; + Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Convection thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Diffusion thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1)) + "Thermal power exchanged on the liquid side for node i"; Units.SI.Power W1t "Total power exchanged on the liquid side"; - Units.SI.Temperature Tp1[N - 1](each start = 500.0) "Wall temperature in node i"; - Units.SI.CoefficientOfHeatTransfer hi[N - 1](start = fill(2000, N - 1), nominal = fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i"; - Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start = fill(2000, N - 1), nominal = fill(200, N - 1)) "Fluid heat exchange coefficient in node i for the liquid fraction"; - Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start = fill(0, N - 1), nominal = fill(200, N - 1)) "Fluid heat exchange coefficient in node i for the vapor fraction"; + Units.SI.Temperature Tp1[N - 1](each start=500.0) + "Wall temperature in node i"; + Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal= + fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i"; + Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1), + nominal=fill(200, N - 1)) + "Fluid heat exchange coefficient in node i for the liquid fraction"; + Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal= + fill(200, N - 1)) + "Fluid heat exchange coefficient in node i for the vapor fraction"; Real S[N - 1] "Corrective term for nucleation removal"; Real E[N - 1] "Corrective term for hcl"; - Units.SI.CoefficientOfHeatTransfer heb[N - 1](start = fill(0, N - 1), nominal = fill(5.e5, N - 1)) "Fluid heat exchange coefficient for vaporization in thermal node i"; - Units.SI.ReynoldsNumber Rel1[N - 1](start = fill(6.e4, N - 1), nominal = fill(0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid"; - Units.SI.ReynoldsNumber Rel2[N](start = fill(6.e4, N), nominal = fill(0.5e4, N)) "Reynolds number in hydraulic node i for the liquid"; - Units.SI.ReynoldsNumber Rev1[N - 1](start = fill(0.1e4, N - 1), nominal = fill(5.e5, N - 1)) "Reynolds number in thermal node i for the vapor"; - Units.SI.ReynoldsNumber Rev2[N](start = fill(0.1e4, N), nominal = fill(5.e5, N)) "Reynolds number in hydraulic node i for the vapor"; - Real Prl[N - 1](start = fill(4, N - 1), nominal = fill(1, N - 1)) "Fluid Prandtl number in node i for the liquid"; - Real Prv[N - 1](start = fill(1, N - 1), nominal = fill(1, N - 1)) "Fluid Prandtl number in node i for the vapor"; - Units.SI.ThermalConductivity kl1[N - 1](start = fill(0.6, N - 1), nominal = fill(0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid"; - Units.SI.ThermalConductivity kl2[N](start = fill(0.6, N), nominal = fill(0.6, N)) "Thermal conductivity in hydraulic node i for the liquid"; - Units.SI.ThermalConductivity kv1[N - 1](start = fill(0.03, N - 1), nominal = fill(0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor"; - Units.SI.ThermalConductivity kv2[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Thermal conductivity in hydraulic node i for the vapor"; + Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal= + fill(5.e5, N - 1)) + "Fluid heat exchange coefficient for vaporization in thermal node i"; + Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill( + 0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid"; + Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N)) + "Reynolds number in hydraulic node i for the liquid"; + Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill( + 5.e5, N - 1)) "Reynolds number in thermal node i for the vapor"; + Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N)) + "Reynolds number in hydraulic node i for the vapor"; + Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1)) + "Fluid Prandtl number in node i for the liquid"; + Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1)) + "Fluid Prandtl number in node i for the vapor"; + Units.SI.ThermalConductivity kl1[N - 1](start=fill(0.6, N - 1), nominal=fill( + 0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid"; + Units.SI.ThermalConductivity kl2[N](start=fill(0.6, N), nominal=fill(0.6, N)) + "Thermal conductivity in hydraulic node i for the liquid"; + Units.SI.ThermalConductivity kv1[N - 1](start=fill(0.03, N - 1), nominal=fill( + 0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor"; + Units.SI.ThermalConductivity kv2[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Thermal conductivity in hydraulic node i for the vapor"; Real xv1[N - 1] "Vapor mass fraction in thermal node i"; Real xv2[N] "Vapor mass fraction in hydraulic node i"; Real xbs[N - 1] "Bounded upper value for the vapor mass fraction"; Real xbi[N - 1] "Bounded lower value for the vapor mass fraction"; - Units.SI.DynamicViscosity mul1[N - 1](start = fill(2.e-4, N - 1), nominal = fill(2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid"; - Units.SI.DynamicViscosity mul2[N](start = fill(2.e-4, N), nominal = fill(2.e-4, N)) "Dynamic viscosity in hydraulic node i for the liquid"; - Units.SI.DynamicViscosity muv1[N - 1](start = fill(1.e-5, N - 1), nominal = fill(1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor"; - Units.SI.DynamicViscosity muv2[N](start = fill(1.e-5, N), nominal = fill(1.e-4, N)) "Dynamic viscosity in hydraulic node i for the vapor"; - Units.SI.SpecificHeatCapacity cpl1[N - 1](start = fill(4000, N - 1), nominal = fill(4000, N - 1)) "Specific heat capacity in thermal node i for the liquid"; - Units.SI.SpecificHeatCapacity cpl2[N](start = fill(4000, N), nominal = fill(4000, N)) "Specific heat capacity in hydraulic node i for the liquid"; - Units.SI.SpecificHeatCapacity cpv1[N - 1](start = fill(2000, N - 1), nominal = fill(2000, N - 1)) "Specific heat capacity in thermal node i for the vapor"; - Units.SI.SpecificHeatCapacity cpv2[N](start = fill(4000, N), nominal = fill(4000, N)) "Specific heat capacity in hydraulic node i for the vapor"; - Real Bo[N - 1](start = fill(0, N - 1), nominal = fill(4.e-4, N - 1)) "Boiling number"; - Real Xtt[N - 1](start = fill(1, N - 1), nominal = fill(1, N - 1)) "Martinelli number"; - Units.SI.SpecificEnthalpy lv[N - 1](start = fill(2.e6, N - 1), nominal = fill(2.e6, N - 1)) "Specific enthalpy for vaporisation"; - Units.SI.Density rhol1[N - 1](start = fill(998, N - 1), nominal = fill(998, N - 1)) "Fluid density in thermal node i for the liquid"; - Units.SI.Density rhol2[N](start = fill(998, N), nominal = fill(998, N)) "Fluid density in hydraulic node i for the liquid"; - Units.SI.Density rhov1[N - 1](start = fill(1, N - 1), nominal = fill(1, N - 1)) "Fluid density in thermal node i for the vapor"; - Units.SI.Density rhov2[N](start = fill(1, N), nominal = fill(1, N)) "Fluid density in hydraulic node i for the vapor"; + Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill( + 2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid"; + Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N)) + "Dynamic viscosity in hydraulic node i for the liquid"; + Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill( + 1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor"; + Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N)) + "Dynamic viscosity in hydraulic node i for the vapor"; + Units.SI.SpecificHeatCapacity cpl1[N - 1](start=fill(4000, N - 1), nominal= + fill(4000, N - 1)) + "Specific heat capacity in thermal node i for the liquid"; + Units.SI.SpecificHeatCapacity cpl2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Specific heat capacity in hydraulic node i for the liquid"; + Units.SI.SpecificHeatCapacity cpv1[N - 1](start=fill(2000, N - 1), nominal= + fill(2000, N - 1)) + "Specific heat capacity in thermal node i for the vapor"; + Units.SI.SpecificHeatCapacity cpv2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Specific heat capacity in hydraulic node i for the vapor"; + Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1)) + "Boiling number"; + Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1)) + "Martinelli number"; + Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill( + 2.e6, N - 1)) "Specific enthalpy for vaporisation"; + Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1)) + "Fluid density in thermal node i for the liquid"; + Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N)) + "Fluid density in hydraulic node i for the liquid"; + Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1)) + "Fluid density in thermal node i for the vapor"; + Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N)) + "Fluid density in hydraulic node i for the vapor"; Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i"; Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i"; - ThermoSysPro.Units.SI.PressureDifference dpa[N] "Advection term for the mass balance equation in node i"; - ThermoSysPro.Units.SI.PressureDifference dpf[N] "Friction pressure loss in node i"; - ThermoSysPro.Units.SI.PressureDifference dpg[N] "Gravity pressure loss in node i"; + ThermoSysPro.Units.SI.PressureDifference dpa[N] + "Advection term for the mass balance equation in node i"; + ThermoSysPro.Units.SI.PressureDifference dpf[N] + "Friction pressure loss in node i"; + ThermoSysPro.Units.SI.PressureDifference dpg[N] + "Gravity pressure loss in node i"; Real khi[N] "Hydraulic pressure loss coefficient in node i"; - Real lambdal[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Friction pressure loss coefficient in node i for the liquid"; - Real lambdav[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Friction pressure loss coefficient in node i for the vapor)"; + Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Friction pressure loss coefficient in node i for the liquid"; + Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Friction pressure loss coefficient in node i for the vapor)"; Real filo[N] "Pressure loss coefficient for two-phase flow"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; + Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.ThermodynamicState state_c[2]; + Medium.SaturationProperties sat1[N - 1]; + Medium.SaturationProperties sat2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid"; Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor"; Real diff_res[N] "Total diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i"; - Units.SI.MassFlowRate gamma[N] "Total diffusion conductance in hydraulic node i"; - Units.SI.MassFlowRate gamma_e[N - 1] "Diffusion conductance at inlet of thermal node i"; - Units.SI.MassFlowRate gamma_s[N - 1] "Diffusion conductance at outlet of thermal node i"; - Units.SI.Power Je[N - 1] "Thermal power diffusion from inlet of thermal node i"; - Units.SI.Power Js[N - 1] "Thermal power diffusion from outlet of thermal node i"; + Units.SI.MassFlowRate gamma[N] + "Total diffusion conductance in hydraulic node i"; + Units.SI.MassFlowRate gamma_e[N - 1] + "Diffusion conductance at inlet of thermal node i"; + Units.SI.MassFlowRate gamma_s[N - 1] + "Diffusion conductance at outlet of thermal node i"; + Units.SI.Power Je[N - 1] + "Thermal power diffusion from inlet of thermal node i"; + Units.SI.Power Js[N - 1] + "Thermal power diffusion from outlet of thermal node i"; Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i"; Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i"; Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1] annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2] annotation( - Placement(transformation(extent = {{-20, 80}, {0, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N] annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N] annotation( - Placement(transformation(extent = {{80, -100}, {100, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N] annotation( - Placement(transformation(extent = {{40, -100}, {60, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1] annotation( - Placement(transformation(extent = {{-60, -100}, {-40, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1] annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] annotation( - Placement(transformation(extent = {{-10, 20}, {10, 40}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer N = Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; - parameter Units.SI.Area A = ntubes*pi*D^2/4 "Internal cross sectional pipe area"; - parameter Units.SI.Diameter Di = ntubes*D "Internal pipe diameter"; - parameter Units.SI.PathLength dx1 = L/(N - 1) "Length of a thermal node"; - parameter Units.SI.PathLength dx2 = L/N "Length of a hydraulic node"; - parameter Units.SI.Area dSi = pi*Di*dx1 "Internal heat exchange area for a node"; - parameter Real Mmol = 18.015 "Water molar mass"; - parameter Units.SI.AbsolutePressure pcrit = ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT "Critical pressure"; - parameter Units.SI.Temperature Tcrit = ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT "Critical temperature"; - parameter Units.SI.AbsolutePressure ptriple = ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple "Triple point pressure"; - parameter Real xb1 = 0.0002 "Min value for vapor mass fraction"; - parameter Real xb2 = 0.85 "Max value for vapor mass fraction"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort CTh[Ns] + annotation (Placement(transformation(extent={{-10,20},{10,40}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -165,7 +222,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(Pb[i], T0[i - 1], X); end for; else for i in 2:N loop @@ -173,67 +230,75 @@ initial equation end for; end if; end if; + if dynamic_mass_balance then for i in 2:N loop der(P[i]) = 0; end for; end if; end if; + if inertia then for i in 1:N loop der(Q[i]) = 0; end for; end if; + equation -/* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowPipe: the fluid type must be water/steam"); -/* Wall temperature */ + + /* Wall temperature */ Tp1 = CTh.T; CTh.W = dW1; -/* Pipe boundaries */ + + /* Pipe boundaries */ P[1] = C1.P; P[N + 1] = C2.P; + Q[1] = C1.Q; Q[N] = C2.Q; + hb[1] = C1.h; hb[N] = C2.h; + h[1] = C1.h_vol_1; h[N + 1] = C2.h_vol_2; + C1.h_vol_2 = h[2]; C2.h_vol_1 = h[N]; + Pb[1] = max(min(P[1], pcrit - 1), ptriple); Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple); + C2.diff_on_1 = diffusion; C1.diff_on_2 = diffusion; + C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - ftype = C1.ftype; - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; -/* Mass and energy balance equations (thermal nodes) */ + + C1.Xi = C2.Xi; + X = C1.Xi; + C1.SubC = C2.SubC; + + /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop -/* Mass balance equation */ + /* Mass balance equation */ BQ[i] = Q[i] - Q[i + 1]; + if dynamic_energy_balance and dynamic_mass_balance then - A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i]; + A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i]; else 0 = BQ[i]; end if; -/* Energy balance equation */ + + /* Energy balance equation */ BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + J[i]; + if dynamic_energy_balance then if dynamic_mass_balance then if simplified_dynamic_energy_balance then A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i]; else - A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; + A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; end if; else A*rho1[i]*der(h[i + 1])*dx1 = BH[i]; @@ -241,12 +306,15 @@ equation else 0 = BH[i]; end if; -/* Heat transfer at the wall */ + + /* Heat transfer at the wall */ dW1_conv[i] = hi[i]*dSi*(Tp1[i] - T1[i]); dW1_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp1[i] - T1[i]); + dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0); + if noEvent(xv1[i] < xb1) then - hi[i] = if noEvent((P[i + 1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]); + hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]); Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1; elseif noEvent(xv1[i] > xb2) then hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*hcl[i] + S[i]*heb[i]); @@ -255,29 +323,37 @@ equation hi[i] = E[i]*hcl[i] + S[i]*heb[i]; Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1; end if; + E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1; Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4*(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5); S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0); heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)^0.67 else 100); + hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl1[i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0); hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv1[i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0); + Prl[i] = mul1[i]*cpl1[i]/kl1[i]; Prv[i] = muv1[i]*cpv1[i]/kv1[i]; + Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i]))); Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i]))); -/* Diffusion power */ + + /* Diffusion power */ if diffusion then re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2); rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2); + gamma_e[i] = 1/diff_res_e[i]; gamma_s[i] = 1/diff_res_s[i]; + if i == 1 then diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i]; Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0; - else + else diff_res_e[i] = diff_res[i]; Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]); end if; + if i == N - 1 then diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1]; Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0; @@ -288,72 +364,94 @@ equation else diff_res_e[i] = 1/gamma0; diff_res_s[i] = 1/gamma0; + re[i] = 0; rs[i] = 0; + gamma_e[i] = gamma0; gamma_s[i] = gamma0; + Je[i] = 0; Js[i] = 0; end if; + J[i] = Je[i] + Js[i]; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1); else hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2]; end if; -/* Fluid thermodynamic properties */ - pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid); - rho1[i] = pro1[i].d; - T1[i] = pro1[i].T; - xv1[i] = if noEvent((P[i + 1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x; - (lsat1[i], vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid); - if noEvent((P[i + 1] > pcrit) or (T1[i] > Tcrit)) then - xbs[i] = 0; - xbi[i] = 1; - rhol1[i] = pro1[i].d; - rhov1[i] = pro1[i].d; - cpl1[i] = pro1[i].cp; - cpv1[i] = pro1[i].cp; - lv[i] = 1; + + /* Fluid thermodynamic properties */ + state1[i] = Medium.setState_phX(P[i + 1], h[i + 1], X); + + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else Medium.vapourQuality(state1[i]); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); + + sat1[i] = Medium.setSat_p(P[i + 1]); + + if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then + xbs[i] = 0; + xbi[i] = 1; + rhol1[i] = rho1[i]; + rhov1[i] = rho1[i]; + cpl1[i] = Medium.specificHeatCapacityCp(state1[i]); + cpv1[i] = Medium.specificHeatCapacityCp(state1[i]); + lv[i] = 1; else - xbs[i] = min(pro1[i].x, 0.90); - xbi[i] = max(pro1[i].x, 0.10); - rhol1[i] = max(pro1[i].d, lsat1[i].rho); - rhov1[i] = min(pro1[i].d, vsat1[i].rho); - cpl1[i] = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp; - cpv1[i] = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp; - lv[i] = vsat1[i].h - lsat1[i].h; + xbs[i] = min(xv1[i], 0.90); + xbi[i] = max(xv1[i], 0.10); + rhol1[i] = max(rho1[i], Medium.bubbleDensity(sat1[i])); + rhov1[i] = min(rho1[i], Medium.dewDensity(sat1[i])); + cpl1[i] = if noEvent(xv1[i] <= 0.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat1[i])); + cpv1[i] = if noEvent(xv1[i] >= 1.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat1[i])); + lv[i] = Medium.dewEnthalpy(sat1[i]) - Medium.bubbleEnthalpy(sat1[i]); end if; - mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid); - muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid); - kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid); - kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid); + + mul1[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat1[i])); + muv1[i] = Medium.dynamicViscosity(Medium.setDewState(sat1[i])); + + kl1[i] = Medium.thermalConductivity(Medium.setBubbleState(sat1[i])); + kv1[i] = Medium.thermalConductivity(Medium.setDewState(sat1[i])); + Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple); end for; -/* Momentum balance equations (hydraulic nodes) */ + + /* Momentum balance equations (hydraulic nodes) */ for i in 1:N loop -/* Momentum balance equation */ + /* Momentum balance equation */ if inertia then 1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i]; else P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0; end if; -/* Advection term */ + + /* Advection term */ if advection then dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2; else dpa[i] = 0; end if; -/* Gravity pressure losses */ + + /* Gravity pressure losses */ dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L; -/* Friction pressure losses */ + + /* Friction pressure losses */ dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i])); + khi[i] = filo[i]*lambdal[i]*dx2/D; + lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01; lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01; + Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i]))); Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i]))); + if noEvent(xv2[i] < 0) then filo[i] = 1; else @@ -363,50 +461,110 @@ equation filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i]; end if; end if; -/* Diffusion resistance */ -// diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i]; -// diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i]; + + /* Diffusion resistance */ + // diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i]; + // diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i]; diff_res_l[i] = 1*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i]; diff_res_v[i] = 0*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i]; + diff_res[i] = diff_res_l[i] + diff_res_v[i]; gamma[i] = if diffusion then 1/diff_res[i] else gamma0; -/* Fluid thermodynamic properties */ - pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i], mode, fluid); - rho2[i] = pro2[i].d; - xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x; - T2[i] = pro2[i].T; - (lsat2[i], vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid); - if noEvent((P[i + 1] > pcrit) or (T2[i] > Tcrit)) then - rhol2[i] = pro2[i].d; - rhov2[i] = pro2[i].d; - cpl2[i] = pro2[i].cp; - cpv2[i] = pro2[i].cp; + + /* Fluid thermodynamic properties */ + state2[i] = Medium.setState_phX((P[i] + P[i + 1])/2, hb[i], X); + + rho2[i] = Medium.density(state2[i]); + xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else Medium.vapourQuality(state2[i]); + T2[i] = Medium.temperature(state2[i]); + + sat2[i] = Medium.setSat_p((P[i] + P[i + 1])/2); + + if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then + rhol2[i] = rho2[i]; + rhov2[i] = rho2[i]; + cpl2[i] = Medium.specificHeatCapacityCp(state2[i]); + cpv2[i] = Medium.specificHeatCapacityCp(state2[i]); else - rhol2[i] = max(pro2[i].d, lsat2[i].rho); - rhov2[i] = min(pro2[i].d, vsat2[i].rho); - cpl2[i] = if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp; - cpv2[i] = if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp; + rhol2[i] = max(rho2[i], Medium.bubbleDensity(sat2[i])); + rhov2[i] = min(rho2[i], Medium.dewDensity(sat2[i])); + cpl2[i] = if noEvent(xv2[i] <= 0.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat2[i])); + cpv2[i] = if noEvent(xv2[i] >= 1.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat2[i])); end if; - mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i], fluid); - muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i], fluid); - kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); - kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); + + mul2[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat2[i])); + muv2[i] = Medium.dynamicViscosity(Medium.setDewState(sat2[i])); + + kl2[i] = Medium.thermalConductivity(Medium.setBubbleState(sat2[i])); + kv2[i] = Medium.thermalConductivity(Medium.setDewState(sat2[i])); end for; -/* Fluid densities at the boundaries of the nodes */ + + /* Fluid densities at the boundaries of the nodes */ for i in 2:N loop rhoc[i] = rho1[i - 1]; end for; - proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid); - proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid); - rhoc[1] = proc[1].d; - rhoc[N + 1] = proc[2].d; + + state_c[1] = Medium.setState_phX(P[1], h[1], X); + state_c[2] = Medium.setState_phX(P[N + 1], h[N + 1], X); + + rhoc[1] = Medium.density(state_c[1]); + rhoc[N + 1] = Medium.density(state_c[2]); + W1t = sum(dW1); -/* Total fluid diffusion resistance */ + + /* Total fluid diffusion resistance */ diff_res_t = sum(diff_res); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 0}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {100, 0}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 20}, {100, 0}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({170, 213, 255}, if dynamic_energy_balance then {170, 213, 255} else if diffusion then {213, 255, 170} else {255, 255, 170}), fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 0}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid)), Line(points = {{-60, 20}, {-60, -20}}), Line(points = {{-20, 20}, {-20, -20}}), Line(points = {{20, 20}, {20, -20}}), Line(points = {{60, 20}, {60, -20}})}), - Window(x = 0.16, y = 0.07, width = 0.71, height = 0.85), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,0},{100,-20}}, + lineColor={0,0,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{100,0}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,20},{100,0}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({170,213,255}, + if dynamic_energy_balance then {170,213,255} + else if diffusion then {213,255,170} + else {255,255,170}), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,0},{100,-20}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid)), + Line(points={{-60,20},{-60,-20}}), + Line(points={{-20,20},{-20,-20}}), + Line(points={{20,20},{20,-20}}), + Line(points={{60,20},{60,-20}})}), + Window( + x=0.16, + y=0.07, + width=0.71, + height=0.85), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -419,4 +577,4 @@ Baligh El Hefni Guillaume Larrignon ")); -end DynamicTwoPhaseFlowPipe; \ No newline at end of file +end DynamicTwoPhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo index bd485801..b7a4132b 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo @@ -1,169 +1,236 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicTwoPhaseFlowRiser "Dynamic two-phase flow riser" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 10. "Pipe length"; - parameter Units.SI.Diameter D = 0.02 "Hydraulic diameter"; - parameter Units.SI.Length rugosrel = 0.0007 "Pipe relative roughness"; - parameter Integer ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.Position z1 = 0 "Pipe inlet altitude"; - parameter Units.SI.Position z2 = 0 "Pipe outlet altitude"; - parameter Real rgliss = 1 "Phase slip coefficient"; - parameter Integer a = 4200 "Phase pressure loss coefficient"; - parameter Real dpfCorr = 1.00 "Corrective term for the friction pressure loss (dpf) for each node"; - parameter Real hcCorr = 1.00 "Corrective term for the heat exchange coefficient (hc) for each node"; - parameter Integer Ns = 10 "Number of segments"; - parameter Units.SI.Temperature T0[Ns] = fill(300, Ns) "Initial fluid temperature (active if steady_state=false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection term - false: without advection term"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure P[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Fluid pressure in node i"; - Units.SI.MassFlowRate Q[N](start = fill(10, N), nominal = fill(10, N)) "Mass flow rate in node i"; - Units.SI.SpecificEnthalpy h[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e6, N + 1)) "Fluid specific enthalpy in node i"; - Units.SI.SpecificEnthalpy hb[N] "Fluid specific enthalpy at the boundary of node i"; - Units.SI.AbsolutePressure Pb[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Bounded fluid pressure in node i"; - Units.SI.Density rho1[N - 1](start = fill(998, N - 1), nominal = fill(1, N - 1)) "Fluid density in thermal node i"; - Units.SI.Density rho2[N](start = fill(998, N), nominal = fill(1, N)) "Fluid density in hydraulic node i"; - Units.SI.Density rhoc[N + 1](start = fill(998, N + 1), nominal = fill(1, N + 1)) "Fluid density at the boudary of node i"; - Units.SI.MassFlowRate BQ[N - 1] "Right hand side of the mass balance equation for thermal node i"; - Units.SI.Power BH[N - 1] "Right hand side of the energy balance equation for thermal node i"; - Units.SI.Power dW1_conv[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Convection thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1_diff[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Diffusion thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW1[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW2_conv[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Convection thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW2_diff[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Diffusion thermal power exchanged on the liquid side for node i"; - Units.SI.Power dW2[N - 1](start = fill(3.e5, N - 1), nominal = fill(3.e5, N - 1)) "Thermal power exchanged on the liquid side for node i"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Length L=10. "Pipe length"; + parameter Units.SI.Diameter D=0.02 "Hydraulic diameter"; + parameter Units.SI.Length rugosrel=0.0007 "Pipe relative roughness"; + parameter Integer ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.Position z1=0 "Pipe inlet altitude"; + parameter Units.SI.Position z2=0 "Pipe outlet altitude"; + parameter Real rgliss=1 "Phase slip coefficient"; + parameter Integer a=4200 "Phase pressure loss coefficient"; + parameter Real dpfCorr=1.00 "Corrective term for the friction pressure loss (dpf) for each node"; + parameter Real hcCorr=1.00 "Corrective term for the heat exchange coefficient (hc) for each node"; + parameter Integer Ns=10 "Number of segments"; + parameter Units.SI.Temperature T0[Ns]=fill(300, Ns) + "Initial fluid temperature (active if steady_state=false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state=false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection term - false: without advection term"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Integer N=Ns + 1 + "Number of hydraulic nodes (= number of thermal nodes + 1)"; + parameter Units.SI.Area A=ntubes*pi*D^2/4 + "Internal cross sectional pipe area"; + parameter Units.SI.Diameter Di=ntubes*D "Internal pipe diameter"; + parameter Units.SI.PathLength dx1=L/(N - 1) "Length of a thermal node"; + parameter Units.SI.PathLength dx2=L/N "Length of a hydraulic node"; + parameter Units.SI.Area dSi=pi*Di*dx1 + "Internal heat exchange area for a node"; + parameter Real Mmol=18.015 "Water molar mass"; + parameter Units.SI.AbsolutePressure pcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT + "Critical pressure"; + parameter Units.SI.Temperature Tcrit=ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT + "Critical temperature"; + parameter Units.SI.AbsolutePressure ptriple=ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple + "Triple point pressure"; + parameter Real xb1=0.0002 "Min value for vapor mass fraction"; + parameter Real xb2=0.85 "Max value for vapor mass fraction"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Units.SI.AbsolutePressure P[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e5, + N + 1)) "Fluid pressure in node i"; + Units.SI.MassFlowRate Q[N](start=fill(10, N), nominal=fill(10, N)) + "Mass flow rate in node i"; + Units.SI.SpecificEnthalpy h[N + 1](start=fill(1.e5, N + 1), nominal=fill(1.e6, + N + 1)) "Fluid specific enthalpy in node i"; + Units.SI.SpecificEnthalpy hb[N] + "Fluid specific enthalpy at the boundary of node i"; + Units.SI.AbsolutePressure Pb[N + 1](start=fill(1.e5, N + 1), nominal=fill( + 1.e5, N + 1)) "Bounded fluid pressure in node i"; + Units.SI.Density rho1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1)) + "Fluid density in thermal node i"; + Units.SI.Density rho2[N](start=fill(998, N), nominal=fill(1, N)) + "Fluid density in hydraulic node i"; + Units.SI.Density rhoc[N + 1](start=fill(998, N + 1), nominal=fill(1, N + 1)) + "Fluid density at the boudary of node i"; + Units.SI.MassFlowRate BQ[N - 1] + "Right hand side of the mass balance equation for thermal node i"; + Units.SI.Power BH[N - 1] + "Right hand side of the energy balance equation for thermal node i"; + Units.SI.Power dW1_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Convection thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Diffusion thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW1[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1)) + "Thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW2_conv[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Convection thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW2_diff[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N + - 1)) + "Diffusion thermal power exchanged on the liquid side for node i"; + Units.SI.Power dW2[N - 1](start=fill(3.e5, N - 1), nominal=fill(3.e5, N - 1)) + "Thermal power exchanged on the liquid side for node i"; Units.SI.Power W1t "Total power exchanged on the liquid side"; - Units.SI.Temperature Tp1[N - 1](each start = 500.0) "Wall temperature in node i"; - Units.SI.Temperature Tp2[N - 1](each start = 500.0) "Wall temperature in node i"; - Units.SI.CoefficientOfHeatTransfer hi[N - 1](start = fill(2000, N - 1), nominal = fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i"; - Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start = fill(2000, N - 1), nominal = fill(200, N - 1)) "Fluid heat exchange coefficient in node i for the liquid fraction"; - Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start = fill(0, N - 1), nominal = fill(200, N - 1)) "Fluid heat exchange coefficient in node i for the vapor fraction"; + Units.SI.Temperature Tp1[N - 1](each start=500.0) + "Wall temperature in node i"; + Units.SI.Temperature Tp2[N - 1](each start=500.0) + "Wall temperature in node i"; + Units.SI.CoefficientOfHeatTransfer hi[N - 1](start=fill(2000, N - 1), nominal= + fill(2.e4, N - 1)) "Fluid heat exchange coefficient in node i"; + Units.SI.CoefficientOfHeatTransfer hcl[N - 1](start=fill(2000, N - 1), + nominal=fill(200, N - 1)) + "Fluid heat exchange coefficient in node i for the liquid fraction"; + Units.SI.CoefficientOfHeatTransfer hcv[N - 1](start=fill(0, N - 1), nominal= + fill(200, N - 1)) + "Fluid heat exchange coefficient in node i for the vapor fraction"; Real S[N - 1] "Corrective terme correctif for nucleation removal"; Real E[N - 1] "Corrective term for hcl"; - Units.SI.CoefficientOfHeatTransfer heb[N - 1](start = fill(0, N - 1), nominal = fill(5.e5, N - 1)) "Fluid heat exchange coefficient for vaporization in thermal node i"; - Units.SI.ReynoldsNumber Rel1[N - 1](start = fill(6.e4, N - 1), nominal = fill(0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid"; - Units.SI.ReynoldsNumber Rel2[N](start = fill(6.e4, N), nominal = fill(0.5e4, N)) "Reynolds number in hydraulic node i for the liquid"; - Units.SI.ReynoldsNumber Rev1[N - 1](start = fill(0.1e4, N - 1), nominal = fill(5.e5, N - 1)) "Reynolds number in thermal node i for the vapor"; - Units.SI.ReynoldsNumber Rev2[N](start = fill(0.1e4, N), nominal = fill(5.e5, N)) "Reynolds number in hydraulic node i for the vapor"; - Real Prl[N - 1](start = fill(4, N - 1), nominal = fill(1, N - 1)) "Fluid Prandtl number in node i for the liquid"; - Real Prv[N - 1](start = fill(1, N - 1), nominal = fill(1, N - 1)) "Fluid Prandtl number in node i for the vapor"; - Units.SI.ThermalConductivity kl1[N - 1](start = fill(0.6, N - 1), nominal = fill(0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid"; - Units.SI.ThermalConductivity kl2[N](start = fill(0.6, N), nominal = fill(0.6, N)) "Thermal conductivity in hydraulic node i for the liquid"; - Units.SI.ThermalConductivity kv1[N - 1](start = fill(0.03, N - 1), nominal = fill(0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor"; - Units.SI.ThermalConductivity kv2[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Thermal conductivity in hydraulic node i for the vapor"; + Units.SI.CoefficientOfHeatTransfer heb[N - 1](start=fill(0, N - 1), nominal= + fill(5.e5, N - 1)) + "Fluid heat exchange coefficient for vaporization in thermal node i"; + Units.SI.ReynoldsNumber Rel1[N - 1](start=fill(6.e4, N - 1), nominal=fill( + 0.5e4, N - 1)) "Reynolds number in thermal node i for the liquid"; + Units.SI.ReynoldsNumber Rel2[N](start=fill(6.e4, N), nominal=fill(0.5e4, N)) + "Reynolds number in hydraulic node i for the liquid"; + Units.SI.ReynoldsNumber Rev1[N - 1](start=fill(0.1e4, N - 1), nominal=fill( + 5.e5, N - 1)) "Reynolds number in thermal node i for the vapor"; + Units.SI.ReynoldsNumber Rev2[N](start=fill(0.1e4, N), nominal=fill(5.e5, N)) + "Reynolds number in hydraulic node i for the vapor"; + Real Prl[N - 1](start=fill(4, N - 1), nominal=fill(1, N - 1)) + "Fluid Prandtl number in node i for the liquid"; + Real Prv[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1)) + "Fluid Prandtl number in node i for the vapor"; + Units.SI.ThermalConductivity kl1[N - 1](start=fill(0.6, N - 1), nominal=fill( + 0.6, N - 1)) "Thermal conductivity in thermal node i for the liquid"; + Units.SI.ThermalConductivity kl2[N](start=fill(0.6, N), nominal=fill(0.6, N)) + "Thermal conductivity in hydraulic node i for the liquid"; + Units.SI.ThermalConductivity kv1[N - 1](start=fill(0.03, N - 1), nominal=fill( + 0.03, N - 1)) "Thermal conductivity in thermal node i for the vapor"; + Units.SI.ThermalConductivity kv2[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Thermal conductivity in hydraulic node i for the vapor"; Real xv1[N - 1] "Vapor mass fraction in thermal node i"; Real xv2[N] "Vapor mass fraction in hydraulic node i"; Real xbs[N - 1] "Bounded upper value for the vapor mass fraction"; Real xbi[N - 1] "Bounded lower value for the vapor mass fraction"; - Units.SI.DynamicViscosity mul1[N - 1](start = fill(2.e-4, N - 1), nominal = fill(2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid"; - Units.SI.DynamicViscosity mul2[N](start = fill(2.e-4, N), nominal = fill(2.e-4, N)) "Dynamic viscosity in hydraulic node i for the liquid"; - Units.SI.DynamicViscosity muv1[N - 1](start = fill(1.e-5, N - 1), nominal = fill(1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor"; - Units.SI.DynamicViscosity muv2[N](start = fill(1.e-5, N), nominal = fill(1.e-4, N)) "Dynamic viscosity in hydraulic node i for the vapor"; - Units.SI.SpecificHeatCapacity cpl1[N - 1](start = fill(4000, N - 1), nominal = fill(4000, N - 1)) "Specific heat capacity in thermal node i for the liquid"; - Units.SI.SpecificHeatCapacity cpl2[N](start = fill(4000, N), nominal = fill(4000, N)) "Specific heat capacity in hydraulic node i for the liquid"; - Units.SI.SpecificHeatCapacity cpv1[N - 1](start = fill(2000, N - 1), nominal = fill(2000, N - 1)) "Specific heat capacity in thermal node i for the vapor"; - Units.SI.SpecificHeatCapacity cpv2[N](start = fill(4000, N), nominal = fill(4000, N)) "Specific heat capacity in hydraulic node i for the vapor"; - Real Bo[N - 1](start = fill(0, N - 1), nominal = fill(4.e-4, N - 1)) "Boiling number"; - Real Xtt[N - 1](start = fill(1, N - 1), nominal = fill(1, N - 1)) "Martinelli number"; - Units.SI.SpecificEnthalpy lv[N - 1](start = fill(2.e6, N - 1), nominal = fill(2.e6, N - 1)) "Specific enthalpy for vaporisation"; - Units.SI.Density rhol1[N - 1](start = fill(998, N - 1), nominal = fill(998, N - 1)) "Fluid density in thermal node i for the liquid"; - Units.SI.Density rhol2[N](start = fill(998, N), nominal = fill(998, N)) "Fluid density in hydraulic node i for the liquid"; - Units.SI.Density rhov1[N - 1](start = fill(1, N - 1), nominal = fill(1, N - 1)) "Fluid density in thermal node i for the vapor"; - Units.SI.Density rhov2[N](start = fill(1, N), nominal = fill(1, N)) "Fluid density in hydraulic node i for the vapor"; + Units.SI.DynamicViscosity mul1[N - 1](start=fill(2.e-4, N - 1), nominal=fill( + 2.e-4, N - 1)) "Dynamic viscosity in thermal node i for the liquid"; + Units.SI.DynamicViscosity mul2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N)) + "Dynamic viscosity in hydraulic node i for the liquid"; + Units.SI.DynamicViscosity muv1[N - 1](start=fill(1.e-5, N - 1), nominal=fill( + 1.e-4, N - 1)) "Dynamic viscosity in thermal node i for the vapor"; + Units.SI.DynamicViscosity muv2[N](start=fill(1.e-5, N), nominal=fill(1.e-4, N)) + "Dynamic viscosity in hydraulic node i for the vapor"; + Units.SI.SpecificHeatCapacity cpl1[N - 1](start=fill(4000, N - 1), nominal= + fill(4000, N - 1)) + "Specific heat capacity in thermal node i for the liquid"; + Units.SI.SpecificHeatCapacity cpl2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Specific heat capacity in hydraulic node i for the liquid"; + Units.SI.SpecificHeatCapacity cpv1[N - 1](start=fill(2000, N - 1), nominal= + fill(2000, N - 1)) + "Specific heat capacity in thermal node i for the vapor"; + Units.SI.SpecificHeatCapacity cpv2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Specific heat capacity in hydraulic node i for the vapor"; + Real Bo[N - 1](start=fill(0, N - 1), nominal=fill(4.e-4, N - 1)) + "Boiling number"; + Real Xtt[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1)) + "Martinelli number"; + Units.SI.SpecificEnthalpy lv[N - 1](start=fill(2.e6, N - 1), nominal=fill( + 2.e6, N - 1)) "Specific enthalpy for vaporisation"; + Units.SI.Density rhol1[N - 1](start=fill(998, N - 1), nominal=fill(998, N - 1)) + "Fluid density in thermal node i for the liquid"; + Units.SI.Density rhol2[N](start=fill(998, N), nominal=fill(998, N)) + "Fluid density in hydraulic node i for the liquid"; + Units.SI.Density rhov1[N - 1](start=fill(1, N - 1), nominal=fill(1, N - 1)) + "Fluid density in thermal node i for the vapor"; + Units.SI.Density rhov2[N](start=fill(1, N), nominal=fill(1, N)) + "Fluid density in hydraulic node i for the vapor"; Units.SI.Temperature T1[N - 1] "Fluid temperature in thermal node i"; Units.SI.Temperature T2[N] "Fluid temperature in hydraulic node i"; - ThermoSysPro.Units.SI.PressureDifference dpa[N] "Advection term for the mass balance equation in node i"; - ThermoSysPro.Units.SI.PressureDifference dpf[N] "Friction pressure loss in node i"; - ThermoSysPro.Units.SI.PressureDifference dpg[N] "Gravity pressure loss in node i"; + ThermoSysPro.Units.SI.PressureDifference dpa[N] + "Advection term for the mass balance equation in node i"; + ThermoSysPro.Units.SI.PressureDifference dpf[N] + "Friction pressure loss in node i"; + ThermoSysPro.Units.SI.PressureDifference dpg[N] + "Gravity pressure loss in node i"; Real khi[N] "Hydraulic pressure loss coefficient in node i"; - Real lambdal[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Friction pressure loss coefficient in node i for the liquid"; - Real lambdav[N](start = fill(0.03, N), nominal = fill(0.03, N)) "Friction pressure loss coefficient in node i for the vapor)"; + Real lambdal[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Friction pressure loss coefficient in node i for the liquid"; + Real lambdav[N](start=fill(0.03, N), nominal=fill(0.03, N)) + "Friction pressure loss coefficient in node i for the vapor)"; Real filo[N] "Pressure loss coefficient for two-phase flow"; - FluidType ftype "Fluid type"; - Integer fluid = Integer(ftype) "Fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2 "CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o "H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2 "O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2 "SO2 mass fraction"; + Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure"; + Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy"; + Medium.ThermodynamicState state1[N - 1]; + Medium.ThermodynamicState state2[N]; + Medium.ThermodynamicState state_c[2]; + Medium.SaturationProperties sat1[N - 1]; + Medium.SaturationProperties sat2[N]; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; Real diff_res_l[N] "Diffusion resistance in hydraulic node i for the liquid"; Real diff_res_v[N] "Diffusion resistance in hydraulic node i for the vapor"; Real diff_res[N] "Total diffusion resistance in hydraulic node i"; Real diff_res_t "Total diffusion resistance in the pipe"; Real diff_res_e[N - 1] "Diffusion resistance at inlet of thermal node i"; Real diff_res_s[N - 1] "Diffusion resistance at outlet of thermal node i"; - Units.SI.MassFlowRate gamma[N] "Total diffusion conductance in hydraulic node i"; - Units.SI.MassFlowRate gamma_e[N - 1] "Diffusion conductance at inlet of thermal node i"; - Units.SI.MassFlowRate gamma_s[N - 1] "Diffusion conductance at outlet of thermal node i"; - Units.SI.Power Je[N - 1] "Thermal power diffusion from inlet of thermal node i"; - Units.SI.Power Js[N - 1] "Thermal power diffusion from outlet of thermal node i"; + Units.SI.MassFlowRate gamma[N] + "Total diffusion conductance in hydraulic node i"; + Units.SI.MassFlowRate gamma_e[N - 1] + "Diffusion conductance at inlet of thermal node i"; + Units.SI.MassFlowRate gamma_s[N - 1] + "Diffusion conductance at outlet of thermal node i"; + Units.SI.Power Je[N - 1] + "Thermal power diffusion from inlet of thermal node i"; + Units.SI.Power Js[N - 1] + "Thermal power diffusion from outlet of thermal node i"; Units.SI.Power J[N - 1] "Total thermal power diffusion of thermal node i"; Real re[N - 1] "Value of r(Q/gamma) for inlet of thermal node i"; Real rs[N - 1] "Value of r(Q/gamma) for outlet of thermal node i"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro1[N - 1] annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proc[2] annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro2[N] annotation( - Placement(transformation(extent = {{-60, 80}, {-40, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat2[N] annotation( - Placement(transformation(extent = {{80, -100}, {100, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat2[N] annotation( - Placement(transformation(extent = {{40, -100}, {60, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat1[N - 1] annotation( - Placement(transformation(extent = {{-60, -100}, {-40, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat1[N - 1] annotation( - Placement(transformation(extent = {{-100, -100}, {-80, -80}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1 annotation( - Placement(transformation(extent = {{-110, 0}, {-90, 20}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort CTh1[Ns] annotation( - Placement(transformation(extent = {{-10, 60}, {10, 80}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2 annotation( - Placement(transformation(extent = {{90, 0}, {110, 20}}, rotation = 0))); - ThermoSysPro.Thermal.Connectors.ThermalPort CTh2[Ns] annotation( - Placement(transformation(extent = {{-10, -60}, {10, -40}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer N = Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; - parameter Units.SI.Area A = ntubes*pi*D^2/4 "Internal cross sectional pipe area"; - parameter Units.SI.Diameter Di = ntubes*D "Internal pipe diameter"; - parameter Units.SI.PathLength dx1 = L/(N - 1) "Length of a thermal node"; - parameter Units.SI.PathLength dx2 = L/N "Length of a hydraulic node"; - parameter Units.SI.Area dSi = pi*Di*dx1 "Internal heat exchange area for a node"; - parameter Real Mmol = 18.015 "Water molar mass"; - parameter Units.SI.AbsolutePressure pcrit = ThermoSysPro.Properties.WaterSteam.BaseIF97.data.PCRIT "Critical pressure"; - parameter Units.SI.Temperature Tcrit = ThermoSysPro.Properties.WaterSteam.BaseIF97.data.TCRIT "Critical temperature"; - parameter Units.SI.AbsolutePressure ptriple = ThermoSysPro.Properties.WaterSteam.BaseIF97.triple.ptriple "Triple point pressure"; - parameter Real xb1 = 0.0002 "Min value for vapor mass fraction"; - parameter Real xb2 = 0.85 "Max value for vapor mass fraction"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-110,0},{-90,20}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort CTh1[Ns] + annotation (Placement(transformation(extent={{-10,60},{10,80}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,0},{110,20}}, rotation=0))); + ThermoSysPro.Thermal.Connectors.ThermalPort CTh2[Ns] + annotation (Placement(transformation(extent={{-10,-60},{10,-40}}, rotation= + 0))); initial equation + if dynamic_energy_balance then if steady_state then for i in 2:N loop @@ -172,7 +239,7 @@ initial equation else if option_temperature then for i in 2:N loop - h[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pb[i], T0[i - 1], fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h[i] = Medium.specificEnthalpy_pTX(Pb[i], T0[i - 1], X); end for; else for i in 2:N loop @@ -180,69 +247,78 @@ initial equation end for; end if; end if; + if dynamic_mass_balance then for i in 2:N loop der(P[i]) = 0; end for; end if; end if; + if inertia then for i in 1:N loop der(Q[i]) = 0; end for; end if; + equation -/* Check that the fluid type is water/steam */ - assert((ftype == FluidType.WaterSteam) or (ftype == FluidType.WaterSteamSimple), "DynamicTwoPhaseFlowRiser: the fluid type must be water/steam"); -/* Wall temperature */ + + /* Wall temperature */ Tp1 = CTh1.T; CTh1.W = dW1; + Tp2 = CTh2.T; CTh2.W = dW2; -/* Pipe boundaries */ + + /* Pipe boundaries */ P[1] = C1.P; P[N + 1] = C2.P; + Q[1] = C1.Q; Q[N] = C2.Q; + hb[1] = C1.h; hb[N] = C2.h; + h[1] = C1.h_vol_1; h[N + 1] = C2.h_vol_2; + C1.h_vol_2 = h[2]; C2.h_vol_1 = h[N]; + Pb[1] = max(min(P[1], pcrit - 1), ptriple); Pb[N + 1] = max(min(P[N + 1], pcrit - 1), ptriple); + C2.diff_on_1 = diffusion; C1.diff_on_2 = diffusion; + C2.diff_res_1 = C1.diff_res_1 + diff_res_t; C1.diff_res_2 = C2.diff_res_2 + diff_res_t; - C1.ftype = C2.ftype; - C1.Xco2 = C2.Xco2; - C1.Xh2o = C2.Xh2o; - C1.Xo2 = C2.Xo2; - C1.Xso2 = C2.Xso2; - ftype = C1.ftype; - Xco2 = C1.Xco2; - Xh2o = C1.Xh2o; - Xo2 = C1.Xo2; - Xso2 = C1.Xso2; -/* Mass and energy balance equations (thermal nodes) */ + + C1.Xi = C2.Xi; + X = C1.Xi; + C1.SubC = C2.SubC; + + /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop BQ[i] = Q[i] - Q[i + 1]; -/* Mass balance equation */ + + /* Mass balance equation */ if dynamic_energy_balance and dynamic_mass_balance then - A*(pro1[i].ddph*der(P[i + 1]) + pro1[i].ddhp*der(h[i + 1]))*dx1 = BQ[i]; + A*(ddph[i]*der(P[i + 1]) + ddhp[i]*der(h[i + 1]))*dx1 = BQ[i]; else 0 = BQ[i]; end if; -/* Energy balance equation */ - BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i] + J[i]; + + /* Energy balance equation */ + BH[i] = hb[i]*Q[i] - hb[i + 1]*Q[i + 1] + dW1[i] + dW2[i] + J[i]; + if dynamic_energy_balance then if dynamic_mass_balance then if simplified_dynamic_energy_balance then A*(-der(P[i + 1]) + rho1[i]*der(h[i + 1]))*dx1 = BH[i]; else - A*((h[i + 1]*pro1[i].ddph - 1)*der(P[i + 1]) + (h[i + 1]*pro1[i].ddhp + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; + A*((h[i + 1]*ddph[i] - 1)*der(P[i + 1]) + (h[i + 1]*ddhp[i] + rho1[i])*der(h[i + 1]))*dx1 = BH[i]; end if; else A*rho1[i]*der(h[i + 1])*dx1 = BH[i]; @@ -250,19 +326,24 @@ equation else 0 = BH[i]; end if; -/* Heat transfer at the wall */ + + /* Heat transfer at the wall */ dW1_conv[i] = hcCorr*hi[i]*dSi*(Tp1[i] - T1[i]); dW2_conv[i] = hcCorr*hi[i]*dSi*(Tp2[i] - T1[i]); + dW1_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp1[i] - T1[i]); dW2_diff[i] = ((1 - xv1[i])*kl1[i] + xv1[i]*kv1[i])*2*pi*dx1*ntubes*(Tp2[i] - T1[i]); + dW1[i] = dW1_conv[i] + (if diffusion then dW1_diff[i] else 0); dW2[i] = dW2_conv[i] + (if diffusion then dW2_diff[i] else 0); -//*** Thermal exchange correlation -// Thom correlation -// hi_1[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp1[i] - Tsat[i]), 5000); -// hi_2[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp2[i] - Tsat[i]), 5000); + + //*** Thermal exchange correlation + // Thom correlation + // hi_1[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp1[i] - Tsat[i]), 5000); + // hi_2[i] = max(1970*exp(P[i + 1]/43.5e5)*(Tp2[i] - Tsat[i]), 5000); + if noEvent(xv1[i] < xb1) then - hi[i] = if noEvent((P[i + 1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]); + hi[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then hcl[i] else (1 - xv1[i]/xb1)*hcl[i] + xv1[i]/xb1*(E[i]*hcl[i] + S[i]*heb[i]); Xtt[i] = ((1 - xb1)/xb1)^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1; elseif noEvent(xv1[i] > xb2) then hi[i] = (xv1[i] - xb2)/(1 - xb2)*hcv[i] + (1 - xv1[i])/(1 - xb2)*(E[i]*hcl[i] + S[i]*heb[i]); @@ -271,29 +352,37 @@ equation hi[i] = E[i]*hcl[i] + S[i]*heb[i]; Xtt[i] = ((1 - xv1[i])/xv1[i])^0.9*(rhov1[i]/rhol1[i])^0.5*(mul1[i]/muv1[i])^0.1; end if; + E[i] = if noEvent(Bo[i] > 0) then 1 + 24000*Bo[i]^1.16 + 1.37*Xtt[i]^(-0.86) else 1; Bo[i] = noEvent(if (abs((Q[i] + Q[i + 1])/2) > 1.e-3) then abs(dW1[i]*D/(4*(Q[i] + Q[i + 1])/2*lv[i]*dx1)) else 1.e-5); S[i] = noEvent(if (Rel1[i] > 1.e-6) then 1/(1 + 1.15e-6*E[i]^2*Rel1[i]^1.17) else 0); heb[i] = noEvent(if (Pb[i] > 1) then 55*(abs(Pb[i])/pcrit)^0.12*(-Modelica.Math.log10(abs(Pb[i])/pcrit))^(-0.55)*Mmol^(-0.5)*(abs(dW1[i])/dSi)^0.67 else 100); + hcl[i] = noEvent(if ((Rel1[i] > 1.e-6) and (Prl[i] > 1.e-6)) then 0.023*kl1[i]/D*Rel1[i]^0.8*Prl[i]^0.4 else 0); hcv[i] = noEvent(if ((Rev1[i] > 1.e-6) and (Prv[i] > 1.e-6)) then 0.023*kv1[i]/D*Rev1[i]^0.8*Prv[i]^0.4 else 0); + Prl[i] = mul1[i]*cpl1[i]/kl1[i]; Prv[i] = muv1[i]*cpv1[i]/kv1[i]; + Rel1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*(1 - xbs[i])/(pi*Di*mul1[i]))); Rev1[i] = noEvent(abs(4*(Q[i] + Q[i + 1])/2*xbi[i]/(pi*Di*muv1[i]))); -/* Diffusion power */ + + /* Diffusion power */ if diffusion then re[i] = exp(-0.033*(Q[i]*diff_res_e[i])^2); rs[i] = exp(-0.033*(Q[i + 1]*diff_res_s[i])^2); + gamma_e[i] = 1/diff_res_e[i]; gamma_s[i] = 1/diff_res_s[i]; + if i == 1 then diff_res_e[i] = (if C1.diff_on_1 then C1.diff_res_1 else 0) + diff_res[i]; Je[i] = if C1.diff_on_1 then re[i]*gamma_e[i]*(h[i] - h[i + 1]) else 0; - else + else diff_res_e[i] = diff_res[i]; Je[i] = re[i]*gamma_e[i]*(h[i] - h[i + 1]); end if; + if i == N - 1 then diff_res_s[i] = (if C2.diff_on_2 then C2.diff_res_2 else 0) + diff_res[i + 1]; Js[i] = if C2.diff_on_2 then rs[i]*gamma_s[i]*(h[i + 2] - h[i + 1]) else 0; @@ -304,72 +393,94 @@ equation else diff_res_e[i] = 1/gamma0; diff_res_s[i] = 1/gamma0; + re[i] = 0; rs[i] = 0; + gamma_e[i] = gamma0; gamma_s[i] = gamma0; + Je[i] = 0; Js[i] = 0; end if; + J[i] = Je[i] + Js[i]; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then hb[i + 1] = ThermoSysPro.Functions.SmoothCond(Q[i + 1]/gamma[i + 1], h[i + 1], h[i + 2], 1); else hb[i + 1] = if (Q[i + 1] > 0) then h[i + 1] else h[i + 2]; end if; -/* Fluid thermodynamic properties */ - pro1[i] = ThermoSysPro.Properties.Fluid.Ph(P[i + 1], h[i + 1], mode, fluid); - rho1[i] = pro1[i].d; - T1[i] = pro1[i].T; - xv1[i] = if noEvent((P[i + 1] > pcrit) or (T1[i] > Tcrit)) then 1 else pro1[i].x; - (lsat1[i], vsat1[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P(P[i + 1], fluid); - if noEvent((P[i + 1] > pcrit) or (T1[i] > Tcrit)) then - xbs[i] = 0; - xbi[i] = 1; - rhol1[i] = pro1[i].d; - rhov1[i] = pro1[i].d; - cpl1[i] = pro1[i].cp; - cpv1[i] = pro1[i].cp; - lv[i] = 1; + + /* Fluid thermodynamic properties */ + state1[i] = Medium.setState_phX(P[i + 1], h[i + 1], X); + + rho1[i] = Medium.density(state1[i]); + T1[i] = Medium.temperature(state1[i]); + xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else Medium.vapourQuality(state1[i]); + ddph[i] = Medium.density_derp_h(state1[i]); + ddhp[i] = Medium.density_derh_p(state1[i]); + + sat1[i] = Medium.setSat_p(P[i + 1]); + + if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then + xbs[i] = 0; + xbi[i] = 1; + rhol1[i] = rho1[i]; + rhov1[i] = rho1[i]; + cpl1[i] = Medium.specificHeatCapacityCp(state1[i]); + cpv1[i] = Medium.specificHeatCapacityCp(state1[i]); + lv[i] = 1; else - xbs[i] = min(pro1[i].x, 0.90); - xbi[i] = max(pro1[i].x, 0.10); - rhol1[i] = max(pro1[i].d, lsat1[i].rho); - rhov1[i] = min(pro1[i].d, vsat1[i].rho); - cpl1[i] = if noEvent(xv1[i] <= 0.0) then pro1[i].cp else lsat1[i].cp; - cpv1[i] = if noEvent(xv1[i] >= 1.0) then pro1[i].cp else vsat1[i].cp; - lv[i] = vsat1[i].h - lsat1[i].h; + xbs[i] = min(xv1[i], 0.90); + xbi[i] = max(xv1[i], 0.10); + rhol1[i] = max(rho1[i], Medium.bubbleDensity(sat1[i])); + rhov1[i] = min(rho1[i], Medium.dewDensity(sat1[i])); + cpl1[i] = if noEvent(xv1[i] <= 0.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat1[i])); + cpv1[i] = if noEvent(xv1[i] >= 1.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat1[i])); + lv[i] = Medium.dewEnthalpy(sat1[i]) - Medium.bubbleEnthalpy(sat1[i]); end if; - mul1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol1[i], T1[i], fluid); - muv1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov1[i], T1[i], fluid); - kl1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol1[i], T1[i], P[i + 1], mode, fluid); - kv1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov1[i], T1[i], P[i + 1], mode, fluid); + + mul1[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat1[i])); + muv1[i] = Medium.dynamicViscosity(Medium.setDewState(sat1[i])); + + kl1[i] = Medium.thermalConductivity(Medium.setBubbleState(sat1[i])); + kv1[i] = Medium.thermalConductivity(Medium.setDewState(sat1[i])); + Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple); end for; -/* Momentum balance equations (hydraulic nodes) */ + + /* Momentum balance equations (hydraulic nodes) */ for i in 1:N loop -/* Momentum balance equation */ + /* Momentum balance equation */ if inertia then 1/A*der(Q[i])*dx2 = P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i]; else P[i] - P[i + 1] - dpf[i] - dpg[i] - dpa[i] = 0; end if; -/* Advection term */ + + /* Advection term */ if advection then dpa[i] = Q[i]^2*(1/rhoc[i + 1] - 1/rhoc[i])/A^2; else dpa[i] = 0; end if; -/* Gravity pressure losses */ + + /* Gravity pressure losses */ dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L; -/* Friction pressure losses */ + + /* Friction pressure losses */ dpf[i] = noEvent(dpfCorr*khi[i]*Q[i]*abs(Q[i])/(2*A^2*rhol2[i])); + khi[i] = filo[i]*lambdal[i]*dx2/D; + lambdal[i] = if noEvent(Rel2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rel2[i] + rugosrel/3.7/D))^(-2) else 0.01; lambdav[i] = if noEvent(Rev2[i] > 1) then 0.25*(Modelica.Math.log10(13/Rev2[i] + rugosrel/3.7/D))^(-2) else 0.01; + Rel2[i] = noEvent(abs(4*Q[i]/(pi*Di*mul2[i]))); Rev2[i] = noEvent(abs(4*Q[i]/(pi*Di*muv2[i]))); + if noEvent(xv2[i] < 0) then filo[i] = 1; else @@ -379,43 +490,152 @@ equation filo[i] = (1 - xv2[i]*rgliss)/0.2*(1 + a*xv2[i]*rgliss/(19 + Pb[i]*1.e-5)/exp(Pb[i]*1.e-5/84)) + (xv2[i]*rgliss - 0.8)/0.2*rhol2[i]/rhov2[i]*lambdav[i]/lambdal[i]; end if; end if; -/* Diffusion resistance */ -// diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i]; -// diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i]; + + /* Diffusion resistance */ + // diff_res_l[i] = (1 - xv2[i])*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i]; + // diff_res_v[i] = xv2[i]*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i]; diff_res_l[i] = 1*rho2[i]/rhol2[i]*cpl2[i]*dx2/A/kl2[i]; diff_res_v[i] = 0*rho2[i]/rhov2[i]*cpv2[i]*dx2/A/kv2[i]; + diff_res[i] = diff_res_l[i] + diff_res_v[i]; gamma[i] = if diffusion then 1/diff_res[i] else gamma0; -/* Fluid thermodynamic properties */ - pro2[i] = ThermoSysPro.Properties.Fluid.Ph((P[i] + P[i + 1])/2, hb[i], mode, fluid); - rho2[i] = pro2[i].d; - xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else pro2[i].x; - T2[i] = pro2[i].T; - (lsat2[i], vsat2[i]) = ThermoSysPro.Properties.Fluid.Water_sat_P((P[i] + P[i + 1])/2, fluid); - rhol2[i] = if noEvent((P[i + 1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else max(pro2[i].d, lsat2[i].rho); - rhov2[i] = if noEvent((P[i + 1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].d else min(pro2[i].d, vsat2[i].rho); - cpl2[i] = if noEvent((P[i + 1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] <= 0.0) then pro2[i].cp else lsat2[i].cp); - cpv2[i] = if noEvent((P[i + 1] > pcrit) or (T2[i] > Tcrit)) then pro2[i].cp else (if noEvent(xv2[i] >= 1.0) then pro2[i].cp else vsat2[i].cp); - mul2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhol2[i], T2[i], fluid); - muv2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_rhoT(rhov2[i], T2[i], fluid); - kl2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhol2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); - kv2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhov2[i], T2[i], (P[i] + P[i + 1])/2, mode, fluid); + + /* Fluid thermodynamic properties */ + state2[i] = Medium.setState_phX((P[i] + P[i + 1])/2, hb[i], X); + + rho2[i] = Medium.density(state2[i]); + xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else Medium.vapourQuality(state2[i]); + T2[i] = Medium.temperature(state2[i]); + + sat2[i] = Medium.setSat_p((P[i] + P[i + 1])/2); + + rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then rho2[i] else max(rho2[i], Medium.bubbleDensity(sat2[i])); + rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then rho2[i] else min(rho2[i], Medium.dewDensity(sat2[i])); + + cpl2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then Medium.specificHeatCapacityCp(state2[i]) else (if noEvent(xv2[i] <= 0.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat2[i]))); + cpv2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then Medium.specificHeatCapacityCp(state2[i]) else (if noEvent(xv2[i] >= 1.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat2[i]))); + + mul2[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat2[i])); + muv2[i] = Medium.dynamicViscosity(Medium.setDewState(sat2[i])); + + kl2[i] = Medium.thermalConductivity(Medium.setBubbleState(sat2[i])); + kv2[i] = Medium.thermalConductivity(Medium.setDewState(sat2[i])); end for; -/* Fluid densities at the boundaries of the nodes */ + + /* Fluid densities at the boundaries of the nodes */ for i in 2:N loop rhoc[i] = rho1[i - 1]; end for; - proc[1] = ThermoSysPro.Properties.Fluid.Ph(P[1], h[1], mode, fluid); - proc[2] = ThermoSysPro.Properties.Fluid.Ph(P[N + 1], h[N + 1], mode, fluid); - rhoc[1] = proc[1].d; - rhoc[N + 1] = proc[2].d; + + state_c[1] = Medium.setState_phX(P[1], h[1], X); + state_c[2] = Medium.setState_phX(P[N + 1], h[N + 1], X); + + rhoc[1] = Medium.density(state_c[1]); + rhoc[N + 1] = Medium.density(state_c[2]); + W1t = sum(dW1); -/* Total fluid diffusion resistance */ + + /* Total fluid diffusion resistance */ diff_res_t = sum(diff_res); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, -20}, {100, -40}}, lineColor = {28, 108, 200}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 0}, {100, -20}}, lineColor = {28, 108, 200}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Line(points = {{-60, 0}, {-60, -40}}), Line(points = {{-20, 0}, {-20, -40}}), Line(points = {{20, 0}, {20, -40}}), Line(points = {{60, 0}, {60, -40}}), Rectangle(extent = {{-100, 60}, {100, 40}}, lineColor = {28, 108, 200}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 40}, {100, 20}}, lineColor = {28, 108, 200}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {100, 0}}, lineColor = {28, 108, 200}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{-60, 60}, {-60, 20}}), Line(points = {{-20, 60}, {-20, 20}}), Line(points = {{20, 60}, {20, 20}}), Line(points = {{60, 60}, {60, 20}})}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 0}, {100, -20}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({170, 213, 255}, if dynamic_energy_balance then {170, 213, 255} else if diffusion then {213, 255, 170} else {255, 255, 170}), fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, -20}, {100, -40}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), lineThickness = 0), Line(points = {{-60, 0}, {-60, -40}}), Line(points = {{-20, 0}, {-20, -40}}), Line(points = {{20, 0}, {20, -40}}), Line(points = {{60, 0}, {60, -40}}), Rectangle(extent = {{-100, 60}, {100, 40}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({170, 213, 255}, if dynamic_energy_balance then {170, 213, 255} else if diffusion then {213, 255, 170} else {255, 255, 170}), fillPattern = FillPattern.Solid, lineThickness = 0), Rectangle(extent = {{-100, 40}, {100, 20}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid)), Rectangle(extent = {{-100, 20}, {100, 0}}, lineColor = {28, 108, 200}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Line(points = {{-60, 60}, {-60, 20}}), Line(points = {{-20, 60}, {-20, 20}}), Line(points = {{20, 60}, {20, 20}}), Line(points = {{60, 60}, {60, 20}})}), - Window(x = 0.16, y = 0.07, width = 0.71, height = 0.85), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,-20},{100,-40}}, + lineColor={28,108,200}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,0},{100,-20}}, + lineColor={28,108,200}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Line(points={{-60,0},{-60,-40}}), + Line(points={{-20,0},{-20,-40}}), + Line(points={{20,0},{20,-40}}), + Line(points={{60,0},{60,-40}}), + Rectangle( + extent={{-100,60},{100,40}}, + lineColor={28,108,200}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,40},{100,20}}, + lineColor={28,108,200}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{100,0}}, + lineColor={28,108,200}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line(points={{-60,60},{-60,20}}), + Line(points={{-20,60},{-20,20}}), + Line(points={{20,60},{20,20}}), + Line(points={{60,60},{60,20}})}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,0},{100,-20}}, + lineColor={28,108,200}, + fillColor=DynamicSelect({170,213,255}, + if dynamic_energy_balance then {170,213,255} + else if diffusion then {213,255,170} + else {255,255,170}), + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,-20},{100,-40}}, + lineColor={28,108,200}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + lineThickness=0), + Line(points={{-60,0},{-60,-40}}), + Line(points={{-20,0},{-20,-40}}), + Line(points={{20,0},{20,-40}}), + Line(points={{60,0},{60,-40}}), + Rectangle( + extent={{-100,60},{100,40}}, + lineColor={28,108,200}, + fillColor=DynamicSelect({170,213,255}, + if dynamic_energy_balance then {170,213,255} + else if diffusion then {213,255,170} + else {255,255,170}), + fillPattern=FillPattern.Solid, + lineThickness=0), + Rectangle( + extent={{-100,40},{100,20}}, + lineColor={28,108,200}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid)), + Rectangle( + extent={{-100,20},{100,0}}, + lineColor={28,108,200}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line(points={{-60,60},{-60,20}}), + Line(points={{-20,60},{-20,20}}), + Line(points={{20,60},{20,20}}), + Line(points={{60,60},{60,20}})}), + Window( + x=0.16, + y=0.07, + width=0.71, + height=0.85), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -426,4 +646,4 @@ Baligh El Hefni Daniel Bouskela ")); -end DynamicTwoPhaseFlowRiser; \ No newline at end of file +end DynamicTwoPhaseFlowRiser; From e92c7c5fbfbf7c018d685f7137198f3137cce010 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:54:37 +0200 Subject: [PATCH 190/213] #125 port dynamic Fluid heat exchanger assemblies medium support onto develop --- .../Fluid/HeatExchangers/DynamicCondenser.mo | 390 +++++++++--- ...DynamicFlueGasesMultiFluidHeatExchanger.mo | 236 +++++--- .../DynamicMultiFluidHeatExchanger.mo | 274 ++++++--- .../DynamicMultiFluidHeatExchangerShell.mo | 262 +++++--- .../HeatExchangers/DynamicWaterHeater.mo | 563 ++++++++++++++---- .../DynamicWaterHeaterOnePipe.mo | 455 ++++++++++---- ...namicWaterSteamMultiFluidsHeatExchanger.mo | 272 ++++++--- 7 files changed, 1837 insertions(+), 615 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo index 73d78dc0..8d53fee4 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo @@ -1,116 +1,314 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicCondenser "Dynamic condenser" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - parameter Units.SI.Radius Rv = 1.0 "Radius of the Cavity cross-sectional area"; - parameter Units.SI.Length Lv = 15 "Cavity length"; - parameter Units.SI.Length L2 = 14 "Pipes length"; - parameter Units.SI.Length Lc = 2.5 "Support plate spacing in cooling zone(chicanes)"; - parameter Units.SI.Diameter Dc = 0.016 "Internal diameter of the cooling pipes"; - parameter Units.SI.Thickness ec = 2.e-3 "Thickness of the cooling pipes"; - parameter Integer Ns = 10 "Number of segments for pipes"; - parameter Integer ntubest = 10000 "Number of total pipes in Cavity "; - parameter Integer ntubesV = 200 "Numbers of pipes in a vertical plan in Cavity"; - parameter Units.SI.SpecificHeatCapacity cp = 460 "Specific heat capacity of the metal of the cooling pipes"; - parameter Units.SI.Density rho = 7900 "Density of the metal of the cooling pipes"; - parameter Units.SI.ThermalConductivity lambda = 26 "Wall thermal conductivity of the cooling pipes"; - parameter Units.SI.Temperature T0[Ns] = fill(290, Ns) "Initial fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.066 "Fraction of initial liquid volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0c = 1e4 "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Volumes.TwoPhaseCavityOnePipe DynamicCondenser(Vf0 = Vf0, P0 = P0c, Ns = Ns, L2 = L2, NbTubT = ntubest, Lc = Lc, NbTubV = ntubesV, Dext = Dc + 2*ec, R = Rv, L = Lv, Vertical = true, wsftype = wsftype, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion) annotation( - Placement(transformation(extent = {{-100, -100}, {100, 100}}, rotation = 0))); - DynamicOnePhaseFlowPipe pipe_3(D = Dc, L = L2, ntubes = ntubest, Ns = Ns, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, advection = advection, option_temperature = option_temperature, inertia = inertia, T0 = T0, h0 = h0) annotation( - Placement(transformation(extent = {{-58, -20}, {54, 18}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet" annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation( - Placement(transformation(extent = {{-110, -11}, {-90, 9}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation( - Placement(transformation(extent = {{89, -11}, {109, 9}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle annotation( - Placement(transformation(extent = {{98, -62}, {118, -42}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation( - Placement(transformation(extent = {{-91, 65}, {-71, 85}}, rotation = 0), iconTransformation(extent = {{-91, 65}, {-71, 85}}))); - Thermal.HeatTransfer.HeatExchangerWall Wall_3(D = Dc, e = ec, lambda = lambda, cpw = cp, rhow = rho, L = L2, Ns = Ns, ntubes = ntubest, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state) annotation( - Placement(transformation(extent = {{-58, -4}, {54, 40}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C2vap "Vapor inlet" annotation( - Placement(transformation(extent = {{-49, 82}, {-29, 102}}, rotation = 0), iconTransformation(extent = {{-49, 82}, {-29, 102}}))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area"; + parameter Units.SI.Length Lv=15 "Cavity length"; + parameter Units.SI.Length L2=14 "Pipes length"; + parameter Units.SI.Length Lc=2.5 + "Support plate spacing in cooling zone(chicanes)"; + parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes"; + parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes"; + parameter Integer Ns=10 "Number of segments for pipes"; + parameter Integer ntubest=10000 "Number of total pipes in Cavity "; + parameter Integer ntubesV=200 "Numbers of pipes in a vertical plan in Cavity"; + parameter Units.SI.SpecificHeatCapacity cp=460 + "Specific heat capacity of the metal of the cooling pipes"; + parameter Units.SI.Density rho=7900 + "Density of the metal of the cooling pipes"; + parameter Units.SI.ThermalConductivity lambda=26 + "Wall thermal conductivity of the cooling pipes"; + parameter Units.SI.Temperature T0[Ns]=fill(290, Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.066 "Fraction of initial liquid volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0c=1e4 + "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + Volumes.TwoPhaseCavityOnePipe DynamicCondenser( + redeclare package Medium = Medium, + Vf0=Vf0, + P0=P0c, + Ns=Ns, + L2=L2, + NbTubT=ntubest, + Lc=Lc, + NbTubV=ntubesV, + Dext=Dc + 2*ec, + R=Rv, + L=Lv, + Vertical=true, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) + annotation ( Placement(transformation(extent={{-100,-100}, + {100,100}}, rotation=0))); + DynamicOnePhaseFlowPipe pipe_3( + redeclare package Medium = Medium_Cooling, + D=Dc, + L=L2, + ntubes=ntubest, + Ns=Ns, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + advection=advection, + option_temperature=option_temperature, + inertia=inertia, + T0=T0, + h0=h0) + annotation (Placement(transformation(extent={{-58,-20},{54,18}}, rotation=0))); + Interfaces.Connectors.FluidInlet C1vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet" + annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation ( + Placement(transformation(extent={{-110,-11},{-90,9}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation ( + Placement(transformation(extent={{89,-11},{109,9}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle + annotation (Placement(transformation(extent={{98,-62},{118,-42}}, rotation= + 0))); + + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) "Extra water inlet" annotation ( + Placement(transformation(extent={{-91,65},{-71,85}}, rotation=0), + iconTransformation(extent={{-91,65},{-71,85}}))); + Thermal.HeatTransfer.HeatExchangerWall Wall_3( + D=Dc, + e=ec, + lambda=lambda, + cpw=cp, + rhow=rho, + L=L2, + Ns=Ns, + ntubes=ntubest, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state) + annotation (Placement(transformation(extent={{-58,-4},{54,40}}, rotation=0))); + Interfaces.Connectors.FluidInlet C2vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( + transformation(extent={{-49,82},{-29,102}}, rotation=0), + iconTransformation(extent={{-49,82},{-29,102}}))); equation + if (cardinality(C1) == 1) then C1.Q = 0; C1.h = 1.e5; C1.h_vol_1 = 1.e5; C1.diff_res_1 = 0; C1.diff_on_1 = false; - C1.ftype = ftype; - C1.Xco2 = 0; - C1.Xh2o = 0; - C1.Xo2 = 0; - C1.Xso2 = 0; + C1.Xi = Medium.X_default[1:Medium.nXi]; + C1.SubC = Medium.C_default; end if; + if (cardinality(C2vap) == 1) then C2vap.Q = 0; C2vap.h = 1.e5; C2vap.h_vol_1 = 1.e5; C2vap.diff_res_1 = 0; C2vap.diff_on_1 = false; - C2vap.ftype = ftype; - C2vap.Xco2 = 0; - C2vap.Xh2o = 0; - C2vap.Xo2 = 0; - C2vap.Xso2 = 0; + C2vap.Xi = Medium.X_default[1:Medium.nXi]; + C2vap.SubC = Medium.C_default; end if; - connect(DynamicCondenser.Cl, C2ex) annotation( - Line(points = {{7.10543e-015, -73.3333}, {7.10543e-015, -98}, {0, -98}, {0, -100}}, color = {0, 0, 255})); - connect(DynamicCondenser.yLevel, sortieReelle) annotation( - Line(points = {{98.8571, -31.3333}, {94, -31.3333}, {94, -52}, {108, -52}})); - connect(DynamicCondenser.Cth3, Wall_3.WT2) annotation( - Line(points = {{-0.571429, 37.3333}, {-2, 32}, {-2, 22.4}}, color = {191, 95, 0})); - connect(Wall_3.WT1, pipe_3.CTh) annotation( - Line(points = {{-2, 13.6}, {-2, 4.7}}, color = {191, 95, 0})); - connect(DynamicCondenser.CvBP, C1vap) annotation( - Line(points = {{-0.571429, 73.3333}, {-0.571429, 92}, {0, 92}, {0, 100}})); - connect(C2vap, DynamicCondenser.CvGCT) annotation( - Line(points = {{-39, 92}, {-42.8571, 92}, {-42.8571, 73.3333}})); - connect(pipe_3.C2, Ce2) annotation( - Line(points = {{54, -1}, {99, -1}}, color = {0, 0, 255}, thickness = 0.5)); - connect(pipe_3.C1, Ce1) annotation( - Line(points = {{-58, -1}, {-100, -1}}, thickness = 0.5)); - connect(C1, DynamicCondenser.Ce) annotation( - Line(points = {{-81, 75}, {-76.5714, 75}, {-76.5714, 52.6667}}, color = {0, 0, 0})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Text(extent = {{6, 114}, {32, 98}}, lineColor = {0, 0, 255}, textString = "LP")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Rectangle(extent = {{100, 58}, {80, -60}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 58}, {-80, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 24}, {-80, 18}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, -20}, {-80, -26}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, -42}, {-80, -48}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, 24}, {20, 18}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, -42}, {20, -48}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, -20}, {20, -26}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, -20}, {-30, -26}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, -42}, {-30, -48}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, 24}, {-30, 18}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{0, 100}, {-20, 98}, {-40, 94}, {-60, 88}, {-80, 78}, {-92, 66}, {-96, 62}, {-96, 62}, {-100, 58}, {100, 58}, {96, 62}, {92, 66}, {86, 72}, {80, 78}, {60, 88}, {40, 94}, {20, 98}, {0, 100}}, lineColor = {28, 108, 200}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{0, -100}, {-20, -98}, {-40, -96}, {-60, -90}, {-80, -80}, {-92, -68}, {-96, -64}, {-100, -60}, {-100, -60}, {98, -60}, {100, -60}, {96, -64}, {92, -68}, {80, -80}, {60, -90}, {40, -96}, {20, -98}, {0, -100}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({53, 117, 255}, if fluid == 1 then {53, 117, 255} else if fluid == 2 then {0, 255, 255} else if fluid == 3 then {175, 175, 175} else if fluid == 4 then {255, 170, 213} else if fluid == 5 then {0, 127, 0} else if fluid == 6 then {170, 215, 215} else {213, 255, 170}), fillPattern = FillPattern.Solid, lineThickness = 0.5), Polygon(points = {{100, -60}, {80, -80}, {80, -60}, {100, -60}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{-100, -60}, {-80, -60}, {-80, -80}, {-100, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{-100, 58}, {-80, 58}, {-80, 78}, {-100, 58}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{100, 58}, {80, 58}, {80, 78}, {100, 58}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, -64}, {-80, -70}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, -64}, {20, -70}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, -64}, {-30, -70}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 2}, {-80, -4}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, 2}, {20, -4}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, 2}, {-30, -4}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 46}, {-80, 40}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, 46}, {20, 40}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, 46}, {-30, 40}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Line(points = {{90, 8}, {80, 20}}, color = {255, 0, 0}), Line(points = {{90, -10}, {80, -22}}, color = {255, 0, 0}), Line(points = {{90, -1}, {78, -1}}, color = {255, 0, 0}), Line(points = {{-90, 9}, {-80, 20}}, color = {0, 0, 255}), Line(points = {{-90, -10}, {-80, -24}}, color = {0, 0, 255}), Line(points = {{-90, -1}, {-76, -1}}, color = {0, 0, 255})}), + + connect(DynamicCondenser.Cl, C2ex) + annotation (Line(points={{7.10543e-015,-73.3333}, + {7.10543e-015,-98},{0,-98},{0,-100}}, color={0,0,255})); + connect(DynamicCondenser.yLevel, sortieReelle) + annotation (Line(points={{98.8571,-31.3333},{94,-31.3333},{94,-52},{108,-52}})); + connect(DynamicCondenser.Cth3, Wall_3.WT2) + annotation (Line(points={{-0.571429, + 37.3333},{-2,32},{-2,22.4}}, color={191,95,0})); + connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{-2,13.6},{-2,4.7}}, + color={191,95,0})); + connect(DynamicCondenser.CvBP, C1vap) + annotation (Line(points={{-0.571429,73.3333},{-0.571429,92},{0,92},{0,100}})); + connect(C2vap, DynamicCondenser.CvGCT) + annotation (Line(points={{-39,92},{-42.8571,92},{-42.8571,73.3333}})); + connect(pipe_3.C2, Ce2) annotation (Line( + points={{54,-1},{99,-1}}, + color={0,0,255}, + thickness=0.5)); + connect(pipe_3.C1, Ce1) + annotation (Line(points={{-58,-1},{-100,-1}}, thickness=0.5)); + connect(C1, DynamicCondenser.Ce) annotation (Line(points={{-81,75},{-76.5714, + 75},{-76.5714,52.6667}}, + color={0,0,0})); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={Text( + extent={{6,114},{32,98}}, + lineColor={0,0,255}, + textString="LP")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={ + Rectangle( + extent={{100,58},{80,-60}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,58},{-80,-60}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,24},{-80,18}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,-20},{-80,-26}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,-42},{-80,-48}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,24},{20,18}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,-42},{20,-48}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,-20},{20,-26}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,-20},{-30,-26}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,-42},{-30,-48}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,24},{-30,18}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,100},{-20,98},{-40,94},{-60,88},{-80,78},{-92,66},{-96,62}, + {-96,62},{-100,58},{100,58},{96,62},{92,66},{86,72},{80,78},{60, + 88},{40,94},{20,98},{0,100}}, + lineColor={28,108,200}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-100},{-20,-98},{-40,-96},{-60,-90},{-80,-80},{-92,-68},{ + -96,-64},{-100,-60},{-100,-60},{98,-60},{100,-60},{96,-64},{92, + -68},{80,-80},{60,-90},{40,-96},{20,-98},{0,-100}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({53,117,255}, if fluid==1 then {53,117,255} else if fluid==2 then {0,255,255} else if fluid==3 then {175,175,175} else if fluid==4 then {255,170,213} else if fluid==5 then {0,127,0} else if fluid==6 then {170,215,215} else {213,255,170}), + fillPattern=FillPattern.Solid, + lineThickness=0.5), + Polygon( + points={{100,-60},{80,-80},{80,-60},{100,-60}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-100,-60},{-80,-60},{-80,-80},{-100,-60}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-100,58},{-80,58},{-80,78},{-100,58}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{100,58},{80,58},{80,78},{100,58}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,-64},{-80,-70}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,-64},{20,-70}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,-64},{-30,-70}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,2},{-80,-4}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,2},{20,-4}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,2},{-30,-4}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,46},{-80,40}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,46},{20,40}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,46},{-30,40}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Line(points={{90,8},{80,20}}, color={255,0,0}), + Line(points={{90,-10},{80,-22}}, color={255,0,0}), + Line(points={{90,-1},{78,-1}}, color={255,0,0}), + Line(points={{-90,9},{-80,20}}, color={0,0,255}), + Line(points={{-90,-10},{-80,-24}}, color={0,0,255}), + Line(points={{-90,-1},{-76,-1}}, color={0,0,255})}), Documentation(revisions = " Author @@ -121,4 +319,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 9.5.4 of the ThermoSysPro book. ")); -end DynamicCondenser; \ No newline at end of file +end DynamicCondenser; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo index bf5362fb..25a758ff 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo @@ -1,78 +1,170 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicFlueGasesMultiFluidHeatExchanger "Dynamic flue gases - water/steam heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 1 "Exchanger length"; - parameter Units.SI.Position z1 = 0 "Exchanger inlet altitude"; - parameter Units.SI.Position z2 = 0 "Exchanger outlet altitude"; - parameter Integer Ns = 1 "Numver of segments"; - parameter Units.SI.Diameter Dint = 0.1 "Pipe internal diameter"; - parameter Integer Ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.Thickness e = 2.e-3 "Wall thickness"; - parameter Units.SI.ThermalConductivity lambda = 26 "Wall thermal conductivity"; - parameter Units.SI.SpecificHeatCapacity cpw = 1000 "Wall specific heat capacity (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.Density rhow = 7800 "Wall density (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.Temperature T0[Ns] = fill(290, Ns) "Initial fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - StaticWallFlueGasesExchanger ExchangerFlueGasesMetal(Dext = 0.022, Ns = Ns, NbTub = Ntubes, L = L, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 10}}, rotation = 0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(L = L, D = Dint, Ns = Ns, ntubes = Ntubes, dynamic_energy_balance = dynamic_energy_balance, cpw = cpw, rhow = rhow, steady_state = steady_state, e = e, lambda = lambda, T0 = T0[1]) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe(L = L, D = Dint, ntubes = Ntubes, Ns = Ns, z1 = z1, z2 = z2, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, T0 = T0, h0 = h0) annotation( - Placement(transformation(extent = {{-10, -30}, {10, -10}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cfg1 annotation( - Placement(transformation(extent = {{-10, 40}, {10, 60}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cfg2 annotation( - Placement(transformation(extent = {{-10, -60}, {10, -40}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cws1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Length L=1 "Exchanger length"; + parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; + parameter Units.SI.Position z2=0 "Exchanger outlet altitude"; + parameter Integer Ns=1 "Numver of segments"; + parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter"; + parameter Integer Ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.Thickness e=2.e-3 "Wall thickness"; + parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity"; + parameter Units.SI.SpecificHeatCapacity cpw=1000 + "Wall specific heat capacity (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.Density rhow=7800 + "Wall density (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.Temperature T0[Ns]=fill(290, Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + StaticWallFlueGasesExchanger + ExchangerFlueGasesMetal( + redeclare package Medium = Medium_FlueGases, + Dext=0.022, + Ns=Ns, + NbTub=Ntubes, + L=L, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) + annotation (Placement(transformation(extent={{-10,30},{10,10}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall( + L=L, + D=Dint, + Ns=Ns, + ntubes=Ntubes, + dynamic_energy_balance=dynamic_energy_balance, + cpw=cpw, + rhow=rhow, + steady_state=steady_state, + e=e, + lambda=lambda, + T0=T0[1]) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); + Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe( + redeclare package Medium = Medium, + L=L, + D=Dint, + ntubes=Ntubes, + Ns=Ns, + z1=z1, + z2=z2, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + T0=T0, + h0=h0) + annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation( + extent={{-10,40},{10,60}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation( + extent={{-10,-60},{10,-40}}, rotation=0))); + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); equation - connect(Cws2, TwoPhaseFlowPipe.C2) annotation( - Line(points = {{100, 0}, {40, 0}, {40, -20}, {10, -20}}, color = {255, 0, 0})); - connect(Cws1, TwoPhaseFlowPipe.C1) annotation( - Line(points = {{-100, 0}, {-20, 0}, {-20, -20}, {-10, -20}})); - connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh) annotation( - Line(points = {{0, -2}, {0, -17}}, color = {191, 95, 0})); - connect(ExchangerFlueGasesMetal.CTh, ExchangerWall.WT2) annotation( - Line(points = {{0, 17}, {0, 2}}, color = {191, 95, 0})); - connect(ExchangerFlueGasesMetal.C1, Cfg1) annotation( - Line(points = {{-10, 20}, {-20, 20}, {-20, 50}, {0, 50}}, color = {0, 0, 0}, thickness = 0.5)); - connect(ExchangerFlueGasesMetal.C2, Cfg2) annotation( - Line(points = {{10, 20}, {24, 20}, {24, -50}, {0, -50}}, color = {0, 0, 0}, thickness = 0.5)); - annotation( - Icon(graphics = {Rectangle(extent = {{-100, 50}, {100, -50}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Backward), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.HorizontalCylinder, fillColor = {255, 127, 0}), Rectangle(extent = {{-100, 30}, {100, -30}}, lineColor = {0, 0, 0}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), lineThickness = 0), Line(points = {{-60, 50}, {-60, -50}}), Line(points = {{-20, 50}, {-20, -50}}), Line(points = {{20, 50}, {20, -50}}), Line(points = {{60, 50}, {60, -50}}), Text(extent = {{-132, 28}, {-106, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water inlet"), Text(extent = {{104, 26}, {128, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water outlet"), Text(extent = {{-50, 66}, {-16, 48}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Flue gases inlet"), Text(extent = {{-54, -50}, {-16, -70}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Flue gases outlet")}), + connect(Cws2, TwoPhaseFlowPipe.C2) + annotation (Line(points={{100,0},{40,0},{40, + -20},{10,-20}}, color={255,0,0})); + connect(Cws1, TwoPhaseFlowPipe.C1) + annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}})); + connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh) + annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0})); + connect(ExchangerFlueGasesMetal.CTh, ExchangerWall.WT2) + annotation (Line(points={{0,17},{0,2}}, color={191,95,0})); + connect(ExchangerFlueGasesMetal.C1, Cfg1) annotation (Line( + points={{-10,20},{-20,20},{-20,50},{0,50}}, + color={0,0,0}, + thickness=0.5)); + connect(ExchangerFlueGasesMetal.C2, Cfg2) annotation (Line( + points={{10,20},{24,20},{24,-50},{0,-50}}, + color={0,0,0}, + thickness=0.5)); + annotation ( Icon(graphics={ + Rectangle( + extent={{-100,50},{100,-50}}, + lineColor={0,0,255}, + fillColor=DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Backward), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={255,127,0}), + Rectangle( + extent={{-100,30},{100,-30}}, + lineColor={0,0,0}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + lineThickness=0), + Line(points={{-60,50},{-60,-50}}), + Line(points={{-20,50},{-20,-50}}), + Line(points={{20,50},{20,-50}}), + Line(points={{60,50},{60,-50}}), + Text( + extent={{-132,28},{-106,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water inlet"), + Text( + extent={{104,26},{128,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water outlet"), + Text( + extent={{-50,66},{-16,48}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Flue gases inlet"), + Text( + extent={{-54,-50},{-16,-70}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Flue gases outlet")}), Documentation(revisions = " Author @@ -82,4 +174,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end DynamicFlueGasesMultiFluidHeatExchanger; \ No newline at end of file +end DynamicFlueGasesMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo index ced79086..95fb0991 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo @@ -1,84 +1,202 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicMultiFluidHeatExchanger "Dynamic one-phase heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 1 "Exchanger length"; - parameter Units.SI.Position z1 = 0 "Exchanger inlet altitude"; - parameter Units.SI.Position z2 = 0 "Exchanger outlet altitude"; - parameter Real rugosrel_int = 0.0007 "Internal relative roughness"; - parameter Real rugosrel_ext = 0.0007 "External relative roughness"; - parameter Units.SI.Diameter Dint = 0.1 "Internal diameter"; - parameter Units.SI.Diameter Dext = 0.11 "External diameter"; - parameter Integer Ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.Thickness e = 2.e-3 "Wall thickness"; - parameter Units.SI.ThermalConductivity lambda = 26 "Wall thermal conductivity"; - parameter Units.SI.SpecificHeatCapacity cpw = 1000 "Wall specific heat capacity (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Units.SI.Density rhow = 7800 "Wall density (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Integer Ns = 1 "Number of segments"; - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fluid initial pressure (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.Temperature T0[Ns] = fill(290, Ns) "Initial fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_2(Ns = Ns, L = L, ntubes = Ntubes, D = Dext, continuous_flow_reversal = continuous_flow_reversal, T0 = T0, h0 = h0, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, steady_state = steady_state, option_temperature = option_temperature, diffusion = diffusion, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, region = region, P0 = P0, z1 = z1, z2 = z2, rugosrel = rugosrel_ext, inertia = inertia) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 10}}, rotation = 0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(L = L, D = Dint, Ns = Ns, ntubes = Ntubes, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, T0 = T0[1], cpw = cpw, rhow = rhow, e = e, lambda = lambda) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_1(ntubes = Ntubes, Ns = Ns, T0 = T0, h0 = h0, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, region = region, P0 = P0, L = L, D = Dint, rugosrel = rugosrel_int, z1 = z1, z2 = z2) annotation( - Placement(transformation(extent = {{-10, -30}, {10, -10}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cfg1 annotation( - Placement(transformation(extent = {{-10, 40}, {10, 60}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cfg2 annotation( - Placement(transformation(extent = {{-10, -60}, {10, -40}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cws1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + + replaceable package Medium_1 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for fluid 1" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_2 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for fluid 2" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Length L=1 "Exchanger length"; + parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; + parameter Units.SI.Position z2=0 "Exchanger outlet altitude"; + parameter Real rugosrel_int=0.0007 "Internal relative roughness"; + parameter Real rugosrel_ext=0.0007 "External relative roughness"; + parameter Units.SI.Diameter Dint=0.1 "Internal diameter"; + parameter Units.SI.Diameter Dext=0.11 "External diameter"; + parameter Integer Ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.Thickness e=2.e-3 "Wall thickness"; + parameter Units.SI.ThermalConductivity lambda=26 "Wall thermal conductivity"; + parameter Units.SI.SpecificHeatCapacity cpw=1000 + "Wall specific heat capacity (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Units.SI.Density rhow=7800 + "Wall density (active if dynamic_energy_balance=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Integer Ns=1 "Number of segments"; + parameter Units.SI.AbsolutePressure P0=1.e5 + "Fluid initial pressure (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.Temperature T0[Ns]=fill(290, Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_2( + redeclare package Medium = Medium_2, + Ns=Ns, + L=L, + ntubes=Ntubes, + D=Dext, + continuous_flow_reversal=continuous_flow_reversal, + T0=T0, + h0=h0, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + steady_state=steady_state, + option_temperature=option_temperature, + diffusion=diffusion, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + P0=P0, + z1=z1, + z2=z2, + rugosrel=rugosrel_ext, + inertia=inertia) + annotation (Placement(transformation(extent={{-10,30},{10,10}}, + rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall( + L=L, + D=Dint, + Ns=Ns, + ntubes=Ntubes, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + T0=T0[1], + cpw=cpw, + rhow=rhow, + e=e, + lambda=lambda) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); + Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_1( + redeclare package Medium = Medium_1, + ntubes=Ntubes, + Ns=Ns, + T0=T0, + h0=h0, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + P0=P0, + L=L, + D=Dint, + rugosrel=rugosrel_int, + z1=z1, + z2=z2) annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, + rotation=0))); + Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_2) annotation (Placement(transformation( + extent={{-10,40},{10,60}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_2) annotation (Placement(transformation( + extent={{-10,-60},{10,-40}}, rotation=0))); + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_1) annotation ( + Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_1) annotation ( + Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); equation - connect(Cws2, DynamicOnePhaseFlowPipe_1.C2) annotation( - Line(points = {{100, 0}, {40, 0}, {40, -20}, {10, -20}}, color = {255, 0, 0}, thickness = 0.5)); - connect(Cws1, DynamicOnePhaseFlowPipe_1.C1) annotation( - Line(points = {{-100, 0}, {-20, 0}, {-20, -20}, {-10, -20}}, thickness = 0.5)); - connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe_1.CTh) annotation( - Line(points = {{0, -2}, {0, -17}}, color = {191, 95, 0})); - connect(DynamicOnePhaseFlowPipe_2.CTh, ExchangerWall.WT2) annotation( - Line(points = {{0, 17}, {0, 2}}, color = {191, 95, 0})); - connect(DynamicOnePhaseFlowPipe_2.C2, Cfg2) annotation( - Line(points = {{10, 20}, {32, 20}, {32, -50}, {0, -50}}, color = {0, 0, 0}, thickness = 1)); - connect(DynamicOnePhaseFlowPipe_2.C1, Cfg1) annotation( - Line(points = {{-10, 20}, {-26, 20}, {-26, 50}, {0, 50}}, color = {0, 0, 0}, thickness = 1)); - annotation( - Icon(graphics = {Rectangle(extent = {{-100, 50}, {100, -50}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Backward), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), fillColor = {255, 127, 0}), Rectangle(extent = {{-100, 30}, {100, -30}}, lineColor = {0, 0, 0}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static)), Line(points = {{-60, 50}, {-60, -50}}), Line(points = {{-20, 50}, {-20, -50}}), Line(points = {{20, 50}, {20, -50}}), Line(points = {{60, 50}, {60, -50}}), Text(extent = {{-48, 68}, {-20, 52}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid2 inlet"), Text(extent = {{-134, 22}, {-108, 10}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid1 inlet"), Text(extent = {{104, 24}, {132, 12}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid1 outlet"), Text(extent = {{-46, -56}, {-14, -68}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid2 outlet")}), + connect(Cws2, DynamicOnePhaseFlowPipe_1.C2) annotation (Line( + points={{100,0},{40,0},{40,-20},{10,-20}}, + color={255,0,0}, + thickness=0.5)); + connect(Cws1, DynamicOnePhaseFlowPipe_1.C1) annotation (Line(points={{-100,0}, + {-20,0},{-20,-20},{-10,-20}}, thickness=0.5)); + connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe_1.CTh) + annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0})); + connect(DynamicOnePhaseFlowPipe_2.CTh, ExchangerWall.WT2) + annotation (Line(points={{0,17},{0,2}}, color={191,95,0})); + connect(DynamicOnePhaseFlowPipe_2.C2, Cfg2) annotation (Line( + points={{10,20},{32,20},{32,-50},{0,-50}}, + color={0,0,0}, + thickness=1)); + connect(DynamicOnePhaseFlowPipe_2.C1, Cfg1) annotation (Line( + points={{-10,20},{-26,20},{-26,50},{0,50}}, + color={0,0,0}, + thickness=1)); + annotation ( Icon(graphics={ + Rectangle( + extent={{-100,50},{100,-50}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Backward), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + fillColor={255,127,0}), + Rectangle( + extent={{-100,30},{100,-30}}, + lineColor={0,0,0}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,255}, + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static)), + Line(points={{-60,50},{-60,-50}}), + Line(points={{-20,50},{-20,-50}}), + Line(points={{20,50},{20,-50}}), + Line(points={{60,50},{60,-50}}), + Text( + extent={{-48,68},{-20,52}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid2 inlet"), + Text( + extent={{-134,22},{-108,10}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid1 inlet"), + Text( + extent={{104,24},{132,12}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid1 outlet"), + Text( + extent={{-46,-56},{-14,-68}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid2 outlet")}), Documentation(revisions = " Author @@ -88,4 +206,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end DynamicMultiFluidHeatExchanger; \ No newline at end of file +end DynamicMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo index 08447592..7c6c23a3 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo @@ -1,74 +1,200 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicMultiFluidHeatExchangerShell "Dynamic one-phase heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 1 "Exchanger length"; - parameter Units.SI.Position z1 = 0 "Exchanger inlet altitude"; - parameter Units.SI.Position z2 = 0 "Exchanger outlet altitude"; - parameter Integer Ns = 1 "Numver of segments"; - parameter Units.SI.Diameter Dint = 0.1 "Pipe internal diameter"; - parameter Units.SI.Diameter Dext = 0.11 "Pipe external diameter"; - parameter Integer Ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fluid initial pressure (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.Temperature T0[Ns] = fill(290, Ns) "Initial fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell(Ns = Ns, L = L, ntubes = Ntubes, De = Dext, inertia = inertia, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, advection = advection, diffusion = diffusion, T0 = T0, h0 = h0, region = region) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 10}}, rotation = 0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(L = L, D = Dint, Ns = Ns, ntubes = Ntubes, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe(L = L, D = Dint, ntubes = Ntubes, Ns = Ns, z1 = z1, z2 = z2, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, dynamic_mass_balance = dynamic_mass_balance, T0 = T0, h0 = h0, P0 = P0, region = region) annotation( - Placement(transformation(extent = {{-10, -30}, {10, -10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation( - Placement(transformation(extent = {{-10, 40}, {10, 60}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation( - Placement(transformation(extent = {{-10, -60}, {10, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + + replaceable package Medium_shell = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for shell-side fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_pipe = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for pipe-side fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Length L=1 "Exchanger length"; + parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; + parameter Units.SI.Position z2=0 "Exchanger outlet altitude"; + parameter Integer Ns=1 "Numver of segments"; + parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter"; + parameter Units.SI.Diameter Dext=0.11 "Pipe external diameter"; + parameter Integer Ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.AbsolutePressure P0=1.e5 + "Fluid initial pressure (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.Temperature T0[Ns]=fill(290, Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell + dynamicOnePhaseFlowShell( + redeclare package Medium = Medium_shell, + Ns=Ns, + L=L, + ntubes=Ntubes, + De=Dext, + inertia=inertia, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + advection=advection, + diffusion=diffusion, + T0=T0, + h0=h0) + annotation (Placement(transformation(extent={{-10,30},{10,10}}, + rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall( + L=L, + D=Dint, + Ns=Ns, + ntubes=Ntubes, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); + Fluid.HeatExchangers.DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe( + redeclare package Medium = Medium_pipe, + L=L, + D=Dint, + ntubes=Ntubes, + Ns=Ns, + z1=z1, + z2=z2, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + dynamic_mass_balance=dynamic_mass_balance, + T0=T0, + h0=h0, + P0=P0) + annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_shell) annotation ( + Placement(transformation(extent={{-10,40},{10,60}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_shell) annotation ( + Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_pipe) annotation ( + Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_pipe) annotation ( + Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); equation - connect(Cws2, DynamicOnePhaseFlowPipe.C2) annotation( - Line(points = {{100, 0}, {40, 0}, {40, -20}, {10, -20}}, color = {255, 0, 0}, thickness = 0.5)); - connect(Cws1, DynamicOnePhaseFlowPipe.C1) annotation( - Line(points = {{-100, 0}, {-20, 0}, {-20, -20}, {-10, -20}}, thickness = 0.5)); - connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe.CTh) annotation( - Line(points = {{0, -2}, {0, -17}}, color = {191, 95, 0})); - connect(dynamicOnePhaseFlowShell.CTh, ExchangerWall.WT2) annotation( - Line(points = {{0, 17}, {0, 2}}, color = {191, 95, 0})); - connect(dynamicOnePhaseFlowShell.C2, Cfg2) annotation( - Line(points = {{10, 20}, {32, 20}, {32, -50}, {0, -50}}, color = {0, 0, 0}, thickness = 1)); - connect(dynamicOnePhaseFlowShell.C1, Cfg1) annotation( - Line(points = {{-10, 20}, {-26, 20}, {-26, 50}, {0, 50}}, color = {0, 0, 0}, thickness = 1)); - annotation( - Icon(graphics = {Rectangle(extent = {{-100, 50}, {100, -50}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Backward), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), fillColor = {255, 127, 0}), Rectangle(extent = {{-100, 30}, {100, -30}}, lineColor = {0, 0, 0}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 255}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static)), Line(points = {{-60, 50}, {-60, -50}}), Line(points = {{-20, 50}, {-20, -50}}), Line(points = {{20, 50}, {20, -50}}), Line(points = {{60, 50}, {60, -50}}), Line(points = {{-60, -30}, {-60, -50}}, color = {255, 255, 255}, thickness = 1), Line(points = {{-20, 50}, {-20, 30}}, color = {255, 255, 255}, thickness = 1), Line(points = {{20, -30}, {20, -50}}, color = {255, 255, 255}, thickness = 1), Line(points = {{60, 50}, {60, 30}}, color = {255, 255, 255}, thickness = 1), Text(extent = {{-50, 66}, {-16, 48}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Flue gases inlet"), Text(extent = {{-132, 28}, {-106, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water inlet"), Text(extent = {{-54, -50}, {-16, -70}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Flue gases outlet"), Text(extent = {{104, 26}, {128, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water outlet")}), + connect(Cws2, DynamicOnePhaseFlowPipe.C2) annotation (Line( + points={{100,0},{40,0},{40,-20},{10,-20}}, + color={255,0,0}, + thickness=0.5)); + connect(Cws1, DynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-100,0},{-20, + 0},{-20,-20},{-10,-20}}, thickness=0.5)); + connect(ExchangerWall.WT1, DynamicOnePhaseFlowPipe.CTh) + annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0})); + connect(dynamicOnePhaseFlowShell.CTh, ExchangerWall.WT2) + annotation (Line(points={{0,17},{0,2}}, color={191,95,0})); + connect(dynamicOnePhaseFlowShell.C2, Cfg2) annotation (Line( + points={{10,20},{32,20},{32,-50},{0,-50}}, + color={0,0,0}, + thickness=1)); + connect(dynamicOnePhaseFlowShell.C1, Cfg1) annotation (Line( + points={{-10,20},{-26,20},{-26,50},{0,50}}, + color={0,0,0}, + thickness=1)); + annotation ( Icon(graphics={ + Rectangle( + extent={{-100,50},{100,-50}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Backward), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + fillColor={255,127,0}), + Rectangle( + extent={{-100,30},{100,-30}}, + lineColor={0,0,0}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,255}, + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static)), + Line(points={{-60,50},{-60,-50}}), + Line(points={{-20,50},{-20,-50}}), + Line(points={{20,50},{20,-50}}), + Line(points={{60,50},{60,-50}}), + Line( + points={{-60,-30},{-60,-50}}, + color={255,255,255}, + thickness=1), + Line( + points={{-20,50},{-20,30}}, + color={255,255,255}, + thickness=1), + Line( + points={{20,-30},{20,-50}}, + color={255,255,255}, + thickness=1), + Line( + points={{60,50},{60,30}}, + color={255,255,255}, + thickness=1), + Text( + extent={{-50,66},{-16,48}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Flue gases inlet"), + Text( + extent={{-132,28},{-106,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water inlet"), + Text( + extent={{-54,-50},{-16,-70}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Flue gases outlet"), + Text( + extent={{104,26},{128,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water outlet")}), Documentation(revisions = " Author @@ -78,4 +204,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end DynamicMultiFluidHeatExchangerShell; \ No newline at end of file +end DynamicMultiFluidHeatExchangerShell; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo index b28188c7..c0f50a69 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo @@ -1,138 +1,455 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicWaterHeater "Dynamic water heater" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - //parameter ThermoSysPro.Units.SI.Volume Vc=4510 "Cavity total volume"; - //parameter ThermoSysPro.Units.SI.Area Ac=200 "Cavity cross-sectional area"; - parameter Units.SI.Radius Rv = 1.0 "Radius of the Cavity cross-sectional area"; - parameter Units.SI.Length L1 = 12.5 " Length of drowned pipes in liquid (pipes 1)"; - parameter Units.SI.Length L2 = 12.5 " Length of Pipe 2 (in steam)"; - parameter Units.SI.Length L3 = 25 " Length of Pipe 3 (in steam)"; - parameter Units.SI.Length Lc = 2.5 "support plate spacing in cooling zone(chicanes)"; - parameter Units.SI.Diameter Dc = 0.016 "Internal diameter of the cooling pipes"; - parameter Units.SI.Thickness ec = 2.e-3 " Thickness of the cooling pipes"; - parameter Units.SI.Diameter DIc = 1.390 "Internal calendre diameter"; - parameter Units.SI.Length PasL = 0.03 "Longitudinal step or bottom pipes triangular step"; - parameter Units.SI.Length PasT = 0.03 " Transverse step or pipes step"; - //parameter ThermoSysPro.Units.SI.Angle Angle = 60 "Average bend angle (deg)"; - parameter Integer Ns = 10 "Number of segments for one tube pass (half U pipe"; - parameter Integer ntubes1 = 500 "Numbers of drowned pipes in liquid for pipes 1"; - parameter Integer ntubes2 = 500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2"; - parameter Integer ntubes3 = 500 "Numbers of the pipes immersed in steam, for pipe 3"; - parameter Integer ntubesV = 15 "Numbers of pipes in a vertical row (tube bank)"; - parameter Units.SI.SpecificHeatCapacity cp = 460 "Specific heat capacity of the metal of the cooling pipes"; - parameter Units.SI.Density rho = 7900 "Density of the metal of the cooling pipes"; - parameter Units.SI.ThermalConductivity lambda = 26 "Wall thermal conductivity of the cooling pipes"; - //parameter ThermoSysPro.Units.SI.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes"; - parameter Real DpfCorr = 1.00 "Corrective terme for friction pressure loss (dpf) in node i"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume"; + //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area"; + parameter Units.SI.Radius Rv=1.0 "Radius of the Cavity cross-sectional area"; + parameter Units.SI.Length L1=12.5 + " Length of drowned pipes in liquid (pipes 1)"; + parameter Units.SI.Length L2=12.5 " Length of Pipe 2 (in steam)"; + parameter Units.SI.Length L3=25 " Length of Pipe 3 (in steam)"; + parameter Units.SI.Length Lc=2.5 + "support plate spacing in cooling zone(chicanes)"; + parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes"; + parameter Units.SI.Thickness ec=2.e-3 " Thickness of the cooling pipes"; + parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter"; + parameter Units.SI.Length PasL=0.03 + "Longitudinal step or bottom pipes triangular step"; + parameter Units.SI.Length PasT=0.03 " Transverse step or pipes step"; + //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)"; + parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe"; + parameter Integer ntubes1=500 "Numbers of drowned pipes in liquid for pipes 1"; + parameter Integer ntubes2=500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2"; + parameter Integer ntubes3=500 "Numbers of the pipes immersed in steam, for pipe 3"; + parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)"; + parameter Units.SI.SpecificHeatCapacity cp=460 + "Specific heat capacity of the metal of the cooling pipes"; + parameter Units.SI.Density rho=7900 + "Density of the metal of the cooling pipes"; + parameter Units.SI.ThermalConductivity lambda=26 + "Wall thermal conductivity of the cooling pipes"; + //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes"; + parameter Real DpfCorr= 1.00 "Corrective terme for friction pressure loss (dpf) in node i"; parameter Real COP0v = 1.0 "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side"; parameter Real COP0l = 1 "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side"; - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = true "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0c = 1.e5 "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Volumes.TwoPhaseCavity WaterHeating(Vf0 = Vf0, P0 = P0c, Ns = Ns, L2 = L2, NbTub1 = ntubes1, NbTubV = ntubesV, DIc = DIc, R = Rv, Dext = Dc + 2*ec, COPv = COP0v, COPl = COP0l, Lc = Lc, PasL = PasL, PasT = PasT, L1 = L1, L3 = L3, NbTub2 = ntubes2, NbTub3 = ntubes3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, Cal_hconv = true, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, wsftype = wsftype) annotation( - Placement(transformation(extent = {{-100, -100}, {100, 100}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(option_temperature = false, D = Dc, Ns = Ns*2, dpfCorr = DpfCorr, L = L3, ntubes = ntubes3, Q(start = fill(300, Ns*2 + 1)), P(start = fill(200e5, 2*Ns + 2)), dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, inertia = inertia, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, advection = advection) annotation( - Placement(transformation(extent = {{-35, -34}, {60, 0}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet" annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation( - Placement(transformation(extent = {{-110, -55}, {-90, -35}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation( - Placement(transformation(extent = {{-110, 34}, {-90, 54}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle annotation( - Placement(transformation(extent = {{92, -86}, {112, -66}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation( - Placement(transformation(extent = {{-74, 82}, {-54, 102}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall Wall_3(D = Dc, e = ec, lambda = lambda, cpw = cp, rhow = rho, Ns = Ns*2, L = L3, ntubes = ntubes3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state) annotation( - Placement(transformation(extent = {{-34, -24}, {60, 24}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_1(option_temperature = false, D = Dc, Ns = Ns, ntubes = ntubes1, dpfCorr = DpfCorr, Q(start = fill(200, Ns + 1)), L = L1, P(start = fill(200e5, Ns + 2)), dynamic_mass_balance = dynamic_mass_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, inertia = inertia, advection = advection, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, dynamic_energy_balance = dynamic_energy_balance) annotation( - Placement(transformation(extent = {{-35, -77}, {60, -43}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall Wall_1(D = Dc, e = ec, lambda = lambda, cpw = cp, rhow = rho, Ns = Ns, ntubes = ntubes1, L = L1, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state) annotation( - Placement(transformation(extent = {{-35, -69}, {59, -21}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_2(option_temperature = false, D = Dc, Ns = Ns, dpfCorr = DpfCorr, Q(start = fill(200, Ns + 1)), L = L2, ntubes = ntubes2, P(start = fill(200e5, Ns + 2)), dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, inertia = inertia, advection = advection, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance) annotation( - Placement(transformation(extent = {{60, 11}, {-35, 45}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall Wall_2(D = Dc, e = ec, lambda = lambda, cpw = cp, rhow = rho, Ns = Ns, L = L2, ntubes = ntubes2, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state) annotation( - Placement(transformation(extent = {{-35, 21}, {59, 69}}, rotation = 0))); - Volumes.VolumeC volumeC(h0 = 890e3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, diffusion = diffusion, dynamic_mass_balance = dynamic_mass_balance, continuous_flow_reversal = continuous_flow_reversal, ftype = ftype) annotation( - Placement(transformation(extent = {{-56, 35}, {-74, 53}}, rotation = 0))); - Volumes.VolumeD volumeD(h0 = 790e3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, diffusion = diffusion, dynamic_mass_balance = dynamic_mass_balance, continuous_flow_reversal = continuous_flow_reversal, ftype = ftype) annotation( - Placement(transformation(extent = {{-74, -54}, {-56, -36}}, rotation = 0))); - Volumes.VolumeD volumeD1(h0 = 850e3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, diffusion = diffusion, dynamic_mass_balance = dynamic_mass_balance, ftype = ftype) annotation( - Placement(transformation(origin = {75, -33}, extent = {{-9, -9}, {9, 9}}, rotation = 90))); + parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium_Cooling.isCompressible and dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true "true: start from steady state - false: start from (P0c, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0c=1.e5 + "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + Volumes.TwoPhaseCavity WaterHeating( + redeclare package Medium = Medium, + Vf0=Vf0, + P0=P0c, + Ns=Ns, + L2=L2, + NbTub1=ntubes1, + NbTubV=ntubesV, + DIc=DIc, + R=Rv, + Dext=Dc + 2*ec, + COPv=COP0v, + COPl=COP0l, + Lc=Lc, + PasL=PasL, + PasT=PasT, + L1=L1, + L3=L3, + NbTub2=ntubes2, + NbTub3=ntubes3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + Cal_hconv=true, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) + annotation ( Placement(transformation(extent={{-100, + -100},{100,100}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3( + redeclare package Medium = Medium_Cooling, + option_temperature=false, + D=Dc, + Ns=Ns*2, + dpfCorr=DpfCorr, + L=L3, + ntubes=ntubes3, + Q(start=fill(300, Ns*2 + 1)), + P(start=fill(200e5, 2*Ns + 2)), + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + inertia=inertia, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + advection=advection) + annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0))); + Interfaces.Connectors.FluidInlet C1vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet" + annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation ( + Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation ( + Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle + annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation= + 0))); + + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) "Extra water inlet" annotation ( + Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0))); + Thermal.HeatTransfer.HeatExchangerWall Wall_3( + D=Dc, + e=ec, + lambda=lambda, + cpw=cp, + rhow=rho, + Ns=Ns*2, + L=L3, + ntubes=ntubes3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state) + annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_1( + redeclare package Medium = Medium_Cooling, + option_temperature=false, + D=Dc, + Ns=Ns, + ntubes=ntubes1, + dpfCorr=DpfCorr, + Q(start=fill(200, Ns + 1)), + L=L1, + P(start=fill(200e5, Ns + 2)), + dynamic_mass_balance=dynamic_mass_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + inertia=inertia, + advection=advection, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + dynamic_energy_balance=dynamic_energy_balance) + annotation (Placement(transformation(extent={{-35,-77},{60,-43}}, rotation= + 0))); + Thermal.HeatTransfer.HeatExchangerWall Wall_1( + D=Dc, + e=ec, + lambda=lambda, + cpw=cp, + rhow=rho, + Ns=Ns, + ntubes=ntubes1, + L=L1, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state) + annotation (Placement(transformation(extent={{-35,-69},{59,-21}}, rotation= + 0))); + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_2( + redeclare package Medium = Medium_Cooling, + option_temperature=false, + D=Dc, + Ns=Ns, + dpfCorr=DpfCorr, + Q(start=fill(200, Ns + 1)), + L=L2, + ntubes=ntubes2, + P(start=fill(200e5, Ns + 2)), + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + inertia=inertia, + advection=advection, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance) + annotation (Placement(transformation(extent={{60,11},{-35,45}}, rotation=0))); + + Thermal.HeatTransfer.HeatExchangerWall Wall_2( + D=Dc, + e=ec, + lambda=lambda, + cpw=cp, + rhow=rho, + Ns=Ns, + L=L2, + ntubes=ntubes2, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state) + annotation (Placement(transformation(extent={{-35,21},{59,69}}, rotation=0))); + Volumes.VolumeC volumeC( + redeclare package Medium = Medium_Cooling, + h0=890e3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + diffusion=diffusion, + dynamic_mass_balance=dynamic_mass_balance, + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{ + -56,35},{-74,53}}, rotation=0))); + Volumes.VolumeD volumeD( + redeclare package Medium = Medium_Cooling, + h0=790e3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + diffusion=diffusion, + dynamic_mass_balance=dynamic_mass_balance, + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{-74,-54},{-56, + -36}}, rotation=0))); + Volumes.VolumeD volumeD1( + redeclare package Medium = Medium_Cooling, + h0=850e3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + diffusion=diffusion, + dynamic_mass_balance=dynamic_mass_balance) annotation (Placement(transformation( + origin={75,-33}, + extent={{-9,-9},{9,9}}, + rotation=90))); equation + if (cardinality(C1) == 1) then C1.Q = 0; C1.h = 1.e5; C1.h_vol_1 = 1.e5; C1.diff_res_1 = 0; C1.diff_on_1 = false; - C1.ftype = ftype; - C1.Xco2 = 0; - C1.Xh2o = 0; - C1.Xo2 = 0; - C1.Xso2 = 0; + C1.Xi = Medium.X_default[1:Medium.nXi]; + C1.SubC = Medium.C_default; end if; - connect(C1vap, WaterHeating.Cv) annotation( - Line(points = {{0, 100}, {0, 73.3333}, {1.11111, 73.3333}})); - connect(WaterHeating.Cl, C2ex) annotation( - Line(points = {{1.11111, -73.3333}, {1.11111, -94}, {-2, -94}, {-2, -98}, {0, -98}, {0, -100}}, color = {0, 0, 255})); - connect(C1, WaterHeating.Ce) annotation( - Line(points = {{-64, 92}, {-60, 92}, {-60, 73.3333}, {-38.8889, 73.3333}})); - connect(WaterHeating.yLevel, sortieReelle) annotation( - Line(points = {{98.8889, -32.6667}, {94, -32.6667}, {94, -76}, {102, -76}})); - connect(WaterHeating.Cth2, Wall_2.WT2) annotation( - Line(points = {{0.555556, 50.3333}, {0.555556, 55.4}, {12, 55.4}, {12, 49.8}}, color = {191, 95, 0})); - connect(Wall_2.WT1, pipe_2.CTh) annotation( - Line(points = {{12, 40.2}, {12, 33.1}, {12.5, 33.1}}, color = {191, 95, 0})); - connect(WaterHeating.Cth1, Wall_1.WT2) annotation( - Line(points = {{0.555556, -51}, {0.555556, -35.5}, {12, -35.5}, {12, -40.2}}, color = {191, 95, 0})); - connect(Wall_1.WT1, pipe_1.CTh) annotation( - Line(points = {{12, -49.8}, {12, -54.4}, {12.5, -54.4}, {12.5, -54.9}}, color = {191, 95, 0})); - connect(WaterHeating.Cth3, Wall_3.WT2) annotation( - Line(points = {{0.555556, 2}, {0.555556, 8.33335}, {13, 8.33335}, {13, 4.8}}, color = {191, 95, 0})); - connect(Wall_3.WT1, pipe_3.CTh) annotation( - Line(points = {{13, -4.8}, {13, -10.4}, {12.5, -10.4}, {12.5, -11.9}}, color = {191, 95, 0})); - connect(Ce1, volumeD.Ce) annotation( - Line(points = {{-100, -45}, {-74, -45}}, thickness = 1)); - connect(volumeD.Cs2, pipe_1.C1) annotation( - Line(points = {{-65, -54}, {-65, -60}, {-35, -60}}, color = {0, 0, 255}, thickness = 1)); - connect(pipe_3.C2, volumeC.Ce3) annotation( - Line(points = {{60, -17}, {70, -17}, {70, 20}, {-65, 20}, {-65, 35}}, color = {95, 95, 95}, thickness = 1)); - connect(pipe_2.C2, volumeC.Ce1) annotation( - Line(points = {{-35, 28}, {-46, 28}, {-46, 44}, {-56, 44}}, color = {0, 0, 255}, thickness = 1)); - connect(volumeD.Cs1, pipe_3.C1) annotation( - Line(points = {{-65, -36}, {-66, -36}, {-66, -17}, {-35, -17}}, color = {95, 95, 95}, thickness = 1)); - connect(Ce2, volumeC.Cs) annotation( - Line(points = {{-100, 44}, {-74, 44}}, color = {95, 95, 95}, thickness = 1)); - connect(volumeD1.Ce, pipe_1.C2) annotation( - Line(points = {{75, -42}, {68, -42}, {68, -60}, {60, -60}}, color = {0, 0, 255}, thickness = 1)); - connect(volumeD1.Cs3, pipe_2.C1) annotation( - Line(points = {{75, -24}, {76, -24}, {76, 28}, {60, 28}}, color = {0, 0, 255}, thickness = 1)); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Text(extent = {{-116, -56}, {-90, -72}}, lineColor = {0, 0, 255}, textString = "Inlet"), Text(extent = {{-110, 67}, {-86, 53}}, lineColor = {0, 0, 255}, textString = "Outlet"), Text(extent = {{16, 102}, {44, 87}}, lineColor = {0, 0, 255}, textString = "Steam")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Rectangle(extent = {{-100, 0}, {-74, -90}}, lineColor = {0, 0, 255}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{60, -8}, {0, -14}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, 14}, {-74, 8}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{60, 14}, {16, 8}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Line(points = {{60, -90}, {-100, -90}}, color = {0, 0, 255}, thickness = 0), Line(points = {{60, 90}, {-100, 90}}, color = {0, 0, 255}, thickness = 0), Line(points = {{-100, 0}, {76, 0}}, color = {0, 0, 255}), Rectangle(extent = {{-74, -52}, {60, -90}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 90}, {-74, 0}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, -8}, {-74, -14}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, -30}, {-74, -36}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, -54}, {-74, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, 36}, {-74, 30}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, 60}, {-74, 54}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{60, 90}, {70, 80}, {84, 60}, {94, 40}, {100, 20}, {102, 0}, {100, -20}, {94, -40}, {84, -60}, {70, -80}, {60, -90}, {60, 90}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid)), Rectangle(extent = {{66, 14}, {60, -14}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{70, 36}, {16, 30}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{78, 60}, {16, 54}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{74, -30}, {16, -36}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{60, -52}, {88, -52}, {74, -74}, {64, -86}, {59, -90}, {60, -52}}, lineColor = {255, 170, 170}, lineThickness = 0.5, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Line(points = {{-74, -76}, {72, -76}}, color = {255, 255, 255}, pattern = LinePattern.Dash, thickness = 0), Rectangle(extent = {{74, 36}, {68, -36}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{82, 60}, {76, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{76, -54}, {16, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Line(points = {{-74, -68}, {78, -68}}, color = {255, 255, 255}, pattern = LinePattern.Dash, thickness = 0), Line(points = {{-74, -58}, {84, -58}}, color = {255, 255, 255}, pattern = LinePattern.Dash, thickness = 0), Text(extent = {{-132, -18}, {-104, -32}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water inlet"), Text(extent = {{-132, 72}, {-106, 58}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water outlet")}), + + connect(C1vap, WaterHeating.Cv) + annotation (Line(points={{0,100},{0,73.3333},{ + 1.11111,73.3333}})); + connect(WaterHeating.Cl, C2ex) + annotation (Line(points={{1.11111,-73.3333},{ + 1.11111,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}}, color={0,0,255})); + connect(C1, WaterHeating.Ce) + annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-38.8889,73.3333}})); + connect(WaterHeating.yLevel, sortieReelle) + annotation (Line(points={{98.8889,-32.6667},{94,-32.6667},{94,-76},{102,-76}})); + connect(WaterHeating.Cth2, Wall_2.WT2) + annotation (Line(points={{0.555556,50.3333},{0.555556,55.4},{12,55.4},{12, + 49.8}}, + color={191,95,0})); + connect(Wall_2.WT1, pipe_2.CTh) annotation (Line(points={{12,40.2},{12,33.1}, + {12.5,33.1}}, color={191,95,0})); + connect(WaterHeating.Cth1, Wall_1.WT2) + annotation (Line(points={{0.555556,-51},{0.555556, + -35.5},{12,-35.5},{12,-40.2}}, color={191,95,0})); + connect(Wall_1.WT1, pipe_1.CTh) annotation (Line(points={{12,-49.8},{12,-54.4}, + {12.5,-54.4},{12.5,-54.9}}, color={191,95,0})); + connect(WaterHeating.Cth3, Wall_3.WT2) + annotation (Line(points={{0.555556,2},{0.555556, + 8.33335},{13,8.33335},{13,4.8}}, color={191,95,0})); + connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4}, + {12.5,-10.4},{12.5,-11.9}}, color={191,95,0})); + connect(Ce1, volumeD.Ce) + annotation (Line(points={{-100,-45},{-74,-45}}, thickness=1)); + connect(volumeD.Cs2, pipe_1.C1) annotation (Line( + points={{-65,-54},{-65,-60},{-35,-60}}, + color={0,0,255}, + thickness=1)); + connect(pipe_3.C2, volumeC.Ce3) annotation (Line( + points={{60,-17},{70,-17},{70,20},{-65,20},{-65,35}}, + color={95,95,95}, + thickness=1)); + connect(pipe_2.C2, volumeC.Ce1) annotation (Line( + points={{-35,28},{-46,28},{-46,44},{-56,44}}, + color={0,0,255}, + thickness=1)); + connect(volumeD.Cs1, pipe_3.C1) annotation (Line( + points={{-65,-36},{-66,-36},{-66,-17},{-35,-17}}, + color={95,95,95}, + thickness=1)); + connect(Ce2, volumeC.Cs) annotation (Line( + points={{-100,44},{-74,44}}, + color={95,95,95}, + thickness=1)); + connect(volumeD1.Ce, pipe_1.C2) annotation (Line( + points={{75,-42},{68,-42},{68,-60},{60,-60}}, + color={0,0,255}, + thickness=1)); + connect(volumeD1.Cs3, pipe_2.C1) annotation (Line( + points={{75,-24},{76,-24},{76,28},{60,28}}, + color={0,0,255}, + thickness=1)); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={ + Text( + extent={{-116,-56},{-90,-72}}, + lineColor={0,0,255}, + textString="Inlet"), + Text( + extent={{-110,67},{-86,53}}, + lineColor={0,0,255}, + textString="Outlet"), + Text( + extent={{16,102},{44,87}}, + lineColor={0,0,255}, + textString= + "Steam")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={ + Rectangle( + extent={{-100,0},{-74,-90}}, + lineColor={0,0,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{60,-8},{0,-14}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,14},{-74,8}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{60,14},{16,8}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Line( + points={{60,-90},{-100,-90}}, + color={0,0,255}, + thickness=0), + Line( + points={{60,90},{-100,90}}, + color={0,0,255}, + thickness=0), + Line( + points={{-100,0},{76,0}}, + color={0,0,255}), + Rectangle( + extent={{-74,-52},{60,-90}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,90},{-74,0}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,-8},{-74,-14}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,-30},{-74,-36}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,-54},{-74,-60}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,36},{-74,30}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,60},{-74,54}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{ + 94,-40},{84,-60},{70,-80},{60,-90},{60,90}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid)), + Rectangle( + extent={{66,14},{60,-14}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{70,36},{16,30}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{78,60},{16,54}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{74,-30},{16,-36}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}}, + lineColor={255,170,170}, + lineThickness=0.5, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Line( + points={{-74,-76},{72,-76}}, + color={255,255,255}, + pattern=LinePattern.Dash, + thickness=0), + Rectangle( + extent={{74,36},{68,-36}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{82,60},{76,-60}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{76,-54},{16,-60}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-74,-68},{78,-68}}, + color={255,255,255}, + pattern=LinePattern.Dash, + thickness=0), + Line( + points={{-74,-58},{84,-58}}, + color={255,255,255}, + pattern=LinePattern.Dash, + thickness=0), + Text( + extent={{-132,-18},{-104,-32}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water inlet"), + Text( + extent={{-132,72},{-106,58}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water outlet")}), Documentation(revisions = " Author @@ -143,4 +460,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 9.5.2 of the ThermoSysPro book. ")); -end DynamicWaterHeater; \ No newline at end of file +end DynamicWaterHeater; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo index 0a639da3..cf94719e 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo @@ -1,85 +1,157 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicWaterHeaterOnePipe "Dynamic water heater" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - //parameter ThermoSysPro.Units.SI.Volume Vc=4510 "Cavity total volume"; - //parameter ThermoSysPro.Units.SI.Area Ac=200 "Cavity cross-sectional area"; - parameter Units.SI.Radius Rv = 1.0 "Radius of the cavity cross-sectional area"; - parameter Units.SI.Length L1 = 12.5 "Length of drowned pipes in liquid (pipes 1)"; - parameter Units.SI.Length L2 = 12.5 "Length of Pipe 2 (in steam)"; - parameter Units.SI.Length L3 = 25 "Length of Pipe 3 (in steam)"; - parameter Units.SI.Length Lc = 2.5 "Support plate spacing in cooling zone(chicanes)"; - parameter Units.SI.Diameter Dc = 0.016 "Internal diameter of the cooling pipes"; - parameter Units.SI.Thickness ec = 2.e-3 "Thickness of the cooling pipes"; - parameter Units.SI.Diameter DIc = 1.390 "Internal calendre diameter"; - parameter Units.SI.Length PasL = 0.03 "Longitudianl step or Length bottom pipes triangular step"; - parameter Units.SI.Length PasT = 0.03 "Transverse step or pipes step"; - //parameter ThermoSysPro.Units.SI.Angle Angle = 60 "Average bend angle (deg)"; - parameter Integer Ns = 10 "Number of segments for one tube pass (half U pipe)"; - parameter Integer ntubes1 = 500 "Numbers of drowned pipes in liquid for pipes 1"; - parameter Integer ntubes2 = 500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2"; - parameter Integer ntubes3 = 500 "Numbers of the pipes immersed in steam, for pipe 3"; - parameter Integer ntubesV = 15 "Numbers of pipes in a vertical row (tube bank)"; - parameter Units.SI.SpecificHeatCapacity cp = 460 "Specific heat capacity of the metal of the cooling pipes"; - parameter Units.SI.Density rho = 7900 "Density of the metal of the cooling pipes"; - parameter Units.SI.ThermalConductivity lambda = 26 "Wall thermal conductivity of the cooling pipes"; - //parameter ThermoSysPro.Units.SI.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes"; - parameter Real DpfCorr = 1.00 "Corrective terme for friction pressure loss (dpf) in node i"; - parameter Real COP0v = 1.0 "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side"; - parameter Real COP0l = 1 "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side"; - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = true "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = isCompressible and dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from (Vf0, P0c, T0 or h0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0c = 1.e5 "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.Temperature T0[2*Ns] = fill(290, 2*Ns) "Initial fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[2*Ns] = fill(1e5, 2*Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state and not option_temperature)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - Volumes.TwoPhaseCavity WaterHeating(Vf0 = Vf0, P0 = P0c, Ns = Ns, L2 = L2, NbTub1 = ntubes1, NbTubV = ntubesV, DIc = DIc, R = Rv, Dext = Dc + 2*ec, COPv = COP0v, COPl = COP0l, Lc = Lc, PasL = PasL, PasT = PasT, L1 = L1, L3 = L3, NbTub2 = ntubes2, NbTub3 = ntubes3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, wsftype = wsftype) annotation( - Placement(transformation(extent = {{-100, -100}, {100, 100}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(D = Dc, Ns = Ns*2, dpfCorr = DpfCorr, L = L3, ntubes = ntubes3, Q(start = fill(300, Ns*2 + 1)), inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, h0 = h0, T0 = T0, option_temperature = option_temperature, P0 = P0c) annotation( - Placement(transformation(extent = {{-35, -34}, {60, 0}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1vap "Vapor inlet" annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet C2ex "Condensed water extraction outlet" annotation( - Placement(transformation(extent = {{-10, -110}, {10, -90}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ce1 "Cooling water inlet" annotation( - Placement(transformation(extent = {{-110, -55}, {-90, -35}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Ce2 "Cooling water outlet" annotation( - Placement(transformation(extent = {{-110, 34}, {-90, 54}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle annotation( - Placement(transformation(extent = {{92, -86}, {112, -66}}, rotation = 0))); - Interfaces.Connectors.FluidInlet C1 "Extra water inlet" annotation( - Placement(transformation(extent = {{-74, 82}, {-54, 102}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall Wall_3(D = Dc, e = ec, lambda = lambda, cpw = cp, rhow = rho, Ns = Ns*2, L = L3, ntubes = ntubes3, steady_state = steady_state, dynamic_energy_balance = dynamic_energy_balance) annotation( - Placement(transformation(extent = {{-34, -24}, {60, 24}}, rotation = 0))); - Volumes.VolumeD volumeD(h0 = 790e3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, diffusion = diffusion, dynamic_mass_balance = dynamic_mass_balance, continuous_flow_reversal = continuous_flow_reversal, ftype = ftype) annotation( - Placement(transformation(extent = {{-72, -54}, {-54, -36}}, rotation = 0))); - Volumes.VolumeC volumeC(h0 = 890e3, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, steady_state = steady_state, diffusion = diffusion, continuous_flow_reversal = continuous_flow_reversal, ftype = ftype) annotation( - Placement(transformation(extent = {{-52, 35}, {-70, 53}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipe" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + //parameter Modelica.SIunits.Volume Vc=4510 "Cavity total volume"; + //parameter Modelica.SIunits.Area Ac=200 "Cavity cross-sectional area"; + parameter Units.SI.Radius Rv=1.0 "Radius of the cavity cross-sectional area"; + parameter Units.SI.Length L1=12.5 + "Length of drowned pipes in liquid (pipes 1)"; + parameter Units.SI.Length L2=12.5 "Length of Pipe 2 (in steam)"; + parameter Units.SI.Length L3=25 "Length of Pipe 3 (in steam)"; + parameter Units.SI.Length Lc=2.5 + "Support plate spacing in cooling zone(chicanes)"; + parameter Units.SI.Diameter Dc=0.016 "Internal diameter of the cooling pipes"; + parameter Units.SI.Thickness ec=2.e-3 "Thickness of the cooling pipes"; + parameter Units.SI.Diameter DIc=1.390 "Internal calendre diameter"; + parameter Units.SI.Length PasL=0.03 + "Longitudianl step or Length bottom pipes triangular step"; + parameter Units.SI.Length PasT=0.03 "Transverse step or pipes step"; + //parameter Modelica.SIunits.Angle Angle = 60 "Average bend angle (deg)"; + parameter Integer Ns=10 "Number of segments for one tube pass (half U pipe)"; + parameter Integer ntubes1=500 "Numbers of drowned pipes in liquid for pipes 1"; + parameter Integer ntubes2=500 "Numbers of the pipes immersed in steam = NbTub2, for pipes 2"; + parameter Integer ntubes3=500 "Numbers of the pipes immersed in steam, for pipe 3"; + parameter Integer ntubesV=15 "Numbers of pipes in a vertical row (tube bank)"; + parameter Units.SI.SpecificHeatCapacity cp=460 + "Specific heat capacity of the metal of the cooling pipes"; + parameter Units.SI.Density rho=7900 + "Density of the metal of the cooling pipes"; + parameter Units.SI.ThermalConductivity lambda=26 + "Wall thermal conductivity of the cooling pipes"; + //parameter Modelica.SIunits.CoefficientOfHeatTransfer hcond=25000 "Heat transfer coefficient between the vapor and the cooling pipes"; + parameter Real DpfCorr=1.00 "Corrective terme for friction pressure loss (dpf) in node i"; + parameter Real COP0v=1.0 "Corrective terme for Heat exchange coefficient or Fouling coefficient steam side"; + parameter Real COP0l=1 "Corrective terme for Heat exchange coefficient or Fouling coefficient liquid side"; + parameter Boolean inertia=true "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=true "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true "true: dynamic mass balance equation - false: static mass balance equation (active if the fluid is compressible and if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=Medium_Cooling.isCompressible and dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true "true: start from steady state - false: start from (Vf0, P0c, T0 or h0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.66 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0c=1.e5 + "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Units.SI.Temperature T0[2*Ns]=fill(290, 2*Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state and option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[2*Ns]=fill(1e5, 2*Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state and not option_temperature)); + parameter Boolean option_temperature=true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + Volumes.TwoPhaseCavity WaterHeating( + redeclare package Medium = Medium, + Vf0=Vf0, + P0=P0c, + Ns=Ns, + L2=L2, + NbTub1=ntubes1, + NbTubV=ntubesV, + DIc=DIc, + R=Rv, + Dext=Dc + 2*ec, + COPv=COP0v, + COPl=COP0l, + Lc=Lc, + PasL=PasL, + PasT=PasT, + L1=L1, + L3=L3, + NbTub2=ntubes2, + NbTub3=ntubes3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) + annotation ( Placement(transformation(extent={{-100, + -100},{100,100}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3( + redeclare package Medium = Medium_Cooling, + D=Dc, + Ns=Ns*2, + dpfCorr=DpfCorr, + L=L3, + ntubes=ntubes3, + Q(start=fill(300, Ns*2 + 1)), + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + h0=h0, + T0=T0, + option_temperature=option_temperature, + P0=P0c) + annotation (Placement(transformation(extent={{-35,-34},{60,0}}, rotation=0))); + Interfaces.Connectors.FluidInlet C1vap(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement( + transformation(extent={{-10,90},{10,110}}, rotation=0))); + Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet" + annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation ( + Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "Cooling water outlet" annotation ( + Placement(transformation(extent={{-110,34},{-90,54}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal sortieReelle + annotation (Placement(transformation(extent={{92,-86},{112,-66}}, rotation= + 0))); + + Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) "Extra water inlet" annotation ( + Placement(transformation(extent={{-74,82},{-54,102}}, rotation=0))); + Thermal.HeatTransfer.HeatExchangerWall Wall_3( + D=Dc, + e=ec, + lambda=lambda, + cpw=cp, + rhow=rho, + Ns=Ns*2, + L=L3, + ntubes=ntubes3, + steady_state=steady_state, + dynamic_energy_balance=dynamic_energy_balance) + annotation (Placement(transformation(extent={{-34,-24},{60,24}}, rotation=0))); + + Volumes.VolumeD volumeD( + redeclare package Medium = Medium_Cooling, + h0=790e3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + diffusion=diffusion, + dynamic_mass_balance=dynamic_mass_balance, + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{-72,-54},{-54,-36}}, + rotation=0))); + Volumes.VolumeC volumeC( + redeclare package Medium = Medium_Cooling, + h0=890e3, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + steady_state=steady_state, + diffusion=diffusion, + continuous_flow_reversal=continuous_flow_reversal) annotation (Placement(transformation(extent={{-52,35}, + {-70,53}}, rotation=0))); equation if (cardinality(C1) == 1) then C1.Q = 0; @@ -87,35 +159,202 @@ equation C1.h_vol_1 = 1.e5; C1.diff_res_1 = 0; C1.diff_on_1 = false; - C1.ftype = ftype; - C1.Xco2 = 0; - C1.Xh2o = 0; - C1.Xo2 = 0; - C1.Xso2 = 0; + C1.Xi = Medium.X_default[1:Medium.nXi]; + C1.SubC = Medium.C_default; end if; - connect(C1vap, WaterHeating.Cv) annotation( - Line(points = {{0, 100}, {0, 73.3333}, {1.11111, 73.3333}})); - connect(WaterHeating.Cl, C2ex) annotation( - Line(points = {{1.11111, -73.3333}, {1.11111, -94}, {-2, -94}, {-2, -98}, {0, -98}, {0, -100}}, color = {0, 0, 255})); - connect(C1, WaterHeating.Ce) annotation( - Line(points = {{-64, 92}, {-60, 92}, {-60, 73.3333}, {-38.8889, 73.3333}})); - connect(WaterHeating.yLevel, sortieReelle) annotation( - Line(points = {{98.8889, -32.6667}, {94, -32.6667}, {94, -76}, {102, -76}})); - connect(WaterHeating.Cth3, Wall_3.WT2) annotation( - Line(points = {{0.555556, 2}, {0.555556, 8.33335}, {13, 8.33335}, {13, 4.8}}, color = {191, 95, 0})); - connect(Wall_3.WT1, pipe_3.CTh) annotation( - Line(points = {{13, -4.8}, {13, -10.4}, {12.5, -10.4}, {12.5, -11.9}}, color = {191, 95, 0})); - connect(Ce1, volumeD.Ce) annotation( - Line(points = {{-100, -45}, {-72, -45}}, color = {0, 0, 0})); - connect(volumeD.Cs1, pipe_3.C1) annotation( - Line(points = {{-63, -36}, {-64, -36}, {-64, -17}, {-35, -17}}, color = {0, 0, 0})); - connect(pipe_3.C2, volumeC.Ce1) annotation( - Line(points = {{60, -17}, {78, -17}, {78, 44}, {-52, 44}}, color = {0, 0, 0})); - connect(volumeC.Cs, Ce2) annotation( - Line(points = {{-70, 44}, {-100, 44}}, color = {0, 0, 0})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Text(extent = {{-116, -56}, {-90, -72}}, lineColor = {0, 0, 255}, textString = "Inlet"), Text(extent = {{-110, 67}, {-86, 53}}, lineColor = {0, 0, 255}, textString = "Outlet"), Text(extent = {{16, 102}, {44, 87}}, lineColor = {0, 0, 255}, textString = "Steam")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, initialScale = 0.1), graphics = {Rectangle(extent = {{-100, 0}, {-74, -90}}, lineColor = {0, 0, 255}, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{60, -8}, {0, -14}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, 14}, {-74, 8}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{60, 14}, {16, 8}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Line(points = {{60, -90}, {-100, -90}}, color = {0, 0, 255}, thickness = 0.5), Line(points = {{60, 90}, {-100, 90}}, color = {0, 0, 255}, thickness = 0.5), Line(points = {{-100, 0}, {76, 0}}, color = {0, 0, 255}, thickness = 0.5), Rectangle(extent = {{-74, -52}, {60, -90}}, lineColor = {0, 0, 255}, lineThickness = 0, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 90}, {-74, 0}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, -8}, {-74, -14}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, -30}, {-74, -36}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, -54}, {-74, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, 36}, {-74, 30}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{16, 60}, {-74, 54}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{60, 90}, {70, 80}, {84, 60}, {94, 40}, {100, 20}, {102, 0}, {100, -20}, {94, -40}, {84, -60}, {70, -80}, {60, -90}, {60, 90}}, lineColor = {0, 0, 255}, lineThickness = 0, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid)), Rectangle(extent = {{66, 14}, {60, -14}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{70, 36}, {16, 30}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{78, 60}, {16, 54}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{74, -30}, {16, -36}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Polygon(points = {{60, -52}, {88, -52}, {74, -74}, {64, -86}, {59, -90}, {60, -52}}, lineColor = {255, 170, 170}, lineThickness = 0, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Line(points = {{-74, -76}, {72, -76}}, color = {255, 255, 255}, pattern = LinePattern.Dash, thickness = 0.5), Rectangle(extent = {{74, 36}, {68, -36}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{82, 60}, {76, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{76, -54}, {16, -60}}, lineColor = {0, 0, 255}, fillColor = {170, 213, 255}, fillPattern = FillPattern.Solid), Line(points = {{-74, -68}, {78, -68}}, color = {255, 255, 255}, pattern = LinePattern.Dash, thickness = 0.5), Line(points = {{-74, -58}, {84, -58}}, color = {255, 255, 255}, pattern = LinePattern.Dash, thickness = 0.5), Text(extent = {{-132, 72}, {-106, 58}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water outlet"), Text(extent = {{-132, -18}, {-104, -32}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water inlet")}), + + connect(C1vap, WaterHeating.Cv) + annotation (Line(points={{0,100},{0,73.3333},{ + 1.11111,73.3333}})); + connect(WaterHeating.Cl, C2ex) + annotation (Line(points={{1.11111,-73.3333},{ + 1.11111,-94},{-2,-94},{-2,-98},{0,-98},{0,-100}}, color={0,0,255})); + connect(C1, WaterHeating.Ce) + annotation (Line(points={{-64,92},{-60,92},{-60,73.3333},{-38.8889,73.3333}})); + connect(WaterHeating.yLevel, sortieReelle) + annotation (Line(points={{98.8889,-32.6667},{94,-32.6667},{94,-76},{102,-76}})); + connect(WaterHeating.Cth3, Wall_3.WT2) + annotation (Line(points={{0.555556,2},{0.555556, + 8.33335},{13,8.33335},{13,4.8}}, color={191,95,0})); + connect(Wall_3.WT1, pipe_3.CTh) annotation (Line(points={{13,-4.8},{13,-10.4}, + {12.5,-10.4},{12.5,-11.9}}, color={191,95,0})); + connect(Ce1, volumeD.Ce) + annotation (Line(points={{-100,-45},{-72,-45}}, color={0,0,0})); + connect(volumeD.Cs1, pipe_3.C1) annotation (Line(points={{-63,-36},{-64,-36},{ + -64,-17},{-35,-17}}, color={0,0,0})); + connect(pipe_3.C2, volumeC.Ce1) annotation (Line(points={{60,-17},{78,-17},{78, + 44},{-52,44}}, color={0,0,0})); + connect(volumeC.Cs, Ce2) + annotation (Line(points={{-70,44},{-100,44}}, color={0,0,0})); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={ + Text( + extent={{-116,-56},{-90,-72}}, + lineColor={0,0,255}, + textString="Inlet"), + Text( + extent={{-110,67},{-86,53}}, + lineColor={0,0,255}, + textString="Outlet"), + Text( + extent={{16,102},{44,87}}, + lineColor={0,0,255}, + textString= + "Steam")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.1), graphics={ + Rectangle( + extent={{-100,0},{-74,-90}}, + lineColor={0,0,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{60,-8},{0,-14}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,14},{-74,8}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{60,14},{16,8}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Line( + points={{60,-90},{-100,-90}}, + color={0,0,255}, + thickness=0.5), + Line( + points={{60,90},{-100,90}}, + color={0,0,255}, + thickness=0.5), + Line( + points={{-100,0},{76,0}}, + color={0,0,255}, + thickness=0.5), + Rectangle( + extent={{-74,-52},{60,-90}}, + lineColor={0,0,255}, + lineThickness=0, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,90},{-74,0}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,-8},{-74,-14}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,-30},{-74,-36}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,-54},{-74,-60}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,36},{-74,30}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{16,60},{-74,54}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{60,90},{70,80},{84,60},{94,40},{100,20},{102,0},{100,-20},{ + 94,-40},{84,-60},{70,-80},{60,-90},{60,90}}, + lineColor={0,0,255}, + lineThickness=0, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid)), + Rectangle( + extent={{66,14},{60,-14}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{70,36},{16,30}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{78,60},{16,54}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{74,-30},{16,-36}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{60,-52},{88,-52},{74,-74},{64,-86},{59,-90},{60,-52}}, + lineColor={255,170,170}, + lineThickness=0, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Line( + points={{-74,-76},{72,-76}}, + color={255,255,255}, + pattern=LinePattern.Dash, + thickness=0.5), + Rectangle( + extent={{74,36},{68,-36}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{82,60},{76,-60}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{76,-54},{16,-60}}, + lineColor={0,0,255}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-74,-68},{78,-68}}, + color={255,255,255}, + pattern=LinePattern.Dash, + thickness=0.5), + Line( + points={{-74,-58},{84,-58}}, + color={255,255,255}, + pattern=LinePattern.Dash, + thickness=0.5), + Text( + extent={{-132,72},{-106,58}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water outlet"), + Text( + extent={{-132,-18},{-104,-32}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water inlet")}), Documentation(revisions = " Author @@ -125,4 +364,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end DynamicWaterHeaterOnePipe; \ No newline at end of file +end DynamicWaterHeaterOnePipe; diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo index 1e79742e..6b1c0c7d 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo @@ -1,74 +1,170 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicWaterSteamMultiFluidsHeatExchanger "Dynamic water/steam heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Length L = 1 "Exchanger length"; - parameter Units.SI.Position z1 = 0 "Exchanger inlet altitude"; - parameter Units.SI.Position z2 = 0 "Exchanger outlet altitude"; - parameter Integer Ns = 1 "Numver of segments"; - parameter Units.SI.Diameter Dint = 0.1 "Pipe internal diameter"; - parameter Units.SI.Diameter Dext = 0.11 "Pipe external diameter"; - parameter Integer Ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fluid initial pressure (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.Temperature T0[Ns] = fill(290, Ns) "Initial fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy h0[Ns] = fill(1e5, Ns) "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean inertia = true "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Fluid.HeatExchangers.DynamicOnePhaseFlowPipe ExchangerMultiFluids(Ns = Ns, L = L, ntubes = Ntubes, D = Dext, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, P0 = P0, T0 = T0, h0 = h0) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 10}}, rotation = 0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall(L = L, D = Dint, Ns = Ns, ntubes = Ntubes, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, T0 = T0[1]) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe(L = L, D = Dint, ntubes = Ntubes, Ns = Ns, z1 = z1, z2 = z2, T0 = T0, h0 = h0, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, diffusion = diffusion, continuous_flow_reversal = continuous_flow_reversal) annotation( - Placement(transformation(extent = {{-10, -30}, {10, -10}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cfg1 annotation( - Placement(transformation(extent = {{-10, 40}, {10, 60}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cfg2 annotation( - Placement(transformation(extent = {{-10, -60}, {10, -40}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cws1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cws2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); + + replaceable package Medium_1 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the one-phase side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_2 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Length L=1 "Exchanger length"; + parameter Units.SI.Position z1=0 "Exchanger inlet altitude"; + parameter Units.SI.Position z2=0 "Exchanger outlet altitude"; + parameter Integer Ns=1 "Numver of segments"; + parameter Units.SI.Diameter Dint=0.1 "Pipe internal diameter"; + parameter Units.SI.Diameter Dext=0.11 "Pipe external diameter"; + parameter Integer Ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.AbsolutePressure P0=1.e5 + "Fluid initial pressure (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.Temperature T0[Ns]=fill(290, Ns) + "Initial fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy h0[Ns]=fill(1e5, Ns) + "Initial fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean inertia=true + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + Fluid.HeatExchangers.DynamicOnePhaseFlowPipe ExchangerMultiFluids( + redeclare package Medium = Medium_1, + Ns=Ns, + L=L, + ntubes=Ntubes, + D=Dext, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + P0=P0, + T0=T0, + h0=h0) annotation (Placement(transformation(extent={{-10,30},{10,10}}, + rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall ExchangerWall( + L=L, + D=Dint, + Ns=Ns, + ntubes=Ntubes, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + T0=T0[1]) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0))); + Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TwoPhaseFlowPipe( + redeclare package Medium = Medium_2, + L=L, + D=Dint, + ntubes=Ntubes, + Ns=Ns, + z1=z1, + z2=z2, + T0=T0, + h0=h0, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + diffusion=diffusion, + continuous_flow_reversal=continuous_flow_reversal) + annotation (Placement(transformation(extent={{-10,-30},{10,-10}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_1) annotation (Placement(transformation( + extent={{-10,40},{10,60}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_1) annotation (Placement(transformation( + extent={{-10,-60},{10,-40}}, rotation=0))); + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_2) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_2) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); equation - connect(Cws2, TwoPhaseFlowPipe.C2) annotation( - Line(points = {{100, 0}, {40, 0}, {40, -20}, {10, -20}}, color = {255, 0, 0}, thickness = 0.5)); - connect(Cws1, TwoPhaseFlowPipe.C1) annotation( - Line(points = {{-100, 0}, {-20, 0}, {-20, -20}, {-10, -20}}, thickness = 0.5)); - connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh) annotation( - Line(points = {{0, -2}, {0, -17}}, color = {191, 95, 0})); - connect(ExchangerMultiFluids.CTh, ExchangerWall.WT2) annotation( - Line(points = {{0, 17}, {0, 2}}, color = {191, 95, 0})); - connect(ExchangerMultiFluids.C2, Cfg2) annotation( - Line(points = {{10, 20}, {32, 20}, {32, -50}, {0, -50}}, color = {0, 0, 0}, thickness = 1)); - connect(ExchangerMultiFluids.C1, Cfg1) annotation( - Line(points = {{-10, 20}, {-26, 20}, {-26, 50}, {0, 50}}, color = {0, 0, 0}, thickness = 1)); - annotation( - Icon(graphics = {Rectangle(extent = {{-100, 50}, {100, -50}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Backward), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), fillColor = {255, 127, 0}), Rectangle(extent = {{-100, 30}, {100, -30}}, lineColor = {0, 0, 0}, fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {100, -20}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.Solid, if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder else FillPattern.Solid), fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static)), Rectangle(extent = {{-100, 0}, {100, -20}}, lineColor = {0, 0, 255}, lineThickness = 0, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Line(points = {{-60, 50}, {-60, -50}}), Line(points = {{-20, 50}, {-20, -50}}), Line(points = {{20, 50}, {20, -50}}), Line(points = {{60, 50}, {60, -50}})}), + connect(Cws2, TwoPhaseFlowPipe.C2) + annotation (Line( + points={{100,0},{40,0},{40,-20},{10,-20}}, + color={255,0,0}, + thickness=0.5)); + connect(Cws1, TwoPhaseFlowPipe.C1) + annotation (Line(points={{-100,0},{-20,0},{-20,-20},{-10,-20}}, thickness= + 0.5)); + connect(ExchangerWall.WT1, TwoPhaseFlowPipe.CTh) + annotation (Line(points={{0,-2},{0,-17}}, color={191,95,0})); + connect(ExchangerMultiFluids.CTh, ExchangerWall.WT2) + annotation (Line(points={{0,17},{0,2}}, color={191,95,0})); + connect(ExchangerMultiFluids.C2, Cfg2) annotation (Line( + points={{10,20},{32,20},{32,-50},{0,-50}}, + color={0,0,0}, + thickness=1)); + connect(ExchangerMultiFluids.C1, Cfg1) annotation (Line( + points={{-10,20},{-26,20},{-26,50},{0,50}}, + color={0,0,0}, + thickness=1)); + annotation ( Icon(graphics={ + Rectangle( + extent={{-100,50},{100,-50}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Backward), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + fillColor={255,127,0}), + Rectangle( + extent={{-100,30},{100,-30}}, + lineColor={0,0,0}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{100,-20}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.Solid, + if dynamic_mass_balance and dynamic_energy_balance then FillPattern.HorizontalCylinder + else FillPattern.Solid), + fillColor=DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static)), + Rectangle( + extent={{-100,0},{100,-20}}, + lineColor={0,0,255}, + lineThickness=0, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Line(points={{-60,50},{-60,-50}}), + Line(points={{-20,50},{-20,-50}}), + Line(points={{20,50},{20,-50}}), + Line(points={{60,50},{60,-50}})}), Documentation(revisions = " Author @@ -78,6 +174,42 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 "), - Diagram(graphics = {Text(extent = {{-14, 76}, {14, 60}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid2 inlet"), Text(extent = {{-16, -56}, {18, -78}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid2 outlet"), Text(extent = {{-146, 40}, {-102, 8}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water/steam inlet"), Text(extent = {{-146, 0}, {-104, -34}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid1 inlet -Two-phase flow"), Text(extent = {{104, 26}, {152, 16}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water/steam outlet"), Text(extent = {{106, -4}, {140, -32}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Fluid1 outlet")})); -end DynamicWaterSteamMultiFluidsHeatExchanger; \ No newline at end of file + Diagram(graphics={ + Text( + extent={{-14,76},{14,60}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid2 inlet"), + Text( + extent={{-16,-56},{18,-78}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid2 outlet"), + Text( + extent={{-146,40},{-102,8}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water/steam inlet"), + Text( + extent={{-146,0},{-104,-34}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid1 inlet +Two-phase flow"), + Text( + extent={{104,26},{152,16}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water/steam outlet"), + Text( + extent={{106,-4},{140,-32}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Fluid1 outlet")})); +end DynamicWaterSteamMultiFluidsHeatExchanger; From fd9a210d7996b668fe39fc20ea4912020a75d137 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:57:37 +0200 Subject: [PATCH 191/213] #125 port dynamic Fluid heat exchanger models medium support onto develop --- .../DynamicPlateHeatExchanger.mo | 621 ++++++++++++------ .../HeatExchangers/SimpleDynamicCondenser.mo | 597 ++++++++++++----- .../SimpleEvaporatorWaterSteamFlueGases.mo | 297 ++++++--- 3 files changed, 1052 insertions(+), 463 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo index 19430338..0ba50c23 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo @@ -1,103 +1,161 @@ within ThermoSysPro.Fluid.HeatExchangers; - model DynamicPlateHeatExchanger "Dynamic plate heat exchanger" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.ThermalConductivity lambdam = 15.0 "Metal thermal conductivity"; - parameter Units.SI.CoefficientOfHeatTransfer p_hc = 6000 "Heat transfer coefficient for the hot side if not computed by the correlations"; - parameter Units.SI.CoefficientOfHeatTransfer p_hf = 3000 "Heat transfer coefficient for the cold side if not computed by the correlations"; - parameter Real p_Kc = 100 "Pressure loss coefficient for the hot side if not computed by the correlations"; - parameter Real p_Kf = 100 "Pressure loss coefficient for the cold side if not computed by the correlations"; - parameter Units.SI.Volume Vc = 1 "Hot side volume"; - parameter Units.SI.Volume Vf = 1 "Cold side volume"; - parameter Units.SI.Thickness emetal = 0.0006 "Wall thickness"; - parameter Units.SI.Area Sp = 2 "Plate area"; - parameter Real nbp = 499 "Number of plates"; - parameter Real c1 = 1.12647 "Correction coefficient"; - parameter Integer Ns = 10 "Number of segments"; - parameter Integer heat_exchange_correlation = 1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations"; - parameter Integer pressure_loss_correlation = 1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations"; - parameter Units.SI.MassFlowRate gamma_diff_c = 1e-4 "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.MassFlowRate gamma_diff_f = 1e-4 "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.AbsolutePressure Pc0 = 1.e5 "Hot fluid initial pressure (active if steady_state = false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Units.SI.AbsolutePressure Pf0 = 1.e5 "Cold fluid initial pressure (active if steady_state = false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Units.SI.Temperature Tc0[Ns] = fill(290, Ns) "Initial hot fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.Temperature Tf0[Ns] = fill(290, Ns) "Initial cold fluid temperature (active if steady_state = false and option_temperature=true)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and option_temperature)); - parameter Units.SI.SpecificEnthalpy hc0[Ns] = fill(1e5, Ns) "Initial hot fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Units.SI.SpecificEnthalpy hf0[Ns] = fill(1e5, Ns) "Initial cold fluid specific enthalpy (active if steady_state = false and option_temperature=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state and not option_temperature)); - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean option_temperature = true "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter Units.SI.Density p_rhoc = 0 "If > 0, fixed fluid density for the hot fluid" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter Units.SI.Density p_rhof = 0 "If > 0, fixed fluid density for the cold fluid" annotation( - Evaluate = true, - Dialog(tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_c = IF97Region.All_regions "Hot fluid IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype_c == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - parameter IF97Region region_f = IF97Region.All_regions "Cold fluid IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype_f == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure Pc[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Hot fluid pressure in node i"; - Units.SI.AbsolutePressure Pf[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e5, N + 1)) "Cold fluid pressure in node i"; - Units.SI.MassFlowRate Qc[N](start = fill(10, N), nominal = fill(10, N)) "Hot fluid mass flow rate in node i"; - Units.SI.MassFlowRate Qf[N](start = fill(10, N), nominal = fill(10, N)) "Cold fluid mass flow rate in node i"; - Units.SI.SpecificEnthalpy hc[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e6, N + 1)) "Hot fluid specific enthalpy in node i"; - Units.SI.SpecificEnthalpy hf[N + 1](start = fill(1.e5, N + 1), nominal = fill(1.e6, N + 1)) "Cold fluid specific enthalpy in node i"; - Units.SI.SpecificEnthalpy hbc[N] "Hot fluid specific enthalpy at the boundary of node i"; - Units.SI.SpecificEnthalpy hbf[N] "Cold fluid specific enthalpy at the boundary of node i"; - Units.SI.Density rhoc1[N - 1](start = fill(998, N - 1), nominal = fill(1, N - 1)) "Hot fluid density in thermal node i"; - Units.SI.Density rhof1[N - 1](start = fill(998, N - 1), nominal = fill(1, N - 1)) "Cold fluid density in thermal node i"; - Units.SI.Density rhoc2[N](start = fill(998, N), nominal = fill(1, N)) "Hot fluid density in hydraulic node i"; - Units.SI.Density rhof2[N](start = fill(998, N), nominal = fill(1, N)) "Cold fluid density in hydraulic node i"; - Units.SI.MassFlowRate BQc[N - 1] "Right hand side of the mass balance equation for thermal node i for the hot fluid"; - Units.SI.MassFlowRate BQf[N - 1] "Right hand side of the mass balance equation for thermal node i for the cold fluid"; - Units.SI.Power BHc[N - 1] "Right hand side of the energy balance equation for thermal node i for the cold fluid"; - Units.SI.Power BHf[N - 1] "Right hand side of the energy balance equation for thermal node i for the hot fluid"; - Units.SI.CoefficientOfHeatTransfer hconv[N - 1] "Global heat transfer coefficient in thermal node i"; - Units.SI.CoefficientOfHeatTransfer hconv_c[N - 1](start = fill(2000, N - 1), nominal = fill(200, N - 1)) "Hot fluid heat exchange coefficient in node i"; - Units.SI.CoefficientOfHeatTransfer hconv_f[N - 1](start = fill(2000, N - 1), nominal = fill(200, N - 1)) "Cold fluid heat exchange coefficient in node i"; - Units.SI.ThermalConductivity kc1[N - 1](start = fill(0.6, N - 1), nominal = fill(0.6, N - 1)) "Hot fluid thermal conductivity in thermal node i"; - Units.SI.ThermalConductivity kf1[N - 1](start = fill(0.6, N - 1), nominal = fill(0.6, N - 1)) "Cold fluid thermal conductivity in thermal node i"; - Units.SI.ThermalConductivity kc2[N](start = fill(0.6, N), nominal = fill(0.6, N)) "Hot fluid thermal conductivity in hydraulic node i"; - Units.SI.ThermalConductivity kf2[N](start = fill(0.6, N), nominal = fill(0.6, N)) "Cold fluid thermal conductivity in hydraulic node i"; - Units.SI.DynamicViscosity muc1[N - 1](start = fill(2.e-4, N - 1), nominal = fill(2.e-4, N - 1)) "Hot fluid dynamic viscosity in thermal node i"; - Units.SI.DynamicViscosity muf1[N - 1](start = fill(2.e-4, N - 1), nominal = fill(2.e-4, N - 1)) "Cold fluid dynamic viscosity in thermal node i"; - Units.SI.DynamicViscosity muc2[N](start = fill(2.e-4, N), nominal = fill(2.e-4, N)) "Hot fluid dynamic viscosity in hydraulic node i"; - Units.SI.DynamicViscosity muf2[N](start = fill(2.e-4, N), nominal = fill(2.e-4, N)) "Cold fluid dynamic viscosity in hydraulic node i"; - Units.SI.SpecificHeatCapacity cpc1[N - 1](start = fill(4000, N - 1), nominal = fill(4000, N - 1)) "Hot fluid specific heat capacity in thermal node i"; - Units.SI.SpecificHeatCapacity cpf1[N - 1](start = fill(4000, N - 1), nominal = fill(4000, N - 1)) "Cold fluid specific heat capacity in thermal node i"; - Units.SI.SpecificHeatCapacity cpc2[N](start = fill(4000, N), nominal = fill(4000, N)) "Hot fluid specific heat capacity in hydraulic node i"; - Units.SI.SpecificHeatCapacity cpf2[N](start = fill(4000, N), nominal = fill(4000, N)) "Cold fluid specific heat capacity in hydraulic node i"; - Units.SI.ThermalConductivity lambdac1[N - 1](start = fill(0.602698, N - 1)) "Hot fluid thermal conductivity in thermal node i"; - Units.SI.ThermalConductivity lambdaf1[N - 1](start = fill(0.597928, N - 1)) "Cold fluid thermal conductivity in thermal node i"; + + replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.ThermalConductivity lambdam=15.0 + "Metal thermal conductivity"; + parameter Units.SI.CoefficientOfHeatTransfer p_hc=6000 + "Heat transfer coefficient for the hot side if not computed by the correlations"; + parameter Units.SI.CoefficientOfHeatTransfer p_hf=3000 + "Heat transfer coefficient for the cold side if not computed by the correlations"; + parameter Real p_Kc=100 "Pressure loss coefficient for the hot side if not computed by the correlations"; + parameter Real p_Kf=100 "Pressure loss coefficient for the cold side if not computed by the correlations"; + parameter Units.SI.Volume Vc=1 "Hot side volume"; + parameter Units.SI.Volume Vf=1 "Cold side volume"; + parameter Units.SI.Thickness emetal=0.0006 "Wall thickness"; + parameter Units.SI.Area Sp=2 "Plate area"; + parameter Real nbp=499 "Number of plates"; + parameter Real c1=1.12647 "Correction coefficient"; + parameter Integer Ns=10 "Number of segments"; + parameter Integer heat_exchange_correlation=1 "Correlation for the computation of the heat exchange coefficient - 0: no correlation. 1: SRI correlations"; + parameter Integer pressure_loss_correlation=1 "Correlation for the computation of the pressure loss coefficient - 0: no correlation. 1: SRI correlations"; + parameter Units.SI.MassFlowRate gamma_diff_c=1e-4 + "Diffusion conductance for the hot fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.MassFlowRate gamma_diff_f=1e-4 + "Diffusion conductance for the cold fluid (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.AbsolutePressure Pc0=1.e5 + "Hot fluid initial pressure (active if steady_state = false)" + annotation (Evaluate=true, Dialog(enable=not steady_state)); + parameter Units.SI.AbsolutePressure Pf0=1.e5 + "Cold fluid initial pressure (active if steady_state = false)" + annotation (Evaluate=true, Dialog(enable=not steady_state)); + parameter Units.SI.Temperature Tc0[Ns]=fill(290, Ns) + "Initial hot fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.Temperature Tf0[Ns]=fill(290, Ns) + "Initial cold fluid temperature (active if steady_state = false and option_temperature=true)" + annotation (Evaluate=true, Dialog(enable=not steady_state and + option_temperature)); + parameter Units.SI.SpecificEnthalpy hc0[Ns]=fill(1e5, Ns) + "Initial hot fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Units.SI.SpecificEnthalpy hf0[Ns]=fill(1e5, Ns) + "Initial cold fluid specific enthalpy (active if steady_state = false and option_temperature=false)" + annotation (Evaluate=true, Dialog(enable=not steady_state and not + option_temperature)); + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean option_temperature=true + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + parameter Units.SI.Density p_rhoc=0 + "If > 0, fixed fluid density for the hot fluid" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + parameter Units.SI.Density p_rhof=0 + "If > 0, fixed fluid density for the cold fluid" + annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Integer N=Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; + parameter Units.SI.Area Ac=1 + "Internal cross sectional pipe area for the hot fluid"; + parameter Units.SI.Area Af=1 + "Internal cross sectional pipe area for the cold fluid"; + parameter Units.SI.PathLength dx2_c=Vc/N/Ac + "Length of a hydraulic node for the hot fluid"; + parameter Units.SI.PathLength dx2_f=Vf/N/Af + "Length of a hydraulic node for the cold fluid"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Units.SI.AbsolutePressure Pc[N + 1](start=fill(1.e5, N + 1), nominal=fill( + 1.e5, N + 1)) "Hot fluid pressure in node i"; + Units.SI.AbsolutePressure Pf[N + 1](start=fill(1.e5, N + 1), nominal=fill( + 1.e5, N + 1)) "Cold fluid pressure in node i"; + Units.SI.MassFlowRate Qc[N](start=fill(10, N), nominal=fill(10, N)) + "Hot fluid mass flow rate in node i"; + Units.SI.MassFlowRate Qf[N](start=fill(10, N), nominal=fill(10, N)) + "Cold fluid mass flow rate in node i"; + Units.SI.SpecificEnthalpy hc[N + 1](start=fill(1.e5, N + 1), nominal=fill( + 1.e6, N + 1)) "Hot fluid specific enthalpy in node i"; + Units.SI.SpecificEnthalpy hf[N + 1](start=fill(1.e5, N + 1), nominal=fill( + 1.e6, N + 1)) "Cold fluid specific enthalpy in node i"; + Units.SI.SpecificEnthalpy hbc[N] + "Hot fluid specific enthalpy at the boundary of node i"; + Units.SI.SpecificEnthalpy hbf[N] + "Cold fluid specific enthalpy at the boundary of node i"; + Units.SI.Density rhoc1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1)) + "Hot fluid density in thermal node i"; + Units.SI.Density rhof1[N - 1](start=fill(998, N - 1), nominal=fill(1, N - 1)) + "Cold fluid density in thermal node i"; + Units.SI.Density rhoc2[N](start=fill(998, N), nominal=fill(1, N)) + "Hot fluid density in hydraulic node i"; + Units.SI.Density rhof2[N](start=fill(998, N), nominal=fill(1, N)) + "Cold fluid density in hydraulic node i"; + Units.SI.MassFlowRate BQc[N - 1] + "Right hand side of the mass balance equation for thermal node i for the hot fluid"; + Units.SI.MassFlowRate BQf[N - 1] + "Right hand side of the mass balance equation for thermal node i for the cold fluid"; + Units.SI.Power BHc[N - 1] + "Right hand side of the energy balance equation for thermal node i for the cold fluid"; + Units.SI.Power BHf[N - 1] + "Right hand side of the energy balance equation for thermal node i for the hot fluid"; + Units.SI.CoefficientOfHeatTransfer hconv[N - 1] + "Global heat transfer coefficient in thermal node i"; + Units.SI.CoefficientOfHeatTransfer hconv_c[N - 1](start=fill(2000, N - 1), + nominal=fill(200, N - 1)) "Hot fluid heat exchange coefficient in node i"; + Units.SI.CoefficientOfHeatTransfer hconv_f[N - 1](start=fill(2000, N - 1), + nominal=fill(200, N - 1)) + "Cold fluid heat exchange coefficient in node i"; + Units.SI.ThermalConductivity kc1[N - 1](start=fill(0.6, N - 1), nominal=fill( + 0.6, N - 1)) "Hot fluid thermal conductivity in thermal node i"; + Units.SI.ThermalConductivity kf1[N - 1](start=fill(0.6, N - 1), nominal=fill( + 0.6, N - 1)) "Cold fluid thermal conductivity in thermal node i"; + Units.SI.ThermalConductivity kc2[N](start=fill(0.6, N), nominal=fill(0.6, N)) + "Hot fluid thermal conductivity in hydraulic node i"; + Units.SI.ThermalConductivity kf2[N](start=fill(0.6, N), nominal=fill(0.6, N)) + "Cold fluid thermal conductivity in hydraulic node i"; + Units.SI.DynamicViscosity muc1[N - 1](start=fill(2.e-4, N - 1), nominal=fill( + 2.e-4, N - 1)) "Hot fluid dynamic viscosity in thermal node i"; + Units.SI.DynamicViscosity muf1[N - 1](start=fill(2.e-4, N - 1), nominal=fill( + 2.e-4, N - 1)) "Cold fluid dynamic viscosity in thermal node i"; + Units.SI.DynamicViscosity muc2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N)) + "Hot fluid dynamic viscosity in hydraulic node i"; + Units.SI.DynamicViscosity muf2[N](start=fill(2.e-4, N), nominal=fill(2.e-4, N)) + "Cold fluid dynamic viscosity in hydraulic node i"; + Units.SI.SpecificHeatCapacity cpc1[N - 1](start=fill(4000, N - 1), nominal= + fill(4000, N - 1)) "Hot fluid specific heat capacity in thermal node i"; + Units.SI.SpecificHeatCapacity cpf1[N - 1](start=fill(4000, N - 1), nominal= + fill(4000, N - 1)) + "Cold fluid specific heat capacity in thermal node i"; + Units.SI.SpecificHeatCapacity cpc2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Hot fluid specific heat capacity in hydraulic node i"; + Units.SI.SpecificHeatCapacity cpf2[N](start=fill(4000, N), nominal=fill(4000, + N)) "Cold fluid specific heat capacity in hydraulic node i"; + Units.SI.ThermalConductivity lambdac1[N - 1](start=fill(0.602698, N - 1)) + "Hot fluid thermal conductivity in thermal node i"; + Units.SI.ThermalConductivity lambdaf1[N - 1](start=fill(0.597928, N - 1)) + "Cold fluid thermal conductivity in thermal node i"; Units.SI.Temperature Tc1[N - 1] "Hot fluid temperature in thermal node i"; Units.SI.Temperature Tf1[N - 1] "Cold fluid temperature in thermal node i"; Units.SI.Temperature Tc2[N] "Hot fluid temperature in hydraulic node i"; Units.SI.Temperature Tf2[N] "Cold fluid temperature in hydraulic node i"; Units.SI.Area dS "Heat exchange surface"; - Units.SI.Power dW[N - 1] "Thermal power exchanged between the hot and cold sides in thermal node i"; + Units.SI.Power dW[N - 1] + "Thermal power exchanged between the hot and cold sides in thermal node i"; Real qmc1[N - 1]; Real qmf1[N - 1]; Real qmc2[N]; @@ -105,24 +163,24 @@ model DynamicPlateHeatExchanger "Dynamic plate heat exchanger" Real quc[N]; Real quf[N]; Real M; - ThermoSysPro.Units.SI.PressureDifference DPc[N] "Pressure loss of the hot fluid in hydraulic node i"; - ThermoSysPro.Units.SI.PressureDifference DPf[N] "Pressure loss of the cold fluid in hydraulic node i"; + ThermoSysPro.Units.SI.PressureDifference DPc[N] + "Pressure loss of the hot fluid in hydraulic node i"; + ThermoSysPro.Units.SI.PressureDifference DPf[N] + "Pressure loss of the cold fluid in hydraulic node i"; Units.SI.Temperature Tec "Fluid temperature at the hot inlet"; Units.SI.Temperature Tsc "Fluid temperature at the hot outlet"; Units.SI.Temperature Tef "Fluid temperature at the cold inlet"; Units.SI.Temperature Tsf "Fluid temperature at the cold outlet"; - FluidType ftype_c "Hot fluid type"; - FluidType ftype_f "Cold fluid type"; - Integer fluid_c = Integer(ftype_c) "Hot fluid number"; - Integer fluid_f = Integer(ftype_f) "Cold fluid number"; - ThermoSysPro.Units.SI.MassFraction Xco2_c "Hot fluid CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xco2_f "Cold fluid CO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o_c "Hot fluid H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xh2o_f "Cold fluid H2O mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2_c "Hot fluid O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xo2_f "Cold fluid O2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2_c "Hot fluid SO2 mass fraction"; - ThermoSysPro.Units.SI.MassFraction Xso2_f "Cold fluid SO2 mass fraction"; + Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid"; + Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid"; + Medium_c.ThermodynamicState state_c1[N - 1] "Hot fluid thermodynamic state in thermal node i"; + Medium_f.ThermodynamicState state_f1[N - 1] "Cold fluid thermodynamic state in thermal node i"; + Medium_c.ThermodynamicState state_c2[N] "Hot fluid thermodynamic state in hydraulic node i"; + Medium_f.ThermodynamicState state_f2[N] "Cold fluid thermodynamic state in hydraulic node i"; + Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet"; + Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet"; + Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet"; + Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet"; Real diff_res_c[N] "Diffusion resistance in hydraulic node i for the hot fluid"; Real diff_res_f[N] "Diffusion resistance in hydraulic node i for the cold fluid"; Real diff_res_t_c "Total diffusion resistance in the pipe for the hot fluid"; @@ -131,41 +189,44 @@ model DynamicPlateHeatExchanger "Dynamic plate heat exchanger" Real diff_res_e_f[N - 1] "Diffusion resistance at inlet of thermal node i for the cold fluid"; Real diff_res_s_c[N - 1] "Diffusion resistance at outlet of thermal node i for the hot fluid"; Real diff_res_s_f[N - 1] "Diffusion resistance at outlet of thermal node i for the cold fluid"; - Units.SI.MassFlowRate gamma_c[N] "Total diffusion conductance in hydraulic node i for the hot fluid"; - Units.SI.MassFlowRate gamma_f[N] "Total diffusion conductance in hydraulic node i for the cold fluid"; - Units.SI.MassFlowRate gamma_e_c[N - 1] "Diffusion conductance at inlet of thermal node i for the hot fluid"; - Units.SI.MassFlowRate gamma_e_f[N - 1] "Diffusion conductance at inlet of thermal node i for the cold fluid"; - Units.SI.MassFlowRate gamma_s_c[N - 1] "Diffusion conductance at outlet of thermal node i for the hot fluid"; - Units.SI.MassFlowRate gamma_s_f[N - 1] "Diffusion conductance at outlet of thermal node i for the cold fluid"; - Units.SI.Power Je_c[N - 1] "Thermal power diffusion from inlet of thermal node i for the hot fluid"; - Units.SI.Power Je_f[N - 1] "Thermal power diffusion from inlet of thermal node i for the cold fluid"; - Units.SI.Power Js_c[N - 1] "Thermal power diffusion from outlet of thermal node i for the hot fluid"; - Units.SI.Power Js_f[N - 1] "Thermal power diffusion from outlet of thermal node i for the cold fluid"; - Units.SI.Power J_c[N - 1] "Total thermal power diffusion of thermal node i for the hot fluid"; - Units.SI.Power J_f[N - 1] "Total thermal power diffusion of thermal node i for the cold fluid"; + Units.SI.MassFlowRate gamma_c[N] + "Total diffusion conductance in hydraulic node i for the hot fluid"; + Units.SI.MassFlowRate gamma_f[N] + "Total diffusion conductance in hydraulic node i for the cold fluid"; + Units.SI.MassFlowRate gamma_e_c[N - 1] + "Diffusion conductance at inlet of thermal node i for the hot fluid"; + Units.SI.MassFlowRate gamma_e_f[N - 1] + "Diffusion conductance at inlet of thermal node i for the cold fluid"; + Units.SI.MassFlowRate gamma_s_c[N - 1] + "Diffusion conductance at outlet of thermal node i for the hot fluid"; + Units.SI.MassFlowRate gamma_s_f[N - 1] + "Diffusion conductance at outlet of thermal node i for the cold fluid"; + Units.SI.Power Je_c[N - 1] + "Thermal power diffusion from inlet of thermal node i for the hot fluid"; + Units.SI.Power Je_f[N - 1] + "Thermal power diffusion from inlet of thermal node i for the cold fluid"; + Units.SI.Power Js_c[N - 1] + "Thermal power diffusion from outlet of thermal node i for the hot fluid"; + Units.SI.Power Js_f[N - 1] + "Thermal power diffusion from outlet of thermal node i for the cold fluid"; + Units.SI.Power J_c[N - 1] + "Total thermal power diffusion of thermal node i for the hot fluid"; + Units.SI.Power J_f[N - 1] + "Total thermal power diffusion of thermal node i for the cold fluid"; Real re_c[N - 1] "Value of r(Q/gamma) for inlet of thermal node i for the hot fluid"; Real re_f[N - 1] "Value of r(Q/gamma) for inlet of thermal node i for the cold fluid"; Real rs_c[N - 1] "Value of r(Q/gamma) for outlet of thermal node i for the hot fluid"; Real rs_f[N - 1] "Value of r(Q/gamma) for outlet of thermal node i for the cold fluid"; - Interfaces.Connectors.FluidInlet Ec annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Ef annotation( - Placement(transformation(extent = {{-60, -70}, {-40, -50}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sf annotation( - Placement(transformation(extent = {{40, -70}, {60, -50}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Sc annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer mode_c = Integer(region_c) - 1 "Hot fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer mode_f = Integer(region_f) - 1 "Cold fluid IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Integer N = Ns + 1 "Number of hydraulic nodes (= number of thermal nodes + 1)"; - parameter Units.SI.Area Ac = 1 "Internal cross sectional pipe area for the hot fluid"; - parameter Units.SI.Area Af = 1 "Internal cross sectional pipe area for the cold fluid"; - parameter Units.SI.PathLength dx2_c = Vc/N/Ac "Length of a hydraulic node for the hot fluid"; - parameter Units.SI.PathLength dx2_f = Vf/N/Af "Length of a hydraulic node for the cold fluid"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal=true)"; + +public + Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{-110,-10},{-90,10}}, rotation=0))); + Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{-60,-70},{-40,-50}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation( + extent={{40,-70},{60,-50}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -176,8 +237,8 @@ initial equation else if option_temperature then for i in 2:N loop - hc[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pc0, Tc0[i - 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - hf[i] = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(Pf0, Tf0[i - 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + hc[i] = Medium_c.specificEnthalpy(Medium_c.setState_pTX(p=Pc0, T=Tc0[i - 1], X=Medium_c.X_default)); + hf[i] = Medium_f.specificEnthalpy(Medium_f.setState_pTX(p=Pf0, T=Tf0[i - 1], X=Medium_f.X_default)); end for; else for i in 2:N loop @@ -187,68 +248,77 @@ initial equation end if; end if; end if; + equation -/* Heat exchanger boundaries */ + + /* Heat exchanger boundaries */ Pc[1] = Ec.P; Pc[N + 1] = Sc.P; + Pf[1] = Sf.P; Pf[N + 1] = Ef.P; + Qc[1] = Ec.Q; Qc[N] = Sc.Q; + Qf[1] = Sf.Q; Qf[N] = Ef.Q; + hbc[1] = Ec.h; hbc[N] = Sc.h; + hbf[1] = Sf.h; hbf[N] = Ef.h; + hc[1] = Ec.h_vol_1; hc[N + 1] = Sc.h_vol_2; + hf[N + 1] = Ef.h_vol_1; hf[1] = Sf.h_vol_2; + Ec.h_vol_2 = hc[2]; Sc.h_vol_1 = hc[N]; + Ef.h_vol_2 = hf[N]; Sf.h_vol_1 = hf[2]; + Sc.diff_on_1 = diffusion; Ec.diff_on_2 = diffusion; + Sf.diff_on_1 = diffusion; Ef.diff_on_2 = diffusion; + Sc.diff_res_1 = Ec.diff_res_1 + diff_res_t_c; Ec.diff_res_2 = Sc.diff_res_2 + diff_res_t_c; + Sf.diff_res_1 = Ef.diff_res_1 + diff_res_t_f; Ef.diff_res_2 = Sf.diff_res_2 + diff_res_t_f; - Ec.ftype = Sc.ftype; - Sf.ftype = Ef.ftype; - Ec.Xco2 = Sc.Xco2; - Ec.Xh2o = Sc.Xh2o; - Ec.Xo2 = Sc.Xo2; - Ec.Xso2 = Sc.Xso2; - Sf.Xco2 = Ef.Xco2; - Sf.Xh2o = Ef.Xh2o; - Sf.Xo2 = Ef.Xo2; - Sf.Xso2 = Ef.Xso2; - ftype_c = Ec.ftype; - ftype_f = Sf.ftype; - Xco2_c = Ec.Xco2; - Xh2o_c = Ec.Xh2o; - Xo2_c = Ec.Xo2; - Xso2_c = Ec.Xso2; - Xco2_f = Sf.Xco2; - Xh2o_f = Sf.Xh2o; - Xo2_f = Sf.Xo2; - Xso2_f = Sf.Xso2; -/* Exchange area for the plate exchanger */ + + Ec.Xi = Sc.Xi; + Ec.SubC = Sc.SubC; + + Sf.Xi = Ef.Xi; + Sf.SubC = Ef.SubC; + + Xc = Ec.Xi; + Xf = Ef.Xi; + + /* Exchange area for the plate exchanger */ dS = (nbp - 2)*Sp/(N - 1); -/* Mass and energy balance equations (thermal nodes) */ + + /* Mass and energy balance equations (thermal nodes) */ for i in 1:N - 1 loop -/* Mass balance equations */ + /* Mass balance equations */ BQc[i] = Qc[i] - Qc[i + 1]; BQf[i] = Qf[i + 1] - Qf[i]; + 0 = BQc[i]; 0 = BQf[i]; -/* Energy balance equations */ + + /* Energy balance equations */ BHc[i] = hbc[i]*Qc[i] - hbc[i + 1]*Qc[i + 1] - dW[i] + J_c[i]; BHf[i] = hbf[i + 1]*Qf[i + 1] - hbf[i]*Qf[i] + dW[i] + J_f[i]; + if dynamic_energy_balance then Vc/(N - 1)*rhoc1[i]*der(hc[i + 1]) = BHc[i]; Vf/(N - 1)*rhof1[i]*der(hf[i + 1]) = BHf[i]; @@ -256,13 +326,16 @@ equation 0 = BHc[i]; 0 = BHf[i]; end if; -/* Heat transfer between the hot and cold sides */ -/* 1/hconv = 1/hconv_c + 1/hconv_f + emetal/lambdam */ + + /* Heat transfer between the hot and cold sides */ + /* 1/hconv = 1/hconv_c + 1/hconv_f + emetal/lambdam */ hconv[i] = if noEvent(hconv_c[i]*hconv_f[i] < 1.e-6) then 0 else hconv_c[i]*hconv_f[i]/(hconv_c[i] + hconv_f[i] + hconv_c[i]*hconv_f[i]*emetal/lambdam); dW[i] = hconv[i]*dS*(Tc1[i] - Tf1[i]); -/* Heat transfer correlations for water/steam */ + + /* Heat transfer correlations for water/steam */ qmc1[i] = (qmc2[i] + qmc2[i + 1])/2; qmf1[i] = (qmf2[i] + qmf2[i + 1])/2; + if (heat_exchange_correlation == 0) then hconv_c[i] = p_hc; hconv_f[i] = p_hf; @@ -274,65 +347,82 @@ equation hconv_f[i] = 0; assert(false, "DynamicWaterWaterExchanger: incorrect heat exchange correlation number"); end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then re_c[i] = exp(-0.033*(Qc[i]*diff_res_e_c[i])^2); rs_c[i] = exp(-0.033*(Qc[i + 1]*diff_res_s_c[i])^2); + gamma_e_c[i] = 1/diff_res_e_c[i]; gamma_s_c[i] = 1/diff_res_s_c[i]; + re_f[i] = exp(-0.033*(Qf[i]*diff_res_e_f[i])^2); rs_f[i] = exp(-0.033*(Qf[i + 1]*diff_res_s_f[i])^2); + gamma_e_f[i] = 1/diff_res_e_f[i]; gamma_s_f[i] = 1/diff_res_s_f[i]; + if i == 1 then diff_res_e_c[i] = (if Ec.diff_on_1 then Ec.diff_res_1 else 0) + diff_res_c[i]; Je_c[i] = if Ec.diff_on_1 then re_c[i]*gamma_e_c[i]*(hc[i] - hc[i + 1]) else 0; - else + else diff_res_e_c[i] = diff_res_c[i]; Je_c[i] = re_c[i]*gamma_e_c[i]*(hc[i] - hc[i + 1]); end if; + if i == N - 1 then diff_res_s_c[i] = (if Sc.diff_on_2 then Sc.diff_res_2 else 0) + diff_res_c[i + 1]; Js_c[i] = if Sc.diff_on_2 then rs_c[i]*gamma_s_c[i]*(hc[i + 2] - hc[i + 1]) else 0; else diff_res_s_c[i] = diff_res_c[i + 1]; Js_c[i] = rs_c[i]*gamma_s_c[i]*(hc[i + 2] - hc[i + 1]); - end if; + end if; + if i == N - 1 then diff_res_e_f[i] = (if Ef.diff_on_1 then Ef.diff_res_1 else 0) + diff_res_f[i]; Je_f[i] = if Ef.diff_on_1 then re_f[i]*gamma_e_f[i]*(hf[i] - hf[i + 1]) else 0; - else + else diff_res_e_f[i] = diff_res_f[i]; Je_f[i] = re_f[i]*gamma_e_f[i]*(hf[i] - hf[i + 1]); end if; + if i == 1 then diff_res_s_f[i] = (if Sf.diff_on_2 then Sf.diff_res_2 else 0) + diff_res_f[i + 1]; Js_f[i] = if Sf.diff_on_2 then rs_f[i]*gamma_s_f[i]*(hf[i + 2] - hf[i + 1]) else 0; else diff_res_s_f[i] = diff_res_f[i + 1]; Js_f[i] = rs_f[i]*gamma_s_f[i]*(hf[i + 2] - hf[i + 1]); - end if; + end if; else diff_res_e_c[i] = 1/gamma0; diff_res_s_c[i] = 1/gamma0; + re_c[i] = 0; rs_c[i] = 0; + gamma_e_c[i] = gamma0; gamma_s_c[i] = gamma0; + Je_c[i] = 0; Js_c[i] = 0; + diff_res_e_f[i] = 1/gamma0; diff_res_s_f[i] = 1/gamma0; + re_f[i] = 0; rs_f[i] = 0; + gamma_e_f[i] = gamma0; gamma_s_f[i] = gamma0; + Je_f[i] = 0; Js_f[i] = 0; end if; + J_c[i] = Je_c[i] + Js_c[i]; J_f[i] = Je_f[i] + Js_f[i]; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then hbc[i + 1] = ThermoSysPro.Functions.SmoothCond(Qc[i + 1]/gamma_c[i + 1], hc[i + 1], hc[i + 2], 1); hbf[i + 1] = ThermoSysPro.Functions.SmoothCond(Qf[i + 1]/gamma_f[i + 1], hf[i + 1], hf[i + 2], 1); @@ -340,39 +430,50 @@ equation hbc[i + 1] = if (Qc[i + 1] > 0) then hc[i + 1] else hc[i + 2]; hbf[i + 1] = if (Qf[i + 1] > 0) then hf[i + 1] else hf[i + 2]; end if; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ if (p_rhoc > 0) then rhoc1[i] = p_rhoc; else - rhoc1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); + rhoc1[i] = Medium_c.density(state_c1[i]); end if; - Tc1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - cpc1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - muc1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - kc1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pc[i + 1], hc[i + 1], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - lambdac1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhoc1[i], Tc1[i], Pc[i + 1], 0, fluid_c); + + state_c1[i] = Medium_c.setState_phX(p=Pc[i + 1], h=hc[i + 1], X=Xc); + Tc1[i] = Medium_c.temperature(state_c1[i]); + cpc1[i] = Medium_c.specificHeatCapacityCp(state_c1[i]); + muc1[i] = Medium_c.dynamicViscosity(state_c1[i]); + kc1[i] = Medium_c.thermalConductivity(state_c1[i]); + lambdac1[i] = Medium_c.thermalConductivity(state_c1[i]); + if (p_rhof > 0) then rhof1[i] = p_rhof; else - rhof1[i] = ThermoSysPro.Properties.Fluid.Density_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + rhof1[i] = Medium_f.density(state_f1[i]); end if; - Tf1[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - cpf1[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - muf1[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - kf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pf[i + 1], hf[i + 1], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - lambdaf1[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_rhoT(rhof1[i], Tf1[i], Pf[i + 1], 0, fluid_f); + + state_f1[i] = Medium_f.setState_phX(p=Pf[i + 1], h=hf[i + 1], X=Xf); + Tf1[i] = Medium_f.temperature(state_f1[i]); + cpf1[i] = Medium_f.specificHeatCapacityCp(state_f1[i]); + muf1[i] = Medium_f.dynamicViscosity(state_f1[i]); + kf1[i] = Medium_f.thermalConductivity(state_f1[i]); + lambdaf1[i] = Medium_f.thermalConductivity(state_f1[i]); end for; -/* Pressure losses correlations */ + + /* Pressure losses correlations */ M = (nbp - 1)/2; -/* Momentum balance equations (hydraulic nodes) */ + + /* Momentum balance equations (hydraulic nodes) */ for i in 1:N loop -/* Pressure losses */ + /* Pressure losses */ Pc[i + 1] = if Qc[i] > 0 then Pc[i] - DPc[i]/N else Pc[i] + DPc[i]/N; Pf[i + 1] = if Qf[i] > 0 then Pf[i] - DPf[i]/N else Pf[i] + DPf[i]/N; + qmc2[i] = noEvent(abs(Qc[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muc2[i])*M)); qmf2[i] = noEvent(abs(Qf[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muf2[i])*M)); + quc[i] = noEvent(abs(Qc[i])/M); quf[i] = noEvent(abs(Qf[i])/M); + if (pressure_loss_correlation == 0) then DPc[i] = p_Kc*Qc[i]^2/rhoc2[i]; DPf[i] = p_Kf*Qf[i]^2/rhof2[i]; @@ -384,43 +485,139 @@ equation DPf[i] = 0; assert(false, "DynamicWaterWaterExchanger: incorrect pressure loss correlation number"); end if; -/* Diffusion resistance */ + + /* Diffusion resistance */ diff_res_c[i] = cpc2[i]*dx2_c/Ac/kc2[i]; gamma_c[i] = if diffusion then 1/diff_res_c[i] else gamma0; + diff_res_f[i] = cpf2[i]*dx2_f/Af/kf2[i]; gamma_f[i] = if diffusion then 1/diff_res_f[i] else gamma0; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ if (p_rhoc > 0) then rhoc2[i] = p_rhoc; else - rhoc2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); + rhoc2[i] = Medium_c.density(state_c2[i]); end if; - Tc2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - cpc2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - muc2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - kc2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pc[i] + Pc[i + 1])/2, hbc[i], fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); + + state_c2[i] = Medium_c.setState_phX(p=(Pc[i] + Pc[i + 1])/2, h=hbc[i], X=Xc); + Tc2[i] = Medium_c.temperature(state_c2[i]); + cpc2[i] = Medium_c.specificHeatCapacityCp(state_c2[i]); + muc2[i] = Medium_c.dynamicViscosity(state_c2[i]); + kc2[i] = Medium_c.thermalConductivity(state_c2[i]); + if (p_rhof > 0) then rhof2[i] = p_rhof; else - rhof2[i] = ThermoSysPro.Properties.Fluid.Density_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + rhof2[i] = Medium_f.density(state_f2[i]); end if; - Tf2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - cpf2[i] = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - muf2[i] = ThermoSysPro.Properties.Fluid.DynamicViscosity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - kf2[i] = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph((Pf[i] + Pf[i + 1])/2, hbf[i], fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); + + state_f2[i] = Medium_f.setState_phX(p=(Pf[i] + Pf[i + 1])/2, h=hbf[i], X=Xf); + Tf2[i] = Medium_f.temperature(state_f2[i]); + cpf2[i] = Medium_f.specificHeatCapacityCp(state_f2[i]); + muf2[i] = Medium_f.dynamicViscosity(state_f2[i]); + kf2[i] = Medium_f.thermalConductivity(state_f2[i]); end for; -/* Calcul des températures en entrée et en sortie de l'échangeur */ - Tec = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ec.P, Ec.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - Tsc = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sc.P, Sc.h, fluid_c, mode_c, Xco2_c, Xh2o_c, Xo2_c, Xso2_c); - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Ef.P, Ef.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Sf.P, Sf.h, fluid_f, mode_f, Xco2_f, Xh2o_f, Xo2_f, Xso2_f); -/* Total fluid diffusion resistance */ + + /* Calcul des températures en entrée et en sortie de l'échangeur */ + state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc); + state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc); + Tec = Medium_c.temperature(state_ce); + Tsc = Medium_c.temperature(state_cs); + + state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf); + state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf); + Tef = Medium_f.temperature(state_fe); + Tsf = Medium_f.temperature(state_fs); + + /* Total fluid diffusion resistance */ diff_res_t_c = sum(diff_res_c); diff_res_t_f = sum(diff_res_f); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = {127, 255, 0}), Line(points = {{-80, 60}, {-80, -60}}), Line(points = {{80, 60}, {80, -60}}), Line(points = {{-80, 0}, {-60, 0}, {-40, 20}, {40, -20}, {60, 0}, {80, 0}}, color = {28, 108, 200}), Line(points = {{-40, 60}, {-40, -60}}, color = {28, 108, 200}, pattern = LinePattern.Dot), Line(points = {{0, 60}, {0, -60}}, color = {28, 108, 200}, pattern = LinePattern.Dot), Line(points = {{40, 60}, {40, -60}}, color = {28, 108, 200}, pattern = LinePattern.Dot)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{-100, 60}, {100, -60}}, lineColor = {0, 0, 0}, fillPattern = FillPattern.Solid, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), lineThickness = 0), Line(points = {{-80, 60}, {-80, -60}}), Line(points = {{80, 60}, {80, -60}}), Line(points = {{-80, 0}, {-60, 0}, {-40, 20}, {40, -20}, {60, 0}, {80, 0}}, color = {28, 108, 200}), Line(points = {{-40, 60}, {-40, -60}}, color = {28, 108, 200}, pattern = LinePattern.Dot), Line(points = {{0, 60}, {0, -60}}, color = {28, 108, 200}, pattern = LinePattern.Dot), Line(points = {{40, 60}, {40, -60}}, color = {28, 108, 200}, pattern = LinePattern.Dot), Text(extent = {{104, 24}, {128, 10}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot outlet"), Text(extent = {{-82, -66}, {-62, -76}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold inlet"), Text(extent = {{-126, 24}, {-106, 14}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Hot inlet"), Text(extent = {{66, -66}, {90, -76}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Cold outlet")}), - Window(x = 0.18, y = 0.05, width = 0.68, height = 0.94), + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={127,255,0}), + Line(points={{-80,60},{-80,-60}}), + Line(points={{80,60},{80,-60}}), + Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={ + 28,108,200}), + Line( + points={{-40,60},{-40,-60}}, + color={28,108,200}, + pattern=LinePattern.Dot), + Line( + points={{0,60},{0,-60}}, + color={28,108,200}, + pattern=LinePattern.Dot), + Line( + points={{40,60},{40,-60}}, + color={28,108,200}, + pattern=LinePattern.Dot)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,60},{100,-60}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + lineThickness=0), + Line(points={{-80,60},{-80,-60}}), + Line(points={{80,60},{80,-60}}), + Line(points={{-80,0},{-60,0},{-40,20},{40,-20},{60,0},{80,0}}, color={ + 28,108,200}), + Line( + points={{-40,60},{-40,-60}}, + color={28,108,200}, + pattern=LinePattern.Dot), + Line( + points={{0,60},{0,-60}}, + color={28,108,200}, + pattern=LinePattern.Dot), + Line( + points={{40,60},{40,-60}}, + color={28,108,200}, + pattern=LinePattern.Dot), + Text( + extent={{104,24},{128,10}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot outlet"), + Text( + extent={{-82,-66},{-62,-76}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold inlet"), + Text( + extent={{-126,24},{-106,14}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Hot inlet"), + Text( + extent={{66,-66},{90,-76}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Cold outlet")}), + Window( + x=0.18, + y=0.05, + width=0.68, + height=0.94), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -432,4 +629,4 @@ Daniel Bouskela Baligh El Hefni ")); -end DynamicPlateHeatExchanger; \ No newline at end of file +end DynamicPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo index 7dd003e4..a8b1e446 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo @@ -1,52 +1,72 @@ within ThermoSysPro.Fluid.HeatExchangers; - model SimpleDynamicCondenser "Simple dynamic condenser" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Volume V = 1 "Cavity volume"; - parameter Units.SI.Area A = 1 "Cavity cross-sectional area"; - parameter Real Ccond = 0.01 "Condensation coefficient"; - parameter Real Cevap = 0.09 "Evaporation coefficient"; - parameter Real Xlo = 0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; - parameter Real Xvo = 0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; - parameter Units.SI.Area Avl = A "Heat exchange surface between the liquid and gas phases"; - parameter Real Kvl = 1000 "Heat exchange coefficient between the liquid and gas phases"; - parameter Units.SI.Length L = 10. "Pipe length"; - parameter Units.SI.Diameter D = 0.02 "Pipe internal diameter"; - parameter Units.SI.Length e = 2.e-3 "Wall thickness"; - parameter Units.SI.Position z1 = 0 "Inlet altitude"; - parameter Units.SI.Position z2 = 0 "Outlet altitude"; - parameter Units.SI.Length rugosrel = 0.0007 "Pipe roughness"; - parameter Real lambda = 0.03 "Friction pressure loss coefficient (active if lambda_fixed=true)"; - parameter Integer ntubes = 1 "Number of pipes in parallel"; - parameter Units.SI.Area At = ntubes*pi*D^2/4 "Internal pipe cross-section area (cooling fluid)"; - parameter Boolean gravity_pressure = false "true: fluid pressure at the bottom of the cavity includes gravity term - false: without gravity term"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean steady_state = true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 0.1e5 "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region for the pipes (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.MassFlowRate Q(start = 100) "Mass flow rate in the pipes"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Volume V=1 "Cavity volume"; + parameter Units.SI.Area A=1 "Cavity cross-sectional area"; + parameter Real Ccond=0.01 "Condensation coefficient"; + parameter Real Cevap=0.09 "Evaporation coefficient"; + parameter Real Xlo=0.0025 "Vapor mass fraction in the liquid phase from which the liquid starts to evaporate"; + parameter Real Xvo=0.9975 "Vapor mass fraction in the gas phase from which the liquid starts to condensate"; + parameter Units.SI.Area Avl=A + "Heat exchange surface between the liquid and gas phases"; + parameter Real Kvl=1000 "Heat exchange coefficient between the liquid and gas phases"; + parameter Units.SI.Length L=10. "Pipe length"; + parameter Units.SI.Diameter D=0.02 "Pipe internal diameter"; + parameter Units.SI.Length e=2.e-3 "Wall thickness"; + parameter Units.SI.Position z1=0 "Inlet altitude"; + parameter Units.SI.Position z2=0 "Outlet altitude"; + parameter Units.SI.Length rugosrel=0.0007 "Pipe roughness"; + parameter Real lambda= 0.03 "Friction pressure loss coefficient (active if lambda_fixed=true)"; + parameter Integer ntubes=1 "Number of pipes in parallel"; + parameter Units.SI.Area At=ntubes*pi*D^2/4 + "Internal pipe cross-section area (cooling fluid)"; + parameter Boolean gravity_pressure=false "true: fluid pressure at the bottom of the cavity includes gravity term - false: without gravity term"; + parameter Boolean dynamic_energy_balance=true "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean steady_state=true "true: start from steady state - false: start from (P0, Vf0) (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.5 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=0.1e5 + "Fluid initial pressure (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial liquid phase trace substances (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default + "Initial vapor phase trace substances (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; + constant Real pi=Modelica.Constants.pi "pi"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public + Units.SI.MassFlowRate Q(start=100) "Mass flow rate in the pipes"; Units.SI.AbsolutePressure Pm "Fluid average pressure in the pipes"; Units.SI.SpecificEnthalpy hm "Fluid average specific enthalpy in the pipes"; - Units.SI.SpecificHeatCapacity cp(start = 4200) "Fluid specific heat capacity in the pipes"; - Units.SI.ThermalConductivity k(start = 0.05) "Fluid thermal conductivity in the pipes"; - Units.SI.Density rhom(start = 998) "Liquid phase density in the pipes"; - ThermoSysPro.Units.SI.PressureDifference deltaP "Total pressure loss in the pipes"; - ThermoSysPro.Units.SI.PressureDifference dpf "Friction pressure loss in the pipes"; - ThermoSysPro.Units.SI.PressureDifference dpg "Gravity pressure loss in the pipes"; + Units.SI.SpecificHeatCapacity cp(start=4200) + "Fluid specific heat capacity in the pipes"; + Units.SI.ThermalConductivity k(start=0.05) + "Fluid thermal conductivity in the pipes"; + Units.SI.Density rhom(start=998) "Liquid phase density in the pipes"; + ThermoSysPro.Units.SI.PressureDifference deltaP + "Total pressure loss in the pipes"; + ThermoSysPro.Units.SI.PressureDifference dpf + "Friction pressure loss in the pipes"; + ThermoSysPro.Units.SI.PressureDifference dpg + "Gravity pressure loss in the pipes"; Real khi "Hydraulic pressure loss coefficient"; Units.SI.AbsolutePressure P "Fluid average pressure in the cavity"; Units.SI.AbsolutePressure Pfond "Fluid pressure at the bottom of the cavity"; @@ -56,58 +76,65 @@ model SimpleDynamicCondenser "Simple dynamic condenser" Units.SI.Temperature Tv "Gas phase temperature in the cavity"; Units.SI.Volume Vl "Liquid phase volume in the cavity"; Units.SI.Volume Vv "Gas phase volume in the cavity"; - Real xl(start = 0.0) "Mass vapor fraction in the liquid phase of the cavity"; - Real xv(start = 1) "Mass vapor fraction in the gas phase if the cavity"; - Units.SI.Density rhol(start = 996) "Liquid phase density in the cavity"; - Units.SI.Density rhov(start = 1.5) "Gas phase density in the cavity"; - Units.SI.MassFlowRate BQl "Right hand side of the mass balance equation of the liquid phase in the cavity"; - Units.SI.MassFlowRate BQv "Right hand side of the mass balance equation of the gas phase in the cavity"; - Units.SI.Power BHl "Right hand side of the energy balance equation of the liquid phase in the cavity"; - Units.SI.Power BHv "Right hand side of the energy balance equation of the gas phase in the cavity"; - Units.SI.MassFlowRate Qcond "Condensation mass flow rate from the vapor phase in the cavity"; - Units.SI.MassFlowRate Qevap "Evaporation mass flow rate from the liquid phase in the cavity"; - Units.SI.Power Wvl "Thermal power exchanged from the gas phase to the liquid phase in the cavity"; - Units.SI.Power Wout "Thermal power exchanged from the steam in the cavity to the pipes"; + Real xl(start=0.0) "Mass vapor fraction in the liquid phase of the cavity"; + Real xv(start=1) "Mass vapor fraction in the gas phase if the cavity"; + Units.SI.Density rhol(start=996) "Liquid phase density in the cavity"; + Units.SI.Density rhov(start=1.5) "Gas phase density in the cavity"; + Units.SI.MassFlowRate BQl + "Right hand side of the mass balance equation of the liquid phase in the cavity"; + Units.SI.MassFlowRate BQv + "Right hand side of the mass balance equation of the gas phase in the cavity"; + Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the liquid phase in the cavity"; + Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) + "Right hand side of the trace balance equation of the vapor phase in the cavity"; + Medium.C_BiPhase C_record; + Units.SI.Power BHl + "Right hand side of the energy balance equation of the liquid phase in the cavity"; + Units.SI.Power BHv + "Right hand side of the energy balance equation of the gas phase in the cavity"; + Units.SI.MassFlowRate Qcond + "Condensation mass flow rate from the vapor phase in the cavity"; + Units.SI.MassFlowRate Qevap + "Evaporation mass flow rate from the liquid phase in the cavity"; + Units.SI.Power Wvl + "Thermal power exchanged from the gas phase to the liquid phase in the cavity"; + Units.SI.Power Wout + "Thermal power exchanged from the steam in the cavity to the pipes"; Units.SI.Power Jv "Thermal power diffusion from inlet Cv"; Units.SI.Power Jl "Thermal power diffusion from outlet Cl"; - Units.SI.Power Jt_l "Total thermal power diffusion for the liquid in the cavity"; - Units.SI.Power Jt_v "Total thermal power diffusion for the vapor in the cavity"; + Units.SI.Power Jt_l + "Total thermal power diffusion for the liquid in the cavity"; + Units.SI.Power Jt_v + "Total thermal power diffusion for the vapor in the cavity"; Units.SI.MassFlowRate gamma_v "Diffusion conductance for inlet Cv"; Units.SI.MassFlowRate gamma_l "Diffusion conductance for outlet Cl"; Real rv "Value of r(Q/gamma) for inlet Cv"; Real rl "Value of r(Q/gamma) for outlet Cl"; - Units.SI.MassFlowRate gamma_diff(start = 1.e-4) "Diffusion conductance in the pipes"; - FluidType ftype_p "Fluid type in the pipes"; - Integer fluid_p = Integer(ftype_p) "Fluid number in the pipes"; - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prol "Propriétés de l'eau dans le ballon" annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prov "Propriétés de la vapeur dans le ballon" annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{-30, 40}, {-10, 60}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{10, 40}, {30, 60}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cv annotation( - Placement(transformation(extent = {{-10, 90}, {10, 110}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cl annotation( - Placement(transformation(extent = {{-8, -110}, {12, -90}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yNiveau annotation( - Placement(transformation(extent = {{100, -82}, {120, -62}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cee annotation( - Placement(transformation(extent = {{-110, -32}, {-90, -12}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cse annotation( - Placement(transformation(extent = {{90, -30}, {110, -10}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proe "Propriétés de l'eau " annotation( - Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); -protected - constant Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity constant"; - constant Real pi = Modelica.Constants.pi "pi"; - parameter Integer fluid_c = Integer(ftype) "Fluid number in the cavity"; - parameter Integer mode = Integer(region) - 1 "IF97 region for the pipes. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + Units.SI.MassFlowRate gamma_diff(start=1.e-4) + "Diffusion conductance in the pipes"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity"; + Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Liquid phase trace substances in the cavity"; + Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Vapor phase trace substances in the cavity"; + Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; + Medium_Cooling.MassFraction Xp[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipes"; + Medium.ThermodynamicState state_l "Liquid phase thermodynamic state in the cavity"; + Medium.ThermodynamicState state_v "Vapor phase thermodynamic state in the cavity"; + Medium.ThermodynamicState state_d "Outlet liquid thermodynamic state"; + Medium_Cooling.ThermodynamicState state_e "Average cooling pipe thermodynamic state"; + Medium.SaturationProperties sat "Saturation properties in the cavity"; + + Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-10,90},{10,110}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) annotation (Placement(transformation( + extent={{-8,-110},{12,-90}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yNiveau annotation (Placement( + transformation(extent={{100,-82},{120,-62}}, rotation=0))); +public + Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( + extent={{-110,-32},{-90,-12}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation( + extent={{90,-30},{110,-10}}, rotation=0))); initial equation if dynamic_energy_balance then if steady_state then @@ -115,177 +142,425 @@ initial equation der(hv) = 0; der(Vl) = 0; der(P) = 0; + der(SubCl) = fill(0, Medium.nC); + der(SubCv) = fill(0, Medium.nC); else - hl = lsat.h; - hv = vsat.h; + hl = Medium.bubbleEnthalpy(Medium.setSat_p(P0)); + hv = Medium.dewEnthalpy(Medium.setSat_p(P0)); Vl = Vf0*V; P = P0; + SubCl = SubCl0; + SubCv = SubCv0; end if; end if; + equation -/* Check that the fluid type for the cooling pipe is water/steam */ - assert((ftype_p == FluidType.WaterSteam) or (ftype_p == FluidType.WaterSteamSimple), "SimpleDynamicCondenser: the fluid type for the cooling pipe must be water/steam"); -/* Unconnected connectors */ + + /* Unconnected connectors */ if (cardinality(Cv) == 0) then Cv.Q = 0; Cv.h = 1.e5; Cv.h_vol_1 = 1.e5; Cv.diff_res_1 = 0; Cv.diff_on_1 = false; - Cv.ftype = ftype; - Cv.Xco2 = 0; - Cv.Xh2o = 0; - Cv.Xo2 = 0; - Cv.Xso2 = 0; + Cv.Xi = Medium.X_default[1:Medium.nXi]; + Cv.SubC = Medium.C_default; end if; + if (cardinality(Cee) == 0) then Cee.Q = 0; Cee.h = 1.e5; Cee.h_vol_1 = 1.e5; Cee.diff_res_1 = 0; Cee.diff_on_1 = false; - Cee.ftype = ftype; - Cee.Xco2 = 0; - Cee.Xh2o = 0; - Cee.Xo2 = 0; - Cee.Xso2 = 0; + Cee.Xi = Medium_Cooling.X_default[1:Medium_Cooling.nXi]; + Cee.SubC = Medium_Cooling.C_default; end if; + if (cardinality(Cl) == 0) then Cl.Q = 0; Cl.h_vol_2 = 1.e5; Cl.diff_res_2 = 0; Cl.diff_on_2 = false; + Cl.Xi = Medium.X_default[1:Medium.nXi]; + Cl.SubC = Medium.C_default; end if; + if (cardinality(Cse) == 0) then Cse.Q = 0; Cse.h_vol_2 = 1.e5; Cse.diff_res_2 = 0; Cse.diff_on_2 = false; + Cse.Xi = Medium_Cooling.X_default[1:Medium_Cooling.nXi]; + Cse.SubC = Medium_Cooling.C_default; end if; -/* Drum volume */ + + /* Drum volume */ V = Vl + Vv; -/* Water level */ + + /* Water level */ yNiveau.signal = Vl/A; -/* Pressure at the bottom of the condenser */ - Pfond = if gravity_pressure then P + prod.d*g*Vl/A else P; -/* Liquid phase mass balance equation in the cavity */ + + /* Pressure at the bottom of the condenser */ + Pfond = if gravity_pressure then P + Medium.density(state_d)*g*Vl/A else P; + + /* Liquid phase mass balance equation in the cavity */ BQl = -Cl.Q + Qcond - Qevap; + if dynamic_energy_balance then - rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl; + rhol*der(Vl) + Vl*(Medium.density_derp_h(state_l)*der(P) + Medium.density_derh_p(state_l)*der(hl)) = BQl; else 0 = BQl; end if; -/* Vapor phase mass balance equation in the cavity */ + + /* Vapor phase mass balance equation in the cavity */ BQv = Cv.Q + Qevap - Qcond; + if dynamic_energy_balance then - rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv; + rhov*der(Vv) + Vv*(Medium.density_derp_h(state_v)*der(P) + Medium.density_derh_p(state_v)*der(hv)) = BQv; else 0 = BQv; end if; -/* Condensation and evaporation mass flow rates */ + + /* Condensation and evaporation mass flow rates */ Qcond = if noEvent(xv < Xvo) then Ccond*rhov*Vv*(Xvo - xv) else 0; Qevap = if noEvent(xl > Xlo) then Cevap*rhol*Vl*(xl - Xlo) else 0; + Cv.P = P; Cl.P = Pfond; -/* Liquid phase energy balance equation in the cavity */ - BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(lsat.h - (hl - P/rhol)) - Qevap*(vsat.h - (hl - P/rhol)) + Wvl + Jt_l; + + /* Liquid phase energy balance equation in the cavity */ + BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(Medium.bubbleEnthalpy(sat) - (hl - P/rhol)) - Qevap*(Medium.dewEnthalpy(sat) - (hl - P/rhol)) + Wvl + Jt_l; + if dynamic_energy_balance then - Vl*((P/rhol*prol.ddph - 1)*der(P) + (P/rhol*prol.ddhp + rhol)*der(hl)) = BHl; + Vl*((P/rhol*Medium.density_derp_h(state_l) - 1)*der(P) + (P/rhol*Medium.density_derh_p(state_l) + rhol)*der(hl)) = BHl; else 0 = BHl; end if; -/* Vapor phase energy balance equation in the cavity */ - BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(vsat.h - (hv - P/rhov)) - Qcond*(lsat.h - (hv - P/rhov)) - Wvl + Wout + Jt_v; + + /* Vapor phase energy balance equation in the cavity */ + BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(Medium.dewEnthalpy(sat) - (hv - P/rhov)) - Qcond*(Medium.bubbleEnthalpy(sat) - (hv - P/rhov)) - Wvl + Wout + Jt_v; + if dynamic_energy_balance then - Vv*((P/rhov*prov.ddph - 1)*der(P) + (P/rhov*prov.ddhp + rhov)*der(hv)) = BHv; + Vv*((P/rhov*Medium.density_derp_h(state_v) - 1)*der(P) + (P/rhov*Medium.density_derh_p(state_v) + rhov)*der(hv)) = BHv; else 0 = BHv; end if; + Cv.h_vol_2 = hv; Cl.h_vol_1 = hl; -/* Heat transfer between the liquid and the vapor */ + + /* Heat transfer between the liquid and the vapor */ Wvl = Kvl*Avl*(Tv - Tl); -/* Thermal power exchanged from the steam to the pipes */ + + /* Thermal power exchanged from the steam to the pipes */ Wout = -Cv.Q*(Cv.h - hl); Wout = -Cee.Q*(Cse.h - Cee.h); -/* Fluid composition in the cavity (no balance equations) */ - Cl.ftype = ftype; - Cl.Xco2 = 0; - Cl.Xh2o = 0; - Cl.Xo2 = 0; - Cl.Xso2 = 0; -/* Pipes inlet and outlet */ + + /* Fluid composition in the cavity (no balance equations) */ + Cv.Xi = Cl.Xi; + X = Cv.Xi; + + /* Traces composition balance equations */ + C_record = PhasesSeparationFunction(); + + SubCSaS = SaS(); + + BSubCl = Qcond*C_record.Cl - Qevap*SubCl - Cl.Q*Cl.SubC; + BSubCv = Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + + if dynamic_energy_balance then + Vl*rhol*der(SubCl) + SubCl*BQl = BSubCl; + Vv*rhov*der(SubCv) + SubCv*BQv + Vv*rhov*SubCSaS = BSubCv; + else + SubCl*BQl = BSubCl; + SubCv*BQv + Vv*rhov*SubCSaS = BSubCv; + end if; + + Cl.SubC = SubCl; + + /* Pipes inlet and outlet */ Cee.Q = Cse.Q; + Cee.h_vol_1 = Cse.h_vol_1; Cee.h_vol_2 = Cse.h_vol_2; + Cse.diff_on_1 = Cee.diff_on_1; Cee.diff_on_2 = Cse.diff_on_2; + Cse.diff_res_1 = Cee.diff_res_1 + 1/gamma_diff; Cee.diff_res_2 = Cse.diff_res_2 + 1/gamma_diff; - Cee.ftype = Cse.ftype; - Cee.Xco2 = Cse.Xco2; - Cee.Xh2o = Cse.Xh2o; - Cee.Xo2 = Cse.Xo2; - Cee.Xso2 = Cse.Xso2; - ftype_p = Cee.ftype; + + Cee.Xi = Cse.Xi; + Cee.SubC = Cse.SubC; + Xp = Cee.Xi; + Q = Cee.Q; deltaP = Cee.P - Cse.P; -/* Pressure losses in the pipes */ - dpf = khi*ThermoSysPro.Functions.ThermoSquare(Cee.Q, eps)/(2*At^2*rhom); + + /* Pressure losses in the pipes */ + dpf = khi*ThermoSysPro.Functions.ThermoSquare(Cee.Q,eps)/(2*At^2*rhom); dpg = rhom*g*(z2 - z1); deltaP = dpf + dpg; + khi = lambda*L/D; -/* Diffusion resistance in the pipes */ + + /* Diffusion resistance in the pipes */ gamma_diff = A*k/cp/L; -/* Flow reversal */ + + /* Flow reversal */ if continuous_flow_reversal then Cl.h = ThermoSysPro.Functions.SmoothCond(Cl.Q/gamma_l, Cl.h_vol_1, Cl.h_vol_2, 1); else Cl.h = if (Cl.Q > 0) then Cl.h_vol_1 else Cl.h_vol_2; end if; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then rv = if Cv.diff_on_1 then exp(-0.033*(Cv.Q*Cv.diff_res_1)^2) else 0; rl = if Cl.diff_on_2 then exp(-0.033*(Cl.Q*Cl.diff_res_2)^2) else 0; + gamma_v = if Cv.diff_on_1 then 1/Cv.diff_res_1 else gamma0; gamma_l = if Cl.diff_on_2 then 1/Cl.diff_res_2 else gamma0; + Jv = if Cv.diff_on_1 then rv*gamma_v*(Cv.h_vol_1 - Cv.h_vol_2) else 0; Jl = if Cl.diff_on_2 then rl*gamma_l*(Cl.h_vol_2 - Cl.h_vol_1) else 0; else rv = 0; rl = 0; + gamma_v = gamma0; gamma_l = gamma0; + Jv = 0; Jl = 0; - end if; + end if; + Jt_l = Jl; Jt_v = Jv; + Cv.diff_res_2 = 0; Cl.diff_res_1 = 0; + Cv.diff_on_2 = diffusion; Cl.diff_on_1 = diffusion; -/* Fluid thermodynamic properties */ + + /* Fluid thermodynamic properties */ Pm = (Cee.P + Cse.P)/2; hm = (Cee.h + Cse.h)/2; - prol = ThermoSysPro.Properties.Fluid.Ph(P, hl, 0, fluid_c); - prov = ThermoSysPro.Properties.Fluid.Ph(P, hv, 0, fluid_c); - prod = ThermoSysPro.Properties.Fluid.Ph(Pfond, Cl.h, 0, fluid_c); - proe = ThermoSysPro.Properties.Fluid.Ph(Pm, hm, mode, fluid_p); - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(P, fluid_c); - rhom = proe.d; - Tl = prol.T; - rhol = prol.d; - xl = prol.x; - Tv = prov.T; - rhov = prov.d; - xv = prov.x; - k = ThermoSysPro.Properties.Fluid.ThermalConductivity_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o, Cee.Xo2, Cee.Xso2); - cp = ThermoSysPro.Properties.Fluid.SpecificHeatCapacityCp_Ph(Pm, hm, fluid_p, mode, Cee.Xco2, Cee.Xh2o, Cee.Xo2, Cee.Xso2); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Rectangle(extent = {{100, 20}, {80, -60}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {-80, -60}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 6}, {-80, 0}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, -18}, {-80, -24}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, -40}, {-80, -46}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, 6}, {20, 0}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, -40}, {20, -46}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, -18}, {20, -24}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, -18}, {-30, -24}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, -40}, {-30, -46}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, 6}, {-30, 0}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, -72}, {100, -100}}, lineColor = {0, 0, 255}, lineThickness = 0.5, fillColor = {85, 170, 255}, fillPattern = FillPattern.Solid), Line(points = {{-20, 100}, {20, 100}, {100, 20}, {100, -100}, {-100, -100}, {-100, 20}, {-20, 100}}, color = {0, 0, 255}, thickness = 0.5)}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics = {Line(points = {{-20, 100}, {20, 100}, {100, 20}, {100, -100}, {-100, -100}, {-100, 20}, {-20, 100}}, color = {0, 0, 255}, thickness = 0), Rectangle(extent = {{100, 20}, {80, -60}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 20}, {-80, -60}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, 6}, {-80, 0}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, -18}, {-80, -24}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-20, -40}, {-80, -46}}, lineColor = {0, 0, 255}, fillColor = {0, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, 6}, {20, 0}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, -40}, {20, -46}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{80, -18}, {20, -24}}, lineColor = {0, 0, 255}, fillColor = {255, 170, 170}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, -18}, {-30, -24}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, -40}, {-30, -46}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{30, 6}, {-30, 0}}, lineColor = {0, 0, 255}, fillColor = {170, 170, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, -72}, {100, -100}}, lineColor = {0, 0, 255}, lineThickness = 0, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-2, 102}, {-22, 100}, {-42, 94}, {-62, 82}, {-82, 62}, {-94, 42}, {-100, 22}, {-100, 20}, {-98, 20}, {100, 20}, {100, 20}, {96, 28}, {90, 42}, {78, 62}, {58, 82}, {38, 94}, {18, 100}, {-2, 102}}, lineColor = {28, 108, 200}, fillColor = DynamicSelect({85, 170, 255}, if dynamic_energy_balance then fill_color_dynamic else if diffusion then fill_color_singular else fill_color_static), lineThickness = 0, fillPattern = FillPattern.Solid), Text(extent = {{-66, 66}, {72, 22}}, lineColor = {0, 0, 255}, fillColor = {175, 175, 175}, fillPattern = FillPattern.Solid, textString = "Simple"), Text(extent = {{-130, 4}, {-104, -12}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water inlet"), Text(extent = {{108, 4}, {136, -10}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Water outlet"), Text(extent = {{-18, 92}, {24, 74}}, lineColor = {0, 0, 0}, lineThickness = 0, fillPattern = FillPattern.Sphere, fillColor = {191, 0, 0}, textString = "Turbine outlet"), Text(extent = {{12, 132}, {40, 104}}, lineColor = {238, 46, 47}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid, textString = "Steam inlet")}), - Window(x = 0.11, y = 0.06, width = 0.78, height = 0.88), + + sat = Medium.setSat_p(P); + state_l = Medium.setState_phX(p=P, h=hl, X=X); + state_v = Medium.setState_phX(p=P, h=hv, X=X); + state_d = Medium.setState_phX(p=Pfond, h=Cl.h, X=X); + state_e = Medium_Cooling.setState_phX(p=Pm, h=hm, X=Xp); + + rhom = Medium_Cooling.density(state_e); + + Tl = Medium.temperature(state_l); + rhol = Medium.density(state_l); + xl = (hl - Medium.bubbleEnthalpy(sat))/(Medium.dewEnthalpy(sat) - Medium.bubbleEnthalpy(sat)); + + Tv = Medium.temperature(state_v); + rhov = Medium.density(state_v); + xv = (hv - Medium.bubbleEnthalpy(sat))/(Medium.dewEnthalpy(sat) - Medium.bubbleEnthalpy(sat)); + + k = Medium_Cooling.thermalConductivity(state_e); + cp = Medium_Cooling.specificHeatCapacityCp(state_e); + + annotation ( + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{100,20},{80,-60}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{-80,-60}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,6},{-80,0}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,-18},{-80,-24}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,-40},{-80,-46}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,6},{20,0}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,-40},{20,-46}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,-18},{20,-24}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,-18},{-30,-24}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,-40},{-30,-46}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,6},{-30,0}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,-72},{100,-100}}, + lineColor={0,0,255}, + lineThickness=0.5, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20}, + {-20,100}}, + color={0,0,255}, + thickness=0.5)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line( + points={{-20,100},{20,100},{100,20},{100,-100},{-100,-100},{-100,20}, + {-20,100}}, + color={0,0,255}, + thickness=0), + Rectangle( + extent={{100,20},{80,-60}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,20},{-80,-60}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,6},{-80,0}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,-18},{-80,-24}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-20,-40},{-80,-46}}, + lineColor={0,0,255}, + fillColor={0,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,6},{20,0}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,-40},{20,-46}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{80,-18},{20,-24}}, + lineColor={0,0,255}, + fillColor={255,170,170}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,-18},{-30,-24}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,-40},{-30,-46}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{30,6},{-30,0}}, + lineColor={0,0,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,-72},{100,-100}}, + lineColor={0,0,255}, + lineThickness=0, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,102},{-22,100},{-42,94},{-62,82},{-82,62},{-94,42},{-100, + 22},{-100,20},{-98,20},{100,20},{100,20},{96,28},{90,42},{78,62}, + {58,82},{38,94},{18,100},{-2,102}}, + lineColor={28,108,200}, + fillColor= DynamicSelect({85,170,255}, + if dynamic_energy_balance then fill_color_dynamic + else if diffusion then fill_color_singular + else fill_color_static), + lineThickness=0, + fillPattern=FillPattern.Solid), + Text( + extent={{-66,66},{72,22}}, + lineColor={0,0,255}, + fillColor={175,175,175}, + fillPattern=FillPattern.Solid, + textString= + "Simple"), + Text( + extent={{-130,4},{-104,-12}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water inlet"), + Text( + extent={{108,4},{136,-10}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Water outlet"), + Text( + extent={{-18,92},{24,74}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.Sphere, + fillColor={191,0,0}, + textString= + "Turbine outlet"), + Text( + extent={{12,132},{40,104}}, + lineColor={238,46,47}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid, + textString="Steam inlet")}), + Window( + x=0.11, + y=0.06, + width=0.78, + height=0.88), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -296,4 +571,4 @@ Author Baligh El Hefni ")); -end SimpleDynamicCondenser; \ No newline at end of file +end SimpleDynamicCondenser; diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo index 7bf6bd1c..2c656622 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo @@ -1,125 +1,242 @@ within ThermoSysPro.Fluid.HeatExchangers; - model SimpleEvaporatorWaterSteamFlueGases "Simple water/steam - flue gases evaporator" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real Kdpf = 10 "Flue gases pressure drop coefficient"; - parameter Real Kdpe = 10 "Water/steam pressure drop coefficient"; - parameter Units.SI.MassFlowRate gamma_diff_ws = 1e-4 "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; - parameter Units.SI.MassFlowRate gamma_diff_fg = 1e-4 "Diffusion conductance for the flue gases side (active if diffusion=true in neighbouring volumes)"; - parameter IF97Region region = IF97Region.All_regions "IF97 region for the water/steam side (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.AbsolutePressure Pef(start = 3e5) "Flue gases pressure at the inlet"; - Units.SI.AbsolutePressure Psf(start = 2.5e5) "Flue gases pressure at the outlet"; - Units.SI.Temperature Tef(start = 600) "Flue gases temperature at the inlet"; - Units.SI.Temperature Tsf(start = 400) "Flue gases temperature at the outlet"; - Units.SI.SpecificEnthalpy Hsf(start = 3e5) "Flue gases specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy Hef(start = 6e5) "Flue gases specific enthalpy at the inlet"; - Units.SI.MassFlowRate Qf(start = 10) "Flue gases mass flow rate"; - Units.SI.AbsolutePressure Pee(start = 2e6) "Water pressure at the inlet"; - Units.SI.AbsolutePressure Pse(start = 2e6) "Water pressure at the outlet"; - Units.SI.Temperature Tee(start = 400) "Water temperature at the inlet"; - Units.SI.Temperature Tse(start = 450) "Water temperature at the outlet"; - Units.SI.SpecificEnthalpy Hee(start = 3e5) "Water specific enthalpy at the inlet"; - Units.SI.SpecificEnthalpy Hse(start = 20e5) "Water specific enthalpy at the outlet"; - Units.SI.MassFlowRate Qe(start = 10) "Water mass flow rate"; - Units.SI.Density rhof(start = 0.9) "Flue gases density"; - Units.SI.Density rhoe(start = 700) "Water density"; - Units.SI.Power W(start = 1e8) "Power exchanged"; - FluidType ftype_ws "Fluid type for the water/steam side"; - Integer fluid_ws = Integer(ftype_ws) "Fluid number for the water/steam side"; - FluidType ftype_fg "Fluid type for the flue gases side"; - Integer fluid_fg = Integer(ftype_fg) "Fluid number for the flue gases side"; - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2 annotation( - Placement(transformation(extent = {{90, -10}, {110, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1 annotation( - Placement(transformation(extent = {{-110, -10}, {-90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1 annotation( - Placement(transformation(extent = {{-10, 80}, {10, 100}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2 annotation( - Placement(transformation(extent = {{-10, -100}, {10, -80}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proes annotation( - Placement(transformation(extent = {{-52, 80}, {-32, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proem annotation( - Placement(transformation(extent = {{-76, 80}, {-56, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat vsat annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.PropThermoSat lsat annotation( - Placement(transformation(extent = {{58, 80}, {78, 100}}, rotation = 0))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real Kdpf=10 "Flue gases pressure drop coefficient"; + parameter Real Kdpe=10 "Water/steam pressure drop coefficient"; + parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4 + "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; + parameter Units.SI.MassFlowRate gamma_diff_fg=1e-4 + "Diffusion conductance for the flue gases side (active if diffusion=true in neighbouring volumes)"; + protected - parameter Integer mode = Integer(region) - 1 "IF97 region for the water/steam side. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public + Units.SI.AbsolutePressure Pef(start=3e5) "Flue gases pressure at the inlet"; + Units.SI.AbsolutePressure Psf(start=2.5e5) + "Flue gases pressure at the outlet"; + Units.SI.Temperature Tef(start=600) "Flue gases temperature at the inlet"; + Units.SI.Temperature Tsf(start=400) "Flue gases temperature at the outlet"; + Units.SI.SpecificEnthalpy Hsf(start=3e5) + "Flue gases specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy Hef(start=6e5) + "Flue gases specific enthalpy at the inlet"; + Units.SI.MassFlowRate Qf(start=10) "Flue gases mass flow rate"; + Units.SI.AbsolutePressure Pee(start=2e6) "Water pressure at the inlet"; + Units.SI.AbsolutePressure Pse(start=2e6) "Water pressure at the outlet"; + Units.SI.Temperature Tee(start=400) "Water temperature at the inlet"; + Units.SI.Temperature Tse(start=450) "Water temperature at the outlet"; + Units.SI.SpecificEnthalpy Hee(start=3e5) + "Water specific enthalpy at the inlet"; + Units.SI.SpecificEnthalpy Hse(start=20e5) + "Water specific enthalpy at the outlet"; + Units.SI.MassFlowRate Qe(start=10) "Water mass flow rate"; + Units.SI.Density rhof(start=0.9) "Flue gases density"; + Units.SI.Density rhoe(start=700) "Water density"; + Units.SI.Power W(start=1e8) "Power exchanged"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xfg[Medium_FlueGases.nXi](start=Medium_FlueGases.X_default[1:Medium_FlueGases.nXi]) "Flue gases mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium.ThermodynamicState state_ws_in "Water/steam inlet thermodynamic state"; + Medium.ThermodynamicState state_ws_out "Water/steam outlet thermodynamic state"; + Medium.ThermodynamicState state_ws_m "Water/steam average thermodynamic state"; + Medium.SaturationProperties sat_ws "Water/steam saturation properties at the outlet pressure"; + Medium_FlueGases.ThermodynamicState state_fg_in "Flue gases inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{90,-10},{110,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) annotation ( + Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) annotation ( + Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0))); equation -/* Check that the fluid type for the water/steam side is water/steam */ - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "SimpleEvaporatorWaterSteamFlueGases: the fluid type must be water/steam for the water/steam side"); -/* Flue gases inlet */ + /* Flue gases inlet */ Pef = Cfg1.P; Hef = Cfg1.h; Qf = Cfg1.Q; -/* Flue gases outlet */ + + /* Flue gases outlet */ Psf = Cfg2.P; Hsf = Cfg2.h; Cfg1.Q = Cfg2.Q; + Cfg1.h_vol_1 = Cfg2.h_vol_1; Cfg1.h_vol_2 = Cfg2.h_vol_2; + Cfg2.diff_on_1 = Cfg1.diff_on_1; Cfg1.diff_on_2 = Cfg2.diff_on_2; + Cfg2.diff_res_1 = Cfg1.diff_res_1 + 1/gamma_diff_fg; Cfg1.diff_res_2 = Cfg2.diff_res_2 + 1/gamma_diff_fg; - Cfg1.ftype = Cfg2.ftype; - Cfg2.Xco2 = Cfg1.Xco2; - Cfg2.Xh2o = Cfg1.Xh2o; - Cfg2.Xo2 = Cfg1.Xo2; - Cfg2.Xso2 = Cfg1.Xso2; - ftype_fg = Cfg1.ftype; -/* Water inlet */ + + Cfg1.Xi = Cfg2.Xi; + Xfg = Cfg1.Xi; + Cfg1.SubC = Cfg2.SubC; + SubCfg = Cfg1.SubC; + + /* Water inlet */ Pee = Cws1.P; Hee = Cws1.h; Qe = Cws1.Q; -/* Water outlet */ + + /* Water outlet */ Pse = Cws2.P; Hse = Cws2.h; Cws1.Q = Cws2.Q; + Cws1.h_vol_1 = Cws2.h_vol_1; Cws1.h_vol_2 = Cws2.h_vol_2; + Cws2.diff_on_1 = Cws1.diff_on_1; Cws1.diff_on_2 = Cws2.diff_on_2; + Cws2.diff_res_1 = Cws1.diff_res_1 + 1/gamma_diff_ws; Cws1.diff_res_2 = Cws2.diff_res_2 + 1/gamma_diff_ws; - Cws1.ftype = Cws2.ftype; - Cws2.Xco2 = Cws1.Xco2; - Cws2.Xh2o = Cws1.Xh2o; - Cws2.Xo2 = Cws1.Xo2; - Cws2.Xso2 = Cws1.Xso2; - ftype_ws = Cws1.ftype; -/* Pressure losses */ + + Cws1.Xi = Cws2.Xi; + Xws = Cws1.Xi; + Cws1.SubC = Cws2.SubC; + SubCws = Cws1.SubC; + + /* Pressure losses */ Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof; Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe; -/* Power exchanged */ + + /* Power exchanged */ W = Qf*(Hef - Hsf); W = Qe*(Hse - Hee); -/* Flue gases specific enthalpy at the inlet */ - Tef = ThermoSysPro.Properties.Fluid.Temperature_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2); -/* Flue gases specific enthalpy at the outlet */ - Tsf = ThermoSysPro.Properties.Fluid.Temperature_Ph(Psf, Hsf, fluid_fg, 0, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2); -/* Flue gases density */ - rhof = ThermoSysPro.Properties.Fluid.Density_Ph(Pef, Hef, fluid_fg, 0, Cfg1.Xco2, Cfg1.Xh2o, Cfg1.Xo2, Cfg1.Xso2); -/* Water/steam thermodynamic properties */ - proee = ThermoSysPro.Properties.Fluid.Ph(Pee, Hee, mode, fluid_ws); - Tee = proee.T; - proem = ThermoSysPro.Properties.Fluid.Ph((Pee + Pse)/2, (Hee + Hse)/2, mode, fluid_ws); - rhoe = proem.d; - proes = ThermoSysPro.Properties.Fluid.Ph(Pse, Hse, mode, fluid_ws); - Tse = proes.T; - (lsat, vsat) = ThermoSysPro.Properties.Fluid.Water_sat_P(Pse, fluid_ws); - Hse = vsat.h; - annotation( - Diagram(graphics = {Rectangle(extent = {{-100, 80}, {100, -80}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Backward), Text(extent = {{-30, 76}, {28, 66}}, lineColor = {0, 0, 0}, lineThickness = 0, fillPattern = FillPattern.HorizontalCylinder, fillColor = {175, 175, 175}, textString = "Flue gases"), Polygon(points = {{-94, 12}, {-80, 12}, {-80, 56}, {80, 56}, {80, 12}, {92, 12}, {92, 6}, {74, 6}, {74, 50}, {-74, 50}, {-74, 6}, {-94, 6}, {-94, 12}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-94, -12}, {-80, -12}, {-80, -56}, {80, -56}, {80, -12}, {92, -12}, {92, -6}, {74, -6}, {74, -50}, {-74, -50}, {-74, -6}, {-94, -6}, {-94, -12}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-114, 28}, {-48, 18}}, lineColor = {0, 0, 0}, lineThickness = 0, fillPattern = FillPattern.HorizontalCylinder, fillColor = {175, 175, 175}, textString = "Water/Steam"), Polygon(points = {{-94, 3}, {90, 3}, {90, -3}, {-94, -3}, {-94, 3}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid)}), - Icon(graphics = {Rectangle(extent = {{-100, -75}, {100, -85}}, lineColor = {175, 175, 175}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 86}, {100, 76}}, lineColor = {175, 175, 175}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-100, 80}, {100, -80}}, lineColor = {175, 175, 175}, lineThickness = 0, fillColor = DynamicSelect({255, 255, 0}, fill_color_static), fillPattern = FillPattern.Backward), Polygon(points = {{-94, 12}, {-80, 12}, {-80, 56}, {80, 56}, {80, 12}, {92, 12}, {92, 6}, {74, 6}, {74, 50}, {-74, 50}, {-74, 6}, {-94, 6}, {-94, 12}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-92, 3}, {92, 3}, {92, -3}, {-92, -3}, {-92, 3}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-94, -12}, {-80, -12}, {-80, -56}, {80, -56}, {80, -12}, {92, -12}, {92, -6}, {74, -6}, {74, -50}, {-74, -50}, {-74, -6}, {-94, -6}, {-94, -12}}, lineColor = {0, 0, 255}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-128, 26}, {-102, 16}}, lineColor = {28, 108, 200}, lineThickness = 0, fillColor = {255, 255, 0}, fillPattern = FillPattern.Backward, textString = "Water"), Text(extent = {{104, 22}, {128, 12}}, lineColor = {255, 0, 0}, lineThickness = 0, fillColor = {255, 255, 0}, fillPattern = FillPattern.Backward, textString = "Steam"), Text(extent = {{-52, -86}, {-14, -98}}, lineColor = {28, 108, 200}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Backward, textString = "Flue gases"), Text(extent = {{-50, 102}, {-14, 86}}, lineColor = {238, 46, 47}, fillColor = {255, 255, 0}, fillPattern = FillPattern.Backward, textString = "Flue gases")}), + + /* Flue gases specific enthalpy at the inlet */ + state_fg_in = Medium_FlueGases.setState_phX(p=Pef, h=Hef, X=Xfg); + Tef = Medium_FlueGases.temperature(state_fg_in); + + /* Flue gases specific enthalpy at the outlet */ + state_fg_out = Medium_FlueGases.setState_phX(p=Psf, h=Hsf, X=Xfg); + Tsf = Medium_FlueGases.temperature(state_fg_out); + + /* Flue gases density */ + rhof = Medium_FlueGases.density(state_fg_in); + + /* Water/steam thermodynamic properties */ + state_ws_in = Medium.setState_phX(p=Pee, h=Hee, X=Xws); + Tee = Medium.temperature(state_ws_in); + + state_ws_m = Medium.setState_phX(p=(Pee + Pse)/2, h=(Hee + Hse)/2, X=Xws); + rhoe = Medium.density(state_ws_m); + + state_ws_out = Medium.setState_phX(p=Pse, h=Hse, X=Xws); + Tse = Medium.temperature(state_ws_out); + + sat_ws = Medium.setSat_p(Pse); + Hse = Medium.dewEnthalpy(sat_ws); + + annotation (Diagram(graphics={ + Rectangle( + extent={{-100,80},{100,-80}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Backward), + Text( + extent={{-30,76},{28,66}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={175,175,175}, + textString= + "Flue gases"), + Polygon( + points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74, + 6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92, + -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-114,28},{-48,18}}, + lineColor={0,0,0}, + lineThickness=0, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={175,175,175}, + textString= + "Water/Steam"), + Polygon( + points={{-94,3},{90,3},{90,-3},{-94,-3},{-94,3}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid)}), + Icon(graphics={ + Rectangle( + extent={{-100,-75},{100,-85}}, + lineColor={175,175,175}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,86},{100,76}}, + lineColor={175,175,175}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,80},{100,-80}}, + lineColor={175,175,175}, + lineThickness=0, + fillColor= DynamicSelect({255,255,0}, fill_color_static), + fillPattern=FillPattern.Backward), + Polygon( + points={{-94,12},{-80,12},{-80,56},{80,56},{80,12},{92,12},{92,6},{74, + 6},{74,50},{-74,50},{-74,6},{-94,6},{-94,12}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-92,3},{92,3},{92,-3},{-92,-3},{-92,3}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-94,-12},{-80,-12},{-80,-56},{80,-56},{80,-12},{92,-12},{92, + -6},{74,-6},{74,-50},{-74,-50},{-74,-6},{-94,-6},{-94,-12}}, + lineColor={0,0,255}, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-128,26},{-102,16}}, + lineColor={28,108,200}, + lineThickness=0, + fillColor={255,255,0}, + fillPattern=FillPattern.Backward, + textString="Water"), + Text( + extent={{104,22},{128,12}}, + lineColor={255,0,0}, + lineThickness=0, + fillColor={255,255,0}, + fillPattern=FillPattern.Backward, + textString="Steam"), + Text( + extent={{-52,-86},{-14,-98}}, + lineColor={28,108,200}, + fillColor={255,255,0}, + fillPattern=FillPattern.Backward, + textString="Flue gases"), + Text( + extent={{-50,102},{-14,86}}, + lineColor={238,46,47}, + fillColor={255,255,0}, + fillPattern=FillPattern.Backward, + textString="Flue gases")}), Documentation(revisions = " Author @@ -129,4 +246,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end SimpleEvaporatorWaterSteamFlueGases; \ No newline at end of file +end SimpleEvaporatorWaterSteamFlueGases; From e1994c30e0448e2d417fcf6512298f2ae567c97a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 16:59:57 +0200 Subject: [PATCH 192/213] #125 port Fluid steam generators medium support onto develop --- .../HeatExchangers/SteamGenerator_1SG.mo | 503 +++++++++++++---- .../HeatExchangers/SteamGenerator_4SG.mo | 510 ++++++++++++++---- 2 files changed, 789 insertions(+), 224 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo index 51b7455b..560db0ae 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo @@ -1,117 +1,400 @@ within ThermoSysPro.Fluid.HeatExchangers; - model SteamGenerator_1SG "Single steam generator" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real H0_Mix_AlimDomeGV = 1194812.89980521; - parameter Boolean inertia = false "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 50.e5 "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean option_temperature = false "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(L = 10.848, D = 0.01687, z2 = 10.848, h(start = {1483455.66417054, 1452982.36179149, 1407381.72335656, 1372666.398393, 1346263.00297153, 1326153.46646787, 1326153}), Ns = 5, dpfCorr = 0.17, hcCorr = 5, ntubes = 5340, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, inertia = inertia, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, option_temperature = option_temperature, P(start = {15548026.576998, 15539261.540558, 15513354.885726, 15479081.11289, 15444819.569988, 15410560.642776, 15395560}), Tp(start = {564, 562, 560, 559, 568})) annotation( - Placement(transformation(origin = {-67, -41.5}, extent = {{30.5, -15}, {-30.5, 15}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg(L = 10.848, D = 0.01687, h(start = {1326153.46646787, 1310848.36111251, 1299218.76228131, 1290360.28876122, 1283604.94388924, 1280654.73156587, 1280654.73156587}), Ns = 5, dpfCorr = 0.17, hcCorr = 5, z1 = 10.848, ntubes = 5340, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, option_temperature = option_temperature, P(start = {15393431.104025, 15393244.26355, 15392971.944187, 15392877.066005, 15392915.646752, 15393000.834432, 15393020}), Tp(start = {584, 580, 575, 571, 568})) annotation( - Placement(transformation(origin = {67, -41.5}, extent = {{30.5, -14}, {-30.5, 14}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV(hl(start = 1257382.15477056), hv(start = 2771260.46625813), cpp = 500, L = 8.625, Cd(P(start = 67.9e5)), zl(fixed = false, start = 0.66), R = 4.2818979, Mp = 32000, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, Vf0 = Vf0, P0 = P0, wsftype = wsftype) annotation( - Placement(transformation(extent = {{-22, 64}, {22, 107}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV(h0 = H0_Mix_AlimDomeGV, h(start = 1194851.37111438), V = 0.01, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, dynamic_mass_balance = dynamic_mass_balance, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, ftype = ftype) " " annotation( - Placement(transformation(origin = {94, 63}, extent = {{-8, -8}, {8, 8}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(K = 1e-4) annotation( - Placement(transformation(origin = {94, 88}, extent = {{-6, -7}, {6, 7}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(p_rho = 0, C2(P(start = 6829391.22090726), Q(fixed = false, start = 6643)), K = 0.172144) annotation( - Placement(transformation(extent = {{53, 53}, {63, 73}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim annotation( - Placement(transformation(origin = {99, 26}, extent = {{-6, -6}, {6, 6}}, rotation = 270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI annotation( - Placement(transformation(extent = {{-10, 139}, {10, 159}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation( - Placement(transformation(extent = {{42, 102}, {62, 122}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation( - Placement(transformation(extent = {{-56, -132}, {-36, -112}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1 annotation( - Placement(transformation(extent = {{36, -132}, {56, -112}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal annotation( - Placement(transformation(extent = {{-42, 86}, {-62, 106}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV(p_rho = 0, h(start = 1194851.3), z1 = 10.8, C1(h_vol_1(start = 1.1733e6), h(start = 1.1733e6), Q(start = 7525.84), P(start = 6829391.22090726)), L = 10.8, D = 0.216, C2(h_vol_1(start = 1.1733e6), Q(start = 7525.84), h(start = 1.1733e6), P(fixed = false, start = 68.4935e5)), lambda = 0.08, ntubes = 32, Q(start = 7525.84/4), inertia = inertia) "DownComerGV" annotation( - Placement(transformation(origin = {94.5, -41}, extent = {{-31, 16.5}, {31, -16.5}}, rotation = 270))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(L = 10.848, D = 0.01687, e = 2.18e-3, lambda = 23, cpw = 503, rhow = 8430, Ns = 5, ntubes = 5340, dynamic_energy_balance = dynamic_energy_balance, Tp(start = {571, 568, 566, 564, 562})) annotation( - Placement(transformation(origin = {-44, -41}, extent = {{-33, -16}, {33, 16}}, rotation = 270))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(L = 10.848, D = 0.01687, e = 2.18e-3, lambda = 23, cpw = 503, rhow = 8430, Ns = 5, ntubes = 5340, dynamic_energy_balance = dynamic_energy_balance, Tp(start = {563, 560, 558, 557, 556})) annotation( - Placement(transformation(origin = {44, -41}, extent = {{-33, 16}, {33, -16}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(Ns = 5, h(start = {1194851.37008144, 1260885.3160958, 1364323.64228458, 1450411.24087846, 1525552.01981793, 1595519.78942018, 1595519.78863864}), D = 0.03689, L = 10.848, z2 = 10.848, hcCorr = 5, dpfCorr = 1, ntubes = 5340, Q(start = {8600/4, 8600/4, 8600/4, 8600/4, 8600/4, 8600/4}), inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, option_temperature = option_temperature, P(start = {6866734.6044951, 6862203.9025063, 6853535.2456408, 6846247.0825137, 6840314.8313501, 6834912.1497303, 6828884.4924605}), Tp1(start = {563.83109489963, 562.97171435789, 562.21322867383, 561.55248247184, 560.97588254902}), Tp2(start = {563.83109489963, 562.97171435789, 562.21322867383, 561.55248247184, 560.97588254902})) annotation( - Placement(transformation(origin = {-2.5, -41}, extent = {{-32, 31.5}, {32, -31.5}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeA(h0 = 1185.2e3, dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, dynamic_mass_balance = dynamic_mass_balance, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, ftype = ftype, P0 = 6849350) annotation( - Placement(transformation(origin = {1, -90}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeA1(dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, dynamic_mass_balance = dynamic_mass_balance, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, ftype = ftype) annotation( - Placement(transformation(origin = {0, 18}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the secondary water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Primary = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the primary side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real H0_Mix_AlimDomeGV=1194812.89980521; + parameter Boolean inertia=false + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=50.e5 + "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean option_temperature=false + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +public + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg( + redeclare package Medium = Medium_Primary, + L=10.848, + D=0.01687, + z2=10.848, + h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393, + 1346263.00297153,1326153.46646787,1326153}), + Ns=5, + dpfCorr=0.17, + hcCorr=5, + ntubes=5340, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + inertia=inertia, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + option_temperature=option_temperature, + P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988, + 15410560.642776,15395560}), + Tp(start={564,562,560,559,568})) + annotation (Placement(transformation( + origin={-67,-41.5}, + extent={{30.5,-15},{-30.5,15}}, + rotation=270))); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg( + redeclare package Medium = Medium_Primary, + L=10.848, + D=0.01687, + h(start={1326153.46646787,1310848.36111251,1299218.76228131, + 1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}), + Ns=5, + dpfCorr=0.17, + hcCorr=5, + z1=10.848, + ntubes=5340, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + option_temperature=option_temperature, + P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752, + 15393000.834432,15393020}), + Tp(start={584,580,575,571,568})) + annotation (Placement(transformation( + origin={67,-41.5}, + extent={{30.5,-14},{-30.5,14}}, + rotation=90))); + + ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV( + redeclare package Medium = Medium, + hl(start=1257382.15477056), + hv(start=2771260.46625813), + cpp=500, + L=8.625, + Cd(P(start=67.9e5)), + zl(fixed=false, start=0.66), + R=4.2818979, + Mp=32000, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + Vf0=Vf0, + P0=P0) + annotation (Placement(transformation(extent={{-22,64},{22,107}}, + rotation=0))); protected - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(L = 1, D = 0.95886, lambda = 0.03, inertia = inertia) annotation( - Placement(transformation(origin = {0, 42}, extent = {{-5, -10}, {5, 10}}, rotation = 90))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone( + redeclare package Medium = Medium, + L=1, + D=0.95886, + lambda=0.03, + inertia=inertia) + annotation (Placement(transformation( + origin={0,42}, + extent={{-5,-10},{5,10}}, + rotation=90))); +public + ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV( + redeclare package Medium = Medium, + h0=H0_Mix_AlimDomeGV, + h(start=1194851.37111438), + V=0.01, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + dynamic_mass_balance=dynamic_mass_balance, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) " " + annotation (Placement(transformation( + origin={94,63}, + extent={{-8,-8},{8,8}}, + rotation=270))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc( + redeclare package Medium = Medium, + K=1e-4) + annotation (Placement(transformation( + origin={94,88}, + extent={{-6,-7},{6,7}}, + rotation=270))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc( + redeclare package Medium = Medium, + p_rho=0, + C2(P(start=6829391.22090726), Q(fixed=false, start=6643)), + K=0.172144) annotation (Placement(transformation(extent={{53,53}, + {63,73}}, rotation=0))); + +public + ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim(redeclare package Medium = Medium) + annotation (Placement(transformation( + origin={99,26}, + extent={{-6,-6},{6,6}}, + rotation=270))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{42,102},{62,122}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1(redeclare package Medium = Medium_Primary) annotation ( + Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1(redeclare package Medium = Medium_Primary) + annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation= + 0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal + annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation= + 0))); +public + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV( + redeclare package Medium = Medium, + p_rho=0, + h(start=1194851.3), + z1=10.8, + C1( + h_vol_1(start=1.1733e6), + h(start=1.1733e6), + Q(start=7525.84), + P(start=6829391.22090726)), + L=10.8, + D=0.216, + C2( + h_vol_1(start=1.1733e6), + Q(start=7525.84), + h(start=1.1733e6), + P(fixed=false, start=68.4935e5)), + lambda=0.08, + ntubes=32, + Q(start=7525.84/4), + inertia=inertia) "DownComerGV" annotation (Placement(transformation( + origin={94.5,-41}, + extent={{-31,16.5},{31,-16.5}}, + rotation=270))); + Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( + L=10.848, + D=0.01687, + e=2.18e-3, + lambda=23, + cpw=503, + rhow=8430, + Ns=5, + ntubes=5340, + dynamic_energy_balance=dynamic_energy_balance, + Tp(start={571,568,566,564,562})) + annotation (Placement(transformation( + origin={-44,-41}, + extent={{-33,-16},{33,16}}, + rotation=270))); + Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1( + L=10.848, + D=0.01687, + e=2.18e-3, + lambda=23, + cpw=503, + rhow=8430, + Ns=5, + ntubes=5340, + dynamic_energy_balance=dynamic_energy_balance, + Tp(start={563,560,558,557,556})) + annotation (Placement(transformation( + origin={44,-41}, + extent={{-33,16},{33,-16}}, + rotation=270))); + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV( + redeclare package Medium = Medium, + Ns=5, + h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846, + 1525552.01981793,1595519.78942018,1595519.78863864}), + D=0.03689, + L=10.848, + z2=10.848, + hcCorr=5, + dpfCorr=1, + ntubes=5340, + Q(start={8600/4,8600/4,8600/4,8600/4,8600/4,8600/4}), + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + option_temperature=option_temperature, + P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501, + 6834912.1497303,6828884.4924605}), + Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}), + Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902})) + annotation (Placement( + transformation( + origin={-2.5,-41}, + extent={{-32,31.5},{32,-31.5}}, + rotation=90))); + + ThermoSysPro.Fluid.Volumes.VolumeC volumeA( + redeclare package Medium = Medium, + h0=1185.2e3, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + dynamic_mass_balance=dynamic_mass_balance, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + P0=6849350) annotation (Placement(transformation( + origin={1,-90}, + extent={{-10,-10},{10,10}}, + rotation=90))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeA1( + redeclare package Medium = Medium, + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + dynamic_mass_balance=dynamic_mass_balance, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) annotation ( + Placement(transformation( + origin={0,18}, + extent={{-10,-10},{10,10}}, + rotation=90))); equation - connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation( - Line(points = {{-67, -11}, {-67, -2}, {67, -2}, {67, -11}}, color = {127, 0, 0}, thickness = 0.5)); - connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2) annotation( - Line(points = {{94, 71}, {94, 82}}, thickness = 0.5)); - connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation( - Line(points = {{63, 63}, {86, 63}}, color = {0, 0, 255}, thickness = 0.5)); - connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation( - Line(points = {{94, 55}, {94.2, 32}}, color = {0, 0, 255}, thickness = 0.5)); - connect(DPnulle_AlimDwnc.C1, fluidInlet) annotation( - Line(points = {{94, 94}, {94, 100.5}, {52, 100.5}, {52, 112}})); - connect(fluidInlet1, UtubeHotLeg.C1) annotation( - Line(points = {{-46, -122}, {-66, -122}, {-66, -72}, {-67, -72}}, color = {127, 0, 0}, thickness = 0.5)); - connect(UtubeColdtLeg.C2, fluidOutletI1) annotation( - Line(points = {{67, -72}, {68, -78}, {68, -122}, {46, -122}}, color = {127, 0, 0}, thickness = 0.5)); - connect(CapteurPAlim.C2, DownComerGV.C1) annotation( - Line(points = {{94.2, 19.88}, {94.2, 20}, {94, 20}, {94, 6}, {94.5, 6}, {94.5, -10}}, color = {0, 0, 255}, thickness = 0.5)); - connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation( - Line(points = {{-62.5, -41.5}, {-57.25, -41.5}, {-57.25, -41}, {-47.2, -41}}, color = {191, 95, 0}, thickness = 0.5)); - connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation( - Line(points = {{47.2, -41}, {58, -41}, {58, -41.5}, {62.8, -41.5}}, color = {191, 95, 0}, thickness = 0.5)); - connect(DownComerGV.C2, volumeA.Ce1) annotation( - Line(points = {{94.5, -72}, {94.5, -108}, {1, -108}, {1, -100}}, color = {0, 0, 255})); - connect(volumeA.Cs, RiserGV.C1) annotation( - Line(points = {{1, -80}, {0.65, -80}, {0.65, -73}}, color = {0, 0, 255})); - connect(RiserGV.C2, volumeA1.Ce1) annotation( - Line(points = {{0.65, -9}, {-6.12303e-016, -9}, {-6.12303e-016, 8}}, color = {0, 0, 255})); - connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation( - Line(points = {{6.12303e-016, 28}, {-6.12303e-016, 28}, {-6.12303e-016, 37}}, color = {0, 0, 255})); - connect(heatExchangerWall.WT2, RiserGV.CTh2) annotation( - Line(points = {{-40.8, -41}, {-18.25, -41}}, color = {191, 95, 0})); - connect(RiserGV.CTh1, heatExchangerWall1.WT2) annotation( - Line(points = {{19.55, -41}, {40.8, -41}}, color = {191, 95, 0})); - connect(DomeGV.Cv, fluidOutletI) annotation( - Line(points = {{22, 107}, {22, 124}, {0, 124}, {0, 149}}, color = {255, 0, 0})); - connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation( - Line(points = {{6.12303e-016, 47}, {6.12303e-016, 52}, {22, 52}, {22, 64}}, color = {0, 0, 255})); - connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation( - Line(points = {{22, 76.9}, {40, 76.9}, {40, 63}, {53, 63}}, color = {0, 0, 255})); - connect(DomeGV.yLevel, outputReal) annotation( - Line(points = {{24.2, 85.5}, {32, 85.5}, {32, 114}, {-36, 114}, {-36, 96}, {-52, 96}}, color = {0, 0, 255})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-150, -150}, {150, 150}}, initialScale = 0.1), graphics = {Text(extent = {{55, 81}, {55, 75}}, lineColor = {0, 0, 255}, textString = "petit DP"), Text(extent = {{-126, 153}, {-84, 123}}, lineColor = {0, 0, 255}, textString = "= 1GV")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-150, -150}, {150, 150}}, initialScale = 0.1), graphics = {Ellipse(extent = {{-42, 150}, {42, 108}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {0, 128, 255}), Rectangle(extent = {{-42, 131}, {42, 80}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {0, 128, 255}), Ellipse(extent = {{-36, -108}, {36, -150}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {0, 128, 255}), Rectangle(extent = {{-42, 86}, {42, 56}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {170, 213, 255}), Rectangle(extent = {{-36, 42}, {36, -128}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {170, 213, 255}), Polygon(points = {{-42, 56}, {42, 56}, {36, 42}, {-36, 42}, {-42, 56}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {170, 213, 255})}), + connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line( + points={{-67,-11},{-67,-2},{67,-2},{67,-11}}, + color={127,0,0}, + thickness=0.5)); + connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2) + annotation (Line(points={{94,71},{94,82}}, thickness=0.5)); + connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line( + points={{63,63},{86,63}}, + color={0,0,255}, + thickness=0.5)); + connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line( + points={{94,55},{94.2,32}}, + color={0,0,255}, + thickness=0.5)); + connect(DPnulle_AlimDwnc.C1, fluidInlet) + annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}})); + connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line( + points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}}, + color={127,0,0}, + thickness=0.5)); + connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line( + points={{67,-72},{68,-78},{68,-122},{46,-122}}, + color={127,0,0}, + thickness=0.5)); + connect(CapteurPAlim.C2, DownComerGV.C1) annotation (Line( + points={{94.2,19.88},{94.2,20},{94,20},{94,6},{94.5,6},{94.5,-10}}, + color={0,0,255}, + thickness=0.5)); + connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line( + points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}}, + color={191,95,0}, + thickness=0.5)); + connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line( + points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}}, + color={191,95,0}, + thickness=0.5)); + connect(DownComerGV.C2, volumeA.Ce1) annotation (Line(points={{94.5,-72}, + {94.5,-108},{1,-108},{1,-100}}, color={0,0,255})); + connect(volumeA.Cs, RiserGV.C1) + annotation (Line(points={{1,-80},{0.65,-80},{ + 0.65,-73}}, color={0,0,255})); + connect(RiserGV.C2, volumeA1.Ce1) + annotation (Line(points={{0.65,-9},{ + -6.12303e-016,-9},{-6.12303e-016,8}}, color={0,0,255})); + connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{ + 6.12303e-016,28},{-6.12303e-016,28},{-6.12303e-016,37}}, color={0,0, + 255})); + connect(heatExchangerWall.WT2, RiserGV.CTh2) + annotation (Line(points={{-40.8, + -41},{-18.25,-41}}, color={191,95,0})); + connect(RiserGV.CTh1, heatExchangerWall1.WT2) + annotation (Line(points={{19.55, + -41},{40.8,-41}}, color={191,95,0})); + connect(DomeGV.Cv, fluidOutletI) annotation (Line(points={{22,107},{22,124},{ + 0,124},{0,149}}, color={255,0,0})); + connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{ + 6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255})); + connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40, + 76.9},{40,63},{53,63}}, color={0,0,255})); + connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5}, + {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255})); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-150,-150},{150,150}}, + initialScale=0.1), graphics={Text( + extent={{55,81},{55,75}}, + lineColor={0,0,255}, + textString= + "petit DP"), Text( + extent={{-126,153},{-84,123}}, + lineColor={0,0,255}, + textString= + "= 1GV")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-150,-150},{150,150}}, + initialScale=0.1), graphics={ + Ellipse( + extent={{-42,150},{42,108}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={0,128,255}), + Rectangle( + extent={{-42,131},{42,80}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={0,128,255}), + Ellipse( + extent={{-36,-108},{36,-150}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={0,128,255}), + Rectangle( + extent={{-42,86},{42,56}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={170,213,255}), + Rectangle( + extent={{-36,42},{36,-128}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={170,213,255}), + Polygon( + points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={170,213,255})}), Documentation(revisions = " Author @@ -121,4 +404,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end SteamGenerator_1SG; \ No newline at end of file +end SteamGenerator_1SG; diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo index 5bf8a9e0..570e0781 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo @@ -1,121 +1,403 @@ within ThermoSysPro.Fluid.HeatExchangers; - model SteamGenerator_4SG "Single steam generator equivalent to four steam generators" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Real H0_Mix_AlimDomeGV = 1194812.89980521; - parameter Boolean inertia = false "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection = false "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance = true "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance = true "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance = true "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state = true "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance)); - parameter Real Vf0 = 0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0 = 50.e5 "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = dynamic_energy_balance and not steady_state)); - parameter Boolean option_temperature = false "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation( - Evaluate = true, - Dialog(enable = not steady_state)); - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(L = 10.848, D = 0.01687, z2 = 10.848, h(start = {1483455.66417054, 1452982.36179149, 1407381.72335656, 1372666.398393, 1346263.00297153, 1326153.46646787, 1326153}), Ns = 5, ntubes = 21360, dpfCorr = 0.17, hcCorr = 5, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, P(start = {15548026.576998, 15539261.540558, 15513354.885726, 15479081.11289, 15444819.569988, 15410560.642776, 15395560}), Tp(start = {564, 562, 560, 559, 568})) annotation( - Placement(transformation(origin = {-67, -41.5}, extent = {{30.5, -15}, {-30.5, 15}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg(L = 10.848, D = 0.01687, z1 = 10.848, h(start = {1326153.46646787, 1310848.36111251, 1299218.76228131, 1290360.28876122, 1283604.94388924, 1280654.73156587, 1280654.73156587}), ntubes = 21360, dpfCorr = 0.17, hcCorr = 5, Ns = 5, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, P(start = {15393431.104025, 15393244.26355, 15392971.944187, 15392877.066005, 15392915.646752, 15393000.834432, 15393020}), Tp(start = {584, 580, 575, 571, 568})) annotation( - Placement(transformation(origin = {67, -41.5}, extent = {{30.5, -14}, {-30.5, 14}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV(hl(start = 1257382.15477056), hv(start = 2771260.46625813), Mp = 32000, cpp = 500, R = 4.2818979, L = 8.625, Cd(P(start = 67.9e5)), zl(fixed = false, start = 0.66), dynamic_energy_balance = dynamic_energy_balance, steady_state = steady_state, Vf0 = Vf0, P0 = P0, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, wsftype = wsftype) annotation( - Placement(transformation(extent = {{-22, 64}, {22, 107}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV(h0 = H0_Mix_AlimDomeGV, h(start = 1194851.37111438), V = 0.01, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, ftype = ftype) " " annotation( - Placement(transformation(origin = {94, 63}, extent = {{-8, -8}, {8, 8}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(K = 1e-4, rho(start = 839)) annotation( - Placement(transformation(origin = {94, 88}, extent = {{-6, -7}, {6, 7}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(p_rho = 0, C2(P(start = 6829391.22090726), Q(fixed = false, start = 6643)), K = 0.172144, rho(start = 742)) annotation( - Placement(transformation(extent = {{53, 53}, {63, 73}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim annotation( - Placement(transformation(origin = {99, 26}, extent = {{-6, -6}, {6, 6}}, rotation = 270))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI annotation( - Placement(transformation(extent = {{-10, 139}, {10, 159}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet annotation( - Placement(transformation(extent = {{42, 102}, {62, 122}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1 annotation( - Placement(transformation(extent = {{-56, -132}, {-36, -112}}, rotation = 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1 annotation( - Placement(transformation(extent = {{36, -132}, {56, -112}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal annotation( - Placement(transformation(extent = {{-42, 86}, {-62, 106}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV(p_rho = 0, h(start = 1194851.3), z1 = 10.8, C1(h_vol_1(start = 1.1733e6), h(start = 1.1733e6), Q(start = 7525.84), P(start = 6829391.22090726)), Q(start = 7525.84), L = 10.8, D = 0.216, ntubes = 128, C2(h_vol_1(start = 1.1733e6), Q(start = 7525.84), h(start = 1.1733e6), P(fixed = false, start = 68.4935e5)), lambda = 0.08, inertia = inertia) "DownComerGV" annotation( - Placement(transformation(origin = {94.5, -41}, extent = {{-31, 16.5}, {31, -16.5}}, rotation = 270))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(L = 10.848, D = 0.01687, e = 2.18e-3, lambda = 23, cpw = 503, rhow = 8430, ntubes = 21360, Ns = 5, dynamic_energy_balance = dynamic_energy_balance, Tp(start = {571, 568, 566, 564, 562})) annotation( - Placement(transformation(origin = {-44, -41}, extent = {{-33, -16}, {33, 16}}, rotation = 270))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(L = 10.848, D = 0.01687, e = 2.18e-3, lambda = 23, cpw = 503, rhow = 8430, ntubes = 21360, Ns = 5, dynamic_energy_balance = dynamic_energy_balance, Tp(start = {563, 560, 558, 557, 556})) annotation( - Placement(transformation(origin = {44, -41}, extent = {{-33, 16}, {33, -16}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(Ns = 5, Q(start = {8600, 8600, 8600, 8600, 8600, 8600}), h(start = {1194851.37008144, 1260885.3160958, 1364323.64228458, 1450411.24087846, 1525552.01981793, 1595519.78942018, 1595519.78863864}), D = 0.03689, ntubes = 22056, L = 10.848, z2 = 10.848, hcCorr = 5, inertia = inertia, advection = advection, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, simplified_dynamic_energy_balance = simplified_dynamic_energy_balance, steady_state = steady_state, option_temperature = option_temperature, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, P(start = {6866734.6044951, 6862203.9025063, 6853535.2456408, 6846247.0825137, 6840314.8313501, 6834912.1497303, 6828884.4924605}), Tp1(start = {563.83109489963, 562.97171435789, 562.21322867383, 561.55248247184, 560.97588254902}), Tp2(start = {563.83109489963, 562.97171435789, 562.21322867383, 561.55248247184, 560.97588254902})) annotation( - Placement(transformation(origin = {-2.5, -41}, extent = {{-32, 31.5}, {32, -31.5}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeA(h0 = 1185.2e3, dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, ftype = ftype, P0 = 6849350) annotation( - Placement(transformation(origin = {0.5, -92}, extent = {{-8, -8.5}, {8, 8.5}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeA1(dynamic_energy_balance = dynamic_energy_balance, dynamic_mass_balance = dynamic_mass_balance, steady_state = steady_state, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, ftype = ftype) annotation( - Placement(transformation(origin = {-0.5, 17}, extent = {{-9, -9.5}, {9, 9.5}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Vapeur(K = 1e-4, Q(start = 2113)) annotation( - Placement(transformation(origin = {-0.5, 124}, extent = {{6, -6.5}, {-6, 6.5}}, rotation = 270))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the secondary water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_Primary = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the primary side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Real H0_Mix_AlimDomeGV=1194812.89980521; + parameter Boolean inertia=false + "true: momentum balance equation with inertia - false: without inertia"; + parameter Boolean advection=false + "true: momentum balance equation with advection terme - false: without advection terme"; + parameter Boolean dynamic_energy_balance=true + "true: dynamic energy balance equation - false: static energy balance equation"; + parameter Boolean dynamic_mass_balance=true + "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Boolean simplified_dynamic_energy_balance=true + "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); + parameter Boolean steady_state=true + "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); + parameter Real Vf0=0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); + parameter Units.SI.AbsolutePressure P0=50.e5 + "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)" + annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not + steady_state)); + parameter Boolean option_temperature=false + "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); + parameter Boolean continuous_flow_reversal=false + "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false + "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +public + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg( + redeclare package Medium = Medium_Primary, + L=10.848, + D=0.01687, + z2=10.848, + h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393, + 1346263.00297153,1326153.46646787,1326153}), + Ns=5, + ntubes=21360, + dpfCorr=0.17, + hcCorr=5, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988, + 15410560.642776,15395560}), + Tp(start={564,562,560,559,568})) + annotation (Placement(transformation( + origin={-67,-41.5}, + extent={{30.5,-15},{-30.5,15}}, + rotation=270))); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg( + redeclare package Medium = Medium_Primary, + L=10.848, + D=0.01687, + z1=10.848, + h(start={1326153.46646787,1310848.36111251,1299218.76228131, + 1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}), + ntubes=21360, + dpfCorr=0.17, + hcCorr=5, + Ns=5, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752, + 15393000.834432,15393020}), + Tp(start={584,580,575,571,568})) + annotation (Placement(transformation( + origin={67,-41.5}, + extent={{30.5,-14},{-30.5,14}}, + rotation=90))); + + ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV( + redeclare package Medium = Medium, + hl(start=1257382.15477056), + hv(start=2771260.46625813), + Mp=32000, + cpp=500, + R=4.2818979, + L=8.625, + Cd(P(start=67.9e5)), + zl(fixed=false, start=0.66), + dynamic_energy_balance=dynamic_energy_balance, + steady_state=steady_state, + Vf0=Vf0, + P0=P0, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) annotation (Placement(transformation(extent={{ + -22,64},{22,107}}, rotation=0))); protected - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(L = 1, D = 0.95886, lambda = 0.03, inertia = inertia) annotation( - Placement(transformation(origin = {0, 39.5}, extent = {{-7.5, -10}, {7.5, 10}}, rotation = 90))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone( + redeclare package Medium = Medium, + L=1, + D=0.95886, + lambda=0.03, + inertia=inertia) + annotation (Placement(transformation( + origin={0,39.5}, + extent={{-7.5,-10},{7.5,10}}, + rotation=90))); +public + ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV( + redeclare package Medium = Medium, + h0=H0_Mix_AlimDomeGV, + h(start=1194851.37111438), + V=0.01, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) " " + annotation (Placement(transformation( + origin={94,63}, + extent={{-8,-8},{8,8}}, + rotation=270))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc( + redeclare package Medium = Medium, K=1e-4, rho(start=839)) + annotation (Placement(transformation( + origin={94,88}, + extent={{-6,-7},{6,7}}, + rotation=270))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc( + redeclare package Medium = Medium, + p_rho=0, + C2(P(start=6829391.22090726), Q(fixed=false, start=6643)), + K=0.172144, + rho(start=742)) annotation (Placement(transformation(extent= + {{53,53},{63,73}}, rotation=0))); + +public + ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim(redeclare package Medium = Medium) + annotation (Placement(transformation( + origin={99,26}, + extent={{-6,-6},{6,6}}, + rotation=270))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet(redeclare package Medium = Medium) annotation ( + Placement(transformation(extent={{42,102},{62,122}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1(redeclare package Medium = Medium_Primary) annotation ( + Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1(redeclare package Medium = Medium_Primary) + annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation= + 0))); + ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal + annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation= + 0))); +public + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV( + redeclare package Medium = Medium, + p_rho=0, + h(start=1194851.3), + z1=10.8, + C1( + h_vol_1(start=1.1733e6), + h(start=1.1733e6), + Q(start=7525.84), + P(start=6829391.22090726)), + Q(start=7525.84), + L=10.8, + D=0.216, + ntubes=128, + C2( + h_vol_1(start=1.1733e6), + Q(start=7525.84), + h(start=1.1733e6), + P(fixed=false, start=68.4935e5)), + lambda=0.08, + inertia=inertia) + "DownComerGV" annotation (Placement(transformation( + origin={94.5,-41}, + extent={{-31,16.5},{31,-16.5}}, + rotation=270))); + Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( + L=10.848, + D=0.01687, + e=2.18e-3, + lambda=23, + cpw=503, + rhow=8430, + ntubes=21360, + Ns=5, + dynamic_energy_balance=dynamic_energy_balance, + Tp(start={571,568,566,564,562})) + annotation (Placement(transformation( + origin={-44,-41}, + extent={{-33,-16},{33,16}}, + rotation=270))); + Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1( + L=10.848, + D=0.01687, + e=2.18e-3, + lambda=23, + cpw=503, + rhow=8430, + ntubes=21360, + Ns=5, + dynamic_energy_balance=dynamic_energy_balance, + Tp(start={563,560,558,557,556})) + annotation (Placement(transformation( + origin={44,-41}, + extent={{-33,16},{33,-16}}, + rotation=270))); + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV( + redeclare package Medium = Medium, + Ns=5, + Q(start={8600,8600,8600,8600,8600,8600}), + h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846, + 1525552.01981793,1595519.78942018,1595519.78863864}), + D=0.03689, + ntubes=22056, + L=10.848, + z2=10.848, + hcCorr=5, + inertia=inertia, + advection=advection, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, + steady_state=steady_state, + option_temperature=option_temperature, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501, + 6834912.1497303,6828884.4924605}), + Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}), + Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902})) + annotation (Placement(transformation( + origin={-2.5,-41}, + extent={{-32,31.5},{32,-31.5}}, + rotation=90))); + + ThermoSysPro.Fluid.Volumes.VolumeC volumeA( + redeclare package Medium = Medium, + h0=1185.2e3, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + P0=6849350) annotation (Placement(transformation( + origin={0.5,-92}, + extent={{-8,-8.5},{8,8.5}}, + rotation=90))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeA1( + redeclare package Medium = Medium, + dynamic_energy_balance=dynamic_energy_balance, + dynamic_mass_balance=dynamic_mass_balance, + steady_state=steady_state, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion) annotation ( + Placement(transformation( + origin={-0.5,17}, + extent={{-9,-9.5},{9,9.5}}, + rotation=90))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Vapeur(redeclare package Medium = Medium, K= + 1e-4, Q(start=2113)) + annotation (Placement(transformation( + origin={-0.5,124}, + extent={{6,-6.5},{-6,6.5}}, + rotation=270))); equation - connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation( - Line(points = {{-67, -11}, {-67, -2}, {67, -2}, {67, -11}}, color = {127, 0, 0}, thickness = 0.5)); - connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2) annotation( - Line(points = {{94, 71}, {94, 82}}, thickness = 0.5)); - connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation( - Line(points = {{63, 63}, {86, 63}}, color = {0, 0, 255}, thickness = 0.5)); - connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation( - Line(points = {{94, 55}, {94.2, 32}}, color = {0, 0, 255}, thickness = 0.5)); - connect(DPnulle_AlimDwnc.C1, fluidInlet) annotation( - Line(points = {{94, 94}, {94, 100.5}, {52, 100.5}, {52, 112}})); - connect(fluidInlet1, UtubeHotLeg.C1) annotation( - Line(points = {{-46, -122}, {-66, -122}, {-66, -72}, {-67, -72}}, color = {127, 0, 0}, thickness = 0.5)); - connect(UtubeColdtLeg.C2, fluidOutletI1) annotation( - Line(points = {{67, -72}, {68, -78}, {68, -122}, {46, -122}}, color = {127, 0, 0}, thickness = 0.5)); - connect(CapteurPAlim.C2, DownComerGV.C1) annotation( - Line(points = {{94.2, 19.88}, {94.2, 18}, {94, 18}, {94, 4}, {94.5, 4}, {94.5, -10}}, color = {0, 0, 255}, thickness = 0.5)); - connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation( - Line(points = {{-62.5, -41.5}, {-57.25, -41.5}, {-57.25, -41}, {-47.2, -41}}, color = {191, 95, 0}, thickness = 0.5)); - connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation( - Line(points = {{47.2, -41}, {58, -41}, {58, -41.5}, {62.8, -41.5}}, color = {191, 95, 0}, thickness = 0.5)); - connect(DownComerGV.C2, volumeA.Ce1) annotation( - Line(points = {{94.5, -72}, {94.5, -108}, {0.5, -108}, {0.5, -100}}, color = {0, 0, 255})); - connect(volumeA.Cs, RiserGV.C1) annotation( - Line(points = {{0.5, -84}, {0.65, -84}, {0.65, -73}}, color = {0, 0, 255})); - connect(RiserGV.C2, volumeA1.Ce1) annotation( - Line(points = {{0.65, -9}, {-0.5, -9}, {-0.5, 8}}, color = {0, 0, 255})); - connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation( - Line(points = {{-0.5, 26}, {-6.12303e-016, 26}, {-6.12303e-016, 32}}, color = {0, 0, 255})); - connect(heatExchangerWall.WT2, RiserGV.CTh2) annotation( - Line(points = {{-40.8, -41}, {-18.25, -41}}, color = {191, 95, 0})); - connect(RiserGV.CTh1, heatExchangerWall1.WT2) annotation( - Line(points = {{19.55, -41}, {30, -41}, {40.8, -41}}, color = {191, 95, 0})); - connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation( - Line(points = {{6.12303e-016, 47}, {6.12303e-016, 52}, {22, 52}, {22, 64}}, color = {0, 0, 255})); - connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation( - Line(points = {{22, 76.9}, {40, 76.9}, {40, 63}, {53, 63}}, color = {0, 0, 255})); - connect(DomeGV.Cv, DPnulle_Vapeur.C1) annotation( - Line(points = {{22, 107}, {22, 118}, {-0.5, 118}}, color = {255, 0, 0})); - connect(DPnulle_Vapeur.C2, fluidOutletI) annotation( - Line(points = {{-0.5, 130}, {0, 130}, {0, 149}}, color = {255, 0, 0})); - connect(DomeGV.yLevel, outputReal) annotation( - Line(points = {{24.2, 85.5}, {32, 85.5}, {32, 114}, {-36, 114}, {-36, 96}, {-52, 96}}, color = {0, 0, 255})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-150, -150}, {150, 150}}, initialScale = 0.1), graphics = {Text(extent = {{55, 81}, {55, 75}}, lineColor = {0, 0, 255}, textString = "petit DP"), Text(extent = {{-126, 153}, {-84, 123}}, lineColor = {0, 0, 255}, textString = "= 4GV")}), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-150, -150}, {150, 150}}, initialScale = 0.1), graphics = {Ellipse(extent = {{-42, 150}, {42, 108}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {0, 128, 255}), Rectangle(extent = {{-42, 131}, {42, 80}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {0, 128, 255}), Ellipse(extent = {{-36, -108}, {36, -150}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {0, 128, 255}), Rectangle(extent = {{-42, 86}, {42, 56}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {170, 213, 255}), Rectangle(extent = {{-36, 42}, {36, -128}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {170, 213, 255}), Polygon(points = {{-42, 56}, {42, 56}, {36, 42}, {-36, 42}, {-42, 56}}, lineColor = {0, 0, 0}, fillPattern = DynamicSelect(FillPattern.VerticalCylinder, if dynamic_energy_balance then FillPattern.VerticalCylinder else FillPattern.Solid), fillColor = {170, 213, 255})}), + connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line( + points={{-67,-11},{-67,-2},{67,-2},{67,-11}}, + color={127,0,0}, + thickness=0.5)); + connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2) + annotation (Line(points={{94,71},{94,82}}, thickness=0.5)); + connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line( + points={{63,63},{86,63}}, + color={0,0,255}, + thickness=0.5)); + connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line( + points={{94,55},{94.2,32}}, + color={0,0,255}, + thickness=0.5)); + connect(DPnulle_AlimDwnc.C1, fluidInlet) + annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}})); + connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line( + points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}}, + color={127,0,0}, + thickness=0.5)); + connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line( + points={{67,-72},{68,-78},{68,-122},{46,-122}}, + color={127,0,0}, + thickness=0.5)); + connect(CapteurPAlim.C2, DownComerGV.C1) annotation (Line( + points={{94.2,19.88},{94.2,18},{94,18},{94,4},{94.5,4},{94.5,-10}}, + color={0,0,255}, + thickness=0.5)); + connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line( + points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}}, + color={191,95,0}, + thickness=0.5)); + connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line( + points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}}, + color={191,95,0}, + thickness=0.5)); + connect(DownComerGV.C2, volumeA.Ce1) annotation (Line(points={{94.5,-72}, + {94.5,-108},{0.5,-108},{0.5,-100}}, color={0,0,255})); + connect(volumeA.Cs, RiserGV.C1) + annotation (Line(points={{0.5,-84},{0.65,-84},{ + 0.65,-73}}, color={0,0,255})); + connect(RiserGV.C2, volumeA1.Ce1) + annotation (Line(points={{0.65,-9},{-0.5,-9},{ + -0.5,8}}, color={0,0,255})); + connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{-0.5,26}, + {-6.12303e-016,26},{-6.12303e-016,32}}, color={0,0, + 255})); + connect(heatExchangerWall.WT2, RiserGV.CTh2) + annotation (Line(points={{-40.8, + -41},{-18.25,-41}}, color={191,95,0})); + connect(RiserGV.CTh1, heatExchangerWall1.WT2) + annotation (Line(points={{19.55,-41}, + {30,-41},{40.8,-41}}, color={191,95,0})); + connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{ + 6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255})); + connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{ + 40,76.9},{40,63},{53,63}}, color={0,0,255})); + connect(DomeGV.Cv, DPnulle_Vapeur.C1) annotation (Line(points={{22,107},{22, + 118},{-0.5,118}}, color={255,0,0})); + connect(DPnulle_Vapeur.C2, fluidOutletI) annotation (Line(points={{-0.5,130}, + {0,130},{0,149}}, color={255,0,0})); + connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5}, + {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255})); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-150,-150},{150,150}}, + initialScale=0.1), graphics={Text( + extent={{55,81},{55,75}}, + lineColor={0,0,255}, + textString= + "petit DP"), Text( + extent={{-126,153},{-84,123}}, + lineColor={0,0,255}, + textString= + "= 4GV")}), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-150,-150},{150,150}}, + initialScale=0.1), graphics={ + Ellipse( + extent={{-42,150},{42,108}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={0,128,255}), + Rectangle( + extent={{-42,131},{42,80}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={0,128,255}), + Ellipse( + extent={{-36,-108},{36,-150}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={0,128,255}), + Rectangle( + extent={{-42,86},{42,56}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={170,213,255}), + Rectangle( + extent={{-36,42},{36,-128}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={170,213,255}), + Polygon( + points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}}, + lineColor={0,0,0}, + fillPattern=DynamicSelect(FillPattern.VerticalCylinder, + if dynamic_energy_balance then FillPattern.VerticalCylinder + else FillPattern.Solid), + fillColor={170,213,255})}), Documentation(revisions = " Author @@ -125,4 +407,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end SteamGenerator_4SG; \ No newline at end of file +end SteamGenerator_4SG; From f900e068e43ece1eb182ad46a985c3b796fb76b8 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 17:04:33 +0200 Subject: [PATCH 193/213] #125 port Fluid boilers and CHP engine medium support onto develop --- ThermoSysPro/Fluid/Boilers/BoilerSystem.mo | 180 +++++-- .../Fluid/Boilers/FossilFuelBoiler.mo | 453 ++++++++++++------ .../Machines/CHPEngineBarkantineSystem.mo | 346 ++++++++++--- 3 files changed, 708 insertions(+), 271 deletions(-) diff --git a/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo b/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo index 52b44fd6..ea2f4406 100644 --- a/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo +++ b/ThermoSysPro/Fluid/Boilers/BoilerSystem.mo @@ -1,48 +1,146 @@ within ThermoSysPro.Fluid.Boilers; - model BoilerSystem "Boiler" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Temperature Tsf = 423.16 "Flue gases temperature at the outlet"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Temperature Tsf=423.16 + "Flue gases temperature at the outlet"; parameter Integer Boiler_efficiency_type = 1 "1: Taking into account LHV only - 2: Using the total incoming power"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf = 0.05 "Flue gases pressure loss coefficient"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke = 1e4 "Water/steam pressure loss coefficient"; - parameter Real etacomb = 1 "Combustion efficiency (between 0 and 1)"; - parameter Units.SI.Power Wloss = 1e5 "Thermal losses"; - parameter Units.SI.MassFlowRate gamma_diff_ws = 1e-4 "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ Fuel(Xashes = 0.011, rho = 1000, Hum = 0.50, Xc = 0.2479, Xh = 0.0297, Xo = 0.2088, Xn = 0.0017, Xs = 0.0003, LHV = 1.5e7, Q0 = 0.0407331, T0 = 294.45) annotation( - Placement(transformation(extent = {{-56, -10}, {-36, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Boilers.FossilFuelBoiler Boiler(Qsf(start = 45.8744, fixed = false), Pee(fixed = false), Qe(fixed = false, start = 6), Hee(fixed = false, start = 293.1e3), Hse(fixed = false, start = 377e3), Tsf = Tsf, exc_air(fixed = false, start = 10), Wloss = Wloss, Wboil(start = 1600e3, fixed = false), gamma_diff_ws = gamma_diff_ws, continuous_flow_reversal = continuous_flow_reversal, diffusion = diffusion, Boiler_efficiency_type = Boiler_efficiency_type, Kf = Kf, Ke = Ke, etacomb = etacomb, Pse(fixed = false, start = 200000), Tse(fixed = false, start = 363.16), Tf(fixed = false, start = 1600)) annotation( - Placement(transformation(origin = {-10, 0}, extent = {{20, -20}, {-20, 20}}, rotation = 270))); - Interfaces.Connectors.FluidInlet InletWaterSteam "Water inlet" annotation( - Placement(transformation(extent = {{40, -110}, {60, -90}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet OutletWaterSteam "Water/steam outlet" annotation( - Placement(transformation(extent = {{40, 90}, {60, 110}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet OutletFlueGases "Flue gases outlet" annotation( - Placement(transformation(extent = {{-80, 90}, {-60, 110}}, rotation = 0), iconTransformation(extent = {{-80, 90}, {-60, 110}}))); - Interfaces.Connectors.FluidInlet InletFlueGases "Flue gases inlet" annotation( - Placement(transformation(extent = {{-80, -110}, {-60, -90}}, rotation = 0))); + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05 + "Flue gases pressure loss coefficient"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4 + "Water/steam pressure loss coefficient"; + parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)"; + parameter Units.SI.Power Wloss=1e5 "Thermal losses"; + parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4 + "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ Fuel( + Xashes=0.011, + rho=1000, + Hum=0.50, + Xc=0.2479, + Xh=0.0297, + Xo=0.2088, + Xn=0.0017, + Xs=0.0003, + LHV=1.5e7, + Q0=0.0407331, + T0=294.45) + annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation= + 0))); + ThermoSysPro.Fluid.Boilers.FossilFuelBoiler Boiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Qsf(start=45.8744, fixed=false), + Pee(fixed=false), + Qe(fixed=false, start=6), + Hee(fixed=false, start=293.1e3), + Hse(fixed=false, start=377e3), + Tsf=Tsf, + exc_air(fixed=false, start=10), + Wloss=Wloss, + Wboil(start=1600e3, fixed=false), + gamma_diff_ws=gamma_diff_ws, + continuous_flow_reversal=continuous_flow_reversal, + diffusion=diffusion, + Boiler_efficiency_type=Boiler_efficiency_type, + Kf=Kf, + Ke=Ke, + etacomb=etacomb, + Pse(fixed=false, start=200000), + Tse(fixed=false, start=363.16), + Tf(fixed=false, start=1600)) + annotation (Placement(transformation( + origin={-10,0}, + extent={{20,-20},{-20,20}}, + rotation=270))); + Interfaces.Connectors.FluidInlet InletWaterSteam(redeclare package Medium = Medium) "Water inlet" annotation ( + Placement(transformation(extent={{40,-110},{60,-90}}, rotation=0))); + Interfaces.Connectors.FluidOutlet OutletWaterSteam(redeclare package Medium = Medium) "Water/steam outlet" + annotation (Placement(transformation(extent={{40,90},{60,110}}, rotation=0))); + Interfaces.Connectors.FluidOutlet OutletFlueGases(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement( + transformation(extent={{-80,90},{-60,110}}, rotation=0), + iconTransformation(extent={{-80,90},{-60,110}}))); + Interfaces.Connectors.FluidInlet InletFlueGases(redeclare package Medium = Medium_FlueGases) "Flue gases inlet" + annotation (Placement( + transformation(extent={{-80,-110},{-60,-90}}, rotation=0))); equation - connect(OutletWaterSteam, Boiler.Cws2) annotation( - Line(points = {{50, 100}, {50, 100}, {2, 100}, {2, 20}}, color = {255, 0, 0})); - connect(Boiler.Cws1, InletWaterSteam) annotation( - Line(points = {{2, -20}, {2, -100}, {50, -100}})); - connect(Boiler.Cfuel, Fuel.C) annotation( - Line(points = {{-26, 9.79685e-016}, {-32, 9.79685e-016}, {-32, 0}, {-36, 0}}, color = {0, 0, 0})); - connect(Boiler.Cfg, OutletFlueGases) annotation( - Line(points = {{-22.4, 20}, {-22, 20}, {-22, 100}, {-70, 100}}, color = {255, 0, 0})); - connect(Boiler.Cair, InletFlueGases) annotation( - Line(points = {{-22.4, -20}, {-22, -20}, {-22, -100}, {-70, -100}}, color = {0, 0, 0})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-80, -100}, {60, 100}}, initialScale = 0.3)), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-80, -100}, {60, 100}}, initialScale = 0.3), graphics = {Rectangle(extent = {{-80, 100}, {60, -100}}, lineColor = {0, 0, 0}, pattern = LinePattern.Dash, lineThickness = 0), Rectangle(extent = {{-60, 80}, {40, -80}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-12, -46}, {0, -50}, {10, -38}, {14, -24}, {12, -10}, {10, -2}, {6, 8}, {2, 18}, {0, 26}, {-2, 32}, {-6, 50}, {-10, 40}, {-14, 32}, {-18, 20}, {-18, 16}, {-20, 12}, {-22, 20}, {-24, 22}, {-26, 18}, {-30, 10}, {-32, 4}, {-36, -4}, {-38, -14}, {-40, -24}, {-40, -32}, {-34, -40}, {-30, -46}, {-20, -52}, {-12, -46}}, lineColor = {255, 0, 128}, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-20, -28}, {-18, -24}, {-14, -22}, {-10, -22}, {-6, -24}, {-4, -26}, {-2, -32}, {-2, -36}, {-4, -34}, {-6, -30}, {-8, -26}, {-14, -26}, {-16, -28}, {-20, -32}, {-22, -34}, {-22, -34}, {-20, -28}}, lineColor = {127, 0, 0}, fillColor = {127, 0, 0}, fillPattern = FillPattern.Solid), Text(extent = {{-109, -90}, {-88, -106}}, lineColor = {28, 108, 200}, textString = "Air"), Text(extent = {{-116, 110}, {-84, 88}}, lineColor = {238, 46, 47}, textString = "FlueGases"), Text(extent = {{65, -88}, {95, -108}}, lineColor = {28, 108, 200}, textString = "WaterSteam"), Text(extent = {{65, 112}, {95, 92}}, lineColor = {238, 46, 47}, textString = "WaterSteam"), Line(points = {{-100, -90}, {-100, 90}}, color = {255, 0, 0}, arrow = {Arrow.None, Arrow.Open}), Line(points = {{80, -86}, {80, 94}}, color = {28, 108, 200}, arrow = {Arrow.None, Arrow.Open})}), + connect(OutletWaterSteam, Boiler.Cws2) annotation (Line(points={{50,100},{50,100}, + {2,100},{2,20}}, color={255,0,0})); + connect(Boiler.Cws1, InletWaterSteam) + annotation (Line(points={{2,-20},{2,-100},{50,-100}})); + connect(Boiler.Cfuel, Fuel.C) annotation (Line(points={{-26,9.79685e-016},{ + -32,9.79685e-016},{-32,0},{-36,0}}, color={0,0,0})); + connect(Boiler.Cfg, OutletFlueGases) annotation (Line(points={{-22.4,20},{-22, + 20},{-22,100},{-70,100}}, + color={255,0,0})); + connect(Boiler.Cair, InletFlueGases) annotation (Line(points={{-22.4,-20},{ + -22,-20},{-22,-100},{-70,-100}}, color={0,0,0})); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-80,-100},{60,100}}, + initialScale=0.3)), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-80,-100},{60,100}}, + initialScale=0.3), graphics={ + Rectangle( + extent={{-80,100},{60,-100}}, + lineColor={0,0,0}, + pattern=LinePattern.Dash, + lineThickness=0), + Rectangle( + extent={{-60,80},{40,-80}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-12,-46},{0,-50},{10,-38},{14,-24},{12,-10},{10,-2},{6,8},{2, + 18},{0,26},{-2,32},{-6,50},{-10,40},{-14,32},{-18,20},{-18,16},{ + -20,12},{-22,20},{-24,22},{-26,18},{-30,10},{-32,4},{-36,-4},{-38, + -14},{-40,-24},{-40,-32},{-34,-40},{-30,-46},{-20,-52},{-12,-46}}, + lineColor={255,0,128}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-20,-28},{-18,-24},{-14,-22},{-10,-22},{-6,-24},{-4,-26},{-2, + -32},{-2,-36},{-4,-34},{-6,-30},{-8,-26},{-14,-26},{-16,-28},{-20, + -32},{-22,-34},{-22,-34},{-20,-28}}, + lineColor={127,0,0}, + fillColor={127,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-109,-90},{-88,-106}}, + lineColor={28,108,200}, + textString="Air"), + Text( + extent={{-116,110},{-84,88}}, + lineColor={238,46,47}, + textString="FlueGases"), + Text( + extent={{65,-88},{95,-108}}, + lineColor={28,108,200}, + textString="WaterSteam"), + Text( + extent={{65,112},{95,92}}, + lineColor={238,46,47}, + textString="WaterSteam"), + Line( + points={{-100,-90},{-100,90}}, + color={255,0,0}, + arrow={Arrow.None,Arrow.Open}), + Line( + points={{80,-86},{80,94}}, + color={28,108,200}, + arrow={Arrow.None,Arrow.Open})}), Documentation(revisions = " Author @@ -52,4 +150,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end BoilerSystem; \ No newline at end of file +end BoilerSystem; diff --git a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo index db0a0085..90d9290e 100644 --- a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo +++ b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo @@ -1,70 +1,106 @@ within ThermoSysPro.Fluid.Boilers; - model FossilFuelBoiler "Fossil fuel boiler" - extends ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FlueGasesFluidTypeParameterInterface; extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; - parameter Units.SI.Temperature Tsf = 400 "Flue gases temperature at the outlet"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Temperature Tsf=400 "Flue gases temperature at the outlet"; parameter Integer Boiler_efficiency_type = 1 "1: Taking into account LHV only - 2: Using the total incoming power"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf = 0.05 "Flue gases pressure loss coefficient"; - parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke = 1e4 "Water/steam pressure loss coefficient"; - parameter Real etacomb = 1 "Combustion efficiency (between 0 and 1)"; - parameter Units.SI.Power Wloss = 1e5 "Thermal losses"; - parameter Units.SI.MassFlowRate gamma_diff_ws = 1e-4 "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; - parameter Boolean continuous_flow_reversal = false "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion = false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region = IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation( - Evaluate = true, - Dialog(enable = (ftype == FluidType.WaterSteam), tab = "Fluid", group = "Fluid properties")); - Units.SI.MassFlowRate Qea(start = 400) "Air mass flow rate at the inlet"; - Units.SI.AbsolutePressure Pea(start = 1e5) "Air pressure at the inlet"; - Units.SI.Temperature Tea(start = 400) "Air temperature at the inlet"; - Units.SI.SpecificEnthalpy Hea(start = 50e3) "Air specific enthalpy at the inlet"; - Units.SI.SpecificEnthalpy Hrair(start = 10e3) "Air reference specific enthalpy"; - Real XeaCO2(start = 0) "CO2 mass fraction at the inlet"; - Real XeaH2O(start = 0.1) "H2O mass fraction at the inlet"; - Real XeaO2(start = 0.2) "O2 mass fraction at the inlet"; - Real XeaSO2(start = 0) "SO2 mass fraction at the inlet"; - Real XeaO2c(start = 0.2) "Intermediate variable for the computation of the O2 mass fraction"; - Units.SI.MassFlowRate Qcomb(start = 5) "Fuel mass flow rate"; - Units.SI.Temperature Tcomb(start = 300) "Fuel temperature"; - Units.SI.SpecificEnthalpy Hcomb(start = 10e3) "Fuel specific enthalpy"; - Units.SI.SpecificEnthalpy Hrcomb(start = 10e3) "Fuel reference specific enthalpy"; - Real XCcomb(start = 0.8) "Carbon mass fraction"; - Real XHcomb(start = 0.2) "Hydrogen mass fraction"; - Real XOcomb(start = 0) "Oxygen mass fraction"; - Real XScomb(start = 0) "Sulfur mass fraction"; - Real PCIcomb(start = 5e7) "Fuel PCI (J/kg)"; - Units.SI.SpecificHeatCapacity Cpcomb(start = 2000) "Fuel specific heat capacity"; - Units.SI.MassFlowRate Qe(start = 100) "Water/steam mass flow rate"; - Units.SI.AbsolutePressure Pee(start = 50e5) "Water/steam pressure at the inlet"; - Units.SI.AbsolutePressure Pse(start = 50e5) "Water/steam pressure at the outlet"; - ThermoSysPro.Units.SI.PressureDifference deltaPe(start = 1e5) "Water/steam pressure losses"; - Units.SI.Temperature Tse(start = 500) "Water/steam temperature at the outlet"; - Units.SI.SpecificEnthalpy Hee(start = 400e3) "Water/steam specific enthalpy at the inlet"; - Units.SI.SpecificEnthalpy Hse(start = 400e3) "Water/steam specific enthalpy at the outlet"; - Units.SI.Density rhoe(start = 998) "Average water/steam density"; - Units.SI.MassFlowRate Qsf(start = 400) "Flue gases mass flow rate at the outlet"; - Units.SI.AbsolutePressure Psf(start = 1e5) "Flue gases pressure at the outlet"; - Units.SI.Temperature Tf(start = 1500) "Flue gases temperature after combustion"; - Units.SI.SpecificEnthalpy Hsf(start = 50e3) "Flue gases specific enthalpy at the outlet"; - Units.SI.SpecificEnthalpy Hf(start = 100e3) "Flue gases specific enthalpy after combustion"; - Units.SI.SpecificEnthalpy Hrfum(start = 10e3) "Flue gases reference specific enthalpy"; - ThermoSysPro.Units.SI.PressureDifference deltaPf(start = 1e3) "Pressure losses in the combusiton chamber"; - Units.SI.Density rhof(start = 0.05) "Flue gases density"; - Real XsfCO2(start = 0.2) "CO2 mass fraction at the outlet"; - Real XsfH2O(start = 0.15) "H2O mass fraction at the outlet"; - Real XsfO2(start = 0) "O2 mass fraction at the outlet"; - Real XsfSO2(start = 0) "SO2 mass fraction at the outlet"; - Units.SI.Power Wfuel(start = 5e8) "Fuel available power PCI"; - Units.SI.Power Wtot(start = 5e8) "Total incoming power"; - Units.SI.Power Wboil(start = 5e9) "Power exchanged in the boiler"; - Real eta_boil(start = 90) "Boiler efficiency (%) "; - Real exc(start = 1) "Air combustion ratio"; - Real exc_air(start = 0.1) "Pertcentage of air in excess"; - FluidType fluids[2] "Fluids mixing in volume"; - Units.SI.SpecificEnthalpy h(start = 10e5) "Flue gases specific enthalpy"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Kf=0.05 + "Flue gases pressure loss coefficient"; + parameter ThermoSysPro.Units.xSI.PressureLossCoefficient Ke=1e4 + "Water/steam pressure loss coefficient"; + parameter Real etacomb=1 "Combustion efficiency (between 0 and 1)"; + parameter Units.SI.Power Wloss=1e5 "Thermal losses"; + parameter Units.SI.MassFlowRate gamma_diff_ws=1e-4 + "Diffusion conductance for the water/steam side (active if diffusion=true in neighbouring volumes)"; + parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; + parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + +protected + constant Real amC=12.01115 "Carbon atomic mass"; + constant Real amH=1.00797 "Hydrogen atomic mass"; + constant Real amO=15.9994 "Oxygen atomic mass"; + constant Real amS=32.064 "Sulfur atomic mass"; + constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; + constant Real amH2O = 2*amH + amO "H2O molecular mass"; + constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; + constant Real teps=1e-6 "Small number"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + parameter Units.SI.MassFlowRate gamma0=1.e-4 + "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; + parameter Real eps=1.e-0 "Small number for pressure loss equation"; + +public + Units.SI.MassFlowRate Qea(start=400) "Air mass flow rate at the inlet"; + Units.SI.AbsolutePressure Pea(start=1e5) "Air pressure at the inlet"; + Units.SI.Temperature Tea(start=400) "Air temperature at the inlet"; + Units.SI.SpecificEnthalpy Hea(start=50e3) + "Air specific enthalpy at the inlet"; + Units.SI.SpecificEnthalpy Hrair(start=10e3) "Air reference specific enthalpy"; + Real XeaCO2(start=0) "CO2 mass fraction at the inlet"; + Real XeaH2O(start=0.1) "H2O mass fraction at the inlet"; + Real XeaO2(start=0.2) "O2 mass fraction at the inlet"; + Real XeaSO2(start=0) "SO2 mass fraction at the inlet"; + Real XeaO2c(start=0.2) "Intermediate variable for the computation of the O2 mass fraction"; + + Units.SI.MassFlowRate Qcomb(start=5) "Fuel mass flow rate"; + Units.SI.Temperature Tcomb(start=300) "Fuel temperature"; + Units.SI.SpecificEnthalpy Hcomb(start=10e3) "Fuel specific enthalpy"; + Units.SI.SpecificEnthalpy Hrcomb(start=10e3) + "Fuel reference specific enthalpy"; + Real XCcomb(start=0.8) "Carbon mass fraction"; + Real XHcomb(start=0.2) "Hydrogen mass fraction"; + Real XOcomb(start=0) "Oxygen mass fraction"; + Real XScomb(start=0) "Sulfur mass fraction"; + Real PCIcomb(start=5e7) "Fuel PCI (J/kg)"; + Units.SI.SpecificHeatCapacity Cpcomb(start=2000) + "Fuel specific heat capacity"; + + Units.SI.MassFlowRate Qe(start=100) "Water/steam mass flow rate"; + Units.SI.AbsolutePressure Pee(start=50e5) "Water/steam pressure at the inlet"; + Units.SI.AbsolutePressure Pse(start=50e5) + "Water/steam pressure at the outlet"; + ThermoSysPro.Units.SI.PressureDifference deltaPe(start=1e5) + "Water/steam pressure losses"; + Units.SI.Temperature Tse(start=500) "Water/steam temperature at the outlet"; + Units.SI.SpecificEnthalpy Hee(start=400e3) + "Water/steam specific enthalpy at the inlet"; + Units.SI.SpecificEnthalpy Hse(start=400e3) + "Water/steam specific enthalpy at the outlet"; + Units.SI.Density rhoe(start=998) "Average water/steam density"; + + Units.SI.MassFlowRate Qsf(start=400) + "Flue gases mass flow rate at the outlet"; + Units.SI.AbsolutePressure Psf(start=1e5) "Flue gases pressure at the outlet"; + Units.SI.Temperature Tf(start=1500) "Flue gases temperature after combustion"; + Units.SI.SpecificEnthalpy Hsf(start=50e3) + "Flue gases specific enthalpy at the outlet"; + Units.SI.SpecificEnthalpy Hf(start=100e3) + "Flue gases specific enthalpy after combustion"; + Units.SI.SpecificEnthalpy Hrfum(start=10e3) + "Flue gases reference specific enthalpy"; + ThermoSysPro.Units.SI.PressureDifference deltaPf(start=1e3) + "Pressure losses in the combusiton chamber"; + Units.SI.Density rhof(start=0.05) "Flue gases density"; + Real XsfCO2(start=0.2) "CO2 mass fraction at the outlet"; + Real XsfH2O(start=0.15) "H2O mass fraction at the outlet"; + Real XsfO2(start=0) "O2 mass fraction at the outlet"; + Real XsfSO2(start=0) "SO2 mass fraction at the outlet"; + + Units.SI.Power Wfuel(start=5e8) "Fuel available power PCI"; + Units.SI.Power Wtot(start=5e8) "Total incoming power"; + Units.SI.Power Wboil(start=5e9) "Power exchanged in the boiler"; + Real eta_boil(start=90) "Boiler efficiency (%) "; + Real exc(start=1) "Air combustion ratio"; + Real exc_air(start=0.1) "Pertcentage of air in excess"; + + Units.SI.SpecificEnthalpy h(start=10e5) "Flue gases specific enthalpy"; Units.SI.Power Jair "Thermal power diffusion from inlet Cair"; Units.SI.Power Jfg "Thermal power diffusion from outlet Cfg"; Units.SI.Power J "Total thermal power diffusion"; @@ -72,63 +108,71 @@ model FossilFuelBoiler "Fossil fuel boiler" Units.SI.MassFlowRate gamma_fg "Diffusion conductance for outlet Cfg"; Real rair "Value of r(Q/gamma) for inlet Cair"; Real rfg "Value of r(Q/gamma) for outlet Cfg"; - FluidType ftype_ws "Water/steam fluid type"; - Integer fluid_ws = Integer(ftype_ws) "Water/steam fluid number"; - Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" annotation( - Placement(transformation(extent = {{-10, -90}, {10, -70}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cair "Air inlet" annotation( - Placement(transformation(extent = {{-110, -72}, {-90, -52}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cfg "Flue gases outlet" annotation( - Placement(transformation(extent = {{90, -72}, {110, -52}}, rotation = 0))); - Interfaces.Connectors.FluidInlet Cws1 "Water inlet" annotation( - Placement(transformation(extent = {{-110, 50}, {-90, 70}}, rotation = 0))); - Interfaces.Connectors.FluidOutlet Cws2 "Water/steam outlet" annotation( - Placement(transformation(extent = {{90, 50}, {110, 70}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pros annotation( - Placement(transformation(extent = {{-100, 84}, {-80, 104}}, rotation = 0))); - ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prom annotation( - Placement(transformation(extent = {{80, 84}, {100, 104}}, rotation = 0))); -protected - constant Real amC = 12.01115 "Carbon atomic mass"; - constant Real amH = 1.00797 "Hydrogen atomic mass"; - constant Real amO = 15.9994 "Oxygen atomic mass"; - constant Real amS = 32.064 "Sulfur atomic mass"; - constant Real amCO2 = amC + 2*amO "CO2 molecular mass"; - constant Real amH2O = 2*amH + amO "H2O molecular mass"; - constant Real amSO2 = amS + 2*amO "SO2 molecular mass"; - constant Real teps = 1e-6 "Small number"; - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - parameter Units.SI.MassFlowRate gamma0 = 1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Real eps = 1.e-0 "Small number for pressure loss equation"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium.ThermodynamicState state_ws_m "Water/steam average thermodynamic state"; + Medium.ThermodynamicState state_ws_out "Water/steam outlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_comb "Flue gases thermodynamic state after combustion"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_m "Flue gases average thermodynamic state"; + +public + Interfaces.Connectors.FuelInlet Cfuel "Fuel inlet" + annotation (Placement(transformation(extent={{-10,-90},{10,-70}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet Cair(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation( + extent={{-110,-72},{-90,-52}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation( + extent={{90,-72},{110,-52}}, rotation=0))); +public + Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) "Water inlet" + annotation (Placement(transformation( + extent={{-110,50},{-90,70}}, rotation=0))); + Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) "Water/steam outlet" + annotation (Placement(transformation( + extent={{90,50},{110,70}}, rotation=0))); equation -/* Check that incoming fluids are compatible with fluid in volume */ - fluids[1] = ftype; - fluids[2] = Cair.ftype; - assert(ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.isCompatible(fluids), "InternalCombustionEngine: fluids mixing in volume are not compatible with each other"); -// ---------------- -// Water/steam side - assert((ftype_ws == FluidType.WaterSteam) or (ftype_ws == FluidType.WaterSteamSimple), "InternalCombustionEngine: the fluid type for the water/steam side must be water/steam"); + + assert(Medium_FlueGases.nX > 1, "FossilFuelBoiler: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "FossilFuelBoiler: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + // ---------------- + // Water/steam side + Cws1.Q = Cws2.Q; + Cws1.h_vol_1 = Cws2.h_vol_1; Cws1.h_vol_2 = Cws2.h_vol_2; + Cws2.diff_on_1 = if (gamma_diff_ws > 0) then Cws1.diff_on_1 else false; Cws1.diff_on_2 = if (gamma_diff_ws > 0) then Cws2.diff_on_2 else false; + Cws2.diff_res_1 = Cws1.diff_res_1 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); Cws1.diff_res_2 = Cws2.diff_res_2 + (if (gamma_diff_ws > 0) then 1/gamma_diff_ws else 0); - Cws1.ftype = Cws2.ftype; - Cws1.Xco2 = Cws2.Xco2; - Cws1.Xh2o = Cws2.Xh2o; - Cws1.Xo2 = Cws2.Xo2; - Cws1.Xso2 = Cws2.Xso2; - ftype_ws = Cws1.ftype; + + Cws1.Xi = Cws2.Xi; + Xws = Cws1.Xi; + Cws1.SubC = Cws2.SubC; + SubCws = Cws1.SubC; + Qe = Cws1.Q; + Pee = Cws1.P; Hee = Cws1.h; + Pse = Cws2.P; Hse = Cws2.h; -// --------------- -// Combustion side -/* Fuel inlet */ + + // --------------- + // Combustion side + + /* Fuel inlet */ Qcomb = Cfuel.Q; Tcomb = Cfuel.T; XCcomb = Cfuel.Xc; @@ -137,103 +181,173 @@ equation XScomb = Cfuel.Xs; PCIcomb = Cfuel.LHV; Cpcomb = Cfuel.cp; -/* Air inlet */ + + /* Air inlet */ Qea = Cair.Q; Pea = Cair.P; Hea = Cair.h; - XeaCO2 = Cair.Xco2; - XeaH2O = Cair.Xh2o; - XeaO2 = Cair.Xo2; - XeaSO2 = Cair.Xso2; -/* Flue gases outlet */ + + Xea[1:Medium_FlueGases.nXi] = Cair.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Cair.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; -/* Mass balance equation for the flue gases */ + + /* Mass balance equation for the flue gases */ 0 = Qcomb + Qea - Qsf; -/* Energy balance equation for the flue gases */ + + /* Energy balance equation for the flue gases */ 0 = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair) - Qsf*(Hf - Hrfum) - Wloss + J; + Hcomb = Cpcomb*Tcomb; + Cair.h_vol_2 = h; Cfg.h_vol_1 = h; -/* Fuel power */ + + /* Fuel power */ Wfuel = Qcomb*PCIcomb; -/* Total incoming power */ + + /* Total incoming power */ Wtot = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair); -/* Power exchanged in the boiler */ + + /* Power exchanged in the boiler */ Wboil = Wtot - Qsf*(Hsf - Hrfum) - Wloss; -/* Water/steam specific enthalpy at the outlet */ + + /* Water/steam specific enthalpy at the outlet */ Hse = Wboil/Qe + Hee; -/* Boiler efficiency*/ + + /* Boiler efficiency*/ if (Boiler_efficiency_type == 1) then - eta_boil = 100*Wboil/Wfuel; + eta_boil = 100*Wboil/Wfuel; else - eta_boil = 100*Wboil/Wtot; + eta_boil = 100*Wboil/Wtot; end if; -/* Flue gases composition balance equations */ + + /* Flue gases composition balance equations */ 0 = Qcomb*XCcomb*amCO2/amC + Qea*XeaCO2 - Qsf*XsfCO2; 0 = Qcomb*XHcomb*(amH2O/2)/amH + Qea*XeaH2O - Qsf*XsfH2O; 0 = Qea*XeaO2c - Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS) + Qcomb*XOcomb - Qsf*XsfO2; 0 = Qcomb*XScomb*amSO2/amS + Qea*XeaSO2 - Qsf*XsfSO2; - Cfg.ftype = ftype; - Cfg.Xco2 = XsfCO2; - Cfg.Xh2o = XsfH2O; - Cfg.Xo2 = XsfO2; - Cfg.Xso2 = XsfSO2; -/* Combustion air ratio */ - exc = Qea*(1 - XeaH2O)/((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO))/(XeaO2c/(1 - XeaH2O))); -/* Air excess */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Qsf*Cfg.SubC = Qea*Cair.SubC; + SubCfg = Cfg.SubC; + + /* Combustion air ratio */ + exc = Qea*(1 - XeaH2O) / ((Qcomb*amO*(2*XCcomb/amC + 0.5*XHcomb/amH + 2*XScomb/amS - XOcomb/amO)) / (XeaO2c/(1 - XeaH2O))); + + /* Air excess */ exc_air = (exc - 1)*100; -/* Flue gases pressure losses */ + + /* Flue gases pressure losses */ Pea - Psf = deltaPf; deltaPf = Kf*ThermoSysPro.Functions.ThermoSquare(Qsf, eps)/rhof; -/* Water/steam pressure losses */ + + /* Water/steam pressure losses */ Pee - Pse = deltaPe; deltaPe = Ke*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe; -/* No flow reversal */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* Diffusion power */ if diffusion then rair = if Cair.diff_on_1 then exp(-0.033*(Cair.Q*Cair.diff_res_1)^2) else 0; rfg = if Cfg.diff_on_2 then exp(-0.033*(Cfg.Q*Cfg.diff_res_2)^2) else 0; + gamma_air = if Cair.diff_on_1 then 1/Cair.diff_res_1 else gamma0; gamma_fg = if Cfg.diff_on_2 then 1/Cfg.diff_res_2 else gamma0; + Jair = if Cair.diff_on_1 then rair*gamma_air*(Cair.h_vol_1 - Cair.h_vol_2) else 0; Jfg = if Cfg.diff_on_2 then rfg*gamma_fg*(Cfg.h_vol_2 - Cfg.h_vol_1) else 0; else rair = 0; rfg = 0; + gamma_air = gamma0; gamma_fg = gamma0; + Jair = 0; Jfg = 0; end if; + J = Jair + Jfg; + Cair.diff_res_2 = 0; Cfg.diff_res_1 = 0; + Cair.diff_on_2 = diffusion; Cfg.diff_on_1 = diffusion; -/* Air specific enthalpy at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2c, XeaSO2); -/* Flue gases tempretaure after combustion */ -// Changed from FlueGases_T to FlueGases_h to provide a differentiable function - Hf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tf, XsfCO2, XsfH2O, XsfO2, XsfSO2); -/* Flue gases specific enthalpy at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); -/* Flue gases density */ - rhof = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, (Tea + Tf)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2); + + /* Air specific enthalpy at the inlet */ + state_air_in = Medium_FlueGases.setState_phX(p=Pea, h=Hea, X=Xea); + Tea = Medium_FlueGases.temperature(state_air_in); + + /* Flue gases tempretaure after combustion */ + Hf = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tf, X=Xsf); + state_fg_comb = Medium_FlueGases.setState_phX(p=Pea, h=Hf, X=Xsf); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_phX(p=Psf, h=Hsf, X=Xsf); + + /* Flue gases density */ + state_fg_m = Medium_FlueGases.setState_pTX(p=Pea, T=(Tea + Tf)/2, X=Xsf); + rhof = Medium_FlueGases.density(state_fg_m); + 0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps); -/* Reference specific enthalpies */ + + /* Reference specific enthalpies */ Hrair = 2501.569e3*XeaH2O; Hrcomb = 0; Hrfum = 2501.569e3*XsfH2O; -/* Water/steam thermodynamic properties */ - prom = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph((Pee + Pse)/2, (Hee + Hse)/2, mode); - rhoe = prom.d; - pros = ThermoSysPro.Properties.WaterSteam.IF97.Water_Ph(Pse, Hse, mode); - Tse = pros.T; - annotation( - Icon(graphics = {Rectangle(extent = {{-100, 80}, {100, -80}}, lineColor = {0, 0, 255}, fillColor = DynamicSelect({255, 255, 0}, if diffusion then fill_color_singular else fill_color_static), fillPattern = FillPattern.Solid), Polygon(points = {{-2, -42}, {10, -46}, {20, -34}, {24, -20}, {22, -6}, {20, 2}, {16, 12}, {12, 22}, {10, 30}, {8, 36}, {4, 54}, {0, 44}, {-4, 36}, {-8, 24}, {-8, 20}, {-10, 16}, {-12, 24}, {-14, 26}, {-16, 22}, {-20, 14}, {-22, 8}, {-26, 0}, {-28, -10}, {-30, -20}, {-30, -28}, {-24, -36}, {-20, -42}, {-10, -48}, {-2, -42}}, lineColor = {255, 0, 128}, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-10, -24}, {-8, -20}, {-4, -18}, {0, -18}, {4, -20}, {6, -22}, {8, -28}, {8, -32}, {6, -30}, {4, -26}, {2, -22}, {-4, -22}, {-6, -24}, {-10, -28}, {-12, -30}, {-12, -30}, {-10, -24}}, lineColor = {127, 0, 0}, fillColor = {127, 0, 0}, fillPattern = FillPattern.Solid), Line(points = {{-92, 60}, {92, 60}, {88, 60}, {80, 60}}, color = {28, 108, 200}), Line(points = {{-92, -62}, {92, -62}, {88, -62}, {80, -62}}, color = {255, 0, 0})}), + + /* Water/steam thermodynamic properties */ + state_ws_m = Medium.setState_phX(p=(Pee + Pse)/2, h=(Hee + Hse)/2, X=Xws); + rhoe = Medium.density(state_ws_m); + + state_ws_out = Medium.setState_phX(p=Pse, h=Hse, X=Xws); + Tse = Medium.temperature(state_ws_out); + + annotation ( Icon(graphics={ + Rectangle( + extent={{-100,80},{100,-80}}, + lineColor={0,0,255}, + fillColor= DynamicSelect({255,255,0}, + if diffusion then fill_color_singular + else fill_color_static), + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{ + 12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10, + 16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10}, + {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}}, + lineColor={255,0,128}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{ + 8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12, + -30},{-12,-30},{-10,-24}}, + lineColor={127,0,0}, + fillColor={127,0,0}, + fillPattern=FillPattern.Solid), + Line(points={{-92,60},{92,60},{88,60},{80,60}}, color={28,108,200}), + Line(points={{-92,-62},{92,-62},{88,-62},{80,-62}}, + color={255,0,0})}), Documentation(revisions = " Author @@ -244,5 +358,36 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 7.2 of the ThermoSysPro book. "), - Diagram(graphics = {Rectangle(extent = {{-100, 80}, {100, -80}}, lineColor = {0, 0, 255}, fillColor = {127, 255, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-2, -42}, {10, -46}, {20, -34}, {24, -20}, {22, -6}, {20, 2}, {16, 12}, {12, 22}, {10, 30}, {8, 36}, {4, 54}, {0, 44}, {-4, 36}, {-8, 24}, {-8, 20}, {-10, 16}, {-12, 24}, {-14, 26}, {-16, 22}, {-20, 14}, {-22, 8}, {-26, 0}, {-28, -10}, {-30, -20}, {-30, -28}, {-24, -36}, {-20, -42}, {-10, -48}, {-2, -42}}, lineColor = {255, 0, 128}, fillColor = {255, 128, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-10, -24}, {-8, -20}, {-4, -18}, {0, -18}, {4, -20}, {6, -22}, {8, -28}, {8, -32}, {6, -30}, {4, -26}, {2, -22}, {-4, -22}, {-6, -24}, {-10, -28}, {-12, -30}, {-12, -30}, {-10, -24}}, lineColor = {127, 0, 0}, fillColor = {127, 0, 0}, fillPattern = FillPattern.Solid), Text(extent = {{68, -30}, {108, -56}}, lineColor = {238, 46, 47}, textString = "Flue Gases"), Line(points = {{-92, 60}, {92, 60}, {88, 60}, {80, 60}}, color = {28, 108, 200}), Line(points = {{-92, -62}, {92, -62}, {88, -62}, {80, -62}}, color = {255, 0, 0}), Text(extent = {{-112, -36}, {-86, -52}}, lineColor = {28, 108, 200}, textString = "Air")})); -end FossilFuelBoiler; \ No newline at end of file + Diagram(graphics={ + Rectangle( + extent={{-100,80},{100,-80}}, + lineColor={0,0,255}, + fillColor= {127,255,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,-42},{10,-46},{20,-34},{24,-20},{22,-6},{20,2},{16,12},{ + 12,22},{10,30},{8,36},{4,54},{0,44},{-4,36},{-8,24},{-8,20},{-10, + 16},{-12,24},{-14,26},{-16,22},{-20,14},{-22,8},{-26,0},{-28,-10}, + {-30,-20},{-30,-28},{-24,-36},{-20,-42},{-10,-48},{-2,-42}}, + lineColor={255,0,128}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-10,-24},{-8,-20},{-4,-18},{0,-18},{4,-20},{6,-22},{8,-28},{ + 8,-32},{6,-30},{4,-26},{2,-22},{-4,-22},{-6,-24},{-10,-28},{-12, + -30},{-12,-30},{-10,-24}}, + lineColor={127,0,0}, + fillColor={127,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{68,-30},{108,-56}}, + lineColor={238,46,47}, + textString="Flue Gases"), + Line(points={{-92,60},{92,60},{88,60},{80,60}}, color={28,108,200}), + Line(points={{-92,-62},{92,-62},{88,-62},{80,-62}}, + color={255,0,0}), + Text( + extent={{-112,-36},{-86,-52}}, + lineColor={28,108,200}, + textString="Air")})); +end FossilFuelBoiler; diff --git a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo index 6fdbf079..7a2590b1 100644 --- a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo +++ b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo @@ -1,81 +1,275 @@ within ThermoSysPro.Fluid.Machines; - model CHPEngineBarkantineSystem - parameter Units.SI.Temperature Tair = 300 "Inlet air temperature"; - parameter Real RechFumEff = 0.73 "Flue gases heater efficiency"; - parameter Real RechWaterEff = 0.9 "Water heater efficiency"; - parameter Integer mechanical_efficiency_type = 3 "Engine efficiency type" annotation( - choices(choice = 1 "Fixed nominal efficiency", choice = 2 "Efficiency computed using a linear function Coef_Rm", choice = 3 "Efficiency computed using the Beau de Rochas Cycle")); - parameter Real Rmeca_nom = 0.40 "Engine nominal efficiency"; - parameter Units.SI.Power Pnom = 1.4e6 "Engine nominal power"; - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ FuelSource(Hum = 0, Xh = 0.25, Xs = 0, Xashes = 0, Xc = 0.75, Xo = 0, Xn = 0, rho = 0.72, LHV = 48e6, Q0 = 0.0727958, P0 = 225000, T0 = 299, Vol = 1) annotation( - Placement(transformation(extent = {{62, -26}, {38, -2}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ WaterSource(h0 = 293e3, Q0 = 11.8, P0 = 300000) annotation( - Placement(transformation(extent = {{62, -46}, {40, -24}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.InternalCombustionEngine Engine(DPe = 1, MMg = 20, Kd = 1.33, Wcomb(fixed = false, start = 3.4942e6), exc(fixed = false, start = 1.8), RV = 6.45, Kc = 1.28, Xpth = 0.01, Xref = 0.2896, Wmeca(fixed = false, start = 1400e3), mechanical_efficiency_type = mechanical_efficiency_type, Rmeca_nom = Rmeca_nom, Tsf(fixed = false, start = 815)) annotation( - Placement(transformation(origin = {0, 0}, extent = {{-24, -24}, {24, 24}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff ExchangerWaterWater(EffEch = RechWaterEff, exchanger_type = 3, Kf = 50) annotation( - Placement(transformation(origin = {0, -66}, extent = {{14, 14}, {-14, -14}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC1(L = 0.0001) annotation( - Placement(transformation(origin = {-60, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.BoundaryConditions.Sink WaterSteamSink annotation( - Placement(transformation(extent = {{-22, -72}, {-44, -48}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC2(L = 0.0001) annotation( - Placement(transformation(origin = {-80, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff ExchangerWaterFlueGases(EffEch = RechFumEff, exchanger_type = 3, Kf = 50, DTfroid = 283.15, Tsf(fixed = false, start = 363)) annotation( - Placement(transformation(origin = {0, 68}, extent = {{-14, -14}, {14, 14}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss silencieux(K = 20) annotation( - Placement(transformation(origin = {-39, 16}, extent = {{10, -9}, {-10, 9}}, rotation = 270))); - Interfaces.Connectors.FluidOutlet outletWaterSteam annotation( - Placement(transformation(extent = {{180, 80}, {220, 120}}, rotation = 0))); - Interfaces.Connectors.FluidInlet inletWaterSteam annotation( - Placement(transformation(extent = {{-220, 80}, {-180, 120}}, rotation = 0))); - BoundaryConditions.Sink FlueGasesSink annotation( - Placement(transformation(extent = {{-56, 86}, {-80, 110}}, rotation = 0))); - BoundaryConditions.SourcePQ AirSource(Xco2 = 0, Xh2o = 0.005, Xo2 = 0.23, Xso2 = 0, h0 = 40000, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true, P0 = 160000) annotation( - Placement(transformation(extent = {{64, 2}, {40, 26}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirTemperature(k = Tair) "Air temperature" annotation( - Placement(transformation(extent = {{100, -10}, {80, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirMassFlowRate(k = 3) "Air mass flow rate" annotation( - Placement(transformation(extent = {{20, 30}, {40, 50}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante WaterMassFlowRate(k = 11.8) annotation( - Placement(transformation(extent = {{96, -34}, {80, -18}}, rotation = 0))); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Units.SI.Temperature Tair=300 "Inlet air temperature"; + parameter Real RechFumEff=0.73 "Flue gases heater efficiency"; + parameter Real RechWaterEff=0.9 "Water heater efficiency"; + parameter Integer mechanical_efficiency_type=3 "Engine efficiency type" + annotation(choices( + choice=1 "Fixed nominal efficiency", + choice=2 "Efficiency computed using a linear function Coef_Rm", + choice=3 "Efficiency computed using the Beau de Rochas Cycle")); + parameter Real Rmeca_nom=0.40 "Engine nominal efficiency"; + parameter Units.SI.Power Pnom=1.4e6 "Engine nominal power"; + + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ FuelSource( + Hum=0, + Xh=0.25, + Xs=0, + Xashes=0, + Xc=0.75, + Xo=0, + Xn=0, + rho=0.72, + LHV=48e6, + Q0=0.0727958, + P0=225000, + T0=299, + Vol=1) annotation (Placement(transformation(extent={{62,-26},{38,-2}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ WaterSource( + redeclare package Medium = Medium, + h0=293e3, + Q0=11.8, + P0=300000) annotation (Placement(transformation(extent={{62,-46},{40,-24}}, + rotation=0))); + ThermoSysPro.Fluid.Machines.InternalCombustionEngine Engine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + DPe=1, + MMg=20, + Kd=1.33, + Wcomb(fixed=false, start=3.4942e6), + exc(fixed=false, start=1.8), + RV=6.45, + Kc=1.28, + Xpth=0.01, + Xref=0.2896, + Wmeca(fixed=false, start=1400e3), + mechanical_efficiency_type=mechanical_efficiency_type, + Rmeca_nom=Rmeca_nom, + Tsf(fixed=false, start=815)) annotation (Placement(transformation( + origin={0,0}, + extent={{-24,-24},{24,24}}, + rotation=90))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff + ExchangerWaterWater( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=RechWaterEff, exchanger_type=3, + Kf=50) annotation (Placement(transformation( + origin={0,-66}, + extent={{14,14},{-14,-14}}, + rotation=270))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC1( + redeclare package Medium = Medium, + L=0.0001) + annotation (Placement(transformation( + origin={-60,-10}, + extent={{10,-10},{-10,10}}, + rotation=90))); + ThermoSysPro.Fluid.BoundaryConditions.Sink WaterSteamSink( + redeclare package Medium = Medium, + option_temperature=true, + T0=320) annotation ( + Placement(transformation(extent={{-22,-72},{-44,-48}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC2( + redeclare package Medium = Medium, + L=0.0001) + annotation (Placement(transformation( + origin={-80,-10}, + extent={{10,-10},{-10,10}}, + rotation=270))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff + ExchangerWaterFlueGases( + redeclare package Medium_c = Medium_FlueGases, + redeclare package Medium_f = Medium, + EffEch=RechFumEff, + exchanger_type=3, + Kf=50, + DTfroid=283.15, + Tsf(fixed=false, start=363)) + annotation (Placement(transformation( + origin={0,68}, + extent={{-14,-14},{14,14}}, + rotation=90))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss silencieux( + redeclare package Medium = Medium_FlueGases, + K=20) + annotation (Placement(transformation( + origin={-39,16}, + extent={{10,-9},{-10,9}}, + rotation=270))); + Interfaces.Connectors.FluidOutlet outletWaterSteam(redeclare package Medium = + Medium) annotation (Placement( + transformation(extent={{180,80},{220,120}}, rotation=0))); + Interfaces.Connectors.FluidInlet inletWaterSteam(redeclare package Medium = + Medium) annotation (Placement( + transformation(extent={{-220,80},{-180,120}}, rotation=0))); + BoundaryConditions.Sink FlueGasesSink( + redeclare package Medium = Medium_FlueGases, + option_temperature=true, + T0=400) annotation (Placement(transformation(extent={{-56,86},{-80,110}}, + rotation=0))); + BoundaryConditions.SourcePQ AirSource( + redeclare package Medium = Medium_FlueGases, + X0={0.765,0.23,0.005,0,0}, + h0=40000, + option_temperature=true, + P0=160000) + annotation (Placement(transformation(extent={{64,2},{40,26}}, rotation=0))); + + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirTemperature(k=Tair) + "Air temperature" annotation (Placement(transformation(extent={{100,-10},{80, + 10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante AirMassFlowRate(k=3) + "Air mass flow rate" annotation (Placement(transformation(extent={{20,30},{40, + 50}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante WaterMassFlowRate(k=11.8) + annotation (Placement(transformation(extent={{96,-34},{80,-18}}, rotation=0))); equation - connect(ExchangerWaterWater.Ef, inletWaterSteam) annotation( - Line(points = {{-9.19104e-016, -80}, {0, -80}, {0, -100}, {-140, -100}, {-140, 100}, {-200, 100}})); - connect(PDC2.C1, ExchangerWaterWater.Sf) annotation( - Line(points = {{-80, -20}, {-80, -40}, {-0.14, -40}, {-0.14, -52}})); - connect(PDC1.C2, ExchangerWaterWater.Ec) annotation( - Line(points = {{-60, -20}, {-60, -71.6}, {-5.74, -71.6}}, color = {0, 0, 0})); - connect(AirMassFlowRate.y, AirSource.IMassFlow) annotation( - Line(points = {{41, 40}, {52, 40}, {52, 20}})); - connect(WaterSource.IMassFlow, WaterMassFlowRate.y) annotation( - Line(points = {{51, -29.5}, {51, -26}, {79.2, -26}})); - connect(silencieux.C1, Engine.Cfg) annotation( - Line(points = {{-39, 6}, {-40, 6}, {-40, 1.32262e-015}, {-21.6, 1.32262e-015}}, color = {0, 0, 0}, thickness = 0.5)); - connect(Engine.Cws1, WaterSource.C) annotation( - Line(points = {{-1.32262e-015, -21.6}, {-1.32262e-015, -35}, {40, -35}})); - connect(Engine.Cair, AirSource.C) annotation( - Line(points = {{21.6, -1.77636e-015}, {32, -1.77636e-015}, {32, 14}, {40, 14}}, color = {0, 0, 0}, thickness = 0.5)); - connect(PDC1.C1, Engine.Cws2) annotation( - Line(points = {{-60, 0}, {-60, 32}, {1.32262e-015, 32}, {1.32262e-015, 21.6}})); - connect(Engine.Cfuel, FuelSource.C) annotation( - Line(points = {{21.6, -16.8}, {32, -16.8}, {32, -14}, {38, -14}}, color = {0, 0, 0})); - connect(silencieux.C2, ExchangerWaterFlueGases.Ec) annotation( - Line(points = {{-39, 26}, {-40, 26}, {-40, 58}, {-40, 62.4}, {-5.74, 62.4}}, color = {0, 0, 0}, thickness = 0.5)); - connect(AirTemperature.y, AirSource.ISpecificEnthalpyOrTemperature) annotation( - Line(points = {{79, 0}, {64, 0}, {52, 0}, {52, 8}}, color = {0, 0, 255})); - connect(ExchangerWaterFlueGases.Sf, outletWaterSteam) annotation( - Line(points = {{-0.14, 82}, {-0.14, 100}, {200, 100}}, color = {0, 0, 0})); - connect(PDC2.C2, ExchangerWaterFlueGases.Ef) annotation( - Line(points = {{-80, 0}, {-80, 44}, {8.88178e-016, 44}, {8.88178e-016, 54}}, color = {0, 0, 0})); - connect(ExchangerWaterFlueGases.Sc, FlueGasesSink.C) annotation( - Line(points = {{-5.74, 73.6}, {-40, 73.6}, {-40, 98}, {-56, 98}}, color = {0, 0, 0}, thickness = 0.5)); - connect(WaterSteamSink.C, ExchangerWaterWater.Sc) annotation( - Line(points = {{-22, -60}, {-14, -60}, {-14, -60.4}, {-5.74, -60.4}}, color = {0, 0, 0})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}}, initialScale = 0.1)), - Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}}, initialScale = 0.1), graphics = {Rectangle(extent = {{-200, 200}, {200, -200}}, lineColor = {0, 0, 0}, pattern = LinePattern.Dash, lineThickness = 0.5, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid), Rectangle(extent = {{-180, 0}, {-20, -160}}, lineColor = {0, 0, 255}, fillColor = {255, 213, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{-110, -144}, {-96, -126}, {-100, -136}, {-82, -134}, {-98, -140}, {-78, -146}, {-94, -144}, {-110, -156}, {-102, -146}, {-110, -144}}, lineColor = {0, 0, 0}, fillColor = {255, 0, 0}, fillPattern = FillPattern.Solid), Polygon(points = {{-146, -122}, {-146, -80}, {-106, -80}, {-106, -22}, {-100, -30}, {-94, -22}, {-94, -80}, {-52, -80}, {-52, -122}, {-146, -122}}, lineColor = {0, 0, 0}, fillColor = {170, 255, 170}, fillPattern = FillPattern.Solid), Polygon(points = {{-180, -50}, {-134, -50}, {-134, -26}, {-62, -26}, {-62, -50}, {-20, -50}, {-20, -42}, {-54, -42}, {-54, -18}, {-142, -18}, {-142, -42}, {-180, -42}, {-180, -50}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Rectangle(extent = {{20, 142}, {180, 40}}, lineColor = {0, 0, 255}, fillColor = {128, 255, 0}, fillPattern = FillPattern.Solid), Text(extent = {{50, 144}, {146, 76}}, lineColor = {0, 0, 255}, textString = "E"), Rectangle(extent = {{-180, 142}, {-20, 40}}, lineColor = {0, 0, 255}, fillColor = {72, 143, 0}, fillPattern = FillPattern.Solid), Line(points = {{-160, 40}, {-160, 118}, {-100, 74}, {-100, 74}, {-100, 74}}, color = {255, 0, 0}, thickness = 1), Text(extent = {{-148, 148}, {-52, 80}}, lineColor = {0, 0, 255}, textString = "E"), Line(points = {{38, 40}, {38, 118}, {98, 74}, {158, 122}, {158, 40}}, color = {0, 0, 0}, thickness = 1), Line(points = {{-20, 100}, {20, 100}}, color = {0, 0, 255}, thickness = 1), Line(points = {{-160, 0}, {-160, 40}}, color = {255, 0, 0}, thickness = 1), Line(points = {{-40, 0}, {-40, 40}}, color = {0, 0, 255}, thickness = 1), Polygon(points = {{-20, -50}, {26, -50}, {26, -50}, {38, -50}, {38, -50}, {44, -50}, {44, 40}, {36, 40}, {36, -42}, {18, -42}, {18, -42}, {-20, -42}, {-20, -50}}, lineColor = {0, 0, 255}, pattern = LinePattern.None, fillColor = {0, 0, 0}, fillPattern = FillPattern.Solid), Line(points = {{-40, 40}, {-40, 118}, {-100, 74}, {-100, 74}, {-100, 74}}, color = {0, 0, 255}, thickness = 1), Line(points = {{40, 40}, {40, 118}, {100, 74}, {160, 122}, {160, 40}}, color = {0, 0, 0}, thickness = 1), Line(points = {{42, 40}, {42, 118}, {102, 74}, {162, 122}, {162, 40}}, color = {0, 0, 0}, thickness = 1)}), + connect(ExchangerWaterWater.Ef, inletWaterSteam) annotation (Line(points={{-9.19104e-016, + -80},{0,-80},{0,-100},{-140,-100},{-140,100},{-200,100}})); + connect(PDC2.C1, ExchangerWaterWater.Sf) + annotation (Line(points={{-80,-20},{-80,-40},{-0.14,-40},{-0.14,-52}})); + connect(PDC1.C2, ExchangerWaterWater.Ec) + annotation (Line(points={{-60,-20},{-60,-71.6}, + {-5.74,-71.6}}, color={0,0,0})); + connect(AirMassFlowRate.y, AirSource.IMassFlow) + annotation (Line(points={{41,40},{52,40},{52,20}})); + connect(WaterSource.IMassFlow, WaterMassFlowRate.y) + annotation (Line(points={{51,-29.5},{51,-26},{79.2,-26}})); + connect(silencieux.C1, Engine.Cfg) annotation (Line( + points={{-39,6},{-40,6},{-40,1.32262e-015},{-21.6,1.32262e-015}}, + color={0,0,0}, + thickness=0.5)); + connect(Engine.Cws1, WaterSource.C) annotation (Line(points={{-1.32262e-015,-21.6}, + {-1.32262e-015,-35},{40,-35}})); + connect(Engine.Cair, AirSource.C) annotation (Line( + points={{21.6,-1.77636e-015},{32,-1.77636e-015},{32,14},{40,14}}, + color={0,0,0}, + thickness=0.5)); + connect(PDC1.C1, Engine.Cws2) + annotation (Line(points={{-60,0},{-60,32},{1.32262e-015,32},{1.32262e-015, + 21.6}})); + connect(Engine.Cfuel, FuelSource.C) annotation (Line(points={{21.6,-16.8},{32, + -16.8},{32,-14},{38,-14}}, color={0,0,0})); + connect(silencieux.C2, ExchangerWaterFlueGases.Ec) annotation (Line(points={{-39,26}, + {-40,26},{-40,58},{-40,62.4},{-5.74,62.4}}, color={0,0,0}, + thickness=0.5)); + connect(AirTemperature.y, AirSource.ISpecificEnthalpyOrTemperature) + annotation (Line(points={{79,0},{64,0},{52,0},{52,8}}, color={0,0,255})); + connect(ExchangerWaterFlueGases.Sf, outletWaterSteam) annotation (Line(points= + {{-0.14,82},{-0.14,100},{200,100}}, color={0,0,0})); + connect(PDC2.C2, ExchangerWaterFlueGases.Ef) annotation (Line(points={{-80,0}, + {-80,44},{8.88178e-016,44},{8.88178e-016,54}}, color={0,0,0})); + connect(ExchangerWaterFlueGases.Sc, FlueGasesSink.C) annotation (Line( + points={{-5.74,73.6},{-40,73.6},{-40,98},{-56,98}}, + color={0,0,0}, + thickness=0.5)); + connect(WaterSteamSink.C, ExchangerWaterWater.Sc) annotation (Line(points={{-22, + -60},{-14,-60},{-14,-60.4},{-5.74,-60.4}}, color={0,0,0})); + annotation (Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-200,-200},{200,200}}, + initialScale=0.1)), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-200,-200},{200,200}}, + initialScale=0.1), graphics={ + Rectangle( + extent={{-200,200},{200,-200}}, + lineColor={0,0,0}, + pattern=LinePattern.Dash, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-180,0},{-20,-160}}, + lineColor={0,0,255}, + fillColor={255,213,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-110,-144},{-96,-126},{-100,-136},{-82,-134},{-98,-140},{-78, + -146},{-94,-144},{-110,-156},{-102,-146},{-110,-144}}, + lineColor={0,0,0}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-146,-122},{-146,-80},{-106,-80},{-106,-22},{-100,-30},{-94, + -22},{-94,-80},{-52,-80},{-52,-122},{-146,-122}}, + lineColor={0,0,0}, + fillColor={170,255,170}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-180,-50},{-134,-50},{-134,-26},{-62,-26},{-62,-50},{-20,-50}, + {-20,-42},{-54,-42},{-54,-18},{-142,-18},{-142,-42},{-180,-42},{ + -180,-50}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{20,142},{180,40}}, + lineColor={0,0,255}, + fillColor={128,255,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{50,144},{146,76}}, + lineColor={0,0,255}, + textString= + "E"), + Rectangle( + extent={{-180,142},{-20,40}}, + lineColor={0,0,255}, + fillColor={72,143,0}, + fillPattern=FillPattern.Solid), + Line( + points={{-160,40},{-160,118},{-100,74},{-100,74},{-100,74}}, + color={255,0,0}, + thickness=1), + Text( + extent={{-148,148},{-52,80}}, + lineColor={0,0,255}, + textString= + "E"), + Line( + points={{38,40},{38,118},{98,74},{158,122},{158,40}}, + color={0,0,0}, + thickness=1), + Line( + points={{-20,100},{20,100}}, + color={0,0,255}, + thickness=1), + Line( + points={{-160,0},{-160,40}}, + color={255,0,0}, + thickness=1), + Line( + points={{-40,0},{-40,40}}, + color={0,0,255}, + thickness=1), + Polygon( + points={{-20,-50},{26,-50},{26,-50},{38,-50},{38,-50},{44,-50},{44,40}, + {36,40},{36,-42},{18,-42},{18,-42},{-20,-42},{-20,-50}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Line( + points={{-40,40},{-40,118},{-100,74},{-100,74},{-100,74}}, + color={0,0,255}, + thickness=1), + Line( + points={{40,40},{40,118},{100,74},{160,122},{160,40}}, + color={0,0,0}, + thickness=1), + Line( + points={{42,40},{42,118},{102,74},{162,122},{162,40}}, + color={0,0,0}, + thickness=1)}), DymolaStoredErrors, Documentation(revisions = " Authors @@ -87,4 +281,4 @@ Bruno Péchiné ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end CHPEngineBarkantineSystem; \ No newline at end of file +end CHPEngineBarkantineSystem; From 5c2fc59874f46f3b53272fd732b9750b703b977a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 17:15:31 +0200 Subject: [PATCH 194/213] #125 port Fluid media and junction examples onto develop --- .../Junctions/TestDeheaterMixer2.mo | 46 +++++++ .../Junctions/TestDeheaterMixer2_FlueGases.mo | 53 ++++++++ .../Junctions/TestDeheaterMixer2_Traces.mo | 48 ++++++++ .../SimpleExamples/Junctions/TestDryer.mo | 16 +++ .../Junctions/TestDryer_Traces.mo | 16 +++ .../Junctions/TestMassFlowMultiplier.mo | 40 ++++++ .../TestMassFlowMultiplier_FlueGases.mo | 51 ++++++++ .../TestMassFlowMultiplier_Traces.mo | 43 +++++++ .../SimpleExamples/Junctions/TestMixer2.mo | 26 ++++ .../Junctions/TestMixer2_FlueGases.mo | 38 ++++++ .../Junctions/TestMixer2_Traces.mo | 29 +++++ .../SimpleExamples/Junctions/TestMixer3.mo | 31 +++++ .../Junctions/TestMixer3_FlueGases.mo | 35 ++++++ .../Junctions/TestMixer3_Traces.mo | 33 +++++ .../SimpleExamples/Junctions/TestMixer8.mo | 84 +++++++++++++ .../Junctions/TestMixer8_Traces.mo | 87 +++++++++++++ .../SimpleExamples/Junctions/TestSplitter2.mo | 26 ++++ .../Junctions/TestSplitter2_FlueGases.mo | 41 +++++++ .../Junctions/TestSplitter2_Traces.mo | 30 +++++ .../SimpleExamples/Junctions/TestSplitter3.mo | 35 ++++++ .../Junctions/TestSplitter3_FlueGases.mo | 41 +++++++ .../Junctions/TestSplitter3_Traces.mo | 38 ++++++ .../Junctions/TestStaticDrum.mo | 28 +++++ .../Junctions/TestStaticDrum_Plug.mo | 53 ++++++++ .../Junctions/TestStaticDrum_Plug_Traces.mo | 57 +++++++++ .../Junctions/TestStaticDrum_Traces.mo | 30 +++++ .../Junctions/TestSteamExtractionSplitter.mo | 27 ++++ .../TestSteamExtractionSplitter_Traces.mo | 27 ++++ .../SimpleExamples/Junctions/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Junctions/package.order | 28 +++++ .../SimpleExamples/Media/TestC3H3F5.mo | 41 +++++++ .../Media/TestDryAirIdealGas.mo | 32 +++++ .../SimpleExamples/Media/TestMoltenSalt.mo | 32 +++++ .../Media/TestWaterSteamSimple.mo | 35 ++++++ .../PhasesSeparation.mo | 18 +++ .../WaterSteam_FullyVolatileTrace/package.mo | 5 + .../package.order | 1 + .../PhasesSeparation.mo | 18 +++ .../WaterSteam_NonVolatileTrace/package.mo | 5 + .../WaterSteam_NonVolatileTrace/package.order | 1 + .../Examples/SimpleExamples/Media/package.mo | 116 ++++++++++++++++++ .../SimpleExamples/Media/package.order | 6 + .../Examples/SimpleExamples/package.order | 2 + ThermoSysPro/UsersGuide/Icons/Example.mo | 22 ++++ ThermoSysPro/UsersGuide/Icons/package.mo | 4 + ThermoSysPro/UsersGuide/Icons/package.order | 1 + ThermoSysPro/UsersGuide/package.order | 1 + 47 files changed, 1593 insertions(+) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order create mode 100644 ThermoSysPro/UsersGuide/Icons/Example.mo create mode 100644 ThermoSysPro/UsersGuide/Icons/package.mo create mode 100644 ThermoSysPro/UsersGuide/Icons/package.order diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo new file mode 100644 index 00000000..8e92ed16 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, Tmax=308) annotation (Placement(transformation(extent={{-10,-16},{10,4}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, T0=310) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, h0=30000) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}},rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo new file mode 100644 index 00000000..47bc0115 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, + Tmax=308, + h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-16},{10,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, + h0=2.5e6, + option_temperature=false) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}, rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo new file mode 100644 index 00000000..bb783883 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, Tmax=308) annotation (Placement(transformation(extent={{-10,-16},{10,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, T0=310) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, h0=30000) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}, rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo new file mode 100644 index 00000000..6bb1a642 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); +equation + connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); + connect(sink.C, steamDryer.Csv) annotation (Line(points={{30,0},{9.9,0}}, color={0,0,0})); + connect(steamDryer.Csl, sink_cond.C) annotation (Line(points={{0.1,-14},{0.1,-30},{30,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDryer; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo new file mode 100644 index 00000000..a78582a8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6, + SubC0={1}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamDryer.xe)) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); +equation + connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); + connect(sink.C, steamDryer.Csv) annotation (Line(points={{30,0},{9.9,0}}, color={0,0,0})); + connect(steamDryer.Csl, sink_cond.C) annotation (Line(points={{0.1,-14},{0.1,-30},{30,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDryer_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo new file mode 100644 index 00000000..ac220531 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo @@ -0,0 +1,40 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo new file mode 100644 index 00000000..789689ec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo @@ -0,0 +1,51 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true, + C(h_vol_2(start=2830566))) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium, rho(start=27, displayUnit="kg/m3")) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium, rho(displayUnit="kg/m3", start=27)) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo new file mode 100644 index 00000000..623e1b0e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo new file mode 100644 index 00000000..88646025 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo new file mode 100644 index 00000000..a89f075e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP( + redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP( + redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo new file mode 100644 index 00000000..108d702f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, SubC0={10}) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, SubC0={20}) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo new file mode 100644 index 00000000..7161949d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-86,-10},{-66,10}},rotation=0))); +equation + connect(singularPressureLoss1.C2,mixer3_1. Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2,mixer3_1. Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y,mixer3_1. Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer3; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo new file mode 100644 index 00000000..ed8b978e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{-86,-10},{-66,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer3_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer3_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer3_1.Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer3_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo new file mode 100644 index 00000000..e0839bec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-10},{-66,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer3_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer3_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer3_1.Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer3_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo new file mode 100644 index 00000000..b653f8bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo @@ -0,0 +1,84 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer8 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(h_vol_2(start=71016.12237181116)), + Q(start=1659.0367844064706)) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=2e5, + Q(start=240.90950915749266)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( + redeclare package Medium = Medium, + C1(h_vol_2(start=71004.06316721764)), + C2(h_vol_1(start=70977.89042837733)), + Pm(start=120690.8728732298)) annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve2( + redeclare package Medium = Medium, + C1(h_vol_1(start=70921.01678153824)), + Pm(start=118970.64778985853)) annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve3( + redeclare package Medium = Medium, + Q(start=1899.9462935639633), + Pm(start=148922.95104974302, displayUnit="bar")) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{82,-30},{102,-10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2( + Duration=1, + Initialvalue=1, + Finalvalue=0.05) annotation (Placement(transformation(extent={{32,20},{52,40}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3( + Initialvalue=1, + Starttime=2, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4( + Initialvalue=1, + Starttime=1, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe1(redeclare package Medium = Medium, Pm(start=286222.6050714449, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe2(redeclare package Medium = Medium, Pm(start=199709.4772494724, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=0))); +equation + connect(valve3.C2, puitsP2.C) annotation (Line(points={{70,-20},{82,-20}}, color={0,0,255})); + connect(rampe2.y, valve3.Ouv) annotation (Line(points={{53,30},{60,30},{60,-3}})); + connect(rampe3.y, valve1.Ouv) annotation (Line(points={{-9,40},{0,40},{0,27}})); + connect(rampe4.y, valve2.Ouv) annotation (Line(points={{-9,-20},{0,-20},{0,-33}})); + connect(sourceP.C, pipe1.C1) annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255})); + connect(sourceP1.C, pipe2.C1) annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255})); + connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},{-50,14},{-40.2,14}}, color={0,0,255})); + connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}}, color={0,0,255})); + connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,-20}}, color={0,0,255})); + connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},{33,-9.8}}, color={0,0,255})); + connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,-50},{33,-29.9}}, color={0,0,255})); + connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,-50},{-50,-46},{-40.2,-46}}, color={0,0,255})); + connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,-50}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer8; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo new file mode 100644 index 00000000..c4016de3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo @@ -0,0 +1,87 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer8_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(h_vol_2(start=71016.12237181116)), + Q(start=1659.0367844064706)) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=2e5, + Q(start=240.90950915749266)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( + redeclare package Medium = Medium, + C1(h_vol_2(start=71004.06316721764)), + C2(h_vol_1(start=70977.89042837733)), + Pm(start=120690.8728732298)) annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve2( + redeclare package Medium = Medium, + C1(h_vol_1(start=70921.01678153824)), + Pm(start=118970.64778985853)) annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve3( + redeclare package Medium = Medium, + Q(start=1899.9462935639633), + Pm(start=148922.95104974302, displayUnit="bar")) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{82,-30},{102,-10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2( + Duration=1, + Initialvalue=1, + Finalvalue=0.05) annotation (Placement(transformation(extent={{32,20},{52,40}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3( + Initialvalue=1, + Starttime=2, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,30},{-10,50}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4( + Initialvalue=1, + Starttime=1, + Finalvalue=0.001) annotation (Placement(transformation(extent={{-30,-30},{-10,-10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe1(redeclare package Medium = Medium, Pm(start=286222.6050714449, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe2(redeclare package Medium = Medium, Pm(start=199709.4772494724, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}, rotation=0))); +equation + connect(valve3.C2, puitsP2.C) annotation (Line(points={{70,-20},{82,-20}}, color={0,0,255})); + connect(rampe2.y, valve3.Ouv) annotation (Line(points={{53,30},{60,30},{60,-3}})); + connect(rampe3.y, valve1.Ouv) annotation (Line(points={{-9,40},{0,40},{0,27}})); + connect(rampe4.y, valve2.Ouv) annotation (Line(points={{-9,-20},{0,-20},{0,-33}})); + connect(sourceP.C, pipe1.C1) annotation (Line(points={{-84,10},{-80,10}}, color={0,0,255})); + connect(sourceP1.C, pipe2.C1) annotation (Line(points={{-84,-50},{-80,-50}}, color={0,0,255})); + connect(pipe1.C2, staticVolume.Ce4) annotation (Line(points={{-60,10},{-50,10},{-50,14},{-40.2,14}}, color={0,0,255})); + connect(staticVolume.Cs, valve1.C1) annotation (Line(points={{-20,10},{-10,10}}, color={0,0,255})); + connect(staticVolume1.Cs, valve3.C1) annotation (Line(points={{40,-20},{50,-20}}, color={0,0,255})); + connect(valve1.C2, staticVolume1.Ce1) annotation (Line(points={{10,10},{33,10},{33,-9.8}}, color={0,0,255})); + connect(valve2.C2, staticVolume1.Ce8) annotation (Line(points={{10,-50},{33,-50},{33,-29.9}}, color={0,0,255})); + connect(pipe2.C2, staticVolume2.Ce4) annotation (Line(points={{-60,-50},{-50,-50},{-50,-46},{-40.2,-46}}, color={0,0,255})); + connect(staticVolume2.Cs, valve2.C1) annotation (Line(points={{-20,-50},{-10,-50}}, color={0,0,255})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestMixer8_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo new file mode 100644 index 00000000..7558ca29 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(redeclare replaceable package Medium = Medium, Q0=200) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSplitter2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo new file mode 100644 index 00000000..9443b946 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP( + redeclare replaceable package Medium = Medium, + Q0=200, + T0=573.15, + option_temperature=true, + SubC0={3}) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSplitter2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo new file mode 100644 index 00000000..84f56024 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(redeclare replaceable package Medium = Medium, Q0=200, + SubC0={3}) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSplitter2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo new file mode 100644 index 00000000..4fec417a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,-50},{64,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0) annotation (Placement(transformation(extent={{-36,10},{-16,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-10},{104,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss3.C1) annotation (Line(points={{-76,0},{-56,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},{-15.8,0}}, color={0,0,255})); + connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},{-2,40},{44,40}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkP2.C) annotation (Line(points={{64,40},{84,40}}, color={0,0,255})); + connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},{-2,-40},{44,-40}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkP3.C) annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255})); + connect(constante1.y, splitter3.Ialpha1) annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}})); + connect(splitter3.Cs3, sinkP4.C) annotation (Line(points={{4,0},{84,0}}, color={0,0,255})); + connect(splitter3.Ialpha2, constante2.y) annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo new file mode 100644 index 00000000..0f66835f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,-50},{64,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0) annotation (Placement(transformation(extent={{-36,10},{-16,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{84,-10},{104,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss3.C1) annotation (Line(points={{-76,0},{-56,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},{-15.8,0}}, color={0,0,255})); + connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},{-2,40},{44,40}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkP2.C) annotation (Line(points={{64,40},{84,40}}, color={0,0,255})); + connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},{-2,-40},{44,-40}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkP3.C) annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255})); + connect(constante1.y, splitter3.Ialpha1) annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}})); + connect(splitter3.Cs3, sinkP4.C) annotation (Line(points={{4,0},{84,0}}, color={0,0,255})); + connect(splitter3.Ialpha2, constante2.y) annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo new file mode 100644 index 00000000..3da13371 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,-50},{64,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k=0) annotation (Placement(transformation(extent={{-36,10},{-16,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-10},{104,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k=0) annotation (Placement(transformation(extent={{-36,-30},{-16,-10}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss3.C1) annotation (Line(points={{-76,0},{-56,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, splitter3.Ce) annotation (Line(points={{-36,0},{-15.8,0}}, color={0,0,255})); + connect(splitter3.Cs1, singularPressureLoss4.C1) annotation (Line(points={{-2,10},{-2,40},{44,40}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkP2.C) annotation (Line(points={{64,40},{84,40}}, color={0,0,255})); + connect(splitter3.Cs2, singularPressureLoss5.C1) annotation (Line(points={{-2,-10},{-2,-40},{44,-40}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkP3.C) annotation (Line(points={{64,-40},{84,-40}}, color={0,0,255})); + connect(constante1.y, splitter3.Ialpha1) annotation (Line(points={{-15,20},{-10,20},{-10,6},{-5,6}})); + connect(splitter3.Cs3, sinkP4.C) annotation (Line(points={{4,0},{84,0}}, color={0,0,255})); + connect(splitter3.Ialpha2, constante2.y) annotation (Line(points={{-5,-6},{-10,-6},{-10,-20},{-15,-20}})); + annotation ( + experiment(StopTime=10), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo new file mode 100644 index 00000000..2714cbae --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(sourcePQ.C, singularPressureLossVALI2.C1) annotation (Line(points={{-70,-80},{-66,-80},{-66,-54},{-84,-54},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo new file mode 100644 index 00000000..ad146428 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Plug + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + W0={2.4e8}, + T0={290}) annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug(redeclare package Medium = Medium, C(h(fixed=true))) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}}, color={0,0,255})); + connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}}, color={0,0,255})); + connect(refP.C2, singularPressureLossVALI2.C1) annotation (Line(points={{-6,-80},{-2,-80},{-2,-56},{-84,-56},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Plug; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo new file mode 100644 index 00000000..542d63ee --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Plug_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=StaticDrumTh1.x)) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + W0={2.4e8}, + T0={290}) annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug( + redeclare package Medium = Medium, + SubC0={10}) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-60,0.6},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(refQ.C2, refP.C1) annotation (Line(points={{-36,-80},{-26,-80}}, color={0,0,255})); + connect(sourcePlug.C, refQ.C1) annotation (Line(points={{-70,-80},{-56,-80}}, color={0,0,255})); + connect(refP.C2, singularPressureLossVALI2.C1) annotation (Line(points={{-6,-80},{-2,-80},{-2,-56},{-84,-56},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Plug_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo new file mode 100644 index 00000000..3d5d4c78 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=StaticDrumTh1.x)) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, + P0=10000000, + SubC0={10}) annotation (Placement(transformation(extent={{-90,-90},{-70,-70}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource annotation (Placement(transformation(extent={{-80,20},{-60,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); +equation + connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation (Line(points={{-60,-40},{-48,-40},{-48,0.6}}, color={0,0,255})); + connect(singularPressureLossVALI1.C2, sinkP1.C) annotation (Line(points={{20,0},{40,0}}, color={0,0,255})); + connect(heatSource.C[1], StaticDrumTh1.Cth) annotation (Line(points={{-70,20.2},{-70,10},{-44,10}}, color={191,95,0})); + connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation (Line(points={{-34.6,6.6},{-19.3,6.6},{-19.3,0},{0,0}}, color={0,0,255})); + connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation (Line(points={{-40.2,19.4},{-40.2,60},{-20,60}}, color={0,0,255})); + connect(sourcePQ.C, singularPressureLossVALI2.C1) annotation (Line(points={{-70,-80},{-66,-80},{-66,-54},{-84,-54},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation (experiment(StopTime=1000), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo new file mode 100644 index 00000000..bb39c918 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSteamExtractionSplitter + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2600000) annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium, K=2.e-3) annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0))); +equation + connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255})); + connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(points={{-40,30},{-20.3,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(points={{0.3,30},{20,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{40,30},{60,30}}, color={0,0,255})); + connect(singularPressureLoss3.C2, sink.C) annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamExtractionSplitter; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo new file mode 100644 index 00000000..83e5941e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSteamExtractionSplitter_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamExtractionSplitter.xe)) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2600000) annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium, K=2.e-3) annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-20},{60,0}}, rotation=0))); +equation + connect(sourceQ.C, singularPressureLoss2.C1) annotation (Line(points={{-80,30},{-60,30}}, color={0,0,255})); + connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation (Line(points={{-40,30},{-20.3,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation (Line(points={{0.3,30},{20,30}}, color={0,0,255})); + connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation (Line(points={{-6,20},{-6,-10},{0,-10}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{40,30},{60,30}}, color={0,0,255})); + connect(singularPressureLoss3.C2, sink.C) annotation (Line(points={{20,-10},{40,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Diagram(graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamExtractionSplitter_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo new file mode 100644 index 00000000..92e0061d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Junctions + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Junctions; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order new file mode 100644 index 00000000..f44cdf65 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -0,0 +1,28 @@ +TestDryer +TestDryer_Traces +TestSplitter2 +TestSplitter2_Traces +TestSplitter2_FlueGases +TestMixer2 +TestMixer2_Traces +TestMixer2_FlueGases +TestDeheaterMixer2 +TestDeheaterMixer2_Traces +TestDeheaterMixer2_FlueGases +TestMassFlowMultiplier +TestMassFlowMultiplier_Traces +TestMassFlowMultiplier_FlueGases +TestMixer3 +TestMixer3_Traces +TestMixer3_FlueGases +TestMixer8 +TestMixer8_Traces +TestSplitter3 +TestSplitter3_Traces +TestSplitter3_FlueGases +TestStaticDrum +TestStaticDrum_Traces +TestStaticDrum_Plug +TestStaticDrum_Plug_Traces +TestSteamExtractionSplitter +TestSteamExtractionSplitter_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo new file mode 100644 index 00000000..bb2e9ecf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestC3H3F5 + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.C3H3F5; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.SpecificEnthalpy h = 3e5; + parameter Units.SI.SpecificEntropy s = 1.5e3; + parameter Medium.ThermodynamicState state_ph = Medium.setState_phX(p, h, {1}); + parameter Medium.ThermodynamicState state_ps = Medium.setState_psX(p, s, {1}); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph legacy_ph = + ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps legacy_ps = + ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state_ph) - legacy_ph.T) < eps, + "C3H3F5 medium temperature_ph differs from legacy C3H3F5_Ph"); + assert(abs(Medium.density(state_ph) - legacy_ph.d) < eps, + "C3H3F5 medium density_ph differs from legacy C3H3F5_Ph"); + assert(abs(Medium.specificEntropy(state_ph) - legacy_ph.s) < eps, + "C3H3F5 medium specificEntropy differs from legacy C3H3F5_Ph"); + assert(abs(Medium.vapourQuality(state_ph) - legacy_ph.x) < 1e-4, + "C3H3F5 medium vapourQuality differs from legacy C3H3F5_Ph"); + + assert(abs(Medium.temperature(state_ps) - legacy_ps.T) < eps, + "C3H3F5 medium temperature_ps differs from legacy C3H3F5_Ps"); + assert(abs(Medium.density(state_ps) - legacy_ps.d) < eps, + "C3H3F5 medium density_ps differs from legacy C3H3F5_Ps"); + assert(abs(Medium.specificEnthalpy(state_ps) - legacy_ps.h) < eps, + "C3H3F5 medium specificEnthalpy_ps differs from legacy C3H3F5_Ps"); + + assert(abs(Medium.specificInternalEnergy(state_ph) - (h - p/legacy_ph.d)) < eps, + "C3H3F5 medium internal energy does not match legacy Fluid assumption u=h-p/d"); + assert(abs(Medium.density_derh_p(state_ph) + 1e6) < eps, + "C3H3F5 medium density_derh_p does not match legacy Fluid assumption"); + assert(abs(Medium.density_derp_h(state_ph) - 1e-8) < eps, + "C3H3F5 medium density_derp_h does not match legacy Fluid assumption"); + annotation (experiment(StopTime=1)); +end TestC3H3F5; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo new file mode 100644 index 00000000..6335caae --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestDryAirIdealGas + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.DryAirIdealGas; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.Temperature T = 300; + parameter Units.SI.SpecificEnthalpy h = + ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(p, T, 6, 0, 0, 0, 0, 0); + parameter Medium.ThermodynamicState state = Medium.setState_phX(p, h, {1}); + parameter ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas data; + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state) - + ThermoSysPro.Properties.Fluid.Temperature_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium temperature differs from legacy Fluid wrapper"); + assert(abs(Medium.density(state) - + ThermoSysPro.Properties.Fluid.Density_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density differs from legacy Fluid wrapper"); + assert(abs(Medium.specificEnthalpy_pTX(p, T, {1}) - h) < eps, + "DryAirIdealGas medium specificEnthalpy_pTX differs from legacy Fluid wrapper"); + assert(abs(Medium.specificInternalEnergy(state) - (h - data.specificGasConstant*Medium.temperature(state))) < eps, + "DryAirIdealGas medium internal energy differs from legacy Fluid assumption"); + assert(abs(Medium.density_derh_p(state) - + ThermoSysPro.Properties.Fluid.Density_derh_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density_derh_p differs from legacy Fluid wrapper"); + assert(abs(Medium.density_derp_h(state) - + ThermoSysPro.Properties.Fluid.Density_derp_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density_derp_h differs from legacy Fluid wrapper"); + annotation (experiment(StopTime=1)); +end TestDryAirIdealGas; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo new file mode 100644 index 00000000..c6a355da --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestMoltenSalt + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.MoltenSalt; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.Temperature T = 600; + parameter Units.SI.SpecificEnthalpy h = + ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(p, T, 4, 0, 0, 0, 0, 0); + parameter Medium.ThermodynamicState state = Medium.setState_phX(p, h, {1}); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state) - + ThermoSysPro.Properties.Fluid.Temperature_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium temperature differs from legacy Fluid wrapper"); + assert(abs(Medium.density(state) - + ThermoSysPro.Properties.Fluid.Density_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density differs from legacy Fluid wrapper"); + assert(abs(Medium.specificEnthalpy_pTX(p, T, {1}) - h) < eps, + "MoltenSalt medium specificEnthalpy_pTX differs from legacy Fluid wrapper"); + assert(abs(Medium.specificInternalEnergy(state) - + ThermoSysPro.Properties.Fluid.SpecificInternalEnergy_Ph_DO_NOT_USE(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium internal energy differs from legacy Fluid assumption"); + assert(abs(Medium.density_derh_p(state) - + ThermoSysPro.Properties.Fluid.Density_derh_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density_derh_p differs from legacy Fluid wrapper"); + assert(abs(Medium.density_derp_h(state) - + ThermoSysPro.Properties.Fluid.Density_derp_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density_derp_h differs from legacy Fluid wrapper"); + annotation (experiment(StopTime=1)); +end TestMoltenSalt; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo new file mode 100644 index 00000000..d20ae3ca --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestWaterSteamSimple + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.WaterSteamSimple; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.SpecificEnthalpy h = 3e5; + parameter Units.SI.SpecificEntropy s = 1000; + parameter Medium.ThermodynamicState state_ph = Medium.setState_phX(p, h, {1}); + parameter Medium.ThermodynamicState state_ps = Medium.setState_psX(p, s, {1}); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph legacy_ph = + ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, 0); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps legacy_ps = + ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ps(p, s, 0); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state_ph) - legacy_ph.T) < eps, + "WaterSteamSimple medium temperature_ph differs from legacy SimpleWater"); + assert(abs(Medium.density(state_ph) - legacy_ph.d) < eps, + "WaterSteamSimple medium density_ph differs from legacy SimpleWater"); + assert(abs(Medium.specificEntropy(state_ph) - legacy_ph.s) < eps, + "WaterSteamSimple medium entropy differs from legacy SimpleWater"); + assert(abs(Medium.temperature(state_ps) - legacy_ps.T) < eps, + "WaterSteamSimple medium temperature_ps differs from legacy SimpleWater"); + assert(abs(Medium.density(state_ps) - legacy_ps.d) < eps, + "WaterSteamSimple medium density_ps differs from legacy SimpleWater"); + assert(abs(Medium.specificEnthalpy(state_ps) - legacy_ps.h) < eps, + "WaterSteamSimple medium enthalpy_ps differs from legacy SimpleWater"); + assert(abs(Medium.density_derh_p(state_ph) - legacy_ph.ddhp) < eps, + "WaterSteamSimple medium density_derh_p differs from legacy SimpleWater"); + assert(abs(Medium.density_derp_h(state_ph) - legacy_ph.ddph) < eps, + "WaterSteamSimple medium density_derp_h differs from legacy SimpleWater"); + annotation (experiment(StopTime=1)); +end TestWaterSteamSimple; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo new file mode 100644 index 00000000..988c4877 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; +function PhasesSeparation + extends partialPhasesSeparation; + input Real x(min=0, max=1) "Title"; + +algorithm + // // HomogeneousSubstance + // C_record.Cl := SubC; + // C_record.Cg := SubC; + + // // Non-volatile + // C_record.Cl := SubC/(1 - x); + // C_record.Cg := fill(0, size(SubC, 1)); + +// Fully-volatile +C_record.Cl := fill(0,size(SubC,1)); +C_record.Cg := SubC / x; +end PhasesSeparation; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo new file mode 100644 index 00000000..fabdb6d5 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +package WaterSteam_FullyVolatileTrace + extends Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + +end WaterSteam_FullyVolatileTrace; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order new file mode 100644 index 00000000..11ebc226 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order @@ -0,0 +1 @@ +PhasesSeparation diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo new file mode 100644 index 00000000..b9c1251f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; +function PhasesSeparation + extends partialPhasesSeparation; + input Real x(min=0, max=1) "Title"; + +algorithm + // // HomogeneousSubstance + // C_record.Cl := SubC; + // C_record.Cg := SubC; + + // Non-volatile + C_record.Cl := SubC/max(1 - x, Modelica.Constants.eps); + C_record.Cg := fill(0, size(SubC, 1)); + + // // Fully-volatile + // C_record.Cl := fill(0,size(SubC,1)); + // C_record.Cg := SubC / x; +end PhasesSeparation; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo new file mode 100644 index 00000000..09644f8a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +package WaterSteam_NonVolatileTrace + extends Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + +end WaterSteam_NonVolatileTrace; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order new file mode 100644 index 00000000..11ebc226 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order @@ -0,0 +1 @@ +PhasesSeparation diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo new file mode 100644 index 00000000..92af1d3a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo @@ -0,0 +1,116 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Media + + annotation (Icon(graphics={ + Text( + extent={{-102,0},{24,-26}}, + lineColor={242,148,0}, + textString= + "Thermo"), + Text( + extent={{-4,8},{68,-34}}, + lineColor={46,170,220}, + textString= + "SysPro"), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,30},{-6,26}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,36},{-6,32}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,42},{-6,38}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-8,48},{-6,44}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,32},{-2,28}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,38},{-2,34}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,44},{-2,40}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-4,50},{-2,46}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, + lineColor={242,148,0}, + fillColor={242,148,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,12},{22,14},{22,16},{24,14},{20,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{26,12},{26,14},{26,16},{28,14},{24,18}}, + color={46,170,220}, + thickness=0.5), + Line( + points={{30,10},{30,12},{30,14},{32,12},{28,16}}, + color={46,170,220}, + thickness=0.5), + Polygon( + points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, + lineColor={46,170,220}, + fillColor={46,170,220}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), + Line( + points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{80,80},{100,100}}, + color={0,0,255}, + smooth=Smooth.None)})); +end Media; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order new file mode 100644 index 00000000..66036803 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.order @@ -0,0 +1,6 @@ +WaterSteam_NonVolatileTrace +WaterSteam_FullyVolatileTrace +TestC3H3F5 +TestMoltenSalt +TestDryAirIdealGas +TestWaterSteamSimple diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order index f1d67d76..d459818c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order @@ -84,3 +84,5 @@ TestTwoPhaseVolume TestVolumeA TestVolumeA1 TestVolumeI +Junctions +Media diff --git a/ThermoSysPro/UsersGuide/Icons/Example.mo b/ThermoSysPro/UsersGuide/Icons/Example.mo new file mode 100644 index 00000000..226066a6 --- /dev/null +++ b/ThermoSysPro/UsersGuide/Icons/Example.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.UsersGuide.Icons; + +partial model Example + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100,-100},{100,100}}, + radius=25.0), + Polygon( + origin={8,14}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), Diagram(coordinateSystem(preserveAspectRatio=false))); +end Example; diff --git a/ThermoSysPro/UsersGuide/Icons/package.mo b/ThermoSysPro/UsersGuide/Icons/package.mo new file mode 100644 index 00000000..edc7ec0b --- /dev/null +++ b/ThermoSysPro/UsersGuide/Icons/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.UsersGuide; + +package Icons +end Icons; diff --git a/ThermoSysPro/UsersGuide/Icons/package.order b/ThermoSysPro/UsersGuide/Icons/package.order new file mode 100644 index 00000000..12a719a4 --- /dev/null +++ b/ThermoSysPro/UsersGuide/Icons/package.order @@ -0,0 +1 @@ +Example diff --git a/ThermoSysPro/UsersGuide/package.order b/ThermoSysPro/UsersGuide/package.order index f0f94eeb..c527a265 100644 --- a/ThermoSysPro/UsersGuide/package.order +++ b/ThermoSysPro/UsersGuide/package.order @@ -2,3 +2,4 @@ ReleaseNotes Contact ThermoSysProLicense Documentation +Icons From 3a49575f7f5dbcb97e8b1e377ce5bbe9a9659a2a Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 17:39:10 +0200 Subject: [PATCH 195/213] #125 restore Fluid icon color inheritance --- ThermoSysPro/Fluid/Machines/GasTurbine.mo | 2 ++ ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo | 2 ++ ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo | 2 ++ 3 files changed, 6 insertions(+) diff --git a/ThermoSysPro/Fluid/Machines/GasTurbine.mo b/ThermoSysPro/Fluid/Machines/GasTurbine.mo index a387d09f..beb0057d 100644 --- a/ThermoSysPro/Fluid/Machines/GasTurbine.mo +++ b/ThermoSysPro/Fluid/Machines/GasTurbine.mo @@ -1,5 +1,7 @@ within ThermoSysPro.Fluid.Machines; model GasTurbine "Combustion turbine for CICO and Barilla plants" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); diff --git a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo index 065776b9..adc3c2ec 100644 --- a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo +++ b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo @@ -1,5 +1,7 @@ within ThermoSysPro.Fluid.Machines; model HeatPumpCompressor "Heat pump compressor " + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.C3H3F5 constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); diff --git a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo index f56d1b00..daad34ac 100644 --- a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo +++ b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo @@ -1,5 +1,7 @@ within ThermoSysPro.Fluid.PressureLosses; model InvSingularPressureLoss "Inverse singular pressure loss" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.MassFlowRate gamma_diff=1e-4 From be3470fba31083463c3a7b50bbe072b26d432d10 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 24 Jul 2026 17:40:51 +0200 Subject: [PATCH 196/213] #125 port remaining Fluid SimpleExamples onto develop --- .../Boilers/TestBoilerSystem.mo | 60 +++++++++ .../Boilers/TestFossilFuelBoiler.mo | 77 +++++++++++ .../SimpleExamples/Boilers/package.mo | 4 + .../SimpleExamples/Boilers/package.order | 2 + .../BoundaryConditions/TestAirHumidity.mo | 56 ++++++++ .../TestAirHumidity_Traces.mo | 59 ++++++++ .../BoundaryConditions/TestRefH.mo | 63 +++++++++ .../BoundaryConditions/TestRefH_Traces.mo | 17 +++ .../TestRefH_Traces_FlueGases.mo | 19 +++ .../BoundaryConditions/TestRefP.mo | 36 +++++ .../BoundaryConditions/TestRefP_Traces.mo | 34 +++++ .../TestRefP_Traces_FlueGases.mo | 46 +++++++ .../BoundaryConditions/TestRefQ.mo | 34 +++++ .../BoundaryConditions/TestRefQ_Traces.mo | 33 +++++ .../TestRefQ_Traces_FlueGases.mo | 34 +++++ .../BoundaryConditions/TestRefSubC_Traces.mo | 29 ++++ .../BoundaryConditions/TestRefT.mo | 24 ++++ .../BoundaryConditions/TestRefX_FlueGases.mo | 28 ++++ .../BoundaryConditions/package.mo | 4 + .../BoundaryConditions/package.order | 14 ++ .../Combustion/TestGTCombustionChamber.mo | 49 +++++++ .../Combustion/TestGenericCombustion.mo | 49 +++++++ .../Combustion/TestGenericCombustion1D.mo | 27 ++++ .../TestGenericCombustion1DWithPipe.mo | 109 +++++++++++++++ .../Combustion/TestGridFurnace.mo | 73 ++++++++++ .../Combustion/TestPostCombustionGas.mo | 67 ++++++++++ .../SimpleExamples/Combustion/package.mo | 4 + .../SimpleExamples/Combustion/package.order | 6 + .../HeatExchangers/TestDynamicCondenser.mo | 52 ++++++++ .../TestDynamicCondenser_Traces.mo | 7 + ...DynamicFlueGasesMultiFluidHeatExchanger.mo | 27 ++++ ...FlueGasesMultiFluidHeatExchanger_Traces.mo | 8 ++ .../TestDynamicMultiFluidHeatExchanger.mo | 24 ++++ ...TestDynamicMultiFluidHeatExchangerShell.mo | 27 ++++ ...cMultiFluidHeatExchangerShell_FlueGases.mo | 16 +++ ...amicMultiFluidHeatExchangerShell_Traces.mo | 8 ++ ...ynamicMultiFluidHeatExchanger_FlueGases.mo | 16 +++ ...stDynamicMultiFluidHeatExchanger_Traces.mo | 8 ++ .../TestDynamicOnePhaseFlowPipe.mo | 28 ++++ .../TestDynamicOnePhaseFlowPipe_FlueGases.mo | 42 ++++++ .../TestDynamicOnePhaseFlowPipe_Traces.mo | 31 +++++ .../TestDynamicOnePhaseFlowShell.mo | 28 ++++ .../TestDynamicOnePhaseFlowShell_FlueGases.mo | 42 ++++++ .../TestDynamicOnePhaseFlowShell_Traces.mo | 31 +++++ .../TestDynamicPlateHeatExchanger.mo | 61 +++++++++ .../TestDynamicPlateHeatExchangerW.mo | 48 +++++++ ...TestDynamicPlateHeatExchanger_FlueGases.mo | 59 ++++++++ .../TestDynamicPlateHeatExchanger_Traces.mo | 59 ++++++++ .../TestDynamicTwoPhaseFlowPipe.mo | 43 ++++++ .../TestDynamicTwoPhaseFlowPipe_Traces.mo | 46 +++++++ .../TestDynamicTwoPhaseFlowRiser.mo | 41 ++++++ .../TestDynamicTwoPhaseFlowRiser_Traces.mo | 44 ++++++ .../HeatExchangers/TestDynamicWaterHeater.mo | 38 ++++++ .../TestDynamicWaterHeaterOnePipe.mo | 35 +++++ .../TestDynamicWaterHeaterOnePipe_Traces.mo | 7 + .../TestDynamicWaterHeater_Traces.mo | 7 + ...namicWaterSteamMultiFluidsHeatExchanger.mo | 25 ++++ ...terSteamMultiFluidsHeatExchanger_Traces.mo | 8 ++ .../TestFixedPowerHeatExchanger.mo | 28 ++++ .../TestFixedPowerHeatExchanger_Traces.mo | 17 +++ .../HeatExchangers/TestNTUWaterHeater.mo | 73 ++++++++++ .../TestNTUWaterHeater_FlueGases.mo | 83 ++++++++++++ .../TestNTUWaterHeater_Traces.mo | 85 ++++++++++++ .../TestSimpleDynamicCondenser.mo | 126 ++++++++++++++++++ .../TestSimpleDynamicCondenser_Traces.mo | 8 ++ ...TestSimpleEvaporatorWaterSteamFlueGases.mo | 47 +++++++ ...pleEvaporatorWaterSteamFlueGases_Traces.mo | 48 +++++++ .../TestSimpleStaticCondenser.mo | 33 +++++ .../TestSimpleStaticCondenser_Traces.mo | 38 ++++++ .../HeatExchangers/TestStaticAerocondenser.mo | 56 ++++++++ .../HeatExchangers/TestStaticCondenser.mo | 89 +++++++++++++ .../HeatExchangers/TestStaticCondenserHEI.mo | 88 ++++++++++++ .../TestStaticCondenserHEI_Traces.mo | 14 ++ .../TestStaticCondenser_Traces.mo | 14 ++ .../TestStaticExchangerDTorWorEff.mo | 37 +++++ ...TestStaticExchangerDTorWorEff_FlueGases.mo | 51 +++++++ .../TestStaticExchangerDTorWorEff_Traces.mo | 42 ++++++ .../HeatExchangers/TestStaticExchangerKS.mo | 28 ++++ .../TestStaticExchangerKS_Traces.mo | 34 +++++ .../TestStaticPlateHeatExchanger.mo | 38 ++++++ .../TestStaticPlateHeatExchanger_FlueGases.mo | 57 ++++++++ .../TestStaticPlateHeatExchanger_Traces.mo | 44 ++++++ ...ticWallFlueGasesExchanger_CustomMixture.mo | 54 ++++++++ ...tStaticWallFlueGasesExchanger_FlueGases.mo | 39 ++++++ ...TestStaticWallFlueGasesExchanger_Traces.mo | 53 ++++++++ .../HeatExchangers/TestSteamGenerator_1SG.mo | 52 ++++++++ .../TestSteamGenerator_1SG_Traces.mo | 7 + .../HeatExchangers/TestSteamGenerator_4SG.mo | 27 ++++ .../TestSteamGenerator_4SG_Traces.mo | 7 + .../SimpleExamples/HeatExchangers/package.mo | 4 + .../HeatExchangers/package.order | 61 +++++++++ .../SimpleExamples/Junctions/package.mo | 114 +--------------- .../LoopBreakers/TestLoopBreakerP.mo | 43 ++++++ .../TestLoopBreakerP_FlueGases.mo | 54 ++++++++ .../LoopBreakers/TestLoopBreakerP_Traces.mo | 46 +++++++ .../LoopBreakers/TestLoopBreakerQH.mo | 24 ++++ .../TestLoopBreakerSubC_Traces.mo | 29 ++++ .../TestLoopBreakerX_FlueGases.mo | 28 ++++ .../SimpleExamples/LoopBreakers/package.mo | 4 + .../SimpleExamples/LoopBreakers/package.order | 6 + .../Machines/TestCHPEngineBarkantineSystem.mo | 57 ++++++++ .../Machines/TestCentrifugalPump.mo | 13 ++ .../Machines/TestCentrifugalPump_FlueGases.mo | 20 +++ .../Machines/TestCentrifugalPump_Traces.mo | 16 +++ .../Machines/TestCombustionTurbine.mo | 46 +++++++ .../Machines/TestCombustionTurbine_Traces.mo | 50 +++++++ .../SimpleExamples/Machines/TestCompressor.mo | 40 ++++++ .../Machines/TestCompressor_Traces.mo | 43 ++++++ .../SimpleExamples/Machines/TestGasTurbine.mo | 120 +++++++++++++++++ .../Machines/TestHeatPumpCompressor.mo | 55 ++++++++ .../Machines/TestInternalCombustionEngine.mo | 93 +++++++++++++ .../Machines/TestStaticCentrifugalPump.mo | 13 ++ .../TestStaticCentrifugalPump_FlueGases.mo | 20 +++ .../TestStaticCentrifugalPump_Traces.mo | 16 +++ .../SimpleExamples/Machines/TestStaticFan.mo | 41 ++++++ .../Machines/TestStaticFan_Traces.mo | 46 +++++++ .../Machines/TestSteamEngine.mo | 31 +++++ .../Machines/TestSteamEngine_Traces.mo | 35 +++++ .../Machines/TestStodolaTurbine.mo | 29 ++++ .../Machines/TestStodolaTurbine_Traces.mo | 31 +++++ .../SimpleExamples/Machines/package.mo | 4 + .../SimpleExamples/Machines/package.order | 20 +++ .../Examples/SimpleExamples/Media/package.mo | 114 +--------------- .../SimpleExamples/PressureLosses/TestBend.mo | 16 +++ .../PressureLosses/TestBend_FlueGases.mo | 23 ++++ .../PressureLosses/TestBend_Traces.mo | 19 +++ .../PressureLosses/TestCheckValve.mo | 16 +++ .../TestCheckValve_FlueGases.mo | 23 ++++ .../PressureLosses/TestCheckValve_Traces.mo | 19 +++ .../PressureLosses/TestControlValve.mo | 29 ++++ .../PressureLosses/TestControlValve_Traces.mo | 30 +++++ .../TestControlValve_Traces_FlueGases.mo | 34 +++++ .../PressureLosses/TestDiaphragm.mo | 13 ++ .../PressureLosses/TestDiaphragm_FlueGases.mo | 20 +++ .../PressureLosses/TestDiaphragm_Traces.mo | 16 +++ .../PressureLosses/TestDynamicCheckValve.mo | 13 ++ .../TestDynamicCheckValve_FlueGases.mo | 20 +++ .../TestDynamicCheckValve_Traces.mo | 16 +++ .../PressureLosses/TestDynamicReliefValve.mo | 19 +++ .../TestDynamicReliefValve_FlueGases.mo | 23 ++++ .../TestDynamicReliefValve_Traces.mo | 22 +++ .../PressureLosses/TestIdealCheckValve.mo | 13 ++ .../TestIdealCheckValve_FlueGases.mo | 20 +++ .../TestIdealCheckValve_Traces.mo | 16 +++ .../PressureLosses/TestIdealSwitchValve.mo | 15 +++ .../TestIdealSwitchValve_FlueGases.mo | 22 +++ .../TestIdealSwitchValve_Traces.mo | 18 +++ .../TestInvSingularPressureLoss.mo | 17 +++ .../TestInvSingularPressureLoss_FlueGases.mo | 22 +++ .../TestInvSingularPressureLoss_Traces.mo | 18 +++ .../PressureLosses/TestLumpedStraightPipe.mo | 18 +++ .../TestLumpedStraightPipe_FlueGases.mo | 23 ++++ .../TestLumpedStraightPipe_Traces.mo | 19 +++ .../PressureLosses/TestPipePressureLoss.mo | 13 ++ .../TestPipePressureLoss_FlueGases.mo | 20 +++ .../TestPipePressureLoss_Traces.mo | 14 ++ .../TestSingularPressureLoss.mo | 22 +++ .../TestSingularPressureLoss_Traces.mo | 22 +++ ...stSingularPressureLoss_Traces_FlueGases.mo | 24 ++++ .../PressureLosses/TestSwitchValve.mo | 15 +++ .../TestSwitchValve_FlueGases.mo | 22 +++ .../PressureLosses/TestSwitchValve_Traces.mo | 18 +++ .../PressureLosses/TestThreeWayValve.mo | 50 +++++++ .../TestThreeWayValve_FlueGases.mo | 54 ++++++++ .../TestThreeWayValve_Traces.mo | 52 ++++++++ .../SimpleExamples/PressureLosses/package.mo | 4 + .../PressureLosses/package.order | 42 ++++++ .../SimpleExamples/Sensors/TestSensors.mo | 25 ++++ .../Sensors/TestSensors_FlueGases.mo | 30 +++++ .../Sensors/TestSensors_Traces.mo | 29 ++++ .../SimpleExamples/Sensors/package.mo | 4 + .../SimpleExamples/Sensors/package.order | 3 + .../SimpleExamples/TestAirHumidity.mo | 26 ---- .../Fluid/Examples/SimpleExamples/TestBend.mo | 24 ---- .../SimpleExamples/TestBoilerSystem.mo | 38 ------ .../TestCHPEngineBarkantineSystem.mo | 24 ---- .../SimpleExamples/TestCentrifugalPump1.mo | 41 ------ .../Examples/SimpleExamples/TestCheckValve.mo | 68 ---------- .../SimpleExamples/TestCombustionTurbine.mo | 28 ---- .../Examples/SimpleExamples/TestCompressor.mo | 23 ---- .../Examples/SimpleExamples/TestDiaphragm.mo | 24 ---- .../TestDiffusion_DynamicOnePhaseFlowPipe.mo | 60 --------- ...TestDiffusion_DynamicPlateHeatExchanger.mo | 30 ----- .../TestDiffusion_DynamicTwoPhaseFlowPipe.mo | 60 --------- .../SimpleExamples/TestDiffusion_VolumeA.mo | 38 ------ .../SimpleExamples/TestDynamicCheckValve.mo | 28 ---- .../SimpleExamples/TestDynamicCondenser.mo | 54 -------- .../SimpleExamples/TestDynamicDrum.mo | 65 --------- .../SimpleExamples/TestDynamicDrum_CC.mo | 71 ---------- ...DynamicFlueGasesMultiFluidHeatExchanger.mo | 30 ----- .../TestDynamicMultiFluidHeatExchanger.mo | 30 ----- ...TestDynamicMultiFluidHeatExchangerShell.mo | 30 ----- .../TestDynamicOnePhaseFlowPipe.mo | 31 ----- .../TestDynamicOnePhaseFlowShell.mo | 33 ----- .../TestDynamicPlateHeatExchanger.mo | 48 ------- .../SimpleExamples/TestDynamicReliefValve.mo | 52 -------- .../TestDynamicTwoPhaseFlowPipe.mo | 52 -------- .../TestDynamicTwoPhaseFlowRiser.mo | 38 ------ .../SimpleExamples/TestDynamicWaterHeating.mo | 86 ------------ .../TestDynamicWaterHeatingOnePipe.mo | 86 ------------ ...ynamicWaterSteamMultiFluidHeatExchanger.mo | 30 ----- .../TestFixedPowerHeatExchanger.mo | 30 ----- .../SimpleExamples/TestFossilFuelBoiler.mo | 42 ------ .../SimpleExamples/TestFresnelField.mo | 59 -------- .../SimpleExamples/TestGTCombustionChamber.mo | 31 ----- .../Examples/SimpleExamples/TestGasTurbine.mo | 42 ------ .../SimpleExamples/TestGenericCombustion.mo | 34 ----- .../SimpleExamples/TestGenericCombustion1D.mo | 51 ------- .../SimpleExamples/TestGridFurnace.mo | 40 ------ .../SimpleExamples/TestHeatPumpCompressor.mo | 21 --- .../SimpleExamples/TestIdealCheckValve.mo | 76 ----------- .../SimpleExamples/TestIdealSwitchValve.mo | 36 ----- .../TestInternalCombustionEngine.mo | 48 ------- .../TestInvSingularPressureLoss.mo | 22 --- .../Examples/SimpleExamples/TestJunctions1.mo | 84 ------------ .../Examples/SimpleExamples/TestJunctions2.mo | 99 -------------- .../Examples/SimpleExamples/TestJunctions3.mo | 67 ---------- .../Examples/SimpleExamples/TestJunctions4.mo | 39 ------ .../SimpleExamples/TestLoopBreaker.mo | 45 ------- .../SimpleExamples/TestMassFlowMultiplier.mo | 30 ----- .../SimpleExamples/TestNTUWaterHeater0.mo | 47 ------- .../SimpleExamples/TestPostCombustionGas.mo | 43 ------ .../SimpleExamples/TestPressurizer.mo | 58 -------- .../Fluid/Examples/SimpleExamples/TestRefP.mo | 44 ------ .../Examples/SimpleExamples/TestRefP1.mo | 38 ------ .../Examples/SimpleExamples/TestSensors.mo | 43 ------ .../TestSimpleDynamicCondenser.mo | 52 -------- .../TestSimpleDynamicCondenser1.mo | 41 ------ ...TestSimpleEvaporatorWaterSteamFlueGases.mo | 30 ----- .../TestSimpleStaticCondenser.mo | 31 ----- .../TestSingularPressureLoss.mo | 24 ---- .../SimpleExamples/TestStaticAerocondenser.mo | 49 ------- .../TestStaticCentrifugalPump1.mo | 24 ---- .../SimpleExamples/TestStaticCondenser.mo | 66 --------- .../SimpleExamples/TestStaticCondenserHEI.mo | 66 --------- .../SimpleExamples/TestStaticDrum1.mo | 62 --------- .../SimpleExamples/TestStaticDrum2.mo | 51 ------- .../TestStaticExchangerDTorWorEff.mo | 31 ----- .../SimpleExamples/TestStaticExchangerKS.mo | 30 ----- .../Examples/SimpleExamples/TestStaticFan.mo | 97 -------------- .../TestStaticPlateHeatExchanger.mo | 31 ----- .../TestStaticWallFlueGasesExchanger.mo | 30 ----- .../SimpleExamples/TestSteamDryer1.mo | 38 ------ .../SimpleExamples/TestSteamDryer2.mo | 38 ------ .../SimpleExamples/TestSteamEngine.mo | 24 ---- .../TestSteamExtractionSplitter.mo | 39 ------ .../SimpleExamples/TestStodolaTurbine1.mo | 45 ------- .../SimpleExamples/TestStodolaTurbine2.mo | 24 ---- .../SimpleExamples/TestSwitchValve.mo | 36 ----- .../Fluid/Examples/SimpleExamples/TestTank.mo | 42 ------ .../SimpleExamples/TestTankHorizontal.mo | 42 ------ .../SimpleExamples/TestThreeWayValve.mo | 32 ----- .../SimpleExamples/TestTwoPhaseCavity.mo | 49 ------- .../TestTwoPhaseCavityOnePipe.mo | 49 ------- .../SimpleExamples/TestTwoPhaseVolume.mo | 49 ------- .../Examples/SimpleExamples/TestVolumeA.mo | 66 --------- .../Examples/SimpleExamples/TestVolumeA1.mo | 45 ------- .../Examples/SimpleExamples/TestVolumeI.mo | 66 --------- .../SimpleExamples/Volumes/TestDynamicDrum.mo | 34 +++++ .../Volumes/TestDynamicDrum_Traces.mo | 37 +++++ .../SimpleExamples/Volumes/TestPressurizer.mo | 123 +++++++++++++++++ .../Volumes/TestPressurizer_Traces.mo | 126 ++++++++++++++++++ ...orizontal_Traces_withPipePressureLosses.mo | 65 +++++++++ ...stTankHorizontal_withPipePressureLosses.mo | 61 +++++++++ .../TestTank_Traces_withPipePressureLosses.mo | 66 +++++++++ .../TestTank_withPipePressureLosses.mo | 61 +++++++++ .../Volumes/TestTwoPhaseCavity.mo | 60 +++++++++ .../Volumes/TestTwoPhaseCavityOnePipe.mo | 57 ++++++++ .../TestTwoPhaseCavityOnePipe_Traces.mo | 63 +++++++++ .../Volumes/TestTwoPhaseCavity_Traces.mo | 65 +++++++++ .../Volumes/TestTwoPhaseVolume.mo | 31 +++++ .../Volumes/TestTwoPhaseVolume_Traces.mo | 35 +++++ .../SimpleExamples/Volumes/TestVolumeA.mo | 19 +++ .../SimpleExamples/Volumes/TestVolumeATh.mo | 17 +++ .../Volumes/TestVolumeATh_FlueGases.mo | 32 +++++ .../Volumes/TestVolumeATh_Traces.mo | 26 ++++ .../Volumes/TestVolumeA_FlueGases.mo | 26 ++++ .../Volumes/TestVolumeA_Traces.mo | 26 ++++ .../SimpleExamples/Volumes/TestVolumeB.mo | 18 +++ .../SimpleExamples/Volumes/TestVolumeBTh.mo | 23 ++++ .../Volumes/TestVolumeBTh_FlueGases.mo | 33 +++++ .../Volumes/TestVolumeBTh_Traces.mo | 32 +++++ .../Volumes/TestVolumeB_FlueGases.mo | 28 ++++ .../Volumes/TestVolumeB_Traces.mo | 27 ++++ .../SimpleExamples/Volumes/TestVolumeC.mo | 15 +++ .../SimpleExamples/Volumes/TestVolumeCTh.mo | 17 +++ .../Volumes/TestVolumeCTh_FlueGases.mo | 27 ++++ .../Volumes/TestVolumeCTh_Traces.mo | 20 +++ .../Volumes/TestVolumeC_FlueGases.mo | 25 ++++ .../Volumes/TestVolumeC_Traces.mo | 17 +++ .../SimpleExamples/Volumes/TestVolumeD.mo | 15 +++ .../SimpleExamples/Volumes/TestVolumeDTh.mo | 18 +++ .../Volumes/TestVolumeDTh_FlueGases.mo | 31 +++++ .../Volumes/TestVolumeDTh_Traces.mo | 30 +++++ .../Volumes/TestVolumeD_FlueGases.mo | 28 ++++ .../Volumes/TestVolumeD_Traces.mo | 27 ++++ .../SimpleExamples/Volumes/TestVolumeI.mo | 15 +++ .../SimpleExamples/Volumes/TestVolumeITh.mo | 18 +++ .../Volumes/TestVolumeITh_FlueGases.mo | 31 +++++ .../Volumes/TestVolumeITh_Traces.mo | 30 +++++ .../Volumes/TestVolumeI_FlueGases.mo | 28 ++++ .../Volumes/TestVolumeI_Traces.mo | 27 ++++ .../SimpleExamples/Volumes/package.mo | 4 + .../SimpleExamples/Volumes/package.order | 44 ++++++ .../Examples/SimpleExamples/package.order | 95 ++----------- 305 files changed, 7252 insertions(+), 4128 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo new file mode 100644 index 00000000..bede404b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo @@ -0,0 +1,60 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Boilers; +model TestBoilerSystem + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.BoilerSystem boilerSystem( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Wloss=0, + Ke=1.e6, + Tsf=386.16) + annotation (Placement(transformation(extent={{-28,-40},{28,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=27, + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) + annotation (Placement(transformation(extent={{-84,-58},{-48,-22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) + annotation (Placement(transformation(extent={{-34,74},{2,110}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + P0=140e5, + Q0=24, + h0=600e3) + annotation (Placement(transformation(extent={{54,-80},{90,-44}}, rotation=180, + origin={132,-126}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWaterSteam(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{54,44},{90,80}}, rotation=180, + origin={90,148}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=932.96)) + annotation (Placement(transformation(extent={{34,-66},{42,-58}}, rotation=90, + origin={-38,-94}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=29.77)) + annotation (Placement(transformation(extent={{34,58},{42,66}}, rotation=90, + origin={112,14}))); +equation + connect(sourceFlueGases.C, boilerSystem.InletFlueGases) annotation (Line(points={{-48,-40},{-24,-40}}, color={0,0,0})); + connect(boilerSystem.OutletFlueGases, sinkFlueGases.C) annotation (Line(points={{-24,40},{-40,40},{-40,92},{-34,92}}, color={0,0,0})); + connect(sourceWaterSteam.C, inletPressureLoss.C1) annotation (Line(points={{42,-64},{24,-64},{24,-60}}, + color={0,0,255})); + connect(inletPressureLoss.C2, boilerSystem.InletWaterSteam) annotation (Line(points={{24,-52},{24,-40}}, color={0,0,255})); + connect(boilerSystem.OutletWaterSteam, outletPressureLoss.C1) annotation (Line(points={{24,40},{48,40},{48,44},{50,44},{50,48}}, + color={0,0,255})); + connect(outletPressureLoss.C2, sinkWaterSteam.C) annotation (Line(points={{50,56},{50,86},{36,86}}, + color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestBoilerSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo new file mode 100644 index 00000000..c9928e94 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo @@ -0,0 +1,77 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Boilers; +model TestFossilFuelBoiler + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.FossilFuelBoiler fossilFuelBoiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Wloss=0, + Ke=1.e6, + Tsf=386.16, + Tea(start=298.16), + Tf(start=2138.32), + deltaPe(start=4028755.6), + rhof(start=0.2733)) + annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( + Xashes=0.011, + rho=1000, + Hum=0.50, + Xc=0.2479, + Xh=0.0297, + Xo=0.2088, + Xn=0.0017, + Xs=0.0003, + LHV=1.5e7, + Q0=0.0407331, + T0=294.45) + annotation (Placement(transformation(extent={{-36,-78},{0,-41}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=27, + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) + annotation (Placement(transformation(extent={{-110,-50},{-71,-13}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) + annotation (Placement(transformation(extent={{68,-51},{110,-12}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + P0=140e5, + Q0=24, + h0=600e3) + annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWaterSteam(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{74,13},{110,49}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=932.96)) + annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=29.77)) + annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0))); +equation + connect(sourceFlueGases.C, fossilFuelBoiler.Cair) annotation (Line( + points={{-71,-31.5},{-63.5,-31.5},{-63.5,-31.62},{-45,-31.62}}, + color={0,0,0}, + thickness=1)); + connect(fossilFuelBoiler.Cfg, sinkFlueGases.C) annotation (Line( + points={{45,-31.62},{62,-31.62},{62,-31.5},{68,-31.5}}, + color={0,0,0}, + thickness=1)); + connect(fuelSourcePQ.C, fossilFuelBoiler.Cfuel) annotation (Line(points={{0,-59.5},{0,-40.8}}, color={0,0,0})); + connect(sourceWaterSteam.C, inletPressureLoss.C1) annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255})); + connect(inletPressureLoss.C2, fossilFuelBoiler.Cws1) annotation (Line(points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255})); + connect(fossilFuelBoiler.Cws2, outletPressureLoss.C1) annotation (Line(points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255})); + connect(outletPressureLoss.C2, sinkWaterSteam.C) annotation (Line(points={{65,31},{74,31}}, color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestFossilFuelBoiler; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo new file mode 100644 index 00000000..6b2ccdaa --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Boilers + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Boilers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order new file mode 100644 index 00000000..5d6f590f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order @@ -0,0 +1,2 @@ +TestFossilFuelBoiler +TestBoilerSystem diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo new file mode 100644 index 00000000..3bd41c98 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo @@ -0,0 +1,56 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestAirHumidity + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity( + redeclare package Medium = Medium, + hum0=0.9, + T0=293, + ppvap0(start=2085), + rho_air(start=1.14), + rho_vap(start=0.015)) annotation (Placement(transformation(extent={{-10,0},{10,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=1.e-5, + rho(start=1.17)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium, + T0=293, + h0=53484, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.0132625 - 0.217282,0.217282,0.0132625,0,0}, + P0=100000, + T0=293) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + +equation + connect(airHumidity.C2, singularPressureLoss.C1) annotation (Line(points={{10,10},{40,10}}, color={0,0,0})); + connect(singularPressureLoss.C2, sinkFlueGases.C) annotation (Line(points={{60,10},{80,10}}, color={0,0,0})); + connect(sourceFlueGasesPQ.C, airHumidity.C1) annotation (Line(points={{-60,10},{-10,10}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestAirHumidity; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo new file mode 100644 index 00000000..6f7a9783 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo @@ -0,0 +1,59 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestAirHumidity_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity( + redeclare package Medium = Medium, + hum0=0.9, + T0=293, + ppvap0(start=2085), + rho_air(start=1.14), + rho_vap(start=0.015)) annotation (Placement(transformation(extent={{-10,0},{10,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=1.e-5, + rho(start=1.17)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium, + T0=293, + h0=53484, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.0132625 - 0.217282,0.217282,0.0132625,0,0}, + P0=100000, + T0=293) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + +equation + connect(airHumidity.C2, singularPressureLoss.C1) annotation (Line(points={{10,10},{40,10}}, color={0,0,0})); + connect(singularPressureLoss.C2, sinkFlueGases.C) annotation (Line(points={{60,10},{80,10}}, color={0,0,0})); + connect(sourceFlueGasesPQ.C, airHumidity.C1) annotation (Line(points={{-60,10},{-10,10}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestAirHumidity_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo new file mode 100644 index 00000000..860e2926 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo @@ -0,0 +1,63 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP( + redeclare package Medium = Medium, + P0=2000000) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=110) + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{126,-10},{146,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefH refH( + redeclare package Medium = Medium, + h0=2600e3) + annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA( + redeclare package Medium = Medium, + h0=2600e3, + dynamic_energy_balance=false) + annotation (Placement(transformation(extent={{20,-50},{0,-30}}))); + InstrumentationAndControl.Blocks.Sources.Constante enthalpy(k=2600e3) + annotation (Placement(transformation(extent={{-58,38},{-38,58}}))); + InstrumentationAndControl.Blocks.Sources.Constante pressure(k=2000000) + annotation (Placement(transformation(extent={{-110,38},{-90,58}}))); + InstrumentationAndControl.Blocks.Sources.Constante massFlow(k=110) + annotation (Placement(transformation(extent={{2,38},{22,58}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{18,-10},{38,10}}, + rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{46,-10},{66,10}}, + rotation=0))); +equation + connect(refP.C2, refH.C1) + annotation (Line(points={{-70,0},{-40,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{112,0},{126,0}}, + color={0,0,0})); + connect(pipePressureLoss.C2, volumeA.Ce1) + annotation (Line(points={{146,0},{150,0},{150,-40},{20,-40}}, + color={0,0,0})); + connect(volumeA.Cs1, refP.C1) + annotation (Line(points={{0,-40},{-102,-40},{-102,0},{-90,0}}, color={0,0,0})); + connect(enthalpy.y, refH.ISpecificEnthalpy) + annotation (Line(points={{-37,48},{-30,48},{-30,11}}, color={0,0,255})); + connect(pressure.y, refP.IPressure) + annotation (Line(points={{-89,48},{-80,48},{-80,11}}, color={0,0,255})); + connect(massFlow.y, refQ.IMassFlow) + annotation (Line(points={{23,48},{102,48},{102,11}}, + color={0,0,255})); + connect(refH.C2, loopBreakerH.C1) annotation (Line(points={{-20,0},{-10,0}}, color={0,0,0})); + connect(loopBreakerH.C2, loopBreakerQ.C1) annotation (Line(points={{10,0},{18,0}}, color={0,0,0})); + connect(loopBreakerQ.C2, loopBreakerP.C1) annotation (Line(points={{38,0},{46,0}}, color={0,0,0})); + connect(loopBreakerP.C2, refQ.C1) annotation (Line(points={{66,0},{92,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo new file mode 100644 index 00000000..cc1aebed --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH_Traces + extends TestRefH( + redeclare package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}), + volumeA( + dynamic_energy_balance=true, + dynamic_mass_balance=true, + steady_state=false, + P0=2000000, + h0=2600e3)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo new file mode 100644 index 00000000..72e57825 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH_Traces_FlueGases + extends TestRefH( + redeclare package Medium = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}), + volumeA( + dynamic_energy_balance=true, + dynamic_mass_balance=true, + dynamic_composition_balance=true, + steady_state=true, + P0=2000000, + h0=2600e3, + X0={0.1,0.2,0.3,0.2,0.2})); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo new file mode 100644 index 00000000..60f4b2b6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo @@ -0,0 +1,36 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=633e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + T0=423.15, + option_temperature=true) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C,refP. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo new file mode 100644 index 00000000..1f0736bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=633e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + T0=423.15, + option_temperature=true, SubC0={10,20,30}) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C,refP. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo new file mode 100644 index 00000000..9aea64c1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare package Medium = + Medium, + T0=453.15, + h0=633193.1, + option_temperature=true) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + Q0=50, + T0=473.15, + h0=633193.1, + option_temperature=true, SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, + T(start=423.15)) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-38,-10},{-18,10}}))); +equation + connect(sinkP.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + connect(sourceQ.C, singularPressureLoss.C1) + annotation (Line(points={{-46,0},{-38,0}}, color={0,0,0})); + connect(singularPressureLoss.C2, refP.C1) + annotation (Line(points={{-18,0},{-10,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo new file mode 100644 index 00000000..63865b8f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, h0=2600e3, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo new file mode 100644 index 00000000..4cda43cc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, h0=2600e3,SubC0={10,20,30}, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo new file mode 100644 index 00000000..3babe41f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=2600e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, + P0=2000000, h0=2600e3,SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo new file mode 100644 index 00000000..a4200c97 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefSubC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefSubC refSubC(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{90,-30},{70,-10}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerSubC loopBreakerSubC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-30},{40,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerSubC.C2) annotation (Line(points={{10,-20},{40,-20}}, color={0,0,0})); + connect(loopBreakerSubC.C1, refSubC.C2) annotation (Line(points={{60,-20},{70,-20}}, color={0,0,0})); + connect(loopBreakerH.C2, refSubC.C1) annotation (Line(points={{50,10},{100,10},{100,-20},{90,-20}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefSubC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo new file mode 100644 index 00000000..b1530cbe --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefT + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerH.C2) annotation (Line(points={{10,-20},{100,-20},{100,10},{50,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefT; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo new file mode 100644 index 00000000..33881c78 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefX_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefXgas refXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{62,0},{82,20}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerXgas loopBreakerXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{64,-30},{44,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(refXgas.C1, loopBreakerH.C2) annotation (Line(points={{62,10},{50,10}}, color={0,0,0})); + connect(volumeA.Ce1, loopBreakerXgas.C2) annotation (Line(points={{10,-20},{44,-20}}, color={0,0,0})); + connect(loopBreakerXgas.C1, refXgas.C2) annotation (Line(points={{64,-20},{100,-20},{100,10},{82,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefX_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo new file mode 100644 index 00000000..bbbaeddd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package BoundaryConditions + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end BoundaryConditions; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order new file mode 100644 index 00000000..1cb5ba44 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -0,0 +1,14 @@ +TestRefQ +TestRefQ_Traces +TestRefQ_Traces_FlueGases +TestRefH +TestRefH_Traces +TestRefH_Traces_FlueGases +TestRefP +TestRefP_Traces +TestRefP_Traces_FlueGases +TestRefT +TestRefSubC_Traces +TestRefX_FlueGases +TestAirHumidity +TestAirHumidity_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo new file mode 100644 index 00000000..0a2ca23b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo @@ -0,0 +1,49 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGTCombustionChamber + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber combustionChamber( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=15e5, + h0=300e3) + annotation (Placement(transformation(extent={{-100,50},{-60,90}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Hum=0, + Xo=0, + Xn=0, + Xs=0, + rho=0.838, + Xc=0.755, + Xh=0.245, + Cp=2255, + T0=410, + Q0=9.30, + LHV=47500e3) + annotation (Placement(transformation(extent={{-100,-90},{-60,-50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{80,-20},{120,20}}, rotation=0))); +equation + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation (Line(points={{-60,70},{-24,70},{-24,36}}, color={0,0,255})); + connect(sourceFuel.C, combustionChamber.Cfuel) annotation (Line(points={{-60,-70},{0,-70},{0,-36}}, color={0,0,0})); + connect(sourceAir.C, combustionChamber.Ca) annotation (Line(points={{-80,0},{-36,0}}, color={0,0,0})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation (Line(points={{36,0},{80,0}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGTCombustionChamber; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo new file mode 100644 index 00000000..353493ee --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo @@ -0,0 +1,49 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion combustionChamber( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=15e5, + h0=300e3) + annotation (Placement(transformation(extent={{-120,10},{-80,50}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Hum=0, + Xo=0, + Xn=0, + Xs=0, + rho=0.838, + Xc=0.755, + Xh=0.245, + Cp=2255, + T0=410, + Q0=9.30, + LHV=47500e3) + annotation (Placement(transformation(extent={{30,-100},{70,-60}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-40,-100},{0,-60}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{-20,80},{20,120}}, rotation=0))); +equation + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation (Line(points={{-80,30},{-70,30},{-70,4},{-36,4}}, color={0,0,255})); + connect(sourceFuel.C, combustionChamber.Cfuel) annotation (Line(points={{70,-80},{28,-80},{28,-36}}, color={0,0,0})); + connect(sourceAir.C, combustionChamber.Ca) annotation (Line(points={{0,-80},{-12,-80},{-12,-36}}, color={0,0,0})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation (Line(points={{-12,36},{-12,100},{-20,100}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGenericCombustion; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo new file mode 100644 index 00000000..dab35fd7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion1D + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D combustionChamber(redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, NCEL = 7, Qm(fixed = false), Qsf(fixed = false), kcham(fixed = true) = 0.1, Acham = 275, Xbf = 0, ImbCV = 0.05, EPSPAR = 0.7, Kec = 8.8, SM = {639.92, 198.58, 466.48, 466.48, 466.48, 358.56, 358.56}, ImbBF = 0.0, Psf(start = 113275)) annotation( + Placement(transformation(origin = {-4, 10}, extent = {{-40, -40}, {40, 40}}))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel(Xn = 0.0208, Xashes = 0.136, Cp = 1200, rho = 1100, LHV = 29245e3, Xc = 0.719, Xh = 0.0414, Xo = 0.086, Xs = 0.0044, Vol = 0.286, Q0 = 57.20, T0 = 358.15, Hum = 0.08) annotation( + Placement(transformation(extent = {{-100, -30}, {-60, 10}}, rotation = 0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(redeclare package Medium = Medium_FlueGases, Q0 = 609.29, P0 = 191000, T0 = 524.89, option_temperature = true, X0 = {0.76, 0.23, 0.01, 0, 0}) annotation( + Placement(transformation(origin = {-80, -74}, extent = {{-20, -100}, {20, -60}}, rotation = 90))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam(redeclare package Medium = Medium, Q0 = 0, P0 = 100000) annotation( + Placement(transformation(extent = {{-100, 30}, {-60, 70}}, rotation = 0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium_FlueGases, T0 = 1200, option_temperature = true) annotation( + Placement(transformation(origin = {24, -18}, extent = {{-20, 80}, {20, 120}}))); +equation + connect(sourceFuel.C, combustionChamber.Cfuel) annotation( + Line(points = {{-60, -10}, {-40, -10}})); + connect(sourceAir.C, combustionChamber.Ca) annotation( + Line(points = {{0, -54}, {0, -45}, {-4, -45}, {-4, -26}})); + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation( + Line(points = {{-60, 50}, {-60, 32}, {-40, 32}, {-40, 30}}, color = {0, 0, 255})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation( + Line(points = {{-4, 46}, {-4, 63}, {4, 63}, {4, 82}})); + annotation( + experiment(StopTime = 1)); +end TestGenericCombustion1D; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo new file mode 100644 index 00000000..80cede49 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo @@ -0,0 +1,109 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion1DWithPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + NCEL=7, + Qm(fixed=false), + Qsf(fixed=false), + kcham(fixed=true) = 0.1, + Acham=275, + Xbf=0, + ImbCV=0.05, + EPSPAR=0.7, + Kec=8.8, + SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56}, + ImbBF=0.0, + Psf(start=113275)) annotation (Placement(transformation(extent={{-62,-56},{62,72}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Xn=0.0208, + Xashes=0.136, + Cp=1200, + rho=1100, + LHV=29245e3, + Xc=0.719, + Xh=0.0414, + Xo=0.086, + Xs=0.0044, + Vol=0.286, + Q0=57.20, + T0=358.15, + Hum=0.08) + annotation (Placement(transformation(extent={{-106,-43},{-72,-5}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=609.29, + P0=191000, + T0=524.89, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=100000) + annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{0,70},{44,112}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe pipeWaterSteam( + redeclare package Medium = Medium, + Ns=7, + inertia=false, + dynamic_energy_balance=false, + z2=56, + rugosrel=5e-5, + ntubes=403, + L=58, + D=0.0327, + P(start=fill(2.0e7, 9)), + Q(start=fill(486.69, 8)), + h(start=fill(1.8e6, 9)), + C2(Q(fixed=false, start=486.69), P(fixed=false, start=1.96318e7, displayUnit="Pa")), + dpfCorr=3.5) + annotation (Placement(transformation(origin={91,8}, extent={{49,16},{-49,-16}}, rotation=270))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall wall( + Ns=7, + dynamic_energy_balance=false, + Tp1(start=fill(500, 7)), + Tp2(start=fill(400, 7)), + lambda=40, + steady_state=true, + ntubes=403, + L=58, + D=0.0327, + e=0.001) + annotation (Placement(transformation(origin={73,7.5}, extent={{51.5,-15},{-51.5,15}}, rotation=270))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePipe( + redeclare package Medium = Medium, + h0=1.292e6, + option_temperature=false, + P0=20112000) + annotation (Placement(transformation(origin={91,-81}, extent={{15,-15},{-15,15}}, rotation=270))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPipe( + redeclare package Medium = Medium, + option_temperature=false, + Q(start=486.69, fixed=true), + h0=2.5e6, + P0(fixed=false) = 19621600) + annotation (Placement(transformation(origin={90,90.5}, extent={{14.5,-15},{-14.5,15}}, rotation=270))); +equation + connect(sourceFuel.C, genericCombustionCCS.Cfuel) annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0})); + connect(genericCombustionCCS.Cfg, sinkFlueGases.C) annotation (Line(points={{0,65.6},{0,91}}, color={0,0,0})); + connect(sourceAir.C, genericCombustionCCS.Ca) annotation (Line(points={{0,-78},{0,-49.6}}, color={0,0,0})); + connect(sourceWaterSteam.C, genericCombustionCCS.Cws) annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255})); + connect(genericCombustionCCS.Cth, wall.WT2) annotation (Line(points={{55.8,8},{68,8},{68,7.5},{76,7.5}}, color={191,95,0})); + connect(wall.WT1, pipeWaterSteam.CTh) + annotation (Line(points={{70,7.5},{71,7.5},{71,8},{86.2,8}}, color={191,95,0})); + connect(sourcePipe.C, pipeWaterSteam.C1) + annotation (Line(points={{91,-66},{91,-41}}, color={0,0,255})); + connect(pipeWaterSteam.C2, sinkPipe.C) + annotation (Line(points={{91,57},{91,76},{90,76}}, color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestGenericCombustion1DWithPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo new file mode 100644 index 00000000..f7dcf2e6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo @@ -0,0 +1,73 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGridFurnace + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSource( + Xn=0.0208, + Xashes=0.136, + Cp=1200, + rho=1100, + LHV=29245e3, + Xc=0.719, + Xh=0.0414, + Xo=0.086, + Xs=0.0044, + Vol=0.286, + Q0=57.20, + T0=358.15, + Hum=0.08) + annotation (Placement(transformation(extent={{-106,-23},{-72,15}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePrimaryAir( + redeclare package Medium = Medium_FlueGases, + T0=300, + Q0=10, + P0=1.9e5, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-74,-80},{-30,-40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{28,50},{72,92}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceCoolingWater( + redeclare package Medium = Medium, + P0=1.e5, + Q0=1) + annotation (Placement(transformation(extent={{89,13},{53,47}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.CombustionChambers.GridFurnace gridFurnace( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Q5eH2O(start=27.562088697651173), + Q5eN2(start=18.629997579210396), + Q5sCO(start=16.083169558220888), + Q5sCO2(start=-23.220946069965017), + Q5sO2(start=-1.7763568394002505E-15), + T2(start=4353.611752483582), + Teap(start=2396.269823464287, displayUnit="degC"), + Teas(start=2396.269823464287, displayUnit="degC"), + Teasm(start=2419.8632089574135, displayUnit="degC"), + Tsf(start=1964.2922985959055), Hsf(start = 4575373),Qeasm(start=14.733687)) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSecondaryAir( + redeclare package Medium = Medium_FlueGases, + option_temperature=true, + T0=300, + Q0=10, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-90,4},{-46,44}}, rotation=0))); +equation + connect(fuelSource.C, gridFurnace.Com) + annotation (Line(points={{-72,-4},{-36,-4}}, color={0,0,0})); + connect(gridFurnace.Cfg, sinkFlueGases.C) + annotation (Line(points={{0,36},{0,71},{28,71}}, color={0,0,0})); + connect(sourceCoolingWater.C, gridFurnace.port_eau_refroid) + annotation (Line(points={{53,30},{32,30},{32,12}}, color={0,0,255})); + connect(sourceSecondaryAir.C, gridFurnace.Ca2) + annotation (Line(points={{-46,24},{-20,24}}, color={0,0,0})); + connect(sourcePrimaryAir.C, gridFurnace.Ca1) + annotation (Line(points={{-30,-60},{0,-60},{0,-36}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGridFurnace; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo new file mode 100644 index 00000000..7b9a15fe --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo @@ -0,0 +1,67 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestPostCombustionGas + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(origin={151,-6}, extent={{23,-24},{-23,24}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-174,-30},{-128,18}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceAir( + redeclare package Medium = Medium_FlueGases, + T0=680, + option_temperature=true, + Q0=10, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-172,68},{-132,108}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + Hum=0, + Xo=0, + Xn=0, + Xs=0, + rho=0.838, + Xc=0.755, + Xh=0.245, + Cp=2255, + T0=410, + Q0=9.30, + LHV=47500e3) + annotation (Placement(transformation(extent={{-107,-109},{-71,-73}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.CombustionChambers.PostCombustionGas postCombustionGas( + redeclare package Medium_FlueGases = Medium_FlueGases, Psf(start = 1.5e6), Tmel(start = 2427.85 + 273.15), h(start = 4026550)) + annotation (Placement(transformation(extent={{-52,-74},{74,50}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss airPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{-100,78},{-80,98}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{-102,-16},{-82,4}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{90,-16},{110,4}}))); +equation + connect(sourceFuel.C, postCombustionGas.Cfuel) + annotation (Line(points={{-71,-91},{-7.9,-91},{-7.9,-67.8}}, color={0,0,0})); + connect(sourceAir.C, airPressureLoss.C1) + annotation (Line(points={{-132,88},{-100,88}}, color={0,0,0})); + connect(airPressureLoss.C2, postCombustionGas.Ca) + annotation (Line(points={{-80,88},{-20.5,88},{-20.5,43.8}}, color={0,0,0})); + connect(sourceFlueGases.C, inletPressureLoss.C1) + annotation (Line(points={{-128,-6},{-102,-6}}, color={0,0,0})); + connect(inletPressureLoss.C2, postCombustionGas.Cfg1) + annotation (Line(points={{-82,-6},{-64,-6},{-64,-5.8},{-45.7,-5.8}}, color={0,0,0})); + connect(postCombustionGas.Cfg2, outletPressureLoss.C1) + annotation (Line(points={{67.7,-5.8},{79.85,-5.8},{79.85,-6},{90,-6}}, color={0,0,0})); + connect(outletPressureLoss.C2, sinkFlueGases.C) + annotation (Line(points={{110,-6},{128,-6}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestPostCombustionGas; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo new file mode 100644 index 00000000..7f2e6adc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Combustion + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Combustion; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order new file mode 100644 index 00000000..a7bc0903 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order @@ -0,0 +1,6 @@ +TestGTCombustionChamber +TestGenericCombustion +TestGenericCombustion1D +TestGenericCombustion1DWithPipe +TestPostCombustionGas +TestGridFurnace diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo new file mode 100644 index 00000000..3568f0c4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo @@ -0,0 +1,52 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser condenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + Ns=3, + ntubest=1000, + ntubesV=50, + C1vap(P(start=66004), h_vol_2(start=353999)), + C2vap(P(start=66004), h_vol_2(start=353999)), + C1(P(start=66004)), + C2ex(P(start=47631), h(start=370191)), + DynamicCondenser( + P(start=66004), + Pfond(start=47631), + hv(start=353999), + hl(start=370191), + Tp(start=357.683), + Tp1(start={351.781,354.987,356.535}), + CvBP(P(start=66004), h_vol_2(start=353999)), + CvGCT(P(start=66004), h_vol_2(start=353999)), + Cl(P(start=47631))), + Wall_3(Tp2(start={351.781,354.987,356.535})), + pipe_3( + P(start={107635,105730,103825,101915,100000}), + mu2(start=fill(9.14034e-4, 4)), + rho2(start=fill(997.34, 4))), + sortieReelle(signal(start=-97.6173)), + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ vaporSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false, C(P(start=66004), h_vol_2(start=353999))) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraVaporSource(redeclare package Medium = Medium, Q0=1e-4, h0=2.7e6, option_temperature=false, C(P(start=66004), h_vol_2(start=353999))) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraWaterSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false, C(P(start=66004))) annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, Q0=10.0002, h0=1e5, option_temperature=false, C(P(start=47631), h(start=370191))) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-20},{-50,0}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{50,-20},{70,0}}))); +equation + connect(vaporSource.C, condenser.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraVaporSource.C, condenser.C2vap) annotation (Line(points={{-50,60},{-3.9,60},{-3.9,9.2}}, color={0,0,255})); + connect(extraWaterSource.C, condenser.C1) annotation (Line(points={{-50,30},{-8.1,30},{-8.1,7.5}}, color={0,0,255})); + connect(condenser.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(coolingSource.C, condenser.Ce1) annotation (Line(points={{-50,-10},{-10,-10},{-10,-0.1}}, color={0,0,255})); + connect(condenser.Ce2, coolingSink.C) annotation (Line(points={{9.9,-0.1},{30,-0.1},{30,-10},{50,-10}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo new file mode 100644 index 00000000..0a600512 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicCondenser_Traces + extends TestDynamicCondenser( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo new file mode 100644 index 00000000..4345686d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicFlueGasesMultiFluidHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger exchanger( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + h0=fill(1.2e6, 1), + option_temperature=false, + ExchangerFlueGasesMetal(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFg(redeclare package Medium = Medium_FlueGases, Q0=10, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFg(redeclare package Medium = Medium_FlueGases, P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceWs(redeclare package Medium = Medium, P0=300000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWs(redeclare package Medium = Medium, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); +equation + connect(sourceFg.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sinkFg.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + connect(sourceWs.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sinkWs.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicFlueGasesMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo new file mode 100644 index 00000000..39a421d8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicFlueGasesMultiFluidHeatExchanger_Traces + extends TestDynamicFlueGasesMultiFluidHeatExchanger( + redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_FlueGases = Properties.Media.FlueGases(extraPropertiesNames={"Trace1"}, C_nominal={0.1}, C_default={0.2}), + sourceFg(SubC0={30}), + sourceWs(SubC0={10})); +end TestDynamicFlueGasesMultiFluidHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo new file mode 100644 index 00000000..d0b36344 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_1 = Properties.Media.WaterSteam; + replaceable package Medium_2 = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicMultiFluidHeatExchanger exchanger( + redeclare package Medium_1 = Medium_1, + redeclare package Medium_2 = Medium_2, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source1(redeclare package Medium = Medium_1, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-70,-30},{-50,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink1(redeclare package Medium = Medium_1, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{50,-30},{70,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source2(redeclare package Medium = Medium_2, P0=300000, h0=320000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink2(redeclare package Medium = Medium_2, P0=100000, h0=310000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); +equation + connect(source1.C, exchanger.Cws1) annotation (Line(points={{-50,-20},{-30,-20},{-30,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sink1.C) annotation (Line(points={{10,0},{30,0},{30,-20},{50,-20}}, color={0,0,255})); + connect(source2.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sink2.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo new file mode 100644 index 00000000..7699ef1f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_shell = Properties.Media.WaterSteam; + replaceable package Medium_pipe = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicMultiFluidHeatExchangerShell exchanger( + redeclare package Medium_shell = Medium_shell, + redeclare package Medium_pipe = Medium_pipe, + Dint=0.016, + Dext=0.019, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePipe(redeclare package Medium = Medium_pipe, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPipe(redeclare package Medium = Medium_pipe, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceShell(redeclare package Medium = Medium_shell, P0=300000, h0=320000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkShell(redeclare package Medium = Medium_shell, P0=100000, h0=310000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); +equation + connect(sourcePipe.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sinkPipe.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(sourceShell.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sinkShell.C) annotation (Line(points={{0,-5},{0,-32},{0,-60},{-10,-60}}, + color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicMultiFluidHeatExchangerShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo new file mode 100644 index 00000000..7df2c666 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell_FlueGases + extends TestDynamicMultiFluidHeatExchangerShell( + redeclare package Medium_shell = Properties.Media.FlueGases, + redeclare package Medium_pipe = Properties.Media.FlueGases, + exchanger( + P0=450000, + h0=fill(3e6, 1), + option_temperature=false, + dynamicOnePhaseFlowShell(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + DynamicOnePhaseFlowPipe(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2)))), + sourceShell(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sinkShell(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))), + sourcePipe(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sinkPipe(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6)))); +end TestDynamicMultiFluidHeatExchangerShell_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo new file mode 100644 index 00000000..0f698216 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell_Traces + extends TestDynamicMultiFluidHeatExchangerShell( + redeclare package Medium_shell = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_pipe = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + sourcePipe(SubC0={10}), + sourceShell(SubC0={20})); +end TestDynamicMultiFluidHeatExchangerShell_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..a794ed00 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger_FlueGases + extends TestDynamicMultiFluidHeatExchanger( + redeclare package Medium_1 = Properties.Media.FlueGases, + redeclare package Medium_2 = Properties.Media.FlueGases, + exchanger( + P0=450000, + h0=fill(3e6, 1), + option_temperature=false, + DynamicOnePhaseFlowPipe_1(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + DynamicOnePhaseFlowPipe_2(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2)))), + source1(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sink1(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))), + source2(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sink2(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6)))); +end TestDynamicMultiFluidHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo new file mode 100644 index 00000000..268cc90a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger_Traces + extends TestDynamicMultiFluidHeatExchanger( + redeclare package Medium_1 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_2 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + source1(SubC0={10}), + source2(SubC0={20})); +end TestDynamicMultiFluidHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo new file mode 100644 index 00000000..d682e934 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}},rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo new file mode 100644 index 00000000..29f0ce1b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + Ns=1, + Q(start=fill(36, dynamicOnePhaseFlowPipe.Ns + 1)), + h(start={3077096.0822837264,3135044.986588299,3077096.0822837264}), + P(start=linspace( + 45, + 44.5, + dynamicOnePhaseFlowPipe.Ns + 2))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + X0={0,0,1,0,0}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0=fill(726.855, dynamicOnePhaseFlowPipe.Ns), + option_temperature=2, + W0=fill(2e6/dynamicOnePhaseFlowPipe.Ns, dynamicOnePhaseFlowPipe.Ns)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=dynamicOnePhaseFlowPipe.Ns) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo new file mode 100644 index 00000000..84ca3da5 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo new file mode 100644 index 00000000..0c70d9a9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo new file mode 100644 index 00000000..7bcd5cfc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + Ns=1, + Q(start=fill(36, dynamicOnePhaseFlowShell.Ns + 1)), + h(start={3077096.0822837264,3135044.986588299,3077096.0822837264}), + P(start=linspace( + 45, + 44.5, + dynamicOnePhaseFlowShell.Ns + 2))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + X0={0,0,1,0,0}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0=fill(726.855, dynamicOnePhaseFlowShell.Ns), + option_temperature=2, + W0=fill(2e6/dynamicOnePhaseFlowShell.Ns, dynamicOnePhaseFlowShell.Ns)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=dynamicOnePhaseFlowShell.Ns) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo new file mode 100644 index 00000000..52a41273 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + Q(start={536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207,536.5750641592207}), + h(start={71016.12237181116,74743.46665892199,78470.81094603281,82198.15523314364,85925.49952025448,89652.84380736532,93380.18809447614,97107.53238158698,100834.8766686978,104562.22095580865,108289.56524291947,70825.9016030344}), + P(start={300000,281833.41863537,263664.30473175,245492.47958308,227317.76827098,209139.99948382,190959.00534677,172774.621262,154586.68575823,136395.04034906,118199.5293995,100000})) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + option_temperature=2, + W0={2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6,2e6}) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo new file mode 100644 index 00000000..48836bb0 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_Kc=1e-4, + p_Kf=1e-4, + state_f2(p(each start=3e5)), + Ec( + P(start=300000), + Q(fixed=true, start=1036), + h(start=280050)), + Sc(P(start=100000), h(start=275103), Q(start=1000)), + Ef(P(start=300000), h(start=280104), Q(start=1000)), + Sf(P(start=100000), h(start=280076)), + Pc(start=fill(3e5, 5+2)), + Pf(start=fill(3e5, 5+2)), + Qf(start=fill(1000, 5+1)), + hc(start={280050,280050,280052,280040,280303,275103,275103}), + hf(start={280076,280104,280154,279724,289301,280000,280000}), + hbc(start={280050,280050,280052,280040,280303,275103}), + hbf(start={280076,280104,280154,279724,289301,280000})) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280050) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280104) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium, + P0(fixed=false) = 100000, + option_temperature=false, + h0=275103) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=280076) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo new file mode 100644 index 00000000..abbd9039 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchangerW + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sc(Q(fixed=true, start=1036))) annotation (Placement(transformation(extent={{-14,6},{6,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(redeclare package Medium = Medium, T0=340) annotation (Placement(transformation(extent={{-74,6},{-54,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,-14},{-34,6}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium, P0(fixed=false) = 100000) annotation (Placement(transformation(extent={{46,6},{66,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{26,-14},{46,6}}, rotation=0))); +equation + connect(sourceP2.C, echangeurAPlaques1D1.Ec) annotation (Line(points={{-54,16},{-14,16}}, color={0,0,255})); + connect(sourceP3.C, echangeurAPlaques1D1.Ef) annotation (Line(points={{-34,-4},{-9,-4},{-9,10}}, color={0,0,255})); + connect(echangeurAPlaques1D1.Sc, puitsP2.C) annotation (Line(points={{6,16},{46,16}}, color={0,0,255})); + connect(echangeurAPlaques1D1.Sf, puitsP3.C) annotation (Line(points={{1,10},{0,10},{0,-4},{26,-4}}, color={0,0,255})); + annotation ( + Diagram(graphics={Text( + extent={{72,24},{92,6}}, + lineColor={0,0,255}, + textString="Qc=true")}), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 9.6.1.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestDynamicPlateHeatExchangerW; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..06417c77 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo @@ -0,0 +1,59 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_c = Properties.Media.FlueGases; + replaceable package Medium_f = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium_c, + redeclare package Medium_f = Medium_f, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_hc=100, + p_hf=100, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=4450000), h(start=2879115.64844), Q(start=117275.047014), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=300000), h(start=2879115.64844), Q(start=49585.430645), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=100000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + hc(start=fill(2879115.64844, 7)), + hf(start=fill(2879115.64844, 7)), + hbc(start=fill(2879115.64844, 6)), + hbf(start=fill(2879115.64844, 6)), + Tc1(start=fill(573.15, 5)), + Tf1(start=fill(573.15, 5)), + Tc2(start=fill(573.15, 6)), + Tf2(start=fill(573.15, 6))) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium_c, + P0=4500000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium_f, + P0=300000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium_c, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium_f, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo new file mode 100644 index 00000000..bfc63f33 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo @@ -0,0 +1,59 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=300000), h(start=280050)), + Sc(P(start=100000), h(start=275103), Q(start=1000)), + Ef(P(start=300000), h(start=280104), Q(start=1000)), + Sf(P(start=100000), h(start=280076)), + hc(start={280050,280050,280052,280040,280303,275103,275103}), + hf(start={280076,280104,280154,279724,289301,280000,280000}), + hbc(start={280050,280050,280052,280040,280303,275103}), + hbf(start={280076,280104,280154,279724,289301,280000})) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280050, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280104, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=275103) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=280076) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo new file mode 100644 index 00000000..986a0e6b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + L=10, + D=0.03, + dpfCorr(fixed=false, start=0.2396333653343408)=1, + P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,1995640.0182728,1994163.0145856,1992283.4952231,1990000})) + annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1, fixed=true)), + option_temperature=false, + h0=800e3, + P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{68,-28},{88,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( + Ns=10, + L=10, + lambda=10, + cpw=460, + rhow=7900, + e=0.005, + D=0.03) annotation (Placement(transformation(extent={{-40,-28},{40,52}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{68,-18}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); + annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo new file mode 100644 index 00000000..178c5f8c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + L=10, + D=0.03, + C1(SubC(start={0.1})), + C2(SubC(start={0.1})), + dpfCorr(fixed=false, start=0.2396333653343408)=1, + P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,1995640.0182728,1994163.0145856,1992283.4952231,1990000})) + annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1, fixed=true), SubC(start={0.1})), + option_temperature=false, + h0=800e3, + P0=2000000, + SubC0={0.1}) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + option_temperature=2, + T0={1000,1100,1200,1300,1400,1500,1600,1700,1800,1900}, + W0={2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4,2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( + Ns=10, + L=10, + lambda=10, + cpw=460, + rhow=7900, + e=0.005, + D=0.03) annotation (Placement(transformation(extent={{-40,-28},{40,52}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); + annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo new file mode 100644 index 00000000..b3e20adc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowRiser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser( + redeclare package Medium = Medium, + L=10, + D=0.03, + inertia=false, + Ns=1, + steady_state=false, + option_temperature=false, + h0={800e3}) annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1)), + option_temperature=false, + h0=800e3, + P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource1.C, dynamicTwoPhaseFlowRiser.CTh1) annotation (Line(points={{0,31.2},{0,-7.7}}, color={191,95,0})); + connect(heatSource2.C, dynamicTwoPhaseFlowRiser.CTh2) annotation (Line(points={{0,-50},{0,-33.5}}, color={191,95,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowRiser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo new file mode 100644 index 00000000..777fc36f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo @@ -0,0 +1,44 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowRiser_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser( + redeclare package Medium = Medium, + L=10, + D=0.03, + inertia=false, + Ns=1, + steady_state=false, + option_temperature=false, + h0={800e3}, + C1(SubC(start={0.1})), + C2(SubC(start={0.1}))) annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1), SubC(start={0.1})), + option_temperature=false, + h0=800e3, + P0=2000000, + SubC0={0.1}) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource1.C, dynamicTwoPhaseFlowRiser.CTh1) annotation (Line(points={{0,31.2},{0,-7.7}}, color={191,95,0})); + connect(heatSource2.C, dynamicTwoPhaseFlowRiser.CTh2) annotation (Line(points={{0,-50},{0,-33.5}}, color={191,95,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowRiser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo new file mode 100644 index 00000000..5aab623f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeater + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater waterHeater( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + dynamic_energy_balance=true, + dynamic_mass_balance=true, + P0c=2200000, + Vf0=0.43, + pipe_1(h0=fill(9e5, 10), P0=6900000), + pipe_2(h0=fill(1.0e6, 10), P0=6900000), + pipe_3(h0=fill(9e5, 20), P0=6900000), + inertia=false, + volumeC(P0=6900000, P(start=6900000)), + volumeD1(P0=6900000, P(start=6900000)), + volumeD(P0=6900000, P(start=6900000))) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, + Q0=10 + 1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, + P0=6900000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); +equation + connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-70,20}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterHeater; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo new file mode 100644 index 00000000..1593241d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeaterOnePipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeaterOnePipe waterHeater( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + dynamic_energy_balance=true, + dynamic_mass_balance=true, + P0c=2200000, + Vf0=0.43, + pipe_3(h0=fill(9e5, 20), P0=6900000), + inertia=false, + volumeC(P0=6900000, P(start=6900000)), + volumeD(P0=6900000, P(start=6900000))) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, + Q0=10 + 1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, + P0=6900000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); +equation + connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-70,20}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterHeaterOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo new file mode 100644 index 00000000..62c252c9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeaterOnePipe_Traces + extends TestDynamicWaterHeaterOnePipe( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicWaterHeaterOnePipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo new file mode 100644 index 00000000..ec38847c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeater_Traces + extends TestDynamicWaterHeater( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicWaterHeater_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo new file mode 100644 index 00000000..163d83df --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterSteamMultiFluidsHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_1 = Properties.Media.WaterSteam; + replaceable package Medium_2 = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterSteamMultiFluidsHeatExchanger exchanger( + redeclare package Medium_1 = Medium_1, + redeclare package Medium_2 = Medium_2, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source1(redeclare package Medium = Medium_1, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink1(redeclare package Medium = Medium_1, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source2(redeclare package Medium = Medium_2, P0=300000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink2(redeclare package Medium = Medium_2, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); +equation + connect(source1.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sink1.C) annotation (Line(points={{0,-5},{0,-32},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(source2.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sink2.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterSteamMultiFluidsHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo new file mode 100644 index 00000000..ab12229d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces + extends TestDynamicWaterSteamMultiFluidsHeatExchanger( + redeclare package Medium_1 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_2 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + source1(SubC0={10}), + source2(SubC0={20})); +end TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo new file mode 100644 index 00000000..79aa47c2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestFixedPowerHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger fixedPowerHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + DW=1e6) + annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-70,22},{-50,42}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-58,44},{-38,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkPc( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkPf( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePQ.C, fixedPowerHeatExchanger.Ec) annotation (Line(points={{-50,32},{-16,32},{-16,48},{-15.8,48}}, + color={0,0,255})); + connect(sourcePQ1.C, fixedPowerHeatExchanger.Ef) annotation (Line(points={{-38,54},{-20,54}}, color={0,0,255})); + connect(fixedPowerHeatExchanger.Sc, sinkPf.C) annotation (Line(points={{-4.2,48},{-4.2,34},{20,34}}, color={0,0,0})); + connect(fixedPowerHeatExchanger.Sf, sinkPc.C) annotation (Line(points={{-0.2,54.1},{19.9,54.1},{19.9,54},{40,54}}, color={0,0,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestFixedPowerHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo new file mode 100644 index 00000000..84d2f19c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestFixedPowerHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + extends TestFixedPowerHeatExchanger( + redeclare replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}), + sourcePQ1(SubC0={1}), + sourcePQ(SubC0={2})); + + + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestFixedPowerHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo new file mode 100644 index 00000000..f0eea4e3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo @@ -0,0 +1,73 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.WaterSteam; + replaceable package Medium_c = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + h0=760.83e3, + P0=8270000) annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=17.49e5, + h0=2432.50e3) annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + HeiF(start=900000), + HDesF(start=900000), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=760000), + Q(start=1790), + h(start=780000)), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true))) annotation (Placement(transformation(extent={{-66,-77},{50,65}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + Q0=118.02, + h0=889.89e3) annotation (Placement(transformation(extent={{-174,35},{-154,55}}, rotation=0))); +equation + connect(Water_inlet1.C, singularPressureLoss6.C1) annotation (Line(points={{-154,-6},{-111,-6}}, color={0,0,255})); + connect(Steam_inlet1.C, singularPressureLoss7.C1) annotation (Line(points={{-154,94},{-110,94}}, color={0,0,255})); + connect(singularPressureLoss8.C2, Puit_condenseur2.C) annotation (Line(points={{95,-6},{137,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C2, Puit_condenseur3.C) annotation (Line(points={{95,-65},{136,-65}}, color={0,0,255})); + connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev) annotation (Line(points={{-90,94},{26.8,94},{26.8,18.14}}, color={0,0,255})); + connect(nTUWaterHeating1.Se, singularPressureLoss8.C1) annotation (Line(points={{50,-6},{75,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp) annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}, color={0,0,255})); + connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee) annotation (Line(points={{-91,-6},{-66,-6}}, color={0,0,255})); + connect(Drain_inlet1.C, singularPressureLoss10.C1) annotation (Line(points={{-154,45},{-110,45}}, color={0,0,255})); + connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep) annotation (Line(points={{-90,45},{-42.8,45},{-42.8,18.14}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo new file mode 100644 index 00000000..c4b542b3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo @@ -0,0 +1,83 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.FlueGases; + replaceable package Medium_c = Properties.Media.WaterSteam; + + parameter Medium_e.MassFraction X0[Medium_e.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + P0=8270000, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e, + option_temperature=true, + T0=573.15) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=17.49e5, + h0=2432.50e3) annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + HeiF(start=2879115.64844), + HDesF(start=2879115.64844), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=2879115.64844), + Q(start=1790), + h(start=2879115.64844), + Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se( + h(fixed=true, start=2879115.64844), + P(start=80.19e5, fixed=true), + Xi(start={0.1,0.2,0.3,0.2,0.2}))) annotation (Placement(transformation(extent={{-66,-77},{50,65}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + Q0=118.02, + h0=889.89e3) annotation (Placement(transformation(extent={{-174,35},{-154,55}}, rotation=0))); +equation + connect(Water_inlet1.C, singularPressureLoss6.C1) annotation (Line(points={{-154,-6},{-111,-6}}, color={0,0,255})); + connect(Steam_inlet1.C, singularPressureLoss7.C1) annotation (Line(points={{-154,94},{-110,94}}, color={0,0,255})); + connect(singularPressureLoss8.C2, Puit_condenseur2.C) annotation (Line(points={{95,-6},{137,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C2, Puit_condenseur3.C) annotation (Line(points={{95,-65},{136,-65}}, color={0,0,255})); + connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev) annotation (Line(points={{-90,94},{26.8,94},{26.8,18.14}}, color={0,0,255})); + connect(nTUWaterHeating1.Se, singularPressureLoss8.C1) annotation (Line(points={{50,-6},{75,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp) annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}, color={0,0,255})); + connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee) annotation (Line(points={{-91,-6},{-66,-6}}, color={0,0,255})); + connect(Drain_inlet1.C, singularPressureLoss10.C1) annotation (Line(points={{-154,45},{-110,45}}, color={0,0,255})); + connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep) annotation (Line(points={{-90,45},{-42.8,45},{-42.8,18.14}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo new file mode 100644 index 00000000..a79a6470 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo @@ -0,0 +1,85 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + replaceable package Medium_c = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace4","Trace5","Trace6"}, + C_nominal={0.3,0.4,0.5}, + C_default={0.4,0.5,0.6}); + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + h0=760.83e3, + P0=8270000, + SubC0={0.4,0.5,0.6}) + annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=1749000, + h0=2432.50e3, + SubC0={0.4,0.5,0.6}) + annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + HeiF(start=900000), + HDesF(start=900000), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=760000), + Q(start=1790), + h(start=780000)), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true))) annotation (Placement(transformation(extent={{-66,-77},{50,65}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + Q0=118.02, + h0=889.89e3, + SubC0={0.5,0.6,0.7}) + annotation (Placement(transformation(extent={{-174,35},{-154,55}}, rotation=0))); +equation + connect(Water_inlet1.C, singularPressureLoss6.C1) annotation (Line(points={{-154,-6},{-111,-6}}, color={0,0,255})); + connect(Steam_inlet1.C, singularPressureLoss7.C1) annotation (Line(points={{-154,94},{-110,94}}, color={0,0,255})); + connect(singularPressureLoss8.C2, Puit_condenseur2.C) annotation (Line(points={{95,-6},{137,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C2, Puit_condenseur3.C) annotation (Line(points={{95,-65},{136,-65}}, color={0,0,255})); + connect(singularPressureLoss7.C2, nTUWaterHeating1.Ev) annotation (Line(points={{-90,94},{26.8,94},{26.8,18.14}}, color={0,0,255})); + connect(nTUWaterHeating1.Se, singularPressureLoss8.C1) annotation (Line(points={{50,-6},{75,-6}}, color={0,0,255})); + connect(singularPressureLoss9.C1, nTUWaterHeating1.Sp) annotation (Line(points={{75,-65},{-44,-65},{-44,-29.43},{-42.8,-29.43}}, color={0,0,255})); + connect(singularPressureLoss6.C2, nTUWaterHeating1.Ee) annotation (Line(points={{-91,-6},{-66,-6}}, color={0,0,255})); + connect(Drain_inlet1.C, singularPressureLoss10.C1) annotation (Line(points={{-154,45},{-110,45}}, color={0,0,255})); + connect(singularPressureLoss10.C2, nTUWaterHeating1.Ep) annotation (Line(points={{-90,45},{-42.8,45},{-42.8,18.14}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo new file mode 100644 index 00000000..95d05b29 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo @@ -0,0 +1,126 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleDynamicCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( + redeclare package Medium = Medium, + K=1e-6, + Q(start=234.2), + rho(start=994.7163, displayUnit="g/cm3"), + C1(P(start=33724.215, displayUnit="bar"))) annotation (Placement(transformation( + origin={-8,-80}, + extent={{-10,-10},{10,10}}, + rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( + redeclare package Medium = Medium, + Q0=234.2, + h0=137.9e3) annotation (Placement(transformation(extent={{-58,-90},{-78,-70}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( + redeclare package Medium = Medium, + K=1e-6, + rho(start=995.2436, displayUnit="g/cm3")) annotation (Placement(transformation( + origin={94,-30}, + extent={{10,-10},{-10,10}}, + rotation=180))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( + redeclare package Medium = Medium, + K=1e-6, + rho(start=998.6793, displayUnit="g/cm3")) annotation (Placement(transformation( + origin={-22,-30}, + extent={{10,-10},{-10,10}}, + rotation=180))); + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + D=0.018, + V=26.592685799971978, + A=1.0140805624113665, + lambda=0.01, + ntubes=30000, + gravity_pressure=true, + steady_state=true, + P0=5010, + yNiveau(signal(fixed=false, start=1.5)), + Vf0=0.10, + P(start=4999.0117, + displayUnit="bar"), + rhom(displayUnit="g/cm3", start=997.1903), + xv(start=4.3733834E-09), + Vv(start=23.606508), + xl(start=-3.5873317E-08)) + annotation (Placement(transformation(extent={{14,-46},{70,-6}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source_retourCondensats( + redeclare package Medium = Medium, + P0=25560, + h0=160.7e3, + option_temperature=false, + T(start=311.52)) annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium, h(start=1861385.9)) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={42,40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source_autre( + redeclare package Medium = Medium, + P0=82050, + h0=394.5e3, + option_temperature=false, + T(start=367.32)) annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PdC_chaudCond_out(redeclare package Medium = Medium, K=1e-5) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={42,14}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ source_vapLP( + redeclare package Medium = Medium, + Q0=194.355 - 9.231 - 9.766 - 9.418, + h0=2624.5e3, + option_temperature=false) annotation (Placement(transformation(extent={{-60,110},{-40,130}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare package Medium = Medium, + Q0=7006, + T0=290.68, + h0=113e3, + option_temperature=true) annotation (Placement(transformation(extent={{-72,-40},{-52,-20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, + T0=302.74, + option_temperature=true) annotation (Placement(transformation(extent={{128,-40},{148,-20}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StodolaTurbine LP4( + redeclare package Medium = Medium, + Cst( + fixed=false, + start=92.838486) = 8000, + eta_is_nom(fixed=false) = 0.8, + Ce(P(fixed=true, start=30000)), + Cs(P(fixed=false, start=5010), h(fixed=true, start=2560.8e3))) annotation (Placement(transformation(extent={{20,110},{40,130}}))); + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve_autre( + redeclare package Medium = Medium, + Cvmax(fixed=false) = 8000, + Q(fixed=true, start=0.1199), + C2(P(start=5010, fixed=false))) annotation (Placement(transformation(extent={{-20,36},{0,56}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2 annotation (Placement(transformation(extent={{-28,56},{-20,64}}))); + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve_retourCondensats( + redeclare package Medium = Medium, + Cvmax(fixed=false) = 8000, + C2(P(start=5010, fixed=false))) annotation (Placement(transformation(extent={{-20,76},{0,96}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1 annotation (Placement(transformation(extent={{-28,96},{-20,104}}))); +equation + connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{-12,-30},{4,-30},{4,-30.4},{14,-30.4}}, color={0,0,0})); + connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation (Line(points={{2,-80},{42.56,-80},{42.56,-46}})); + connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation (Line(points={{84,-30},{70,-30}})); + connect(PdC_chaudCond_out.C1, volumeC.Cs) annotation (Line(points={{42,24},{42,30}}, color={0,0,0})); + connect(PdC_chaudCond_out.C2, Condenseur.Cv) annotation (Line(points={{42,4},{42,-6}}, color={0,0,0})); + connect(sourceQ.C, PerteChargeCondPompe2.C1) annotation (Line(points={{-52,-30},{-32,-30}}, color={0,0,0})); + connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(points={{104,-30},{128,-30}}, color={0,0,0})); + connect(LP4.Ce, source_vapLP.C) annotation (Line(points={{19.9,120},{-40,120}}, color={0,0,0})); + connect(LP4.Cs, volumeC.Ce2) annotation (Line(points={{40.1,120},{58,120},{58,40},{52,40}}, color={0,0,0})); + connect(source_autre.C, controlValve_autre.C1) annotation (Line(points={{-40,40},{-20,40}}, color={0,0,0})); + connect(controlValve_autre.C2, volumeC.Ce3) annotation (Line(points={{0,40},{32,40}}, color={0,0,0})); + connect(controlValve_autre.Ouv, constante2.y) annotation (Line(points={{-10,57},{-10,60},{-19.6,60}}, color={0,0,255})); + connect(source_retourCondensats.C, controlValve_retourCondensats.C1) annotation (Line(points={{-40,80},{-20,80}}, color={0,0,0})); + connect(controlValve_retourCondensats.C2, volumeC.Ce1) annotation (Line(points={{0,80},{42,80},{42,50}}, color={0,0,0})); + connect(constante1.y, controlValve_retourCondensats.Ouv) annotation (Line(points={{-19.6,100},{-10,100},{-10,97}}, color={0,0,255})); + connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation (Line(points={{-58,-80},{-18,-80}}, color={0,0,0})); + + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo new file mode 100644 index 00000000..97ebc8ef --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleDynamicCondenser_Traces + extends ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers.TestSimpleDynamicCondenser( + redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + Condenseur(redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=Condenseur.xv) +) +) annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo new file mode 100644 index 00000000..9ba63f1a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo @@ -0,0 +1,47 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleEvaporatorWaterSteamFlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=10, + C(P(start=2000000)), + h0=300000, + option_temperature=false) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkSteam( + redeclare package Medium = Medium, + P0=1900000) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=50, + C(P(start=300000)), + T0=900, + option_temperature=true, + X0={0.75,0.1,0.1,0.03,0.02}) annotation (Placement(transformation(extent={{-10,70},{10,50}}, rotation=-90, + origin={-60,30}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=250000) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90, + origin={60,-30}))); + ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases evaporator( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Kdpf=0.02, + Kdpe=0.02, + Cws1(P(start=2000000), h(start=300000)), + Cws2(P(start=1900000), h(start=2800000)), + Cfg1(P(start=300000), h(start=1000000), Xi(start={0.75,0.1,0.1,0.03,0.02})), + Cfg2(P(start=250000), h(start=500000), Xi(start={0.75,0.1,0.1,0.03,0.02}))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourceWater.C, evaporator.Cws1) annotation (Line(points={{-60,0},{-10,0}}, color={0,0,255})); + connect(evaporator.Cws2, sinkSteam.C) annotation (Line(points={{10,0},{60,0}}, color={0,0,255})); + connect(sourceFlueGases.C, evaporator.Cfg1) annotation (Line(points={{0,20},{0,9}}, color={0,0,255})); + connect(evaporator.Cfg2, sinkFlueGases.C) annotation (Line(points={{0,-9},{0,-20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleEvaporatorWaterSteamFlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo new file mode 100644 index 00000000..ce5c9c42 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleEvaporatorWaterSteamFlueGases_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=10, + C(P(start=2000000), SubC(start={0.1})), + h0=300000, + option_temperature=false, + SubC0={0.1}) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkSteam(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=50, + C(P(start=300000), SubC(start={0.3})), + T0=900, + option_temperature=true, + X0={0.75,0.1,0.1,0.03,0.02}, + SubC0={0.3}) annotation (Placement(transformation(extent={{-10,70},{10,50}}, rotation=-90, + origin={-60,30}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90, + origin={60,-30}))); + ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases evaporator( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Kdpf=0.02, + Kdpe=0.02, + Cws1(P(start=2000000), h(start=300000), SubC(start={0.1})), + Cws2(P(start=1900000), h(start=2800000), SubC(start={0.1})), + Cfg1(P(start=300000), h(start=1000000), Xi(start={0.75,0.1,0.1,0.03,0.02}), SubC(start={0.3})), + Cfg2(P(start=250000), h(start=500000), Xi(start={0.75,0.1,0.1,0.03,0.02}), SubC(start={0.3}))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourceWater.C, evaporator.Cws1) annotation (Line(points={{-60,0},{-10,0}}, color={0,0,255})); + connect(evaporator.Cws2, sinkSteam.C) annotation (Line(points={{10,0},{60,0}}, color={0,0,255})); + connect(sourceFlueGases.C, evaporator.Cfg1) annotation (Line(points={{0,20},{0,9}}, color={0,0,255})); + connect(evaporator.Cfg2, sinkFlueGases.C) annotation (Line(points={{0,-9},{0,-20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleEvaporatorWaterSteamFlueGases_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo new file mode 100644 index 00000000..be8ea3fb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleStaticCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser simpleStaticCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Ec(h(start=532983.7176868258)), + Ef(h(start=71016.12237181116)), + Qc(start=1049.6385508765125), + Qf(start=4469.84281279143), + Sf(h(start=64330.208038325145))) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + T0=400) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); +equation + connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255})); + connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,-10},{-16,-10},{-16,20}}, color={0,0,255})); + connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},{10,29.9},{10,30},{20,30}}, color={0,0,255})); + connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},{-4,-10},{20,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo new file mode 100644 index 00000000..b18f22c4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleStaticCondenser_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}); + + ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser simpleStaticCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Ec(h(start=532983.7176868258), SubC(start={10,20})), + Ef(h(start=71016.12237181116), SubC(start={10,20})), + Qc(start=1049.6385508765125), + Qf(start=4469.84281279143), + Sf(h(start=64330.208038325145), SubC(start={10,20}))) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + SubC0={10,20}) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + T0=400, + SubC0={10,20}) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); +equation + connect(sourceP.C, simpleStaticCondenser.Ef) annotation (Line(points={{-40,30},{-20,30}}, color={0,0,255})); + connect(sourceP1.C, simpleStaticCondenser.Ec) annotation (Line(points={{-40,-10},{-16,-10},{-16,20}}, color={0,0,255})); + connect(simpleStaticCondenser.Sf, sinkP.C) annotation (Line(points={{0,29.9},{10,29.9},{10,30},{20,30}}, color={0,0,255})); + connect(simpleStaticCondenser.Sc, sinkP1.C) annotation (Line(points={{-4,20},{-4,-10},{20,-10}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleStaticCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo new file mode 100644 index 00000000..f3c3ca7b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo @@ -0,0 +1,56 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticAerocondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser( + redeclare package Medium = Medium, + redeclare package Medium_Air = Medium_Air, + Se=10000, + z=0.5, + Ka=1) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ airSource( + redeclare package Medium = Medium_Air, + Q0=1400, + h0=Medium_Air.specificEnthalpy_pTX( + p=100000, + T=293.15, + X=Medium_Air.X_default)) annotation (Placement(transformation(extent={{40,-30},{20,-10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ drainSource( + redeclare package Medium = Medium, + Q0=1, + T0=340, + h0=370000) annotation (Placement(transformation(extent={{-40,-20},{-20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource1( + redeclare package Medium = Medium, + Q0=100, + T0=340, + h0=2600000) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink condensateSink( + redeclare package Medium = Medium, + h0=370000) annotation (Placement(transformation( + extent={{-10,-70},{10,-50}}, + rotation=-90, + origin={60,-50}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP airSink( + redeclare package Medium = Medium_Air, + P0=100000, + T0=293.15) annotation (Placement(transformation( + extent={{40,50},{60,70}}, + rotation=90, + origin={80,-20}))); +equation + connect(airSource.C, staticAerocondenser.Cair1) annotation (Line(points={{20,-20},{9.16667,-20},{9.16667,-9.08333}}, + color={0,0,0})); + connect(drainSource.C, staticAerocondenser.Cw) annotation (Line(points={{-20,-10},{-14,-10},{-14,-7.5},{-9.16667,-7.5}}, color={0,0,0})); + connect(staticAerocondenser.Cws1, steamSource1.C) annotation (Line(points={{0,9.16667},{0,20},{-20,20}}, color={0,0,0})); + connect(staticAerocondenser.Cws2, condensateSink.C) annotation (Line(points={{0,-9.16667},{0,-40}}, color={0,0,0})); + connect(staticAerocondenser.Cair2, airSink.C) annotation (Line(points={{9.16667,9.16667},{20,9.16667},{20,20}}, + color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticAerocondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo new file mode 100644 index 00000000..3dfd512a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo @@ -0,0 +1,89 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) + "Flow pressure at inlet 1"; + parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000) + "Flow pressure at inlet 2"; + parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) + "Flow pressure at inlet 3"; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceCooling( + redeclare package Medium = Medium, + h0=60e3, + Q0(fixed=true)=4000) annotation (Placement(transformation(extent={{-180,0},{-160,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkCooling( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{160,0},{180,20}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + CPCE=0, + KCO=100, + QC0=200, + z=5, + SCO=15e3, + Qee(start=4000, fixed=false), + Pcond(fixed=false, start=2154.77)) annotation (Placement(transformation(extent={{-20,-16},{72,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_1, + h0=2.5817e6, + C(Q(fixed=true, start=100))) annotation (Placement(transformation(extent={{-100,140},{-80,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_2, + h0=2.5481e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-182,80},{-162,100}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_3, + h0=2.5055e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-180,40},{-160,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-40,140},{-20,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkEx( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{100,0},{120,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss.C1) + annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255})); + connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{-80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255})); + connect(sourceP2.C, singularPressureLoss1.C1) + annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255})); + connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{-80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255})); + connect(sourceCooling.C, singularPressureLoss2.C1) + annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{-80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss3.C1) + annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255})); + connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{-20,150},{26,150},{26,82.49}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkCooling.C) + annotation (Line(points={{120,10},{160,10}}, color={0,0,255})); + connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkEx.C) + annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255})); + connect(singularPressureLoss5.C1, condenseur.Cex) + annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16.98}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo new file mode 100644 index 00000000..2fc01b2a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo @@ -0,0 +1,88 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenserHEI + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) + "Flow pressure at inlet 1"; + parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000) + "Flow pressure at inlet 2"; + parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) + "Flow pressure at inlet 3"; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceCooling( + redeclare package Medium = Medium, + h0=60e3, + Q0(fixed=true)=4000) annotation (Placement(transformation(extent={{-180,0},{-160,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkCooling( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{160,0},{180,20}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticCondenserHEI condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Kf=0, + z1c=0, + z2c=5, + Qc(start=100), + Qf(start=4000), + Pcond(fixed=false, start=2154.77)) annotation (Placement(transformation(extent={{-20,-16},{72,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_1, + h0=2.5817e6, + C(Q(fixed=true, start=100))) annotation (Placement(transformation(extent={{-100,140},{-80,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_2, + h0=2.5481e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-182,80},{-162,100}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_3, + h0=2.5055e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-180,40},{-160,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-40,140},{-20,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkEx( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{100,0},{120,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{40,-100},{60,-80}}, rotation=0))); +equation + connect(sourceP1.C, singularPressureLoss.C1) + annotation (Line(points={{-162,90},{-100,90}}, color={0,0,255})); + connect(singularPressureLoss.C2, condenseur.Cev) annotation (Line(points={{-80,90},{-50,90},{-50,62.89},{-20,62.89}}, color={0,0,255})); + connect(sourceP2.C, singularPressureLoss1.C1) + annotation (Line(points={{-160,50},{-100,50}}, color={0,0,255})); + connect(singularPressureLoss1.C2, condenseur.Cep) annotation (Line(points={{-80,50},{-52,50},{-52,42.31},{-20,42.31}}, color={0,0,255})); + connect(sourceCooling.C, singularPressureLoss2.C1) + annotation (Line(points={{-160,10},{-100,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, condenseur.Cee) annotation (Line(points={{-80,10},{-52,10},{-52,3.11},{-20,3.11}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss3.C1) + annotation (Line(points={{-80,150},{-40,150}}, color={0,0,255})); + connect(singularPressureLoss3.C2, condenseur.Cvt) annotation (Line(points={{-20,150},{26,150},{26,82.49}}, color={0,0,255})); + connect(singularPressureLoss4.C2, sinkCooling.C) + annotation (Line(points={{120,10},{160,10}}, color={0,0,255})); + connect(condenseur.Cse, singularPressureLoss4.C1) annotation (Line(points={{72.92,3.11},{86,3.11},{86,10},{100,10}}, color={0,0,255})); + connect(singularPressureLoss5.C2, sinkEx.C) + annotation (Line(points={{60,-90},{100,-90}}, color={0,0,255})); + connect(singularPressureLoss5.C1, condenseur.Cex) + annotation (Line(points={{40,-90},{26.46,-90},{26.46,-16.98}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenserHEI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo new file mode 100644 index 00000000..adacd0a4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenserHEI_Traces + extends TestStaticCondenserHEI( + redeclare package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}), + sourceP(SubC0={10,20}), + sourceP1(SubC0={10,20}), + sourceP2(SubC0={10,20}), + sourceCooling(SubC0={10,20}), + condenseur(Cvt(SubC(start={10,20})), Cev(SubC(start={10,20})), Cep(SubC(start={10,20})), Cee(SubC(start={10,20})))); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenserHEI_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo new file mode 100644 index 00000000..b235af11 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenser_Traces + extends TestStaticCondenser( + redeclare package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}), + sourceP(SubC0={10,20}), + sourceP1(SubC0={10,20}), + sourceP2(SubC0={10,20}), + sourceCooling(SubC0={10,20}), + condenseur(Cvt(SubC(start={10,20})), Cev(SubC(start={10,20})), Cep(SubC(start={10,20})), Cee(SubC(start={10,20})))); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo new file mode 100644 index 00000000..e054d592 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo @@ -0,0 +1,37 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF( + redeclare package Medium = Medium, + C(P(start=219e5)), + Q0=481.07, + h0=1067.9e3) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF( + redeclare package Medium = Medium, + P0=217.68e5) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC( + redeclare package Medium = Medium, + C(P(start=24e5)), + Q0=23.377, + h0=3420.3e3) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC( + redeclare package Medium = Medium, + P0=24.13e5) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerWaterSteamDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=1, + Kf=597.832, + Ec(P(start=23e5)), + Ef(P(start=219e5)), + exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); +equation + connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef) annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); + connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo new file mode 100644 index 00000000..b41a7281 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo @@ -0,0 +1,51 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases_FF( + redeclare package Medium = Medium, + C(P(start=4500000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Q0=481.07, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases_FF( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases_FC( + redeclare package Medium = Medium, + C(P(start=300000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Q0=23.377, + option_temperature=true, + T0=673.15, + X0=X0) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases_FC( + redeclare package Medium = Medium, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerFlueGasesDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=0.8, + Kc=1e-4, + Kf=1e-4, + Ec(P(start=300000), h(start=3379115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=100000), h(start=3200000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=4450000), h(start=3000000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Tec(start=673.15), + Tsc(start=640), + Tef(start=573.15), + Tsf(start=600), + exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); +equation + connect(sourceFlueGases_FF.C, exchangerFlueGasesDTorWorEFF.Ef) annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); + connect(exchangerFlueGasesDTorWorEFF.Sf, sinkFlueGases_FF.C) annotation (Line(points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); + connect(sourceFlueGases_FC.C, exchangerFlueGasesDTorWorEFF.Ec) annotation (Line(points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); + connect(exchangerFlueGasesDTorWorEFF.Sc, sinkFlueGases_FC.C) annotation (Line(points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo new file mode 100644 index 00000000..b39a7964 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF( + redeclare package Medium = Medium, + C(P(start=219e5)), + Q0=481.07, + h0=1067.9e3, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF( + redeclare package Medium = Medium, + P0=217.68e5) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC( + redeclare package Medium = Medium, + C(P(start=24e5)), + Q0=23.377, + h0=3420.3e3, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC( + redeclare package Medium = Medium, + P0=24.13e5) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerWaterSteamDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=1, + Kf=597.832, + Ec(P(start=23e5)), + Ef(P(start=219e5)), + exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); +equation + connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef) annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation (Line(points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); + connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation (Line(points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); + connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation (Line(points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo new file mode 100644 index 00000000..19074313 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerKS + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS staticExchangerKS( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + K=100, + S=10, + exchanger_conf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePc.C, staticExchangerKS.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,51}}, color={0,0,255})); + connect(sourcePf.C, staticExchangerKS.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(staticExchangerKS.Sc, sinkPc.C) annotation (Line(points={{0,51},{20,51},{20,54},{40,54}}, color={0,0,255})); + connect(staticExchangerKS.Sf, sinkPf.C) annotation (Line(points={{0,57},{6,57},{6,34},{20,34}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerKS; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo new file mode 100644 index 00000000..be41268e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerKS_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS staticExchangerKS( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + K=100, + S=10, + exchanger_conf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePc.C, staticExchangerKS.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,51}}, color={0,0,255})); + connect(sourcePf.C, staticExchangerKS.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(staticExchangerKS.Sc, sinkPc.C) annotation (Line(points={{0,51},{20,51},{20,54},{40,54}}, color={0,0,255})); + connect(staticExchangerKS.Sf, sinkPf.C) annotation (Line(points={{0,57},{6,57},{6,34},{20,34}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerKS_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo new file mode 100644 index 00000000..ac3044f3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Ec(P(start=300000), h(start=280e3)), + Sc(P(start=100000), h(start=250e3), Q(start=1000)), + Ef(P(start=300000), h(start=70e3), Q(start=1000)), + Sf(P(start=100000), h(start=200e3)), + Tec(start=340), + Tsc(start=330), + Tef(start=290), + Tsf(start=320), + Tmc(start=335), + Tmf(start=305), + Hmc(start=270e3), + Hmf(start=140e3)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..b94ad1bd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_c = Properties.Media.FlueGases; + replaceable package Medium_f = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium_c, + redeclare package Medium_f = Medium_f, + Sp=2, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_hc=100, + p_hf=100, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=4450000), h(start=2879115.64844), Q(start=117275.047014), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=300000), h(start=2879115.64844), Q(start=49585.430645), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=100000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Tec(start=573.15), + Tsc(start=573.15), + Tef(start=573.15), + Tsf(start=573.15), + Tmc(start=573.15), + Tmf(start=573.15), + Hmc(start=2879115.64844), + Hmf(start=2879115.64844)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium_c, + P0=4500000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium_f, + P0=300000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium_c, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium_f, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo new file mode 100644 index 00000000..32cd71d4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo @@ -0,0 +1,44 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Ec(P(start=300000), h(start=280e3)), + Sc(P(start=100000), h(start=250e3), Q(start=1000)), + Ef(P(start=300000), h(start=70e3), Q(start=1000)), + Sf(P(start=100000), h(start=200e3)), + Tec(start=340), + Tsc(start=330), + Tef(start=290), + Tsf(start=320), + Tmc(start=335), + Tmf(start=305), + Hmc(start=270e3), + Hmf(start=140e3)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo new file mode 100644 index 00000000..85a1472e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo @@ -0,0 +1,54 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_CustomMixture + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium + extends ThermoSysPro.Properties.Media.PartialSubCMedium(nSubC=nC, isCompressible=true); + extends Modelica.Media.IdealGases.Common.MixtureGasNasa( + mediumName="CustomCombustionGas", + data={Modelica.Media.IdealGases.Common.SingleGasesData.CO2, + Modelica.Media.IdealGases.Common.SingleGasesData.H2O, + Modelica.Media.IdealGases.Common.SingleGasesData.O2, + Modelica.Media.IdealGases.Common.SingleGasesData.N2}, + fluidConstants={Modelica.Media.IdealGases.Common.FluidData.CO2, + Modelica.Media.IdealGases.Common.FluidData.H2O, + Modelica.Media.IdealGases.Common.FluidData.O2, + Modelica.Media.IdealGases.Common.FluidData.N2}, + substanceNames={"CO2","H2O","O2","N2"}, + reference_X={0.12,0.08,0.05,0.75}); + end Medium; + + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.12,0.08,0.05,0.75}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1(P(start=4500000), h(start=700000), Q(start=10), Xi(start={0.12,0.08,0.05,0.75})), + C2(P(start=4450000), h(start=650000), Q(start=10), Xi(start={0.12,0.08,0.05,0.75})), + h(start=fill(700000, Ns + 2)), + hb(start=fill(700000, Ns + 1)), + T1(start=fill(650, Ns)), + T2(start=fill(650, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=650, + X0=X0) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=650000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_CustomMixture; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo new file mode 100644 index 00000000..0982b5b9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo @@ -0,0 +1,39 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1(P(start=4500000), h(start=2879115.64844), Q(start=10), Xi(start={0.1,0.2,0.3,0.2,0.2})), + C2(P(start=4450000), h(start=2820000), Q(start=10), Xi(start={0.1,0.2,0.3,0.2,0.2})), + h(start=fill(2879115.64844, Ns + 2)), + hb(start=fill(2879115.64844, Ns + 1)), + T1(start=fill(573.15, Ns)), + T2(start=fill(573.15, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=2820000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo new file mode 100644 index 00000000..264cba4b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1( + P(start=4500000), + h(start=2879115.64844), + Q(start=10), + Xi(start={0.1,0.2,0.3,0.2,0.2}), + SubC(start={0.1,0.2,0.3})), + C2( + P(start=4450000), + h(start=2820000), + Q(start=10), + Xi(start={0.1,0.2,0.3,0.2,0.2}), + SubC(start={0.1,0.2,0.3})), + h(start=fill(2879115.64844, Ns + 2)), + hb(start=fill(2879115.64844, Ns + 1)), + T1(start=fill(573.15, Ns)), + T2(start=fill(573.15, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=573.15, + X0=X0, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=2820000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo new file mode 100644 index 00000000..850ef506 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo @@ -0,0 +1,52 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Primary = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_1SG steamGenerator( + redeclare package Medium = Medium, + redeclare package Medium_Primary = Medium_Primary, + DomeGV( + Cm(h_vol_1(start=1467382.1491761294), + Q(start=3682.6323348377664)), + hl(start=1239103.1618852438), + Tp(start=1085.1630860204652, displayUnit="degC"), + Pfond(start=6537896.329041586, displayUnit="bar")), + DownComerGV(C2(P(start=6652618.15111204, displayUnit="bar"))), + fluidInlet(h_vol_2(start=1203352.0170161917)), + fluidInlet1(P(start=15603447.190394623, displayUnit="bar")), + fluidOutletI(h_vol_1(start=2.82156e6)), + fluidOutletI1(h(start=1266398.0525517925)), + MixAlimDomeGV(P(start=6597719.510802327, displayUnit="bar"), + Cs(h_vol_2(start=1203352.0170161917))), + outputReal(signal(start=-6.329123415280561)), + RiserGV( + h(start={1.20335e6,1.28046e6,1.34313e6,1.39379e6,1.43460e6,1.46738e6,1.46738e6}), + P(start={6.65262e6,6.63846e6,6.62828e6,6.62094e6,6.61445e6,6.60826e6,6.53790e6}), + Tp1(start={556.156,555.899,555.700,555.537,555.398}), + Tp2(start={557.644,557.097,556.655,556.295,555.999}), + state1(h(start={1280461.0750118925,1343134.833335842,1393794.5882590986,1434595.9090880589,1467382.1491761294}), p(start={6638456.595608159,6628277.414901627,6620936.90876653,6614447.789782153,6608263.233348276}, each displayUnit="bar"))), + UtubeColdtLeg( + P(start={1.54474e7,1.54475e7,1.54477e7,1.54482e7,1.54487e7,1.54493e7,1.54500e7}), + Tp(start={565.892673062783,563.7423137333859,562.0024887705413,560.5974122265403,559.4633025748175}, each displayUnit="degC")), + UtubeHotLeg( + P(start={1.56034e7,1.55774e7,1.55514e7,1.55254e7,1.54994e7,1.54734e7,1.54474e7}), + Tp(start={586.895939774836,580.9426855874689,575.9677586513063,571.864684816329,568.5110695637635}, each displayUnit="degC")), + DPnulle_AlimDwnc(rho(start=830.6664450130019, displayUnit="g/cm3")), + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, Q0=531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP steamSink(redeclare package Medium = Medium, P0=6600000, h0=2.77257e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, Q0=4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); +equation + connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,34},{0,60},{-10,60}}, + color={0,0,255})); + connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSteamGenerator_1SG; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo new file mode 100644 index 00000000..dd461219 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG_Traces + extends TestSteamGenerator_1SG( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Primary = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + primaryInlet(SubC0={10})); +end TestSteamGenerator_1SG_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo new file mode 100644 index 00000000..823a3933 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_4SG + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Primary = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_4SG steamGenerator( + redeclare package Medium = Medium, + redeclare package Medium_Primary = Medium_Primary, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, + Q0=4*531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP steamSink(redeclare package Medium = Medium, P0=6600000, h0=2.77257e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, + Q0=4*4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); +equation + connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,34},{0,60},{-10,60}}, + color={0,0,255})); + connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSteamGenerator_4SG; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo new file mode 100644 index 00000000..2b9eb78f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_4SG_Traces + extends TestSteamGenerator_4SG( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Primary = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + primaryInlet(SubC0={10})); +end TestSteamGenerator_4SG_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo new file mode 100644 index 00000000..0da727b3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package HeatExchangers + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end HeatExchangers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order new file mode 100644 index 00000000..a33c9fb7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -0,0 +1,61 @@ +TestDynamicOnePhaseFlowPipe +TestDynamicOnePhaseFlowPipe_Traces +TestDynamicOnePhaseFlowPipe_FlueGases +TestDynamicTwoPhaseFlowPipe +TestDynamicTwoPhaseFlowPipe_Traces +TestDynamicTwoPhaseFlowRiser +TestDynamicTwoPhaseFlowRiser_Traces +TestDynamicOnePhaseFlowShell +TestDynamicOnePhaseFlowShell_Traces +TestDynamicOnePhaseFlowShell_FlueGases +TestFixedPowerHeatExchanger +TestFixedPowerHeatExchanger_Traces +TestStaticExchangerKS +TestStaticExchangerKS_Traces +TestStaticExchangerDTorWorEff +TestStaticExchangerDTorWorEff_Traces +TestStaticExchangerDTorWorEff_FlueGases +TestStaticWallFlueGasesExchanger_FlueGases +TestStaticWallFlueGasesExchanger_Traces +TestStaticWallFlueGasesExchanger_CustomMixture +TestStaticPlateHeatExchanger +TestStaticPlateHeatExchanger_Traces +TestStaticPlateHeatExchanger_FlueGases +TestDynamicPlateHeatExchanger +TestDynamicPlateHeatExchanger_Traces +TestDynamicPlateHeatExchanger_FlueGases +TestDynamicPlateHeatExchangerW +TestNTUWaterHeater +TestNTUWaterHeater_Traces +TestNTUWaterHeater_FlueGases +TestSimpleDynamicCondenser +TestSimpleDynamicCondenser_Traces +TestSimpleEvaporatorWaterSteamFlueGases +TestSimpleEvaporatorWaterSteamFlueGases_Traces +TestSimpleStaticCondenser +TestSimpleStaticCondenser_Traces +TestStaticCondenser +TestStaticCondenser_Traces +TestStaticCondenserHEI +TestStaticCondenserHEI_Traces +TestStaticAerocondenser +TestDynamicCondenser +TestDynamicCondenser_Traces +TestDynamicFlueGasesMultiFluidHeatExchanger +TestDynamicFlueGasesMultiFluidHeatExchanger_Traces +TestDynamicMultiFluidHeatExchanger +TestDynamicMultiFluidHeatExchanger_FlueGases +TestDynamicMultiFluidHeatExchanger_Traces +TestDynamicMultiFluidHeatExchangerShell +TestDynamicMultiFluidHeatExchangerShell_FlueGases +TestDynamicMultiFluidHeatExchangerShell_Traces +TestDynamicWaterHeater +TestDynamicWaterHeater_Traces +TestDynamicWaterHeaterOnePipe +TestDynamicWaterHeaterOnePipe_Traces +TestDynamicWaterSteamMultiFluidsHeatExchanger +TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces +TestSteamGenerator_1SG +TestSteamGenerator_1SG_Traces +TestSteamGenerator_4SG +TestSteamGenerator_4SG_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo index 92e0061d..659c5137 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo @@ -1,116 +1,4 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples; package Junctions - - annotation (Icon(graphics={ - Text( - extent={{-102,0},{24,-26}}, - lineColor={242,148,0}, - textString= - "Thermo"), - Text( - extent={{-4,8},{68,-34}}, - lineColor={46,170,220}, - textString= - "SysPro"), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,30},{-6,26}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,36},{-6,32}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,42},{-6,38}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,48},{-6,44}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,32},{-2,28}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,38},{-2,34}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,44},{-2,40}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,50},{-2,46}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Line( - points={{22,12},{22,14},{22,16},{24,14},{20,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{26,12},{26,14},{26,16},{28,14},{24,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{30,10},{30,12},{30,14},{32,12},{28,16}}, - color={46,170,220}, - thickness=0.5), - Polygon( - points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), - Line( - points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{80,80},{100,100}}, - color={0,0,255}, - smooth=Smooth.None)})); + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; end Junctions; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo new file mode 100644 index 00000000..76c078a7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); +equation + connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( + points={{-80,10},{-56,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line( + points={{-42,20},{-42,30},{-20,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line( + points={{-42,0},{-42,-10},{-20,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(mixer2_1.Ce1, singularPressureLoss1.C2) annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None)); + connect(mixer2_1.Cs, sink.C) annotation (Line( + points={{60,10},{80,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(constante.y, splitter2_1.Ialpha1) annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=Smooth.None)); + connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line( + points={{0,-10},{10,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line( + points={{30,-10},{46,-10},{46,0}}, + color={0,0,255}, + smooth=Smooth.None)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo new file mode 100644 index 00000000..33e8eb00 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo @@ -0,0 +1,54 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true, + SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); +equation + connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( + points={{-80,10},{-56,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line( + points={{-42,20},{-42,30},{-20,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line( + points={{-42,0},{-42,-10},{-20,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(mixer2_1.Ce1, singularPressureLoss1.C2) annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None)); + connect(mixer2_1.Cs, sink.C) annotation (Line( + points={{60,10},{80,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(constante.y, splitter2_1.Ialpha1) annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=Smooth.None)); + connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line( + points={{0,-10},{10,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line( + points={{30,-10},{46,-10},{46,0}}, + color={0,0,255}, + smooth=Smooth.None)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo new file mode 100644 index 00000000..3a67cdb0 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.5) annotation (Placement(transformation(extent={{-80,40},{-60,60}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{10,-20},{30,0}}, rotation=0))); +equation + connect(sourcePQ.C, splitter2_1.Ce) annotation (Line( + points={{-80,10},{-56,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation (Line( + points={{-42,20},{-42,30},{-20,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation (Line( + points={{-42,0},{-42,-10},{-20,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(mixer2_1.Ce1, singularPressureLoss1.C2) annotation (Line(points={{46,20},{46,30},{0,30}}, smooth=Smooth.None)); + connect(mixer2_1.Cs, sink.C) annotation (Line( + points={{60,10},{80,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(constante.y, splitter2_1.Ialpha1) annotation (Line(points={{-59,50},{-52,50},{-52,16},{-45,16}}, smooth=Smooth.None)); + connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation (Line( + points={{0,-10},{10,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(loopBreakerP.C2, mixer2_1.Ce2) annotation (Line( + points={{30,-10},{46,-10},{46,0}}, + color={0,0,255}, + smooth=Smooth.None)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo new file mode 100644 index 00000000..c6bf70b7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerQH + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerH.C2) annotation (Line(points={{10,-20},{100,-20},{100,10},{50,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerQH; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo new file mode 100644 index 00000000..9661a3bf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerSubC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefSubC refSubC(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{90,-30},{70,-10}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerSubC loopBreakerSubC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-30},{40,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerSubC.C2) annotation (Line(points={{10,-20},{40,-20}}, color={0,0,0})); + connect(loopBreakerSubC.C1, refSubC.C2) annotation (Line(points={{60,-20},{70,-20}}, color={0,0,0})); + connect(loopBreakerH.C2, refSubC.C1) annotation (Line(points={{50,10},{100,10},{100,-20},{90,-20}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerSubC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo new file mode 100644 index 00000000..c30188a1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerX_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,0},{-70,20}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=2.e5) annotation (Placement(transformation(extent={{-100,60},{-80,80}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefXgas refXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{62,0},{82,20}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerXgas loopBreakerXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{64,-30},{44,-10}}))); +equation + connect(refP.C2, refT.C1) annotation (Line(points={{-70,10},{-60,10}}, color={0,0,255})); + connect(refT.C2, pump.C1) annotation (Line(points={{-40,10},{-30,10}}, color={0,0,255})); + connect(constante.y, refP.IPressure) annotation (Line(points={{-79,70},{-60,70},{-60,34},{-80,34},{-80,21}})); + connect(pump.C2, loopBreakerQ.C1) annotation (Line(points={{-10,10},{0,10}}, color={0,0,255})); + connect(loopBreakerQ.C2, loopBreakerH.C1) annotation (Line(points={{20,10},{30,10}}, color={0,0,255})); + connect(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(refXgas.C1, loopBreakerH.C2) annotation (Line(points={{62,10},{50,10}}, color={0,0,0})); + connect(volumeA.Ce1, loopBreakerXgas.C2) annotation (Line(points={{10,-20},{44,-20}}, color={0,0,0})); + connect(loopBreakerXgas.C1, refXgas.C2) annotation (Line(points={{64,-20},{100,-20},{100,10},{82,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerX_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo new file mode 100644 index 00000000..d8e41490 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package LoopBreakers + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end LoopBreakers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order new file mode 100644 index 00000000..0b1ec3d4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order @@ -0,0 +1,6 @@ +TestLoopBreakerP +TestLoopBreakerP_Traces +TestLoopBreakerP_FlueGases +TestLoopBreakerQH +TestLoopBreakerSubC_Traces +TestLoopBreakerX_FlueGases diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo new file mode 100644 index 00000000..4b0c3637 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCHPEngineBarkantineSystem + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium, + P0=300000, + h0=293e3, + option_temperature=false) + annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= + 0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium, + P0=100000, + T0=360) + annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.Machines.CHPEngineBarkantineSystem CHPBarkantine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,0},{20,60}}, rotation=0))); +equation + connect(SourceP1.C, CHPBarkantine.inletWaterSteam) annotation (Line(points={{ + -80,30},{-50,30},{-50,45},{-40,45}}, color={0,0,0})); + connect(CHPBarkantine.outletWaterSteam, PuitsP1.C) + annotation (Line(points={{20,45},{30,45},{30,30},{60,30}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2})), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end TestCHPEngineBarkantineSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo new file mode 100644 index 00000000..b306260b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo new file mode 100644 index 00000000..9fdeb876 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo new file mode 100644 index 00000000..8387f4d8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); +equation + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo new file mode 100644 index 00000000..6812d7bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCombustionTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + parameter Real Qred1(fixed=false, start=0.01) "Reduced mass flow rate"; + + Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2+Medium.h_offset)) annotation (Placement(transformation(extent={{-42,-42},{36,42}}, rotation=0))); + Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + option_temperature=true, + X0={1-0.14-0.06-0.06,0.14,0.06,0.06,0}, + Q0=430, + T0=1500) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, rotation=0))); + Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, + P0=100000, + T0=830) annotation (Placement(transformation( + origin={94,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); + InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8) annotation (Placement(transformation(extent={{-100,-42},{-80,-22}}, rotation=0))); +equation + connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line( + points={{-86,0},{-42,0}}, + color={0,0,0}, + thickness=1)); + connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line( + points={{36,0},{84,0}}, + color={0,0,0}, + thickness=1)); + connect(Wc1.y, CombustionTurbine.CompressorPower) annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}})); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 11.4.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestCombustionTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo new file mode 100644 index 00000000..6dac368b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo @@ -0,0 +1,50 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCombustionTurbine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + parameter Real Qred1(fixed=false, start=0.01) "Reduced mass flow rate"; + + Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2 + Medium.h_offset)) annotation (Placement(transformation(extent={{-42,-42},{36,42}}, rotation=0))); + Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.14 - 0.06 - 0.06,0.14,0.06,0.06,0}, + Q0=430, + T0=1500) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, rotation=0))); + Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=100000, + T0=830) annotation (Placement(transformation( + origin={94,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); + InstrumentationAndControl.Blocks.Sources.Constante Wc1(k=-1.8e8) annotation (Placement(transformation(extent={{-100,-42},{-80,-22}}, rotation=0))); +equation + connect(SourceQ1.C, CombustionTurbine.Ce) annotation (Line( + points={{-86,0},{-42,0}}, + color={0,0,0}, + thickness=1)); + connect(CombustionTurbine.Cs, SinkP1.C) annotation (Line( + points={{36,0},{84,0}}, + color={0,0,0}, + thickness=1)); + connect(Wc1.y, CombustionTurbine.CompressorPower) annotation (Line(points={{-79,-32},{-45.9,-32},{-45.9,-16.8}})); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +

    This model is documented in Sect. 11.4.5 of the ThermoSysPro book. +

    The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestCombustionTurbine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo new file mode 100644 index 00000000..345c316c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo @@ -0,0 +1,40 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCompressor + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + Ps(fixed=false), + tau_n=16, + is_eff_n=is_eff_n1, + Pe(fixed=false, start=100000), + Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{-52,-52},{48,52}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}, + Q0=420, + P0=100000, + T0=288, + option_temperature=true) annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, P0=15.8e5) annotation (Placement(transformation( + origin={96,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(SourceQ1.C, Compressor.Ce) annotation (Line( + points={{-84,0},{-39.5,0}}, + color={0,0,0}, + thickness=1)); + connect(Compressor.Cs, SinkP1.C) annotation (Line( + points={{35.5,0},{86,0}}, + color={0,0,0}, + thickness=1)); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo new file mode 100644 index 00000000..e2792641 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCompressor_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + Ps(fixed=false), + tau_n=16, + is_eff_n=is_eff_n1, + Pe(fixed=false, start=100000), + Ts(fixed=true, start=680)) annotation (Placement(transformation(extent={{-52,-52},{48,52}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}, + Q0=420, + P0=100000, + T0=288, + option_temperature=true) annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, P0=15.8e5) annotation (Placement(transformation( + origin={96,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(SourceQ1.C, Compressor.Ce) annotation (Line( + points={{-84,0},{-39.5,0}}, + color={0,0,0}, + thickness=1)); + connect(Compressor.Cs, SinkP1.C) annotation (Line( + points={{35.5,0},{86,0}}, + color={0,0,0}, + thickness=1)); + annotation (Diagram(graphics), Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestCompressor_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo new file mode 100644 index 00000000..1d20227f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo @@ -0,0 +1,120 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestGasTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium_FlueGases, + P0=1.013e5, + Q0=600, + T0=29.4 + 273.16, + option_temperature=true, + X0={1 - 0.20994,0.20994,0,0,0}) + annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante humidity(k=0.93) + annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe fuel( + Starttime=200, + Duration=800, + Initialvalue=13.507, + Finalvalue=8.756) + annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe air( + Starttime=200, + Duration=800, + Initialvalue=592.7, + Finalvalue=415.70) + annotation (Placement(transformation(extent={{-98,0},{-78,20}}))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( + Q0=13.4368286133, + T0=185 + 273.16, + LHV=46989e3, + Cp=2255, + Xc=0.755, + Xh=0.245, + rho=0.838) + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ water( + redeclare package Medium = Medium, + Q0=0) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + ThermoSysPro.Fluid.Machines.GasTurbine gasTurbine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + comp_tau_n=14.0178, + comp_eff_n=0.87004, + exp_tau_n=0.06458, + exp_eff_n=0.89045, + TurbQred=0.0175634, + Kcham=2.02088, + Wpth=1e6, + Compresseur( + Ps(start=1404200.0), + He(start=2.5525e6), + Hs(start=3.008e6), + His(start=2.95e6), + Te(start=302.56000000000006), + Tis(start=630.0), + Ts(start=729.0)), + TurbineAgaz( + He(start=4.0e6), + Hs(start=3.24e6), + His(start=3.1e6), + Tis(start=847.0)), + chambreCombustionTAC( + Psf(start=1310000.0), + Tea(start=729.0), + Hsf(start=4.0e6), + Tsf(start=1532.57)), + xAIR( + T(start=302.56000000000006), + ppvap0(start=4104.0), + rho_air(start=1.0836), + rho_vap(start=0.029))) + annotation (Placement(transformation(extent={{-30,-28},{30,28}}))); +equation + connect(air.y, sourcePQ.IMassFlow) + annotation (Line(points={{-77,10},{-60,10},{-60,5}}, color={0,0,255})); + connect(humidity.y, gasTurbine.Huminide) annotation (Line(points={{-79,40},{ + -60,40},{-60,16.8},{-31.2,16.8}},color={0,0,255})); + connect(fuel.y, fuelSourcePQ.IMassFlow) + annotation (Line(points={{-19,70},{-10,70},{-10,55}}, + color={0,0,255})); + connect(sourcePQ.C, gasTurbine.Entree_air) annotation (Line(points={{-50,0},{ + -32,0},{-32,3.55271e-015},{-30,3.55271e-015}}, color={0,0,0})); + connect(fuelSourcePQ.C, gasTurbine.Entree_combustible) + annotation (Line(points={{0,50},{18,50},{18,28}}, color={0,0,0})); + connect(water.C, gasTurbine.Entree_eau_combustion) + annotation (Line(points={{-40,50},{-18,50},{-18,28}}, color={0,0,0})); + connect(gasTurbine.Sortie_fumees, sink.C) + annotation (Line(points={{30,3.55271e-015},{46,3.55271e-015},{46,0},{60,0}}, + color={0,0,0})); + annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +"), + experiment(StopTime=1200)); +end TestGasTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo new file mode 100644 index 00000000..d4210dc3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo @@ -0,0 +1,55 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestHeatPumpCompressor + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.C3H3F5; + + ThermoSysPro.Fluid.Machines.HeatPumpCompressor Compressor( + redeclare package Medium = Medium, + Pe(fixed=false, start=100000), + Ts(fixed=false, start=680)) + annotation (Placement(transformation(extent={{-52,-52},{48,52}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + Q0=420, + h0=3.e5, + T0=288, + option_temperature=false) + annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=1580000, + option_temperature=false) + annotation (Placement(transformation( + origin={96,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(SourceQ1.C, Compressor.C1) + annotation (Line(points={{-84,0},{-52,0}}, color={0,0,0})); + connect(SinkP1.C, Compressor.C2) + annotation (Line(points={{86,0},{48,0}}, color={0,0,0})); + annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1

    +")); +end TestHeatPumpCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo new file mode 100644 index 00000000..3a722f76 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo @@ -0,0 +1,93 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestInternalCombustionEngine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( + Hum=0, + Xh=0.25, + Xs=0, + Xashes=0, + Xc=0.75, + Xo=0, + Xn=0, + Q0=0.0676, + rho=0.744, + LHV=50e6, + T0(displayUnit="K") = 299, + P0=210300, + Vol=1) + annotation (Placement(transformation(extent={{-106,-81},{-72,-43}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=1.9627, + T0=30 + 273.16, + option_temperature=true, + X0={0.765,0.23,0.005,0,0}, + P0=191000) + annotation (Placement(transformation(extent={{111,-79},{73,-45}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium_FlueGases, + option_temperature=true) + annotation (Placement(transformation(extent={{0,44},{44,86}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWater( + redeclare package Medium = Medium, + Q0=15.3, + h0=334.41e3, + P0=410000) + annotation (Placement(transformation(extent={{-107,-19},{-71,15}}, rotation=0))); + ThermoSysPro.Fluid.Machines.InternalCombustionEngine internalCombustionEngine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + mechanical_efficiency_type=2, + Rmeca_nom=0.41, + Coef_Rm_a=-5.4727e-9, + Coef_Rm_b=4.9359e-5, + Coef_Rm_c=0.30814, + Xpth=0.05, + MMg=20, + DPe=1, + RV=6.45, + Kc=1.28, + Kd=1.33, + Wmeca(start=1400e3), + Welec(start=1358e3), + Wcomb(start=3.4942e6), + exc(start=1.8), + Gamma=1.2085, + Tsf(start=1088.15)) + annotation (Placement(transformation(extent={{-44,-46},{44,42}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWater(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{75,-19},{111,15}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss waterPressureLossIn( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-63,-8},{-51,4}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss waterPressureLossOut( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{51,-9},{65,5}}))); +equation + connect(internalCombustionEngine.Cair, sourceAir.C) annotation (Line( + points={{0,-41.6},{0,-62},{73,-62}}, + color={0,0,0}, + thickness=1)); + connect(internalCombustionEngine.Cfuel, fuelSourcePQ.C) annotation (Line( + points={{-30.8,-41.6},{-30.8,-62},{-72,-62}}, color={0,0,0})); + connect(sourceWater.C, waterPressureLossIn.C1) + annotation (Line(points={{-71,-2},{-63,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cws1, waterPressureLossIn.C2) annotation ( + Line(points={{-39.6,-2},{-51,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cws2, waterPressureLossOut.C1) + annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255})); + connect(sinkWater.C, waterPressureLossOut.C2) + annotation (Line(points={{75,-2},{65,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cfg, sink.C) annotation (Line( + points={{0,37.6},{0,65}}, + color={0,0,0}, + thickness=1)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestInternalCombustionEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo new file mode 100644 index 00000000..123ab095 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticCentrifugalPump + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo new file mode 100644 index 00000000..3e2e9e02 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticCentrifugalPump_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo new file mode 100644 index 00000000..9cc25305 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticCentrifugalPump_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo new file mode 100644 index 00000000..d1bc4845 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticFan + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Machines.StaticFan Compressor( + redeclare package Medium = Medium, + VRotn=2700, + rm=1, + a2=0, + b1=-1.315, + b2=2.4593, + VRot=2700, + a1=-263.145, + a3=500, + Q(start=2), + Qv(start=1.4), + rho(start=1.4)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + X0={1-0.006-0.23,0.23,0.006,0,0}, + Q0=4, + P0=130000, + T0=300, + option_temperature=true) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink SinkP1(redeclare package Medium = Medium, + T0=300, + option_temperature=true) annotation (Placement(transformation( + origin={50,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(Compressor.C2, SinkP1.C) annotation (Line(points={{10,0},{40,0}}, color={0,0,0})); + connect(Compressor.C1, SourceQ1.C) annotation (Line(points={{-10,0},{-40,0}}, color={0,0,0})); + annotation ( Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestStaticFan; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo new file mode 100644 index 00000000..acf05608 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticFan_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.Machines.StaticFan Compressor( + redeclare package Medium = Medium, + VRotn=2700, + rm=1, + a2=0, + b1=-1.315, + b2=2.4593, + VRot=2700, + a1=-263.145, + a3=500, + Q(start=2), + Qv(start=1.4), + rho(start=1.4)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + SubC0={0.5}, + X0={1 - 0.006 - 0.23,0.23,0.006,0,0}, + Q0=4, + P0=130000, + T0=300, + option_temperature=true) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink SinkP1( + redeclare package Medium = Medium, + T0=300, + option_temperature=true) annotation (Placement(transformation( + origin={50,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(Compressor.C2, SinkP1.C) annotation (Line(points={{10,0},{40,0}}, color={0,0,0})); + connect(Compressor.C1, SourceQ1.C) annotation (Line(points={{-10,0},{-40,0}}, color={0,0,0})); + annotation (Documentation(info=" +

    Copyright © EDF 2002 - 2021

    +

    ThermoSysPro Version 4.0

    +")); +end TestStaticFan_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo new file mode 100644 index 00000000..6fd8484e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestSteamEngine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(redeclare package Medium = Medium, P0=100000) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + h0=3.e6, + option_temperature=false, + P0=1600000) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); +equation + connect(sourceP.C, steamEngine1.C1) annotation (Line(points={{-30,0},{-7,0}}, color={0,0,255})); + connect(steamEngine1.C2, puitsP.C) annotation (Line(points={{7,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Window( + x=0.32, + y=0.02, + width=0.39, + height=0.47), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo new file mode 100644 index 00000000..20f0d47c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestSteamEngine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(redeclare package Medium = Medium, P0=100000) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + h0=3.e6, + option_temperature=false, + P0=1600000, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); +equation + connect(sourceP.C, steamEngine1.C1) annotation (Line(points={{-30,0},{-7,0}}, color={0,0,255})); + connect(steamEngine1.C2, puitsP.C) annotation (Line(points={{7,0},{30,0}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Window( + x=0.32, + y=0.02, + width=0.39, + height=0.47), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestSteamEngine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo new file mode 100644 index 00000000..ac7159d2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStodolaTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + +replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare replaceable package Medium = Medium, + Cst=4100, + Ps(start=5000), + rhos(start=1.22)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=300000, + Q0=200, + h0=3e6, + option_temperature=false) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{26,-10},{46,10}}))); +equation + connect(sourcePQ.C, stodolaTurbine.Ce) + annotation (Line(points={{-30,0},{-10.1,0}}, color={0,0,0})); + connect(stodolaTurbine.Cs, sink.C) + annotation (Line(points={{10.1,0},{26,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestStodolaTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo new file mode 100644 index 00000000..adcb506f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStodolaTurbine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + +replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3", "Trace4"}, C_nominal={0.1, 0.2, 0.3, 0.4}, C_default={0.2, 0.3, 0.4, 0.5}); + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare replaceable package Medium = Medium, + Cst=4100, + Ps(start=5000), + rhos(start=1.22)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=300000, + Q0=200, + h0=3e6, + SubC0={40,50,60,70}, + option_temperature=false) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{26,-10},{46,10}}))); +equation + connect(sourcePQ.C, stodolaTurbine.Ce) + annotation (Line(points={{-30,0},{-10.1,0}}, color={0,0,0})); + connect(stodolaTurbine.Cs, sink.C) + annotation (Line(points={{10.1,0},{26,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestStodolaTurbine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo new file mode 100644 index 00000000..de97f225 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Machines + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Machines; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order new file mode 100644 index 00000000..a20912f4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -0,0 +1,20 @@ +TestStodolaTurbine +TestStodolaTurbine_Traces +TestStaticCentrifugalPump +TestStaticCentrifugalPump_FlueGases +TestStaticCentrifugalPump_Traces +TestCentrifugalPump +TestCentrifugalPump_FlueGases +TestCentrifugalPump_Traces +TestCombustionTurbine +TestCombustionTurbine_Traces +TestGasTurbine +TestHeatPumpCompressor +TestInternalCombustionEngine +TestCHPEngineBarkantineSystem +TestCompressor +TestCompressor_Traces +TestStaticFan +TestStaticFan_Traces +TestSteamEngine +TestSteamEngine_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo index 92af1d3a..b511da1e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/package.mo @@ -1,116 +1,4 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples; package Media - - annotation (Icon(graphics={ - Text( - extent={{-102,0},{24,-26}}, - lineColor={242,148,0}, - textString= - "Thermo"), - Text( - extent={{-4,8},{68,-34}}, - lineColor={46,170,220}, - textString= - "SysPro"), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,30},{-6,26}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,36},{-6,32}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,42},{-6,38}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,48},{-6,44}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,32},{-2,28}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,38},{-2,34}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,44},{-2,40}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,50},{-2,46}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Line( - points={{22,12},{22,14},{22,16},{24,14},{20,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{26,12},{26,14},{26,16},{28,14},{24,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{30,10},{30,12},{30,14},{32,12},{28,16}}, - color={46,170,220}, - thickness=0.5), - Polygon( - points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), - Line( - points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{80,80},{100,100}}, - color={0,0,255}, - smooth=Smooth.None)})); + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; end Media; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo new file mode 100644 index 00000000..4609b989 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestBend + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.Bend bend(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-22},{1.77636e-15,-22},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestBend; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo new file mode 100644 index 00000000..dbb61f49 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_FlueGases.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestBend_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.Bend bend(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-30},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestBend_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo new file mode 100644 index 00000000..419b6238 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestBend_Traces.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestBend_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.Bend bend(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(bend.C2, sink.C) annotation (Line(points={{0,-10},{0,-23},{1.77636e-15,-23},{1.77636e-15,-30}}, color={0,0,0})); + connect(bend.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestBend_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo new file mode 100644 index 00000000..84c3160b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestCheckValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(checkValve.C2, sink.C) annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo new file mode 100644 index 00000000..ee165db7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_FlueGases.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestCheckValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(checkValve.C2, sink.C) annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo new file mode 100644 index 00000000..0c99f89c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestCheckValve_Traces.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestCheckValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(checkValve.C2, sink.C) annotation (Line(points={{11,0},{30,0}}, color={0,0,0})); + connect(checkValve.C1, sourcePQ.C) annotation (Line(points={{-11,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo new file mode 100644 index 00000000..28e578c2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestControlValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve( + redeclare replaceable package Medium = Medium, caract=[0,0; 0.5,3000; 0.75, + 7000; 1,8000]) + annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, Q0=2580) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,0.9; + 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2]) + annotation (Placement(transformation(extent={{-30,34},{-10,54}}, rotation=0))); +equation + connect(controlValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(controlValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(Constante1.y, controlValve.Ouv) + annotation (Line(points={{-9,44},{0,44},{0,17}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestControlValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo new file mode 100644 index 00000000..f79d0787 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestControlValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2"}, C_nominal={0.1, 2}, C_default={0.2, 5}); + + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve( + redeclare replaceable package Medium = Medium, caract=[0,0; 0.5,3000; 0.75, + 7000; 1,8000]) + annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + SubC0={10,20}, Q0=2580) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,0.9; + 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2]) + annotation (Placement(transformation(extent={{-30,34},{-10,54}}, rotation=0))); +equation + connect(controlValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(controlValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(Constante1.y, controlValve.Ouv) + annotation (Line(points={{-9,44},{0,44},{0,17}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestControlValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo new file mode 100644 index 00000000..1e2d861d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestControlValve_Traces_FlueGases.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestControlValve_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2"}, C_nominal={0.1, 2}, C_default={0.2, 5}); + + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve( + redeclare replaceable package Medium = Medium, + Cvmax=50000, caract=[0,0; 0.5,3000; 0.75, + 7000; 1,8000], + Pm(start=200000)) + annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, h0=2538785.2) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + h0=2538785.2, + SubC0={10,20}, X0={0.1,0.2,0.3,0.2,0.2}, + Q0=8) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table=[0,0.9; + 5,0.9; 15,0.5; 25,0.5; 50,0.2; 100,0.2]) + annotation (Placement(transformation(extent={{-30,34},{-10,54}}, rotation=0))); +equation + connect(controlValve.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(controlValve.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(Constante1.y, controlValve.Ouv) + annotation (Line(points={{-9,44},{0,44},{0,17}}, color={0,0,255})); + annotation (experiment(StopTime=80), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestControlValve_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo new file mode 100644 index 00000000..b063b2f6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDiaphragm + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(diaphragm.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDiaphragm; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo new file mode 100644 index 00000000..c0891318 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDiaphragm_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(diaphragm.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDiaphragm_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo new file mode 100644 index 00000000..f5acc6d4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDiaphragm_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDiaphragm_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(diaphragm.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(diaphragm.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDiaphragm_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo new file mode 100644 index 00000000..03404bbb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDynamicCheckValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve dynamicCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(dynamicCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo new file mode 100644 index 00000000..3e1b001a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDynamicCheckValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve dynamicCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(dynamicCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo new file mode 100644 index 00000000..ea171e73 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicCheckValve_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDynamicCheckValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve dynamicCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(dynamicCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo new file mode 100644 index 00000000..8c9e763f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDynamicReliefValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve dynamicReliefValve( + redeclare replaceable package Medium = Medium, + vh(start=0.91), + z(start=0.00389)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,-40}))); +equation + connect(dynamicReliefValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8},{0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicReliefValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo new file mode 100644 index 00000000..da900f05 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_FlueGases.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDynamicReliefValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve dynamicReliefValve(redeclare replaceable package Medium = Medium, vh(start=232)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=350000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,-40}))); +equation + connect(dynamicReliefValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8},{4.44089e-16,-9.8},{4.44089e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicReliefValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo new file mode 100644 index 00000000..94c22056 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestDynamicReliefValve_Traces.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestDynamicReliefValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve dynamicReliefValve( + redeclare replaceable package Medium = Medium, + vh(start=0.91), + z(start=0.00389)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,-40}))); +equation + connect(dynamicReliefValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(dynamicReliefValve.C1, sourcePQ.C) annotation (Line(points={{0,-9.8},{0,-19.9},{5.55112e-16,-19.9},{5.55112e-16,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicReliefValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo new file mode 100644 index 00000000..3d97044e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestIdealCheckValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(idealCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestIdealCheckValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo new file mode 100644 index 00000000..5a01613a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestIdealCheckValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(idealCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestIdealCheckValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo new file mode 100644 index 00000000..51cccd09 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealCheckValve_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestIdealCheckValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(idealCheckValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealCheckValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestIdealCheckValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo new file mode 100644 index 00000000..90644316 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve.mo @@ -0,0 +1,15 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestIdealSwitchValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve idealSwitchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(idealSwitchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestIdealSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo new file mode 100644 index 00000000..f722152a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_FlueGases.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestIdealSwitchValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve idealSwitchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(idealSwitchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestIdealSwitchValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo new file mode 100644 index 00000000..a9e66005 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestIdealSwitchValve_Traces.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestIdealSwitchValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve idealSwitchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(idealSwitchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(idealSwitchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, idealSwitchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestIdealSwitchValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo new file mode 100644 index 00000000..61534adc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestInvSingularPressureLoss + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(invSingularPressureLoss.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(invSingularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestInvSingularPressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo new file mode 100644 index 00000000..9fcc68d7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_FlueGases.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestInvSingularPressureLoss_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(invSingularPressureLoss.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(invSingularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestInvSingularPressureLoss_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo new file mode 100644 index 00000000..b041dcab --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestInvSingularPressureLoss_Traces.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestInvSingularPressureLoss_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + SubC0={10,20,30}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(invSingularPressureLoss.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(invSingularPressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestInvSingularPressureLoss_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo new file mode 100644 index 00000000..8ee42b80 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare replaceable package Medium = Medium, + L=10, + D=0.2) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(lumpedStraightPipe.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo new file mode 100644 index 00000000..623c5fdc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_FlueGases.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare replaceable package Medium = Medium, + L=10, + D=0.2) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(lumpedStraightPipe.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo new file mode 100644 index 00000000..52c96120 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestLumpedStraightPipe_Traces.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestLumpedStraightPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare replaceable package Medium = Medium, + L=10, + D=0.2) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + SubC0={10,20,30}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(lumpedStraightPipe.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(lumpedStraightPipe.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLumpedStraightPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo new file mode 100644 index 00000000..59b00b69 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestPipePressureLoss + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestPipePressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo new file mode 100644 index 00000000..728fb69a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestPipePressureLoss_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestPipePressureLoss_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo new file mode 100644 index 00000000..baebf5cd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestPipePressureLoss_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestPipePressureLoss_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(pipePressureLoss.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(pipePressureLoss.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestPipePressureLoss_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo new file mode 100644 index 00000000..2b78a5a7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSingularPressureLoss + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(singularPressureLoss.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(singularPressureLoss.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestSingularPressureLoss; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo new file mode 100644 index 00000000..c67d6dd3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSingularPressureLoss_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={10,20,30}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(singularPressureLoss.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(singularPressureLoss.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestSingularPressureLoss_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo new file mode 100644 index 00000000..a13b12e3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSingularPressureLoss_Traces_FlueGases.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSingularPressureLoss_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, option_temperature=true) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, SubC0={10,20,30}, + X0={0.1,0.2,0.3,0.2,0.2}, + option_temperature=true) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(singularPressureLoss.C2, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(singularPressureLoss.C1, sourcePQ.C) + annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestSingularPressureLoss_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo new file mode 100644 index 00000000..448ce7a7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve.mo @@ -0,0 +1,15 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSwitchValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.SwitchValve switchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-78,32},{-58,52}}))); +equation + connect(switchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) annotation (Line(points={{-57,42},{0,42},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSwitchValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo new file mode 100644 index 00000000..16b7d843 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_FlueGases.mo @@ -0,0 +1,22 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSwitchValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.PressureLosses.SwitchValve switchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-42,30},{-22,50}}))); +equation + connect(switchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) annotation (Line(points={{-21,40},{0,40},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSwitchValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo new file mode 100644 index 00000000..5238d3ce --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestSwitchValve_Traces.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestSwitchValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.SwitchValve switchValve(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-4},{10,16}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Constante constante annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); +equation + connect(switchValve.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(switchValve.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + connect(constante.yL, switchValve.Ouv) annotation (Line(points={{-19,40},{0,40},{0,13.2}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSwitchValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo new file mode 100644 index 00000000..5d93f85f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve.mo @@ -0,0 +1,50 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestThreeWayValve + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare replaceable package Medium = Medium, + P0=300000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare replaceable package Medium = Medium, + C2(Q(start=0)), + C3(Q(start=2000)), + Valve1(Pm(start=200000)), + VolumeA1(h(start=100000))) + annotation (Placement(transformation(extent={{-10,-6},{10,14}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-10},{90,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp( + Starttime=1, + Duration=2, + Initialvalue=0.2, + Finalvalue=0.8) + annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); +equation + connect(sourceP.C, threeWayValve.C1) + annotation (Line(points={{-70,0},{-10,0}}, color={0,0,255})); + connect(threeWayValve.C2, sinkP1.C) + annotation (Line(points={{10,0},{70,0}}, color={255,0,0})); + connect(threeWayValve.C3, sinkP2.C) + annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={255,0,0})); + connect(ramp.y, threeWayValve.Ouv) + annotation (Line(points={{-29,40},{0,40},{0,15}}, color={0,0,255})); + annotation (experiment(StopTime=5), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestThreeWayValve; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo new file mode 100644 index 00000000..9aac55bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_FlueGases.mo @@ -0,0 +1,54 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestThreeWayValve_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare replaceable package Medium = Medium, + P0=450000, + T0=573.15, + option_temperature=true, + X0={0.1,0.2,0.3,0.2,0.2}) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare replaceable package Medium = Medium, + Cvmax1=50000, + Cvmax2=50000, + C2(Q(start=0)), + C3(Q(start=20)), + Valve1(Pm(start=200000)), + Valve2(Pm(start=200000)), + VolumeA1(h(start=2800000))) + annotation (Placement(transformation(extent={{-10,-6},{10,14}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=100000, + T0=573.15, + option_temperature=true) + annotation (Placement(transformation(extent={{70,-10},{90,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2( + redeclare replaceable package Medium = Medium, + P0=100000, + T0=573.15, + option_temperature=true) + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp( + Starttime=1, + Duration=2, + Initialvalue=0.2, + Finalvalue=0.8) + annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); +equation + connect(sourceP.C, threeWayValve.C1) + annotation (Line(points={{-70,0},{-10,0}}, color={0,0,255})); + connect(threeWayValve.C2, sinkP1.C) + annotation (Line(points={{10,0},{70,0}}, color={255,0,0})); + connect(threeWayValve.C3, sinkP2.C) + annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={255,0,0})); + connect(ramp.y, threeWayValve.Ouv) + annotation (Line(points={{-29,40},{0,40},{0,15}}, color={0,0,255})); + annotation (experiment(StopTime=5), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestThreeWayValve_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo new file mode 100644 index 00000000..50a9e55f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/TestThreeWayValve_Traces.mo @@ -0,0 +1,52 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.PressureLosses; +model TestThreeWayValve_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = + ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare replaceable package Medium = Medium, + P0=300000, + h0=100000, + option_temperature=false, + SubC0={10}) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare replaceable package Medium = Medium, + C2(Q(start=0)), + C3(Q(start=2000)), + Valve1(Pm(start=200000)), + VolumeA1(h(start=100000))) + annotation (Placement(transformation(extent={{-10,-6},{10,14}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-10},{90,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2( + redeclare replaceable package Medium = Medium, + P0=100000, + h0=100000, + option_temperature=false) + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe ramp( + Starttime=1, + Duration=2, + Initialvalue=0.2, + Finalvalue=0.8) + annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); +equation + connect(sourceP.C, threeWayValve.C1) + annotation (Line(points={{-70,0},{-10,0}}, color={0,0,255})); + connect(threeWayValve.C2, sinkP1.C) + annotation (Line(points={{10,0},{70,0}}, color={255,0,0})); + connect(threeWayValve.C3, sinkP2.C) + annotation (Line(points={{0,-6},{0,-40},{70,-40}}, color={255,0,0})); + connect(ramp.y, threeWayValve.Ouv) + annotation (Line(points={{-29,40},{0,40},{0,15}}, color={0,0,255})); + annotation (experiment(StopTime=5), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestThreeWayValve_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo new file mode 100644 index 00000000..1238e652 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package PressureLosses + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end PressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order new file mode 100644 index 00000000..6c71b9c9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/PressureLosses/package.order @@ -0,0 +1,42 @@ +TestPipePressureLoss +TestPipePressureLoss_FlueGases +TestPipePressureLoss_Traces +TestSingularPressureLoss +TestSingularPressureLoss_Traces +TestSingularPressureLoss_Traces_FlueGases +TestLumpedStraightPipe +TestLumpedStraightPipe_FlueGases +TestLumpedStraightPipe_Traces +TestInvSingularPressureLoss +TestInvSingularPressureLoss_FlueGases +TestInvSingularPressureLoss_Traces +TestControlValve +TestControlValve_Traces +TestControlValve_Traces_FlueGases +TestThreeWayValve +TestThreeWayValve_FlueGases +TestThreeWayValve_Traces +TestDynamicReliefValve +TestDynamicReliefValve_FlueGases +TestDynamicReliefValve_Traces +TestIdealCheckValve +TestIdealCheckValve_FlueGases +TestIdealCheckValve_Traces +TestDiaphragm +TestDiaphragm_FlueGases +TestDiaphragm_Traces +TestBend +TestBend_FlueGases +TestBend_Traces +TestSwitchValve +TestSwitchValve_FlueGases +TestSwitchValve_Traces +TestIdealSwitchValve +TestIdealSwitchValve_FlueGases +TestIdealSwitchValve_Traces +TestDynamicCheckValve +TestDynamicCheckValve_FlueGases +TestDynamicCheckValve_Traces +TestCheckValve +TestCheckValve_FlueGases +TestCheckValve_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo new file mode 100644 index 00000000..c0f0702e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo new file mode 100644 index 00000000..2a5805a4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_FlueGases.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo new file mode 100644 index 00000000..c163eb70 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/TestSensors_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Sensors; +model TestSensors_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{86,-10},{106,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) + annotation (Placement(transformation(extent={{-106,-10},{-86,10}}))); + ThermoSysPro.Fluid.Sensors.SensorP sensorP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-82,-2},{-62,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQ sensorQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-58,-2},{-38,18}}))); + ThermoSysPro.Fluid.Sensors.SensorQv sensorQv(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-34,-2},{-14,18}}))); + ThermoSysPro.Fluid.Sensors.SensorH sensorH(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + ThermoSysPro.Fluid.Sensors.SensorT sensorT(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{14,-2},{34,18}}))); + ThermoSysPro.Fluid.Sensors.SensorSubC sensorSubC(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{38,-2},{58,18}}))); + ThermoSysPro.Fluid.Sensors.SensorX sensorX(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{62,-2},{82,18}}))); +equation + connect(sensorP.C1, sourcePQ.C) annotation (Line(points={{-82,0},{-86,0}}, color={0,0,0})); + connect(sensorP.C2, sensorQ.C1) annotation (Line(points={{-61.8,0},{-58,0}}, color={0,0,0})); + connect(sensorQ.C2, sensorQv.C1) annotation (Line(points={{-37.8,0},{-34,0}}, color={0,0,0})); + connect(sensorQv.C2, sensorH.C1) annotation (Line(points={{-13.8,0},{-10,0}}, color={0,0,0})); + connect(sensorH.C2, sensorT.C1) annotation (Line(points={{10.2,0},{14,0}}, color={0,0,0})); + connect(sensorT.C2, sensorSubC.C1) annotation (Line(points={{34.2,0},{38,0}}, color={0,0,0})); + connect(sensorSubC.C2, sensorX.C1) annotation (Line(points={{58.2,0},{62,0}}, color={0,0,0})); + connect(sensorX.C2, sink.C) annotation (Line(points={{82.2,0},{86,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSensors_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo new file mode 100644 index 00000000..f8825d8b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Sensors + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Sensors; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order new file mode 100644 index 00000000..89cbb72b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Sensors/package.order @@ -0,0 +1,3 @@ +TestSensors +TestSensors_FlueGases +TestSensors_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo deleted file mode 100644 index 55aab89d..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestAirHumidity.mo +++ /dev/null @@ -1,26 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestAirHumidity - ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity(hum0 = 0.9, ppvap0(start = 2085.0), rho_air(start = 1.14), rho_vap(start = 0.015)) annotation( - Placement(transformation(extent = {{-10, 0}, {10, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 1.e-5, rho(start = 1.17)) annotation( - Placement(transformation(extent = {{40, 0}, {60, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases annotation( - Placement(transformation(extent = {{80, 0}, {100, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ(option_temperature = true, Xco2 = 0, Xh2o = 0.0132625, Xo2 = 0.217282, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 100000, T0 = 293) annotation( - Placement(transformation(extent = {{-80, 0}, {-60, 20}}, rotation = 0))); -equation - connect(airHumidity.C2, singularPressureLoss.C1) annotation( - Line(points = {{10, 10}, {40, 10}}, color = {0, 0, 0})); - connect(singularPressureLoss.C2, sinkFlueGases.C) annotation( - Line(points = {{60, 10}, {80, 10}}, color = {0, 0, 0})); - connect(sourceFlueGasesPQ.C, airHumidity.C1) annotation( - Line(points = {{-60, 10}, {-10, 10}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestAirHumidity; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo deleted file mode 100644 index 40ad2383..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBend.mo +++ /dev/null @@ -1,24 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestBend - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-100, 26}, {-80, 46}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1 annotation( - Placement(transformation(extent = {{60, 0}, {80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.Bend Bend annotation( - Placement(transformation(extent = {{-20, 26}, {0, 46}}, rotation = 0))); -equation - connect(Bend.C2, SinkP1.C) annotation( - Line(points = {{-10, 26}, {-10, 10}, {60, 10}}, color = {0, 0, 255})); - connect(SourceP1.C, Bend.C1) annotation( - Line(points = {{-80, 36}, {-20, 36}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.45, y = 0.01, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestBend; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo deleted file mode 100644 index eb484eb3..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestBoilerSystem.mo +++ /dev/null @@ -1,38 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestBoilerSystem - import ThermoSysPro; - ThermoSysPro.Fluid.Boilers.BoilerSystem BoilerSystem(Wloss = 0, Ke = 1.e6, Tsf = 386.16) annotation( - Placement(transformation(extent = {{-45, -51}, {45, 51}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(Xco2 = 0, Xh2o = 0.01, Q0 = 27., Xo2 = 0.233, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, T0 = 298.16, option_temperature = true) annotation( - Placement(transformation(extent = {{-102, -92}, {-63, -55}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( - Placement(transformation(extent = {{-56, 51}, {-98, 90}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0 = 24., h0 = 600e3, P0 = 14000000) annotation( - Placement(transformation(extent = {{105, -88}, {69, -54}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{70, 53}, {106, 89}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 1e-3) annotation( - Placement(transformation(extent = {{60, -77}, {52, -65}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 1e-3) annotation( - Placement(transformation(extent = {{53, 65}, {61, 77}}, rotation = 0))); -equation - connect(singularPressureLoss1.C2, sink.C) annotation( - Line(points = {{61, 71}, {70, 71}}, color = {0, 0, 255})); - connect(BoilerSystem.OutletWaterSteam, singularPressureLoss1.C1) annotation( - Line(points = {{38.5714, 51}, {38.5714, 71}, {53, 71}}, color = {0, 0, 0})); - connect(BoilerSystem.InletWaterSteam, singularPressureLoss.C2) annotation( - Line(points = {{38.5714, -51}, {38.5714, -71}, {52, -71}}, color = {0, 0, 0})); - connect(singularPressureLoss.C1, sourcePQ.C) annotation( - Line(points = {{60, -71}, {66, -71}, {66, -71}, {69, -71}}, color = {0, 0, 0})); - connect(sinkP.C, BoilerSystem.OutletFlueGases) annotation( - Line(points = {{-56, 70.5}, {-38.5714, 70.5}, {-38.5714, 51}}, color = {0, 0, 0})); - connect(sourceQ.C, BoilerSystem.InletFlueGases) annotation( - Line(points = {{-63, -73.5}, {-38.5714, -73.5}, {-38.5714, -51}}, color = {0, 0, 0})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestBoilerSystem; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo deleted file mode 100644 index 751b064d..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCHPEngineBarkantineSystem.mo +++ /dev/null @@ -1,24 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestCHPEngineBarkantineSystem - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - Machines.CHPEngineBarkantineSystem CHPBarkantine annotation( - Placement(transformation(extent = {{-40, 0}, {20, 60}}, rotation = 0))); -equation - connect(SourceP1.C, CHPBarkantine.inletWaterSteam) annotation( - Line(points = {{-80, 30}, {-50, 30}, {-50, 45}, {-40, 45}}, color = {0, 0, 0})); - connect(CHPBarkantine.outletWaterSteam, PuitsP1.C) annotation( - Line(points = {{20, 45}, {30, 45}, {30, 30}, {60, 30}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.45, y = 0.01, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestCHPEngineBarkantineSystem; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo deleted file mode 100644 index e58ce5de..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCentrifugalPump1.mo +++ /dev/null @@ -1,41 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestCentrifugalPump1 - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(mode_car = 1, mode_car_hn = 1, mode_car_Cr = 1, dynamic_mech_equation = false) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0 = 0) annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(Starttime = 10, Duration = 100, Initialvalue = 1400, Finalvalue = 0) annotation( - Placement(transformation(extent = {{-100, -20}, {-80, 0}}, rotation = 0))); - ThermoSysPro.ElectroMechanics.BoundaryConditions.SourceAngularVelocity sourceAngularVelocity annotation( - Placement(transformation(extent = {{-60, -20}, {-40, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ1(Q0 = 0) annotation( - Placement(transformation(extent = {{-80, -60}, {-60, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump1(mode_car = 1, mode_car_hn = 1, mode_car_Cr = 1) annotation( - Placement(transformation(extent = {{-20, -60}, {0, -40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink1 annotation( - Placement(transformation(extent = {{40, -60}, {60, -40}}, rotation = 0))); -equation - connect(sourcePQ.C, centrifugalPump.C1) annotation( - Line(points = {{-60, 30}, {-20, 30}}, color = {0, 0, 255})); - connect(centrifugalPump.C2, sink.C) annotation( - Line(points = {{0, 30}, {40, 30}}, color = {0, 0, 255})); - connect(sourceAngularVelocity.M, centrifugalPump.M) annotation( - Line(points = {{-39, -10}, {-10, -10}, {-10, 19}})); - connect(sourcePQ1.C, centrifugalPump1.C1) annotation( - Line(points = {{-60, -50}, {-20, -50}}, color = {0, 0, 255})); - connect(centrifugalPump1.C2, sink1.C) annotation( - Line(points = {{0, -50}, {40, -50}}, color = {0, 0, 255})); - connect(rampe.y, sourceAngularVelocity.IAngularVelocity) annotation( - Line(points = {{-79, -10}, {-55, -10}})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics = {Text(extent = {{-100, 100}, {-60, 80}}, lineColor = {0, 0, 255}, textString = "w=1 ==> w=0"), Text(extent = {{-100, 80}, {-60, 60}}, lineColor = {0, 0, 255}, textString = "q=0"), Text(extent = {{-100, 60}, {-60, 40}}, lineColor = {0, 0, 255}, textString = "theta=0 ==> theta=-180")}), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestCentrifugalPump1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo deleted file mode 100644 index e3ac7d95..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCheckValve.mo +++ /dev/null @@ -1,68 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestCheckValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-104, 20}, {-84, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0 = 6e5) annotation( - Placement(transformation(extent = {{84, 20}, {104, 40}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump1 annotation( - Placement(transformation(extent = {{-30, 60}, {-10, 80}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump2 annotation( - Placement(transformation(extent = {{-30, -20}, {-10, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumeD annotation( - Placement(transformation(extent = {{-50, 20}, {-30, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve1 annotation( - Placement(transformation(extent = {{10, 60}, {30, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve2 annotation( - Placement(transformation(extent = {{8, -20}, {28, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC annotation( - Placement(transformation(extent = {{30, 20}, {50, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( - Placement(transformation(extent = {{-60, -80}, {-40, -60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 6e5) annotation( - Placement(transformation(extent = {{20, -80}, {40, -60}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(amplitude = 6e5, width = 50, period = 100, offset = 3e5) annotation( - Placement(transformation(extent = {{-100, -80}, {-80, -60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3 annotation( - Placement(transformation(extent = {{-20, -80}, {0, -60}}, rotation = 0))); -equation - connect(staticCentrifugalPump1.C2, checkValve1.C1) annotation( - Line(points = {{-10, 70}, {9, 70}}, color = {0, 0, 255})); - connect(staticCentrifugalPump2.C2, checkValve2.C1) annotation( - Line(points = {{-10, -10}, {0, -10}, {0, -10}, {7, -10}}, color = {0, 0, 255})); - connect(perteDP1.C2, puitsP.C) annotation( - Line(points = {{80, 30}, {84, 30}}, color = {0, 0, 255})); - connect(sourceP.C, perteDP.C1) annotation( - Line(points = {{-84, 30}, {-80, 30}}, color = {0, 0, 255})); - connect(sourceP1.C, checkValve3.C1) annotation( - Line(points = {{-40, -70}, {-21, -70}}, color = {0, 0, 255})); - connect(checkValve3.C2, puitsP1.C) annotation( - Line(points = {{1, -70}, {20, -70}}, color = {0, 0, 255})); - connect(pulse.y, sourceP1.IPressure) annotation( - Line(points = {{-79, -70}, {-55, -70}})); - connect(volumeD.Cs1, staticCentrifugalPump1.C1) annotation( - Line(points = {{-40, 40}, {-40, 70}, {-30, 70}}, color = {0, 0, 0})); - connect(volumeD.Cs2, staticCentrifugalPump2.C1) annotation( - Line(points = {{-40, 20}, {-40, -10}, {-30, -10}}, color = {0, 0, 0})); - connect(checkValve1.C2, volumeC.Ce2) annotation( - Line(points = {{31, 70}, {40, 70}, {40, 40}}, color = {0, 0, 0})); - connect(checkValve2.C2, volumeC.Ce3) annotation( - Line(points = {{29, -10}, {40, -10}, {40, 20}}, color = {0, 0, 0})); - connect(volumeC.Cs, perteDP1.C1) annotation( - Line(points = {{50, 30}, {60, 30}}, color = {0, 0, 0})); - connect(perteDP.C2, volumeD.Ce) annotation( - Line(points = {{-60, 30}, {-50, 30}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})), - Window(x = 0.28, y = 0.03, width = 0.5, height = 0.6), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestCheckValve; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo deleted file mode 100644 index b0d74727..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCombustionTurbine.mo +++ /dev/null @@ -1,28 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestCombustionTurbine - parameter Real is_eff_n1(fixed = false, start = 0.85) "Nominal isentropic efficiency"; - parameter Real Qred1(fixed = false, start = 0.01) "Reduced mass flow rate"; - ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine(tau_n = 0.065, is_eff_n = is_eff_n1, Qred = Qred1, Pe(fixed = true, start = 1500000), Ts(fixed = true, start = 830)) annotation( - Placement(transformation(extent = {{-42, -42}, {36, 42}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1(Xso2 = 0, Q0 = 430, Xco2 = 0.06, Xh2o = 0.06, Xo2 = 0.14, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, T0 = 1500, option_temperature = true) annotation( - Placement(transformation(extent = {{-106, -10}, {-86, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0 = 1e5) annotation( - Placement(transformation(origin = {94, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Wc1(k = -1.8e8) annotation( - Placement(transformation(extent = {{-100, -42}, {-80, -22}}, rotation = 0))); -equation - connect(SourceQ1.C, CombustionTurbine.Ce) annotation( - Line(points = {{-86, 0}, {-42, 0}}, color = {0, 0, 0}, thickness = 1)); - connect(CombustionTurbine.Cs, SinkP1.C) annotation( - Line(points = {{36, 0}, {84, 0}}, color = {0, 0, 0}, thickness = 1)); - connect(Wc1.y, CombustionTurbine.CompressorPower) annotation( - Line(points = {{-79, -32}, {-45.9, -32}, {-45.9, -16.8}})); - annotation( - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestCombustionTurbine; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo deleted file mode 100644 index 10b98b93..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestCompressor.mo +++ /dev/null @@ -1,23 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestCompressor - parameter Real is_eff_n1(fixed = false, start = 0.85) "Nominal isentropic efficiency"; - ThermoSysPro.Fluid.Machines.Compressor Compressor(Ps(fixed = false), tau_n = 16, is_eff_n = is_eff_n1, Pe(fixed = false, start = 100000), Ts(fixed = true, start = 680)) annotation( - Placement(transformation(extent = {{-52, -52}, {48, 52}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1(Xso2 = 0, Xco2 = 0.0, Xh2o = 0.003, Xo2 = 0.23, Q0 = 420, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 100000, T0 = 288, option_temperature = true) annotation( - Placement(transformation(extent = {{-104, -10}, {-84, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0 = 15.8e5) annotation( - Placement(transformation(origin = {96, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); -equation - connect(SourceQ1.C, Compressor.Ce) annotation( - Line(points = {{-84, 0}, {-39.5, 0}}, color = {0, 0, 0}, thickness = 1)); - connect(Compressor.Cs, SinkP1.C) annotation( - Line(points = {{35.5, 0}, {86, 0}}, color = {0, 0, 0}, thickness = 1)); - annotation( - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestCompressor; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo deleted file mode 100644 index a505c5a1..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiaphragm.mo +++ /dev/null @@ -1,24 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDiaphragm - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-64, -10}, {-44, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{44, -10}, {64, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); -equation - connect(Diaphragm.C2, PuitsP1.C) annotation( - Line(points = {{10, 0}, {44, 0}}, color = {0, 0, 255})); - connect(SourceP1.C, Diaphragm.C1) annotation( - Line(points = {{-44, 0}, {-10, 0}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.45, y = 0.01, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDiaphragm; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo deleted file mode 100644 index 5a46ef73..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicOnePhaseFlowPipe.mo +++ /dev/null @@ -1,60 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDiffusion_DynamicOnePhaseFlowPipe - HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe(L = 20, Q(start = {5.492026593727256E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28}), h(start = {84011.8111671368, 96057.08454715868, 107718.52365349933, 119295.22918923412, 130792.44987567255, 142215.00322033433, 153567.34130353143, 164853.6027022597, 176077.65400298327, 187243.1234252416, 198353.42841254506, 209411.79856705698}), continuous_flow_reversal = true, inertia = false, dynamic_mass_balance = false, advection = true, dynamic_energy_balance = false, diffusion = true, P(start = {99999.999999976, 99999.999999978, 99999.999999981, 99999.999999983, 99999.999999985, 99999.999999988, 99999.99999999, 99999.999999992, 100000, 100000, 100000, 100000})) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 50}}, rotation = 0))); - BoundaryConditions.SourceP sourceP(continuous_flow_reversal = true, diffusion = true, P0 = 100000, T0 = 293.15) annotation( - Placement(transformation(extent = {{-80, 30}, {-60, 50}}, rotation = 0))); - BoundaryConditions.SinkP sinkP(diffusion = true, T0 = 323.15) annotation( - Placement(transformation(extent = {{30, 30}, {50, 50}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource(option_temperature = 2, T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, W0 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) annotation( - Placement(transformation(extent = {{-10, 70}, {10, 90}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, 50}, {10, 70}}, rotation = 0))); - PressureLosses.SwitchValve switchValve(Qmin = 0) annotation( - Placement(transformation(extent = {{-40, 36}, {-20, 56}}))); - InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime = 1) annotation( - Placement(transformation(extent = {{-74, 66}, {-66, 74}}))); - InstrumentationAndControl.Blocks.Logique.NONL nONL annotation( - Placement(transformation(extent = {{-54, 66}, {-46, 74}}))); - HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe1(L = 20, Q(start = {4.9243335191367076E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05}), h(start = {84011.8111671368, 95792.53373784182, 107482.21110144592, 119086.65906940492, 130611.17116650468, 142060.60442474802, 153439.44619534744, 164751.8668430315, 176001.7618457063, 187192.78587129858, 198328.3807233511, 209411.79856705698}), continuous_flow_reversal = true, inertia = false, dynamic_mass_balance = false, advection = true, dynamic_energy_balance = false, diffusion = true, P(start = {99999.999999976, 99999.999999978, 99999.999999981, 99999.999999983, 99999.999999985, 99999.999999988, 99999.99999999, 99999.999999992, 100000, 100000, 100000, 100000})) annotation( - Placement(transformation(extent = {{-10, -70}, {10, -50}}, rotation = 0))); - BoundaryConditions.SourceQ sourceP1(continuous_flow_reversal = true, diffusion = true, Q0 = 0, T0 = 293.15, option_temperature = true) annotation( - Placement(transformation(extent = {{-80, -70}, {-60, -50}}, rotation = 0))); - BoundaryConditions.SinkP sinkP1(diffusion = true, T0 = 323.15) annotation( - Placement(transformation(extent = {{30, -70}, {50, -50}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature = 2, T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, W0 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) annotation( - Placement(transformation(extent = {{-10, -30}, {10, -10}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, -50}, {10, -30}}, rotation = 0))); -equation - connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation( - Line(points = {{10, 40}, {30, 40}}, color = {0, 0, 255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation( - Line(points = {{0, 70.2}, {0, 62}}, color = {191, 95, 0})); - connect(sourceP.C, switchValve.C1) annotation( - Line(points = {{-60, 40}, {-40, 40}}, color = {0, 0, 0})); - connect(switchValve.C2, dynamicOnePhaseFlowPipe.C1) annotation( - Line(points = {{-20, 40}, {-10, 40}}, color = {0, 0, 0})); - connect(echelon.yL, nONL.uL) annotation( - Line(points = {{-65.6, 70}, {-54.4, 70}}, color = {0, 0, 255})); - connect(nONL.yL, switchValve.Ouv) annotation( - Line(points = {{-45.6, 70}, {-30, 70}, {-30, 53.2}}, color = {0, 0, 255})); - connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation( - Line(points = {{0, 58}, {0, 43}}, color = {0, 0, 0})); - connect(dynamicOnePhaseFlowPipe1.C2, sinkP1.C) annotation( - Line(points = {{10, -60}, {30, -60}}, color = {0, 0, 255})); - connect(heatSource1.C, heatExchangerWall1.WT2) annotation( - Line(points = {{0, -29.8}, {0, -38}}, color = {191, 95, 0})); - connect(heatExchangerWall1.WT1, dynamicOnePhaseFlowPipe1.CTh) annotation( - Line(points = {{0, -42}, {0, -57}}, color = {0, 0, 0})); - connect(sourceP1.C, dynamicOnePhaseFlowPipe1.C1) annotation( - Line(points = {{-60, -60}, {-10, -60}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 10), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDiffusion_DynamicOnePhaseFlowPipe; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo deleted file mode 100644 index 452a4edd..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicPlateHeatExchanger.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDiffusion_DynamicPlateHeatExchanger - ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D(region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, steady_state = true, Ns = 10, dynamic_energy_balance = false, diffusion = true, continuous_flow_reversal = true) annotation( - Placement(transformation(extent = {{-20, 40}, {0, 60}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP(option_temperature = true, diffusion = true, Q0 = 0, T0 = 340) annotation( - Placement(transformation(extent = {{-80, 40}, {-60, 60}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP1 annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - BoundaryConditions.Sink puitsP(option_temperature = true, diffusion = true) annotation( - Placement(transformation(extent = {{40, 40}, {60, 60}}, rotation = 0))); - BoundaryConditions.Sink puitsP1(diffusion = true, h0 = 200000) annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); -equation - connect(sourceP.C, echangeurAPlaques1D.Ec) annotation( - Line(points = {{-60, 50}, {-20, 50}}, color = {0, 0, 255})); - connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation( - Line(points = {{-40, 30}, {-15, 30}, {-15, 44}}, color = {0, 0, 255})); - connect(echangeurAPlaques1D.Sc, puitsP.C) annotation( - Line(points = {{0, 50}, {20, 50}, {20, 50}, {40, 50}}, color = {0, 0, 255})); - connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation( - Line(points = {{-5, 44}, {-6, 44}, {-6, 30}, {20, 30}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDiffusion_DynamicPlateHeatExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo deleted file mode 100644 index 98e81fd0..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_DynamicTwoPhaseFlowPipe.mo +++ /dev/null @@ -1,60 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDiffusion_DynamicTwoPhaseFlowPipe - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(L = 20, Q(start = {5.492026593727256E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28, 5.492026607285849E-28}), h(start = {84011.8111671368, 96057.08454715868, 107718.52365349933, 119295.22918923412, 130792.44987567255, 142215.00322033433, 153567.34130353143, 164853.6027022597, 176077.65400298327, 187243.1234252416, 198353.42841254506, 209411.79856705698}), continuous_flow_reversal = true, inertia = false, dynamic_mass_balance = false, advection = true, dynamic_energy_balance = false, cpl2(start = {4183.826265167646, 4182.239614474996, 4181.0130500668565, 4180.0726819587735, 4179.380584625066, 4178.908955510578, 4178.63729871947, 4178.550389628282, 4178.636803895239, 4178.887855575399, 4179.29683238825}), cpv2(start = {2049.2168798430116, 2046.3449415228738, 2043.4582034172774, 2040.5558258112756, 2037.636860922887, 2034.7002308786582, 2031.744699351002, 2028.7688344361377, 2025.770959168656, 2022.7490841743909, 2019.518356822069}), kl2(start = {0.5995743350581909, 0.5995743350579683, 0.5995743350571023, 0.5995743350562764, 0.5995743350555206, 0.5995743350548642, 0.5995743350543319, 0.5995743350539415, 0.5995743350536991, 0.599574335053346, 0.5995743403506435}), kv2(start = {0.024965829345847085, 0.024990303852044017, 0.025018417766029456, 0.02505065954620164, 0.025087620205457677, 0.025130023834108832, 0.025178770324693366, 0.02523499664554269, 0.025300167212669696, 0.02537621164077076, 0.0254715737844706}), diffusion = true, pro2(T(start = {294.61264959452353, 297.4461204783121, 300.22404336919567, 302.982702661547, 305.7232156830587, 308.44660714369365, 311.15382285197893, 313.8457405734291, 316.5231787363566, 319.18690350188376, 321.8376345796106}), d(start = {997.892715521068, 997.2253707910008, 996.4959923473901, 995.7017938222477, 994.8471177790162, 993.9357736693299, 992.9711212203756, 991.9561376232762, 990.8934721677539, 989.7854910510117, 988.6343144234495})), P(start = {99999.999999976, 99999.999999978, 99999.999999981, 99999.999999983, 99999.999999985, 99999.999999988, 99999.99999999, 99999.999999992, 100000, 100000, 100000, 100000})) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 50}}, rotation = 0))); - BoundaryConditions.SourceP sourceP(continuous_flow_reversal = true, diffusion = true, P0 = 100000, T0 = 293.15) annotation( - Placement(transformation(extent = {{-80, 30}, {-60, 50}}, rotation = 0))); - BoundaryConditions.SinkP sinkP(diffusion = true, T0 = 323.15) annotation( - Placement(transformation(extent = {{30, 30}, {50, 50}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource(option_temperature = 2, T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, W0 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) annotation( - Placement(transformation(extent = {{-10, 70}, {10, 90}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, 50}, {10, 70}}, rotation = 0))); - PressureLosses.SwitchValve switchValve(Qmin = 0) annotation( - Placement(transformation(extent = {{-40, 36}, {-20, 56}}))); - InstrumentationAndControl.Blocks.Logique.Echelon echelon(startTime = 1) annotation( - Placement(transformation(extent = {{-74, 66}, {-66, 74}}))); - InstrumentationAndControl.Blocks.Logique.NONL nONL annotation( - Placement(transformation(extent = {{-54, 66}, {-46, 74}}))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(L = 20, Q(start = {4.9243335191367076E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05, 4.924351014778949E-05}), h(start = {84011.8111671368, 95792.53373784182, 107482.21110144592, 119086.65906940492, 130611.17116650468, 142060.60442474802, 153439.44619534744, 164751.8668430315, 176001.7618457063, 187192.78587129858, 198328.3807233511, 209411.79856705698}), continuous_flow_reversal = true, inertia = false, dynamic_mass_balance = false, advection = true, cpl2(start = {4183.8461052314415, 4182.2694439224715, 4181.033777873867, 4180.086463719214, 4179.389099400846, 4178.913555072556, 4178.639109839789, 4178.550383980675, 4178.6358456341095, 4178.886733579299, 4179.2962820044995}), cpv2(start = {2049.2168798430116, 2046.3449415228738, 2043.4582034172774, 2040.5558258112756, 2037.636860922887, 2034.7002308786582, 2031.744699351002, 2028.7688344361377, 2025.770959168656, 2022.7490841743909, 2019.518356822069}), kl2(start = {0.5995743350581909, 0.5995743350579683, 0.5995743350571023, 0.5995743350562764, 0.5995743350555206, 0.5995743350548642, 0.5995743350543319, 0.5995743350539415, 0.5995743350536991, 0.599574335053346, 0.5995743403506435}), kv2(start = {0.024965829345847085, 0.024990303852044017, 0.025018417766029456, 0.02505065954620164, 0.025087620205457677, 0.025130023834108832, 0.025178770324693366, 0.02523499664554269, 0.025300167212669696, 0.02537621164077076, 0.0254715737844706}), diffusion = true, pro2(T(start = {294.58103295016184, 297.3862511962513, 300.1708576823335, 302.9360907339107, 305.6830771234792, 308.4128498965468, 311.12636229776916, 313.82449878754863, 316.50808386868016, 319.1778892498971, 321.83463973606456}), d(start = {997.8997091804818, 997.2402860410343, 996.5106311231898, 995.7157728656836, 994.8600940026633, 993.9474377103298, 992.9811922410435, 991.9643590731059, 990.8996082946633, 989.7893240021328, 988.6356418174122})), dynamic_energy_balance = false, P(start = {99999.999999976, 99999.999999978, 99999.999999981, 99999.999999983, 99999.999999985, 99999.999999988, 99999.99999999, 99999.999999992, 100000, 100000, 100000, 100000})) annotation( - Placement(transformation(extent = {{-10, -70}, {10, -50}}, rotation = 0))); - BoundaryConditions.SourceQ sourceP1(continuous_flow_reversal = true, diffusion = true, Q0 = 0, T0 = 293.15, option_temperature = true) annotation( - Placement(transformation(extent = {{-80, -70}, {-60, -50}}, rotation = 0))); - BoundaryConditions.SinkP sinkP1(diffusion = true, T0 = 323.15) annotation( - Placement(transformation(extent = {{30, -70}, {50, -50}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature = 2, T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, W0 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) annotation( - Placement(transformation(extent = {{-10, -30}, {10, -10}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, -50}, {10, -30}}, rotation = 0))); -equation - connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation( - Line(points = {{10, 40}, {30, 40}}, color = {0, 0, 255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation( - Line(points = {{0, 70.2}, {0, 62}}, color = {191, 95, 0})); - connect(sourceP.C, switchValve.C1) annotation( - Line(points = {{-60, 40}, {-40, 40}}, color = {0, 0, 0})); - connect(switchValve.C2, dynamicTwoPhaseFlowPipe.C1) annotation( - Line(points = {{-20, 40}, {-10, 40}}, color = {0, 0, 0})); - connect(echelon.yL, nONL.uL) annotation( - Line(points = {{-65.6, 70}, {-54.4, 70}}, color = {0, 0, 255})); - connect(nONL.yL, switchValve.Ouv) annotation( - Line(points = {{-45.6, 70}, {-30, 70}, {-30, 53.2}}, color = {0, 0, 255})); - connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation( - Line(points = {{0, 58}, {0, 43}}, color = {0, 0, 0})); - connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation( - Line(points = {{10, -60}, {30, -60}}, color = {0, 0, 255})); - connect(heatSource1.C, heatExchangerWall1.WT2) annotation( - Line(points = {{0, -29.8}, {0, -38}}, color = {191, 95, 0})); - connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh) annotation( - Line(points = {{0, -42}, {0, -57}}, color = {0, 0, 0})); - connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation( - Line(points = {{-60, -60}, {-10, -60}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 10), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDiffusion_DynamicTwoPhaseFlowPipe; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo deleted file mode 100644 index 2df14a91..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDiffusion_VolumeA.mo +++ /dev/null @@ -1,38 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDiffusion_VolumeA - BoundaryConditions.SourcePQ sourcePQ1(C(h_vol_2(start = 63269.22110794237)), Q(start = 0), continuous_flow_reversal = false, Q0 = 0, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam, option_temperature = true, T0 = 293.15, diffusion = true) annotation( - Placement(transformation(extent = {{-100, -10}, {-80, 10}}))); - BoundaryConditions.Sink sink1(option_temperature = true, T0 = 333.15, diffusion = true) annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}))); - PressureLosses.SwitchValve switchValve(Qmin = 0) annotation( - Placement(transformation(extent = {{-60, -4}, {-40, 16}}))); - InstrumentationAndControl.Blocks.Logique.Constante constante(K = true) annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}))); - Volumes.VolumeA volumeA(continuous_flow_reversal = false, diffusion = true, dynamic_energy_balance = false, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}))); - PressureLosses.SwitchValve switchValve1(Qmin = 0, k = 2000) annotation( - Placement(transformation(extent = {{40, -4}, {60, 16}}))); - InstrumentationAndControl.Blocks.Logique.Constante constante1(K = true) annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}))); -equation - connect(constante.yL, switchValve.Ouv) annotation( - Line(points = {{-59, 30}, {-50, 30}, {-50, 13.2}}, color = {0, 0, 255})); - connect(sourcePQ1.C, switchValve.C1) annotation( - Line(points = {{-80, 0}, {-60, 0}}, color = {0, 0, 0})); - connect(volumeA.Cs1, switchValve1.C1) annotation( - Line(points = {{10, 0}, {40, 0}}, color = {0, 0, 0})); - connect(switchValve1.C2, sink1.C) annotation( - Line(points = {{60, 0}, {80, 0}}, color = {0, 0, 0})); - connect(constante1.yL, switchValve1.Ouv) annotation( - Line(points = {{41, 30}, {50, 30}, {50, 13.2}}, color = {0, 0, 255})); - connect(switchValve.C2, volumeA.Ce1) annotation( - Line(points = {{-40, 0}, {-10, 0}}, color = {0, 0, 0})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - experiment(StopTime = 12), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDiffusion_VolumeA; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo deleted file mode 100644 index b51b2453..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCheckValve.mo +++ /dev/null @@ -1,28 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicCheckValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( - Placement(transformation(extent = {{-38, -10}, {-18, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 6e5) annotation( - Placement(transformation(extent = {{42, -10}, {62, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J = 10) annotation( - Placement(transformation(extent = {{2, -10}, {22, 10}}, rotation = 0))); - InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(period = 100, amplitude = 3e5, offset = 6e5) annotation( - Placement(transformation(extent = {{-78, -10}, {-58, 10}}, rotation = 0))); -equation - connect(sourceP1.C, checkValve.C1) annotation( - Line(points = {{-18, 0}, {2, 0}}, color = {0, 0, 255})); - connect(checkValve.C2, puitsP1.C) annotation( - Line(points = {{22, 0}, {32, 0}, {42, 0}}, color = {0, 0, 255})); - connect(sourceP1.IPressure, pulse.y) annotation( - Line(points = {{-33, 0}, {-57, 0}}, color = {28, 108, 200})); - annotation( - Diagram(graphics, coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})), - Window(x = 0.28, y = 0.03, width = 0.5, height = 0.6), - experiment(StopTime = 300), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicCheckValve; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo deleted file mode 100644 index 8c428244..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicCondenser.mo +++ /dev/null @@ -1,54 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicCondenser - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start = 355000.00000015664), Q(fixed = false), hn(fixed = false, start = 71.08245675235786), p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"), a1(start = -88.67, fixed = false), C2(h(start = 195297.69906611618), h_vol_1(start = 195297.69906611618)), Qv(start = 0.009081311621074862), h(start = 193554.9971298399), C1(P(start = 10000.0))) annotation( - Placement(visible = true, transformation(origin = {-10, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false), xm(fixed = false, start = 0.9856238368898451), proe(x(start = 1, fixed = true)), Ce(h_vol_2(start = 3128840.013040668), h(start = 3128840.0130323363)), pros(d(start = 0.07018147245152216))) annotation( - Placement(visible = true, transformation(origin = {-10, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser Condenseur(dynamic_energy_balance = true, Rv = 20, steady_state = false) annotation( - Placement(visible = true, transformation(origin = {40.5, -1}, extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation( - Placement(visible = true, transformation(origin = {91, -1}, extent = {{-11, -12}, {11, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(h0 = 113e3, option_temperature = true, Q0 = 100) annotation( - Placement(visible = true, transformation(origin = {-10, -1}, extent = {{-10, -9}, {10, 9}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeATh volumeA(P(start = 70e5), h(start = 2.e6), dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-70, 10}, {-50, -10}}))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(W0(start = {2e6}, each fixed = false), option_temperature = 2) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {-88, 12}))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_GCT1(Table = [0, 0.0001; 22, 0.0001; 24, 2.02; 25, 100; 26, 150; 28, 300; 29.7, 590; 30.2, 600; 30.5, 590; 31, 570; 35, 250; 40, 100; 45, 15; 47, 0.000001; 200, 0.000001; 1000, 0.000001]) annotation( - Placement(transformation(extent = {{-56, 34}, {-44, 46}}, rotation = 0))); - BoundaryConditions.SourceQ Source_Vsup1(h0 = 2759.6e3, Q0 = 1) annotation( - Placement(transformation(extent = {{-40, 10}, {-20, 30}}, rotation = 0))); - PressureLosses.SingularPressureLoss PressureLoss_VapeurIn_in4(K = 1e-4, Q(fixed = false, start = 0.01)) annotation( - Placement(transformation(extent = {{0, 10}, {20, 30}}, rotation = 0))); -equation - connect(staticCentrifugalPump.C2, volumeA.Ce2) annotation( - Line(points = {{-20, -60}, {-60, -60}, {-60, -10}}, color = {28, 108, 200})); - connect(volumeA.Cs2, stodolaTurbine.Ce) annotation( - Line(points = {{-60, 10}, {-60, 60}, {-20.1, 60}}, color = {28, 108, 200})); - connect(heatSource.C[1], volumeA.Cth) annotation( - Line(points = {{-78.2, 12}, {-64, 12}, {-64, 0}, {-60, 0}}, color = {0, 0, 0})); - connect(sourcePCaloporteur.C, Condenseur.Ce1) annotation( - Line(points = {{0, -1}, {2, -1}, {2, -1.16}, {20, -1.16}}, color = {0, 0, 0})); - connect(Condenseur.Ce2, puitsPCaloporteur.C) annotation( - Line(points = {{60.795, -1.16}, {66.3975, -1.16}, {66.3975, -1}, {80, -1}}, color = {0, 0, 0})); - connect(Condenseur.C2ex, staticCentrifugalPump.C1) annotation( - Line(points = {{40.5, -17}, {40.5, -60}, {0, -60}}, color = {0, 0, 0})); - connect(stodolaTurbine.Cs, Condenseur.C1vap) annotation( - Line(points = {{0.1, 60}, {40.5, 60}, {40.5, 15}}, color = {0, 0, 0})); - connect(Vapeur_GCT1.y, Source_Vsup1.IMassFlow) annotation( - Line(points = {{-43.4, 40}, {-30, 40}, {-30, 25}}, color = {0, 0, 255})); - connect(Source_Vsup1.C, PressureLoss_VapeurIn_in4.C1) annotation( - Line(points = {{-20, 20}, {0, 20}}, color = {0, 0, 0})); - connect(PressureLoss_VapeurIn_in4.C2, Condenseur.C2vap) annotation( - Line(points = {{20, 20}, {32.505, 20}, {32.505, 13.72}}, color = {0, 0, 0})); - annotation( - Diagram(graphics = {Text(extent = {{-94, 34}, {-64, 24}}, lineColor = {28, 108, 200}, textString = "W: free"), Text(extent = {{-26, -38}, {8, -48}}, lineColor = {28, 108, 200}, textString = "a1: free"), Text(extent = {{-28, 94}, {8, 84}}, lineColor = {28, 108, 200}, textString = "Pe: fixed"), Text(extent = {{-28, 84}, {10, 72}}, lineColor = {28, 108, 200}, textString = "proe.x: fixed")}), - Documentation(info = " - -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - experiment(StopTime = 10000)); -end TestDynamicCondenser; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo deleted file mode 100644 index 03a0f9ed..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum.mo +++ /dev/null @@ -1,65 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicDrum - parameter Units.SI.MassFlowRate Qin(fixed = false, start = 80) "Mass flow rate"; - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed = false, start = 670) "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed = false, start = 0.085) "Friction pressure loss coefficient (active if lambda_fixed=true)"; - Volumes.DynamicDrum Drum(Vv(start = 39), Vertical = false, hl(start = 1454177.7248984643), hv(start = 2670002.8920646077), xv(start = 0.01), rhol(start = 670), rhov(start = 78), zl(fixed = true, start = 1.05), wsftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam, Cm(diff_res_1(start = 8476939.240220599)), steady_state = true, dynamic_energy_balance = false, P0 = 13000000, diffusion = true, P(start = 13000000, fixed = true), Pfond(start = 13006991.905108), Tp(start = 590.93934457637)) annotation( - Placement(transformation(extent = {{-61, 18}, {1, 80}}, rotation = 0))); - PressureLosses.ControlValve feedwaterValve(Cv(start = 335), C1(h_vol_1(start = 1400e3), h(start = 1400e3), P(start = 13300000), Q(start = 79.5)), Q(start = 79.5), rho(start = 888), h(start = 1400000), Cvmax = CvmaxWater, Pm(start = 13100000)) annotation( - Placement(transformation(extent = {{-120, 76}, {-100, 96}}, rotation = 0))); - PressureLosses.ControlValve steamValve(Cvmax(fixed = true) = 50000, Cv(start = 25000), Q(start = 79.5), rho(start = 78.5), h(start = 2657930), Pm(start = 12998726.577779422)) annotation( - Placement(transformation(extent = {{40, 76}, {60, 96}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon(k(fixed = true) = 0.5) annotation( - Placement(transformation(extent = {{-160, 122}, {-140, 142}}, rotation = 0))); - HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcranBoucleEvaporatoire(T0 = fill(400, 10), heb(start = {10409, 10268, 10127, 9985, 9842, 9698, 9552, 9406, 9258, 9111}), advection = false, z2 = 10, simplified_dynamic_energy_balance = false, D = 0.03, ntubes = 1400, h(start = {1454177.75, 1531100.8018215413, 1608023.8787446183, 1684946.955667695, 1761870.032590772, 1838793.109513849, 1915716.186436926, 1992639.2633600028, 2069562.3402830793, 2146485.4172061565, 2223408.4941292335, 1454177.75}), L = 20, Q(start = fill(130, 11)), dynamic_mass_balance = false, inertia = false, dynamic_energy_balance = false, diffusion = true, P(start = {13032002.884172, 13025908.565037, 13020089.245351, 13015847.070697, 13012648.443752, 13010064.118918, 13007881.468256, 13005979.718403, 13004283.685995, 13002743.397189, 13001323.948575, 13000000})) annotation( - Placement(transformation(origin = {6, -26}, extent = {{-10, 10}, {10, -10}}, rotation = 90))); - Thermal.BoundaryConditions.HeatSource SourceC3(option_temperature = 2, W0 = {1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7}, T0 = {290, 290, 290, 290, 290, 290, 290, 290, 290, 290}) annotation( - Placement(transformation(origin = {36, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, L = 20, D = 0.03, ntubes = 1400, dynamic_energy_balance = false) annotation( - Placement(transformation(origin = {18, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe(L = 20, z1 = 20, Q(fixed = true, start = 130), lambda = LambdaPipe) annotation( - Placement(transformation(origin = {-66, -26}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon1(k(fixed = true) = 0.5) annotation( - Placement(transformation(extent = {{0, 122}, {20, 142}}, rotation = 0))); - BoundaryConditions.SourceP sourceP(h0 = 1400000, P0(fixed = true) = 13200000, option_temperature = false) annotation( - Placement(transformation(extent = {{-200, 70}, {-180, 90}}, rotation = 0))); - BoundaryConditions.SinkQ sinkQ(Q0 = 75) annotation( - Placement(transformation(extent = {{120, 70}, {140, 90}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamMassFlowRate(k = Qin) annotation( - Placement(transformation(extent = {{100, 122}, {120, 142}}, rotation = 0))); -equation - connect(Drum.Cv, steamValve.C1) annotation( - Line(points = {{1, 80}, {40, 80}}, color = {0, 0, 255})); - connect(feedwaterValve.C2, Drum.Ce1) annotation( - Line(points = {{-100, 80}, {-61, 80}}, color = {0, 0, 255})); - connect(Drum.Cd, lumpedStraightPipe.C1) annotation( - Line(points = {{-61, 18}, {-66, 18}, {-66, -16}}, color = {0, 0, 255})); - connect(heatExchangerWall.WT1, SourceC3.C) annotation( - Line(points = {{20, -26}, {26.2, -26}}, color = {191, 95, 0})); - connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2) annotation( - Line(points = {{1, 18}, {6, 18}, {6, -16}})); - connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation( - Line(points = {{9, -26}, {16, -26}}, color = {191, 95, 0})); - connect(ConsigneNiveauBallon.y, feedwaterValve.Ouv) annotation( - Line(points = {{-139, 132}, {-110, 132}, {-110, 97}}, smooth = Smooth.None)); - connect(sourceP.C, feedwaterValve.C1) annotation( - Line(points = {{-180, 80}, {-120, 80}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(steamValve.C2, sinkQ.C) annotation( - Line(points = {{60, 80}, {120, 80}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2) annotation( - Line(points = {{6, -36}, {6, -68}, {-66, -68}, {-66, -36}})); - connect(ConsigneNiveauBallon1.y, steamValve.Ouv) annotation( - Line(points = {{21, 132}, {50, 132}, {50, 97}}, smooth = Smooth.None)); - connect(SteamMassFlowRate.y, sinkQ.IMassFlow) annotation( - Line(points = {{121, 132}, {130, 132}, {130, 85}})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.43, y = 0, width = 0.57, height = 0.63), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -100}, {140, 200}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicDrum; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo deleted file mode 100644 index cd92b16a..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicDrum_CC.mo +++ /dev/null @@ -1,71 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicDrum_CC - import ThermoSysPro; - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed = false, start = 670) "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed = false, start = 0.085) "Friction pressure loss coefficient (active if lambda_fixed=true)"; - ThermoSysPro.Fluid.Volumes.DynamicDrum Drum(Vv(start = 39), Vertical = false, hl(start = 1454400), hv(start = 2.658e6), xv(start = 0.01), rhol(start = 670), rhov(start = 78), zl(fixed = true, start = 1.05), wsftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.WaterSteamFluidType.WaterSteam, P0 = 13000000, P(start = 13000000, fixed = false), Tp(start = 592.6)) annotation( - Placement(transformation(extent = {{-61, 18}, {1, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(Cv(start = 335), Q(start = 79.5), rho(start = 888), h(start = 1400000), C1(h_vol_1(start = 1400e3), h(start = 1400e3), Q(start = 79.5), P(start = 13300000)), Cvmax = CvmaxWater, Pm(start = 13100000)) annotation( - Placement(transformation(extent = {{-120, 76}, {-100, 96}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(Cv(start = 25000), Q(start = 79.5), rho(start = 78.5), h(start = 2657930), Cvmax = 10000, Pm(start = 12900000)) annotation( - Placement(transformation(extent = {{40, 76}, {60, 96}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcranBoucleEvaporatoire(T0 = fill(400, 10), heb(start = {10409, 10268, 10127, 9985, 9842, 9698, 9552, 9406, 9258, 9111}), advection = false, z2 = 10, simplified_dynamic_energy_balance = false, P(start = {13007000, 13006600, 13006000, 13005500, 13005000, 13004500, 13004000, 13003000, 13002000, 13001000, 13000000, 12999990}), D = 0.03, ntubes = 1400, h(start = {1400e3, 1450e3, 1500e3, 1550e3, 1600e3, 1650e3, 1700e3, 1750e3, 1800e3, 1850e3, 1900e3, 1950e3}), L = 20, Q(start = fill(130, 11))) annotation( - Placement(transformation(origin = {6, -26}, extent = {{-10, 10}, {10, -10}}, rotation = 90))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(option_temperature = 2, W0 = {1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7}, T0 = {290, 290, 290, 290, 290, 290, 290, 290, 290, 290}) annotation( - Placement(transformation(origin = {36, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, L = 20, D = 0.03, ntubes = 1400) annotation( - Placement(transformation(origin = {18, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(L = 20, z1 = 20, C1(P(start = 130e5)), Q(fixed = true, start = 130), lambda = LambdaPipe) annotation( - Placement(transformation(origin = {-66, -26}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceQ(h0 = 1400000, option_temperature = false, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam, P0 = 13300000) annotation( - Placement(transformation(extent = {{-196, 70}, {-176, 90}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature = false, h0 = 2.650e6, P0 = 12700000) annotation( - Placement(transformation(extent = {{115, 70}, {135, 90}}, rotation = 0))); - InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k = 0.5) annotation( - Placement(transformation(extent = {{20, 102}, {40, 121}}, rotation = 0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Steam_Pressure(Table = [0, 128e5; 100, 128e5; 110, 124e5; 200, 124e5; 400, 128e5; 2000, 128e5; 2010, 131e5; 2090, 131e5; 2300, 128e5; 3000, 128e5]) annotation( - Placement(transformation(extent = {{96, 99}, {120, 123}}, rotation = 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau(add(k1 = -1, k2 = +1), Ti = 50, pIsat(ureset0 = 0.5, Limiteur1(u(signal(start = 0.5))), Ti = 2000)) annotation( - Placement(transformation(extent = {{-56, 106}, {-84, 132}}, rotation = 0))); - InstrumentationAndControl.Blocks.Sources.Constante Level(k = 1.05) annotation( - Placement(transformation(extent = {{-21, 102}, {-40, 121}}, rotation = 0))); -equation - connect(Drum.Cv, SteamValve.C1) annotation( - Line(points = {{1, 80}, {40, 80}}, color = {0, 0, 255})); - connect(FeedwaterValve.C2, Drum.Ce1) annotation( - Line(points = {{-100, 80}, {-61, 80}}, color = {0, 0, 255})); - connect(Drum.Cd, lumpedStraightPipe.C1) annotation( - Line(points = {{-61, 18}, {-66, 18}, {-66, -16}}, color = {0, 0, 255})); - connect(heatExchangerWall.WT1, SourceC3.C) annotation( - Line(points = {{20, -26}, {26.2, -26}}, color = {191, 95, 0})); - connect(Drum.Cm, TubeEcranBoucleEvaporatoire.C2) annotation( - Line(points = {{1, 18}, {6, 18}, {6, -16}})); - connect(TubeEcranBoucleEvaporatoire.CTh, heatExchangerWall.WT2) annotation( - Line(points = {{9, -26}, {16, -26}}, color = {191, 95, 0})); - connect(sourceQ.C, FeedwaterValve.C1) annotation( - Line(points = {{-176, 80}, {-120, 80}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(SteamValve.C2, sinkP.C) annotation( - Line(points = {{60, 80}, {115, 80}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(TubeEcranBoucleEvaporatoire.C1, lumpedStraightPipe.C2) annotation( - Line(points = {{6, -36}, {6, -68}, {-66, -68}, {-66, -36}})); - connect(SteamValve_O.y, SteamValve.Ouv) annotation( - Line(points = {{41, 111.5}, {50, 111.5}, {50, 97}}, color = {0, 0, 255})); - connect(Steam_Pressure.y, sinkP.IPressure) annotation( - Line(points = {{121.2, 111}, {130, 111}, {130, 80}}, color = {0, 0, 255})); - connect(Level.y, regulation_Niveau.ConsigneNiveauEau) annotation( - Line(points = {{-40.95, 111.5}, {-44, 111.5}, {-44, 111.2}, {-55.3, 111.2}}, color = {0, 0, 0}, pattern = LinePattern.Dash)); - connect(Drum.yLevel, regulation_Niveau.MesureNiveauEau) annotation( - Line(points = {{4.1, 49}, {10, 49}, {10, 130.7}, {-55.3, 130.7}}, color = {0, 0, 0}, pattern = LinePattern.Dash)); - connect(regulation_Niveau.SortieReelle1, FeedwaterValve.Ouv) annotation( - Line(points = {{-84.7, 107.3}, {-110, 107.3}, {-110, 97}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 3000), - Window(x = 0.43, y = 0, width = 0.57, height = 0.63), - Diagram(graphics, coordinateSystem(preserveAspectRatio = false, extent = {{-200, -100}, {140, 200}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicDrum_CC; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo deleted file mode 100644 index 24ee21e4..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicFlueGasesMultiFluidHeatExchanger.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicFlueGasesMultiFluidHeatExchanger - BoundaryConditions.SourceP sourceP(C(h_vol_2(start = 71016.12237181065)), option_temperature = true, P0 = 10000000, Q(start = 190407.49090838886)) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - BoundaryConditions.SinkP sinkP(C(h_vol_1(start = 71016.1223718086))) annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger(steady_state = true, Cfg1(h_vol_2(start = 1999458.3239137873)), Cfg2(h_vol_1(start = 1997835.1051783948)), ExchangerFlueGasesMetal(P(start = {5000000.0, 5000000.0, 5000000.0, 5000000.0, 5000000.0, 5000000.0}), Q(start = {2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343}), Tp(start = {293.20684981473266, 293.655268073503, 294.1038710234491, 294.55265602776745}), h(start = {2000000.0, 1999458.375, 1998916.9494222174, 1998375.8765143699, 1997835.125, 100000.0}), rho2(start = {9.227614370571606, 9.229671002969678, 9.231727464730685, 9.23378375498367, 9.235839872860517})), TwoPhaseFlowPipe(P(start = {10000000.0, 8023904.042494878, 6045867.025005122, 4065878.0712931687, 2083926.1359166082, 100000.0}), Q(start = {3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616}), h(start = {80196.484375, 80197.90894929563, 80199.3305700632, 80200.75139888813, 80202.17143579095, 70825.8984375})), ExchangerWall(Tp(start = {291.91912560937857, 292.368260847782, 292.81758075140095, 293.26708268122}), Tp1(start = {290.60590026437563, 291.055766680952, 291.5058177362657, 291.9560507892685})), Ns = 4, inertia = false, Ntubes = 100, diffusion = true, dynamic_energy_balance = true) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}))); - BoundaryConditions.SourcePQ sourceP1(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, h0 = 2e6, P0 = 5000000, Q0 = 500, T0 = 1273.15) annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, 70}))); - BoundaryConditions.Sink sinkP1 annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, -10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1) annotation( - Line(points = {{-40, 30}, {-20, 30}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C) annotation( - Line(points = {{0, 30}, {20, 30}}, color = {0, 0, 0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1) annotation( - Line(points = {{-10, 60}, {-10, 35}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C) annotation( - Line(points = {{-10, 25}, {-10, 0}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicFlueGasesMultiFluidHeatExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo deleted file mode 100644 index 4944500e..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchanger.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicMultiFluidHeatExchanger - BoundaryConditions.SourceQ sourceP(C(h_vol_2(start = 71016.12237181065)), Q0 = 10, option_temperature = true) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start = 71016.1223718086))) annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - HeatExchangers.DynamicMultiFluidHeatExchanger dynamicMultiFluidHeatExchanger(steady_state = true, diffusion = true, dynamic_energy_balance = false, Cfg1(h_vol_2(start = 71016.12237181155)), Cfg2(h_vol_1(start = 71016.12237181314)), DynamicOnePhaseFlowPipe_1(P(start = {300000.0, 260001.59713260198, 220002.3957916478, 180002.39588440701, 140001.5973181204, 100000.0}), Q(start = {2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343}), h(start = {71016.125, 71016.125, 71016.12237180988, 71016.1223718091, 71016.125, 70825.8984375})), DynamicOnePhaseFlowPipe_2(P(start = {300000.0, 260001.59801114563, 220002.39710936273, 180002.3972020214, 140001.59819646296, 100000.0}), Q(start = {3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616}), Tp(start = {290.0310327031831, 290.04018142634584, 290.0493302229013, 290.05847909283045}), h(start = {71016.125, 71016.125, 71016.12237181216, 71016.12237181274, 71016.125, 70825.8984375})), ExchangerWall(Tp(start = {290.03103270324897, 290.0401814264445, 290.0493302229999, 290.05847909289605}), Tp1(start = {290.03103270331616, 290.04018142654525, 290.0493302231005, 290.0584790929629})), Ntubes = 10, Ns = 4, inertia = false) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 5000000, T0 = 1273.15) annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, 70}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, -10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1) annotation( - Line(points = {{-40, 30}, {-20, 30}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C) annotation( - Line(points = {{0, 30}, {20, 30}}, color = {0, 0, 0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1) annotation( - Line(points = {{-10, 60}, {-10, 35}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C) annotation( - Line(points = {{-10, 25}, {-10, 0}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicMultiFluidHeatExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo deleted file mode 100644 index e0708d81..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicMultiFluidHeatExchangerShell.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicMultiFluidHeatExchangerShell - BoundaryConditions.SourceQ sourceP(C(h_vol_2(start = 71016.12237181065)), Q0 = 10, option_temperature = true) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start = 71016.1223718086))) annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - HeatExchangers.DynamicMultiFluidHeatExchangerShell dynamicMultiFluidHeatExchangerShell(Cfg1(h_vol_2(start = 71016.12237181155)), Cfg2(h_vol_1(start = 71016.12237181314)), DynamicOnePhaseFlowPipe(P(start = {300000.0, 260001.59713260198, 220002.3957916478, 180002.39588440701, 140001.5973181204, 100000.0}), Q(start = {2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343}), h(start = {71016.125, 71016.125, 71016.12237180988, 71016.1223718091, 71016.125, 70825.8984375})), dynamicOnePhaseFlowShell(P(start = {300000.0, 260001.59801114563, 220002.39710936273, 180002.3972020214, 140001.59819646296, 100000.0}), Q(start = {3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616}), Tp(start = {290.0310327031831, 290.04018142634584, 290.0493302229013, 290.05847909283045}), h(start = {71016.125, 71016.125, 71016.12237181216, 71016.12237181274, 71016.125, 70825.8984375})), ExchangerWall(Tp(start = {290.03103270324897, 290.0401814264445, 290.0493302229999, 290.05847909289605}), Tp1(start = {290.03103270331616, 290.04018142654525, 290.0493302231005, 290.0584790929629})), Ntubes = 10, Ns = 4, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, Dext = 0.01, inertia = false, dynamic_energy_balance = false, diffusion = true) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}))); - BoundaryConditions.SourceP sourceP1(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 5000000, T0 = 1273.15) annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, 70}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, -10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchangerShell.Cws1) annotation( - Line(points = {{-40, 30}, {-20, 30}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchangerShell.Cws2, sinkP.C) annotation( - Line(points = {{0, 30}, {20, 30}}, color = {0, 0, 0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchangerShell.Cfg1) annotation( - Line(points = {{-10, 60}, {-10, 35}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchangerShell.Cfg2, sinkP1.C) annotation( - Line(points = {{-10, 25}, {-10, 0}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicMultiFluidHeatExchangerShell; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo deleted file mode 100644 index 42506182..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowPipe.mo +++ /dev/null @@ -1,31 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicOnePhaseFlowPipe - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe(Q(start = {536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207}), h(start = {71016.12237181116, 74743.46665892199, 78470.81094603281, 82198.15523314364, 85925.49952025448, 89652.84380736532, 93380.18809447614, 97107.53238158698, 100834.8766686978, 104562.22095580865, 108289.56524291947, 70825.9016030344}), P(start = {300000, 281833.41863537, 263664.30473175, 245492.47958308, 227317.76827098, 209139.99948382, 190959.00534677, 172774.621262, 154586.68575823, 136395.04034906, 118199.5293995, 100000})) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, option_temperature = 2, W0 = {2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6}) annotation( - Placement(transformation(extent = {{-20, 60}, {0, 80}}, rotation = 0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10) annotation( - Placement(transformation(extent = {{-20, 40}, {0, 60}}, rotation = 0))); -equation - connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation( - Line(points = {{-40, 30}, {-20, 30}}, color = {0, 0, 255})); - connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation( - Line(points = {{0, 30}, {20, 30}}, color = {0, 0, 255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation( - Line(points = {{-10, 60.2}, {-10, 52}}, color = {191, 95, 0})); - connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation( - Line(points = {{-10, 48}, {-10, 33}}, color = {191, 95, 0})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicOnePhaseFlowPipe; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo deleted file mode 100644 index 7daf2fee..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicOnePhaseFlowShell.mo +++ /dev/null @@ -1,33 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicOnePhaseFlowShell - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowPipeShell(Q(start = {30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}), Ds = 1, ntubes = 520, L = 12, P(start = {2000000, 1996000, 1993000, 1990000, 1986000, 1983000, 1980000, 1976000, 1973000, 1965000, 1955000, 1950000})) annotation( - Placement(transformation(extent = {{-48, -36}, {48, 36}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature = false, P0(fixed = false) = 1900000) annotation( - Placement(transformation(extent = {{74, -15}, {102, 15}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 600e3, P0 = 2000000, Q(start = 500, fixed = true)) annotation( - Placement(transformation(extent = {{-103, -15}, {-75, 15}}, rotation = 0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(lambda = 10, Ns = 10, cpw = 460, rhow = 7900, D = 0.017, e = 0.002, ntubes = 520, L = 12) annotation( - Placement(transformation(extent = {{-54, 30}, {54, 58}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(option_temperature = 2, W0 = {-2e6, -2e6, -2e6, -2e6, -2e6, -2e6, -2e6, -2e6, -2e6, -2e6}, T0 = {300, 300, 300, 300, 300, 300, 300, 300, 300, 300}) annotation( - Placement(transformation(extent = {{-12, 76}, {12, 98}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(Initialvalue = 20e5, Starttime = 300, Duration = 600, Finalvalue = 19.8e5) annotation( - Placement(transformation(extent = {{-100, 32}, {-80, 52}}, rotation = 0))); -equation - connect(sourceP.C, dynamicOnePhaseFlowPipeShell.C1) annotation( - Line(points = {{-75, 0}, {-48, 0}}, color = {0, 0, 255})); - connect(dynamicOnePhaseFlowPipeShell.C2, sinkP.C) annotation( - Line(points = {{48, 0}, {74, 0}}, color = {0, 0, 255})); - connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipeShell.CTh) annotation( - Line(points = {{0, 41.2}, {0, 10.8}}, color = {191, 95, 0})); - connect(heatSource.C, heatExchangerWall.WT2) annotation( - Line(points = {{0, 76.22}, {0, 46.8}}, color = {191, 95, 0})); - connect(rampe.y, sourceP.IPressure) annotation( - Line(points = {{-79, 42}, {-70, 42}, {-70, 24}, {-98, 24}, {-98, 0}, {-96, 0}})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicOnePhaseFlowShell; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo deleted file mode 100644 index e1c8b897..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicPlateHeatExchanger.mo +++ /dev/null @@ -1,48 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicPlateHeatExchanger - ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D(region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, steady_state = true, Ns = 10, dynamic_energy_balance = false, diffusion = true, continuous_flow_reversal = true) annotation( - Placement(transformation(extent = {{-20, 40}, {0, 60}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP(option_temperature = true, diffusion = true, T0 = 340) annotation( - Placement(transformation(extent = {{-80, 40}, {-60, 60}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP1 annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - BoundaryConditions.Sink puitsP(option_temperature = true, diffusion = true) annotation( - Placement(transformation(extent = {{40, 40}, {60, 60}}, rotation = 0))); - BoundaryConditions.Sink puitsP1 annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( - Placement(transformation(extent = {{-20, -40}, {0, -20}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP2(T0 = 340, option_temperature = true) annotation( - Placement(transformation(extent = {{-80, -40}, {-60, -20}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP3 annotation( - Placement(transformation(extent = {{-60, -60}, {-40, -40}}, rotation = 0))); - BoundaryConditions.Sink puitsP2 annotation( - Placement(transformation(extent = {{40, -40}, {60, -20}}, rotation = 0))); - BoundaryConditions.Sink puitsP3 annotation( - Placement(transformation(extent = {{20, -60}, {40, -40}}, rotation = 0))); -equation - connect(sourceP.C, echangeurAPlaques1D.Ec) annotation( - Line(points = {{-60, 50}, {-20, 50}}, color = {0, 0, 255})); - connect(sourceP1.C, echangeurAPlaques1D.Ef) annotation( - Line(points = {{-40, 30}, {-15, 30}, {-15, 44}}, color = {0, 0, 255})); - connect(echangeurAPlaques1D.Sc, puitsP.C) annotation( - Line(points = {{0, 50}, {20, 50}, {20, 50}, {40, 50}}, color = {0, 0, 255})); - connect(echangeurAPlaques1D.Sf, puitsP1.C) annotation( - Line(points = {{-5, 44}, {-6, 44}, {-6, 30}, {20, 30}}, color = {0, 0, 255})); - connect(sourceP2.C, echangeurAPlaques.Ec) annotation( - Line(points = {{-60, -30}, {-20, -30}}, color = {0, 0, 255})); - connect(sourceP3.C, echangeurAPlaques.Ef) annotation( - Line(points = {{-40, -50}, {-15, -50}, {-15, -36}}, color = {0, 0, 255})); - connect(echangeurAPlaques.Sc, puitsP2.C) annotation( - Line(points = {{0, -29.8}, {20, -29.8}, {20, -30}, {40, -30}}, color = {0, 0, 255})); - connect(echangeurAPlaques.Sf, puitsP3.C) annotation( - Line(points = {{-5, -36}, {-6, -36}, {-6, -50}, {20, -50}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicPlateHeatExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo deleted file mode 100644 index 4dff59f8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicReliefValve.mo +++ /dev/null @@ -1,52 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicReliefValve - import ThermoSysPro; - parameter ThermoSysPro.Units.SI.AbsolutePressure Pinitial = 18e5 "Initial pressure"; - parameter ThermoSysPro.Units.SI.AbsolutePressure Pfinal = Pinitial "Final pressure"; - parameter ThermoSysPro.Units.SI.AbsolutePressure Pmax = 21e5 "Maximum pressure"; - ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve reliefValve(mech_steady_state = false, caract = [0, 0; 0.1, 2745; 0.2, 4915; 0.3, 6391; 0.4, 7339; 0.5, 7949; 0.6, 8351; 0.7, 8625; 0.8, 8818; 0.9, 8958; 1, 9063], Cvmax = 9063, Q(start = 0), Pm(start = Pinitial), Pout = sinkP.P0, mode_caract = 2, A2 = 1.1*reliefValve.A1, A1 = 1.3*Modelica.Constants.pi*pipe.D^2/4, m = 50, Cd = 0.44, Popen = 2000000, z_max = 0.05) annotation( - Placement(transformation(extent = {{0, 0}, {20, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe(Q(start = 0), Pm(start = Pinitial), L = 2, D = 0.2) annotation( - Placement(transformation(extent = {{-40, -40}, {-20, -20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( - Placement(transformation(extent = {{80, 0}, {100, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-80, -40}, {-60, -20}}))); - InstrumentationAndControl.Blocks.Sources.Rampe ramp1(Duration = 200, Finalvalue = Pmax, Initialvalue = Pinitial) annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}))); - InstrumentationAndControl.Blocks.Sources.Rampe ramp2(Duration = 200, Starttime = 300, Finalvalue = Pmax - Pfinal) annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}))); - InstrumentationAndControl.Blocks.Math.Add add(k2 = -1) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}))); - ThermoSysPro.Fluid.PressureLosses.Bend bend(R0 = 0.2, D = pipe.D) annotation( - Placement(transformation(extent = {{0, -20}, {20, -40}}))); - ThermoSysPro.Fluid.PressureLosses.Diaphragm diaphragm(Ouv = 1, D = 0.5) annotation( - Placement(transformation(extent = {{40, 0}, {60, 20}}))); -equation - connect(sourceP.C, pipe.C1) annotation( - Line(points = {{-60, -30}, {-40, -30}}, color = {0, 0, 255})); - connect(ramp1.y, add.u1) annotation( - Line(points = {{-79, 50}, {-70, 50}, {-70, 36}, {-61, 36}}, color = {0, 0, 255})); - connect(ramp2.y, add.u2) annotation( - Line(points = {{-79, 10}, {-70, 10}, {-70, 24}, {-61, 24}}, color = {0, 0, 255})); - connect(add.y, sourceP.IPressure) annotation( - Line(points = {{-39, 30}, {-20, 30}, {-20, -10}, {-90, -10}, {-90, -30}, {-75, -30}}, color = {0, 0, 255})); - connect(pipe.C2, bend.C1) annotation( - Line(points = {{-20, -30}, {0, -30}}, color = {0, 0, 255})); - connect(bend.C2, reliefValve.C1) annotation( - Line(points = {{10, -20}, {10, 0.2}}, color = {0, 0, 255})); - connect(reliefValve.C2, diaphragm.C1) annotation( - Line(points = {{20, 10}, {40, 10}}, color = {0, 0, 255})); - connect(diaphragm.C2, sinkP.C) annotation( - Line(points = {{60, 10}, {80, 10}}, color = {0, 0, 255})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, initialScale = 0.1)), - Window(x = 0.1, y = 0.08, width = 0.5, height = 0.6), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}, coordinateSystem(preserveAspectRatio = false, initialScale = 0.1)), - experiment(StopTime = 600, Interval = 1), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicReliefValve; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo deleted file mode 100644 index 425d5844..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowPipe.mo +++ /dev/null @@ -1,52 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicTwoPhaseFlowPipe - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(L = 20, advection = false, Q(start = {378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421, 378.2555714391421}), h(start = {71016.12237181116, 89522.1287033792, 108028.13503495205, 126534.14136650086, 145040.14769798872, 163546.15402957145, 182052.16036112772, 200558.16669267463, 219064.17302421754, 237570.17935577242, 256076.18568728055, 70825.9016030344}), dynamic_energy_balance = false, diffusion = true, P(start = {300000, 281934.94102069, 263857.29519348, 245762.87920492, 227647.89301968, 209508.84324089, 191342.485106, 173145.77779074, 154915.84935981, 136649.96881108, 118345.52340716, 100000})) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-50, 30}, {-30, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( - Placement(transformation(extent = {{30, 30}, {50, 50}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource(T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, option_temperature = 2, W0 = {7e6, 7e6, 7e6, 7e6, 7e6, 7e6, 7e6, 7e6, 7e6, 7e6}) annotation( - Placement(transformation(extent = {{-10, 70}, {10, 90}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, 50}, {10, 70}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(L = 10, D = 0.03, dpfCorr(fixed = false, start = 0.23963336533422905) = 1, inertia = true, P(start = {2000000, 1999571.7070274, 1999140.9402168, 1998707.6248919, 1998271.6837223, 1997833.0364983, 1997391.5998908, 1996715.822109, 1995640.0182728, 1994163.0145856, 1992283.4952231, 1990000})) annotation( - Placement(transformation(extent = {{-40, -90}, {40, -32}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(C(Q(fixed = true, start = 1)), option_temperature = false, h0 = 800e3, P0 = 2000000) annotation( - Placement(transformation(extent = {{-90, -70}, {-70, -50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(option_temperature = false, h0 = 2000e3, P0 = 1990000) annotation( - Placement(transformation(extent = {{70, -70}, {90, -50}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature = 2, T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, W0 = {2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4}) annotation( - Placement(transformation(extent = {{-10, -11}, {10, 9}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(Ns = 10, L = 10, lambda = 10, cpw = 460, rhow = 7900, e = 0.005, D = 0.03) annotation( - Placement(transformation(extent = {{-40, -70}, {40, 10}}, rotation = 0))); - InstrumentationAndControl.Blocks.Sources.Rampe rampe(Initialvalue = 20e5, Starttime = 300, Duration = 600, Finalvalue = 19.8e5) annotation( - Placement(transformation(extent = {{-74, -46}, {-86, -35}}, rotation = 0))); -equation - connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation( - Line(points = {{-30, 40}, {-10, 40}}, color = {0, 0, 255})); - connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation( - Line(points = {{10, 40}, {30, 40}}, color = {0, 0, 255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation( - Line(points = {{0, 70.2}, {0, 62}}, color = {191, 95, 0})); - connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation( - Line(points = {{0, 58}, {0, 43}}, color = {191, 95, 0})); - connect(sourceP1.C, dynamicTwoPhaseFlowPipe1.C1) annotation( - Line(points = {{-70, -60}, {-42, -60}, {-42, -61}, {-40, -61}}, color = {0, 0, 255})); - connect(dynamicTwoPhaseFlowPipe1.C2, sinkP1.C) annotation( - Line(points = {{40, -61}, {40, -60}, {70, -60}}, color = {0, 0, 255})); - connect(heatSource1.C, heatExchangerWall1.WT2) annotation( - Line(points = {{0, -10.8}, {0, -22}}, color = {191, 95, 0})); - connect(heatExchangerWall1.WT1, dynamicTwoPhaseFlowPipe1.CTh) annotation( - Line(points = {{0, -38}, {0, -52.3}}, color = {191, 95, 0})); - connect(rampe.y, sourceP1.IPressure) annotation( - Line(points = {{-86.6, -40.5}, {-92, -40.5}, {-92, -60}, {-85, -60}})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicTwoPhaseFlowPipe; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo deleted file mode 100644 index c54a1f89..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicTwoPhaseFlowRiser.mo +++ /dev/null @@ -1,38 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicTwoPhaseFlowRiser - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser(L = 20, inertia = false, advection = false, dynamic_energy_balance = true, Q(start = {0.7975821689256883, 0.7975821689256898, 0.7975821689256883, 0.7975821689256885, 0.7975821689256883, 0.797582168925689, 0.7975821689256886, 0.7975821689256887, 0.7975821689256888, 0.7975821689256888, 0.7975821689256886}), h(start = {71016.12237181116, 196401.3226637204, 196412.6067675415, 196423.89087136256, 196435.17497518365, 196446.45907900474, 196457.7431828258, 196469.0272866469, 196480.31139046798, 196491.59549428907, 196502.87959811013, 70825.9016030344}), diffusion = true, P(start = {300000, 281879.25838975, 263692.15565175, 245504.87004838, 227317.40156239, 209129.75017657, 190941.91587368, 172753.89863649, 154565.69844777, 136377.31529027, 118188.74914676, 100000})) annotation( - Placement(transformation(extent = {{-10, 30}, {10, 48}}, rotation = 0))); - BoundaryConditions.SourceP sourcePQ(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteamSimple) annotation( - Placement(transformation(extent = {{-50, 30}, {-30, 50}}, rotation = 0))); - BoundaryConditions.SinkP sinkP annotation( - Placement(transformation(extent = {{30, 30}, {50, 50}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource(T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, option_temperature = 2, W0 = {0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) annotation( - Placement(transformation(extent = {{-10, 80}, {10, 100}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, 60}, {10, 80}}, rotation = 0))); - Thermal.BoundaryConditions.HeatSource heatSource1(T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, option_temperature = 2, W0 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) annotation( - Placement(transformation(extent = {{-10, 0}, {10, -20}}, rotation = 0))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, 20}, {10, 0}}, rotation = 0))); -equation - connect(sourcePQ.C, dynamicTwoPhaseFlowRiser.C1) annotation( - Line(points = {{-30, 40}, {-20, 40}, {-20, 39.9}, {-10, 39.9}}, color = {0, 0, 255})); - connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation( - Line(points = {{10, 39.9}, {20, 39.9}, {20, 40}, {30, 40}}, color = {0, 0, 255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation( - Line(points = {{0, 80.2}, {0, 72}}, color = {191, 95, 0})); - connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowRiser.CTh1) annotation( - Line(points = {{0, 68}, {0, 45.3}}, color = {0, 0, 0})); - connect(dynamicTwoPhaseFlowRiser.CTh2, heatExchangerWall1.WT1) annotation( - Line(points = {{0, 34.5}, {0, 12}}, color = {0, 0, 0})); - connect(heatExchangerWall1.WT2, heatSource1.C) annotation( - Line(points = {{0, 8}, {0, -0.2}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicTwoPhaseFlowRiser; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo deleted file mode 100644 index 6c64b011..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeating.mo +++ /dev/null @@ -1,86 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicWaterHeating - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed = false, start = 68.5297) "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed = false, start = 0.003003) "Friction pressure loss coefficient (active if lambda_fixed=true)"; - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 2750.e3, P0 = 40e5) annotation( - Placement(transformation(extent = {{-192, 110}, {-150, 150}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(option_temperature = false, P0(fixed = true) = 10e5) annotation( - Placement(transformation(extent = {{124, -202}, {160, -162}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(mode_caract = 0, Cvmax = CvmaxWater, Q(fixed = false, start = 38.0656), Pm(start = 24.771e5), h(start = 906345), C1(h_vol_1(start = 906345), h(start = 906345)), Cv(start = 34.26, fixed = false)) annotation( - Placement(transformation(extent = {{88, -186}, {108, -166}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(ec = 2e-3, Ns = 10, Rv = 1.2, Lc = 2.5, PasL = 0.028, PasT = 0.024, ntubes3 = 1500, Dc = 0.018, ntubes1 = 400, ntubes2 = 400, L1 = 11, L2 = 11, L3 = 22, pipe_1(z2 = 0.4, Tp(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510}), h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3}), Q(start = {202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4}), P(start = {222.700e5, 222.690e5, 222.680e5, 222.670e5, 222.660e5, 222.650e5, 222.640e5, 222.630e5, 222.620e5, 222.610e5, 222.600e5, 222.590e5})), pipe_2(z2 = 0.4, Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), h(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {57.57, 57.57, 57.57, 57.57, 57.57, 57.57, 57.57, 57.57, 57.57, 57.57, 57.57}), P(start = {222.600e5, 222.590e5, 222.580e5, 222.570e5, 222.560e5, 222.550e5, 222.540e5, 222.530e5, 222.520e5, 222.51e5, 222.50e5, 222.48e5})), C2ex(P(start = 3900000)), Wall_1(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_2(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_3(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4})), volumeC(h(start = 1082.65e3), P(start = 222.48e5)), volumeD1(h(start = 953939), P(start = 222.48e5)), volumeD(h(start = 812750), P(start = 222.72e5)), WaterHeating(steady_state = true, Vertical = false, step_square = true, Kvl = 1, Klp = 1500, Kvp = 1200, Kpa = 0.2, V = 70, Mp = 50000, zl(fixed = true, start = 0.5), P(fixed = true, start = 39.5e5), Cv(Q(fixed = false, start = 35), P(fixed = false, start = 39.5e5)), hv(start = 1463490), hl(start = 906345), Pfond(start = 39.542e5), Tp1(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp3(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp(start = 509)), pipe_3(z2 = 1, Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4}), P(start = {222.700e5, 222.690e5, 222.680e5, 222.670e5, 222.660e5, 222.650e5, 222.640e5, 222.630e5, 222.620e5, 222.610e5, 222.600e5, 222.590e5, 222.580e5, 222.570e5, 222.560e5, 222.550e5, 222.540e5, 222.530e5, 222.520e5, 222.51e5, 222.50e5, 222.48e5})), P0c = 4000000) annotation( - Placement(transformation(extent = {{-58, -90}, {162, 96}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 annotation( - Placement(transformation(extent = {{-150, 22}, {-192, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn(K = 35, Q(fixed = false, start = 250), Pm(start = 227e5)) annotation( - Placement(transformation(extent = {{-99, -48}, {-79, -28}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut(K = 30, Q(fixed = false, start = 250), Pm(start = 222.48e5), C2(h_vol_1(start = 1082650), h(start = 1082650))) annotation( - Placement(transformation(extent = {{-80, 34}, {-100, 54}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(option_temperature = true, P0 = 220e5, h0 = 900e3, T0 = 482.87) annotation( - Placement(transformation(extent = {{-192, -60}, {-150, -16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0 = 53, C1(h_vol_1(start = 1082.65e3), h(start = 1082.65e3))) annotation( - Placement(transformation(extent = {{-115, 34}, {-135, 54}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table = [0, 260; 378, 260; 390, 238; 438, 275; 507, 135; 936, 65; 1404, 50; 1872, 50]) annotation( - Placement(transformation(extent = {{-195, 78}, {-175, 98}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k = 0.50) annotation( - Placement(transformation(extent = {{135, -152}, {113, -130}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin = 0.5, C2(h_vol_1(start = 2750.e3), h(start = 2750.e3))) annotation( - Placement(transformation(extent = {{-100, 122}, {-84, 138}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge(K = 1e-3, T(fixed = false, start = 461.56), Q(fixed = false, start = 35), Pm(start = 3900000), C2(h_vol_1(start = 906340), h(start = 906340))) annotation( - Placement(transformation(origin = {54, -138}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_purge(Table = [0, 10e5; 378, 10e5; 418, 7e5; 1145, 3.9e5; 2000, 3.9e5]) annotation( - Placement(transformation(extent = {{162, -178}, {182, -158}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(Q(fixed = false, start = 35), L = 10, D = 0.1, lambda = LambdaPipe, Pm(start = 40.34e5), C1(h_vol_1(start = 2750e3), h(start = 2750e3))) annotation( - Placement(transformation(extent = {{-48, 162}, {30, 98}}, rotation = 0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table = [0, 41.19e5; 378, 41.19e5; 418, 21.e5; 1145, 5.e5; 2000, 5.e5]) annotation( - Placement(transformation(extent = {{-195, 160}, {-175, 180}}, rotation = 0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(Table = [0, 222.72e5; 378, 222.72e5; 438, 230e5; 597, 217e5; 1000, 216e5; 1533, 214e5; 1863, 213.5e5; 2340, 213e5; 2500, 213e5]) annotation( - Placement(transformation(extent = {{-195, -8}, {-175, 12}}, rotation = 0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table = [0, 462; 448, 462; 1155, 420.0; 2000, 420.0]) annotation( - Placement(transformation(extent = {{-196, -84}, {-176, -64}}, rotation = 0))); -equation - connect(ControlValve_eau.C2, Puit_condenseur1.C) annotation( - Line(points = {{108, -182}, {124, -182}}, color = {0, 0, 255})); - connect(Puit_condenseur2.C, refQ.C2) annotation( - Line(points = {{-150, 44}, {-135, 44}}, color = {255, 0, 0}, thickness = 0.5)); - connect(refQ.C1, singularPressureLossWaterOut.C2) annotation( - Line(points = {{-115, 44}, {-100, 44}}, color = {255, 0, 0}, thickness = 0.5)); - connect(sourceP1.C, singularPressureLossWaterIn.C1) annotation( - Line(points = {{-150, -38}, {-99, -38}}, color = {0, 0, 255}, thickness = 0.5)); - connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2) annotation( - Line(points = {{-80, 44}, {-64, 44}, {-64, 43.92}, {-58, 43.92}}, color = {255, 0, 0}, thickness = 0.5)); - connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1) annotation( - Line(points = {{-79, -38}, {-58, -38}, {-58, -38.85}}, color = {0, 0, 255}, thickness = 0.5)); - connect(sourceP.C, checkValve.C1) annotation( - Line(points = {{-150, 130}, {-100, 130}}, color = {127, 0, 0}, thickness = 1)); - connect(singularPressureLossPurge.C1, WaterHeating.C2ex) annotation( - Line(points = {{54, -128}, {54, -90}, {52, -90}})); - connect(Pression_purge.y, Puit_condenseur1.IPressure) annotation( - Line(points = {{183, -168}, {196, -168}, {196, -182}, {151, -182}})); - connect(checkValve.C2, PressureLoss_Steam.C1) annotation( - Line(points = {{-84, 130}, {-48, 130}}, color = {127, 0, 0}, thickness = 1)); - connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation( - Line(points = {{52, 96}, {52, 130}, {30, 130}}, color = {127, 0, 0}, thickness = 1)); - connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation( - Line(points = {{54, -148}, {54, -182}, {88, -182}}, color = {0, 0, 255})); - connect(Pression_Turbine1.y, sourceP.IPressure) annotation( - Line(points = {{-174, 170}, {-174, 152}, {-190, 152}, {-190, 130}, {-181.5, 130}})); - connect(Pression_eauA2.y, sourceP1.IPressure) annotation( - Line(points = {{-174, 2}, {-174, -10}, {-194, -10}, {-194, -38}, {-181.5, -38}})); - connect(Debit_eauA.y, refQ.IMassFlow) annotation( - Line(points = {{-174, 88}, {-125, 88}, {-125, 55}})); - connect(Level.y, ControlValve_eau.Ouv) annotation( - Line(points = {{111.9, -141}, {98, -141}, {98, -165}})); - connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature) annotation( - Line(points = {{-175, -74}, {-171, -74}, {-171, -49}}, color = {0, 0, 255})); - annotation( - Diagram(coordinateSystem(extent = {{-200, -200}, {200, 200}}), graphics = {Text(extent = {{-124, 206}, {130, 146}}, lineColor = {0, 0, 255}, textString = "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"), Text(extent = {{-74, -190}, {118, -222}}, lineColor = {0, 0, 255}, textString = "COP0l_coef_h =false , T_Dp_purge=true"), Text(extent = {{-186, -198}, {-84, -212}}, lineColor = {0, 0, 255}, textString = "Qvap=true ==> Erreur"), Text(extent = {{16, 170}, {130, 156}}, lineColor = {0, 0, 255}, textString = "checkValve Qmin =0.5"), Text(extent = {{-136, 168}, {-18, 154}}, lineColor = {0, 0, 255}, textString = "With guess values")}), - experiment(StopTime = 1000, Tolerance = 1e-004), - experimentSetupOutput, - Icon(graphics = {Rectangle(lineColor = {128, 128, 128}, extent = {{-220, -240}, {220, 240}}, radius = 25.0), Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicWaterHeating; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo deleted file mode 100644 index dab61a8a..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterHeatingOnePipe.mo +++ /dev/null @@ -1,86 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicWaterHeatingOnePipe - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed = false, start = 68.5297) "Maximum CV (active if mode_caract=0)"; - parameter Real LambdaPipe(fixed = false, start = 0.003003) "Friction pressure loss coefficient (active if lambda_fixed=true)"; - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 2750.e3, P0 = 40e5) annotation( - Placement(transformation(extent = {{-192, 110}, {-150, 150}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(option_temperature = false, P0(fixed = true) = 10e5) annotation( - Placement(transformation(extent = {{124, -202}, {160, -162}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(mode_caract = 0, Cvmax = CvmaxWater, Q(fixed = false, start = 38.0656), Pm(start = 24.771e5), h(start = 906345), C1(h_vol_1(start = 906345), h(start = 906345)), Cv(start = 34.26, fixed = false)) annotation( - Placement(transformation(extent = {{88, -186}, {108, -166}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeaterOnePipe WaterHeating(ec = 2e-3, Ns = 10, Rv = 1.2, Lc = 2.5, PasL = 0.028, PasT = 0.024, ntubes3 = 1500, Dc = 0.018, ntubes1 = 400, ntubes2 = 400, L1 = 11, L2 = 11, L3 = 22, C2ex(P(start = 3953920.2674434385)), Wall_3(Tp(start = {497.4216192636609, 502.69423468274414, 506.9759296757205, 510.4223715331536, 513.1750788320363, 515.3580718035844, 517.0775540203194, 518.4230303861297, 519.4690257033071, 520.2769753151857, 520.8970764101637, 521.3700027404278, 521.7284442755915, 521.9984626845046, 522.2006676867453, 522.3512258466948, 522.4627164232634, 522.5440949624972, 522.5983494885799, 522.6391412946117}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4})), volumeC(h(start = 1083284.4675828198), P(start = 22239324.06759518)), volumeD(h(start = 812750.3853612987), P(start = 222.72e5)), WaterHeating(steady_state = true, Vertical = false, step_square = true, Kvl = 1, Klp = 1500, Kvp = 1200, Kpa = 0.2, V = 70, Mp = 50000, zl(fixed = true, start = 0.5), P(fixed = true, start = 39.5e5), Cv(Q(fixed = false, start = 35), P(fixed = false, start = 39.5e5)), hv(start = 1431115.3931413875), hl(start = 1083784.8007690564), Pfond(start = 39.542e5), Tp1(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp3(start = {502.0668232342926, 506.5603551100769, 510.17517354535573, 513.0552006761686, 515.3300849797615, 517.1125155075463, 518.4982207642074, 519.5672140241339, 520.3855368446975, 521.0071208743625, 521.475583235511, 521.8258726586643, 522.0857355520467, 522.276996946816, 522.4166635499804, 522.5178617542946, 522.5906259809204, 522.6416937796047, 522.6717272169116, 522.6943081560064}), Tp(start = 522.7203786935834)), pipe_3(z2 = 1, Tp(start = {492.2865845099074, 498.42043682971996, 503.43932965553495, 507.5119139438755, 510.7928300582301, 513.4186242679523, 515.5070797958261, 517.1581940553467, 518.4558696409629, 519.4698368458761, 520.2575667844292, 520.866061927203, 521.3334770960658, 521.6905573412918, 521.9618953291181, 522.1670184035046, 522.3213189657012, 522.4362044759667, 522.5172341741693, 522.5781571584042}), h(start = {812750.375, 863278.0600600096, 905331.3426571415, 940130.751800155, 968769.0495620216, 992209.8823638612, 1011293.6430149649, 1026746.7829727756, 1039192.5095809929, 1049161.7546575891, 1057103.8294379094, 1063396.4712379558, 1068355.1441001317, 1072241.5390561111, 1075271.2636377309, 1077620.734010462, 1079433.2969658624, 1080824.6185597836, 1081886.238523024, 1082684.3963576336, 1083284.4675828198, 1083284.5}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4, 202.4}), P(start = {22269346.0, 22267948.39153832, 22266544.294239394, 22265134.171108145, 22263718.740660597, 22262298.715698708, 22260874.773397826, 22259447.536273584, 22258017.56171816, 22256585.338030815, 22255151.28511641, 22253715.75831186, 22252279.054104224, 22250841.416797128, 22249403.045444023, 22247964.100585815, 22246524.71050402, 22245084.976831134, 22243644.979685582, 22242204.783200525, 22240764.436308913, 22239324.0})), P0c = 4000000) annotation( - Placement(transformation(extent = {{-58, -90}, {162, 96}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 annotation( - Placement(transformation(extent = {{-150, 22}, {-192, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn(K = 35, Q(fixed = false, start = 250), Pm(start = 22270672.891128033)) annotation( - Placement(transformation(extent = {{-99, -48}, {-79, -28}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut(K = 30, Q(fixed = false, start = 250), Pm(start = 22238086.493105933), C2(h_vol_1(start = 1082650), h(start = 1082650))) annotation( - Placement(transformation(extent = {{-80, 34}, {-100, 54}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(option_temperature = true, P0 = 220e5, h0 = 900e3, T0 = 482.87) annotation( - Placement(transformation(extent = {{-192, -60}, {-150, -16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0 = 53, C1(h_vol_1(start = 1082.65e3), h(start = 1082.65e3))) annotation( - Placement(transformation(extent = {{-115, 34}, {-135, 54}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table = [0, 260; 378, 260; 390, 238; 438, 275; 507, 135; 936, 65; 1404, 50; 1872, 50]) annotation( - Placement(transformation(extent = {{-195, 78}, {-175, 98}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k = 0.50) annotation( - Placement(transformation(extent = {{135, -152}, {113, -130}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(Qmin = 0.5, C2(h_vol_1(start = 2750.e3), h(start = 2750.e3))) annotation( - Placement(transformation(extent = {{-100, 122}, {-84, 138}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge(K = 1e-3, T(fixed = false, start = 461.56), Q(fixed = false, start = 35), Pm(start = 3953920.266328794), C2(h_vol_1(start = 906340), h(start = 906340))) annotation( - Placement(transformation(origin = {54, -138}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_purge(Table = [0, 10e5; 378, 10e5; 418, 7e5; 1145, 3.9e5; 2000, 3.9e5]) annotation( - Placement(transformation(extent = {{162, -178}, {182, -158}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(Q(fixed = false, start = 35), L = 10, D = 0.1, lambda = LambdaPipe, Pm(start = 40.34e5), C1(h_vol_1(start = 2750e3), h(start = 2750e3))) annotation( - Placement(transformation(extent = {{-48, 162}, {30, 98}}, rotation = 0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_Turbine1(Table = [0, 41.19e5; 378, 41.19e5; 418, 21.e5; 1145, 5.e5; 2000, 5.e5]) annotation( - Placement(transformation(extent = {{-195, 160}, {-175, 180}}, rotation = 0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA2(Table = [0, 222.72e5; 378, 222.72e5; 438, 230e5; 597, 217e5; 1000, 216e5; 1533, 214e5; 1863, 213.5e5; 2340, 213e5; 2500, 213e5]) annotation( - Placement(transformation(extent = {{-195, -8}, {-175, 12}}, rotation = 0))); - InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA1(Table = [0, 462; 448, 462; 1155, 420.0; 2000, 420.0]) annotation( - Placement(transformation(extent = {{-196, -84}, {-176, -64}}, rotation = 0))); -equation - connect(ControlValve_eau.C2, Puit_condenseur1.C) annotation( - Line(points = {{108, -182}, {124, -182}}, color = {0, 0, 255})); - connect(Puit_condenseur2.C, refQ.C2) annotation( - Line(points = {{-150, 44}, {-135, 44}}, color = {255, 0, 0}, thickness = 0.5)); - connect(refQ.C1, singularPressureLossWaterOut.C2) annotation( - Line(points = {{-115, 44}, {-100, 44}}, color = {255, 0, 0}, thickness = 0.5)); - connect(sourceP1.C, singularPressureLossWaterIn.C1) annotation( - Line(points = {{-150, -38}, {-99, -38}}, color = {0, 0, 255}, thickness = 0.5)); - connect(singularPressureLossWaterOut.C1, WaterHeating.Ce2) annotation( - Line(points = {{-80, 44}, {-64, 44}, {-64, 43.92}, {-58, 43.92}}, color = {255, 0, 0}, thickness = 0.5)); - connect(singularPressureLossWaterIn.C2, WaterHeating.Ce1) annotation( - Line(points = {{-79, -38}, {-58, -38}, {-58, -38.85}}, color = {0, 0, 255}, thickness = 0.5)); - connect(sourceP.C, checkValve.C1) annotation( - Line(points = {{-150, 130}, {-100, 130}}, color = {127, 0, 0}, thickness = 1)); - connect(singularPressureLossPurge.C1, WaterHeating.C2ex) annotation( - Line(points = {{54, -128}, {54, -90}, {52, -90}})); - connect(Pression_purge.y, Puit_condenseur1.IPressure) annotation( - Line(points = {{183, -168}, {196, -168}, {196, -182}, {151, -182}})); - connect(checkValve.C2, PressureLoss_Steam.C1) annotation( - Line(points = {{-84, 130}, {-48, 130}}, color = {127, 0, 0}, thickness = 1)); - connect(WaterHeating.C1vap, PressureLoss_Steam.C2) annotation( - Line(points = {{52, 96}, {52, 130}, {30, 130}}, color = {127, 0, 0}, thickness = 1)); - connect(singularPressureLossPurge.C2, ControlValve_eau.C1) annotation( - Line(points = {{54, -148}, {54, -182}, {88, -182}}, color = {0, 0, 255})); - connect(Pression_Turbine1.y, sourceP.IPressure) annotation( - Line(points = {{-174, 170}, {-174, 152}, {-190, 152}, {-190, 130}, {-181.5, 130}})); - connect(Pression_eauA2.y, sourceP1.IPressure) annotation( - Line(points = {{-174, 2}, {-174, -10}, {-194, -10}, {-194, -38}, {-181.5, -38}})); - connect(Debit_eauA.y, refQ.IMassFlow) annotation( - Line(points = {{-174, 88}, {-125, 88}, {-125, 55}})); - connect(Level.y, ControlValve_eau.Ouv) annotation( - Line(points = {{111.9, -141}, {98, -141}, {98, -165}})); - connect(Temperature_eauA1.y, sourceP1.ISpecificEnthalpyOrTemperature) annotation( - Line(points = {{-175, -74}, {-171, -74}, {-171, -49}}, color = {0, 0, 255})); - annotation( - Diagram(coordinateSystem(extent = {{-200, -200}, {200, 200}}), graphics = {Text(extent = {{-124, 206}, {130, 146}}, lineColor = {0, 0, 255}, textString = "1 Ouv et 1 Cvmax = false, Qvap et niveau=true ou P cavite"), Text(extent = {{-74, -190}, {118, -222}}, lineColor = {0, 0, 255}, textString = "COP0l_coef_h =false , T_Dp_purge=true"), Text(extent = {{-186, -198}, {-84, -212}}, lineColor = {0, 0, 255}, textString = "Qvap=true ==> Erreur"), Text(extent = {{16, 170}, {130, 156}}, lineColor = {0, 0, 255}, textString = "checkValve Qmin =0.5"), Text(extent = {{-136, 168}, {-18, 154}}, lineColor = {0, 0, 255}, textString = "With guess values")}), - experiment(StopTime = 1000, Tolerance = 1e-004), - experimentSetupOutput, - Icon(graphics = {Rectangle(lineColor = {128, 128, 128}, extent = {{-220, -240}, {220, 240}}, radius = 25.0), Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicWaterHeatingOnePipe; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo deleted file mode 100644 index dffd8894..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestDynamicWaterSteamMultiFluidHeatExchanger.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestDynamicWaterSteamMultiFluidHeatExchanger - BoundaryConditions.SourceQ sourceP(C(h_vol_2(start = 71016.12237181065)), Q0 = 10, option_temperature = true) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(C(h_vol_1(start = 71016.1223718086))) annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - HeatExchangers.DynamicWaterSteamMultiFluidsHeatExchanger dynamicMultiFluidHeatExchanger(steady_state = true, Cfg1(h_vol_2(start = 71016.12237181155)), Cfg2(h_vol_1(start = 71016.12237181314)), ExchangerMultiFluids(P(start = {300000.0, 260001.59713260198, 220002.3957916478, 180002.39588440701, 140001.5973181204, 100000.0}), Q(start = {2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343, 2702.7912398488343}), h(start = {71016.125, 71016.125, 71016.12237180988, 71016.1223718091, 71016.125, 70825.8984375})), TwoPhaseFlowPipe(P(start = {300000.0, 260001.59801114563, 220002.39710936273, 180002.3972020214, 140001.59819646296, 100000.0}), Q(start = {3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616, 3482.228448926616}), h(start = {71016.125, 71016.125, 71016.12237181216, 71016.12237181274, 71016.125, 70825.8984375})), ExchangerWall(Tp(start = {290.03103270324897, 290.0401814264445, 290.0493302229999, 290.05847909289605}), Tp1(start = {290.03103270331616, 290.04018142654525, 290.0493302231005, 290.0584790929629})), Ntubes = 10, Ns = 4, diffusion = true, dynamic_mass_balance = true, dynamic_energy_balance = false, inertia = false) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 5000000, T0 = 1273.15) annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, 70}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-10, -10}))); -equation - connect(sourceP.C, dynamicMultiFluidHeatExchanger.Cws1) annotation( - Line(points = {{-40, 30}, {-20, 30}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchanger.Cws2, sinkP.C) annotation( - Line(points = {{0, 30}, {20, 30}}, color = {0, 0, 0})); - connect(sourceP1.C, dynamicMultiFluidHeatExchanger.Cfg1) annotation( - Line(points = {{-10, 60}, {-10, 35}}, color = {0, 0, 0})); - connect(dynamicMultiFluidHeatExchanger.Cfg2, sinkP1.C) annotation( - Line(points = {{-10, 25}, {-10, 0}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestDynamicWaterSteamMultiFluidHeatExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo deleted file mode 100644 index 5db742fd..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFixedPowerHeatExchanger.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestFixedPowerHeatExchanger - ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger plateHeatExchanger(region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, DW = 1.e6) annotation( - Placement(transformation(extent = {{-20, 40}, {0, 60}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP2(T0 = 340, option_temperature = true) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP3(option_temperature = true) annotation( - Placement(transformation(extent = {{-60, 40}, {-40, 60}}, rotation = 0))); - BoundaryConditions.Sink puitsP2 annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - BoundaryConditions.Sink puitsP3 annotation( - Placement(transformation(extent = {{20, 40}, {40, 60}}, rotation = 0))); -equation - connect(sourceP3.C, plateHeatExchanger.Ef) annotation( - Line(points = {{-40, 50}, {-20, 50}}, color = {0, 0, 0})); - connect(plateHeatExchanger.Sf, puitsP3.C) annotation( - Line(points = {{-0.2, 50.1}, {9.9, 50.1}, {9.9, 50}, {20, 50}}, color = {0, 0, 0})); - connect(plateHeatExchanger.Sc, puitsP2.C) annotation( - Line(points = {{-4.2, 44}, {-4, 44}, {-4, 30}, {20, 30}}, color = {0, 0, 0})); - connect(plateHeatExchanger.Ec, sourceP2.C) annotation( - Line(points = {{-15.8, 44}, {-16, 44}, {-16, 30}, {-40, 30}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestFixedPowerHeatExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo deleted file mode 100644 index 0454bdbd..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFossilFuelBoiler.mo +++ /dev/null @@ -1,42 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestFossilFuelBoiler - import ThermoSysPro; - ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler(Wloss = 0, Ke = 1.e6, Tsf = 386.16) annotation( - Placement(transformation(extent = {{-45, -51}, {45, 51}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(T0 = 338.16, Cp = 1282, Xh = 0.24403, Xc = 0.75323, Q0 = 1.45) annotation( - Placement(transformation(extent = {{-36, -78}, {0, -41}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(Xco2 = 0, Xh2o = 0.01, Q0 = 27., Xo2 = 0.233, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, T0 = 298.16, option_temperature = true) annotation( - Placement(transformation(extent = {{-110, -50}, {-71, -13}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( - Placement(transformation(extent = {{68, -51}, {110, -12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0 = 24., h0 = 600e3, P0 = 14000000) annotation( - Placement(transformation(extent = {{-107, 14}, {-71, 48}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{74, 13}, {110, 49}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 1e-3) annotation( - Placement(transformation(extent = {{-64, 25}, {-56, 37}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 1e-3) annotation( - Placement(transformation(extent = {{57, 25}, {65, 37}}, rotation = 0))); -equation - connect(sourceQ.C, FossilFuelBoiler.Cair) annotation( - Line(points = {{-71, -31.5}, {-63.5, -31.5}, {-63.5, -31.62}, {-45, -31.62}}, color = {0, 0, 0}, thickness = 1)); - connect(FossilFuelBoiler.Cfg, sinkP.C) annotation( - Line(points = {{45, -31.62}, {62, -31.62}, {62, -31.5}, {68, -31.5}}, color = {0, 0, 0}, thickness = 1)); - connect(fuelSourcePQ.C, FossilFuelBoiler.Cfuel) annotation( - Line(points = {{0, -59.5}, {0, -40.8}}, color = {0, 0, 0})); - connect(sourcePQ.C, singularPressureLoss.C1) annotation( - Line(points = {{-71, 31}, {-64, 31}}, color = {0, 0, 255})); - connect(singularPressureLoss.C2, FossilFuelBoiler.Cws1) annotation( - Line(points = {{-56, 31}, {-50, 31}, {-50, 30.6}, {-45, 30.6}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, sink.C) annotation( - Line(points = {{65, 31}, {74, 31}}, color = {0, 0, 255})); - connect(FossilFuelBoiler.Cws2, singularPressureLoss1.C1) annotation( - Line(points = {{45, 30.6}, {51, 30.6}, {51, 31}, {57, 31}}, color = {0, 0, 255})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestFossilFuelBoiler; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo deleted file mode 100644 index 72b6ca37..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestFresnelField.mo +++ /dev/null @@ -1,59 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestFresnelField - parameter Integer Nt = 3 "Number of trains"; - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(ntubes = 1, steady_state = true, D = 0.07, e = 0.004, Ns = 30, T0 = 500, lambda = 20, cpw = 500, rhow = 8000, Tp(start = {628.0843201819387, 627.9310075597404, 627.8220175907211, 627.7368992018166, 627.6679716601412, 627.6112649113921, 627.5643995456558, 627.5258238160011, 627.4944728950805, 627.4695948757801, 627.4506537300122, 627.4372716636091, 627.4291939746797, 627.426267226699, 627.428426585461, 627.4356896138493, 627.4481553612113, 627.4660085346942, 627.4895290639054, 627.5191082002851, 627.5552734790091, 627.5987264837852, 627.6504001032708, 627.7115474128314, 627.7838847016081, 627.8698331666657, 627.9729350144038, 629.4253815385038, 633.135688507217, 636.2622387488283}), Tp1(start = {610.2709965207655, 610.0984334604643, 609.9757644369477, 609.8799665740102, 609.8023932206363, 609.7385750723525, 609.6858335131916, 609.6424216866362, 609.6071408778737, 609.5791446660139, 609.5578296140685, 609.5427704711935, 609.533680491646, 609.5303869740989, 609.5328169418054, 609.540990157294, 609.5550181389947, 609.5751088339957, 609.6015773714007, 609.6348642175905, 609.6755632868924, 609.7244644309128, 609.7826179283193, 609.8514345863706, 609.9328467812495, 610.0295806069864, 610.1456244663702, 611.7808730290952, 615.9622431406954, 619.4903247027197}), Tp2(start = {644.9596553467713, 644.824579502235, 644.7285482944553, 644.6535470354397, 644.592810046145, 644.5428402353538, 644.5015416419557, 644.4675473586904, 644.4399193877858, 644.4179953736024, 644.4013031238645, 644.3895098327511, 644.3823911261306, 644.3798118348441, 644.3817148399042, 644.38811560583, 644.3991013774125, 644.4148348525065, 644.4355626048274, 644.4616292617266, 644.4934994867675, 644.531791236838, 644.5773261834961, 644.6312079828199, 644.6949482231629, 644.7706792525222, 644.8615205623447, 646.1407907783827, 649.404839172216, 652.1510013554424}), L = 1e4/11.46) annotation( - Placement(transformation(extent = {{-40, -36}, {40, -2}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0 = 11, h0 = 1500e3) annotation( - Placement(transformation(extent = {{-101, -55}, {-81, -35}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(ntubes = 1, steady_state = true, rugosrel = 0.00005, dpfCorr = 1, Ns = 30, P(start = {12512365.778485337, 12512269.4730028, 12512159.010926897, 12512028.619141866, 12511878.28140543, 12511707.984695798, 12511517.718132183, 12511307.472416837, 12511077.239500606, 12510827.012364838, 12510556.784871727, 12510266.551658653, 12509956.30806284, 12509626.050068311, 12509275.774270097, 12508905.477852736, 12508515.15858121, 12508104.814803492, 12507674.445464557, 12507224.050132478, 12506753.629037917, 12506263.183129327, 12505752.714147368, 12505222.224723859, 12504671.718513375, 12504101.200370008, 12503510.676589508, 12502896.415784404, 12502231.48634808, 12501522.52554151, 12500776.553197166, 12500000.0}), h(start = {1500000.0, 1536254.1810191544, 1572547.5410785251, 1608868.7411348266, 1645211.676359884, 1681572.2077847784, 1717947.2125321354, 1754334.1766730088, 1790730.9833788855, 1827135.788296852, 1863546.9394607474, 1899962.9220483964, 1936382.3178860326, 1972803.7739566958, 2009225.9764870608, 2045647.6282789519, 2082067.4276265746, 2118484.0474634594, 2154896.1134394333, 2191302.179544121, 2227700.6996020116, 2264089.9923674623, 2300468.196934767, 2336833.213464297, 2373182.6211112435, 2409513.559261445, 2445822.5467506223, 2482105.1942732874, 2518015.7979130256, 2552967.680496474, 2587102.355161259, 82548.43470391157}), D = 0.07, inertia = false, L = 1e4/11.46) annotation( - Placement(transformation(extent = {{-36, -67}, {36, -20}}, rotation = 0))); - ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(Ns = 30, T(start = fill(500, 30)), F12 = 0.6366, A = 1e4, T0 = 303) annotation( - Placement(transformation(extent = {{-40, -16}, {40, 72}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(h0 = 2000e3, P0 = 125e5) annotation( - Placement(transformation(extent = {{80, -54}, {100, -34}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(Starttime = 100, Initialvalue = 100, Duration = 3600, Finalvalue = 900) annotation( - Placement(transformation(extent = {{72, 39}, {58, 53}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Angles(Starttime = 100, Initialvalue = 45, Finalvalue = 45, Duration = 3600) annotation( - Placement(transformation(extent = {{-26, 77}, {-12, 90}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Q(Starttime = 100, Duration = 3600, Initialvalue = 2, Finalvalue = 3) annotation( - Placement(transformation(extent = {{7, -6.5}, {-7, 6.5}}, rotation = 90, origin = {-90, -9.5}))); - Junctions.MassFlowMultiplier massFlowMultiplier1(alpha = 1/Nt) annotation( - Placement(transformation(extent = {{-70, -54}, {-50, -34}}))); - Junctions.MassFlowMultiplier massFlowMultiplier2(alpha = Nt) annotation( - Placement(transformation(extent = {{52, -54}, {72, -34}}))); -equation - connect(champThermosolaireLFR_N.P, heatExchangerWall.WT2) annotation( - Line(points = {{0, 1.6}, {0, -15.6}}, color = {191, 95, 0})); - connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation( - Line(points = {{0, -22.4}, {0, -36.45}}, color = {191, 95, 0})); - connect(champThermosolaireLFR_N.SunDNI, DNI.y) annotation( - Line(points = {{44, 45.6}, {51, 45.6}, {51, 46}, {57.3, 46}})); - connect(champThermosolaireLFR_N.SunA, Angles.y) annotation( - Line(points = {{36.8, 58.8}, {36.8, 84}, {28, 84}, {28, 83.5}, {-11.3, 83.5}})); - connect(sourceP.C, massFlowMultiplier1.Ce) annotation( - Line(points = {{-81, -45}, {-76.5, -45}, {-76.5, -44}, {-70, -44}}, color = {0, 0, 0})); - connect(massFlowMultiplier1.Cs, dynamicTwoPhaseFlowPipe.C1) annotation( - Line(points = {{-50, -44}, {-44, -44}, {-44, -43.5}, {-36, -43.5}}, color = {0, 0, 0})); - connect(dynamicTwoPhaseFlowPipe.C2, massFlowMultiplier2.Ce) annotation( - Line(points = {{36, -43.5}, {47, -43.5}, {47, -44}, {52, -44}}, color = {0, 0, 0})); - connect(massFlowMultiplier2.Cs, sinkP.C) annotation( - Line(points = {{72, -44}, {80, -44}}, color = {0, 0, 0})); - connect(Q.y, sourceP.IMassFlow) annotation( - Line(points = {{-90, -17.2}, {-91, -17.2}, {-91, -40}}, color = {0, 0, 255})); - connect(Angles.y, champThermosolaireLFR_N.SunG) annotation( - Line(points = {{-11.3, 83.5}, {27.2, 83.5}, {27.2, 58.8}}, color = {0, 0, 255})); - annotation( - Documentation(revisions = " -Author - -Baligh El Hefni - - ", info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - experiment(StopTime = 5000), - Diagram(graphics = {Text(extent = {{-36, -64}, {54, -82}}, lineColor = {28, 108, 200}, textString = "Fresnel field with Nt=%Nt trains")})); -end TestFresnelField; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo deleted file mode 100644 index 7a5609b3..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGTCombustionChamber.mo +++ /dev/null @@ -1,31 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestGTCombustionChamber - import ThermoSysPro; - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 annotation( - Placement(transformation(origin = {149, -2}, extent = {{23, -24}, {-23, 24}}, rotation = 180))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P(fixed = true, start = 14.1e5)), kcham(fixed = false, start = 1)) annotation( - Placement(transformation(extent = {{-67, -68}, {67, 64}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2(Q0 = 0, P0 = 15e5, h0 = 300e3) annotation( - Placement(transformation(extent = {{-112, 48}, {-72, 88}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(Hum = 0, Xo = 0, Xn = 0, Xs = 0, rho = 0.838, Xc = 0.755, Xh = 0.245, Cp = 2255, T0 = 410, Q0 = 9.30, LHV = 47500e3) annotation( - Placement(transformation(extent = {{-107, -93}, {-71, -57}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(Xso2 = 0, Xco2 = 0.0, Xo2 = 0.23, Xh2o = 0.01, P0 = 15e5, Q0 = 415, T0 = 680, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true) annotation( - Placement(transformation(extent = {{-174, -26}, {-128, 22}}, rotation = 0))); -equation - connect(GTCombustionChamber2.Cws, sourcePQ2.C) annotation( - Line(points = {{-40.2, 57.4}, {-40.2, 68}, {-72, 68}})); - connect(GTCombustionChamber2.Cfuel, sourceCombustible2.C) annotation( - Line(points = {{0, -61.4}, {0, -75}, {-71, -75}}, color = {0, 0, 0})); - connect(GTCombustionChamber2.Cfg, Puits_Fumees2.C) annotation( - Line(points = {{60.3, -2}, {126, -2}}, color = {0, 0, 0}, thickness = 1)); - connect(Source_Fumees2.C, GTCombustionChamber2.Ca) annotation( - Line(points = {{-128, -2}, {-60.3, -2}}, color = {0, 0, 0}, thickness = 1)); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}}, initialScale = 0.1)), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestGTCombustionChamber; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo deleted file mode 100644 index 92361c4f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGasTurbine.mo +++ /dev/null @@ -1,42 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestGasTurbine - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(P0 = 1.013e5, Q0 = 600, T0 = 29.4 + 273.16, option_temperature = true, Xco2 = 0, Xh2o = 0, Xo2 = 0.20994, Xso2 = 0, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-70, -10}, {-50, 10}}))); - BoundaryConditions.SinkP sink annotation( - Placement(transformation(extent = {{60, -10}, {80, 10}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante humidity(k = 0.93) annotation( - Placement(transformation(extent = {{-100, 30}, {-80, 50}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe fuel(Starttime = 200, Duration = 800, Initialvalue = 13.507, Finalvalue = 8.756) annotation( - Placement(transformation(extent = {{-40, 60}, {-20, 80}}))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe air(Starttime = 200, Duration = 800, Initialvalue = 592.7, Finalvalue = 415.70) annotation( - Placement(transformation(extent = {{-98, 0}, {-78, 20}}))); - Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(Q0 = 13.4368286133, T0 = 185 + 273.16, LHV = 46989e3, Cp = 2255, Xc = 0.755, Xh = 0.245, rho = 0.838) annotation( - Placement(transformation(extent = {{-20, 40}, {0, 60}}))); - BoundaryConditions.SourcePQ water(Q0 = 0) annotation( - Placement(transformation(extent = {{-60, 40}, {-40, 60}}))); - Machines.GasTurbine gasTurbine(comp_tau_n = 14.0178, comp_eff_n = 0.87004, exp_tau_n = 0.06458, exp_eff_n = 0.89045, TurbQred = 0.0175634, Kcham = 2.02088, Wpth = 1e6, Compresseur(Ps(start = 1404200.0), Te(start = 302.56000000000006), Tis(start = 630.0), Ts(start = 729.0)), TurbineAgaz(Tis(start = 847.0)), chambreCombustionTAC(Psf(start = 1310000.0), Tea(start = 729.0), Tsf(start = 1532.57)), xAIR(ppvap0(start = 4104.0), rho_air(start = 1.0836), rho_vap(start = 0.029))) annotation( - Placement(transformation(extent = {{-30, -28}, {30, 28}}))); -equation - connect(air.y, sourcePQ.IMassFlow) annotation( - Line(points = {{-77, 10}, {-60, 10}, {-60, 5}}, color = {0, 0, 255})); - connect(humidity.y, gasTurbine.Huminide) annotation( - Line(points = {{-79, 40}, {-60, 40}, {-60, 16.8}, {-31.2, 16.8}}, color = {0, 0, 255})); - connect(fuel.y, fuelSourcePQ.IMassFlow) annotation( - Line(points = {{-19, 70}, {-10, 70}, {-10, 55}}, color = {0, 0, 255})); - connect(sourcePQ.C, gasTurbine.Entree_air) annotation( - Line(points = {{-50, 0}, {-32, 0}, {-32, 3.55271e-015}, {-30, 3.55271e-015}}, color = {0, 0, 0})); - connect(fuelSourcePQ.C, gasTurbine.Entree_combustible) annotation( - Line(points = {{0, 50}, {18, 50}, {18, 28}}, color = {0, 0, 0})); - connect(water.C, gasTurbine.Entree_eau_combustion) annotation( - Line(points = {{-40, 50}, {-18, 50}, {-18, 28}}, color = {0, 0, 0})); - connect(gasTurbine.Sortie_fumees, sink.C) annotation( - Line(points = {{30, 3.55271e-015}, {46, 3.55271e-015}, {46, 0}, {60, 0}}, color = {0, 0, 0})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - experiment(StopTime = 1200)); -end TestGasTurbine; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo deleted file mode 100644 index 42ce7417..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion.mo +++ /dev/null @@ -1,34 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestGenericCombustion - ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion genericCombustionCCS(kcham = 0.1, Acham = 275, Xbf = 0, ImbCV = 0.05, ImbBF = 0.0, Psf(start = 113275)) annotation( - Placement(transformation(extent = {{-32, -56}, {92, 72}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(Xn = 0.0208, Xashes = 0.136, Cp = 1200, rho = 1100, LHV = 29245e3, Xc = 0.719, Xh = 0.0414, Xo = 0.086, Xs = 0.0044, Vol = 0.286, Q0 = 57.20, T0 = 358.15, Hum = 0.08) annotation( - Placement(transformation(extent = {{24, -95}, {58, -57}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0 = 0, P0 = 100000) annotation( - Placement(transformation(extent = {{-83, -3}, {-47, 31}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(Xso2 = 0, Q0 = 609.29, Xh2o = 0.01, Xo2 = 0.230, Xco2 = 0, P0 = 191000, T0 = 524.89, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true) annotation( - Placement(transformation(extent = {{-54, -94}, {-10, -54}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{30, 70}, {74, 112}}, rotation = 0))); -equation - connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel) annotation( - Line(points = {{58, -76}, {73.4, -76}, {73.4, -49.6}}, color = {0, 0, 0})); - connect(SourcePQ_Water.C, genericCombustionCCS.Cws) annotation( - Line(points = {{-47, 14}, {-36, 14}, {-36, 14.4}, {-25.8, 14.4}}, color = {0, 0, 0})); - connect(genericCombustionCCS.Ca, sourceAir.C) annotation( - Line(points = {{11.4, -49.6}, {11.4, -74}, {-10, -74}}, color = {0, 0, 0}, thickness = 1)); - connect(genericCombustionCCS.Cfg, sink.C) annotation( - Line(points = {{11.4, 65.6}, {11.4, 91}, {30, 91}}, color = {0, 0, 0}, thickness = 1)); - annotation( - Documentation(revisions = " -Author - -Baligh El Hefni - - ", info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); -end TestGenericCombustion; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo deleted file mode 100644 index f041a504..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGenericCombustion1D.mo +++ /dev/null @@ -1,51 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestGenericCombustion1D - parameter Integer NCEL = 7; - ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(NCEL = 7, Qm(fixed = false), Qsf(fixed = false), kcham(fixed = true) = 0.1, Acham = 275, Xbf = 0, ImbCV = 0.05, EPSPAR = 0.7, Kec = 8.8, SM = {639.92, 198.58, 466.48, 466.48, 466.48, 358.56, 358.56}, ImbBF = 0.0, Psf(start = 113275)) annotation( - Placement(transformation(extent = {{-62, -56}, {62, 72}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(Xn = 0.0208, Xashes = 0.136, Cp = 1200, rho = 1100, LHV = 29245e3, Xc = 0.719, Xh = 0.0414, Xo = 0.086, Xs = 0.0044, Vol = 0.286, Q0 = 57.20, T0 = 358.15, Hum = 0.08) annotation( - Placement(transformation(extent = {{-106, -43}, {-72, -5}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(Xso2 = 0, Q0 = 609.29, Xh2o = 0.01, Xo2 = 0.230, Xco2 = 0, P0 = 191000, T0 = 524.89, option_temperature = true, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-44, -98}, {0, -58}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{0, 70}, {44, 112}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0 = 0, P0 = 100000) annotation( - Placement(transformation(extent = {{-107, 23}, {-71, 57}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe PipeWaterSteam(Ns = 7, z2 = 56, rugosrel = 5e-5, ntubes = 403, L = 58, D = 0.0327, C2(Q(fixed = false, start = 486.69), P(fixed = false, start = 1.96318e+07, displayUnit = "Pa")), dpfCorr = 3.5) annotation( - Placement(transformation(origin = {91, 8}, extent = {{49, 16}, {-49, -16}}, rotation = 270))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall paroiEcrans(Ns = 7, lambda = 40, steady_state = true, ntubes = 403, L = 58, D = 0.0327, e = 0.001) annotation( - Placement(transformation(origin = {73, 7.5}, extent = {{51.5, -15}, {-51.5, 15}}, rotation = 270))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam2(option_temperature = false, Q(start = 486.69, fixed = true), h0 = 2.5e+06, P0(fixed = false) = 19621600) annotation( - Placement(transformation(origin = {90, 90.5}, extent = {{14.5, -15}, {-14.5, 15}}, rotation = 270))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceEcrans(h0 = 1.292e+06, option_temperature = false, P0 = 20112000) annotation( - Placement(transformation(origin = {91, -81}, extent = {{15, -15}, {-15, 15}}, rotation = 270))); -equation - connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel) annotation( - Line(points = {{-72, -24}, {-55.8, -24}}, color = {0, 0, 0})); - connect(genericCombustionCCS.Cfg, sink.C) annotation( - Line(points = {{0, 65.6}, {0, 91}, {0, 91}}, color = {0, 0, 0}, thickness = 1)); - connect(genericCombustionCCS.Ca, sourceAir.C) annotation( - Line(points = {{0, -49.6}, {0, -78}}, color = {0, 0, 0}, thickness = 1)); - connect(SourcePQ_Water.C, genericCombustionCCS.Cws) annotation( - Line(points = {{-71, 40}, {-55.8, 40}}, color = {0, 0, 255})); - connect(genericCombustionCCS.Cth, paroiEcrans.WT2) annotation( - Line(points = {{55.8, 8}, {68, 8}, {68, 7.5}, {76, 7.5}}, color = {191, 95, 0})); - connect(paroiEcrans.WT1, PipeWaterSteam.CTh) annotation( - Line(points = {{70, 7.5}, {71, 7.5}, {71, 8}, {86.2, 8}}, color = {191, 95, 0})); - connect(sourceEcrans.C, PipeWaterSteam.C1) annotation( - Line(points = {{91, -66}, {91, -41}}, color = {0, 0, 255})); - connect(PipeWaterSteam.C2, sinkWaterSteam2.C) annotation( - Line(points = {{91, 57}, {91, 76}, {90, 76}}, color = {0, 0, 255})); - annotation( - Documentation(revisions = " -Author - -Baligh El Hefni - - ", info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); -end TestGenericCombustion1D; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo deleted file mode 100644 index 156241e4..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestGridFurnace.mo +++ /dev/null @@ -1,40 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestGridFurnace - import ThermoSysPro; - parameter Integer NCEL = 7; - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(Xn = 0.0208, Xashes = 0.136, Cp = 1200, rho = 1100, LHV = 29245e3, Xc = 0.719, Xh = 0.0414, Xo = 0.086, Xs = 0.0044, Vol = 0.286, Q0 = 57.20, T0 = 358.15, Hum = 0.08) annotation( - Placement(transformation(extent = {{-106, -23}, {-72, 15}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(Xso2 = 0, Xh2o = 0.01, Xo2 = 0.230, Xco2 = 0, T0 = 300, Q0 = 10, P0 = 1.9e5, option_temperature = true, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-74, -80}, {-30, -40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature = true) annotation( - Placement(transformation(extent = {{28, 50}, {72, 92}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(P0 = 1.e5, Q0 = 1) annotation( - Placement(transformation(extent = {{89, 13}, {53, 47}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.GridFurnace gridFurnace annotation( - Placement(transformation(extent = {{-40, -40}, {40, 40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceAir1(Xso2 = 0, Xh2o = 0.01, Xo2 = 0.230, Xco2 = 0, option_temperature = true, T0 = 300, Q0 = 10, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-90, 4}, {-46, 44}}, rotation = 0))); -equation - connect(fuelSourcePQ.C, gridFurnace.Com) annotation( - Line(points = {{-72, -4}, {-36, -4}}, color = {0, 0, 0})); - connect(gridFurnace.Cfg, sink.C) annotation( - Line(points = {{0, 36}, {0, 71}, {28, 71}}, color = {0, 0, 0})); - connect(SourcePQ_Water.C, gridFurnace.port_eau_refroid) annotation( - Line(points = {{53, 30}, {32, 30}, {32, 12}}, color = {0, 0, 0})); - connect(sourceAir1.C, gridFurnace.Ca2) annotation( - Line(points = {{-46, 24}, {-20, 24}}, color = {0, 0, 0})); - connect(sourceAir.C, gridFurnace.Ca1) annotation( - Line(points = {{-30, -60}, {0, -60}, {0, -36}}, color = {0, 0, 0})); - annotation( - Documentation(revisions = " -Author - -Baligh El Hefni - - ", info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); -end TestGridFurnace; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo deleted file mode 100644 index dc086036..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestHeatPumpCompressor.mo +++ /dev/null @@ -1,21 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestHeatPumpCompressor - ThermoSysPro.Fluid.Machines.HeatPumpCompressor Compressor(Pe(fixed = false, start = 100000), Ts(fixed = false, start = 680)) annotation( - Placement(transformation(extent = {{-52, -52}, {48, 52}}, rotation = 0))); - BoundaryConditions.SourceQ SourceQ1(Xso2 = 0, Xco2 = 0.0, Xh2o = 0.003, Xo2 = 0.23, Q0 = 420, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.C3H3F5, h0 = 3.e4, T0 = 288, option_temperature = false) annotation( - Placement(transformation(extent = {{-104, -10}, {-84, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0 = 1580000, option_temperature = false) annotation( - Placement(transformation(origin = {96, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); -equation - connect(SourceQ1.C, Compressor.C1) annotation( - Line(points = {{-84, 0}, {-52, 0}}, color = {0, 0, 0})); - connect(SinkP1.C, Compressor.C2) annotation( - Line(points = {{86, 0}, {48, 0}}, color = {0, 0, 0})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestHeatPumpCompressor; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo deleted file mode 100644 index 56e14698..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealCheckValve.mo +++ /dev/null @@ -1,76 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestIdealCheckValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( - Placement(transformation(extent = {{-60, -80}, {-40, -60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 6e5) annotation( - Placement(transformation(extent = {{80, -80}, {100, -60}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(amplitude = 6e5, width = 50, period = 100, offset = 3e5) annotation( - Placement(transformation(extent = {{-100, -80}, {-80, -60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve3 annotation( - Placement(transformation(extent = {{10, -80}, {30, -60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 annotation( - Placement(transformation(extent = {{-30, -80}, {-10, -60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP3 annotation( - Placement(transformation(extent = {{50, -80}, {70, -60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-104, 20}, {-84, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0 = 6e5) annotation( - Placement(transformation(extent = {{84, 20}, {104, 40}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump1 annotation( - Placement(transformation(extent = {{-30, 60}, {-10, 80}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump2 annotation( - Placement(transformation(extent = {{-30, -20}, {-10, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeD volumeD annotation( - Placement(transformation(extent = {{-50, 20}, {-30, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve1 annotation( - Placement(transformation(extent = {{10, 60}, {30, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve idealCheckValve2 annotation( - Placement(transformation(extent = {{8, -20}, {28, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeC annotation( - Placement(transformation(extent = {{30, 20}, {50, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); -equation - connect(sourceP1.C, perteDP2.C1) annotation( - Line(points = {{-40, -70}, {-30, -70}}, color = {0, 0, 255})); - connect(perteDP2.C2, idealCheckValve3.C1) annotation( - Line(points = {{-10, -70}, {10, -70}}, color = {0, 0, 255})); - connect(idealCheckValve3.C2, perteDP3.C1) annotation( - Line(points = {{30, -70}, {50, -70}}, color = {0, 0, 255})); - connect(perteDP3.C2, puitsP1.C) annotation( - Line(points = {{70, -70}, {80, -70}}, color = {0, 0, 255})); - connect(pulse.y, sourceP1.IPressure) annotation( - Line(points = {{-79, -70}, {-55, -70}})); - connect(staticCentrifugalPump1.C2, idealCheckValve1.C1) annotation( - Line(points = {{-10, 70}, {-2, 70}, {-2, 70}, {10, 70}}, color = {0, 0, 255})); - connect(staticCentrifugalPump2.C2, idealCheckValve2.C1) annotation( - Line(points = {{-10, -10}, {0, -10}, {0, -10}, {8, -10}}, color = {0, 0, 255})); - connect(perteDP1.C2, puitsP.C) annotation( - Line(points = {{80, 30}, {84, 30}}, color = {0, 0, 255})); - connect(sourceP.C, perteDP.C1) annotation( - Line(points = {{-84, 30}, {-80, 30}}, color = {0, 0, 255})); - connect(perteDP.C2, volumeD.Ce) annotation( - Line(points = {{-60, 30}, {-50, 30}}, color = {0, 0, 0})); - connect(volumeD.Cs1, staticCentrifugalPump1.C1) annotation( - Line(points = {{-40, 40}, {-40, 70}, {-30, 70}}, color = {0, 0, 0})); - connect(volumeD.Cs2, staticCentrifugalPump2.C1) annotation( - Line(points = {{-40, 20}, {-40, -10}, {-30, -10}}, color = {0, 0, 0})); - connect(idealCheckValve1.C2, volumeC.Ce2) annotation( - Line(points = {{30, 70}, {40, 70}, {40, 40}}, color = {0, 0, 0})); - connect(volumeC.Cs, perteDP1.C1) annotation( - Line(points = {{50, 30}, {60, 30}}, color = {0, 0, 0})); - connect(idealCheckValve2.C2, volumeC.Ce3) annotation( - Line(points = {{28, -10}, {40, -10}, {40, 20}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})), - Window(x = 0.28, y = 0.03, width = 0.5, height = 0.6), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestIdealCheckValve; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo deleted file mode 100644 index f57f4767..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestIdealSwitchValve.mo +++ /dev/null @@ -1,36 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestIdealSwitchValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealSwitchValve SwitchValve annotation( - Placement(transformation(extent = {{-20, 26}, {0, 46}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(width = 10, period = 20) annotation( - Placement(transformation(extent = {{-60, 60}, {-40, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); -equation - connect(pulse.yL, SwitchValve.Ouv) annotation( - Line(points = {{-39, 70}, {-10, 70}, {-10, 43}})); - connect(SourceP1.C, perteDP2.C1) annotation( - Line(points = {{-80, 30}, {-60, 30}}, color = {0, 0, 255})); - connect(perteDP2.C2, SwitchValve.C1) annotation( - Line(points = {{-40, 30}, {-30, 30}, {-30, 30}, {-20, 30}}, color = {0, 0, 255})); - connect(SwitchValve.C2, perteDP1.C1) annotation( - Line(points = {{0, 30}, {20, 30}}, color = {0, 0, 255})); - connect(perteDP1.C2, PuitsP1.C) annotation( - Line(points = {{40, 30}, {60, 30}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 100), - Window(x = 0.45, y = 0.01, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestIdealSwitchValve; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo deleted file mode 100644 index dcedda7f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInternalCombustionEngine.mo +++ /dev/null @@ -1,48 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestInternalCombustionEngine - import ThermoSysPro; - parameter Integer NCEL = 7; - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(Hum = 0, Xh = 0.25, Xs = 0, Xashes = 0, Xc = 0.75, Xo = 0, Xn = 0, Q0 = 0.0676, rho = 0.744, LHV = 50e6, T0(displayUnit = "K") = 299, P0 = 210300, Vol = 100) annotation( - Placement(transformation(extent = {{-106, -81}, {-72, -43}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(Xso2 = 0, Xco2 = 0, Xh2o = 0.005, Xo2 = 0.23, Q0 = 1.9627, T0 = 30 + 273.16, option_temperature = true, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 191000) annotation( - Placement(transformation(extent = {{111, -79}, {73, -45}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink(option_temperature = true) annotation( - Placement(transformation(extent = {{0, 44}, {44, 86}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0 = 15.3, h0 = 334.41e3, P0 = 410000) annotation( - Placement(transformation(extent = {{-107, -19}, {-71, 15}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.InternalCombustionEngine alternatingEngine(mechanical_efficiency_type = 2, Rmeca_nom = 0.41, Coef_Rm_a = -5.4727e-9, Coef_Rm_b = 4.9359e-5, Coef_Rm_c = 0.30814, Xpth = 0.05, MMg = 20, DPe = 1, RV = 6.45, Kc = 1.28, Kd = 1.33, Wmeca(start = 1400e3), Welec(start = 1358e3), Wcomb(start = 3.4942e6), exc(start = 1.8), Gamma = 1.2085, Tsf(start = 1088.15)) annotation( - Placement(transformation(extent = {{-44, -46}, {44, 42}}))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Sink_Water1 annotation( - Placement(transformation(extent = {{75, -19}, {111, 15}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss annotation( - Placement(transformation(extent = {{-63, -8}, {-51, 4}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{51, -9}, {65, 5}}))); -equation - connect(alternatingEngine.Cair, sourceAir.C) annotation( - Line(points = {{0, -41.6}, {0, -62}, {73, -62}}, color = {0, 0, 0}, thickness = 1)); - connect(alternatingEngine.Cfuel, fuelSourcePQ.C) annotation( - Line(points = {{-30.8, -41.6}, {-30.8, -62}, {-72, -62}}, color = {0, 0, 0})); - connect(SourcePQ_Water.C, singularPressureLoss.C1) annotation( - Line(points = {{-71, -2}, {-63, -2}}, color = {0, 0, 255})); - connect(alternatingEngine.Cws1, singularPressureLoss.C2) annotation( - Line(points = {{-39.6, -2}, {-51, -2}}, color = {0, 0, 255})); - connect(alternatingEngine.Cws2, singularPressureLoss1.C1) annotation( - Line(points = {{39.6, -2}, {48, -2}, {51, -2}}, color = {0, 0, 255})); - connect(Sink_Water1.C, singularPressureLoss1.C2) annotation( - Line(points = {{75, -2}, {75, -2}, {65, -2}}, color = {0, 0, 255})); - connect(alternatingEngine.Cfg, sink.C) annotation( - Line(points = {{0, 37.6}, {0, 65}, {0, 65}}, color = {0, 0, 0}, thickness = 1)); - annotation( - Documentation(revisions = " -Author - -Baligh El Hefni - - ", info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); -end TestInternalCombustionEngine; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo deleted file mode 100644 index 159fdfb9..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestInvSingularPressureLoss.mo +++ /dev/null @@ -1,22 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestInvSingularPressureLoss - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ annotation( - Placement(transformation(extent = {{-80, 0}, {-60, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkQ annotation( - Placement(transformation(extent = {{40, 0}, {60, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss annotation( - Placement(transformation(extent = {{-20, 0}, {0, 20}}, rotation = 0))); -equation - connect(sourcePQ.C, invSingularPressureLoss.C1) annotation( - Line(points = {{-60, 10}, {-20, 10}}, color = {0, 0, 255})); - connect(invSingularPressureLoss.C2, sinkQ.C) annotation( - Line(points = {{0, 10}, {40, 10}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestInvSingularPressureLoss; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo deleted file mode 100644 index ecb7388c..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions1.mo +++ /dev/null @@ -1,84 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestJunctions1 - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2 annotation( - Placement(transformation(extent = {{-20, 40}, {0, 60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0 = 200) annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss annotation( - Placement(transformation(extent = {{-60, 40}, {-40, 60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP annotation( - Placement(transformation(extent = {{80, 80}, {100, 100}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 annotation( - Placement(transformation(extent = {{80, 0}, {100, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{40, 80}, {60, 100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{40, 0}, {60, 20}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k = 0.5) annotation( - Placement(transformation(extent = {{-40, 60}, {-20, 80}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Splitter3 splitter3 annotation( - Placement(transformation(extent = {{-20, -60}, {0, -40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0 = 400) annotation( - Placement(transformation(extent = {{-100, -60}, {-80, -40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 annotation( - Placement(transformation(extent = {{-60, -60}, {-40, -40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 annotation( - Placement(transformation(extent = {{80, -20}, {100, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3 annotation( - Placement(transformation(extent = {{80, -100}, {100, -80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 annotation( - Placement(transformation(extent = {{40, -20}, {60, 0}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 annotation( - Placement(transformation(extent = {{40, -100}, {60, -80}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k = 0) annotation( - Placement(transformation(extent = {{-40, -40}, {-20, -20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4 annotation( - Placement(transformation(extent = {{80, -60}, {100, -40}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k = 0) annotation( - Placement(transformation(extent = {{-40, -80}, {-20, -60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6 annotation( - Placement(transformation(extent = {{40, -60}, {60, -40}}, rotation = 0))); -equation - connect(sourceP.C, singularPressureLoss.C1) annotation( - Line(points = {{-80, 50}, {-60, 50}}, color = {0, 0, 255})); - connect(singularPressureLoss.C2, splitter2.Ce) annotation( - Line(points = {{-40, 50}, {-20, 50}}, color = {0, 0, 255})); - connect(splitter2.Cs1, singularPressureLoss1.C1) annotation( - Line(points = {{-6, 60}, {-6, 90}, {40, 90}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, sinkP.C) annotation( - Line(points = {{60, 90}, {80, 90}}, color = {0, 0, 255})); - connect(splitter2.Cs2, singularPressureLoss2.C1) annotation( - Line(points = {{-6, 40}, {-6, 10}, {40, 10}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, sinkP1.C) annotation( - Line(points = {{60, 10}, {80, 10}}, color = {0, 0, 255})); - connect(constante.y, splitter2.Ialpha1) annotation( - Line(points = {{-19, 70}, {-14, 70}, {-14, 56}, {-9, 56}})); - connect(sourceP1.C, singularPressureLoss3.C1) annotation( - Line(points = {{-80, -50}, {-60, -50}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, splitter3.Ce) annotation( - Line(points = {{-40, -50}, {-19.8, -50}}, color = {0, 0, 255})); - connect(splitter3.Cs1, singularPressureLoss4.C1) annotation( - Line(points = {{-6, -40}, {-6, -10}, {40, -10}}, color = {0, 0, 255})); - connect(singularPressureLoss4.C2, sinkP2.C) annotation( - Line(points = {{60, -10}, {80, -10}}, color = {0, 0, 255})); - connect(splitter3.Cs2, singularPressureLoss5.C1) annotation( - Line(points = {{-6, -60}, {-6, -90}, {40, -90}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C2, sinkP3.C) annotation( - Line(points = {{60, -90}, {80, -90}}, color = {0, 0, 255})); - connect(constante1.y, splitter3.Ialpha1) annotation( - Line(points = {{-19, -30}, {-14, -30}, {-14, -44}, {-9, -44}})); - connect(splitter3.Ialpha2, constante2.y) annotation( - Line(points = {{-9, -56}, {-14, -56}, {-14, -70}, {-19, -70}})); - connect(splitter3.Cs3, singularPressureLoss6.C1) annotation( - Line(points = {{0, -50}, {40, -50}}, color = {0, 0, 0})); - connect(singularPressureLoss6.C2, sinkP4.C) annotation( - Line(points = {{60, -50}, {80, -50}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 10), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestJunctions1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo deleted file mode 100644 index 3972d34f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions2.mo +++ /dev/null @@ -1,99 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestJunctions2 - ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1 annotation( - Placement(transformation(extent = {{0, 60}, {20, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss annotation( - Placement(transformation(extent = {{40, 60}, {60, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{-40, 80}, {-20, 100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{-40, 40}, {-20, 60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP annotation( - Placement(transformation(extent = {{-80, 80}, {-60, 100}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( - Placement(transformation(extent = {{-80, 40}, {-60, 60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP annotation( - Placement(transformation(extent = {{80, 60}, {100, 80}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k = 0) annotation( - Placement(transformation(extent = {{-40, 60}, {-20, 80}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2 annotation( - Placement(transformation(extent = {{0, -60}, {20, -40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 annotation( - Placement(transformation(extent = {{40, -60}, {60, -40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 annotation( - Placement(transformation(extent = {{-40, -40}, {-20, -20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 annotation( - Placement(transformation(extent = {{-40, -80}, {-20, -60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2 annotation( - Placement(transformation(extent = {{-80, -40}, {-60, -20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 annotation( - Placement(transformation(extent = {{-80, -80}, {-60, -60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1 annotation( - Placement(transformation(extent = {{80, -60}, {100, -40}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k = 0.5) annotation( - Placement(transformation(extent = {{-40, -20}, {-20, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ annotation( - Placement(transformation(extent = {{-80, -60}, {-60, -40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6 annotation( - Placement(transformation(extent = {{-40, -60}, {-20, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha = 2) annotation( - Placement(transformation(extent = {{0, 20}, {20, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ1 annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7 annotation( - Placement(transformation(extent = {{-40, 20}, {-20, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8 annotation( - Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP2 annotation( - Placement(transformation(extent = {{80, 20}, {100, 40}}, rotation = 0))); -equation - connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation( - Line(points = {{-20, 90}, {6, 90}, {6, 80}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation( - Line(points = {{-20, 50}, {6, 50}, {6, 60}}, color = {0, 0, 255})); - connect(mixer2_1.Cs, singularPressureLoss.C1) annotation( - Line(points = {{20, 70}, {40, 70}}, color = {0, 0, 255})); - connect(sourceP.C, singularPressureLoss1.C1) annotation( - Line(points = {{-60, 90}, {-40, 90}}, color = {0, 0, 255})); - connect(sourceP1.C, singularPressureLoss2.C1) annotation( - Line(points = {{-60, 50}, {-40, 50}}, color = {0, 0, 255})); - connect(singularPressureLoss.C2, sinkP.C) annotation( - Line(points = {{60, 70}, {80, 70}}, color = {0, 0, 255})); - connect(constante.y, mixer2_1.Ialpha1) annotation( - Line(points = {{-19, 70}, {-8, 70}, {-8, 76}, {3, 76}})); - connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation( - Line(points = {{-20, -30}, {6, -30}, {6, -40}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C2, mixer2_2.Ce2) annotation( - Line(points = {{-20, -70}, {6, -70}, {6, -60}}, color = {0, 0, 255})); - connect(mixer2_2.Cs, singularPressureLoss3.C1) annotation( - Line(points = {{20, -50}, {40, -50}}, color = {0, 0, 255})); - connect(sourceP2.C, singularPressureLoss4.C1) annotation( - Line(points = {{-60, -30}, {-40, -30}}, color = {0, 0, 255})); - connect(sourceP3.C, singularPressureLoss5.C1) annotation( - Line(points = {{-60, -70}, {-40, -70}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, sinkP1.C) annotation( - Line(points = {{60, -50}, {80, -50}}, color = {0, 0, 255})); - connect(sourceQ.C, singularPressureLoss6.C1) annotation( - Line(points = {{-60, -50}, {-40, -50}}, color = {0, 0, 255})); - connect(singularPressureLoss6.C2, mixer2_2.Ce3) annotation( - Line(points = {{-20, -50}, {-10, -50}, {0, -50}}, color = {0, 0, 255})); - connect(constante1.y, mixer2_2.Ialpha1) annotation( - Line(points = {{-19, -10}, {-8, -10}, {-8, -44}, {3, -44}})); - connect(sourceQ1.C, singularPressureLoss7.C1) annotation( - Line(points = {{-60, 30}, {-40, 30}}, color = {0, 0, 255})); - connect(singularPressureLoss7.C2, massFlowMultiplier.Ce) annotation( - Line(points = {{-20, 30}, {0, 30}}, color = {0, 0, 255})); - connect(massFlowMultiplier.Cs, singularPressureLoss8.C1) annotation( - Line(points = {{20, 30}, {40, 30}}, color = {0, 0, 255})); - connect(singularPressureLoss8.C2, sinkP2.C) annotation( - Line(points = {{60, 30}, {80, 30}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 10), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestJunctions2; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo deleted file mode 100644 index 0c13c257..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions3.mo +++ /dev/null @@ -1,67 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestJunctions3 - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-104, 0}, {-84, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(P0 = 2e5, Q(start = 323.48244470861454)) annotation( - Placement(transformation(extent = {{-104, -60}, {-84, -40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve valve1(C2(h_vol_1(start = 70977.89042837733)), Pm(start = 120690.8728732298), C1(h_vol_1(start = 71016.12237181116), Xco2(start = 4.2755644765396636E-32), Xso2(start = 2.0610804919205873E-32), h_vol_2(start = 70977.89042837733), Xh2o(start = 1.4925957069001078E-32), Xo2(start = 1.8180778675015506E-31))) annotation( - Placement(transformation(extent = {{-10, 6}, {10, 26}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve valve2(C1(h_vol_1(start = 70921.01678153824), Xco2(start = 7.395570986446986E-32), Xh2o(start = 1.9721522630525295E-31), Xo2(start = 1.9721522630525295E-31), Xso2(start = 6.998299036616324E-32)), Pm(start = 118970.64778985853)) annotation( - Placement(transformation(extent = {{-10, -54}, {10, -34}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve valve3(Q(start = 804.6933031325926), Pm(start = 108776.21727782265), C1(Xco2(start = 3.4137108264263755E-31), Xo2(start = 1.9413373839423337E-31), Xso2(start = 1.7792131856876708E-31), Xh2o(start = 2.3303752327085554E-31))) annotation( - Placement(transformation(extent = {{50, -24}, {70, -4}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2 annotation( - Placement(transformation(extent = {{82, -30}, {102, -10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(Duration = 1, Initialvalue = 1, Finalvalue = 0.05) annotation( - Placement(transformation(extent = {{32, 20}, {52, 40}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Initialvalue = 1, Starttime = 2, Finalvalue = 0.001) annotation( - Placement(transformation(extent = {{-30, 30}, {-10, 50}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe4(Initialvalue = 1, Starttime = 1, Finalvalue = 0.001) annotation( - Placement(transformation(extent = {{-30, -30}, {-10, -10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe1 annotation( - Placement(transformation(extent = {{-80, 0}, {-60, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe pipe2 annotation( - Placement(transformation(extent = {{-80, -60}, {-60, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume annotation( - Placement(transformation(extent = {{-40, 0}, {-20, 20}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1 annotation( - Placement(transformation(extent = {{20, -30}, {40, -10}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2 annotation( - Placement(transformation(extent = {{-40, -60}, {-20, -40}}, rotation = 0))); -equation - connect(valve3.C2, puitsP2.C) annotation( - Line(points = {{70, -20}, {82, -20}}, color = {0, 0, 255})); - connect(rampe2.y, valve3.Ouv) annotation( - Line(points = {{53, 30}, {60, 30}, {60, -3}})); - connect(rampe3.y, valve1.Ouv) annotation( - Line(points = {{-9, 40}, {0, 40}, {0, 27}})); - connect(rampe4.y, valve2.Ouv) annotation( - Line(points = {{-9, -20}, {0, -20}, {0, -33}})); - connect(sourceP.C, pipe1.C1) annotation( - Line(points = {{-84, 10}, {-80, 10}}, color = {0, 0, 255})); - connect(sourceP1.C, pipe2.C1) annotation( - Line(points = {{-84, -50}, {-80, -50}}, color = {0, 0, 255})); - connect(pipe1.C2, staticVolume.Ce4) annotation( - Line(points = {{-60, 10}, {-50, 10}, {-50, 14}, {-40.2, 14}}, color = {0, 0, 255})); - connect(staticVolume.Cs, valve1.C1) annotation( - Line(points = {{-20, 10}, {-10, 10}}, color = {0, 0, 255})); - connect(staticVolume1.Cs, valve3.C1) annotation( - Line(points = {{40, -20}, {50, -20}}, color = {0, 0, 255})); - connect(valve1.C2, staticVolume1.Ce1) annotation( - Line(points = {{10, 10}, {33, 10}, {33, -9.8}}, color = {0, 0, 255})); - connect(valve2.C2, staticVolume1.Ce8) annotation( - Line(points = {{10, -50}, {33, -50}, {33, -29.9}}, color = {0, 0, 255})); - connect(pipe2.C2, staticVolume2.Ce4) annotation( - Line(points = {{-60, -50}, {-50, -50}, {-50, -46}, {-40.2, -46}}, color = {0, 0, 255})); - connect(staticVolume2.Cs, valve2.C1) annotation( - Line(points = {{-20, -50}, {-10, -50}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 10), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestJunctions3; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo deleted file mode 100644 index de657f04..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestJunctions4.mo +++ /dev/null @@ -1,39 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestJunctions4 - ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(Tmax = 308) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{-60, -20}, {-40, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(T0 = 310) annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Source source(h0 = 30000) annotation( - Placement(transformation(extent = {{-100, -20}, {-80, 0}}, rotation = 0))); -equation - connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation( - Line(points = {{-40, 30}, {-30, 30}, {-30, 36}, {-20, 36}}, color = {0, 0, 255})); - connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation( - Line(points = {{0, 36}, {10, 36}, {10, 30}, {20, 30}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation( - Line(points = {{-40, -10}, {-9.9, -10}, {-9.9, 20}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, sinkP.C) annotation( - Line(points = {{40, 30}, {60, 30}}, color = {0, 0, 255})); - connect(sourceP.C, singularPressureLoss.C1) annotation( - Line(points = {{-80, 30}, {-60, 30}}, color = {0, 0, 255})); - connect(source.C, singularPressureLoss2.C1) annotation( - Line(points = {{-80, -10}, {-60, -10}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 10), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestJunctions4; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo deleted file mode 100644 index d795d8e1..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestLoopBreaker.mo +++ /dev/null @@ -1,45 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestLoopBreaker - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{-20, -20}, {0, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1 annotation( - Placement(transformation(extent = {{-56, 0}, {-36, 20}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1 annotation( - Placement(transformation(extent = {{40, 0}, {60, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{80, 0}, {100, 20}}, rotation = 0))); - InstrumentationAndControl.Blocks.Sources.Constante constante(k = 0.5) annotation( - Placement(transformation(extent = {{-80, 40}, {-60, 60}}, rotation = 0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP annotation( - Placement(transformation(extent = {{10, -20}, {30, 0}}, rotation = 0))); -equation - connect(sourcePQ.C, splitter2_1.Ce) annotation( - Line(points = {{-80, 10}, {-56, 10}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(splitter2_1.Cs1, singularPressureLoss1.C1) annotation( - Line(points = {{-42, 20}, {-42, 30}, {-20, 30}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(splitter2_1.Cs2, singularPressureLoss2.C1) annotation( - Line(points = {{-42, 0}, {-42, -10}, {-20, -10}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(mixer2_1.Ce1, singularPressureLoss1.C2) annotation( - Line(points = {{46, 20}, {46, 30}, {0, 30}}, smooth = Smooth.None)); - connect(mixer2_1.Cs, sink.C) annotation( - Line(points = {{60, 10}, {80, 10}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(constante.y, splitter2_1.Ialpha1) annotation( - Line(points = {{-59, 50}, {-52, 50}, {-52, 16}, {-45, 16}}, smooth = Smooth.None)); - connect(singularPressureLoss2.C2, loopBreakerP.C1) annotation( - Line(points = {{0, -10}, {10, -10}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(loopBreakerP.C2, mixer2_1.Ce2) annotation( - Line(points = {{30, -10}, {46, -10}, {46, 0}}, color = {0, 0, 255}, smooth = Smooth.None)); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestLoopBreaker; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo deleted file mode 100644 index 4e2cf3e1..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestMassFlowMultiplier.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestMassFlowMultiplier - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{60, 0}, {80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss annotation( - Placement(transformation(extent = {{-60, 0}, {-40, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{20, 0}, {40, 20}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier annotation( - Placement(transformation(extent = {{-20, 0}, {0, 20}}, rotation = 0))); -equation - connect(sourcePQ.C, singularPressureLoss.C1) annotation( - Line(points = {{-80, 10}, {-60, 10}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, sink.C) annotation( - Line(points = {{40, 10}, {60, 10}}, color = {0, 0, 255})); - connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation( - Line(points = {{-40, 10}, {-20, 10}}, color = {0, 0, 255})); - connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation( - Line(points = {{0, 10}, {20, 10}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestMassFlowMultiplier; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo deleted file mode 100644 index 6ff33f55..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestNTUWaterHeater0.mo +++ /dev/null @@ -1,47 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestNTUWaterHeater0 - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_condenseur(P0 = 80.0e5, Q0 = 1780, h0 = 872.0e3) annotation( - Placement(transformation(extent = {{-182, -10}, {-162, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur(C(h(start = 980281.0129225359))) annotation( - Placement(transformation(extent = {{152, -10}, {172, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, P0 = 27.e5, h0 = 2.6e6, C(h_vol_2(start = 883556.9736276601)), Q(start = 112.29047515166533)) annotation( - Placement(transformation(extent = {{-182, 90}, {-162, 110}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(K = 1e-4, C2(P(start = 7999999.633732218))) annotation( - Placement(transformation(extent = {{-106, -10}, {-86, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 1e-4) annotation( - Placement(transformation(extent = {{-106, 90}, {-86, 110}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 annotation( - Placement(transformation(extent = {{152, -106}, {172, -86}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(K = 1e-4, C1(P(start = 7618062.482445708)), rho(start = 834.862478836879)) annotation( - Placement(transformation(extent = {{92, -10}, {112, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(K = 1e-4, rho(start = 857.3159873035071)) annotation( - Placement(transformation(extent = {{34, -106}, {54, -86}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating(lambdaE = 102.5, SCondDes = 6314, KCond = 5024, SPurge = 656, KPurge = 1767, HeiF(start = 878162.3337936474), HDesF(start = 980281.0129225359), Hep(start = 981240.7187349163), Ee(h_vol_2(start = 880000), Q(start = 1800), h(start = 880000), P(start = 80e5)), Ev(h_vol_1(start = 3500000), P(start = 27e5)), Ep(Q(start = 10)), Se(P(start = 80e5)), SDes(start = 1E-09), continuous_flow_reversal = true) annotation( - Placement(transformation(extent = {{-44, -52}, {64, 54}}, rotation = 0))); -equation - connect(Source_condenseur.C, singularPressureLoss2.C1) annotation( - Line(points = {{-162, 0}, {-106, 0}}, color = {0, 0, 255})); - connect(sourceP.C, singularPressureLoss3.C1) annotation( - Line(points = {{-162, 100}, {-106, 100}}, color = {0, 0, 255})); - connect(singularPressureLoss4.C2, Puit_condenseur.C) annotation( - Line(points = {{112, 0}, {152, 0}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C2, Puit_condenseur1.C) annotation( - Line(points = {{54, -96}, {152, -96}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, nTUWaterHeating.Ev) annotation( - Line(points = {{-86, 100}, {42.4, 100}, {42.4, 19.02}}, color = {0, 0, 255})); - connect(nTUWaterHeating.Se, singularPressureLoss4.C1) annotation( - Line(points = {{64, 1}, {68, 1}, {68, 0}, {92, 0}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, nTUWaterHeating.Ee) annotation( - Line(points = {{-86, 0}, {-44, 0}, {-44, 1}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C1, nTUWaterHeating.Sp) annotation( - Line(points = {{34, -96}, {-18, -96}, {-18, -16.49}, {-22.4, -16.49}})); - annotation( - experiment(StopTime = 1000), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestNTUWaterHeater0; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo deleted file mode 100644 index 0ec02fae..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPostCombustionGas.mo +++ /dev/null @@ -1,43 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestPostCombustionGas - import ThermoSysPro; - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 annotation( - Placement(transformation(origin = {151, -6}, extent = {{23, -24}, {-23, 24}}, rotation = 180))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(Xso2 = 0, Xco2 = 0.0, Xo2 = 0.23, Xh2o = 0.01, P0 = 15e5, Q0 = 415, T0 = 680, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true) annotation( - Placement(transformation(extent = {{-174, -30}, {-128, 18}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePQ2(h0 = 300e3, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, Q0 = 10) annotation( - Placement(transformation(extent = {{-172, 68}, {-132, 108}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(Hum = 0, Xo = 0, Xn = 0, Xs = 0, rho = 0.838, Xc = 0.755, Xh = 0.245, Cp = 2255, T0 = 410, Q0 = 9.30, LHV = 47500e3) annotation( - Placement(transformation(extent = {{-107, -109}, {-71, -73}}, rotation = 0))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.PostCombustionGas postCombustionGas annotation( - Placement(transformation(extent = {{-52, -74}, {74, 50}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss annotation( - Placement(transformation(extent = {{-100, 78}, {-80, 98}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{-102, -16}, {-82, 4}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{90, -16}, {110, 4}}))); -equation - connect(sourceCombustible2.C, postCombustionGas.Cfuel) annotation( - Line(points = {{-71, -91}, {-7.9, -91}, {-7.9, -67.8}}, color = {0, 0, 0})); - connect(sourcePQ2.C, singularPressureLoss.C1) annotation( - Line(points = {{-132, 88}, {-100, 88}}, color = {0, 0, 0})); - connect(singularPressureLoss.C2, postCombustionGas.Ca) annotation( - Line(points = {{-80, 88}, {-20.5, 88}, {-20.5, 43.8}}, color = {0, 0, 0})); - connect(Source_Fumees2.C, singularPressureLoss1.C1) annotation( - Line(points = {{-128, -6}, {-102, -6}}, color = {0, 0, 0})); - connect(singularPressureLoss1.C2, postCombustionGas.Cfg1) annotation( - Line(points = {{-82, -6}, {-64, -6}, {-64, -5.8}, {-45.7, -5.8}}, color = {0, 0, 0})); - connect(postCombustionGas.Cfg2, singularPressureLoss2.C1) annotation( - Line(points = {{67.7, -5.8}, {79.85, -5.8}, {79.85, -6}, {90, -6}}, color = {0, 0, 0})); - connect(singularPressureLoss2.C2, Puits_Fumees2.C) annotation( - Line(points = {{110, -6}, {128, -6}}, color = {0, 0, 0})); - annotation( - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}}, initialScale = 0.1)), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestPostCombustionGas; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo deleted file mode 100644 index 102efb03..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestPressurizer.mo +++ /dev/null @@ -1,58 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestPressurizer - parameter Units.SI.Power Wch(fixed = false) = 0.29e6 "Power released by the electrical heaters"; - parameter Real OUVfeedwaterValve(fixed = false) = 0.01 "OUV feed water valve"; - ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(Cv(start = 100), C1(P(start = 160e5), h_vol_1(start = 1270e3), Q(start = 0.3), h(start = 1270e3)), Q(fixed = false, start = 0.32), Cvmax = 5000) annotation( - Placement(transformation(extent = {{-110, 130}, {-90, 150}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(Cv(start = 25000), Cvmax(fixed = true) = 5000, Pm(start = 15500000)) annotation( - Placement(transformation(extent = {{58, 130}, {78, 150}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvFeedwaterValve1(k = OUVfeedwaterValve) annotation( - Placement(transformation(extent = {{-140, 176}, {-120, 196}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(L = 1, D = 1, z1 = 1, z2 = 0, C1(P(start = 160e5)), C2(P(start = 160e5)), Q(fixed = false, start = 0)) annotation( - Placement(transformation(origin = {-30, -42}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante OuvSteamrValve(k(fixed = true) = 0.5) annotation( - Placement(transformation(extent = {{0, 176}, {20, 196}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 1270e3, P0 = 160e5) annotation( - Placement(transformation(extent = {{-168, 124}, {-148, 144}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0 = 0, h0 = 3e6) annotation( - Placement(transformation(extent = {{106, 124}, {126, 144}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer(Zm = 10.15, Klv = 0.5e6, cpp = 600, hl(start = 1629887.98290107), hv(start = 2596216.59571565), Zl(start = 5.5900717167325), Yw0 = 60, V = 61.12, Rp = 1.27, Ae = 96.23, Klp = 1780, Kvp = 7500, Mp = 107e3, Kpa = 5.63, Ccond = 0.02, Cevap = 0.05, Yw(start = 32.92), y(start = 0.3292, fixed = true), P0 = 15500000, P(start = 15500000, fixed = true), Tp(start = 617.94155291055)) annotation( - Placement(transformation(extent = {{-92, -12}, {32, 118}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(Q0 = 0, h0 = 1600000) annotation( - Placement(transformation(extent = {{-30, -76}, {-10, -56}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(option_temperature = 2, T0 = {310}, W0 = {Wch}) annotation( - Placement(transformation(origin = {-133, 32}, extent = {{-17, 17}, {17, -17}}, rotation = 270))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC2(T0 = {310}, W0 = {0.286e6}, option_temperature = 1) annotation( - Placement(transformation(origin = {-133, 55}, extent = {{-17, 17}, {17, -17}}, rotation = 270))); -equation - connect(sourceP.C, FeedwaterValve.C1) annotation( - Line(points = {{-148, 134}, {-110, 134}}, color = {0, 0, 255})); - connect(SteamValve.C2, sinkQ.C) annotation( - Line(points = {{78, 134}, {106, 134}}, color = {0, 0, 255})); - connect(OuvSteamrValve.y, SteamValve.Ouv) annotation( - Line(points = {{21, 186}, {68, 186}, {68, 151}})); - connect(FeedwaterValve.C2, pressurizer.Cas) annotation( - Line(points = {{-90, 134}, {-30, 134}, {-30, 118}}, color = {0, 0, 255})); - connect(pressurizer.Cs, SteamValve.C1) annotation( - Line(points = {{32, 116.7}, {32, 134}, {58, 134}}, color = {0, 0, 255})); - connect(sinkQ1.C, lumpedStraightPipe.C2) annotation( - Line(points = {{-30, -66}, {-30, -52}})); - connect(lumpedStraightPipe.C1, pressurizer.Cex) annotation( - Line(points = {{-30, -32}, {-30, -12}})); - connect(SourceC2.C[1], pressurizer.Ca) annotation( - Line(points = {{-116.34, 55}, {-103.17, 55}, {-103.17, 54.3}, {-85.8, 54.3}}, color = {191, 95, 0})); - connect(SourceC1.C[1], pressurizer.Cc) annotation( - Line(points = {{-116.34, 32}, {-73.17, 32}, {-73.17, 32.2}, {-30, 32.2}}, color = {191, 95, 0})); - connect(OuvFeedwaterValve1.y, FeedwaterValve.Ouv) annotation( - Line(points = {{-119, 186}, {-100, 186}, {-100, 151}}, color = {0, 0, 255})); - annotation( - Window(x = 0.43, y = 0, width = 0.57, height = 0.63), - Diagram(graphics, coordinateSystem(preserveAspectRatio = false, extent = {{-200, -100}, {140, 200}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - experiment(StopTime = 1000)); -end TestPressurizer; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo deleted file mode 100644 index a0831290..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP.mo +++ /dev/null @@ -1,44 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestRefP - ThermoSysPro.Fluid.BoundaryConditions.RefP refP annotation( - Placement(transformation(extent = {{-90, 0}, {-70, 20}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k = 2.e5) annotation( - Placement(transformation(extent = {{-100, 60}, {-80, 80}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump annotation( - Placement(transformation(extent = {{-30, 0}, {-10, 20}}, rotation = 0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ annotation( - Placement(transformation(extent = {{0, 0}, {20, 20}}, rotation = 0))); - ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH annotation( - Placement(transformation(extent = {{30, 0}, {50, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefT refT annotation( - Placement(transformation(extent = {{-60, 0}, {-40, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation( - Placement(transformation(extent = {{60, 0}, {80, 20}}, rotation = 0))); - Volumes.VolumeA volumeA(dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{10, -30}, {-10, -10}}))); -equation - connect(refP.C2, refT.C1) annotation( - Line(points = {{-70, 10}, {-60, 10}}, color = {0, 0, 255})); - connect(refT.C2, pump.C1) annotation( - Line(points = {{-40, 10}, {-30, 10}}, color = {0, 0, 255})); - connect(constante.y, refP.IPressure) annotation( - Line(points = {{-79, 70}, {-60, 70}, {-60, 34}, {-80, 34}, {-80, 21}})); - connect(pump.C2, loopBreakerQ.C1) annotation( - Line(points = {{-10, 10}, {0, 10}}, color = {0, 0, 255})); - connect(loopBreakerQ.C2, loopBreakerH.C1) annotation( - Line(points = {{20, 10}, {30, 10}}, color = {0, 0, 255})); - connect(loopBreakerH.C2, lumpedStraightPipe.C1) annotation( - Line(points = {{50, 10}, {60, 10}}, color = {0, 0, 255})); - connect(lumpedStraightPipe.C2, volumeA.Ce1) annotation( - Line(points = {{80, 10}, {100, 10}, {100, -20}, {10, -20}}, color = {0, 0, 0})); - connect(volumeA.Cs1, refP.C1) annotation( - Line(points = {{-10, -20}, {-100, -20}, {-100, 10}, {-90, 10}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestRefP; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo deleted file mode 100644 index e607d33b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestRefP1.mo +++ /dev/null @@ -1,38 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestRefP1 - ThermoSysPro.Fluid.BoundaryConditions.RefP refP annotation( - Placement(transformation(extent = {{-70, 0}, {-50, 20}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k = 2.e5) annotation( - Placement(transformation(extent = {{-100, 60}, {-80, 80}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump pump annotation( - Placement(transformation(extent = {{0, 0}, {20, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation( - Placement(transformation(extent = {{40, 0}, {60, 20}}, rotation = 0))); - BoundaryConditions.Source source annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}))); - BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{80, 0}, {100, 20}}))); - BoundaryConditions.RefQ refQ annotation( - Placement(transformation(extent = {{-40, 0}, {-20, 20}}))); -equation - connect(constante.y, refP.IPressure) annotation( - Line(points = {{-79, 70}, {-60, 70}, {-60, 21}})); - connect(source.C, refP.C1) annotation( - Line(points = {{-80, 10}, {-70, 10}}, color = {0, 0, 0})); - connect(lumpedStraightPipe.C2, sink.C) annotation( - Line(points = {{60, 10}, {80, 10}}, color = {0, 0, 0})); - connect(pump.C2, lumpedStraightPipe.C1) annotation( - Line(points = {{20, 10}, {40, 10}}, color = {0, 0, 0})); - connect(refP.C2, refQ.C1) annotation( - Line(points = {{-50, 10}, {-40, 10}}, color = {0, 0, 0})); - connect(pump.C1, refQ.C2) annotation( - Line(points = {{0, 10}, {-20, 10}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestRefP1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo deleted file mode 100644 index 17a3f3cf..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSensors.mo +++ /dev/null @@ -1,43 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSensors - ThermoSysPro.Fluid.Sensors.SensorH specificEnthalpySensor annotation( - Placement(transformation(extent = {{-60, 8}, {-40, 28}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQ massFlowSensor annotation( - Placement(transformation(extent = {{-20, 8}, {0, 28}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQv volumetricFlowSensor annotation( - Placement(transformation(extent = {{20, 8}, {40, 28}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorP pressureSensor annotation( - Placement(transformation(extent = {{-60, -32}, {-40, -12}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor annotation( - Placement(transformation(extent = {{-20, -32}, {0, -12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP annotation( - Placement(transformation(extent = {{60, -40}, {80, -20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP annotation( - Placement(transformation(extent = {{20, -40}, {40, -20}}, rotation = 0))); -equation - connect(sourceP.C, specificEnthalpySensor.C1) annotation( - Line(points = {{-80, 10}, {-60, 10}}, color = {0, 0, 255})); - connect(specificEnthalpySensor.C2, massFlowSensor.C1) annotation( - Line(points = {{-39.8, 10}, {-20, 10}}, color = {0, 0, 255})); - connect(massFlowSensor.C2, volumetricFlowSensor.C1) annotation( - Line(points = {{0.2, 10}, {20, 10}}, color = {0, 0, 255})); - connect(volumetricFlowSensor.C2, pressureSensor.C1) annotation( - Line(points = {{40.2, 10}, {60, 10}, {60, 0}, {-80, 0}, {-80, -30}, {-60, -30}}, color = {0, 0, 255})); - connect(pressureSensor.C2, temperatureSensor.C1) annotation( - Line(points = {{-39.8, -30}, {-20, -30}}, color = {0, 0, 255})); - connect(temperatureSensor.C2, perteDP.C1) annotation( - Line(points = {{0.2, -30}, {20, -30}}, color = {0, 0, 255})); - connect(perteDP.C2, puitsP.C) annotation( - Line(points = {{40, -30}, {60, -30}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSensors; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo deleted file mode 100644 index dfb6fef9..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser.mo +++ /dev/null @@ -1,52 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSimpleDynamicCondenser - parameter Real L1 = 425 "Longueur de la première chaine de capteurs"; - parameter Integer Ns1 = 80 "Nombre de mailles de la première chaine de capteurs"; - parameter Real L2 = 75 "Longueur de la deuxième chaine de capteurs"; - parameter Integer Ns2 = 1 "Nombre de mailles de la deuxième chaine de capteurs"; - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, option_temperature = false) annotation( - Placement(transformation(extent = {{48, 30}, {88, 70}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(K = 1e-6, Q(start = 0.598447), C1(P(start = 9035.18437098087)), rho(start = 990.6632738884383)) annotation( - Placement(transformation(origin = {-90, -38}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau(option_temperature = false, h0 = 2401e3, P0 = 15050) annotation( - Placement(transformation(extent = {{-207, 148}, {-183, 170}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau(h0 = 191812, Q0(start = 192, fixed = false)) annotation( - Placement(transformation(extent = {{-184, -52}, {-208, -24}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0 = 29804.5, h0 = 113e3) annotation( - Placement(transformation(extent = {{-212, 30}, {-172, 68}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(K = 1e-6, rho(start = 995.5397398431962)) annotation( - Placement(transformation(origin = {36, 50}, extent = {{6, -10}, {-6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(K = 1e-6, rho(start = 996.552939890412)) annotation( - Placement(transformation(origin = {-154, 49}, extent = {{6, -10}, {-6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(K(fixed = false) = 1e-3, Q(start = 192, fixed = true)) annotation( - Placement(transformation(origin = {-120, 159}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(D = 0.018, V = 1000, A = 100, lambda = 0.01, ntubes = 28700, yNiveau(signal(fixed = false, start = 1.5)), Vf0 = 0.15, Vl(start = 500, fixed = true), P(fixed = false, start = 9035.18437098087), hl(start = 183576.8570917718), hv(start = 187278.68509678004), proe(d(start = 996.0593559031695))) annotation( - Placement(transformation(extent = {{-118, 6}, {1, 116}}, rotation = 0))); -equation - connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation( - Line(points = {{-172, 49}, {-160, 49}}, color = {0, 0, 255})); - connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation( - Line(points = {{42, 50}, {48, 50}}, color = {0, 0, 255})); - connect(SourceRechauffeurEau.C, PerteChargeCondPompe3.C1) annotation( - Line(points = {{-183, 159}, {-130, 159}}, color = {0, 0, 255})); - connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation( - Line(points = {{-184, -38}, {-100, -38}})); - connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation( - Line(points = {{-148, 49}, {-133, 49}, {-133, 48.9}, {-118, 48.9}}, color = {0, 0, 255})); - connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation( - Line(points = {{-80, -38}, {-57.31, -38}, {-57.31, 6}})); - connect(PerteChargeCondPompe3.C2, Condenseur.Cv) annotation( - Line(points = {{-110, 159}, {-58.5, 159}, {-58.5, 116}}, color = {0, 0, 255})); - connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation( - Line(points = {{30, 50}, {15.5, 50}, {15.5, 50}, {1, 50}})); - annotation( - Window(x = 0.43, y = 0, width = 0.57, height = 0.63), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-250, -60}, {130, 180}}, grid = {2, 2}, initialScale = 0.1)), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - experiment(StopTime = 1000)); -end TestSimpleDynamicCondenser; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo deleted file mode 100644 index f0911e1e..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleDynamicCondenser1.mo +++ /dev/null @@ -1,41 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSimpleDynamicCondenser1 - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(Pm(displayUnit = "Pa", start = 355000.00000015664), Q(fixed = false), hn(fixed = false, start = 71.08245675235786), p_rho(displayUnit = "kg/m3"), rho(displayUnit = "kg/m3"), a1(start = -88.67, fixed = false), C2(h(start = 195297.69906611618), h_vol_1(start = 195297.69906611618)), Qv(start = 0.009081311621074862), h(start = 193554.9971298399), C1(P(start = 10000.0))) annotation( - Placement(visible = true, transformation(origin = {-10, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Pe(displayUnit = "Pa", fixed = true, start = 700000), Ps(displayUnit = "Pa", fixed = false), W_fric = 0, eta_is(fixed = false), eta_is_wet(fixed = false), rhos(displayUnit = "kg/m3", fixed = false), xm(fixed = false, start = 0.9856238368898451), proe(x(start = 1, fixed = true)), Ce(h_vol_2(start = 3128840.013040668), h(start = 3128840.0130323363)), pros(d(start = 0.07018147245152216))) annotation( - Placement(visible = true, transformation(origin = {-10, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 100, D = 0.018, dynamic_energy_balance = true, P(fixed = false, start = 10000), P0(displayUnit = "Pa") = 1000, V = 1000, continuous_flow_reversal = true, lambda = 0.01, ntubes = 28700, rhol(displayUnit = "kg/m3"), rhom(displayUnit = "kg/m3"), rhov(displayUnit = "kg/m3"), yNiveau(signal(fixed = false, start = 1.5)), steady_state = false, proe(d(start = 0.7468807684211932))) annotation( - Placement(visible = true, transformation(origin = {40.5, -1}, extent = {{-20.5, -16}, {20.5, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, T0 = 373.05, option_temperature = true) annotation( - Placement(visible = true, transformation(origin = {85, -1}, extent = {{-11, -12}, {11, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0 = 5, h0 = 113e3) annotation( - Placement(visible = true, transformation(origin = {-24, -1}, extent = {{-10, -9}, {10, 9}}, rotation = 0))); - Volumes.VolumeATh volumeA(P(start = 70e5), h(start = 2.e6), dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-70, 10}, {-50, -10}}))); - Thermal.BoundaryConditions.HeatSource heatSource(W0(start = {2e6}, each fixed = false), option_temperature = 2) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {-88, 12}))); -equation - connect(Condenseur.Cv, stodolaTurbine.Cs) annotation( - Line(points = {{40.5, 15}, {40.5, 60}, {0.1, 60}}, color = {0, 0, 255})); - connect(Condenseur.Cse, puitsPCaloporteur.C) annotation( - Line(points = {{61, -4.2}, {62, -4.2}, {62, -1}, {74, -1}}, color = {0, 0, 255})); - connect(sourcePCaloporteur.C, Condenseur.Cee) annotation( - Line(points = {{-14, -1}, {-9, -1}, {-9, -4.52}, {20, -4.52}}, color = {0, 0, 255})); - connect(Condenseur.Cl, staticCentrifugalPump.C1) annotation( - Line(points = {{40.91, -17}, {40, -17}, {40, -60}, {0, -60}}, color = {28, 108, 200})); - connect(staticCentrifugalPump.C2, volumeA.Ce2) annotation( - Line(points = {{-20, -60}, {-60, -60}, {-60, -10}}, color = {28, 108, 200})); - connect(volumeA.Cs2, stodolaTurbine.Ce) annotation( - Line(points = {{-60, 10}, {-60, 60}, {-20.1, 60}}, color = {28, 108, 200})); - connect(heatSource.C[1], volumeA.Cth) annotation( - Line(points = {{-78.2, 12}, {-64, 12}, {-64, 0}, {-60, 0}}, color = {0, 0, 0})); - annotation( - Diagram(graphics = {Text(extent = {{-94, 34}, {-64, 24}}, lineColor = {28, 108, 200}, textString = "W: free"), Text(extent = {{-26, -38}, {8, -48}}, lineColor = {28, 108, 200}, textString = "a1: free"), Text(extent = {{-28, 94}, {8, 84}}, lineColor = {28, 108, 200}, textString = "Pe: fixed"), Text(extent = {{-28, 84}, {10, 72}}, lineColor = {28, 108, 200}, textString = "proe.x: fixed")}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - experiment(StopTime = 1000, __Dymola_Algorithm = "Dassl")); -end TestSimpleDynamicCondenser1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo deleted file mode 100644 index f79ee39c..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleEvaporatorWaterSteamFlueGases.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSimpleEvaporatorWaterSteamFlueGases - ThermoSysPro.Fluid.BoundaryConditions.Sink puits_Eau annotation( - Placement(transformation(extent = {{64, -17}, {84, 3}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases EchangeurEfficacite(Kdpf = 1, Kdpe = 1) annotation( - Placement(transformation(extent = {{-44, -35}, {44, 21}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source_Eau(Q0 = 38.92/3.6, h0 = 1242080, P0 = 6527000) annotation( - Placement(transformation(extent = {{-84, -17}, {-64, 3}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees(Xso2 = 0, Q0 = 86.7429, Xco2 = 0.04725, Xh2o = 0.051874, Xo2 = 0.15011, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 101000, T0 = 750.54, option_temperature = true) annotation( - Placement(transformation(extent = {{-34, 45}, {0, 75}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees annotation( - Placement(transformation(origin = {16, -70}, extent = {{16, -15}, {-16, 15}}, rotation = 180))); -equation - connect(Source_Fumees.C, EchangeurEfficacite.Cfg1) annotation( - Line(points = {{0, 60}, {0, 18.2}}, color = {0, 0, 0}, thickness = 1)); - connect(EchangeurEfficacite.Cfg2, Puits_Fumees.C) annotation( - Line(points = {{0, -32.2}, {0, -70}, {0, -70}}, color = {0, 0, 0}, thickness = 1)); - connect(EchangeurEfficacite.Cws2, puits_Eau.C) annotation( - Line(points = {{44, -7}, {54, -7}, {54, -7}, {64, -7}}, color = {0, 0, 255})); - connect(EchangeurEfficacite.Cws1, source_Eau.C) annotation( - Line(points = {{-44, -7}, {-54, -7}, {-54, -7}, {-64, -7}})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSimpleEvaporatorWaterSteamFlueGases; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo deleted file mode 100644 index d05b312b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSimpleStaticCondenser.mo +++ /dev/null @@ -1,31 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSimpleStaticCondenser - ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser simpleStaticCondenser(Ec(h(start = 532983.7176868258)), Ef(h(start = 71016.12237181116)), Qc(start = 1049.6385508765125), Qf(start = 4469.84281279143), Sf(h(start = 64330.208038325145))) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(T0 = 400) annotation( - Placement(transformation(extent = {{-60, -20}, {-40, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1 annotation( - Placement(transformation(extent = {{20, -20}, {40, 0}}, rotation = 0))); -equation - connect(sourceP.C, simpleStaticCondenser.Ef) annotation( - Line(points = {{-40, 30}, {-20, 30}}, color = {0, 0, 255})); - connect(sourceP1.C, simpleStaticCondenser.Ec) annotation( - Line(points = {{-40, -10}, {-16, -10}, {-16, 20}}, color = {0, 0, 255})); - connect(simpleStaticCondenser.Sf, sinkP.C) annotation( - Line(points = {{0, 29.9}, {10, 29.9}, {10, 30}, {20, 30}}, color = {0, 0, 255})); - connect(simpleStaticCondenser.Sc, sinkP1.C) annotation( - Line(points = {{-4, 20}, {-4, -10}, {20, -10}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSimpleStaticCondenser; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo deleted file mode 100644 index c3cbd88f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSingularPressureLoss.mo +++ /dev/null @@ -1,24 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSingularPressureLoss - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(fluid = 1) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); -equation - connect(singularPressureLoss.C2, PuitsP1.C) annotation( - Line(points = {{0, 30}, {60, 30}}, color = {0, 0, 255})); - connect(SourceP1.C, singularPressureLoss.C1) annotation( - Line(points = {{-80, 30}, {-20, 30}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.45, y = 0.01, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSingularPressureLoss; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo deleted file mode 100644 index 644c5aa6..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticAerocondenser.mo +++ /dev/null @@ -1,49 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticAerocondenser - parameter Units.SI.AbsolutePressure Pin_1 = 20000 "Flow pressure at inlet 1 (sourceP)"; - parameter Units.SI.AbsolutePressure Pin_2 = 20000 "Flow pressure at inlet 3 (sourceP2)"; - BoundaryConditions.SourcePQ Source_condenseur(Q0(fixed = true) = 4000, h0 = 15e3, option_temperature = true, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 100000, T0 = 287.15) annotation( - Placement(transformation(extent = {{190, -90}, {170, -70}}, rotation = 0))); - BoundaryConditions.Sink Puit_condenseur annotation( - Placement(transformation(extent = {{170, 90}, {190, 110}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 2.5817e6, C(Q(fixed = false, start = 100)), P0 = Pin_1) annotation( - Placement(transformation(extent = {{-100, 90}, {-80, 110}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(option_temperature = false, h0 = 2.5055e6, C(Q(fixed = false, start = 1e-5)), P0 = Pin_2) annotation( - Placement(transformation(extent = {{-182, -40}, {-162, -20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 10) annotation( - Placement(transformation(extent = {{-120, -40}, {-100, -20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 10) annotation( - Placement(transformation(extent = {{-38, 90}, {-18, 110}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 annotation( - Placement(transformation(extent = {{-100, -90}, {-120, -70}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(K = 1e-4) annotation( - Placement(transformation(extent = {{-40, -90}, {-60, -70}}, rotation = 0))); - Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser annotation( - Placement(transformation(extent = {{-64, -44}, {66, 70}}))); -equation - connect(sourceP2.C, singularPressureLoss1.C1) annotation( - Line(points = {{-162, -30}, {-120, -30}}, color = {0, 0, 255})); - connect(sourceP.C, singularPressureLoss3.C1) annotation( - Line(points = {{-80, 100}, {-38, 100}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, staticAerocondenser.Cw) annotation( - Line(points = {{-100, -30}, {-70, -30}, {-70, -29.75}, {-58.5833, -29.75}}, color = {0, 0, 0})); - connect(singularPressureLoss3.C2, staticAerocondenser.Cws1) annotation( - Line(points = {{-18, 100}, {1, 100}, {1, 65.25}}, color = {0, 0, 0})); - connect(Puit_condenseur1.C, singularPressureLoss5.C2) annotation( - Line(points = {{-100, -80}, {-60, -80}}, color = {0, 0, 0})); - connect(singularPressureLoss5.C1, staticAerocondenser.Cws2) annotation( - Line(points = {{-40, -80}, {1, -80}, {1, -39.25}}, color = {0, 0, 0})); - connect(Source_condenseur.C, staticAerocondenser.Cair1) annotation( - Line(points = {{170, -80}, {60.5833, -80}, {60.5833, -38.775}}, color = {0, 0, 0})); - connect(Puit_condenseur.C, staticAerocondenser.Cair2) annotation( - Line(points = {{170, 100}, {60.5833, 100}, {60.5833, 65.25}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticAerocondenser; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo deleted file mode 100644 index 744e6d1c..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCentrifugalPump1.mo +++ /dev/null @@ -1,24 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticCentrifugalPump1 - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1(fixed_rot_or_power = 2, MPower = 0.15e6) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0 = 600000) annotation( - Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); -equation - connect(sourceP.C, StaticCentrifugalPump1.C1) annotation( - Line(points = {{-60, 30}, {-20, 30}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(StaticCentrifugalPump1.C2, sinkP.C) annotation( - Line(points = {{0, 30}, {40, 30}}, color = {0, 0, 255}, smooth = Smooth.None)); - annotation( - experiment(StopTime = 1000), - Window(x = 0.32, y = 0.02, width = 0.39, height = 0.47), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticCentrifugalPump1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo deleted file mode 100644 index ac4def00..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenser.mo +++ /dev/null @@ -1,66 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticCondenser - parameter Units.SI.AbsolutePressure Pin_1(fixed = false, start = 20000) "Flow pressure at inlet 1 (sourceP)"; - parameter Units.SI.AbsolutePressure Pin_2(fixed = false, start = 20000) "Flow pressure at inlet 2 (sourceP1)"; - parameter Units.SI.AbsolutePressure Pin_3(fixed = false, start = 20000) "Flow pressure at inlet 3 (sourceP2)"; - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(h0 = 60e3, Q0(fixed = true) = 4000) annotation( - Placement(transformation(extent = {{-180, 0}, {-160, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur annotation( - Placement(transformation(extent = {{160, 0}, {180, 20}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur(CPCE = 0, KCO = 100, QC0 = 200, z = 5, SCO = 15e3, Qee(start = 4000, fixed = false), Pcond(fixed = false, start = 2154.77)) annotation( - Placement(transformation(extent = {{-20, -16}, {72, 82}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 2.5817e6, C(Q(fixed = true, start = 100)), P0 = Pin_1) annotation( - Placement(transformation(extent = {{-100, 140}, {-80, 160}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(option_temperature = false, h0 = 2.5481e6, C(Q(fixed = true, start = 1e-5)), P0 = Pin_2) annotation( - Placement(transformation(extent = {{-182, 80}, {-162, 100}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(option_temperature = false, h0 = 2.5055e6, C(Q(fixed = true, start = 1e-5)), P0 = Pin_3) annotation( - Placement(transformation(extent = {{-180, 40}, {-160, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 10) annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 10) annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(K = 1e-4) annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 10) annotation( - Placement(transformation(extent = {{-40, 140}, {-20, 160}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 annotation( - Placement(transformation(extent = {{100, -100}, {120, -80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(K = 1e-4) annotation( - Placement(transformation(extent = {{100, 0}, {120, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(K = 1e-4) annotation( - Placement(transformation(extent = {{40, -100}, {60, -80}}, rotation = 0))); -equation - connect(sourceP1.C, singularPressureLoss.C1) annotation( - Line(points = {{-162, 90}, {-100, 90}}, color = {0, 0, 255})); - connect(singularPressureLoss.C2, condenseur.Cev) annotation( - Line(points = {{-80, 90}, {-50, 90}, {-50, 62.89}, {-20, 62.89}}, color = {0, 0, 255})); - connect(sourceP2.C, singularPressureLoss1.C1) annotation( - Line(points = {{-160, 50}, {-100, 50}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, condenseur.Cep) annotation( - Line(points = {{-80, 50}, {-52, 50}, {-52, 42.31}, {-20, 42.31}}, color = {0, 0, 255})); - connect(Source_condenseur.C, singularPressureLoss2.C1) annotation( - Line(points = {{-160, 10}, {-100, 10}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, condenseur.Cee) annotation( - Line(points = {{-80, 10}, {-52, 10}, {-52, 3.11}, {-20, 3.11}}, color = {0, 0, 255})); - connect(sourceP.C, singularPressureLoss3.C1) annotation( - Line(points = {{-80, 150}, {-40, 150}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, condenseur.Cvt) annotation( - Line(points = {{-20, 150}, {26, 150}, {26, 82.49}}, color = {0, 0, 255})); - connect(singularPressureLoss4.C2, Puit_condenseur.C) annotation( - Line(points = {{120, 10}, {160, 10}}, color = {0, 0, 255})); - connect(condenseur.Cse, singularPressureLoss4.C1) annotation( - Line(points = {{72.92, 3.11}, {86, 3.11}, {86, 10}, {100, 10}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C2, Puit_condenseur1.C) annotation( - Line(points = {{60, -90}, {100, -90}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C1, condenseur.Cex) annotation( - Line(points = {{40, -90}, {26.46, -90}, {26.46, -16}})); - annotation( - experiment(StopTime = 1000), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticCondenser; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo deleted file mode 100644 index 9d7e60a2..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticCondenserHEI.mo +++ /dev/null @@ -1,66 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticCondenserHEI - parameter Units.SI.AbsolutePressure Pin_1(fixed = false, start = 179979.0023433965) "Flow pressure at inlet 1 (sourceP)"; - parameter Units.SI.AbsolutePressure Pin_2(fixed = false, start = 4691.365030963762) "Flow pressure at inlet 2 (sourceP1)"; - parameter Units.SI.AbsolutePressure Pin_3(fixed = false, start = 4691.365030911197) "Flow pressure at inlet 3 (sourceP2)"; - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(h0 = 60e3, Q0(fixed = true) = 4000) annotation( - Placement(transformation(extent = {{-180, 0}, {-160, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(C(h(start = 121216.39257552983))) annotation( - Placement(transformation(extent = {{160, 0}, {180, 20}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.StaticCondenserHEI condenseur(Kf = 0, z1c = 5, Cee(Q(start = 4000, fixed = false)), Pcond(fixed = false, start = 2154.77), DPf(start = -7.816453667652961E-26), Wcut_off(start = 116804805.25936648), procs(d(start = 9.50351941496327))) annotation( - Placement(transformation(extent = {{-20, -16}, {72, 82}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 2.5817e6, C(Q(fixed = true, start = 100)), P0 = Pin_1) annotation( - Placement(transformation(extent = {{-100, 140}, {-80, 160}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(option_temperature = false, h0 = 2.5481e6, C(Q(fixed = true, start = 1e-5)), P0 = Pin_2) annotation( - Placement(transformation(extent = {{-182, 80}, {-162, 100}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(option_temperature = false, h0 = 2.5055e6, C(Q(fixed = true, start = 1e-5)), P0 = Pin_3) annotation( - Placement(transformation(extent = {{-180, 40}, {-160, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 10) annotation( - Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 10) annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(K = 1e-4, rho(start = 999.2051327991054)) annotation( - Placement(transformation(extent = {{-100, 0}, {-80, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 10) annotation( - Placement(transformation(extent = {{-40, 140}, {-20, 160}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 annotation( - Placement(transformation(extent = {{100, -100}, {120, -80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(K = 1e-4, rho(start = 995.9727926518547)) annotation( - Placement(transformation(extent = {{100, 0}, {120, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(K = 1e-4, rho(start = 9.502298036944223)) annotation( - Placement(transformation(extent = {{40, -100}, {60, -80}}, rotation = 0))); -equation - connect(sourceP1.C, singularPressureLoss.C1) annotation( - Line(points = {{-162, 90}, {-100, 90}}, color = {0, 0, 255})); - connect(singularPressureLoss.C2, condenseur.Cev) annotation( - Line(points = {{-80, 90}, {-50, 90}, {-50, 62.89}, {-20, 62.89}}, color = {0, 0, 255})); - connect(sourceP2.C, singularPressureLoss1.C1) annotation( - Line(points = {{-160, 50}, {-100, 50}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, condenseur.Cep) annotation( - Line(points = {{-80, 50}, {-52, 50}, {-52, 42.31}, {-20, 42.31}}, color = {0, 0, 255})); - connect(Source_condenseur.C, singularPressureLoss2.C1) annotation( - Line(points = {{-160, 10}, {-100, 10}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, condenseur.Cee) annotation( - Line(points = {{-80, 10}, {-52, 10}, {-52, 3.11}, {-20, 3.11}}, color = {0, 0, 255})); - connect(sourceP.C, singularPressureLoss3.C1) annotation( - Line(points = {{-80, 150}, {-40, 150}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, condenseur.Cvt) annotation( - Line(points = {{-20, 150}, {26, 150}, {26, 82.49}}, color = {0, 0, 255})); - connect(singularPressureLoss4.C2, Puit_condenseur.C) annotation( - Line(points = {{120, 10}, {160, 10}}, color = {0, 0, 255})); - connect(condenseur.Cse, singularPressureLoss4.C1) annotation( - Line(points = {{72.92, 3.11}, {86, 3.11}, {86, 10}, {100, 10}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C2, Puit_condenseur1.C) annotation( - Line(points = {{60, -90}, {100, -90}}, color = {0, 0, 255})); - connect(singularPressureLoss5.C1, condenseur.Cex) annotation( - Line(points = {{40, -90}, {26.46, -90}, {26.46, -16}})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics, coordinateSystem(preserveAspectRatio = false, extent = {{-200, -200}, {200, 200}})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticCondenserHEI; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo deleted file mode 100644 index d5343042..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum1.mo +++ /dev/null @@ -1,62 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticDrum1 - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 annotation( - Placement(transformation(extent = {{-54, 0}, {-34, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(K = 1e-4) annotation( - Placement(transformation(extent = {{0, -10}, {20, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(K = 1e-4) annotation( - Placement(transformation(extent = {{-80, -50}, {-60, -30}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0 = 10) annotation( - Placement(transformation(extent = {{40, -10}, {60, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT annotation( - Placement(transformation(extent = {{40, -82}, {60, -62}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(option_temperature = 2, W0 = {2.4e8}, T0 = {290}) annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(K = 1e-4) annotation( - Placement(transformation(extent = {{-20, 50}, {0, 70}}, rotation = 0))); - BoundaryConditions.PlugB sinkP2 annotation( - Placement(transformation(extent = {{60, 50}, {80, 70}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT1 annotation( - Placement(transformation(extent = {{20, 58}, {40, 78}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefP refP(P0 = 3e5) annotation( - Placement(transformation(extent = {{-26, -90}, {-6, -70}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0 = 100) annotation( - Placement(transformation(extent = {{-56, -90}, {-36, -70}}, rotation = 0))); - BoundaryConditions.PlugA sourcePlug(C(h(fixed = true))) annotation( - Placement(transformation(extent = {{-90, -90}, {-70, -70}}, rotation = 0))); - BoundaryConditions.RefXgas refXgas annotation( - Placement(transformation(extent = {{8, -90}, {28, -70}}))); -equation - connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation( - Line(points = {{-60, -40}, {-60, 0.6}, {-48, 0.6}}, color = {0, 0, 255})); - connect(singularPressureLossVALI1.C2, sinkP1.C) annotation( - Line(points = {{20, 0}, {40, 0}}, color = {0, 0, 255})); - connect(sensorT.C2, singularPressureLossVALI2.C1) annotation( - Line(points = {{60.2, -80}, {80, -80}, {80, -60}, {-80, -60}, {-80, -40}}, color = {0, 0, 255})); - connect(heatSource.C[1], StaticDrumTh1.Cth) annotation( - Line(points = {{-70, 20.2}, {-70, 10}, {-44, 10}}, color = {191, 95, 0})); - connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation( - Line(points = {{-34.6, 6.6}, {-19.3, 6.6}, {-19.3, 0}, {0, 0}}, color = {0, 0, 255})); - connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation( - Line(points = {{-40.2, 19.4}, {-40.2, 60}, {-20, 60}}, color = {0, 0, 255})); - connect(singularPressureLossVALI3.C2, sensorT1.C1) annotation( - Line(points = {{0, 60}, {20, 60}}, color = {0, 0, 255})); - connect(sensorT1.C2, sinkP2.C) annotation( - Line(points = {{40.2, 60}, {60, 60}}, color = {0, 0, 255})); - connect(refQ.C2, refP.C1) annotation( - Line(points = {{-36, -80}, {-26, -80}}, color = {0, 0, 255})); - connect(sourcePlug.C, refQ.C1) annotation( - Line(points = {{-70, -80}, {-56, -80}}, color = {0, 0, 255})); - connect(refP.C2, refXgas.C1) annotation( - Line(points = {{-6, -80}, {8, -80}}, color = {0, 0, 0})); - connect(refXgas.C2, sensorT.C1) annotation( - Line(points = {{28, -80}, {40, -80}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticDrum1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo deleted file mode 100644 index ccc1398a..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticDrum2.mo +++ /dev/null @@ -1,51 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticDrum2 - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 annotation( - Placement(transformation(extent = {{-54, 0}, {-34, 20}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(K = 1e-4) annotation( - Placement(transformation(extent = {{0, -10}, {20, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(K = 1e-4) annotation( - Placement(transformation(extent = {{-80, -50}, {-60, -30}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(Q0 = 10) annotation( - Placement(transformation(extent = {{40, -10}, {60, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT annotation( - Placement(transformation(extent = {{-40, -82}, {-20, -62}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(P0 = 100e5) annotation( - Placement(transformation(extent = {{-90, -90}, {-70, -70}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(K = 1e-4) annotation( - Placement(transformation(extent = {{-20, 50}, {0, 70}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 annotation( - Placement(transformation(extent = {{60, 50}, {80, 70}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorT sensorT1 annotation( - Placement(transformation(extent = {{20, 58}, {40, 78}}, rotation = 0))); -equation - connect(singularPressureLossVALI2.C2, StaticDrumTh1.Ce_eco) annotation( - Line(points = {{-60, -40}, {-48, -40}, {-48, 0.6}}, color = {0, 0, 255})); - connect(singularPressureLossVALI1.C2, sinkP1.C) annotation( - Line(points = {{20, 0}, {40, 0}}, color = {0, 0, 255})); - connect(sensorT.C2, singularPressureLossVALI2.C1) annotation( - Line(points = {{-19.8, -80}, {-10, -80}, {-10, -54}, {-80, -54}, {-80, -40}}, color = {0, 0, 255})); - connect(sourcePQ.C, sensorT.C1) annotation( - Line(points = {{-70, -80}, {-40, -80}}, color = {0, 0, 255})); - connect(heatSource.C[1], StaticDrumTh1.Cth) annotation( - Line(points = {{-70, 20.2}, {-70, 10}, {-44, 10}}, color = {191, 95, 0})); - connect(StaticDrumTh1.Cs_purg, singularPressureLossVALI1.C1) annotation( - Line(points = {{-34.6, 6.6}, {-19.3, 6.6}, {-19.3, 0}, {0, 0}}, color = {0, 0, 255})); - connect(StaticDrumTh1.Cs_sur, singularPressureLossVALI3.C1) annotation( - Line(points = {{-40.2, 19.4}, {-40.2, 60}, {-20, 60}}, color = {0, 0, 255})); - connect(singularPressureLossVALI3.C2, sensorT1.C1) annotation( - Line(points = {{0, 60}, {20, 60}}, color = {0, 0, 255})); - connect(sensorT1.C2, sinkP2.C) annotation( - Line(points = {{40.2, 60}, {60, 60}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticDrum2; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo deleted file mode 100644 index a427e3b5..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerDTorWorEff.mo +++ /dev/null @@ -1,31 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticExchangerDTorWorEff - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF(C(P(start = 219.E5)), Q0 = 481.07, h0 = 1067.9E3) annotation( - Placement(transformation(extent = {{-60, -20}, {-40, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF(P0 = 217.68E5) annotation( - Placement(transformation(extent = {{20, -20}, {40, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC(C(P(start = 24E5)), Q0 = 23.377, h0 = 3420.3E3) annotation( - Placement(transformation(origin = {-30, 30}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC(P0 = 24.13E5) annotation( - Placement(transformation(extent = {{-2, 20}, {20, 40}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerWaterSteamDTorWorEFF(EffEch = 1, Kf = 597.832, Ec(P(start = 23e5)), Ef(P(start = 219E5)), exchanger_type = 3) annotation( - Placement(transformation(extent = {{-20, -20}, {0, 0}}, rotation = 0))); -equation - connect(sourceWaterSteam_FF.C, exchangerWaterSteamDTorWorEFF.Ef) annotation( - Line(points = {{-40, -10}, {-20, -10}}, color = {0, 0, 255})); - connect(exchangerWaterSteamDTorWorEFF.Sf, sinkWaterSteam_FF.C) annotation( - Line(points = {{0, -9.9}, {10.2, -9.9}, {10.2, -10}, {20, -10}}, color = {0, 0, 255})); - connect(sourceWaterSteam_FC.C, exchangerWaterSteamDTorWorEFF.Ec) annotation( - Line(points = {{-20, 30}, {-14, 30}, {-14, -5.9}}, color = {0, 0, 255})); - connect(exchangerWaterSteamDTorWorEFF.Sc, sinkWaterSteam_FC.C) annotation( - Line(points = {{-6, -5.9}, {-6, 30}, {-2, 30}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticExchangerDTorWorEff; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo deleted file mode 100644 index 7291ef79..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticExchangerKS.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticExchangerKS - ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS plateHeatExchanger(region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( - Placement(transformation(extent = {{-20, 34}, {20, 66}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0 = 340) annotation( - Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 annotation( - Placement(transformation(extent = {{-80, 60}, {-60, 80}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2 annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 annotation( - Placement(transformation(extent = {{60, 60}, {80, 80}}, rotation = 0))); -equation - connect(sourceP2.C, plateHeatExchanger.Ec) annotation( - Line(points = {{-60, 30}, {-40, 30}, {-40, 45.2}, {-20, 45.2}}, color = {0, 0, 255})); - connect(sourceP3.C, plateHeatExchanger.Ef) annotation( - Line(points = {{-60, 70}, {-40, 70}, {-40, 54.8}, {-20, 54.8}}, color = {0, 0, 0})); - connect(plateHeatExchanger.Sc, puitsP2.C) annotation( - Line(points = {{20, 45.2}, {26, 45.2}, {26, 46}, {40, 46}, {40, 30}, {60, 30}}, color = {0, 0, 0})); - connect(plateHeatExchanger.Sf, puitsP3.C) annotation( - Line(points = {{20, 54.8}, {40, 54.8}, {40, 70}, {60, 70}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticExchangerKS; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo deleted file mode 100644 index b7b9a442..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticFan.mo +++ /dev/null @@ -1,97 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticFan - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees(Xso2 = 0, Xco2 = 0.0, Xh2o = 0.006, Xo2 = 0.23, Q0 = 4, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 130000, T0 = 300, option_temperature = true) annotation( - Placement(transformation(extent = {{-210, -24}, {-164, 24}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees annotation( - Placement(transformation(origin = {182, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-68, 50}, {-48, 70}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(option_temperature = 2, W0 = {1e4}) annotation( - Placement(transformation(extent = {{-48, 90}, {-28, 110}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases(Q(fixed = false, start = 10), K = 10) annotation( - Placement(transformation(extent = {{12, 50}, {32, 70}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases1(Q(fixed = false, start = 11), K = 0.01) annotation( - Placement(transformation(extent = {{-108, 50}, {-88, 70}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(Starttime = 50, Duration = 50, Initialvalue = 1e4, Finalvalue = 2e5) annotation( - Placement(transformation(extent = {{0, 100}, {-20, 120}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticFan staticFan(VRotn = 2700, rm = 1, a2 = 0, b1 = -1.315, b2 = 2.4593, VRot = 2700, a1 = -263.145, a3 = 500, Q(start = 2), Qv(start = 1.4), rho(start = 1.4)) annotation( - Placement(transformation(extent = {{52, 50}, {72, 70}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve singularPressureLossFlueGases2(Q(fixed = false, start = 10)) annotation( - Placement(transformation(extent = {{92, 50}, {112, 70}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeATh dynamicExchanger1(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-68, -70}, {-48, -50}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature = 2, W0 = {1e4}) annotation( - Placement(transformation(extent = {{-48, -90}, {-28, -110}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases3(Q(fixed = false, start = 10), K = 10) annotation( - Placement(transformation(extent = {{12, -70}, {32, -50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossFlueGases4(Q(fixed = false, start = 11), K = 0.01) annotation( - Placement(transformation(extent = {{-108, -70}, {-88, -50}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe1(Starttime = 50, Duration = 50, Initialvalue = 1e4, Finalvalue = 2e5) annotation( - Placement(transformation(extent = {{0, -120}, {-20, -100}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticFan staticFan1(VRotn = 2700, rm = 1, b2 = 2.4593, b1 = -1.315, VRot = 2700, a1 = -263.145, a2 = 0, a3 = 500, Q(start = 2), Qv(start = 1.4), rho(start = 1.4)) annotation( - Placement(transformation(extent = {{52, -70}, {72, -50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve singularPressureLossFlueGases5(Q(fixed = false, start = 10)) annotation( - Placement(transformation(extent = {{92, -70}, {112, -50}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.Mixer2 mixerFlueGases2_1(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{132, -10}, {152, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeDTh volume2S(dynamic_composition_balance = true, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-148, -10}, {-128, 10}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor annotation( - Placement(transformation(extent = {{-28, 58}, {-8, 78}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorT temperatureSensor1 annotation( - Placement(transformation(extent = {{-28, -62}, {-8, -42}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Qin(Starttime = 50, Duration = 50, Initialvalue = 4, Finalvalue = 1) annotation( - Placement(transformation(extent = {{-200, 40}, {-180, 60}}, rotation = 0))); -equation - connect(singularPressureLossFlueGases.C2, staticFan.C1) annotation( - Line(points = {{32, 60}, {52, 60}}, color = {0, 0, 0}, thickness = 1)); - connect(staticFan.C2, singularPressureLossFlueGases2.C1) annotation( - Line(points = {{72, 60}, {91, 60}}, color = {0, 0, 0}, thickness = 1)); - connect(singularPressureLossFlueGases3.C2, staticFan1.C1) annotation( - Line(points = {{32, -60}, {52, -60}}, color = {0, 0, 0}, thickness = 1)); - connect(staticFan1.C2, singularPressureLossFlueGases5.C1) annotation( - Line(points = {{72, -60}, {91, -60}}, color = {0, 0, 0}, thickness = 1)); - connect(singularPressureLossFlueGases2.C2, mixerFlueGases2_1.Ce1) annotation( - Line(points = {{113, 60}, {138, 60}, {138, 10}}, color = {0, 0, 0}, thickness = 1)); - connect(singularPressureLossFlueGases5.C2, mixerFlueGases2_1.Ce2) annotation( - Line(points = {{113, -60}, {138, -60}, {138, -10}}, color = {0, 0, 0}, thickness = 1)); - connect(temperatureSensor1.C2, singularPressureLossFlueGases3.C1) annotation( - Line(points = {{-7.8, -60}, {12, -60}}, color = {0, 0, 0}, thickness = 1)); - connect(temperatureSensor.C2, singularPressureLossFlueGases.C1) annotation( - Line(points = {{-7.8, 60}, {12, 60}}, color = {0, 0, 0}, thickness = 1)); - connect(Source_Fumees.C, volume2S.Ce) annotation( - Line(points = {{-164, 0}, {-148, 0}}, color = {0, 0, 0}, thickness = 1)); - connect(volume2S.Cs1, singularPressureLossFlueGases1.C1) annotation( - Line(points = {{-138, 10}, {-138, 60}, {-108, 60}}, color = {0, 0, 0}, thickness = 1)); - connect(volume2S.Cs2, singularPressureLossFlueGases4.C1) annotation( - Line(points = {{-138, -10}, {-138, -60}, {-108, -60}}, color = {0, 0, 0}, thickness = 1)); - connect(heatSource.C[1], dynamicExchanger.Cth) annotation( - Line(points = {{-38, 90.2}, {-58, 60}}, color = {191, 95, 0})); - connect(heatSource1.C[1], dynamicExchanger1.Cth) annotation( - Line(points = {{-38, -90.2}, {-58, -60}}, color = {191, 95, 0})); - connect(mixerFlueGases2_1.Cs, Puits_Fumees.C) annotation( - Line(points = {{152, 0}, {162, 0}, {162, -1.20011e-015}, {172, -1.20011e-015}}, color = {0, 0, 0}, thickness = 1)); - connect(singularPressureLossFlueGases1.C2, dynamicExchanger.Ce1) annotation( - Line(points = {{-88, 60}, {-68, 60}}, color = {0, 0, 0}, thickness = 1, smooth = Smooth.None)); - connect(dynamicExchanger.Cs1, temperatureSensor.C1) annotation( - Line(points = {{-48, 60}, {-28, 60}}, color = {0, 0, 0}, thickness = 1, smooth = Smooth.None)); - connect(Qin.y, Source_Fumees.IMassFlow) annotation( - Line(points = {{-179, 50}, {-170, 50}, {-170, 28}, {-187, 28}, {-187, 12}})); - connect(singularPressureLossFlueGases4.C2, dynamicExchanger1.Ce1) annotation( - Line(points = {{-88, -60}, {-68, -60}}, color = {0, 0, 0}, thickness = 1)); - connect(dynamicExchanger1.Cs1, temperatureSensor1.C1) annotation( - Line(points = {{-48, -60}, {-38, -60}, {-28, -60}}, color = {0, 0, 0}, thickness = 1)); - connect(rampe.y, heatSource.ISignal) annotation( - Line(points = {{-21, 110}, {-38, 110}, {-38, 105}}, color = {0, 0, 255})); - connect(rampe1.y, heatSource1.ISignal) annotation( - Line(points = {{-21, -110}, {-38, -110}, {-38, -105}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -150}, {200, 150}}, initialScale = 0.1)), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticFan; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo deleted file mode 100644 index 60425bd5..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticPlateHeatExchanger.mo +++ /dev/null @@ -1,31 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticPlateHeatExchanger - ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger plateHeatExchanger(region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( - Placement(transformation(extent = {{-20, 44}, {0, 64}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0 = 340) annotation( - Placement(transformation(extent = {{-80, 44}, {-60, 64}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 annotation( - Placement(transformation(extent = {{-60, 24}, {-40, 44}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2 annotation( - Placement(transformation(extent = {{40, 44}, {60, 64}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 annotation( - Placement(transformation(extent = {{20, 24}, {40, 44}}, rotation = 0))); -equation - connect(sourceP2.C, plateHeatExchanger.Ec) annotation( - Line(points = {{-60, 54}, {-20, 54}}, color = {0, 0, 255})); - connect(sourceP3.C, plateHeatExchanger.Ef) annotation( - Line(points = {{-40, 34}, {-15, 34}, {-15, 48}}, color = {0, 0, 255})); - connect(plateHeatExchanger.Sc, puitsP2.C) annotation( - Line(points = {{0, 54.2}, {20, 54.2}, {20, 54}, {40, 54}}, color = {0, 0, 255})); - connect(plateHeatExchanger.Sf, puitsP3.C) annotation( - Line(points = {{-5, 48}, {-6, 48}, {-6, 34}, {20, 34}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticPlateHeatExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo deleted file mode 100644 index ec4e4406..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStaticWallFlueGasesExchanger.mo +++ /dev/null @@ -1,30 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStaticWallFlueGasesExchanger - HeatExchangers.StaticWallFlueGasesExchanger dynamicOnePhaseFlowPipe(Q(start = {536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207, 536.5750641592207}), h(start = {71016.12237181116, 74743.46665892199, 78470.81094603281, 82198.15523314364, 85925.49952025448, 89652.84380736532, 93380.18809447614, 97107.53238158698, 100834.8766686978, 104562.22095580865, 108289.56524291947, 70825.9016030344}), p_rho = 998, P(start = {300000, 281833.41863537, 263664.30473175, 245492.47958308, 227317.76827098, 209139.99948382, 190959.00534677, 172774.621262, 154586.68575823, 136395.04034906, 118199.5293995, 100000})) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceP(option_temperature = true, Q0 = 1, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - BoundaryConditions.Sink sinkP annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(T0 = {273 + 400, 273 + 400, 273 + 400, 273 + 400, 273 + 400, 273 + 400, 273 + 400, 273 + 400, 273 + 400, 273 + 400}, option_temperature = 2, W0 = {6e4, 6e4, 6e4, 6e4, 6e4, 6e4, 6e4, 6e4, 6e4, 6e4}) annotation( - Placement(transformation(extent = {{-20, 60}, {0, 80}}, rotation = 0))); - ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-20, 40}, {0, 60}}, rotation = 0))); -equation - connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation( - Line(points = {{-40, 30}, {-20, 30}}, color = {0, 0, 255})); - connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation( - Line(points = {{0, 30}, {20, 30}}, color = {0, 0, 255})); - connect(heatSource.C, heatExchangerWall.WT2) annotation( - Line(points = {{-10, 60.2}, {-10, 52}}, color = {191, 95, 0})); - connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation( - Line(points = {{-10, 48}, {-10, 33}}, color = {191, 95, 0})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStaticWallFlueGasesExchanger; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo deleted file mode 100644 index 711ba630..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer1.mo +++ /dev/null @@ -1,38 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSteamDryer1 - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta = 1, h(start = 3e6), P(start = 10000000)) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0 = 3000000) annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0 = 100e5) annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 2.e-3) annotation( - Placement(transformation(extent = {{0, -20}, {20, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{40, -20}, {60, 0}}, rotation = 0))); -equation - connect(sourceQ.C, singularPressureLoss2.C1) annotation( - Line(points = {{-80, 30}, {-60, 30}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, sinkP.C) annotation( - Line(points = {{40, 30}, {60, 30}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, sink.C) annotation( - Line(points = {{20, -10}, {40, -10}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, steamDryer.Cev) annotation( - Line(points = {{-40, 30}, {-30, 30}, {-30, 34}, {-19.9, 34}}, color = {0, 0, 255})); - connect(steamDryer.Csv, singularPressureLoss1.C1) annotation( - Line(points = {{-0.1, 34}, {10, 34}, {10, 30}, {20, 30}}, color = {0, 0, 255})); - connect(steamDryer.Csl, singularPressureLoss3.C1) annotation( - Line(points = {{-9.9, 20}, {-10, 20}, {-10, -10}, {0, -10}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSteamDryer1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo deleted file mode 100644 index 9eb2e093..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamDryer2.mo +++ /dev/null @@ -1,38 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSteamDryer2 - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta = 0.9, P(start = 10000000)) annotation( - Placement(transformation(extent = {{-10, -8}, {10, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0 = 10000000, h0 = 2400000) annotation( - Placement(transformation(extent = {{-90, -4}, {-70, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{-50, -4}, {-30, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP annotation( - Placement(transformation(extent = {{70, -4}, {90, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{30, -4}, {50, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 1.e-4) annotation( - Placement(transformation(extent = {{30, -44}, {50, -24}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( - Placement(transformation(extent = {{70, -44}, {90, -24}}, rotation = 0))); -equation - connect(sourceQ.C, singularPressureLoss2.C1) annotation( - Line(points = {{-70, 6}, {-50, 6}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, sinkP.C) annotation( - Line(points = {{50, 6}, {70, 6}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, sink.C) annotation( - Line(points = {{50, -34}, {70, -34}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, steamDryer.Cev) annotation( - Line(points = {{-30, 6}, {-20, 6}, {-9.9, 6}}, color = {0, 0, 255})); - connect(steamDryer.Csv, singularPressureLoss1.C1) annotation( - Line(points = {{9.9, 6}, {20, 6}, {30, 6}}, color = {0, 0, 255})); - connect(steamDryer.Csl, singularPressureLoss3.C1) annotation( - Line(points = {{0.1, -8}, {0, -8}, {0, -34}, {30, -34}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 10), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSteamDryer2; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo deleted file mode 100644 index 13fa86ff..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamEngine.mo +++ /dev/null @@ -1,24 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSteamEngine - ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1 annotation( - Placement(transformation(extent = {{-60, 60}, {-40, 80}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0 = 100000) annotation( - Placement(transformation(extent = {{-20, 60}, {0, 80}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(h0 = 3.e6, option_temperature = false, P0 = 16e5) annotation( - Placement(transformation(extent = {{-100, 60}, {-80, 80}}, rotation = 0))); -equation - connect(sourceP.C, steamEngine1.C1) annotation( - Line(points = {{-80, 70}, {-57, 70}}, color = {0, 0, 255})); - connect(steamEngine1.C2, puitsP.C) annotation( - Line(points = {{-43, 70}, {-31.5, 70}, {-31.5, 70}, {-20, 70}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.32, y = 0.02, width = 0.39, height = 0.47), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSteamEngine; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo deleted file mode 100644 index 02063e21..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSteamExtractionSplitter.mo +++ /dev/null @@ -1,39 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSteamExtractionSplitter - ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(alpha = 0.9) annotation( - Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(h0 = 2600000) annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(P0 = 100e5) annotation( - Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 2.e-3) annotation( - Placement(transformation(extent = {{0, -20}, {20, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(Q0 = 10) annotation( - Placement(transformation(extent = {{40, -20}, {60, 0}}, rotation = 0))); -equation - connect(sourceQ.C, singularPressureLoss2.C1) annotation( - Line(points = {{-80, 30}, {-60, 30}}, color = {0, 0, 255})); - connect(singularPressureLoss2.C2, steamExtractionSplitter.Ce) annotation( - Line(points = {{-40, 30}, {-20.3, 30}}, color = {0, 0, 255})); - connect(steamExtractionSplitter.Cs, singularPressureLoss1.C1) annotation( - Line(points = {{0.3, 30}, {20, 30}}, color = {0, 0, 255})); - connect(steamExtractionSplitter.Cex, singularPressureLoss3.C1) annotation( - Line(points = {{-6, 20}, {-6, -10}, {0, -10}}, color = {0, 0, 255})); - connect(singularPressureLoss1.C2, sinkP.C) annotation( - Line(points = {{40, 30}, {60, 30}}, color = {0, 0, 255})); - connect(singularPressureLoss3.C2, sink.C) annotation( - Line(points = {{20, -10}, {40, -10}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Diagram(graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSteamExtractionSplitter; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo deleted file mode 100644 index 773bcf5b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine1.mo +++ /dev/null @@ -1,45 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStodolaTurbine1 - parameter Units.SI.AbsolutePressure PoutPump(fixed = false, start = 13e5) "Flow pressure at the outlet of the pump"; - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(pros1(x(start = 1)), Hrs(start = 2931e3), pros(d(start = 19.715136086827403)), Ce(h(start = 3000000.0)), proe(T(start = 613.0), x(start = 1.0))) annotation( - Placement(transformation(extent = {{-60, 60}, {-40, 80}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0 = 45e5, C(h_vol_1(start = 75002))) annotation( - Placement(transformation(extent = {{-20, 60}, {0, 80}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(h0 = 3.e6, option_temperature = false, P0 = 6500000, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2) annotation( - Placement(transformation(extent = {{-100, 60}, {-80, 80}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.CentrifugalPump DynamicCentrifugalPump1(Q(fixed = true, start = 50), Qv(start = 23.0), Pm(start = 1158163.6), h(start = 3041170.0441966015), C1(P(start = 10e5)), C2(P(start = 3.e6), h(start = 3082340.088393203)), hn(start = 7119.0), w_a(start = 20.0)) annotation( - Placement(transformation(extent = {{20, -40}, {40, -20}}, rotation = 0))); - ThermoSysPro.ElectroMechanics.Machines.Shaft Shaft1 annotation( - Placement(transformation(extent = {{-20, -90}, {0, -70}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 13e5) annotation( - Placement(transformation(extent = {{60, -40}, {80, -20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(h0 = 3.e6, option_temperature = false, P0 = 1000000, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2) annotation( - Placement(transformation(extent = {{-20, -40}, {0, -20}}, rotation = 0))); - InstrumentationAndControl.Blocks.Sources.Constante Pout(k = PoutPump) annotation( - Placement(transformation(extent = {{56, -12}, {68, 0}}, rotation = 0))); -equation - connect(Shaft1.C2, DynamicCentrifugalPump1.M) annotation( - Line(points = {{1, -80}, {30, -80}, {30, -41}})); - connect(stodolaTurbine.M, Shaft1.C1) annotation( - Line(points = {{-50, 60}, {-50, -80}, {-21, -80}})); - connect(sourceP1.C, DynamicCentrifugalPump1.C1) annotation( - Line(points = {{0, -30}, {20, -30}}, color = {0, 0, 255})); - connect(DynamicCentrifugalPump1.C2, puitsP1.C) annotation( - Line(points = {{40, -30}, {50, -30}, {50, -30}, {60, -30}}, color = {0, 0, 255})); - connect(sourceP.C, stodolaTurbine.Ce) annotation( - Line(points = {{-80, 70}, {-60.1, 70}}, color = {0, 0, 255})); - connect(stodolaTurbine.Cs, puitsP.C) annotation( - Line(points = {{-39.9, 70}, {-20, 70}}, color = {0, 0, 255})); - connect(Pout.y, puitsP1.IPressure) annotation( - Line(points = {{68.6, -6}, {88, -6}, {88, -30}, {75, -30}})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.32, y = 0.02, width = 0.39, height = 0.47), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStodolaTurbine1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo deleted file mode 100644 index 904f3895..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestStodolaTurbine2.mo +++ /dev/null @@ -1,24 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestStodolaTurbine2 - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Ce(h(start = 3000000.0))) annotation( - Placement(transformation(extent = {{-60, 60}, {-40, 80}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0 = 5000) annotation( - Placement(transformation(extent = {{-20, 60}, {0, 80}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(h0 = 3.e6, option_temperature = false, P0 = 300000, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_2) annotation( - Placement(transformation(extent = {{-100, 60}, {-80, 80}}, rotation = 0))); -equation - connect(sourceP.C, stodolaTurbine.Ce) annotation( - Line(points = {{-80, 70}, {-60.1, 70}}, color = {0, 0, 255})); - connect(stodolaTurbine.Cs, puitsP.C) annotation( - Line(points = {{-39.9, 70}, {-20, 70}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 1000), - Window(x = 0.32, y = 0.02, width = 0.39, height = 0.47), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestStodolaTurbine2; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo deleted file mode 100644 index 84b4806c..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestSwitchValve.mo +++ /dev/null @@ -1,36 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestSwitchValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-100, -10}, {-80, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve annotation( - Placement(transformation(extent = {{-10, -4}, {10, 16}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(width = 10, period = 20) annotation( - Placement(transformation(extent = {{-60, 50}, {-40, 70}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 annotation( - Placement(transformation(extent = {{-60, -10}, {-39, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 annotation( - Placement(transformation(extent = {{40, -10}, {60, 10}}, rotation = 0))); -equation - connect(pulse.yL, SwitchValve.Ouv) annotation( - Line(points = {{-39, 60}, {0, 60}, {0, 13.2}})); - connect(SourceP1.C, perteDP2.C1) annotation( - Line(points = {{-80, 0}, {-60, 0}}, color = {0, 0, 255})); - connect(perteDP2.C2, SwitchValve.C1) annotation( - Line(points = {{-39, 0}, {-10, 0}}, color = {0, 0, 255})); - connect(SwitchValve.C2, perteDP1.C1) annotation( - Line(points = {{10, 0}, {40, 0}}, color = {0, 0, 255})); - connect(perteDP1.C2, PuitsP1.C) annotation( - Line(points = {{60, 0}, {80, 0}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 100), - Window(x = 0.45, y = 0.01, width = 0.35, height = 0.49), - Diagram(graphics, coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestSwitchValve; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo deleted file mode 100644 index bd5c36bc..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTank.mo +++ /dev/null @@ -1,42 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestTank - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start = 400000.0)), Q(start = 600.0)) annotation( - Placement(transformation(extent = {{30, -50}, {50, -30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start = 200000.0), Q(start = 0.0)) annotation( - Placement(transformation(extent = {{-50, 2}, {-30, 22}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-90, -4}, {-70, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{70, -50}, {90, -30}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed = false, start = 5), Cs1(Q(start = 0.0)), steady_state = true) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation( - Placement(transformation(extent = {{-90, 30}, {-70, 50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 annotation( - Placement(transformation(extent = {{30, -4}, {50, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 annotation( - Placement(transformation(extent = {{70, -4}, {90, 16}}, rotation = 0))); -equation - connect(PerteDP1.C2, PuitsP1.C) annotation( - Line(points = {{50, -40}, {70, -40}}, color = {0, 0, 255})); - connect(SourceP1.C, VanneReglante1.C1) annotation( - Line(points = {{-70, 6}, {-50, 6}}, color = {0, 0, 255})); - connect(Tank1.Cs2, PerteDP1.C1) annotation( - Line(points = {{10, -6}, {20, -6}, {20, -40}, {30, -40}}, color = {0, 0, 255})); - connect(Rampe1.y, VanneReglante1.Ouv) annotation( - Line(points = {{-69, 40}, {-40, 40}, {-40, 23}})); - connect(VanneReglante1.C2, Tank1.Ce1) annotation( - Line(points = {{-30, 6}, {-20, 6}, {-10, 6}}, color = {0, 0, 255})); - connect(Tank1.Cs1, PerteDP2.C1) annotation( - Line(points = {{10.2, 6}, {20, 6}, {30, 6}}, color = {0, 0, 255})); - connect(PerteDP2.C2, PuitsP2.C) annotation( - Line(points = {{50, 6}, {50, 6}, {70, 6}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 20), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestTank; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo deleted file mode 100644 index 0dd951c7..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTankHorizontal.mo +++ /dev/null @@ -1,42 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestTankHorizontal - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1(C1(P(start = 400000.0)), Q(start = 600.0)) annotation( - Placement(transformation(extent = {{32, -20}, {52, 0}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1(Pm(start = 200000.0), Q(start = 0.0)) annotation( - Placement(transformation(extent = {{-50, 6}, {-30, 26}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-90, 0}, {-70, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{70, -20}, {90, 0}}, rotation = 0))); - Volumes.TankHorizontal Tank1(z(fixed = false, start = 5), Cs1(Q(start = 0.0)), diffusion = true, dynamic_mass_balance = true) annotation( - Placement(transformation(extent = {{-20, -20}, {20, 20}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation( - Placement(transformation(extent = {{-90, 30}, {-70, 50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 annotation( - Placement(transformation(extent = {{32, 0}, {52, 20}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 annotation( - Placement(transformation(extent = {{70, 0}, {90, 20}}, rotation = 0))); -equation - connect(PerteDP1.C2, PuitsP1.C) annotation( - Line(points = {{52, -10}, {70, -10}}, color = {0, 0, 255})); - connect(SourceP1.C, VanneReglante1.C1) annotation( - Line(points = {{-70, 10}, {-50, 10}}, color = {0, 0, 255})); - connect(Tank1.Cs2, PerteDP1.C1) annotation( - Line(points = {{20, -10}, {32, -10}}, color = {0, 0, 255})); - connect(Rampe1.y, VanneReglante1.Ouv) annotation( - Line(points = {{-69, 40}, {-40, 40}, {-40, 27}})); - connect(VanneReglante1.C2, Tank1.Ce1) annotation( - Line(points = {{-30, 10}, {-20, 10}}, color = {0, 0, 255})); - connect(Tank1.Cs1, PerteDP2.C1) annotation( - Line(points = {{20.4, 9.8}, {20.4, 10}, {32, 10}}, color = {0, 0, 255})); - connect(PerteDP2.C2, PuitsP2.C) annotation( - Line(points = {{52, 10}, {70, 10}}, color = {0, 0, 255})); - annotation( - experiment(StopTime = 20), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestTankHorizontal; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo deleted file mode 100644 index 1212059b..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestThreeWayValve.mo +++ /dev/null @@ -1,32 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestThreeWayValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( - Placement(transformation(extent = {{-90, -10}, {-70, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( - Placement(transformation(extent = {{70, -10}, {90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve(C2(Q(start = -7.902947109890763E-33)), C3(Q(start = 2716.4138702433384)), Valve1(Pm(start = 200000.0)), VolumeA1(h(start = 71016.12237181117))) annotation( - Placement(transformation(extent = {{-10, -6}, {10, 14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 annotation( - Placement(transformation(extent = {{70, -50}, {90, -30}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe annotation( - Placement(transformation(extent = {{-50, 30}, {-30, 50}}, rotation = 0))); -equation - connect(rampe.y, threeWayValve.Ouv) annotation( - Line(points = {{-29, 40}, {0, 40}, {0, 15}})); - connect(SourceP1.C, threeWayValve.C1) annotation( - Line(points = {{-70, 0}, {-10, 0}}, color = {0, 0, 0})); - connect(threeWayValve.C2, PuitsP1.C) annotation( - Line(points = {{10, 0}, {70, 0}}, color = {0, 0, 0})); - connect(threeWayValve.C3, PuitsP2.C) annotation( - Line(points = {{0, -6}, {0, -40}, {70, -40}}, color = {0, 0, 0})); - annotation( - experiment(StopTime = 5), - Window(x = 0.45, y = 0.01, width = 0.35, height = 0.49), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestThreeWayValve; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo deleted file mode 100644 index 5140b28a..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavity.mo +++ /dev/null @@ -1,49 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestTwoPhaseCavity - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater = 670 "Maximum CV (active if mode_caract=0)"; - PressureLosses.ControlValve feedwaterValve(Cv(start = 335), C1(h_vol_1(start = 1400e3), h(start = 1400e3), P(start = 13300000), h_vol_2(start = 1975433.4222685455)), rho(start = 888), h(start = 1400000), Cvmax = CvmaxWater, Q(start = 10), Pm(start = 13200000.029884)) annotation( - Placement(transformation(extent = {{-98, 96}, {-78, 116}}, rotation = 0))); - PressureLosses.ControlValve steamValve(Cv(start = 25000), Q(start = 0.0), rho(start = 78.5), h(start = 2657930), C1(h_vol_2(start = 2655313.7785675577)), Cvmax(fixed = false), Pm(start = 12998726.577779)) annotation( - Placement(transformation(extent = {{-60, 136}, {-40, 156}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon(k = 0.5) annotation( - Placement(transformation(extent = {{-138, 120}, {-118, 140}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon1(k = 0.5) annotation( - Placement(transformation(extent = {{-100, 160}, {-80, 180}}, rotation = 0))); - BoundaryConditions.SourceP sourceP(h0 = 1400000, option_temperature = false, P0 = 13200000) annotation( - Placement(transformation(extent = {{-138, 90}, {-118, 110}}, rotation = 0))); - BoundaryConditions.SinkP sinkQ(P0 = 13200000, Q(start = 51.00572315373906)) annotation( - Placement(transformation(extent = {{0, -60}, {20, -40}}, rotation = 0))); - Volumes.TwoPhaseCavity twoPhaseVolume(Vv(start = 0.5, fixed = true), diffusion = true, dynamic_energy_balance = false, P0 = 13200000, Pfond(start = 13200000)) annotation( - Placement(transformation(extent = {{-60, 20}, {20, 100}}))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-20, -10}))); - BoundaryConditions.SourceP sourceP1(P0(fixed = true) = 13200000, option_temperature = false, h0 = 2600000) annotation( - Placement(transformation(extent = {{-100, 130}, {-80, 150}}, rotation = 0))); -equation - connect(ConsigneNiveauBallon.y, feedwaterValve.Ouv) annotation( - Line(points = {{-117, 130}, {-88, 130}, {-88, 117}}, smooth = Smooth.None)); - connect(sourceP.C, feedwaterValve.C1) annotation( - Line(points = {{-118, 100}, {-98, 100}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(ConsigneNiveauBallon1.y, steamValve.Ouv) annotation( - Line(points = {{-79, 170}, {-50, 170}, {-50, 157}}, smooth = Smooth.None)); - connect(lumpedStraightPipe.C2, sinkQ.C) annotation( - Line(points = {{-20, -20}, {-20, -50}, {0, -50}}, color = {0, 0, 0})); - connect(sourceP1.C, steamValve.C1) annotation( - Line(points = {{-80, 140}, {-60, 140}}, color = {0, 0, 0})); - connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation( - Line(points = {{-19.5556, 30.6667}, {-19.5556, 15.3333}, {-20, 15.3333}, {-20, 0}}, color = {0, 0, 0})); - connect(steamValve.C2, twoPhaseVolume.Cv) annotation( - Line(points = {{-40, 140}, {-19.5556, 140}, {-19.5556, 89.3333}}, color = {0, 0, 0})); - connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation( - Line(points = {{-78, 100}, {-35.5556, 100}, {-35.5556, 89.3333}}, color = {0, 0, 0})); - annotation( - experiment(__Dymola_Algorithm = "Dassl"), - Window(x = 0.43, y = 0, width = 0.57, height = 0.63), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -100}, {140, 200}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestTwoPhaseCavity; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo deleted file mode 100644 index 8b0f1ab8..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseCavityOnePipe.mo +++ /dev/null @@ -1,49 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestTwoPhaseCavityOnePipe - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater = 670 "Maximum CV (active if mode_caract=0)"; - PressureLosses.ControlValve feedwaterValve(Cv(start = 335), C1(h_vol_1(start = 1400e3), h(start = 1400e3), P(start = 13300000), h_vol_2(start = 1399988.8233534198)), rho(start = 888), h(start = 1400000), Cvmax = CvmaxWater, Q(start = 58.005768798668484), Pm(start = 13146647.912081594)) annotation( - Placement(transformation(extent = {{-98, 96}, {-78, 116}}, rotation = 0))); - PressureLosses.ControlValve steamValve(Cv(start = 25000), Q(start = 6.303270420619601E-10), rho(start = 78.5), h(start = 2657930), C1(h_vol_2(start = 2658519.5634182408)), Cvmax(fixed = false), Pm(start = 12998726.577779)) annotation( - Placement(transformation(extent = {{-60, 136}, {-40, 156}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon(k = 0.5) annotation( - Placement(transformation(extent = {{-138, 120}, {-118, 140}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon1(k = 0.5) annotation( - Placement(transformation(extent = {{-100, 160}, {-80, 180}}, rotation = 0))); - BoundaryConditions.SourceP sourceP(h0 = 1400000, option_temperature = false, P0 = 13200000) annotation( - Placement(transformation(extent = {{-138, 90}, {-118, 110}}, rotation = 0))); - BoundaryConditions.SinkP sinkQ(P0 = 13200000, Q(start = 51.00572315373906)) annotation( - Placement(transformation(extent = {{0, -60}, {20, -40}}, rotation = 0))); - Volumes.TwoPhaseCavityOnePipe twoPhaseVolume(Vv(start = 0.5, fixed = true), diffusion = true, hl(start = 1400000.0), hv(start = 2410000.0), Cal_hcond = false, dynamic_energy_balance = false, P0 = 13200000, Pfond(start = 13203663.545897305), Tp(start = 583.6846968972088), hvIn(start = 2400966.7047930923)) annotation( - Placement(transformation(extent = {{-60, 20}, {20, 100}}))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-20, -10}))); - BoundaryConditions.SourceP sourceP1(P0(fixed = true) = 13200000, option_temperature = false, h0 = 2600000) annotation( - Placement(transformation(extent = {{-100, 130}, {-80, 150}}, rotation = 0))); -equation - connect(ConsigneNiveauBallon.y, feedwaterValve.Ouv) annotation( - Line(points = {{-117, 130}, {-88, 130}, {-88, 117}}, smooth = Smooth.None)); - connect(sourceP.C, feedwaterValve.C1) annotation( - Line(points = {{-118, 100}, {-98, 100}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(ConsigneNiveauBallon1.y, steamValve.Ouv) annotation( - Line(points = {{-79, 170}, {-50, 170}, {-50, 157}}, smooth = Smooth.None)); - connect(lumpedStraightPipe.C2, sinkQ.C) annotation( - Line(points = {{-20, -20}, {-20, -50}, {0, -50}}, color = {0, 0, 0})); - connect(sourceP1.C, steamValve.C1) annotation( - Line(points = {{-80, 140}, {-60, 140}}, color = {0, 0, 0})); - connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation( - Line(points = {{-20, 30.6667}, {-20, 15.3333}, {-20, 15.3333}, {-20, 0}}, color = {0, 0, 0})); - connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation( - Line(points = {{-78, 100}, {-50.6286, 100}, {-50.6286, 81.0667}}, color = {0, 0, 0})); - connect(steamValve.C2, twoPhaseVolume.CvBP) annotation( - Line(points = {{-40, 140}, {-20.2286, 140}, {-20.2286, 89.3333}}, color = {0, 0, 0})); - annotation( - experiment(__Dymola_Algorithm = "Dassl"), - Window(x = 0.43, y = 0, width = 0.57, height = 0.63), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -100}, {140, 200}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestTwoPhaseCavityOnePipe; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo deleted file mode 100644 index f847e5c0..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestTwoPhaseVolume.mo +++ /dev/null @@ -1,49 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestTwoPhaseVolume - parameter ThermoSysPro.Units.xSI.Cv CvmaxWater = 670 "Maximum CV (active if mode_caract=0)"; - PressureLosses.ControlValve feedwaterValve(Cv(start = 335), C1(h_vol_1(start = 1400e3), h(start = 1400e3), P(start = 13300000), h_vol_2(start = 1975433.4222685455)), rho(start = 888), h(start = 1400000), Cvmax = CvmaxWater, Q(start = 10), Pm(start = 13200000.029884)) annotation( - Placement(transformation(extent = {{-120, 76}, {-100, 96}}, rotation = 0))); - PressureLosses.ControlValve steamValve(Cv(start = 25000), Q(start = 0.0), rho(start = 78.5), h(start = 2657930), C1(h_vol_2(start = 2655313.7785675577)), Cvmax(fixed = false), Pm(start = 12998726.577779)) annotation( - Placement(transformation(extent = {{-120, 136}, {-100, 156}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon(k = 0.5) annotation( - Placement(transformation(extent = {{-160, 100}, {-140, 120}}, rotation = 0))); - ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauBallon1(k = 0.5) annotation( - Placement(transformation(extent = {{-160, 160}, {-140, 180}}, rotation = 0))); - BoundaryConditions.SourceP sourceP(h0 = 1400000, option_temperature = false, P0 = 13200000) annotation( - Placement(transformation(extent = {{-200, 70}, {-180, 90}}, rotation = 0))); - BoundaryConditions.SinkP sinkQ(P0 = 13200000, Q(start = 51.00572315373906)) annotation( - Placement(transformation(extent = {{-38, -40}, {-18, -20}}, rotation = 0))); - Volumes.TwoPhaseVolume twoPhaseVolume(diffusion = true, steady_state = true, Vv(start = 0.5, fixed = true), dynamic_energy_balance = true, P0 = 13200000, Pfond(start = 13200000)) annotation( - Placement(transformation(extent = {{-80, 50}, {-20, 110}}))); - PressureLosses.LumpedStraightPipe lumpedStraightPipe annotation( - Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 90, origin = {-50, 10}))); - BoundaryConditions.SourceP sourceP1(P0(fixed = true) = 13200000, option_temperature = false, h0 = 2600000) annotation( - Placement(transformation(extent = {{-200, 130}, {-180, 150}}, rotation = 0))); -equation - connect(ConsigneNiveauBallon.y, feedwaterValve.Ouv) annotation( - Line(points = {{-139, 110}, {-110, 110}, {-110, 97}}, smooth = Smooth.None)); - connect(sourceP.C, feedwaterValve.C1) annotation( - Line(points = {{-180, 80}, {-120, 80}}, color = {0, 0, 255}, smooth = Smooth.None)); - connect(ConsigneNiveauBallon1.y, steamValve.Ouv) annotation( - Line(points = {{-139, 170}, {-110, 170}, {-110, 157}}, smooth = Smooth.None)); - connect(feedwaterValve.C2, twoPhaseVolume.Ce) annotation( - Line(points = {{-100, 80}, {-80, 80}}, color = {0, 0, 0})); - connect(lumpedStraightPipe.C2, sinkQ.C) annotation( - Line(points = {{-50, 0}, {-50, -30}, {-38, -30}}, color = {0, 0, 0})); - connect(sourceP1.C, steamValve.C1) annotation( - Line(points = {{-180, 140}, {-120, 140}}, color = {0, 0, 0})); - connect(steamValve.C2, twoPhaseVolume.Cv) annotation( - Line(points = {{-100, 140}, {-50, 140}, {-50, 110}}, color = {0, 0, 0})); - connect(twoPhaseVolume.Cl, lumpedStraightPipe.C1) annotation( - Line(points = {{-50, 50}, {-50, 20}}, color = {0, 0, 0})); - annotation( - experiment(__Dymola_Algorithm = "Dassl"), - Window(x = 0.43, y = 0, width = 0.57, height = 0.63), - Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-200, -100}, {140, 200}}, grid = {2, 2})), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestTwoPhaseVolume; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo deleted file mode 100644 index 19dea528..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA.mo +++ /dev/null @@ -1,66 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestVolumeA - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(continuous_flow_reversal = true, T0 = 288.15, diffusion = true, C(h_vol_2(start = 63269.22110794238))) annotation( - Placement(transformation(extent = {{-100, -10}, {-80, 10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(Q(start = 356.3142593657128), P0 = 300000, T0 = 369.15, diffusion = true) annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}))); - ThermoSysPro.Fluid.Volumes.VolumeA volumeA(dynamic_composition_balance = false, steady_state = true, V = 1.e-6, Ce2(Q(start = -4.6367791499652465E-36)), continuous_flow_reversal = true, dynamic_mass_balance = false, dynamic_energy_balance = false, diffusion = true, P(start = 200002.5108577)) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}))); - InstrumentationAndControl.Blocks.Sources.Rampe rampe(Duration = 10, Initialvalue = 1e5, Finalvalue = 5e5) annotation( - Placement(transformation(extent = {{60, -40}, {80, -20}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff(start = 4.4340701734837724E-07)) annotation( - Placement(transformation(extent = {{-70, -10}, {-50, 10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3(gamma_diff(start = 4.4336099270975624E-07)) annotation( - Placement(transformation(extent = {{50, -10}, {70, 10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia = false) annotation( - Placement(transformation(extent = {{-70, 40}, {-50, 60}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(continuous_flow_reversal = false, T0 = 288.15, diffusion = true) annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}))); - PressureLosses.ControlValve controlValve1(Pm(start = 201722.05301761828)) annotation( - Placement(transformation(extent = {{-40, -4}, {-20, 16}}))); - PressureLosses.ControlValve controlValve2(C2(Q(start = 0)), Pm(start = 250001.25542885027)) annotation( - Placement(transformation(extent = {{-40, 46}, {-20, 66}}))); - PressureLosses.ControlValve controlValve3(Pm(start = 198282.96276544)) annotation( - Placement(transformation(extent = {{20, -4}, {40, 16}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante1(k = 1) annotation( - Placement(transformation(extent = {{-56, 24}, {-44, 36}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante2(k = 0) annotation( - Placement(transformation(extent = {{-56, 74}, {-44, 86}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante3 annotation( - Placement(transformation(extent = {{4, 22}, {16, 34}}))); -equation - connect(rampe.y, sinkP.IPressure) annotation( - Line(points = {{81, -30}, {100, -30}, {100, 0}, {95, 0}}, color = {0, 0, 255})); - connect(sourceP1.C, lumpedStraightPipe1.C1) annotation( - Line(points = {{-80, 0}, {-70, 0}}, color = {0, 0, 0})); - connect(lumpedStraightPipe3.C2, sinkP.C) annotation( - Line(points = {{70, 0}, {80, 0}}, color = {0, 0, 0})); - connect(sourceP2.C, lumpedStraightPipe2.C1) annotation( - Line(points = {{-80, 50}, {-70, 50}}, color = {0, 0, 0})); - connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation( - Line(points = {{-50, 0}, {-40, 0}}, color = {0, 0, 0})); - connect(lumpedStraightPipe2.C2, controlValve2.C1) annotation( - Line(points = {{-50, 50}, {-40, 50}}, color = {0, 0, 0})); - connect(controlValve2.C2, volumeA.Ce2) annotation( - Line(points = {{-20, 50}, {0, 50}, {0, 10}}, color = {0, 0, 0})); - connect(volumeA.Cs1, controlValve3.C1) annotation( - Line(points = {{10, 0}, {20, 0}}, color = {0, 0, 0})); - connect(controlValve3.C2, lumpedStraightPipe3.C1) annotation( - Line(points = {{40, 0}, {50, 0}}, color = {0, 0, 0})); - connect(constante1.y, controlValve1.Ouv) annotation( - Line(points = {{-43.4, 30}, {-30, 30}, {-30, 17}}, color = {0, 0, 255})); - connect(constante2.y, controlValve2.Ouv) annotation( - Line(points = {{-43.4, 80}, {-30, 80}, {-30, 67}}, color = {0, 0, 255})); - connect(constante3.y, controlValve3.Ouv) annotation( - Line(points = {{16.6, 28}, {30, 28}, {30, 17}}, color = {0, 0, 255})); - connect(volumeA.Ce1, controlValve1.C2) annotation( - Line(points = {{-10, 0}, {-20, 0}}, color = {0, 0, 255})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - experiment(StopTime = 12), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestVolumeA; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo deleted file mode 100644 index 2c130464..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeA1.mo +++ /dev/null @@ -1,45 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestVolumeA1 - ThermoSysPro.Fluid.Volumes.VolumeA volumeA(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, Ce2(Q(start = 5381683.17323685)), Cs1(Q(start = 5381683.173236847)), Cs2(Q(start = 5381683.173236847)), Xo2(start = 0.22), h(start = 999999.9999999997), dynamic_energy_balance = false) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(rho(start = 164.8075648419657)) annotation( - Placement(transformation(extent = {{-60, 20}, {-40, 40}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( - Placement(transformation(extent = {{-60, -40}, {-40, -20}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( - Placement(transformation(extent = {{40, 20}, {60, 40}}))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 annotation( - Placement(transformation(extent = {{40, -40}, {60, -20}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = false, h0 = 1e6, P0 = 600e5) annotation( - Placement(transformation(extent = {{-100, 20}, {-80, 40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, T0 = 1000, option_temperature = false, h0 = 1e6, P0 = 600e5) annotation( - Placement(transformation(extent = {{-100, -40}, {-80, -20}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature = false) annotation( - Placement(transformation(extent = {{80, 20}, {100, 40}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(option_temperature = false) annotation( - Placement(transformation(extent = {{80, -40}, {100, -20}}))); -equation - connect(singularPressureLoss.C2, volumeA.Ce2) annotation( - Line(points = {{-40, 30}, {0, 30}, {0, 10}}, color = {0, 0, 0})); - connect(singularPressureLoss1.C2, volumeA.Ce1) annotation( - Line(points = {{-40, -30}, {-20, -30}, {-20, 0}, {-10, 0}}, color = {0, 0, 0})); - connect(volumeA.Cs1, singularPressureLoss2.C1) annotation( - Line(points = {{10, 0}, {10, 0}, {20, 0}, {20, 30}, {40, 30}, {40, 30}}, color = {0, 0, 0})); - connect(volumeA.Cs2, singularPressureLoss3.C1) annotation( - Line(points = {{0, -10}, {0, -10}, {0, -30}, {40, -30}, {40, -30}}, color = {0, 0, 0})); - connect(sourceP.C, singularPressureLoss.C1) annotation( - Line(points = {{-80, 30}, {-60, 30}}, color = {0, 0, 0})); - connect(sourceP1.C, singularPressureLoss1.C1) annotation( - Line(points = {{-80, -30}, {-60, -30}}, color = {0, 0, 0})); - connect(singularPressureLoss2.C2, sinkP.C) annotation( - Line(points = {{60, 30}, {70, 30}, {70, 30}, {80, 30}}, color = {0, 0, 0})); - connect(singularPressureLoss3.C2, sinkP1.C) annotation( - Line(points = {{60, -30}, {70, -30}, {70, -30}, {80, -30}}, color = {0, 0, 0})); - annotation( - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - "), - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); -end TestVolumeA1; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo deleted file mode 100644 index f87e8877..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/TestVolumeI.mo +++ /dev/null @@ -1,66 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples; - -model TestVolumeI - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(continuous_flow_reversal = true, T0 = 288.15, diffusion = true) annotation( - Placement(transformation(extent = {{-100, -10}, {-80, 10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(Q(start = 356.3142593657128), P0 = 300000, T0 = 369.15, diffusion = true) annotation( - Placement(transformation(extent = {{80, -10}, {100, 10}}))); - Volumes.VolumeI volumeA(dynamic_composition_balance = false, steady_state = true, V = 1.e-6, Ce2(Q(start = -1.2064107019298721E-33)), continuous_flow_reversal = true, dynamic_mass_balance = false, diffusion = false, dynamic_energy_balance = true, P(start = 200002.5108577), h(start = 63269.22110794238)) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}))); - InstrumentationAndControl.Blocks.Sources.Rampe rampe(Duration = 10, Initialvalue = 1e5, Finalvalue = 5e5) annotation( - Placement(transformation(extent = {{60, -40}, {80, -20}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(gamma_diff(start = 4.4340701734837724E-07)) annotation( - Placement(transformation(extent = {{-70, -10}, {-50, 10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe3 annotation( - Placement(transformation(extent = {{50, -10}, {70, 10}}))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe2(inertia = false) annotation( - Placement(transformation(extent = {{-70, 40}, {-50, 60}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(continuous_flow_reversal = false, T0 = 288.15, diffusion = true) annotation( - Placement(transformation(extent = {{-100, 40}, {-80, 60}}))); - PressureLosses.ControlValve controlValve1(Pm(start = 201722.05301761828)) annotation( - Placement(transformation(extent = {{-40, -4}, {-20, 16}}))); - PressureLosses.ControlValve controlValve2(C2(Q(start = 0)), Pm(start = 250001.25542885027)) annotation( - Placement(transformation(extent = {{-40, 46}, {-20, 66}}))); - PressureLosses.ControlValve controlValve3(Pm(start = 198282.96276544)) annotation( - Placement(transformation(extent = {{20, -4}, {40, 16}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante1(k = 1) annotation( - Placement(transformation(extent = {{-56, 24}, {-44, 36}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante2(k = 0) annotation( - Placement(transformation(extent = {{-56, 74}, {-44, 86}}))); - InstrumentationAndControl.Blocks.Sources.Constante constante3 annotation( - Placement(transformation(extent = {{4, 22}, {16, 34}}))); -equation - connect(rampe.y, sinkP.IPressure) annotation( - Line(points = {{81, -30}, {100, -30}, {100, 0}, {95, 0}}, color = {0, 0, 255})); - connect(sourceP1.C, lumpedStraightPipe1.C1) annotation( - Line(points = {{-80, 0}, {-70, 0}}, color = {0, 0, 0})); - connect(lumpedStraightPipe3.C2, sinkP.C) annotation( - Line(points = {{70, 0}, {80, 0}}, color = {0, 0, 0})); - connect(sourceP2.C, lumpedStraightPipe2.C1) annotation( - Line(points = {{-80, 50}, {-70, 50}}, color = {0, 0, 0})); - connect(lumpedStraightPipe1.C2, controlValve1.C1) annotation( - Line(points = {{-50, 0}, {-40, 0}}, color = {0, 0, 0})); - connect(lumpedStraightPipe2.C2, controlValve2.C1) annotation( - Line(points = {{-50, 50}, {-40, 50}}, color = {0, 0, 0})); - connect(controlValve3.C2, lumpedStraightPipe3.C1) annotation( - Line(points = {{40, 0}, {50, 0}}, color = {0, 0, 0})); - connect(constante1.y, controlValve1.Ouv) annotation( - Line(points = {{-43.4, 30}, {-30, 30}, {-30, 17}}, color = {0, 0, 255})); - connect(constante2.y, controlValve2.Ouv) annotation( - Line(points = {{-43.4, 80}, {-30, 80}, {-30, 67}}, color = {0, 0, 255})); - connect(constante3.y, controlValve3.Ouv) annotation( - Line(points = {{16.6, 28}, {30, 28}, {30, 17}}, color = {0, 0, 255})); - connect(controlValve1.C2, volumeA.Ce2) annotation( - Line(points = {{-20, 0}, {-10, 0}}, color = {0, 0, 0})); - connect(controlValve2.C2, volumeA.Ce1) annotation( - Line(points = {{-20, 50}, {-14, 50}, {-14, 8}, {-10, 8}}, color = {0, 0, 0})); - connect(volumeA.Cs2, controlValve3.C1) annotation( - Line(points = {{10, 0}, {20, 0}}, color = {0, 0, 0})); - annotation( - Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), - experiment(StopTime = 12), - Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end TestVolumeI; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo new file mode 100644 index 00000000..653e56e1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestDynamicDrum + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.DynamicDrum drum( + redeclare package Medium = Medium, + Vertical=false, + steady_state=false, + Vv(start=39), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + P0=13000000, + P(start=13000000, fixed=true), + Tp(start=592.6), + zl(start=1.05)) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={80,-20}))); +equation + + connect(drum.Cs, sinkQ.C) annotation (Line(points={{40,-2},{64,-2},{64,-20},{70,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestDynamicDrum; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo new file mode 100644 index 00000000..2b29f22e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo @@ -0,0 +1,37 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestDynamicDrum_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.DynamicDrum drum( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=drum.xv), + Vertical=false, + steady_state=false, + Vv(start=39), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + P0=13000000, + P(start=13000000, fixed=true), + Tp(start=592.6), + zl(start=1.05), + SubCl0={0}, + SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={80,-20}))); +equation + + connect(drum.Cs, sinkQ.C) annotation (Line(points={{40,-2},{64,-2},{64,-20},{70,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestDynamicDrum_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo new file mode 100644 index 00000000..ca7ac920 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer.mo @@ -0,0 +1,123 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestPressurizer + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.Power Wch(fixed=true) = 0.29e6 "Power released by the electrical heaters"; + parameter Real OUVfeedwaterValve(fixed=true) = 0.01 "Position of the feedwater valve"; + + ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( + redeclare package Medium = Medium, + Zm=10.15, + Klv=0.5e6, + cpp=600, + hl(start=1629887.98290107), + hv(start=2596216.59571565), + Zl(start=5.5900717167325), + Yw0=32.92, + steady_state=false, + V=61.12, + Rp=1.27, + Ae=96.23, + Klp=1780, + Kvp=7500, + Mp=107e3, + Kpa=5.63, + Ccond=0.02, + Cevap=0.05, + Yw(start=32.92), + y(start=0.3292), + P0=15500000, + P(start=15500000), + Tp(start=617.94155291055)) + annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray( + Cv(start=100), + C1( + P(start=160e5), + h_vol_2(start=1270e3), + Q(start=0.3), + h(start=1270e3)), + Q(fixed=false, start=0.32), + Cvmax=5000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,36},{-60,56}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + option_temperature=false, + h0=1270e3, + P0=16000000, + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-138,30},{-118,50}}, rotation=0))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005; 300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(transformation(extent={{-104,60},{-78,86}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + Cv(start=25000), + Cvmax(fixed=true) = 5000, + Pm(start=15500000), + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{88,36},{108,56}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=true) = 0.5) annotation (Placement(transformation(extent={{30,62},{50,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + Q0=0, + h0=3e6, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{136,30},{156,50}}, rotation=0))); + Thermal.BoundaryConditions.HeatSource SourceC1( + option_temperature=2, + T0={310}, + W0={1e5}) annotation (Placement(transformation( + origin={-67,-12}, + extent={{-17,17},{17,-17}}, + rotation=270))); + Thermal.BoundaryConditions.HeatSource SourceC2( + T0={310}, + W0={0.286e6}, + option_temperature=1) annotation (Placement(transformation( + origin={-67,11}, + extent={{-17,17},{17,-17}}, + rotation=270))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(extent={{-109,-25},{-83,1}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipe( + z1=1, + z2=0, + C1(P(start=160e5), redeclare package Medium = Medium), + C2(P(start=160e5), redeclare package Medium = Medium), + Q(fixed=false, start=0)) annotation (Placement(transformation( + origin={10,-44}, + extent={{10,-10},{-10,10}}, + rotation=90))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( + Q0=0, + h0=1600000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{12,-78},{32,-58}}, rotation=0))); + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau( + Ti=50, + add(k1=+1, k2=-1), + minval=-100, + pIsat( + Limiteur1(u(signal(start=0.001))), + ureset0=0.0, + maxval=100, + Ti=2000)) annotation (Placement(transformation(extent={{94,-54},{66,-28}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92) annotation (Placement(transformation(extent={{129,-58},{110,-39}}, rotation=0))); +equation + connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(points={{-76.7,73},{-70,73},{-70,57}}, color={0,0,255})); + connect(SteamrValve_O.y, SteamValve.Ouv) annotation (Line(points={{51,72},{98,72},{98,57}})); + connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{40,39.4},{64,39.4},{64,40},{88,40}}, color={0,0,0})); + connect(sinkQ.C, SteamValve.C2) annotation (Line(points={{136,40},{108,40}}, color={0,0,0})); + connect(sourceP.C, FeedwaterValve_Spray.C1) annotation (Line(points={{-118,40},{-80,40}}, color={0,0,0})); + connect(FeedwaterValve_Spray.C2, pressurizer.Cas) annotation (Line(points={{-60,40},{-24,40},{-24,48},{10,48},{10,40}}, color={0,0,0})); + connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-50.34,11},{-33.67,11},{-33.67,10.6},{-17,10.6}}, color={191,95,0})); + connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-50.34,-12},{10,-12},{10,0.4}}, color={191,95,0})); + connect(ElectricalHeaters.y, SourceC1.ISignal) annotation (Line(points={{-81.7,-12},{-75.5,-12}}, color={0,0,255})); + connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line( + points={{109.05,-48.5},{106,-48.5},{106,-48.8},{94.7,-48.8}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(points={{65.3,-52.7},{22,-52.7},{22,-63}}, color={0,0,255})); + connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(points={{37,10},{100,10},{100,-29.3},{94.7,-29.3}}, color={0,0,255})); + connect(pressurizer.Cex, lumpedStraightPipe.C1) annotation (Line(points={{10,-20},{10,-34}}, color={0,0,0})); + connect(lumpedStraightPipe.C2, sinkQ1.C) annotation (Line(points={{10,-54},{10,-68},{12,-68}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestPressurizer; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo new file mode 100644 index 00000000..7c770e2a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo @@ -0,0 +1,126 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestPressurizer_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + parameter Units.SI.Power Wch(fixed=true) = 0.29e6 "Power released by the electrical heaters"; + parameter Real OUVfeedwaterValve(fixed=true) = 0.01 "Position of the feedwater valve"; + + ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=1), + Zm=10.15, + Klv=0.5e6, + cpp=600, + hl(start=1629887.98290107), + hv(start=2596216.59571565), + Zl(start=5.5900717167325), + Yw0=32.92, + steady_state=false, + V=61.12, + Rp=1.27, + Ae=96.23, + Klp=1780, + Kvp=7500, + Mp=107e3, + Kpa=5.63, + Ccond=0.02, + Cevap=0.05, + Yw(start=32.92), + y(start=0.3292), + P0=15500000, + P(start=15500000), + Tp(start=617.94155291055), + SubCl0={0}, + SubCv0={10}) + annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray( + Cv(start=100), + C1( + P(start=160e5), + h_vol_2(start=1270e3), + Q(start=0.3), + h(start=1270e3)), + Q(fixed=false, start=0.32), + Cvmax=5000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,36},{-60,56}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + option_temperature=false, + h0=1270e3, + P0=16000000, + redeclare package Medium = Medium, + SubC0={10}) annotation (Placement(transformation(extent={{-138,30},{-118,50}}, rotation=0))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps FeedwaterValveSpray(Table=[0,OUVfeedwaterValve; 200,OUVfeedwaterValve; 250,OUVfeedwaterValve + 0.005; 300,OUVfeedwaterValve + 0.005; 400,0; 1000,0]) annotation (Placement(transformation(extent={{-104,60},{-78,86}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + Cv(start=25000), + Cvmax(fixed=true) = 5000, + Pm(start=15500000), + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{88,36},{108,56}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed=true) = 0.5) annotation (Placement(transformation(extent={{30,62},{50,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + Q0=0, + h0=3e6, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{136,30},{156,50}}, rotation=0))); + Thermal.BoundaryConditions.HeatSource SourceC1( + option_temperature=2, + T0={310}, + W0={1e5}) annotation (Placement(transformation( + origin={-67,-12}, + extent={{-17,17},{17,-17}}, + rotation=270))); + Thermal.BoundaryConditions.HeatSource SourceC2( + T0={310}, + W0={0.286e6}, + option_temperature=1) annotation (Placement(transformation( + origin={-67,11}, + extent={{-17,17},{17,-17}}, + rotation=270))); + InstrumentationAndControl.Blocks.Tables.Table1DTemps ElectricalHeaters(Table=[0,Wch; 100,Wch; 110,Wch; 120,Wch; 300,Wch; 1200,Wch; 1400,Wch*7.75; 1600,Wch*7.75; 1900,Wch; 3000,Wch]) annotation (Placement(transformation(extent={{-109,-25},{-83,1}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipe( + z1=1, + z2=0, + C1(P(start=160e5), redeclare package Medium = Medium), + C2(P(start=160e5), redeclare package Medium = Medium), + Q(fixed=false, start=0)) annotation (Placement(transformation( + origin={10,-44}, + extent={{10,-10},{-10,10}}, + rotation=90))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( + Q0=0, + h0=1600000, + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{12,-78},{32,-58}}, rotation=0))); + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau( + Ti=50, + add(k1=+1, k2=-1), + minval=-100, + pIsat( + Limiteur1(u(signal(start=0.001))), + ureset0=0.0, + maxval=100, + Ti=2000)) annotation (Placement(transformation(extent={{94,-54},{66,-28}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante Level_y100(k=32.92) annotation (Placement(transformation(extent={{129,-58},{110,-39}}, rotation=0))); +equation + connect(FeedwaterValveSpray.y, FeedwaterValve_Spray.Ouv) annotation (Line(points={{-76.7,73},{-70,73},{-70,57}}, color={0,0,255})); + connect(SteamrValve_O.y, SteamValve.Ouv) annotation (Line(points={{51,72},{98,72},{98,57}})); + connect(pressurizer.Cs, SteamValve.C1) annotation (Line(points={{40,39.4},{64,39.4},{64,40},{88,40}}, color={0,0,0})); + connect(sinkQ.C, SteamValve.C2) annotation (Line(points={{136,40},{108,40}}, color={0,0,0})); + connect(sourceP.C, FeedwaterValve_Spray.C1) annotation (Line(points={{-118,40},{-80,40}}, color={0,0,0})); + connect(FeedwaterValve_Spray.C2, pressurizer.Cas) annotation (Line(points={{-60,40},{-24,40},{-24,48},{10,48},{10,40}}, color={0,0,0})); + connect(SourceC2.C[1], pressurizer.Ca) annotation (Line(points={{-50.34,11},{-33.67,11},{-33.67,10.6},{-17,10.6}}, color={191,95,0})); + connect(SourceC1.C[1], pressurizer.Cc) annotation (Line(points={{-50.34,-12},{10,-12},{10,0.4}}, color={191,95,0})); + connect(ElectricalHeaters.y, SourceC1.ISignal) annotation (Line(points={{-81.7,-12},{-75.5,-12}}, color={0,0,255})); + connect(Level_y100.y, regulation_Niveau.ConsigneNiveauEau) annotation (Line( + points={{109.05,-48.5},{106,-48.5},{106,-48.8},{94.7,-48.8}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(regulation_Niveau.SortieReelle1, sinkQ1.IMassFlow) annotation (Line(points={{65.3,-52.7},{22,-52.7},{22,-63}}, color={0,0,255})); + connect(pressurizer.yLevel, regulation_Niveau.MesureNiveauEau) annotation (Line(points={{37,10},{100,10},{100,-29.3},{94.7,-29.3}}, color={0,0,255})); + connect(pressurizer.Cex, lumpedStraightPipe.C1) annotation (Line(points={{10,-20},{10,-34}}, color={0,0,0})); + connect(lumpedStraightPipe.C2, sinkQ1.C) annotation (Line(points={{10,-54},{10,-68},{12,-68}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestPressurizer_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo new file mode 100644 index 00000000..4c6c1f47 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_Traces_withPipePressureLosses.mo @@ -0,0 +1,65 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTankHorizontal_Traces_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.TankHorizontal Tank1( + redeclare package Medium = Medium, + SubC(start={0.9}), + z(fixed=false, start=1), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-5},{20,-5},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-20,5},{-10,5}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,4.9},{20,4.9},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestTankHorizontal_Traces_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo new file mode 100644 index 00000000..b8ff2542 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTankHorizontal_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.TankHorizontal Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=1), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-5},{20,-5},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-20,5},{-10,5}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,4.9},{20,4.9},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestTankHorizontal_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo new file mode 100644 index 00000000..0107dd5f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo @@ -0,0 +1,66 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTank_Traces_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + SubC(start={0.9}), + z(fixed=false, start=5), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-6},{20,-6},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-10,6}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,6},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestTank_Traces_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo new file mode 100644 index 00000000..24010d0b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTank_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=5), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation (Placement(transformation(extent={{-90,30},{-70,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-4},{90,16}}, rotation=0))); +equation + connect(PerteDP1.C2, PuitsP1.C) annotation (Line(points={{50,-40},{70,-40}}, color={0,0,255})); + connect(SourceP1.C, VanneReglante1.C1) annotation (Line(points={{-70,6},{-50,6}}, color={0,0,255})); + connect(Tank1.Cs2, PerteDP1.C1) annotation (Line(points={{10,-6},{20,-6},{20,-40},{30,-40}}, color={0,0,255})); + connect(Rampe1.y, VanneReglante1.Ouv) annotation (Line(points={{-69,40},{-40,40},{-40,23}})); + connect(VanneReglante1.C2, Tank1.Ce1) annotation (Line(points={{-30,6},{-20,6},{-10,6}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,6},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{50,6},{50,6},{70,6}}, color={0,0,255})); + annotation ( + experiment(StopTime=20), + Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), + Documentation(info=" +

    Copyright © EDF 2002 - 2024

    +

    ThermoSysPro Version 4.1 +")); +end TestTank_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo new file mode 100644 index 00000000..59e389cc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo @@ -0,0 +1,60 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavity + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavity cavity( + redeclare package Medium = Medium, + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=1, + Vf0=0.5, + Cal_hconv=false) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400) annotation (Placement(transformation(extent={{-90,20},{-70,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteam( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6) annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, + Q0=2) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource3a( + T0={293.15,293.15}, + option_temperature=2, + W0={1e5,1e5}) + annotation (Placement(transformation(extent={{70,50},{90,70}}, rotation=0))); +equation + cavity.Cth3[3:2*cavity.Ns].W = fill(0, 2*cavity.Ns - 2); + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-70,30},{-40,30},{-40,32},{-1.66667,32}}, + color={0,0,0})); + connect(sourceSteam.C, cavity.Cv) annotation (Line(points={{-40,60},{10.3333,60},{10.3333,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10.3333,-12},{10.3333,-50},{-90,-50}}, + color={0,0,0})); + connect(heatSource1.C, cavity.Cth1) annotation (Line(points={{70,-69.8},{20,-69.8},{20,-5.3},{10.1667,-5.3}},color={255,0,0})); + connect(heatSource2.C, cavity.Cth2) annotation (Line(points={{80,0.2},{42,0.2},{42,25.1},{10.1667,25.1}}, + color={255,0,0})); + connect(cavity.Cth3, heatSource3a.C) annotation (Line(points={{10.1667,10.6},{58,10.6},{58,50.2},{80,50.2}}, color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavity; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo new file mode 100644 index 00000000..b435abf8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavityOnePipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavityOnePipe cavity( + redeclare package Medium = Medium, + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + hvIn(start=2.8e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=2, + Vf0=0.5, + Cal_hcond=false) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamBP( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6) annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamGCT( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, + Q0=3) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={293.15, 293.15}, + option_temperature=2, + W0={1e5, 1e5}) annotation (Placement(transformation(extent={{70,30},{90,50}}, rotation=0))); +equation + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-80,10},{-26,10},{-26,25.8},{-12.971,25.8}}, + color={0,0,0})); + connect(sourceSteamBP.C, cavity.CvBP) annotation (Line(points={{-60,60},{9.82857,60},{9.82857,32}}, + color={0,0,0})); + connect(sourceSteamGCT.C, cavity.CvGCT) annotation (Line(points={{-90,60},{-84,60},{-84,46},{-2.857,46},{-2.857,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10,-12},{10,-34},{-94,-34},{-94,-50},{-90,-50}}, + color={0,0,0})); + connect(cavity.Cth3, heatSource.C) annotation (Line(points={{9.82857,21.2},{50,21.2},{50,30.2},{80,30.2}}, + color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavityOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo new file mode 100644 index 00000000..7a5465cd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo @@ -0,0 +1,63 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavityOnePipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavityOnePipe cavity( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=cavity.xv), + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + hvIn(start=2.8e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=2, + Vf0=0.5, + Cal_hcond=false, + SubCl0={1}, + SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400, + SubC0={1}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamBP( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6, + SubC0={10}) annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamGCT( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6, + SubC0={10}) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, Q0=3) + annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0={293.15, 293.15}, + option_temperature=2, + W0={1e5, 1e5}) annotation (Placement(transformation(extent={{70,30},{90,50}}, rotation=0))); +equation + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-80,10},{-26,10},{-26,25.8},{-12.971,25.8}}, + color={0,0,0})); + connect(sourceSteamBP.C, cavity.CvBP) annotation (Line(points={{-60,60},{9.82857,60},{9.82857,32}}, + color={0,0,0})); + connect(sourceSteamGCT.C, cavity.CvGCT) annotation (Line(points={{-90,60},{-84,60},{-84,46},{-2.857,46},{-2.857,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10,-12},{10,-34},{-94,-34},{-94,-50},{-90,-50}}, + color={0,0,0})); + connect(cavity.Cth3, heatSource.C) annotation (Line(points={{9.82857,21.2},{50,21.2},{50,30.2},{80,30.2}}, + color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavityOnePipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo new file mode 100644 index 00000000..c526b9af --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo @@ -0,0 +1,65 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseCavity_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.TwoPhaseCavity cavity( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=cavity.xv), + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + Ns=1, + Vf0=0.5, + Cal_hconv=false, + SubCl0={0}, + SubCv0={0}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=1, + h0=1454400, + SubC0={0}) annotation (Placement(transformation(extent={{-90,20},{-70,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteam( + redeclare package Medium = Medium, + Q0=1, + h0=2.8e6, + SubC0={10}) annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater( + redeclare package Medium = Medium, + Q0=2) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0))); + + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + W0={1e5}) annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0))); + Thermal.BoundaryConditions.HeatSource heatSource3a( + T0={293.15,293.15}, + option_temperature=2, + W0={1e5,1e5}) + annotation (Placement(transformation(extent={{68,56},{88,76}}, rotation=0))); +equation + cavity.Cth3[3:2*cavity.Ns].W = fill(0, 2*cavity.Ns - 2); + connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-70,30},{-40,30},{-40,32},{-1.66667,32}}, + color={0,0,0})); + connect(sourceSteam.C, cavity.Cv) annotation (Line(points={{-40,60},{10.3333,60},{10.3333,32}}, + color={0,0,0})); + connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10.3333,-12},{10.3333,-50},{-90,-50}}, + color={0,0,0})); + connect(heatSource1.C, cavity.Cth1) annotation (Line(points={{70,-69.8},{20,-69.8},{20,-5.3},{10.1667,-5.3}},color={255,0,0})); + connect(heatSource2.C, cavity.Cth2) annotation (Line(points={{80,0.2},{42,0.2},{42,25.1},{10.1667,25.1}}, + color={255,0,0})); + connect(cavity.Cth3, heatSource3a.C) annotation (Line(points={{10.1667,10.6},{64,10.6},{64,52},{78,52},{78,56.2}}, color={255,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseCavity_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo new file mode 100644 index 00000000..1279de8f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseVolume + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Volumes.TwoPhaseVolume volume( + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + V=80, + A=20, + Vf0=0.5, + redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,-40}))); +equation + connect(sinkQ.C, volume.Cl) annotation (Line(points={{20,-40},{10,-40},{10,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseVolume; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo new file mode 100644 index 00000000..b3ab2755 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTwoPhaseVolume_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.Volumes.TwoPhaseVolume volume( + redeclare package Medium = Medium, + redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=volume.xv), + steady_state=false, + P0=13000000, + P(start=13000000, fixed=true), + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + V=80, + A=20, + Vf0=0.5, + SubCl0={0}, + SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,-40}))); +equation + connect(sinkQ.C, volume.Cl) annotation (Line(points={{20,-40},{10,-40},{10,-20}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}}))); +end TestTwoPhaseVolume_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo new file mode 100644 index 00000000..13e231d2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeA + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeA.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeA; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo new file mode 100644 index 00000000..6b2789bd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeATh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); +equation + connect(sourcePQ.C, volumeATh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeATh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeATh.Cs1, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(heatSource.C[1], volumeATh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeATh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo new file mode 100644 index 00000000..2f1a9e64 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeATh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0 = {573.15}) annotation( + Placement(transformation(extent = {{-10, -20}, {10, -40}}))); +equation + connect(sourcePQ.C, volumeATh.Ce1) annotation( + Line(points = {{-30, 0}, {-10, 0}}, color = {0, 0, 0})); + connect(volumeATh.Ce2, sourceQ.C) annotation( + Line(points = {{0, 10}, {0, 30}, {-30, 30}}, color = {0, 0, 0})); + connect(volumeATh.Cs1, sink.C) annotation( + Line(points = {{10, 0}, {30, 0}}, color = {0, 0, 0})); + connect(volumeATh.Cth, heatSource.C[1]) annotation( + Line(points = {{0, 0}, {0, -20.2}}, color = {0, 0, 0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeATh_FlueGases; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo new file mode 100644 index 00000000..ecbf2734 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeATh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-20},{10,-40}}))); +equation + connect(sourcePQ.C, volumeATh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeATh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeATh.Cs1, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeATh.Cth, heatSource.C[1]) annotation (Line(points={{0,0},{0,-20.2}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeATh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo new file mode 100644 index 00000000..a154a30d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeA_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(volumeA.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeA_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo new file mode 100644 index 00000000..35f5de29 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeA_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare + replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable + package Medium = Medium, + SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30, + 30}}, color={0,0,0})); + connect(volumeA.Cs1, sink.C) + annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeA_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo new file mode 100644 index 00000000..70a46a81 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeB + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,28},{40,48}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={42,0}))); +equation + connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21,7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,38},{20,38}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeB; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo new file mode 100644 index 00000000..927f3cd4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo @@ -0,0 +1,23 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeBTh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,38}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={42,0}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); +equation + connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21,7.21645e-16},{32,7.21645e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,19},{-5.55112e-16,19},{-5.55112e-16,28}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeBTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo new file mode 100644 index 00000000..ae9b8890 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeBTh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={40,0}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); +equation + connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{25,0},{25,6.66134e-16},{30,6.66134e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,20},{-5.55112e-16,20},{-5.55112e-16,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeBTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo new file mode 100644 index 00000000..23543d62 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeBTh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,36}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={38,0}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); +equation + connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{19,0},{19,7.21645e-16},{28,7.21645e-16}}, color={0,0,0})); + connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{-6.66134e-16,26}}, color={0,0,0})); + connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeBTh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo new file mode 100644 index 00000000..034bfd84 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeB_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={40,0}))); +equation + connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{23,0},{23,7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeB_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo new file mode 100644 index 00000000..1622f1d4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeB_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeB volumeB( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={40,0}))); +equation + connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{24,0},{24,7.21645e-16},{30,7.21645e-16}}, color={0,0,0})); + connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,30},{20,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeB_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo new file mode 100644 index 00000000..60ba1d38 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo @@ -0,0 +1,15 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeC + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeC; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo new file mode 100644 index 00000000..ff030840 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeCTh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-26},{10,-46}}))); +equation + connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeCTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo new file mode 100644 index 00000000..224fc061 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeCTh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-24},{10,-44}}))); +equation + connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeCTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo new file mode 100644 index 00000000..7b584788 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeCTh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1}) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}}))); +equation + connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeCTh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo new file mode 100644 index 00000000..e17f46c6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeC_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeC_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo new file mode 100644 index 00000000..77037832 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1}) + annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); +equation + connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0})); + connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo new file mode 100644 index 00000000..141159c5 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo @@ -0,0 +1,15 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeD + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeD volumeD(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{12,22},{32,42}}))); +equation + connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(volumeD.Cs3, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeD.Cs1, sinkQ.C) annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeD; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo new file mode 100644 index 00000000..7f9fc507 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeDTh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{12,22},{32,42}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); +equation + connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(volumeDTh.Cs1, sinkQ.C) annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0})); + connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeDTh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo new file mode 100644 index 00000000..25920676 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeDTh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-28},{10,-48}}))); +equation + connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); + connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeDTh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo new file mode 100644 index 00000000..bd6a3ae9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeDTh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); +equation + connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); + connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeDTh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo new file mode 100644 index 00000000..aad09e10 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeD_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeD volumeD(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); +equation + connect(volumeD.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0})); + connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(volumeD.Cs3, sinkQ.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeD_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo new file mode 100644 index 00000000..767e33ce --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeD_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeD volumeD( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={40,0}))); +equation + connect(volumeD.Cs1, sink.C) annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(volumeD.Cs3, sinkQ.C) annotation (Line(points={{8,0},{30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeD_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo new file mode 100644 index 00000000..4ffc4874 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo @@ -0,0 +1,15 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeI + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}}))); +equation + connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo new file mode 100644 index 00000000..7bb2b515 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo @@ -0,0 +1,18 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeITh + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-24},{10,-44}}))); +equation + connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0})); + connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeITh; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo new file mode 100644 index 00000000..dd23d458 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeITh_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,-18},{46,2}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-40,20}))); + Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-26},{10,-46}}))); +equation + connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); + connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeITh_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo new file mode 100644 index 00000000..9b182a61 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeITh_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18},{-36,38}}))); + Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-12,-28},{8,-48}}))); +equation + connect(volumeITh.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); + connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeITh_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo new file mode 100644 index 00000000..b8b11661 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeI_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{26,-18},{46,2}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-40,20}))); +equation + connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0})); + connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeI_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo new file mode 100644 index 00000000..3ee353d0 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestVolumeI_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeI volumeI( + redeclare package Medium = Medium, + V=1, + dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare replaceable package Medium = Medium, + Q0=100, + SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18},{-36,38}}))); +equation + connect(volumeI.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0})); + connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0})); + connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestVolumeI_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo new file mode 100644 index 00000000..e67a9f76 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Volumes + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Volumes; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order new file mode 100644 index 00000000..f8cc92cc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order @@ -0,0 +1,44 @@ +TestVolumeC +TestVolumeC_FlueGases +TestVolumeC_Traces +TestVolumeA +TestVolumeA_FlueGases +TestVolumeA_Traces +TestVolumeD +TestVolumeD_FlueGases +TestVolumeD_Traces +TestVolumeB +TestVolumeB_FlueGases +TestVolumeB_Traces +TestVolumeI +TestVolumeI_FlueGases +TestVolumeI_Traces +TestVolumeATh +TestVolumeATh_Traces +TestVolumeATh_FlueGases +TestVolumeBTh +TestVolumeBTh_FlueGases +TestVolumeBTh_Traces +TestVolumeCTh +TestVolumeCTh_FlueGases +TestVolumeCTh_Traces +TestVolumeDTh +TestVolumeDTh_FlueGases +TestVolumeDTh_Traces +TestVolumeITh +TestVolumeITh_FlueGases +TestVolumeITh_Traces +TestTank_withPipePressureLosses +TestTank_Traces_withPipePressureLosses +TestTankHorizontal_withPipePressureLosses +TestTankHorizontal_Traces_withPipePressureLosses +TestDynamicDrum +TestDynamicDrum_Traces +TestTwoPhaseVolume +TestTwoPhaseVolume_Traces +TestTwoPhaseCavity +TestTwoPhaseCavity_Traces +TestTwoPhaseCavityOnePipe +TestTwoPhaseCavityOnePipe_Traces +TestPressurizer +TestPressurizer_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order index d459818c..6f19330f 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order @@ -1,88 +1,11 @@ -TestAirHumidity -TestBend -TestBoilerSystem -TestCentrifugalPump1 -TestCheckValve -TestCHPEngineBarkantineSystem -TestCombustionTurbine -TestCompressor -TestDiaphragm -TestDiffusion_DynamicOnePhaseFlowPipe -TestDiffusion_DynamicPlateHeatExchanger -TestDiffusion_DynamicTwoPhaseFlowPipe -TestDiffusion_VolumeA -TestDynamicCheckValve -TestDynamicCondenser -TestDynamicDrum -TestDynamicDrum_CC -TestDynamicFlueGasesMultiFluidHeatExchanger -TestDynamicMultiFluidHeatExchanger -TestDynamicMultiFluidHeatExchangerShell -TestDynamicOnePhaseFlowPipe -TestDynamicOnePhaseFlowShell -TestDynamicPlateHeatExchanger -TestDynamicReliefValve -TestDynamicTwoPhaseFlowPipe -TestDynamicTwoPhaseFlowRiser -TestDynamicWaterHeating -TestDynamicWaterHeatingOnePipe -TestDynamicWaterSteamMultiFluidHeatExchanger -TestFixedPowerHeatExchanger -TestFossilFuelBoiler -TestFresnelField -TestGasTurbine -TestGenericCombustion -TestGenericCombustion1D -TestGridFurnace -TestGTCombustionChamber -TestHeatPumpCompressor -TestIdealCheckValve -TestIdealSwitchValve -TestInternalCombustionEngine -TestInvSingularPressureLoss -TestJunctions1 -TestJunctions2 -TestJunctions3 -TestJunctions4 -TestLoopBreaker -TestMassFlowMultiplier -TestNTUWaterHeater0 -TestPostCombustionGas -TestPressurizer -TestRefP -TestRefP1 -TestSensors -TestSimpleDynamicCondenser -TestSimpleDynamicCondenser1 -TestSimpleEvaporatorWaterSteamFlueGases -TestSimpleStaticCondenser -TestSingularPressureLoss -TestStaticAerocondenser -TestStaticCentrifugalPump1 -TestStaticCondenser -TestStaticCondenserHEI -TestStaticDrum1 -TestStaticDrum2 -TestStaticExchangerDTorWorEff -TestStaticExchangerKS -TestStaticFan -TestStaticPlateHeatExchanger -TestStaticWallFlueGasesExchanger -TestSteamDryer1 -TestSteamDryer2 -TestSteamEngine -TestSteamExtractionSplitter -TestStodolaTurbine1 -TestStodolaTurbine2 -TestSwitchValve -TestTank -TestTankHorizontal -TestThreeWayValve -TestTwoPhaseCavity -TestTwoPhaseCavityOnePipe -TestTwoPhaseVolume -TestVolumeA -TestVolumeA1 -TestVolumeI +Boilers +BoundaryConditions +Combustion +HeatExchangers Junctions +LoopBreakers +Machines +PressureLosses +Sensors +Volumes Media From e1ae6a33d0b1ac465b75868ef2ed12c6781f1f15 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 27 Jul 2026 09:32:10 +0200 Subject: [PATCH 197/213] #125 port Fluid book examples medium support onto develop --- .../ConcentratedSolarPowerPlant_PTSC.mo | 30 +-- .../Boiler/TestFossilFuelBoiler.mo | 45 ++++- .../TestCentrifugalPump/Scenario_1.mo | 16 +- .../TestCentrifugalPump/Scenario_2.mo | 15 +- .../TestCentrifugalPump/Scenario_3.mo | 22 ++- .../TestCentrifugalPump/Scenario_4.mo | 25 ++- .../TestStaticCentrifugalPump.mo | 13 +- .../TestGTCombustionChamber.mo | 26 ++- .../TestGenericCombustion1D.mo | 69 ++++++- .../GasTurbine/TestCombustionTurbine.mo | 23 ++- .../GasTurbine/TestCompressor.mo | 22 ++- .../DynamicWaterHeater/Islanding.mo | 171 +++++++++++++++-- .../DynamicWaterHeater/NegativeFlow.mo | 172 ++++++++++++++++-- .../DynamicWaterHeater/ZeroFlow.mo | 172 ++++++++++++++++-- .../HeatExchanger/TestDynamicCondenser.mo | 89 +++++++-- .../TestDynamicOnePhaseFlowShell.mo | 24 ++- .../TestDynamicPlateHeatExchanger.mo | 37 +++- .../TestDynamicTwoPhaseFlowPipe.mo | 25 ++- .../HeatExchanger/TestNTUWaterHeater.mo | 66 +++++-- .../TestSimpleDynamicCondenser.mo | 52 +++++- .../HeatExchanger/TestStaticCondenser.mo | 69 +++++-- .../TestStaticPlateHeatExchanger.mo | 48 ++++- .../TestInternalCombustionEngine.mo | 51 +++++- .../SimpleExamples/PressureLoss/TestBend.mo | 11 +- .../PressureLoss/TestCheckValve.mo | 12 +- .../PressureLoss/TestControlValve.mo | 13 +- .../PressureLoss/TestDiaphragm.mo | 11 +- .../PressureLoss/TestDynamicCheckValve.mo | 13 +- .../PressureLoss/TestDynamicReliefValve.mo | 40 +++- .../PressureLoss/TestLumpedStraightPipe.mo | 16 +- .../PressureLoss/TestPipePressureLoss.mo | 11 +- .../PressureLoss/TestSwitchValve.mo | 17 +- .../PressureLoss/TestThreeWayValve.mo | 18 +- .../SolarCollector/TestFresnelField.mo | 44 ++++- .../SteamTurbine/TestStodolaTurbine.mo | 17 +- .../SimpleExamples/Volume/TestDynamicDrum.mo | 74 +++++++- .../Book/SimpleExamples/Volume/TestMixer3.mo | 25 ++- .../SimpleExamples/Volume/TestPressurizer.mo | 70 ++++++- .../SimpleExamples/Volume/TestSplitter3.mo | 25 ++- .../SimpleExamples/Volume/TestStaticDrum3.mo | 57 +++++- .../SimpleExamples/Volume/TestSteamDryer.mo | 26 ++- .../Book/SimpleExamples/Volume/TestTank.mo | 24 ++- .../SimpleExamples/Volume/TestVolumeATh.mo | 33 +++- 43 files changed, 1571 insertions(+), 268 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo index 4df33c48..d8d135a1 100644 --- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo +++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo @@ -36,23 +36,23 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(extent = {{-171, 34}, {-115, 78}}, rotation = 0))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_11(P(each start = 2.2e6), option_temperature = false, L = L1, Ns = Ns1, T0 = {587.815, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0}, h0 = fill(650e3, Ns1), D = 0.04, advection = false, hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {801122.25, 638880.0, 582613.0, 562383.0, 546913.0, 533929.0, 522949.0, 513609.0, 505631.0, 498794.0, 492917.0, 487857.0, 483492.0, 479721.0, 476460.0, 473637.0, 471191.0, 469070.0, 467231.0, 465634.0, 464248.0, 464248.0})) annotation( Placement(transformation(extent = {{-116, 122}, {-173, 78}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(proe(x(start = 0.273553))) annotation( + ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(xe(start = 0.273553)) annotation( Placement(transformation(extent = {{-86, 39}, {-62, 63}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 5, Kvl = 100, e = 0.0005, L = 3.5, Vf0 = 0.15, ntubes = 300, steady_state = false, V = 30, P0 = 5000, Cv(Q(start = 1.13)), Pfond(start = 5000.53), proe(d(start = 995.533))) annotation( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 5, Kvl = 100, e = 0.0005, L = 3.5, Vf0 = 0.15, ntubes = 300, steady_state = false, V = 30, P0 = 5000, Cv(Q(start = 1.13)), Pfond(start = 5000.53), rhol(start = 995.533)) annotation( Placement(transformation(extent = {{116, -51}, {156, -11}}, rotation = 0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, option_temperature = false) annotation( Placement(transformation(extent = {{178, -48}, {206, -22}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(K = 1e-6, C2(h_vol_1(start = 137765.0)), Pm(start = 5000.53), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(K = 1e-6, C2(h_vol_1(start = 137765.0)), Pm(start = 5000.53)) annotation( Placement(transformation(origin = {117, -82.5}, extent = {{-6, -9.5}, {6, 9.5}}, rotation = 180))); ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss Connection_HQ_Secheur_Ballon(Q(start = 1)) annotation( Placement(transformation(origin = {-73, -15}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(Pm(fixed = false, start = 3502560.0), a1(fixed = false) = -4.9345734425e8, hn(start = 716.167), a3 = 2000, b1 = -3500, b2 = 510, Q(fixed = true, start = 1.13), C2(h_vol_1(start = 150161.0)), Qv(start = 0.00113454), h(start = 143963.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(Pm(fixed = false, start = 3502560.0), a1(fixed = false) = -4.9345734425e8, hn(start = 716.167), a3 = 2000, b1 = -3500, b2 = 510, Q(fixed = true, start = 1.13), C2(h_vol_1(start = 150161.0)), Qv(start = 0.00113454), h(start = 143963.0)) annotation( Placement(transformation(extent = {{84, -91}, {64, -71}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC Ballon(V = 1, h0 = 3e5, h(start = 1125640.0), P0 = 7000000, dynamic_mass_balance = true, P(start = 7000000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC Ballon(V = 1, h0 = 3e5, h(start = 1125640.0), P0 = 7000000, dynamic_mass_balance = true, P(start = 7000000)) annotation( Placement(transformation(extent = {{-63, -91}, {-83, -71}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0)) annotation( Placement(transformation(origin = {-30, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0)) annotation( Placement(transformation(origin = {-212, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(option_temperature = false, h0 = 63.03e3, P0(fixed = false) = 500000, Q(fixed = true, start = 14.9263)) annotation( Placement(transformation(extent = {{66, -49}, {94, -22}}, rotation = 0))); @@ -64,17 +64,17 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(extent = {{-48, -62}, {-38, -52}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv1(k = 0.5) annotation( Placement(transformation(extent = {{-231, -62}, {-221, -52}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(Pm(fixed = false), hn(start = 466.292), a3 = 2000, b2 = 510, b1 = -3500, a1(fixed = false) = -9.5e8, Q(fixed = false, start = 0.65), C2(P(fixed = false, start = 75e5)), C1(P(fixed = true, start = 70e5), h_vol_2(start = 1125640.0)), Qv(start = 0.00521975), h(start = 1126540.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(Pm(fixed = false), hn(start = 466.292), a3 = 2000, b2 = 510, b1 = -3500, a1(fixed = false) = -9.5e8, Q(fixed = false, start = 0.65), C2(P(fixed = false, start = 75e5)), C1(P(fixed = true, start = 70e5), h_vol_2(start = 1125640.0)), Qv(start = 0.00521975), h(start = 1126540.0)) annotation( Placement(transformation(extent = {{-158, -91}, {-178, -71}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(K = 1e-6, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(K = 1e-6) annotation( Placement(transformation(origin = {-120, -81}, extent = {{-6, -10}, {6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(W_fric = 1, Cst(fixed = false, start = 6.8e10) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.92, Pe(fixed = true, start = 8000000), Ps(fixed = false, start = 1800000), pros(d(start = 8.36949))) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(W_fric = 1, Cst(fixed = false, start = 6.8e10) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.92, Pe(fixed = true, start = 8000000), Ps(fixed = false, start = 1800000)) annotation( Placement(transformation(extent = {{47, 72}, {73, 40}}, rotation = 0))); ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur annotation( Placement(transformation(extent = {{168, 90}, {198, 130}}, rotation = 0))); Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi4(cpw = 1000, steady_state = true, lambda = 26, D = 0.04, L = L4, Ns = Ns4, ntubes = 3, e = 0.003, Tp1(start = {532.06, 532.262, 532.478}), Tp2(start = {533.3, 532.429, 532.217}), Tp(start = {532.141, 532.349, 532.57})) annotation( Placement(transformation(origin = {-269, -12}, extent = {{-24, -30}, {24, 30}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(option_temperature = false, D = 0.04, L = L4, Ns = Ns4, T0 = fill(300, Ns4), h0 = fill(650e3, Ns4), ntubes = 3, inertia = false, advection = false, P(start = {8751668.0, 8729230.0, 8724830.0, 8720430.0, 8733863.0}), h(start = {1128519.5, 1128310.0, 1129260.0, 1130270.0, 1131729.0}), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(option_temperature = false, D = 0.04, L = L4, Ns = Ns4, T0 = fill(300, Ns4), h0 = fill(650e3, Ns4), ntubes = 3, inertia = false, advection = false, P(start = {8751668.0, 8729230.0, 8724830.0, 8720430.0, 8733863.0}), h(start = {1128519.5, 1128310.0, 1129260.0, 1130270.0, 1131729.0})) annotation( Placement(transformation(origin = {-245.5, -11.5}, extent = {{-23.5, -23.5}, {23.5, 23.5}}, rotation = 90))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_44(P(each start = 1.6e6), option_temperature = false, L = L4, Ns = Ns4, T0 = {532.656, 550.0, 550.0}, h0 = fill(650e3, Ns4), advection = false, D(fixed = true) = 0.04, C2(P(fixed = false, start = 16.99e5), Q(fixed = false, start = 2)), hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {465547.78125, 463670.0, 463128.0, 462620.0, 462620.0})) annotation( Placement(transformation(origin = {-293, -12}, extent = {{23, 24}, {-23, -24}}, rotation = 90))); @@ -84,15 +84,15 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(origin = {-212, 138.5}, extent = {{6, -9.5}, {-6, 9.5}}, rotation = 180))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(K = 1e-6, p_rho = 900) annotation( Placement(transformation(origin = {-286, 138.5}, extent = {{6, -9.5}, {-6, 9.5}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(W_fric = 1, Cst(fixed = false, start = 8.3e9) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.94, Pe(fixed = true, start = 1800000), Ps(fixed = false, start = 5000), pros(d(start = 0.0434309)), xm(start = 0.908482)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(W_fric = 1, Cst(fixed = false, start = 8.3e9) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.94, Pe(fixed = true, start = 1800000), Ps(fixed = false, start = 5000), xm(start = 0.908482)) annotation( Placement(transformation(extent = {{105, 72}, {131, 40}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Tank(p_rho = 895, A = 0.1, z0 = 1, h0 = 423600, steady_state = true, h(start = 462620.0), rho(start = 895), Patm = 1670000, P(start = 1699000), ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.Oil_TherminolVP1) annotation( + ThermoSysPro.Fluid.Volumes.Tank Tank(p_rho = 895, A = 0.1, z0 = 1, h0 = 423600, steady_state = true, h(start = 462620.0), rho(start = 895), Patm = 1670000, P(start = 1699000)) annotation( Placement(transformation(origin = {-248, 142}, extent = {{6, 6}, {-6, -6}}, rotation = 180))); ThermoSysPro.Fluid.Volumes.VolumeA VolumeMP(V = 1, rho(start = 10), h0 = 2.4e6, h(start = 2868560.0), P0 = 1800000, dynamic_mass_balance = true, P(start = 1800000), Cs2(Q(start = 0.255955), h_vol_2(start = 2.87e6))) annotation( Placement(transformation(extent = {{84, 50}, {94, 62}}, rotation = 0))); ThermoSysPro.Fluid.Volumes.VolumeA VolumeCond(V = 1, rho(start = 10), h(start = 1837610.0), h0 = 2.1e6, P0 = 5000, dynamic_mass_balance = false, P(start = 5000)) annotation( Placement(transformation(extent = {{141, 24}, {130, 34}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(KPurge = 10, SPurge = 0.3, Se(h(fixed = true, start = 600e3)), SCondDes(fixed = false, start = 9.57697) = 3, HDesF(start = 583561.0), HeiF(start = 150619.0), Hep(start = 884611.0), SDes(start = 0.932441), h(start = 882589.0), lambdaE = 1, KCond = 500, region_eeF = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_seF = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(KPurge = 10, SPurge = 0.3, Se(h(fixed = true, start = 600e3)), SCondDes(fixed = false, start = 9.57697) = 3, HDesF(start = 583561.0), HeiF(start = 150619.0), Hep(start = 884611.0), SDes(start = 0.932441), h(start = 882589.0), lambdaE = 1, KCond = 500) annotation( Placement(transformation(extent = {{42, -106}, {0, -56}}, rotation = 0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(rho(start = 10), h(start = 2400e3), Q(start = 0.1), K = 1e-4, Pm(start = 1800000)) annotation( Placement(transformation(origin = {31.5, -13.5}, extent = {{5.5, -5.5}, {-5.5, 5.5}}, rotation = 90))); @@ -236,4 +236,4 @@ It is documented in a conference paper and in Sect. 6.7 of the ThermoSysPro book The results reported in the ThermoSysPro book were computed using Dymola. "), Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); -end ConcentratedSolarPowerPlant_PTSC; \ No newline at end of file +end ConcentratedSolarPowerPlant_PTSC; diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo index 97b4fdb0..42cf4341 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo @@ -1,21 +1,52 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Boiler; model TestFossilFuelBoiler - ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler(Wloss = 0, Ke = 1.e6, Tsf = 386.16, Tea(start = 298.15999999999923), Tf(start = 2138.3201722145304), deltaPe(start = 4028755.599053718), rhof(start = 0.2733355904203506)) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Wloss=0, + Ke=1.e6, + Tsf=386.16, + Tea(start=298.15999999999923), + Tf(start=2138.3201722145304), + deltaPe(start=4028755.599053718), + rhof(start=0.2733355904203506)) annotation( Placement(transformation(extent = {{-45, -51}, {45, 51}}, rotation = 0))); ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(T0 = 338.16, Cp = 1282, Xh = 0.24403, Xc = 0.75323, Q0 = 1.45) annotation( Placement(transformation(extent = {{-36, -78}, {0, -41}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(Xco2 = 0, Xh2o = 0.01, Q0 = 27., T0 = 298.16, Xo2 = 0.233, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare package Medium = Medium_FlueGases, + Q0=27., + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) annotation( Placement(transformation(extent = {{-110, -50}, {-71, -13}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP ( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) annotation( Placement(transformation(extent = {{68, -51}, {110, -12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(P0 = 140e5, Q0 = 24., h0 = 600e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + P0=140e5, + Q0=24., + h0=600e3) annotation( Placement(transformation(extent = {{-107, 14}, {-71, 48}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{74, 13}, {110, 49}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 1e-3, rho(start = 932.9612394321883)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=1e-3, rho( + start=932.9612394321883)) annotation( Placement(transformation(extent = {{-64, 25}, {-56, 37}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 1e-3, rho(start = 29.766102492862515)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=1e-3, rho( + start=29.766102492862515)) annotation( Placement(transformation(extent = {{57, 25}, {65, 37}}, rotation = 0))); equation connect(sourceQ.C, FossilFuelBoiler.Cair) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo index 6431bcf8..72e09e6b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo @@ -1,11 +1,21 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_1 - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(mode_car = 1, mode_car_hn = 1, mode_car_Cr = 1, dynamic_mech_equation = false) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + mode_car=1, + mode_car_hn=1, + mode_car_Cr=1, + dynamic_mech_equation=false) annotation( Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0 = 0) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + Q0=0) annotation( Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(Starttime = 10, Duration = 100, Initialvalue = 1400, Finalvalue = 0) annotation( Placement(transformation(extent = {{-100, -20}, {-80, 0}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo index 259e273c..a8e599a0 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo @@ -1,11 +1,20 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_2 - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(mode_car_hn = 1, mode_car_Cr = 1, mode_car = 1) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + mode_car_hn= + 1, mode_car_Cr=1, + mode_car=1) annotation( Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0 = 100) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + Q0=100) annotation( Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe(Starttime = 10, Duration = 100, Initialvalue = 1400, Finalvalue = 0) annotation( Placement(transformation(extent = {{-80, -20}, {-60, 0}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo index 3fe2702b..4b8b0564 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo @@ -1,15 +1,29 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_3 - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(hn_nom_p = 10, mode_car = 1, V = 0.01, dynamic_energy_balance = false, mode_car_Cr = 1, mode_car_hn = 1) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + hn_nom_p=10, + mode_car=1, + V=0.01, + dynamic_energy_balance=false, + mode_car_Cr=1, + mode_car_hn=1) annotation( Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(P0 = 300000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=300000) annotation( Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe2(Duration = 100, Starttime = 100, Finalvalue = 4800000, Initialvalue = 400000) annotation( Placement(transformation(extent = {{0, 60}, {20, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(lambda = 0, inertia = true) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + lambda=0, inertia=true) annotation( Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); equation connect(sourceP.C, centrifugalPump.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo index 4e703610..64db9658 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo @@ -1,11 +1,30 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump.TestCentrifugalPump; model Scenario_4 - ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(J = 5.685, dynamic_mech_equation = true, hn_coef = {-165.23, 774.95}, rh_coef = {-0.704, 1.46}, N_nom = 4809, hn_nom_p = 662, Qv_nom_p = 0.921, mode_car_Cr = 1, w_a(start = 0.003569900907740773), C1(h(start = 650000.0)), Qv(start = 0.010949905982587188)) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + J=5.685, + dynamic_mech_equation=true, + hn_coef={-165.23,774.95}, + rh_coef={-0.704,1.46}, + N_nom=4809, + hn_nom_p=662, + Qv_nom_p=0.921, + mode_car_Cr=1, + w_a(start=0.003569900907740773), + C1(h(start=650000.0)), + Qv(start=0.010949905982587188)) annotation( Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceP(Q0 = 10, h0 = 650e3, P0 = 100000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceP( + redeclare package Medium = Medium, + Q0=10, + h0=650e3, + P0=100000) annotation( Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{60, 20}, {80, 40}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe3(Duration = 1000, Starttime = 0, Initialvalue = 7.2e5, Finalvalue = 2.0e5) annotation( Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo index 409479d1..a03c6b18 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo @@ -1,11 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump; model TestStaticCentrifugalPump - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-10, -50}, {-30, -30}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Bache1(ze2 = 10, zs2 = 10) annotation( + ThermoSysPro.Fluid.Volumes.Tank Bache1( + redeclare package Medium = Medium, + ze2=10, + zs2=10) annotation( Placement(transformation(extent = {{-30, 10}, {-10, 30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, 10}, {50, 30}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constante1(k = 0.5) annotation( Placement(transformation(extent = {{-10, 50}, {10, 70}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo index 2bc706d4..b90b612b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo @@ -1,15 +1,33 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber; model TestGTCombustionChamber - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 ( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) annotation( Placement(transformation(origin = {149, -2}, extent = {{23, -24}, {-23, 24}}, rotation = 180))); - ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2(Cfg(P(fixed = true, start = 14.1e5)), kcham(fixed = false, start = 1)) annotation( + ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) annotation( Placement(transformation(extent = {{-67, -68}, {67, 64}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2(Q0 = 0, P0 = 15e5, h0 = 300e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2( + redeclare package Medium = Medium, + Q0=0, + P0=15e5, + h0=300e3) annotation( Placement(transformation(extent = {{-112, 48}, {-72, 88}}, rotation = 0))); ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible2(Hum = 0, Xo = 0, Xn = 0, Xs = 0, rho = 0.838, Xc = 0.755, Xh = 0.245, Cp = 2255, T0 = 410, Q0 = 9.30, LHV = 47500e3) annotation( Placement(transformation(extent = {{-107, -93}, {-71, -57}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2(Xso2 = 0, Xco2 = 0.0, Xo2 = 0.23, Xh2o = 0.01, P0 = 15e5, Q0 = 415, T0 = 680, option_temperature = true, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) annotation( Placement(transformation(extent = {{-174, -26}, {-128, 22}}, rotation = 0))); equation connect(GTCombustionChamber2.Cws, sourcePQ2.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo index ada1647a..776e25dc 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo @@ -1,23 +1,78 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber; model TestGenericCombustion1D "TestGenericCombustion1D" - ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS(NCEL = 7, Qm(fixed = false), Qsf(fixed = false), kcham(fixed = true) = 0.1, Acham = 275, Xbf = 0, ImbCV = 0.05, EPSPAR = 0.7, Kec = 8.8, SM = {639.92, 198.58, 466.48, 466.48, 466.48, 358.56, 358.56}, ImbBF = 0.0, Psf(start = 113275)) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + NCEL=7, + Qm(fixed=false), + Qsf(fixed=false), + kcham(fixed=true) = 0.1, + Acham=275, + Xbf=0, + ImbCV=0.05, + EPSPAR=0.7, + Kec=8.8, + SM={639.92,198.58,466.48,466.48,466.48,358.56,358.56}, + ImbBF=0.0, + Psf(start=113275)) annotation( Placement(transformation(extent = {{-62, -56}, {62, 72}}, rotation = 0))); ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(Xn = 0.0208, Xashes = 0.136, Cp = 1200, rho = 1100, LHV = 29245e3, Xc = 0.719, Xh = 0.0414, Xo = 0.086, Xs = 0.0044, Vol = 0.286, Q0 = 57.20, T0 = 358.15, Hum = 0.08) annotation( Placement(transformation(extent = {{-106, -43}, {-72, -5}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(Xso2 = 0, Q0 = 609.29, Xh2o = 0.01, Xo2 = 0.230, Xco2 = 0, P0 = 191000, T0 = 524.89, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=609.29, + P0=191000, + T0=524.89, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) annotation( Placement(transformation(extent = {{-44, -98}, {0, -58}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) annotation( Placement(transformation(extent = {{0, 70}, {44, 112}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0 = 0, P0 = 100000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water( + redeclare package Medium = Medium, + Q0=0, + P0=100000) annotation( Placement(transformation(extent = {{-107, 23}, {-71, 57}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe PipeWaterSteam(Ns = 7, z2 = 56, rugosrel = 5e-5, ntubes = 403, L = 58, D = 0.0327, C2(Q(fixed = false, start = 486.69), P(fixed = false, start = 1.96318e+07, displayUnit = "Pa")), dpfCorr = 3.5) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe PipeWaterSteam( + redeclare package Medium = Medium, + Ns=7, + inertia=false, + dynamic_energy_balance=false, + z2=56, + rugosrel=5e-5, + ntubes=403, + L=58, + D=0.0327, + P(start=fill(2.0e7, 9)), + Q(start=fill(486.69, 8)), + h(start=fill(1.8e6, 9)), + C2(Q(fixed=false, start=486.69), P( + fixed=false, + start=1.96318e+07, + displayUnit="Pa")), + dpfCorr=3.5) annotation( Placement(transformation(origin = {91, 8}, extent = {{49, 16}, {-49, -16}}, rotation = 270))); ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall paroiEcrans(Ns = 7, lambda = 40, steady_state = true, ntubes = 403, L = 58, D = 0.0327, e = 0.001) annotation( Placement(transformation(origin = {73, 7.5}, extent = {{51.5, -15}, {-51.5, 15}}, rotation = 270))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam2(option_temperature = false, Q(start = 486.69, fixed = true), h0 = 2.5e+06, P0(fixed = false) = 19621600) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam2( + redeclare package Medium = Medium, + option_temperature=false, + Q(start=486.69), + h0=2.5e+06, + P0=19621600) annotation( Placement(transformation(origin = {90, 90.5}, extent = {{14.5, -15}, {-14.5, 15}}, rotation = 270))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceEcrans(h0 = 1.292e+06, option_temperature = false, P0 = 20112000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceEcrans( + redeclare package Medium = Medium, + h0=1.292e+06, + option_temperature=false, + P0=20112000) annotation( Placement(transformation(origin = {91, -81}, extent = {{15, -15}, {-15, 15}}, rotation = 270))); equation connect(fuelSourcePQ.C, genericCombustionCCS.Cfuel) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo index 67f22a5e..f32465b8 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo @@ -1,13 +1,30 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine; model TestCombustionTurbine + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + parameter Real is_eff_n1(fixed = false, start = 0.85) "Nominal isentropic efficiency"; parameter Real Qred1(fixed = false, start = 0.01) "Reduced mass flow rate"; - ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine(tau_n = 0.065, is_eff_n = is_eff_n1, Qred = Qred1, Pe(fixed = true, start = 1500000), Ts(fixed = true, start = 830)) annotation( + ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2 + Medium.h_offset)) annotation( Placement(transformation(extent = {{-42, -42}, {36, 42}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1(Xso2 = 0, Q0 = 430, Xco2 = 0.06, Xh2o = 0.06, Xo2 = 0.14, T0 = 1500, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + Q0=430, + T0=1500, + option_temperature=true, + X0={1 - 0.14 - 0.06 - 0.06,0.14,0.06,0.06,0}) annotation( Placement(transformation(extent = {{-106, -10}, {-86, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0 = 1e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=1e5, + T0=830) annotation( Placement(transformation(origin = {94, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Wc1(k = -1.8e8) annotation( Placement(transformation(extent = {{-100, -42}, {-80, -22}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo index 2bac63a0..5b8320bf 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo @@ -1,12 +1,28 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine; model TestCompressor + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + parameter Real is_eff_n1(fixed = false, start = 0.85) "Nominal isentropic efficiency"; - ThermoSysPro.Fluid.Machines.Compressor Compressor(Ps(fixed = false), tau_n = 16, is_eff_n = is_eff_n1, Pe(fixed = false, start = 100000), Ts(fixed = true, start = 680)) annotation( + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + Ps(fixed=false), + tau_n=16, + is_eff_n=is_eff_n1, + Pe(fixed=false, start=100000), + Ts(fixed=true, start=680)) annotation( Placement(transformation(extent = {{-52, -52}, {48, 52}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1(Xso2 = 0, T0 = 288, Xco2 = 0.0, Xh2o = 0.003, Xo2 = 0.23, P0 = 1e5, Q0 = 420, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + T0=288, + P0=1e5, + Q0=420, + option_temperature=true, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}) annotation( Placement(transformation(extent = {{-104, -10}, {-84, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0 = 15.8e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=15.8e5) annotation( Placement(transformation(origin = {96, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); equation connect(SourceQ1.C, Compressor.Ce) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo index 16fdf496..75bae660 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo @@ -1,27 +1,163 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater; model Islanding - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, P0 = 22.733e5, h0 = 2650.6e3) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=22.733e5, + h0=2650.6e3) annotation( Placement(transformation(extent = {{-192, 110}, {-150, 150}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(option_temperature = false, P0(fixed = true) = 10e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, + option_temperature=false, P0(fixed=true) = 10e5) annotation( Placement(transformation(extent = {{124, -202}, {160, -162}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(Q(fixed = false, start = 56), Cvmax(fixed = false) = 354.534, mode_caract = 0, Cv(start = 70, fixed = false), C1(h_vol_2(start = 800e3), h(start = 800e3))) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, + Q(fixed=false, start=56), + Cvmax(fixed=false) = 354.534, + mode_caract=0, + Cv(start=70, fixed=false), + C1(h_vol_2(start=800e3), h(start=800e3))) annotation( Placement(transformation(extent = {{88, -186}, {108, -166}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(Dc = 0.016, Lc = 2.56, PasL = 0.027, PasT = 0.02338, ec = 2e-3, Rv = 1.130514, Ns = 10, DpfCorr = 1.1136, cp = 506, rho = 7780, lambda = 35, COP0l(fixed = false) = 1.23, C2ex(P(start = 2220000)), ntubes1 = 351, ntubes2 = 351, ntubes3 = 1319, L3 = 26.4, L2 = 13.2, L1 = 13.2, Wall_1(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_2(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_3(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4})), volumeC(h(start = 1000.65e3), P(start = 68.48e5)), WaterHeating(steady_state = true, Vertical = false, step_square = true, zl(fixed = true, start = 0.43), Kvl = 1, V = 53, Cv(P(fixed = false, start = 21.867e5), Q(fixed = false, start = 52.6)), Mp = 53227, Klp = 1500, Kvp = 1200, Kpa = 0.2, P(fixed = true, start = 2216584), hl(start = 806345), hv(start = 1063490), Tp1(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp3(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp(start = 509)), Ce1(P(start = 7100000)), pipe_1(z2 = 0.3, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3}), Q(start = {132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132}), advection = false, P(start = {6870000, 6869000, 6868000, 6867000, 6866000, 6865000, 6864000, 6863000, 6862000, 6861000, 6860000, 6859000}), Tp(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510})), pipe_2(z2 = 0.4, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132}), advection = false, P(start = {6859000, 6859000, 6858000, 6857000, 6856000, 6855000, 6854000, 6853000, 6852000, 6851000, 6850000, 6848000}), Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), volumeD1(h(start = 953939), P(start = 6848000)), volumeD(h(start = 812750), dynamic_mass_balance = false, P(start = 6872000)), P0c = 2200000, pipe_3(steady_state = true, z2 = 0.7, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 132}), advection = false, inertia = true, P(start = {6870000, 6869000, 6868000, 6867000, 6866000, 6865000, 6864000, 6863000, 6862000, 6861000, 6860000, 6859000, 6858000, 6857000, 6856000, 6855000, 6854000, 6853000, 6852000, 6851000, 6850000, 6848000}), Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Dc=0.016, + Lc=2.56, + PasL=0.027, + PasT=0.02338, + ec=2e-3, + Rv=1.130514, + Ns=10, + DpfCorr=1.1136, + cp=506, + rho=7780, + lambda=35, + COP0l(fixed=false) = 1.23, + C2ex(P(start=2220000)), + ntubes1=351, + ntubes2=351, + ntubes3=1319, + L3=26.4, + L2=13.2, + L1=13.2, + Wall_1( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + Wall_2( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + Wall_3( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})), + volumeC(h(start=1000.65e3), P(start=68.48e5)), + WaterHeating( + steady_state=true, + Vertical=false, + step_square=true, + zl(fixed=true, start=0.43), + Kvl=1, + V=53, + Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)), + Mp=53227, + Klp=1500, + Kvp=1200, + Kpa=0.2, + P(fixed=true, start=2216584), + hl(start=806345), + hv(start=1063490), + Tp1(start={500,501,502,503,504,505,506,507,508,510}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4, + 519,519.4}), + Tp(start=509)), + Ce1(P(start=7100000)), + pipe_1( + z2=0.3, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3}), + hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3}), + Q(start={132,132,132,132,132,132,132,132,132,132,132}), + advection=false, + P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000, + 6862000,6861000,6860000,6859000}), + Tp(start={500,501,502,503,504,505,506,507,508,510})), + pipe_2( + z2=0.4, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, + 1070e3,1080e3,1080e3}), + hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, + 1070e3,1080e3}), + Q(start={132,132,132,132,132,132,132,132,132,132,132}), + advection=false, + P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000, + 6852000,6851000,6850000,6848000}), + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + volumeD1(h(start=953939), P(start=6848000)), + volumeD( + h(start=812750), + dynamic_mass_balance=false, + P(start=6872000)), + P0c=2200000, + pipe_3( + steady_state=true, + z2=0.7, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, + 1080e3,1080e3}), + hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, + 1080e3}), + Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,132}), + advection=false, + inertia=true, + P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000, + 6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000, + 6854000,6853000,6852000,6851000,6850000,6848000}), + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516, + 516.4,517,517.4,518,518.4,519,519.4}))) annotation( Placement(transformation(extent = {{-58, -90}, {162, 96}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0 = 940.000e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + h0=940.000e3) annotation( Placement(transformation(extent = {{-150, 22}, {-192, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn(Q(fixed = false, start = 650), K = 35) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + K=35) annotation( Placement(transformation(extent = {{-99, -48}, {-79, -28}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut(Q(fixed = false, start = 650), K = 30, C2(h_vol_1(start = 927700), h(start = 927700))) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut( + redeclare package Medium = Medium, + Q(fixed=false, start=650), K=30, + C2(h_vol_1(start=927700), h(start=927700))) annotation( Placement(transformation(extent = {{-80, 34}, {-100, 54}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA(Table = [0, 71.29e5; 378, 71.29e5; 438, 77e5; 597, 73.8e5; 1000, 72.06e5; 1533, 69.8e5; 1863, 69.39e5; 2340, 68.8e5; 2500, 68.8e5]) annotation( Placement(transformation(extent = {{-194, -8}, {-172, 14}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA(Table = [0, 454.46; 448, 454.46; 1155, 407.76; 2000, 407.76]) annotation( Placement(transformation(extent = {{-196, -88}, {-176, -68}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(P0 = 71.29e5, h0 = 772.09e3, T0 = 454.46, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=71.29e5, + h0=772.09e3, + T0=454.46, + option_temperature=true) annotation( Placement(transformation(extent = {{-192, -60}, {-150, -16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0 = 53) annotation( + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=53) annotation( Placement(transformation(extent = {{-115, 34}, {-135, 54}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table = [0, 624.97; 378, 624.97; 390, 592; 438, 699; 507, 353; 936, 252; 1404, 176; 1872, 116; 2340, 88; 2500, 88]) annotation( Placement(transformation(extent = {{-196, 78}, {-176, 98}}, rotation = 0))); @@ -31,13 +167,24 @@ model Islanding Placement(transformation(extent = {{140, -146}, {102, -110}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k = 0.43) annotation( Placement(transformation(extent = {{191, -140}, {169, -118}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start = 2600e3), h(start = 2600e3))) annotation( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + C2(h_vol_1(start=2600e3), h(start=2600e3))) annotation( Placement(transformation(extent = {{-100, 122}, {-84, 138}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge(Q(fixed = false, start = 56), K = 1e-3, T(fixed = true, start = 461.56), Pm(start = 2220000)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge( + redeclare package Medium = Medium, + Q(fixed=false, start=56), K=1e-3, + T(fixed=true, start=461.56), + Pm(start=2220000)) annotation( Placement(transformation(origin = {54, -138}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_purge(Table = [0, 10e5; 378, 10e5; 418, 7e5; 1145, 2.9e5; 2000, 2.9e5]) annotation( Placement(transformation(extent = {{162, -178}, {182, -158}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(Q(fixed = false, start = 650), lambda(fixed = false) = 0.03, L = 48.72, D = 0.387) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + lambda(fixed=false) = 0.03, + L=48.72, + D=0.387) annotation( Placement(transformation(extent = {{-48, 162}, {30, 98}}, rotation = 0))); equation connect(ControlValve_eau.C2, Puit_condenseur1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo index d59a3b77..f5b524ce 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo @@ -1,27 +1,164 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater; model NegativeFlow - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, P0 = 22.733e5, h0 = 2650.6e3) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=22.733e5, + h0=2650.6e3) annotation( Placement(transformation(extent = {{-192, 110}, {-150, 150}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(option_temperature = false, P0(fixed = true) = 10e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, + option_temperature=false, P0(fixed=true) = 10e5) annotation( Placement(transformation(extent = {{124, -202}, {160, -162}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(Q(fixed = false, start = 56), Cvmax(fixed = false) = 354.534, mode_caract = 0, Cv(start = 70, fixed = false), C1(h_vol_2(start = 800e3), h(start = 800e3))) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, + Q(fixed=false, start=56), + Cvmax(fixed=false) = 354.534, + mode_caract=0, + Cv(start=70, fixed=false), + C1(h_vol_2(start=800e3), h(start=800e3))) annotation( Placement(transformation(extent = {{88, -186}, {108, -166}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(Dc = 0.016, Lc = 2.56, PasL = 0.027, PasT = 0.02338, ec = 2e-3, Rv = 1.130514, Ns = 10, DpfCorr = 1.1136, cp = 506, rho = 7780, lambda = 35, COP0l(fixed = false) = 1.23, C2ex(P(start = 2220000)), ntubes1 = 351, ntubes2 = 351, ntubes3 = 1319, L3 = 26.4, L2 = 13.2, L1 = 13.2, Wall_1(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_2(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_3(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4})), volumeC(h(start = 1000.65e3), P(start = 68.48e5)), WaterHeating(steady_state = true, Vertical = false, step_square = true, zl(fixed = true, start = 0.43), Kvl = 1, V = 53, Cv(P(fixed = false, start = 21.867e5), Q(fixed = false, start = 52.6)), Mp = 53227, Klp = 1500, Kvp = 1200, Kpa = 0.2, P(fixed = true, start = 2216584), hl(start = 806345), hv(start = 1063490), Tp1(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp3(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp(start = 509)), Ce1(P(start = 7100000)), pipe_1(z2 = 0.3, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3}), Q(start = {132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132}), advection = false, P(start = {6870000, 6869000, 6868000, 6867000, 6866000, 6865000, 6864000, 6863000, 6862000, 6861000, 6860000, 6859000}), Tp(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510})), pipe_2(z2 = 0.4, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132}), advection = false, P(start = {6859000, 6859000, 6858000, 6857000, 6856000, 6855000, 6854000, 6853000, 6852000, 6851000, 6850000, 6848000}), Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), volumeD1(h(start = 953939), P(start = 6848000)), volumeD(h(start = 812750), dynamic_mass_balance = false, P(start = 6872000)), P0c = 2200000, pipe_3(steady_state = true, z2 = 0.7, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 132}), advection = false, inertia = true, P(start = {6870000, 6869000, 6868000, 6867000, 6866000, 6865000, 6864000, 6863000, 6862000, 6861000, 6860000, 6859000, 6858000, 6857000, 6856000, 6855000, 6854000, 6853000, 6852000, 6851000, 6850000, 6848000}), Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4})), continuous_flow_reversal = true) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Dc=0.016, + Lc=2.56, + PasL=0.027, + PasT=0.02338, + ec=2e-3, + Rv=1.130514, + Ns=10, + DpfCorr=1.1136, + cp=506, + rho=7780, + lambda=35, + COP0l(fixed=false) = 1.23, + C2ex(P(start=2220000)), + ntubes1=351, + ntubes2=351, + ntubes3=1319, + L3=26.4, + L2=13.2, + L1=13.2, + Wall_1( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + Wall_2( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + Wall_3( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})), + volumeC(h(start=1000.65e3), P(start=68.48e5)), + WaterHeating( + steady_state=true, + Vertical=false, + step_square=true, + zl(fixed=true, start=0.43), + Kvl=1, + V=53, + Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)), + Mp=53227, + Klp=1500, + Kvp=1200, + Kpa=0.2, + P(fixed=true, start=2216584), + hl(start=806345), + hv(start=1063490), + Tp1(start={500,501,502,503,504,505,506,507,508,510}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4, + 519,519.4}), + Tp(start=509)), + Ce1(P(start=7100000)), + pipe_1( + z2=0.3, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3}), + hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3}), + Q(start={132,132,132,132,132,132,132,132,132,132,132}), + advection=false, + P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000, + 6862000,6861000,6860000,6859000}), + Tp(start={500,501,502,503,504,505,506,507,508,510})), + pipe_2( + z2=0.4, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, + 1070e3,1080e3,1080e3}), + hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, + 1070e3,1080e3}), + Q(start={132,132,132,132,132,132,132,132,132,132,132}), + advection=false, + P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000, + 6852000,6851000,6850000,6848000}), + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + volumeD1(h(start=953939), P(start=6848000)), + volumeD( + h(start=812750), + dynamic_mass_balance=false, + P(start=6872000)), + P0c=2200000, + pipe_3( + steady_state=true, + z2=0.7, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, + 1080e3,1080e3}), + hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, + 1080e3}), + Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,132}), + advection=false, + inertia=true, + P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000, + 6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000, + 6854000,6853000,6852000,6851000,6850000,6848000}), + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516, + 516.4,517,517.4,518,518.4,519,519.4})), + continuous_flow_reversal=true) annotation( Placement(transformation(extent = {{-58, -90}, {162, 96}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0 = 940.000e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + h0=940.000e3) annotation( Placement(transformation(extent = {{-150, 22}, {-192, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn(Q(fixed = false, start = 650), K = 35) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + K=35) annotation( Placement(transformation(extent = {{-99, -48}, {-79, -28}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut(Q(fixed = false, start = 650), K = 30, C2(h_vol_1(start = 927700), h(start = 927700))) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut( + redeclare package Medium = Medium, + Q(fixed=false, start=650), K=30, + C2(h_vol_1(start=927700), h(start=927700))) annotation( Placement(transformation(extent = {{-80, 34}, {-100, 54}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA(Table = [0, 71.29e5; 3000, 71.29e5]) annotation( Placement(transformation(extent = {{-194, -8}, {-172, 14}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA(Table = [0, 454.46; 448, 454.46; 1155, 407.76; 2000, 407.76]) annotation( Placement(transformation(extent = {{-196, -88}, {-176, -68}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(P0 = 71.29e5, h0 = 772.09e3, T0 = 454.46, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=71.29e5, + h0=772.09e3, + T0=454.46, + option_temperature=true) annotation( Placement(transformation(extent = {{-192, -60}, {-150, -16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0 = 53) annotation( + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=53) annotation( Placement(transformation(extent = {{-115, 34}, {-135, 54}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table = [0, 624.97; 300, 624.97; 2000, -200; 3000, -200]) annotation( Placement(transformation(extent = {{-196, 78}, {-176, 98}}, rotation = 0))); @@ -31,13 +168,24 @@ model NegativeFlow Placement(transformation(extent = {{140, -146}, {102, -110}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k = 0.43) annotation( Placement(transformation(extent = {{191, -140}, {169, -118}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start = 2600e3), h(start = 2600e3))) annotation( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + C2(h_vol_1(start=2600e3), h(start=2600e3))) annotation( Placement(transformation(extent = {{-100, 122}, {-84, 138}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge(Q(fixed = false, start = 56), K = 1e-3, T(fixed = true, start = 461.56), Pm(start = 2220000)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge( + redeclare package Medium = Medium, + Q(fixed=false, start=56), K=1e-3, + T(fixed=true, start=461.56), + Pm(start=2220000)) annotation( Placement(transformation(origin = {54, -138}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_purge(Table = [0, 10e5; 378, 10e5; 418, 7e5; 1145, 2.9e5; 2000, 2.9e5]) annotation( Placement(transformation(extent = {{162, -178}, {182, -158}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(Q(fixed = false, start = 650), lambda(fixed = false) = 0.03, L = 48.72, D = 0.387) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + lambda(fixed=false) = 0.03, + L=48.72, + D=0.387) annotation( Placement(transformation(extent = {{-48, 162}, {30, 98}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA1(Table = [0, 71.29e5; 378, 71.29e5; 438, 77e5; 597, 73.8e5; 1533, 69.8e5; 2340, 68.8e5; 2500, 68.8e5]) annotation( Placement(transformation(extent = {{-196, -154}, {-174, -132}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo index 6cac14b4..fd5f8d0a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo @@ -1,27 +1,164 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger.DynamicWaterHeater; model ZeroFlow - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, P0 = 22.733e5, h0 = 2650.6e3) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=22.733e5, + h0=2650.6e3) annotation( Placement(transformation(extent = {{-192, 110}, {-150, 150}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1(option_temperature = false, P0(fixed = true) = 10e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, + option_temperature=false, P0(fixed=true) = 10e5) annotation( Placement(transformation(extent = {{124, -202}, {160, -162}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau(Q(fixed = false, start = 56), Cvmax(fixed = false) = 354.534, mode_caract = 0, Cv(start = 70, fixed = false), C1(h_vol_2(start = 800e3), h(start = 800e3))) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, + Q(fixed=false, start=56), + Cvmax(fixed=false) = 354.534, + mode_caract=0, + Cv(start=70, fixed=false), + C1(h_vol_2(start=800e3), h(start=800e3))) annotation( Placement(transformation(extent = {{88, -186}, {108, -166}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating(Dc = 0.016, Lc = 2.56, PasL = 0.027, PasT = 0.02338, ec = 2e-3, Rv = 1.130514, Ns = 10, DpfCorr = 1.1136, cp = 506, rho = 7780, lambda = 35, COP0l(fixed = false) = 1.23, C2ex(P(start = 2220000)), ntubes1 = 351, ntubes2 = 351, ntubes3 = 1319, L3 = 26.4, L2 = 13.2, L1 = 13.2, Wall_1(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_2(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), Wall_3(Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp1(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4})), volumeC(h(start = 1000.65e3), P(start = 68.48e5)), WaterHeating(steady_state = true, Vertical = false, step_square = true, zl(fixed = true, start = 0.43), Kvl = 1, V = 53, Cv(P(fixed = false, start = 21.867e5), Q(fixed = false, start = 52.6)), Mp = 53227, Klp = 1500, Kvp = 1200, Kpa = 0.2, P(fixed = true, start = 2216584), hl(start = 806345), hv(start = 1063490), Tp1(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510}), Tp2(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4}), Tp3(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4}), Tp(start = 509)), Ce1(P(start = 7100000)), pipe_1(z2 = 0.3, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3}), Q(start = {132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132}), advection = false, P(start = {6870000, 6869000, 6868000, 6867000, 6866000, 6865000, 6864000, 6863000, 6862000, 6861000, 6860000, 6859000}), Tp(start = {500, 501, 502, 503, 504, 505, 506, 507, 508, 510})), pipe_2(z2 = 0.4, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132}), advection = false, P(start = {6859000, 6859000, 6858000, 6857000, 6856000, 6855000, 6854000, 6853000, 6852000, 6851000, 6850000, 6848000}), Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4})), volumeD1(h(start = 953939), P(start = 6848000)), volumeD(h(start = 812750), dynamic_mass_balance = false, P(start = 6872000)), P0c = 2200000, pipe_3(steady_state = true, z2 = 0.7, dynamic_mass_balance = true, simplified_dynamic_energy_balance = false, h(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3, 1080e3}), hb(start = {813e3, 826e3, 850e3, 865e3, 880e3, 895e3, 905e3, 920e3, 935e3, 950e3, 965e3, 980e3, 995e3, 1010e3, 1120e3, 1130e3, 1040e3, 1050e3, 1060e3, 1070e3, 1080e3}), Q(start = {492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 132}), advection = false, inertia = true, P(start = {6870000, 6869000, 6868000, 6867000, 6866000, 6865000, 6864000, 6863000, 6862000, 6861000, 6860000, 6859000, 6858000, 6857000, 6856000, 6855000, 6854000, 6853000, 6852000, 6851000, 6850000, 6848000}), Tp(start = {510, 510.4, 511, 511.4, 512, 512.4, 513, 513.4, 514, 514.4, 515, 515.4, 516, 516.4, 517, 517.4, 518, 518.4, 519, 519.4})), continuous_flow_reversal = true) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Dc=0.016, + Lc=2.56, + PasL=0.027, + PasT=0.02338, + ec=2e-3, + Rv=1.130514, + Ns=10, + DpfCorr=1.1136, + cp=506, + rho=7780, + lambda=35, + COP0l(fixed=false) = 1.23, + C2ex(P(start=2220000)), + ntubes1=351, + ntubes2=351, + ntubes3=1319, + L3=26.4, + L2=13.2, + L1=13.2, + Wall_1( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + Wall_2( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + Wall_3( + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}), + Tp1(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4, 515,515.4,516,516.4,517,517.4,518,518.4,519,519.4})), + volumeC(h(start=1000.65e3), P(start=68.48e5)), + WaterHeating( + steady_state=true, + Vertical=false, + step_square=true, + zl(fixed=true, start=0.43), + Kvl=1, + V=53, + Cv(P(fixed=false, start=21.867e5), Q(fixed=false, start=52.6)), + Mp=53227, + Klp=1500, + Kvp=1200, + Kpa=0.2, + P(fixed=true, start=2216584), + hl(start=806345), + hv(start=1063490), + Tp1(start={500,501,502,503,504,505,506,507,508,510}), + Tp2(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4}), + Tp3(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516,516.4,517,517.4,518,518.4, + 519,519.4}), + Tp(start=509)), + Ce1(P(start=7100000)), + pipe_1( + z2=0.3, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3}), + hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3}), + Q(start={132,132,132,132,132,132,132,132,132,132,132}), + advection=false, + P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000, + 6862000,6861000,6860000,6859000}), + Tp(start={500,501,502,503,504,505,506,507,508,510})), + pipe_2( + z2=0.4, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, + 1070e3,1080e3,1080e3}), + hb(start={965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3, + 1070e3,1080e3}), + Q(start={132,132,132,132,132,132,132,132,132,132,132}), + advection=false, + P(start={6859000,6859000,6858000,6857000,6856000,6855000,6854000,6853000, + 6852000,6851000,6850000,6848000}), + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4})), + volumeD1(h(start=953939), P(start=6848000)), + volumeD( + h(start=812750), + dynamic_mass_balance=false, + P(start=6872000)), + P0c=2200000, + pipe_3( + steady_state=true, + z2=0.7, + dynamic_mass_balance=true, + simplified_dynamic_energy_balance=false, + h(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, + 1080e3,1080e3}), + hb(start={813e3,826e3,850e3,865e3,880e3,895e3,905e3,920e3,935e3,950e3, + 965e3,980e3,995e3,1010e3,1120e3,1130e3,1040e3,1050e3,1060e3,1070e3, + 1080e3}), + Q(start={492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, + 492,492,492,492,132}), + advection=false, + inertia=true, + P(start={6870000,6869000,6868000,6867000,6866000,6865000,6864000,6863000, + 6862000,6861000,6860000,6859000,6858000,6857000,6856000,6855000, + 6854000,6853000,6852000,6851000,6850000,6848000}), + Tp(start={510,510.4,511,511.4,512,512.4,513,513.4,514,514.4,515,515.4,516, + 516.4,517,517.4,518,518.4,519,519.4})), + continuous_flow_reversal=true) annotation( Placement(transformation(extent = {{-58, -90}, {162, 96}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2(h0 = 940.000e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + h0=940.000e3) annotation( Placement(transformation(extent = {{-150, 22}, {-192, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn(Q(fixed = false, start = 650), K = 35) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + K=35) annotation( Placement(transformation(extent = {{-99, -48}, {-79, -28}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut(Q(fixed = false, start = 650), K = 30, C2(h_vol_1(start = 927700), h(start = 927700))) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut( + redeclare package Medium = Medium, + Q(fixed=false, start=650), K=30, + C2(h_vol_1(start=927700), h(start=927700))) annotation( Placement(transformation(extent = {{-80, 34}, {-100, 54}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA(Table = [0, 71.29e5; 3000, 71.29e5]) annotation( Placement(transformation(extent = {{-194, -8}, {-172, 14}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Temperature_eauA(Table = [0, 454.46; 448, 454.46; 1155, 407.76; 2000, 407.76]) annotation( Placement(transformation(extent = {{-196, -88}, {-176, -68}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(P0 = 71.29e5, h0 = 772.09e3, T0 = 454.46, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=71.29e5, + h0=772.09e3, + T0=454.46, + option_temperature=true) annotation( Placement(transformation(extent = {{-192, -16}, {-150, -60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(Q0 = 53) annotation( + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=53) annotation( Placement(transformation(extent = {{-115, 34}, {-135, 54}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_eauA(Table = [0, 624.97; 300, 624.97; 2000, 0; 3000, 0]) annotation( Placement(transformation(extent = {{-196, 78}, {-176, 98}}, rotation = 0))); @@ -31,13 +168,24 @@ model ZeroFlow Placement(transformation(extent = {{140, -146}, {102, -110}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k = 0.43) annotation( Placement(transformation(extent = {{191, -140}, {169, -118}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve(C2(h_vol_1(start = 2600e3), h(start = 2600e3))) annotation( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + C2(h_vol_1(start=2600e3), h(start=2600e3))) annotation( Placement(transformation(extent = {{-100, 122}, {-84, 138}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge(Q(fixed = false, start = 56), K = 1e-3, T(fixed = true, start = 461.56), Pm(start = 2220000)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge( + redeclare package Medium = Medium, + Q(fixed=false, start=56), K=1e-3, + T(fixed=true, start=461.56), + Pm(start=2220000)) annotation( Placement(transformation(origin = {54, -138}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_purge(Table = [0, 10e5; 378, 10e5; 418, 7e5; 1145, 2.9e5; 2000, 2.9e5]) annotation( Placement(transformation(extent = {{162, -178}, {182, -158}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam(Q(fixed = false, start = 650), lambda(fixed = false) = 0.03, L = 48.72, D = 0.387) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, + Q(fixed=false, start=650), + lambda(fixed=false) = 0.03, + L=48.72, + D=0.387) annotation( Placement(transformation(extent = {{-48, 162}, {30, 98}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Pression_eauA1(Table = [0, 71.29e5; 378, 71.29e5; 438, 77e5; 597, 73.8e5; 1533, 69.8e5; 2340, 68.8e5; 2500, 68.8e5]) annotation( Placement(transformation(extent = {{-196, -154}, {-174, -132}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo index afbd0a01..1d671d35 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo @@ -1,34 +1,101 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + parameter Real COP1(fixed = false, start = 0.7) "Corrective terme for heat exchange coefficient or Fouling coefficient"; //parameter ThermoSysPro.Units.SI.MassFlowRate QCRF = 20000 "CRF mass flow rate"; //parameter ThermoSysPro.Units.SI.Position z=1.05 "Liquid level in Cavity"; - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Eau(h0 = 50000, Q0 = 19000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Eau( + redeclare package Medium = Medium, + h0=50000, Q0=19000) annotation( Placement(transformation(extent = {{-191, -27}, {-133, 29}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_vapeur(Q0 = 310, h0 = 2400e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_vapeur( + redeclare package Medium = Medium, + Q0=310, h0= + 2400e3) annotation( Placement(transformation(extent = {{-192, 144}, {-134, 200}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1(Q0 = 310) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1( + redeclare package Medium = Medium, + Q0=310) annotation( Placement(transformation(extent = {{151, -187}, {213, -133}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser DynamicCondenser(Dc = 0.016, ec = 0.5e-3, ntubest = 52176, cp = 506, rho = 7780, lambda = 20, Ns = 5, Rv = 8.15, Vf0 = 140/2500, Lv = 12, L2 = 12, Ce2(h_vol_1(fixed = false, start = 55390), h(fixed = false, start = 55390)), ntubesV = 223, pipe_3(dynamic_mass_balance = false, inertia = false, simplified_dynamic_energy_balance = true, C2(h(start = 55390, fixed = false)), P(start = {110000, 109000, 108000, 107000, 106000, 105000, 104000}), h(start = {50000, 65000, 80000, 95000, 115000, 140000, 160000})), P0c = 3199.2, DynamicCondenser(steady_state = true, Cal_hcond = true, Mp = 50e3, Vertical = true, Kpa = 0.01, zl(fixed = false, start = 0.65), Qcond(start = 380), hl(start = 105e3), hcond = 2e3, COP = COP1, hv(start = 115.1e3), P(fixed = true, start = 3199.2))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser DynamicCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Dc=0.016, + ec=0.5e-3, + ntubest=52176, + cp=506, + rho=7780, + lambda=20, + Ns=5, + Rv=8.15, + Vf0=140/2500, + Lv=12, + L2=12, + Ce2(h_vol_1(fixed=false, start=55390), h(fixed=false, start=55390)), + ntubesV=223, + pipe_3( + dynamic_mass_balance=false, + inertia=false, + simplified_dynamic_energy_balance=true, + C2(h(start=55390, fixed=false)), + P(start={110000,109000,108000,107000,106000,105000,104000}), + h(start={50000,65000,80000,95000,115000,140000,160000})), + P0c=3199.2, + DynamicCondenser( + steady_state=true, + Cal_hcond=true, + Mp=50e3, + Vertical=true, + Kpa=0.01, + zl(fixed=false, start=0.65), + Qcond(start=380), + hl(start=105e3), + hcond=2e3, + COP=COP1, + hv(start=115.1e3), + P(fixed=true, start=3199.2))) annotation( Placement(transformation(extent = {{-47, -52}, {71, 64}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_Eau(option_temperature = false, P0 = 100000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_Eau( + redeclare package Medium = Medium, + option_temperature=false, + P0=100000) annotation( Placement(transformation(extent = {{181, -8}, {201, 12}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_VapeurIn(Q(start = 900), K = 1e-4, Pm(start = 10000)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_VapeurIn( + redeclare package Medium = Medium, + Q(start=900), + K=1e-4, + Pm(start=10000)) annotation( Placement(transformation(extent = {{-100, 162}, {-80, 182}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Valve_ext(Q(fixed = false, start = 927), C1(P(start = 10000), Q(start = 927)), Cvmax = 15000, Pm(start = 10000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve Valve_ext( + redeclare package Medium = Medium, + Q(fixed=false, start=927), + C1(P(start=10000), Q(start=927)), + Cvmax=15000, + Pm(start=10000)) annotation( Placement(transformation(extent = {{50, -164}, {70, -144}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Level(k = 0.8) annotation( Placement(transformation(extent = {{113, -123}, {91, -101}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_VapeurIn_in4(K = 1e-4, Q(fixed = false, start = 0.01)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_VapeurIn_in4( + redeclare package Medium = Medium, + K=1e-4, + Q(fixed=false, start=0.01)) annotation( Placement(transformation(extent = {{-102, 83}, {-82, 102}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Vsup1(Q0 = 0.00001, h0 = 2759.6e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Vsup1(Q0=0.00001, + redeclare package Medium = Medium, + h0=2759.6e3) annotation( Placement(transformation(extent = {{-191, 65}, {-134, 119}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Vapeur_BP(Table = [0, 310; 22, 310; 24, 150; 25, 80; 28, 15; 31, 0.000001; 35, 0.000001; 1000, 0.000001]) annotation( Placement(transformation(extent = {{-202, 182}, {-182, 202}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_EauOut(K = 1e-4, Q(start = 20000)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_EauOut( + redeclare package Medium = Medium, + K=1e-4, + Q(start=20000)) annotation( Placement(transformation(extent = {{112, -8}, {132, 12}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1(Q(start = 1000)) annotation( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1( + redeclare package Medium = Medium, + Q(start=1000)) annotation( Placement(transformation(origin = {12, 96}, extent = {{-6, -9}, {6, 9}}, rotation = 270))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit_Eau(Table = [0, 19000; 8, 3000; 9, 1500; 9.6, 0.000001; 100, 0.000001]) annotation( Placement(transformation(extent = {{-202, 22}, {-182, 42}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo index b47a5f16..c3c63222 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo @@ -1,11 +1,29 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicOnePhaseFlowShell - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowPipeShell(Q(start = {30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}), Ds = 1, ntubes = 520, L = 12, P(start = {2000000, 1996000, 1993000, 1990000, 1986000, 1983000, 1980000, 1976000, 1973000, 1965000, 1955000, 1950000})) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowPipeShell( + redeclare package Medium = Medium, + inertia=false, + Q(start={30,30,30,30,30,30,30,30,30,30,30}), + Ds=1, + ntubes=520, + L=12, + P(start={2000000,1996000,1993000,1990000,1986000,1983000,1980000,1976000, + 1973000,1965000,1955000,1950000})) annotation( Placement(transformation(extent = {{-48, -36}, {48, 36}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature = false, P0(fixed = false) = 1900000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + P0=1900000) annotation( Placement(transformation(extent = {{74, -15}, {102, 15}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 600e3, Q(start = 500, fixed = true), P0 = 2000000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + h0=600e3, + Q(start=500, fixed=false), + P0=2000000) annotation( Placement(transformation(extent = {{-103, -15}, {-75, 15}}, rotation = 0))); ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(lambda = 10, Ns = 10, cpw = 460, rhow = 7900, D = 0.017, e = 0.002, ntubes = 520, L = 12) annotation( Placement(transformation(extent = {{-54, 30}, {54, 58}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo index e2049138..78e96e21 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo @@ -1,15 +1,42 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicPlateHeatExchanger - ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D1(Ns = 5, Sc(Q(fixed = true, start = 1036)), region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, Qc(start = {39464.19306563736, 39464.19140625, 39464.19140625, 39464.19140625, 39464.19140625, 39464.19140625}), hc(start = {280049.6746505721, 280050.4252984669, 280051.8112565058, 280040.0015809256, 280303.05286784086, 275103.35213299847, 70825.9016030344}), hf(start = {100000.0, 280103.55213273736, 280154.0094354263, 279724.06541591545, 289300.73217909626, 100000.0, 100000.0}), Pf(start = {300190.97994125, 300159.55033252, 300128.12100957, 300096.69221392, 300065.25892599, 300033.92449902, 300000}), hbf(start = {280076.2239838133, 280103.55213273736, 280154.0094354263, 279724.06541591545, 289300.73217909626, 100000.0}), muc2(start = {0.0004220110175304796, 0.00042196254388820765, 0.0004219131741885822, 0.00042188258281012253, 0.0004214613445406211, 0.0004289079959529233}), muf2(start = {0.0004219971888386315, 0.00042195825821082143, 0.00042188643245605134, 0.0004224986924487388, 0.00040920745505383134, 0.0009148967539000273})) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sc(Q(fixed=true, start=1036)), + Qc(start={39464.19306563736,39464.19140625,39464.19140625,39464.19140625,39464.19140625, + 39464.19140625}), + hc(start={280049.6746505721,280050.4252984669,280051.8112565058,280040.0015809256, + 280303.05286784086,275103.35213299847,70825.9016030344}), + hf(start={100000.0,280103.55213273736,280154.0094354263,279724.06541591545,289300.73217909626, + 100000.0,100000.0}), + Pf(start={300190.97994125,300159.55033252,300128.12100957,300096.69221392,300065.25892599, + 300033.92449902,300000}), + hbf(start={280076.2239838133,280103.55213273736,280154.0094354263,279724.06541591545, + 289300.73217909626,100000.0}), + muc2(start={0.0004220110175304796,0.00042196254388820765,0.0004219131741885822, + 0.00042188258281012253,0.0004214613445406211,0.0004289079959529233}), + muf2(start={0.0004219971888386315,0.00042195825821082143,0.00042188643245605134, + 0.0004224986924487388,0.00040920745505383134,0.0009148967539000273})) annotation( Placement(transformation(extent = {{-14, 6}, {6, 26}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0 = 340, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + T0=340) annotation( Placement(transformation(extent = {{-74, 6}, {-54, 26}}, rotation = 0))); - BoundaryConditions.SourceP sourcePQ(region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, Q(start = 1084)) annotation( + BoundaryConditions.SourceP sourcePQ( + redeclare package Medium = Medium, + Q(start=1084)) annotation( Placement(transformation(extent = {{-54, -14}, {-34, 6}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed = false) = 100000, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)= + 100000, + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{46, 6}, {66, 26}}, rotation = 0))); - BoundaryConditions.SinkP puitsP3(region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + BoundaryConditions.SinkP puitsP3( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{26, -14}, {46, 6}}, rotation = 0))); equation connect(sourceP2.C, echangeurAPlaques1D1.Ec) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo index 2a9ee684..634bdcad 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo @@ -1,11 +1,30 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicTwoPhaseFlowPipe - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1(L = 10, D = 0.03, dpfCorr(fixed = false, start = 0.2396333653343408) = 1, P(start = {2000000.0, 1999571.707027408, 1999140.94021676, 1998707.6248918818, 1998271.6837222823, 1997833.0364982954, 1997391.599890757, 1996715.8221090273, 1995640.018272837, 1994163.014585635, 1992283.4952231126, 1990000.0})) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1( + redeclare package Medium = Medium, + inertia=false, + L=10, + D=0.03, + dpfCorr( + fixed=false, + start=0.2396333653343408) = 1, + P(start={2000000,1999571.7070274,1999140.9402168,1998707.6248919,1998271.6837223,1997833.0364983,1997391.5998908,1996715.822109,1995640.0182728,1994163.0145856,1992283.4952231,1990000})) annotation( Placement(transformation(extent = {{-40, -48}, {40, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(C(Q(fixed = true, start = 1)), option_temperature = false, h0 = 800e3, P0 = 2000000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + C(Q(fixed=true, start=1)), + option_temperature=false, + h0=800e3, + P0=2000000) annotation( Placement(transformation(extent = {{-90, -28}, {-70, -8}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(option_temperature = false, h0 = 2000e3, P0 = 19.9e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation( Placement(transformation(extent = {{70, -28}, {90, -8}}, rotation = 0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature = 2, T0 = {1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900}, W0 = {2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4, 2e4}) annotation( Placement(transformation(extent = {{-10, 31}, {10, 51}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo index c168832d..656113a0 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo @@ -1,27 +1,71 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestNTUWaterHeater - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1(Q0 = 1788.90, h0 = 760.83e3, P0 = 8270000) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium, + Q0=1788.90, + h0=760.83e3, + P0=8270000) annotation( Placement(transformation(extent = {{-174, -16}, {-154, 4}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{137, -16}, {157, 4}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1(option_temperature = false, P0 = 17.49e5, h0 = 2432.50e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium, + option_temperature=false, + P0=17.49e5, + h0=2432.50e3) annotation( Placement(transformation(extent = {{-174, 84}, {-154, 104}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{-111, -16}, {-91, 4}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{-110, 84}, {-90, 104}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{136, -75}, {156, -55}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{75, -16}, {95, 4}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{75, -75}, {95, -55}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1(HeiF(start = 900000), HDesF(start = 900000), Hep(start = 500000), SCondDes = 5752, Ee(P(start = 82e5), h_vol_2(start = 760000), Q(start = 1790), h(start = 780000)), Ep(Q(start = 118)), Ev(P(start = 27.22e5), h_vol_2(start = 2430000)), KCond(fixed = false) = 5024, KPurge(fixed = false) = 1767, Sp(h_vol_1(start = 780.13e3), h(fixed = true, start = 780.13e3)), lambdaE(fixed = false) = 67.1, SPurge = 1458, Se(h(fixed = true, start = 872.08e3), P(start = 80.19e5, fixed = true))) annotation( + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium, + redeclare package Medium_c = Medium, + HeiF(start=900000), + HDesF(start=900000), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=760000), + Q(start=1790), + h(start=780000)), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se(h(fixed=true, start=872.08e3), P(start=80.19e5, fixed=true))) annotation( Placement(transformation(extent = {{-66, -77}, {50, 65}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{-110, 35}, {-90, 55}}, rotation = 0))); - BoundaryConditions.SourceQ Drain_inlet1(Q0 = 118.02, h0 = 889.89e3) annotation( + BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium, + Q0=118.02, + h0=889.89e3) annotation( Placement(transformation(extent = {{-174, 35}, {-154, 55}}, rotation = 0))); equation connect(Water_inlet1.C, singularPressureLoss6.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo index f1c40377..9424131b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo @@ -1,27 +1,61 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestSimpleDynamicCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + parameter Real L1 = 425 "First sensor chain length"; parameter Integer Ns1 = 80 "Number of cells in the first sensor chain"; parameter Real L2 = 75 "Second sensor chain length"; parameter Integer Ns2 = 1 "Number of cells in the second sensor chain"; - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, option_temperature = false) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, + P0=1e5, + option_temperature=false) annotation( Placement(transformation(extent = {{48, 30}, {88, 70}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(K = 1e-6, Q(start = 0.598447)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( + redeclare package Medium = Medium, + K=1e-6, Q(start= + 0.598447)) annotation( Placement(transformation(origin = {-90, -38}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau(option_temperature = false, h0 = 2401e3, P0 = 15050) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( + redeclare package Medium = Medium, + option_temperature=false, + h0=2401e3, + P0=15050) annotation( Placement(transformation(extent = {{-207, 148}, {-183, 170}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau(h0 = 191812, Q0 = 192) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( + redeclare package Medium = Medium, + h0=191812, Q0=192) annotation( Placement(transformation(extent = {{-184, -52}, {-208, -24}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur(Q0 = 29804.5, h0 = 113e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( + redeclare package Medium = Medium, + Q0=29804.5, h0=113e3) annotation( Placement(transformation(extent = {{-212, 30}, {-172, 68}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(K = 1e-6) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( + redeclare package Medium = Medium, + K=1e-6) annotation( Placement(transformation(origin = {36, 50}, extent = {{6, -10}, {-6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(K = 1e-6) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( + redeclare package Medium = Medium, + K=1e-6) annotation( Placement(transformation(origin = {-154, 49}, extent = {{6, -10}, {-6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(K(fixed = false) = 1e-3, Q(start = 192, fixed = true)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3( + redeclare package Medium = Medium, + K=1e-3, + Q(start=192, fixed=false)) annotation( Placement(transformation(origin = {-120, 159}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(D = 0.018, V = 1000, A = 100, lambda = 0.01, ntubes = 28700, continuous_flow_reversal = true, yNiveau(signal(fixed = false, start = 1.5)), Vf0 = 0.15, steady_state = false, P(fixed = false, start = 10000)) annotation( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( D=0.018, + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + V=1000, + A=100, + lambda=0.01, + ntubes=28700, + continuous_flow_reversal=true, + yNiveau(signal(fixed=false, start=1.5)), + Vf0=0.15, + steady_state=false, + P(fixed=false, start=10000)) annotation( Placement(transformation(extent = {{-118, 6}, {1, 116}}, rotation = 0))); equation connect(sourcePCaloporteur.C, PerteChargeCondPompe2.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo index 56b40d2f..4fd8655c 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo @@ -1,34 +1,77 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestStaticCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + parameter Units.SI.AbsolutePressure Pin_1(fixed = false, start = 20000) "Flow pressure at inlet 1 (sourceP)"; parameter Units.SI.AbsolutePressure Pin_2(fixed = false, start = 20000) "Flow pressure at inlet 2 (sourceP1)"; parameter Units.SI.AbsolutePressure Pin_3(fixed = false, start = 20000) "Flow pressure at inlet 3 (sourceP2)"; - ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur(P0(fixed = false) = 100000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur( + redeclare package Medium = Medium, + P0=100000) annotation( Placement(transformation(extent = {{158, -15}, {178, 5}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, P0 = Pin_1, C(Q(fixed = true, start = 832.66)), h0 = 2275.10e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_1, + C(Q(fixed=true, start=832.66)), + h0=2275.10e3) annotation( Placement(transformation(extent = {{-100, 140}, {-80, 160}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(option_temperature = false, h0 = 2.5481e6, C(Q(fixed = true, start = 1e-5)), P0 = Pin_2) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + option_temperature=false, + h0=2.5481e6, + C(Q(fixed=true, start=1e-5)), + P0=Pin_2) annotation( Placement(transformation(extent = {{-182, 80}, {-162, 100}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(option_temperature = false, h0 = 2.5055e6, C(Q(fixed = true, start = 1e-5)), P0 = Pin_3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false, + h0=2.5055e6, + C(Q(fixed=true, start=1e-5)), + P0=Pin_3) annotation( Placement(transformation(extent = {{-180, 40}, {-160, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 10) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation( Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 10) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation( Placement(transformation(extent = {{-100, 40}, {-80, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 10) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation( Placement(transformation(extent = {{-40, 140}, {-20, 160}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{100, -100}, {120, -80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{98, -15}, {118, 5}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{40, -100}, {60, -80}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur(SCO = 47786, z = 0, CPCE = 0, KCO = 3400.57, QC0 = 37700) annotation( + ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + SCO=47786, + z=0, + CPCE=0, + KCO=3400.57, + QC0=37700) annotation( Placement(transformation(extent = {{-24, -24}, {68, 74}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur(h0 = 60e3, C(P(fixed = true, start = 328800)), Q0(fixed = true) = 42261) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur( + redeclare package Medium = Medium, + h0=60e3, + C(P(fixed=false, start=328800)), + Q0(fixed=true) = 42261) annotation( Placement(transformation(extent = {{-189, -25}, {-146, 15}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(K = 1e-3) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-3) annotation( Placement(transformation(extent = {{-101, -15}, {-81, 5}}, rotation = 0))); equation connect(sourceP1.C, singularPressureLoss.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo index 811cbfc9..4439eadd 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo @@ -1,25 +1,53 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestStaticPlateHeatExchanger - ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques1(Sp = 2, Sc(Q(fixed = true, start = 1036.78)), region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Sc(Q(fixed=true, start=1036.78)), + Hmc(start=220524.0), + Hmf(start=127690.0), + Qf(start=1000.0)) annotation( Placement(transformation(extent = {{-10, 30}, {10, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0 = 340) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + T0=340) annotation( Placement(transformation(extent = {{-70, 30}, {-50, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, 10}, {-30, 30}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed = false) = 100000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2( + redeclare package Medium = Medium, + P0(fixed=false)= + 100000) annotation( Placement(transformation(extent = {{50, 30}, {70, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, 10}, {50, 30}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques(region_c = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_f = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Hmc(start=220524.0), + Hmf(start=127690.0), + Qc(start=1000.0), + Qf(start=1000.0)) annotation( Placement(transformation(extent = {{-10, -34}, {10, -14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP6(T0 = 340) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP6( + redeclare package Medium = Medium, + T0=340) annotation( Placement(transformation(extent = {{-70, -34}, {-50, -14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP7 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP7 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, -54}, {-30, -34}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP6 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP6 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{50, -34}, {70, -14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP7 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP7 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -54}, {50, -34}}, rotation = 0))); equation connect(sourceP2.C, echangeurAPlaques1.Ec) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo index 4f31843a..5128fddf 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo @@ -1,22 +1,59 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.InternalCombustionEngine; model TestInternalCombustionEngine + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + parameter Integer NCEL = 7; Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ(Hum = 0, Xh = 0.25, Xs = 0, Xashes = 0, Xc = 0.75, Xo = 0, Xn = 0, Q0 = 0.0676, rho = 0.744, LHV = 50e6, T0(displayUnit = "K") = 299, P0 = 210300, Vol = 100) annotation( Placement(transformation(extent = {{-106, -81}, {-72, -43}}, rotation = 0))); - BoundaryConditions.SourcePQ sourceAir(Xso2 = 0, Xco2 = 0, Xh2o = 0.005, Xo2 = 0.23, Q0 = 1.9627, T0 = 30 + 273.16, option_temperature = true, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases, P0 = 191000) annotation( + BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=1.9627, + T0=30 + 273.16, + option_temperature=true, + X0={0.765,0.23,0.005,0,0}, + P0=191000) annotation( Placement(transformation(extent = {{111, -79}, {73, -45}}, rotation = 0))); - BoundaryConditions.Sink sink(option_temperature = true) annotation( + BoundaryConditions.Sink sink( + redeclare package Medium = Medium_FlueGases, + option_temperature=true) annotation( Placement(transformation(extent = {{0, 44}, {44, 86}}, rotation = 0))); - BoundaryConditions.SourcePQ SourcePQ_Water(Q0 = 15.3, h0 = 334.41e3, P0 = 410000) annotation( + BoundaryConditions.SourcePQ SourcePQ_Water( + redeclare package Medium = Medium, + Q0=15.3, + h0=334.41e3, + P0=410000) annotation( Placement(transformation(extent = {{-107, -19}, {-71, 15}}, rotation = 0))); - Machines.InternalCombustionEngine alternatingEngine(mechanical_efficiency_type = 2, Rmeca_nom = 0.41, Coef_Rm_a = -5.4727e-9, Coef_Rm_b = 4.9359e-5, Coef_Rm_c = 0.30814, Xpth = 0.05, MMg = 20, DPe = 1, RV = 6.45, Kc = 1.28, Kd = 1.33, Wmeca(start = 1400e3), Welec(start = 1358e3), Wcomb(start = 3.4942e6), exc(start = 1.8), Gamma = 1.2085, Tsf(start = 1088.15)) annotation( + Machines.InternalCombustionEngine alternatingEngine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + mechanical_efficiency_type=2, + Rmeca_nom=0.41, + Coef_Rm_a=-5.4727e-9, + Coef_Rm_b=4.9359e-5, + Coef_Rm_c=0.30814, + Xpth=0.05, + MMg=20, + DPe=1, + RV=6.45, + Kc=1.28, + Kd=1.33, + Wmeca(start=1400e3), + Welec(start=1358e3), + Wcomb(start=3.4942e6), + exc(start=1.8), + Gamma=1.2085, + Tsf(start=1088.15)) annotation( Placement(transformation(extent = {{-44, -46}, {44, 42}}))); - BoundaryConditions.Sink Sink_Water1 annotation( + BoundaryConditions.Sink Sink_Water1 (redeclare package Medium = + Medium) annotation( Placement(transformation(extent = {{75, -19}, {111, 15}}, rotation = 0))); - PressureLosses.SingularPressureLoss singularPressureLoss annotation( + PressureLosses.SingularPressureLoss singularPressureLoss ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-63, -8}, {-51, 4}}))); - PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( + PressureLosses.SingularPressureLoss singularPressureLoss1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{51, -9}, {65, 5}}))); equation connect(alternatingEngine.Cair, sourceAir.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo index d4f9c7e4..03ad31b4 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo @@ -1,11 +1,16 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestBend - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-62, -6}, {-42, 14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{41, -34}, {61, -14}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.Bend Bend annotation( + ThermoSysPro.Fluid.PressureLosses.Bend Bend ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-8, -6}, {12, 14}}, rotation = 0))); equation connect(Bend.C2, SinkP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo index f61aedd3..be640f3a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo @@ -1,13 +1,19 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestCheckValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-40, -10}, {-20, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 6e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( + redeclare package Medium = Medium, + P0=6e5) annotation( Placement(transformation(extent = {{40, -10}, {60, 10}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Pulse pulse(amplitude = 6e5, width = 50, period = 100, offset = 3e5) annotation( Placement(transformation(extent = {{-80, -10}, {-60, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3 annotation( + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{0, -10}, {20, 10}}, rotation = 0))); equation connect(sourceP1.C, checkValve3.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo index 19690b16..65b36378 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo @@ -1,11 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestControlValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-64, -10}, {-44, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{44, -10}, {64, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve(mode_caract = 1, caract = [0, 0; 0.5, 3000; 0.75, 7000; 1, 8000]) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve( + redeclare package Medium = Medium, + mode_caract=1, caract=[ + 0,0; 0.5,3000; 0.75,7000; 1,8000]) annotation( Placement(transformation(extent = {{-10, -4}, {10, 16}}, rotation = 0))); InstrumentationAndControl.Blocks.Tables.Table1DTemps Constante1(Table = [0, 0.9; 5, 0.9; 15, 0.5; 25, 0.5; 50, 0.2; 100, 0.2]) annotation( Placement(transformation(extent = {{-30, 30}, {-10, 50}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo index aa077dd4..6f81ce12 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo @@ -1,11 +1,16 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDiaphragm - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-64, -10}, {-44, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{44, -10}, {64, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm annotation( + ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation connect(Diaphragm.C2, PuitsP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo index cf5c486d..9d624510 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo @@ -1,11 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDynamicCheckValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-38, -10}, {-18, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 6e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( + redeclare package Medium = Medium, + P0=6e5) annotation( Placement(transformation(extent = {{42, -10}, {62, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J = 10) annotation( + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve( + redeclare package Medium = Medium, + J=10) annotation( Placement(transformation(extent = {{2, -10}, {22, 10}}, rotation = 0))); InstrumentationAndControl.Blocks.Sources.Sinusoide pulse(period = 100, amplitude = 3e5, offset = 6e5) annotation( Placement(transformation(extent = {{-78, -10}, {-58, 10}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo index e1ab8d59..85a4f627 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo @@ -1,19 +1,45 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDynamicReliefValve - ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve ReliefValve(mech_steady_state = false, caract = [0, 0; 0.1, 2745; 0.2, 4915; 0.3, 6391; 0.4, 7339; 0.5, 7949; 0.6, 8351; 0.7, 8625; 0.8, 8818; 0.9, 8958; 1, 9063], Cvmax = 9063, mode_caract = 1, A1 = 0.125, A2 = 0.125, z_max = 0.6, m = 100, Popen = 2000000, Q(start = 1.4404060369658185E-32)) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve ReliefValve( + redeclare package Medium = Medium, + mech_steady_state=false, + caract=[0,0; 0.1,2745; 0.2,4915; 0.3,6391; 0.4,7339; 0.5,7949; 0.6,8351; + 0.7,8625; 0.8,8818; 0.9,8958; 1,9063], + Cvmax=9063, + mode_caract=1, + A1=0.125, + A2=0.125, + z_max=0.6, + m=100, + Popen=2000000, + Q(start=1.4404060369658185E-32)) annotation( Placement(transformation(extent = {{0, 20}, {20, 40}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe2(Pm(start = 199283), Q(start = 1335.993983016864)) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe2( + redeclare package Medium = Medium, + Pm(start=199283), + Q(start=1335.993983016864)) annotation( Placement(transformation(extent = {{40, -20}, {60, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{80, -20}, {100, 0}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe1(D = 0.4, Pm(start = 1478795.1075221882)) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe1( + redeclare package Medium = Medium, + D=0.4, + Pm(start=1478795.1075221882)) annotation( Placement(transformation(extent = {{-40, -20}, {-20, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeD VolumeD1(P(start = 298566), h(start = 72156.6431966866)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeD VolumeD1( + redeclare package Medium = Medium, + P(start=298566), h(start= + 72156.6431966866)) annotation( Placement(transformation(extent = {{0, -20}, {20, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-80, -20}, {-60, 0}}))); InstrumentationAndControl.Blocks.Sources.Rampe ramp(Duration = 200, Finalvalue = 30e5, Initialvalue = 15e5) annotation( Placement(transformation(extent = {{-100, 20}, {-80, 40}}))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo index 79fba28f..9fb30d4f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo @@ -1,11 +1,21 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestLumpedStraightPipe - ThermoSysPro.Fluid.Volumes.Tank tank1(h0 = 2e5) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.Tank tank1( + redeclare package Medium = Medium, + h0=2e5) annotation( Placement(transformation(extent = {{-50, 16}, {-30, 36}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank tank2(z0 = 10) annotation( + ThermoSysPro.Fluid.Volumes.Tank tank2( + redeclare package Medium = Medium, + z0=10) annotation( Placement(transformation(extent = {{30, 16}, {50, 36}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(inertia = true, lambda = 0.012, lambda_fixed = true) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + inertia=true, + lambda=0.012, + lambda_fixed=true) annotation( Placement(transformation(extent = {{-10, -24}, {10, -4}}, rotation = 0))); equation connect(tank1.Cs2, lumpedStraightPipe.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo index 30ff389e..96e761c3 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo @@ -1,11 +1,16 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestPipePressureLoss - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-85, -10}, {-65, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{64, -10}, {84, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-40, -53}, {38, 53}}, rotation = 0))); equation connect(pipePressureLoss.C2, PuitsP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo index f854198e..4fa1d9a7 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo @@ -1,17 +1,24 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestSwitchValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-90, -10}, {-70, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -10}, {90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve annotation( + ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-18, -9}, {18, 37}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Logique.Pulse pulse(width = 10, period = 20) annotation( Placement(transformation(extent = {{-50, 31}, {-30, 51}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-55, -10}, {-35, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{34, -10}, {54, 10}}, rotation = 0))); equation connect(pulse.yL, SwitchValve.Ouv) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo index 7208b618..2e7cdd13 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo @@ -1,13 +1,23 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestThreeWayValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-90, -10}, {-70, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -10}, {90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve(C2(Q(start = -7.902947109890763E-33)), C3(Q(start = 2716.4138702433384)), Valve1(Pm(start = 200000.0)), VolumeA1(h(start = 71016.12237181117))) annotation( + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare package Medium = Medium, + C2(Q(start=-7.902947109890763E-33)), + C3(Q(start=2716.4138702433384)), + Valve1(Pm(start=200000.0)), + VolumeA1(h(start=71016.12237181117))) annotation( Placement(transformation(extent = {{-10, -6}, {10, 14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -50}, {90, -30}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe rampe annotation( Placement(transformation(extent = {{-50, 30}, {-30, 50}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo index 36991e2c..1b690853 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo @@ -1,15 +1,53 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SolarCollector; model TestFresnelField + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(ntubes = 1, steady_state = true, D = 0.07, e = 0.004, Ns = 30, T0 = 500, lambda = 20, cpw = 500, rhow = 8000, Tp(start = {628.0843201819387, 627.9310075597404, 627.8220175907211, 627.7368992018166, 627.6679716601412, 627.6112649113921, 627.5643995456558, 627.5258238160011, 627.4944728950805, 627.4695948757801, 627.4506537300122, 627.4372716636091, 627.4291939746797, 627.426267226699, 627.428426585461, 627.4356896138493, 627.4481553612113, 627.4660085346942, 627.4895290639054, 627.5191082002851, 627.5552734790091, 627.5987264837852, 627.6504001032708, 627.7115474128314, 627.7838847016081, 627.8698331666657, 627.9729350144038, 629.4253815385038, 633.135688507217, 636.2622387488283}), Tp1(start = {610.2709965207655, 610.0984334604643, 609.9757644369477, 609.8799665740102, 609.8023932206363, 609.7385750723525, 609.6858335131916, 609.6424216866362, 609.6071408778737, 609.5791446660139, 609.5578296140685, 609.5427704711935, 609.533680491646, 609.5303869740989, 609.5328169418054, 609.540990157294, 609.5550181389947, 609.5751088339957, 609.6015773714007, 609.6348642175905, 609.6755632868924, 609.7244644309128, 609.7826179283193, 609.8514345863706, 609.9328467812495, 610.0295806069864, 610.1456244663702, 611.7808730290952, 615.9622431406954, 619.4903247027197}), Tp2(start = {644.9596553467713, 644.824579502235, 644.7285482944553, 644.6535470354397, 644.592810046145, 644.5428402353538, 644.5015416419557, 644.4675473586904, 644.4399193877858, 644.4179953736024, 644.4013031238645, 644.3895098327511, 644.3823911261306, 644.3798118348441, 644.3817148399042, 644.38811560583, 644.3991013774125, 644.4148348525065, 644.4355626048274, 644.4616292617266, 644.4934994867675, 644.531791236838, 644.5773261834961, 644.6312079828199, 644.6949482231629, 644.7706792525222, 644.8615205623447, 646.1407907783827, 649.404839172216, 652.1510013554424}), L = 1e4/11.46) annotation( Placement(transformation(extent = {{-40, -36}, {40, -2}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(ntubes = 1, steady_state = true, rugosrel = 0.00005, dpfCorr = 1, Ns = 30, P(start = {12512365.778485337, 12512269.4730028, 12512159.010926897, 12512028.619141866, 12511878.28140543, 12511707.984695798, 12511517.718132183, 12511307.472416837, 12511077.239500606, 12510827.012364838, 12510556.784871727, 12510266.551658653, 12509956.30806284, 12509626.050068311, 12509275.774270097, 12508905.477852736, 12508515.15858121, 12508104.814803492, 12507674.445464557, 12507224.050132478, 12506753.629037917, 12506263.183129327, 12505752.714147368, 12505222.224723859, 12504671.718513375, 12504101.200370008, 12503510.676589508, 12502896.415784404, 12502231.48634808, 12501522.52554151, 12500776.553197166, 12500000.0}), h(start = {1500000.0, 1536254.1810191544, 1572547.5410785251, 1608868.7411348266, 1645211.676359884, 1681572.2077847784, 1717947.2125321354, 1754334.1766730088, 1790730.9833788855, 1827135.788296852, 1863546.9394607474, 1899962.9220483964, 1936382.3178860326, 1972803.7739566958, 2009225.9764870608, 2045647.6282789519, 2082067.4276265746, 2118484.0474634594, 2154896.1134394333, 2191302.179544121, 2227700.6996020116, 2264089.9923674623, 2300468.196934767, 2336833.213464297, 2373182.6211112435, 2409513.559261445, 2445822.5467506223, 2482105.1942732874, 2518015.7979130256, 2552967.680496474, 2587102.355161259, 82548.43470391157}), D = 0.07, inertia = false, L = 1e4/11.46) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + ntubes=1, + steady_state=true, + rugosrel=0.00005, + dpfCorr=1, + Ns=30, + P(start={12512365.778485337,12512269.4730028,12512159.010926897, + 12512028.619141866,12511878.28140543,12511707.984695798, + 12511517.718132183,12511307.472416837,12511077.239500606, + 12510827.012364838,12510556.784871727,12510266.551658653, + 12509956.30806284,12509626.050068311,12509275.774270097, + 12508905.477852736,12508515.15858121,12508104.814803492, + 12507674.445464557,12507224.050132478,12506753.629037917, + 12506263.183129327,12505752.714147368,12505222.224723859, + 12504671.718513375,12504101.200370008,12503510.676589508, + 12502896.415784404,12502231.48634808,12501522.52554151, + 12500776.553197166,12500000.0}), + h(start={1500000.0,1536254.1810191544,1572547.5410785251,1608868.7411348266, + 1645211.676359884,1681572.2077847784,1717947.2125321354, + 1754334.1766730088,1790730.9833788855,1827135.788296852, + 1863546.9394607474,1899962.9220483964,1936382.3178860326, + 1972803.7739566958,2009225.9764870608,2045647.6282789519, + 2082067.4276265746,2118484.0474634594,2154896.1134394333, + 2191302.179544121,2227700.6996020116,2264089.9923674623, + 2300468.196934767,2336833.213464297,2373182.6211112435, + 2409513.559261445,2445822.5467506223,2482105.1942732874, + 2518015.7979130256,2552967.680496474,2587102.355161259, + 82548.43470391157}), + D=0.07, + inertia=false, + L=1e4/11.46) annotation( Placement(transformation(extent = {{-36, -67}, {36, -20}}, rotation = 0))); ThermoSysPro.Solar.Collectors.FresnelField champThermosolaireLFR_N(Ns = 30, T(start = fill(500, 30)), F12 = 0.6366, A = 1e4, T0 = 303) annotation( Placement(transformation(extent = {{-40, -16}, {40, 72}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(h0 = 2000e3, P0 = 125e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + h0=2000e3, P0=125e5) annotation( Placement(transformation(extent = {{48, -54}, {68, -34}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0 = 11, h0 = 1500e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP( + redeclare package Medium = Medium, + Q0=11, + h0=1500e3) annotation( Placement(transformation(extent = {{-69, -53}, {-49, -33}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe DNI(Starttime = 100, Initialvalue = 100, Duration = 3600, Finalvalue = 900) annotation( Placement(transformation(extent = {{72, 39}, {58, 53}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo index 619cfc2b..61745204 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo @@ -1,11 +1,22 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SteamTurbine; model TestStodolaTurbine - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Cst = 2e6, eta_is_nom = 0.94) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare package Medium = Medium, + Cst=2e6, + eta_is_nom=0.94) annotation( Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(P0 = 10000000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP( + redeclare package Medium = Medium, + P0=10000000) annotation( Placement(transformation(extent = {{30, -10}, {50, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, P0 = 27000000, h0 = 3475.e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=27000000, + h0=3475.e3) annotation( Placement(transformation(extent = {{-50, -10}, {-30, 10}}, rotation = 0))); equation connect(sourceP.C, stodolaTurbine.Ce) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo index 2a569c87..493067aa 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo @@ -1,25 +1,85 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestDynamicDrum + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + parameter ThermoSysPro.Units.xSI.Cv CvmaxWater(fixed = false, start = 670) "Maximum CV (active if mode_caract=0)"; parameter Real LambdaPipe(fixed = false, start = 0.085) "Friction pressure loss coefficient (active if lambda_fixed=true)"; - ThermoSysPro.Fluid.Volumes.DynamicDrum Drum(Vv(start = 39), Vertical = false, hl(start = 1454400), hv(start = 2.658e6), xv(start = 0.01), rhol(start = 670), rhov(start = 78), zl(fixed = true, start = 1.05), P0 = 13000000, P(start = 13000000, fixed = false), Tp(start = 592.6)) annotation( + ThermoSysPro.Fluid.Volumes.DynamicDrum Drum( + redeclare package Medium = Medium, + Vv(start=39), + Vertical=false, + hl(start=1454400), + hv(start=2.658e6), + xv(start=0.01), + rhol(start=670), + rhov(start=78), + zl(fixed=true, start=1.05), + P0=13000000, + P(start=13000000, fixed=false), + Tp(start=592.6)) annotation( Placement(transformation(extent = {{-61, 16}, {1, 78}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve(Cv(start = 335), Q(start = 79.5), rho(start = 888), h(start = 1400000), C1(h_vol_2(start = 1400e3), h(start = 1400e3), Q(start = 79.5), P(start = 13300000)), Cvmax = CvmaxWater, Pm(start = 13100000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve( + redeclare package Medium = Medium, + Cv(start=335), + Q(start=79.5), + rho(start=888), + h(start=1400000), + C1( + h_vol_2(start=1400e3), + h(start=1400e3), + Q(start=79.5), + P(start=13300000)), + Cvmax=CvmaxWater, + Pm(start=13100000)) annotation( Placement(transformation(extent = {{-120, 74}, {-100, 94}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(Cv(start = 25000), Q(start = 79.5), rho(start = 78.5), h(start = 2657930), Cvmax = 10000, Pm(start = 12900000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + redeclare package Medium = Medium, + Cv(start=25000), + Q(start=79.5), + rho(start=78.5), + h(start=2657930), + Cvmax=10000, + Pm(start=12900000)) annotation( Placement(transformation(extent = {{40, 74}, {60, 94}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcranBoucleEvaporatoire(T0 = fill(400, 10), heb(start = {10409, 10268, 10127, 9985, 9842, 9698, 9552, 9406, 9258, 9111}), advection = false, z2 = 10, simplified_dynamic_energy_balance = false, P(start = {13007000, 13006600, 13006000, 13005500, 13005000, 13004500, 13004000, 13003000, 13002000, 13001000, 13000000, 12999990}), D = 0.03, ntubes = 1400, h(start = {1400e3, 1450e3, 1500e3, 1550e3, 1600e3, 1650e3, 1700e3, 1750e3, 1800e3, 1850e3, 1900e3, 1950e3}), L = 20, Q(start = fill(130, 11))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcranBoucleEvaporatoire( + redeclare package Medium = Medium, + T0=fill(400, 10), + heb(start={10409,10268,10127,9985,9842,9698,9552,9406,9258,9111}), + advection=false, + z2=10, + simplified_dynamic_energy_balance=false, + P(start={13007000,13006600,13006000,13005500,13005000,13004500,13004000,13003000, + 13002000,13001000,13000000,12999990}), + D=0.03, + ntubes=1400, + h(start={1400e3,1450e3,1500e3,1550e3,1600e3,1650e3,1700e3,1750e3,1800e3,1850e3, + 1900e3,1950e3}), + L=20, + Q(start=fill(130, 11))) annotation( Placement(transformation(origin = {6, -28}, extent = {{-10, 10}, {10, -10}}, rotation = 90))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC3(option_temperature = 2, W0 = {1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7, 1e7}, T0 = {290, 290, 290, 290, 290, 290, 290, 290, 290, 290}) annotation( Placement(transformation(origin = {36, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns = 10, L = 20, D = 0.03, ntubes = 1400) annotation( Placement(transformation(origin = {18, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(L = 20, z1 = 20, C1(P(start = 130e5)), Q(fixed = true, start = 130), lambda = LambdaPipe) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + L=20, + z1=20, + C1(P(start=130e5)), + Q(fixed=true, start=130), + lambda=LambdaPipe) annotation( Placement(transformation(origin = {-66, -28}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceQ(h0 = 1400000, option_temperature = false, P0 = 13300000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceQ(h0=1400000, + redeclare package Medium = Medium, + option_temperature=false, + P0=13300000) annotation( Placement(transformation(extent = {{-196, 68}, {-176, 88}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(option_temperature = false, h0 = 2.650e6, P0 = 12700000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2.650e6, + P0=12700000) annotation( Placement(transformation(extent = {{115, 68}, {135, 88}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamValve_O(k = 0.5) annotation( Placement(transformation(extent = {{20, 100}, {40, 119}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo index 92c23447..7ef940e3 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo @@ -1,25 +1,32 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestMixer3 - ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-6, -10}, {14, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{34, -10}, {54, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-46, 10}, {-26, 30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-46, -30}, {-26, -10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-86, 10}, {-66, 30}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-86, -30}, {-66, -10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{74, -10}, {94, 10}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k = 0.5) annotation( Placement(transformation(extent = {{-46, 30}, {-26, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-86, -10}, {-66, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-46, -10}, {-26, 10}}, rotation = 0))); equation connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo index 1e2d0a65..d304aea2 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo @@ -1,23 +1,79 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestPressurizer + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + parameter Units.SI.Power Wch(fixed = false) = 0.29e6 "Power released by the electrical heaters"; parameter Real OUVfeedwaterValve(fixed = false) = 0.01 "Position of the feedwater valve"; - ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray(Cv(start = 100), C1(P(start = 160e5), h_vol_2(start = 1270e3), Q(start = 0.3), h(start = 1270e3)), Q(fixed = false, start = 0.32), Cvmax = 5000) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray( + redeclare package Medium = Medium, + Cv(start=100), + C1( + P(start=160e5), + h_vol_2(start=1270e3), + Q(start=0.3), + h(start=1270e3)), + Q(fixed=false, start=0.32), + Cvmax=5000) annotation( Placement(transformation(extent = {{-110, 130}, {-90, 150}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve(Cv(start = 25000), Cvmax(fixed = true) = 5000, Pm(start = 15500000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + redeclare package Medium = Medium, + Cv(start=25000), + Cvmax(fixed=true) = 5000, + Pm(start=15500000)) annotation( Placement(transformation(extent = {{58, 130}, {78, 150}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(L = 1, D = 1, z1 = 1, z2 = 0, C1(P(start = 160e5)), C2(P(start = 160e5)), Q(fixed = false, start = 0)) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + L=1, + D=1, + z1=1, + z2=0, + C1(P(start=160e5)), + C2(P(start=160e5)), + Q(fixed=false, start=0)) annotation( Placement(transformation(origin = {-30, -42}, extent = {{10, -10}, {-10, 10}}, rotation = 90))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante SteamrValve_O(k(fixed = true) = 0.5) annotation( Placement(transformation(extent = {{0, 156}, {20, 176}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(option_temperature = false, h0 = 1270e3, P0 = 16000000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + h0=1270e3, + P0=16000000) annotation( Placement(transformation(extent = {{-168, 124}, {-148, 144}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0 = 0, h0 = 3e6) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare package Medium = Medium, + Q0=0, + h0=3e6) annotation( Placement(transformation(extent = {{106, 124}, {126, 144}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer(Zm = 10.15, Klv = 0.5e6, cpp = 600, hl(start = 1629887.98290107), hv(start = 2596216.59571565), Zl(start = 5.5900717167325), Yw0 = 60, steady_state = true, V = 61.12, Rp = 1.27, Ae = 96.23, Klp = 1780, Kvp = 7500, Mp = 107e3, Kpa = 5.63, Ccond = 0.02, Cevap = 0.05, Yw(start = 32.92), y(start = 0.3292, fixed = true), P0 = 15500000, P(start = 15500000, fixed = true), Tp(start = 617.94155291055)) annotation( + ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( + redeclare package Medium = Medium, + Zm=10.15, + Klv=0.5e6, + cpp=600, + hl(start=1629887.98290107), + hv(start=2596216.59571565), + Zl(start=5.5900717167325), + Yw0=32.92, + steady_state=false, + V=61.12, + Rp=1.27, + Ae=96.23, + Klp=1780, + Kvp=7500, + Mp=107e3, + Kpa=5.63, + Ccond=0.02, + Cevap=0.05, + Yw(start=32.92), + y(start=0.3292), + P0=15500000, + P(start=15500000), + Tp(start=617.94155291055)) annotation( Placement(transformation(extent = {{-92, -12}, {32, 118}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(Q0 = 0, h0 = 1600000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( + redeclare package Medium = Medium, + Q0=0, + h0=1600000) annotation( Placement(transformation(extent = {{-30, -76}, {-10, -56}}, rotation = 0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource SourceC1(option_temperature = 2, T0 = {310}, W0 = {1e5}) annotation( Placement(transformation(origin = {-133, 32}, extent = {{-17, 17}, {17, -17}}, rotation = 270))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo index 05a4d4c3..8079dabd 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo @@ -1,23 +1,32 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestSplitter3 - ThermoSysPro.Fluid.Junctions.Splitter3 splitter3 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-16, -10}, {4, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0 = 100, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1( + redeclare package Medium = Medium, + Q0=100, + option_temperature=true) annotation( Placement(transformation(extent = {{-96, -10}, {-76, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-56, -10}, {-36, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{84, 30}, {104, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{84, -50}, {104, -30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{44, 30}, {64, 50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{44, -50}, {64, -30}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1(k = 0) annotation( Placement(transformation(extent = {{-36, 10}, {-16, 30}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{84, -10}, {104, 10}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2(k = 0) annotation( Placement(transformation(extent = {{-36, -30}, {-16, -10}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo index 65fb112c..af94442a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo @@ -1,27 +1,64 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestStaticDrum3 - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-30, 1}, {20, 51}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1( + redeclare package Medium = Medium, + K=1e-4, + rho(start=688.4113, displayUnit="g/cm3")) annotation( Placement(transformation(extent = {{38, 7}, {58, 27}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2( + redeclare package Medium = Medium, + K=1e-4, + rho(start=691.7364, displayUnit="g/cm3")) annotation( Placement(transformation(extent = {{-58, -8}, {-38, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0 = 10) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare package Medium = Medium, + Q0=10) annotation( Placement(transformation(extent = {{74, 7}, {94, 27}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0 = 100, h0 = 1400e3, P0 = 10000000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + Q0=100, + h0=1400e3, + P0=10000000) annotation( Placement(transformation(extent = {{-86, -8}, {-66, 12}}, rotation = 0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSink heatSource annotation( Placement(transformation(origin = {-76, 26}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3( + redeclare package Medium = Medium, + K=1e-4, + rho(start=55.45212, displayUnit="g/cm3")) annotation( Placement(transformation(extent = {{38, 52}, {58, 72}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{74, 52}, {94, 72}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe(z1 = 0, rugosrel = 0.0001, D = 0.05, ntubes = 10, L = 10, z2 = 10) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + inertia=false, + z1=0, + rugosrel=0.0001, + D=0.05, + ntubes=10, + L=10, + z2=10, + P(start={10053832.0,10046967.0,10041924.0,10037550.0,10033392.0,10029237.0,10024966.0,10020505.0,10015807.0,10010839.0,10005576.0,10000000.0}, each displayUnit="bar")) annotation( Placement(transformation(origin = {-28.5, -45.5}, extent = {{13.5, 11.5}, {-13.5, -11.5}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe(lambda(fixed = false) = 0.03, D = 0.05, ntubes = 10, L = 10, z1 = 10, Q(fixed = true, start = 30)) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + lambda(fixed=false) = 0.03, + D=0.05, + ntubes=10, + L=10, + z1=10, + Q(fixed=false, start=30)) annotation( Placement(transformation(origin = {20, -45}, extent = {{-14, -12}, {14, 12}}, rotation = 270))); - ThermoSysPro.Fluid.Volumes.VolumeA volumeA annotation( + ThermoSysPro.Fluid.Volumes.VolumeA volumeA ( + redeclare package Medium = Medium, + steady_state=false) annotation( Placement(transformation(extent = {{1, -72}, {-9, -62}}, rotation = 0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(option_temperature = 2, W0 = {2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6, 2e6}, T0 = {300, 300, 300, 300, 300, 300, 300, 300, 300, 300}) annotation( Placement(transformation(origin = {-76, -45}, extent = {{-10, -10}, {10, 10}}, rotation = 90))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo index 6b562cd0..3cd16300 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo @@ -1,19 +1,31 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestSteamDryer - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta = 0.9, P(start = 10000000)) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer( + redeclare package Medium = Medium, + eta=0.9, P(start= + 10000000)) annotation( Placement(transformation(extent = {{-10, -8}, {10, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ(P0 = 10000000, h0 = 2400000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ( + redeclare package Medium = Medium, + P0=10000000, h0= + 2400000) annotation( Placement(transformation(extent = {{-90, -4}, {-70, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, -4}, {-30, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -4}, {90, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -4}, {50, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 1.e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=1.e-4) annotation( Placement(transformation(extent = {{30, -44}, {50, -24}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -44}, {90, -24}}, rotation = 0))); equation connect(sourceQ.C, singularPressureLoss2.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo index a249d370..13fa209d 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo @@ -1,21 +1,31 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestTank - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -50}, {50, -30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, 2}, {-30, 22}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-90, -4}, {-70, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -50}, {90, -30}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed = false, start = 5)) annotation( + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=5)) annotation( Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe1 annotation( Placement(transformation(extent = {{-90, 30}, {-70, 50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -4}, {50, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -4}, {90, 16}}, rotation = 0))); equation connect(PerteDP1.C2, PuitsP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo index f74708d5..c14242cd 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo @@ -1,23 +1,42 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestVolumeATh - ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(h0 = 1.2e5, V = 1, P0 = 300000, P(start = 300000)) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh( + redeclare package Medium = Medium, + h0=1.2e5, + V=1, + P0=300000, + P(start=300000)) annotation( Placement(transformation(extent = {{-15, 21}, {15, -9}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sink(T0 = 320, option_temperature = false, h0 = 200000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink( + redeclare package Medium = Medium, + T0=320, + option_temperature=false, + h0=200000) annotation( Placement(transformation(extent = {{64, -4}, {84, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve1(Cvmax = 80) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve1( + redeclare package Medium = Medium, + Cvmax=80) annotation( Placement(transformation(extent = {{-47, -58}, {-27, -38}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe Rampe(Finalvalue = 0, Initialvalue = 1) annotation( Placement(transformation(extent = {{-89, -38}, {-73, -22}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve2 annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{28, 2}, {48, 22}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-83, -6}, {-59, 18}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Constant annotation( Placement(transformation(extent = {{10, 18}, {26, 34}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(option_temperature = false) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false) annotation( Placement(transformation(extent = {{-79, -64}, {-59, -44}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(L = 0.1, D = 1) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1( + redeclare package Medium = Medium, + L=0.1, D=1) annotation( Placement(transformation(extent = {{-47, -4}, {-27, 16}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Table1DTemps(Table = [0, 10; 5, -10; 8, 0; 9, 0]) annotation( Placement(transformation(extent = {{-93, 16}, {-73, 36}}, rotation = 0))); From 2e85930c4c73ed7fe501dab9837a4dbb0ff93399 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 27 Jul 2026 09:45:29 +0200 Subject: [PATCH 198/213] #125 defer PTSC oil medium example port --- .../ConcentratedSolarPowerPlant_PTSC.mo | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo index d8d135a1..4df33c48 100644 --- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo +++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo @@ -36,23 +36,23 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(extent = {{-171, 34}, {-115, 78}}, rotation = 0))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_11(P(each start = 2.2e6), option_temperature = false, L = L1, Ns = Ns1, T0 = {587.815, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0}, h0 = fill(650e3, Ns1), D = 0.04, advection = false, hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {801122.25, 638880.0, 582613.0, 562383.0, 546913.0, 533929.0, 522949.0, 513609.0, 505631.0, 498794.0, 492917.0, 487857.0, 483492.0, 479721.0, 476460.0, 473637.0, 471191.0, 469070.0, 467231.0, 465634.0, 464248.0, 464248.0})) annotation( Placement(transformation(extent = {{-116, 122}, {-173, 78}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(xe(start = 0.273553)) annotation( + ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(proe(x(start = 0.273553))) annotation( Placement(transformation(extent = {{-86, 39}, {-62, 63}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 5, Kvl = 100, e = 0.0005, L = 3.5, Vf0 = 0.15, ntubes = 300, steady_state = false, V = 30, P0 = 5000, Cv(Q(start = 1.13)), Pfond(start = 5000.53), rhol(start = 995.533)) annotation( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 5, Kvl = 100, e = 0.0005, L = 3.5, Vf0 = 0.15, ntubes = 300, steady_state = false, V = 30, P0 = 5000, Cv(Q(start = 1.13)), Pfond(start = 5000.53), proe(d(start = 995.533))) annotation( Placement(transformation(extent = {{116, -51}, {156, -11}}, rotation = 0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, option_temperature = false) annotation( Placement(transformation(extent = {{178, -48}, {206, -22}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(K = 1e-6, C2(h_vol_1(start = 137765.0)), Pm(start = 5000.53)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(K = 1e-6, C2(h_vol_1(start = 137765.0)), Pm(start = 5000.53), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(origin = {117, -82.5}, extent = {{-6, -9.5}, {6, 9.5}}, rotation = 180))); ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss Connection_HQ_Secheur_Ballon(Q(start = 1)) annotation( Placement(transformation(origin = {-73, -15}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(Pm(fixed = false, start = 3502560.0), a1(fixed = false) = -4.9345734425e8, hn(start = 716.167), a3 = 2000, b1 = -3500, b2 = 510, Q(fixed = true, start = 1.13), C2(h_vol_1(start = 150161.0)), Qv(start = 0.00113454), h(start = 143963.0)) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(Pm(fixed = false, start = 3502560.0), a1(fixed = false) = -4.9345734425e8, hn(start = 716.167), a3 = 2000, b1 = -3500, b2 = 510, Q(fixed = true, start = 1.13), C2(h_vol_1(start = 150161.0)), Qv(start = 0.00113454), h(start = 143963.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(extent = {{84, -91}, {64, -71}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC Ballon(V = 1, h0 = 3e5, h(start = 1125640.0), P0 = 7000000, dynamic_mass_balance = true, P(start = 7000000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC Ballon(V = 1, h0 = 3e5, h(start = 1125640.0), P0 = 7000000, dynamic_mass_balance = true, P(start = 7000000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(extent = {{-63, -91}, {-83, -71}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(origin = {-30, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(origin = {-212, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(option_temperature = false, h0 = 63.03e3, P0(fixed = false) = 500000, Q(fixed = true, start = 14.9263)) annotation( Placement(transformation(extent = {{66, -49}, {94, -22}}, rotation = 0))); @@ -64,17 +64,17 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(extent = {{-48, -62}, {-38, -52}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv1(k = 0.5) annotation( Placement(transformation(extent = {{-231, -62}, {-221, -52}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(Pm(fixed = false), hn(start = 466.292), a3 = 2000, b2 = 510, b1 = -3500, a1(fixed = false) = -9.5e8, Q(fixed = false, start = 0.65), C2(P(fixed = false, start = 75e5)), C1(P(fixed = true, start = 70e5), h_vol_2(start = 1125640.0)), Qv(start = 0.00521975), h(start = 1126540.0)) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(Pm(fixed = false), hn(start = 466.292), a3 = 2000, b2 = 510, b1 = -3500, a1(fixed = false) = -9.5e8, Q(fixed = false, start = 0.65), C2(P(fixed = false, start = 75e5)), C1(P(fixed = true, start = 70e5), h_vol_2(start = 1125640.0)), Qv(start = 0.00521975), h(start = 1126540.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(extent = {{-158, -91}, {-178, -71}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(K = 1e-6) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(K = 1e-6, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(origin = {-120, -81}, extent = {{-6, -10}, {6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(W_fric = 1, Cst(fixed = false, start = 6.8e10) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.92, Pe(fixed = true, start = 8000000), Ps(fixed = false, start = 1800000)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(W_fric = 1, Cst(fixed = false, start = 6.8e10) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.92, Pe(fixed = true, start = 8000000), Ps(fixed = false, start = 1800000), pros(d(start = 8.36949))) annotation( Placement(transformation(extent = {{47, 72}, {73, 40}}, rotation = 0))); ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur annotation( Placement(transformation(extent = {{168, 90}, {198, 130}}, rotation = 0))); Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi4(cpw = 1000, steady_state = true, lambda = 26, D = 0.04, L = L4, Ns = Ns4, ntubes = 3, e = 0.003, Tp1(start = {532.06, 532.262, 532.478}), Tp2(start = {533.3, 532.429, 532.217}), Tp(start = {532.141, 532.349, 532.57})) annotation( Placement(transformation(origin = {-269, -12}, extent = {{-24, -30}, {24, 30}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(option_temperature = false, D = 0.04, L = L4, Ns = Ns4, T0 = fill(300, Ns4), h0 = fill(650e3, Ns4), ntubes = 3, inertia = false, advection = false, P(start = {8751668.0, 8729230.0, 8724830.0, 8720430.0, 8733863.0}), h(start = {1128519.5, 1128310.0, 1129260.0, 1130270.0, 1131729.0})) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(option_temperature = false, D = 0.04, L = L4, Ns = Ns4, T0 = fill(300, Ns4), h0 = fill(650e3, Ns4), ntubes = 3, inertia = false, advection = false, P(start = {8751668.0, 8729230.0, 8724830.0, 8720430.0, 8733863.0}), h(start = {1128519.5, 1128310.0, 1129260.0, 1130270.0, 1131729.0}), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(origin = {-245.5, -11.5}, extent = {{-23.5, -23.5}, {23.5, 23.5}}, rotation = 90))); ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_44(P(each start = 1.6e6), option_temperature = false, L = L4, Ns = Ns4, T0 = {532.656, 550.0, 550.0}, h0 = fill(650e3, Ns4), advection = false, D(fixed = true) = 0.04, C2(P(fixed = false, start = 16.99e5), Q(fixed = false, start = 2)), hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {465547.78125, 463670.0, 463128.0, 462620.0, 462620.0})) annotation( Placement(transformation(origin = {-293, -12}, extent = {{23, 24}, {-23, -24}}, rotation = 90))); @@ -84,15 +84,15 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(origin = {-212, 138.5}, extent = {{6, -9.5}, {-6, 9.5}}, rotation = 180))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(K = 1e-6, p_rho = 900) annotation( Placement(transformation(origin = {-286, 138.5}, extent = {{6, -9.5}, {-6, 9.5}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(W_fric = 1, Cst(fixed = false, start = 8.3e9) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.94, Pe(fixed = true, start = 1800000), Ps(fixed = false, start = 5000), xm(start = 0.908482)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(W_fric = 1, Cst(fixed = false, start = 8.3e9) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.94, Pe(fixed = true, start = 1800000), Ps(fixed = false, start = 5000), pros(d(start = 0.0434309)), xm(start = 0.908482)) annotation( Placement(transformation(extent = {{105, 72}, {131, 40}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Tank(p_rho = 895, A = 0.1, z0 = 1, h0 = 423600, steady_state = true, h(start = 462620.0), rho(start = 895), Patm = 1670000, P(start = 1699000)) annotation( + ThermoSysPro.Fluid.Volumes.Tank Tank(p_rho = 895, A = 0.1, z0 = 1, h0 = 423600, steady_state = true, h(start = 462620.0), rho(start = 895), Patm = 1670000, P(start = 1699000), ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.Oil_TherminolVP1) annotation( Placement(transformation(origin = {-248, 142}, extent = {{6, 6}, {-6, -6}}, rotation = 180))); ThermoSysPro.Fluid.Volumes.VolumeA VolumeMP(V = 1, rho(start = 10), h0 = 2.4e6, h(start = 2868560.0), P0 = 1800000, dynamic_mass_balance = true, P(start = 1800000), Cs2(Q(start = 0.255955), h_vol_2(start = 2.87e6))) annotation( Placement(transformation(extent = {{84, 50}, {94, 62}}, rotation = 0))); ThermoSysPro.Fluid.Volumes.VolumeA VolumeCond(V = 1, rho(start = 10), h(start = 1837610.0), h0 = 2.1e6, P0 = 5000, dynamic_mass_balance = false, P(start = 5000)) annotation( Placement(transformation(extent = {{141, 24}, {130, 34}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(KPurge = 10, SPurge = 0.3, Se(h(fixed = true, start = 600e3)), SCondDes(fixed = false, start = 9.57697) = 3, HDesF(start = 583561.0), HeiF(start = 150619.0), Hep(start = 884611.0), SDes(start = 0.932441), h(start = 882589.0), lambdaE = 1, KCond = 500) annotation( + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(KPurge = 10, SPurge = 0.3, Se(h(fixed = true, start = 600e3)), SCondDes(fixed = false, start = 9.57697) = 3, HDesF(start = 583561.0), HeiF(start = 150619.0), Hep(start = 884611.0), SDes(start = 0.932441), h(start = 882589.0), lambdaE = 1, KCond = 500, region_eeF = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_seF = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(extent = {{42, -106}, {0, -56}}, rotation = 0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(rho(start = 10), h(start = 2400e3), Q(start = 0.1), K = 1e-4, Pm(start = 1800000)) annotation( Placement(transformation(origin = {31.5, -13.5}, extent = {{5.5, -5.5}, {-5.5, 5.5}}, rotation = 90))); @@ -236,4 +236,4 @@ It is documented in a conference paper and in Sect. 6.7 of the ThermoSysPro book The results reported in the ThermoSysPro book were computed using Dymola. "), Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})})); -end ConcentratedSolarPowerPlant_PTSC; +end ConcentratedSolarPowerPlant_PTSC; \ No newline at end of file From 7b4e9c32386941dedd98862d481ab771b27baa76 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 27 Jul 2026 09:50:43 +0200 Subject: [PATCH 199/213] #125 set ThermoSysPro package version to 5.0 --- ThermoSysPro/package.mo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ThermoSysPro/package.mo b/ThermoSysPro/package.mo index 4ed30a13..fee4a4a7 100644 --- a/ThermoSysPro/package.mo +++ b/ThermoSysPro/package.mo @@ -1,8 +1,8 @@ package ThermoSysPro extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; annotation(Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 5.0 "), - version = "4.2"); + version = "5.0"); end ThermoSysPro; From 769a3e7871e4f75410cf28bb8ff96c1d4e1f2c18 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 27 Jul 2026 10:01:10 +0200 Subject: [PATCH 200/213] #125 tests for Fluid Examples with omc --- .test/config_new_openmodelica.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.test/config_new_openmodelica.json b/.test/config_new_openmodelica.json index 8d09d9c9..f47cab1d 100644 --- a/.test/config_new_openmodelica.json +++ b/.test/config_new_openmodelica.json @@ -16,7 +16,7 @@ "libs": { "ThermoSysPro": { "path": "../../ThermoSysPro/package.mo", - "models_filter": "(? Date: Wed, 18 Nov 2026 15:20:45 +0100 Subject: [PATCH 201/213] relativeVolatility and equilibriumPartition instead of PhasesSeparationFunction --- .../TestSimpleDynamicCondenser.mo | 4 +- .../TestSimpleDynamicCondenser_Traces.mo | 5 +- .../Junctions/TestDryer_Traces.mo | 2 +- .../Junctions/TestStaticDrum_Plug_Traces.mo | 3 +- .../Junctions/TestStaticDrum_Traces.mo | 3 +- .../TestSteamExtractionSplitter_Traces.mo | 2 +- .../PhasesSeparation.mo | 18 ------ .../WaterSteam_FullyVolatileTrace/package.mo | 14 +++- .../package.order | 1 - .../PhasesSeparation.mo | 18 ------ .../WaterSteam_NonVolatileTrace/package.mo | 13 +++- .../WaterSteam_NonVolatileTrace/package.order | 1 - .../Volumes/TestDynamicDrum_Traces.mo | 1 - .../Volumes/TestPressurizer_Traces.mo | 1 - .../TestTwoPhaseCavityOnePipe_Traces.mo | 1 - .../Volumes/TestTwoPhaseCavity_Traces.mo | 1 - .../Volumes/TestTwoPhaseVolume_Traces.mo | 1 - .../HeatExchangers/SimpleDynamicCondenser.mo | 16 +++-- ThermoSysPro/Fluid/Junctions/StaticDrum.mo | 11 ++-- ThermoSysPro/Fluid/Junctions/SteamDryer.mo | 14 ++-- .../Junctions/SteamExtractionSplitter.mo | 12 ++-- ThermoSysPro/Fluid/Volumes/DynamicDrum.mo | 20 ++++-- ThermoSysPro/Fluid/Volumes/Pressurizer.mo | 20 ++++-- ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo | 18 ++++-- .../Fluid/Volumes/TwoPhaseCavityOnePipe.mo | 24 +++++-- ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo | 16 +++-- .../HomogeneousPhasesSeparation.mo | 18 ------ .../PartialSubCMedium/equilibriumPartition.mo | 30 +++++++++ .../Media/PartialSubCMedium/package.mo | 30 +++++++++ .../Media/PartialSubCMedium/package.order | 5 +- .../partialPhasesSeparation.mo | 64 ------------------- 31 files changed, 202 insertions(+), 185 deletions(-) delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order delete mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo delete mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo index 95d05b29..38586f75 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo @@ -47,7 +47,9 @@ model TestSimpleDynamicCondenser displayUnit="bar"), rhom(displayUnit="g/cm3", start=997.1903), xv(start=4.3733834E-09), - Vv(start=23.606508), + /* Steam and condensate flows are both imposed: the steady-state start + leaves the condenser mass undetermined, it is fixed by Vv. */ + Vv(start=23.606508, fixed=true), xl(start=-3.5873317E-08)) annotation (Placement(transformation(extent={{14,-46},{70,-6}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP source_retourCondensats( diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo index 97ebc8ef..7460966b 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo @@ -1,8 +1,5 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; model TestSimpleDynamicCondenser_Traces extends ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers.TestSimpleDynamicCondenser( - redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, - Condenseur(redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=Condenseur.xv) -) -) annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); + redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace) annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); end TestSimpleDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo index a78582a8..2a58e9b1 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo @@ -6,7 +6,7 @@ model TestDryer_Traces ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6, SubC0={1}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamDryer.xe)) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); equation connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo index 542d63ee..9b0035ae 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo @@ -4,8 +4,7 @@ model TestStaticDrum_Plug_Traces replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( - redeclare package Medium = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=StaticDrumTh1.x)) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo index 3d5d4c78..5ff72def 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo @@ -4,8 +4,7 @@ model TestStaticDrum_Traces replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( - redeclare package Medium = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=StaticDrumTh1.x)) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo index 83e5941e..9a92e0db 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo @@ -3,7 +3,7 @@ model TestSteamExtractionSplitter_Traces extends ThermoSysPro.UsersGuide.Icons.Example; replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; - ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9, redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=steamExtractionSplitter.xe)) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2600000) annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=0))); ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo deleted file mode 100644 index 988c4877..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/PhasesSeparation.mo +++ /dev/null @@ -1,18 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; -function PhasesSeparation - extends partialPhasesSeparation; - input Real x(min=0, max=1) "Title"; - -algorithm - // // HomogeneousSubstance - // C_record.Cl := SubC; - // C_record.Cg := SubC; - - // // Non-volatile - // C_record.Cl := SubC/(1 - x); - // C_record.Cg := fill(0, size(SubC, 1)); - -// Fully-volatile -C_record.Cl := fill(0,size(SubC,1)); -C_record.Cg := SubC / x; -end PhasesSeparation; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo index fabdb6d5..2c371330 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo @@ -1,5 +1,17 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; -package WaterSteam_FullyVolatileTrace +package WaterSteam_FullyVolatileTrace "Water/steam carrying one fully volatile trace" extends Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + redeclare function relativeVolatility "Fully volatile trace: it goes to the vapour phase" + extends partialRelativeVolatility; + algorithm + RV := fill(1e6, nSubC); + end relativeVolatility; + + annotation (Documentation(info=" +

    Water/steam with one trace that goes entirely to the vapour phase. The exact +limit, Cl = 0 and Cg = SubC/x, corresponds to an infinite +relative volatility; relativeVolatility = 1e6 reproduces it to better +than 0.1 % as soon as the vapour mass fraction exceeds 1e-3.

    +")); end WaterSteam_FullyVolatileTrace; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order deleted file mode 100644 index 11ebc226..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.order +++ /dev/null @@ -1 +0,0 @@ -PhasesSeparation diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo deleted file mode 100644 index b9c1251f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/PhasesSeparation.mo +++ /dev/null @@ -1,18 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; -function PhasesSeparation - extends partialPhasesSeparation; - input Real x(min=0, max=1) "Title"; - -algorithm - // // HomogeneousSubstance - // C_record.Cl := SubC; - // C_record.Cg := SubC; - - // Non-volatile - C_record.Cl := SubC/max(1 - x, Modelica.Constants.eps); - C_record.Cg := fill(0, size(SubC, 1)); - - // // Fully-volatile - // C_record.Cl := fill(0,size(SubC,1)); - // C_record.Cg := SubC / x; -end PhasesSeparation; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo index 09644f8a..bdbe4907 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo @@ -1,5 +1,16 @@ within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; -package WaterSteam_NonVolatileTrace +package WaterSteam_NonVolatileTrace "Water/steam carrying one non-volatile trace" extends Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + redeclare function relativeVolatility "Non-volatile trace: it stays in the liquid phase" + extends partialRelativeVolatility; + algorithm + RV := fill(0, nSubC); + end relativeVolatility; + + annotation (Documentation(info=" +

    Water/steam with one trace that does not evaporate: relativeVolatility = 0. +The vapour phase carries no trace at equilibrium, the liquid phase carries +SubC/(1 - x).

    +")); end WaterSteam_NonVolatileTrace; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order deleted file mode 100644 index 11ebc226..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.order +++ /dev/null @@ -1 +0,0 @@ -PhasesSeparation diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo index 2b29f22e..cfc3a9af 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestDynamicDrum_Traces.mo @@ -6,7 +6,6 @@ model TestDynamicDrum_Traces ThermoSysPro.Fluid.Volumes.DynamicDrum drum( redeclare package Medium = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=drum.xv), Vertical=false, steady_state=false, Vv(start=39), diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo index 7c770e2a..013b73d0 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestPressurizer_Traces.mo @@ -9,7 +9,6 @@ model TestPressurizer_Traces ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( redeclare package Medium = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation (x=1), Zm=10.15, Klv=0.5e6, cpp=600, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo index 7a5465cd..b45fa58d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo @@ -6,7 +6,6 @@ model TestTwoPhaseCavityOnePipe_Traces ThermoSysPro.Fluid.Volumes.TwoPhaseCavityOnePipe cavity( redeclare package Medium = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=cavity.xv), steady_state=false, P0=13000000, P(start=13000000, fixed=true), diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo index c526b9af..23e07a38 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo @@ -6,7 +6,6 @@ model TestTwoPhaseCavity_Traces ThermoSysPro.Fluid.Volumes.TwoPhaseCavity cavity( redeclare package Medium = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=cavity.xv), steady_state=false, P0=13000000, P(start=13000000, fixed=true), diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo index b3ab2755..58df232e 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo @@ -6,7 +6,6 @@ model TestTwoPhaseVolume_Traces ThermoSysPro.Fluid.Volumes.TwoPhaseVolume volume( redeclare package Medium = Medium, - redeclare function PhasesSeparationFunction = Medium.PhasesSeparation(x=volume.xv), steady_state=false, P0=13000000, P(start=13000000, fixed=true), diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo index a8b1e446..32c05624 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo @@ -5,7 +5,6 @@ model SimpleDynamicCondenser "Simple dynamic condenser" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; @@ -88,7 +87,8 @@ public "Right hand side of the trace balance equation of the liquid phase in the cavity"; Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation of the vapor phase in the cavity"; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_l "Trace partition of the liquid phase of the cavity"; + Medium.C_BiPhase C_v "Trace partition of the gas phase of the cavity"; Units.SI.Power BHl "Right hand side of the energy balance equation of the liquid phase in the cavity"; Units.SI.Power BHv @@ -262,12 +262,18 @@ equation X = Cv.Xi; /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); + /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to + every mass transfer between phases. Each transfer removes from one phase + exactly what it adds to the other: the balance is exact for any volatility. */ + if Medium.nC > 0 then + C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); + C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + end if; SubCSaS = SaS(); - BSubCl = Qcond*C_record.Cl - Qevap*SubCl - Cl.Q*Cl.SubC; - BSubCv = Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + BSubCl = Qcond*C_v.Cl - Qevap*C_l.Cg - Cl.Q*Cl.SubC; + BSubCv = Cv.Q*Cv.SubC + Qevap*C_l.Cg - Qcond*C_v.Cl; if dynamic_energy_balance then Vl*rhol*der(SubCl) + SubCl*BQl = BSubCl; diff --git a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo index 31df68ca..84af9fbd 100644 --- a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo +++ b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo @@ -2,7 +2,6 @@ within ThermoSysPro.Fluid.Junctions; model StaticDrum "Static drum" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Ce_steam.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real x=1 "Vapor separation efficiency at the outlet"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; @@ -24,7 +23,6 @@ public Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames) "Liquid phase trace substances"; Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames) "Vapor phase trace substances"; Medium.ExtraProperty SubCs_sur[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace substances at the steam/reheater outlet"; - Medium.C_BiPhase C_record; Units.SI.Power Je_steam "Thermal power diffusion from inlet e_steam"; Units.SI.Power Je_sup "Thermal power diffusion from inlet e_sup"; Units.SI.Power Je_eva "Thermal power diffusion from inlet e_eva"; @@ -177,11 +175,12 @@ equation X = Cs_sur.Xi; /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); + /* Overall trace balance of the drum, and phase equilibrium between its + liquid and gas phases (Medium.relativeVolatility) */ + fill(0, Medium.nC) = Ce_steam.Q*Ce_steam.SubC + Ce_sup.Q*Ce_sup.SubC + Ce_eva.Q*Ce_eva.SubC + Ce_eco.Q*Ce_eco.SubC + - Cs_eva.Q*Cs_eva.SubC - Cs_purg.Q*Cs_purg.SubC - Cs_sup.Q*Cs_sup.SubC - Cs_sur.Q*Cs_sur.SubC; - fill(0, Medium.nC) = (1 - Medium.vapourQuality(state_e_steam))*Ce_steam.Q*Ce_steam.SubC + (1 - Medium.vapourQuality(state_e_sup))*Ce_sup.Q*Ce_sup.SubC + (1 - Medium.vapourQuality(state_e_eva))*Ce_eva.Q*Ce_eva.SubC + (1 - Medium.vapourQuality(state_e_eco))*Ce_eco.Q*Ce_eco.SubC - Cs_eva.Q*Cs_eva.SubC - Cs_purg.Q*Cs_purg.SubC - Cs_sup.Q*Cs_sup.SubC + Medium.vapourQuality(state_e_steam)*Ce_steam.Q*C_record.Cl + Medium.vapourQuality(state_e_sup)*Ce_sup.Q*C_record.Cl + Medium.vapourQuality(state_e_eva)*Ce_eva.Q*C_record.Cl + Medium.vapourQuality(state_e_eco)*Ce_eco.Q*C_record.Cl - (1 - x)*Cs_sur.Q*SubCl; - - fill(0, Medium.nC) = Medium.vapourQuality(state_e_steam)*Ce_steam.Q*C_record.Cg + Medium.vapourQuality(state_e_sup)*Ce_sup.Q*C_record.Cg + Medium.vapourQuality(state_e_eva)*Ce_eva.Q*C_record.Cg + Medium.vapourQuality(state_e_eco)*Ce_eco.Q*C_record.Cg - x*Cs_sur.Q*SubCv; + SubCv = Medium.relativeVolatility(sat.Tsat) .* SubCl; SubCs_sur = (1 - x)*SubCl + x*SubCv; diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo index b2b921d9..35a9999b 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo @@ -7,7 +7,6 @@ model SteamDryer "Steam dryer" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); parameter Real eta=1 "Steam dryer efficiency (0 <= eta <= 1)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; @@ -19,7 +18,8 @@ protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_e "Trace partition of the inlet mixture"; + Real xsv "Vapor mass fraction at the vapor outlet"; public Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure"; @@ -73,8 +73,14 @@ equation Csl.Xi = X; /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); - Csv.SubC = C_record.Cg; + /* Equilibrium partition of the inlet traces (Medium.relativeVolatility). The vapor + outlet keeps the liquid not removed by the dryer (eta < 1): it carries the mixture + concentration at its own vapor mass fraction xsv. The liquid outlet follows from the balance. */ + if Medium.nC > 0 then + C_e = Medium.equilibriumPartition(Cev.SubC, xe, sat.Tsat); + end if; + xsv = noEvent(if (xe > 0) then xe/(1 - eta*(1 - xe)) else 0); + Csv.SubC = xsv*C_e.Cg + (1 - xsv)*C_e.Cl; Csv.Q*Csv.SubC + Csl.Q*Csl.SubC = Cev.Q*Cev.SubC + SubCSaS * Cev.Q; diff --git a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo index a9e62c3b..c6e6bdba 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo @@ -5,7 +5,6 @@ model SteamExtractionSplitter "Splitter for steam extraction" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter Real alpha = 1 @@ -20,7 +19,7 @@ protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_e "Trace partition of the inlet mixture"; public Real x_ex(start=0.99) "Vapor mass fraction at the extraction outlet"; @@ -61,8 +60,13 @@ equation Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*Medium.bubbleEnthalpy(sat)+ x_ex*Medium.dewEnthalpy(sat) else h; /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); - Cs.SubC = C_record.Cg; + /* Equilibrium partition of the inlet traces (Medium.relativeVolatility). The extraction + carries the mixture concentration at its vapor mass fraction x_ex = alpha*xe. + The main outlet follows from the balance. */ + if Medium.nC > 0 then + C_e = Medium.equilibriumPartition(Ce.SubC, xe, sat.Tsat); + end if; + Cex.SubC = x_ex*C_e.Cg + (1 - x_ex)*C_e.Cl; Cs.Q*Cs.SubC + Cex.Q*Cex.SubC = Ce.Q*Ce.SubC + SubCSaS * Ce.Q; diff --git a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo index e245f7dd..ab0dcb49 100644 --- a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo +++ b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo @@ -3,7 +3,6 @@ model DynamicDrum "Dynamic drum" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; @@ -52,7 +51,9 @@ protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Units.SI.Volume Vmin=1.e-6; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_m "Trace partition of the evaporation loop mixture (Cm)"; + Medium.C_BiPhase C_l "Trace partition of the liquid phase"; + Medium.C_BiPhase C_v "Trace partition of the gas phase"; public Units.SI.AbsolutePressure P "Fluid average pressure"; @@ -327,13 +328,20 @@ equation Wpa = Kpa*Ape*(Ta - Tp); /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); + /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to + every mass transfer between phases. Each transfer removes from one phase + exactly what it adds to the other: the balance is exact for any volatility. */ + if Medium.nC > 0 then + C_m = Medium.equilibriumPartition(Cm.SubC, xmv, sat.Tsat); + C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); + C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + end if; SubCSaS = SaS(); BSubCl = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC - - Cd.Q*Cd.SubC - Cs.Q*Cs.SubC + (1 - xmv)*Cm.Q*Cm.SubC - + Qcond*C_record.Cl - Qevap*SubCl; - BSubCv = xmv*Cm.Q*Cm.SubC - Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + - Cd.Q*Cd.SubC - Cs.Q*Cs.SubC + Cm.Q*Cm.SubC - xmv*Cm.Q*C_m.Cg + + Qcond*C_v.Cl - Qevap*C_l.Cg; + BSubCv = xmv*Cm.Q*C_m.Cg - Cv.Q*Cv.SubC + Qevap*C_l.Cg - Qcond*C_v.Cl; if dynamic_energy_balance then rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; diff --git a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo index 85af4bb6..8bd940a7 100644 --- a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo +++ b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo @@ -4,7 +4,6 @@ model Pressurizer "Pressurizer" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cs.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=61.1 "Pressurizer volume"; parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius"; @@ -47,7 +46,10 @@ protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; parameter Units.SI.Area Ap=pi*Rp*Rp "Pressurizer cross-sectional area"; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_l "Trace partition of the liquid phase"; + Medium.C_BiPhase C_v "Trace partition of the gas phase"; + Real xl "Vapor mass fraction in the liquid phase"; + Real xv "Vapor mass fraction in the gas phase"; public Units.SI.Area Slpin "Exchange surface between the liquid and the wall"; @@ -241,11 +243,19 @@ equation Wpa = Kpa*Ae*(Ta - Tp); /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); + /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to + every mass transfer between phases. Each transfer removes from one phase + exactly what it adds to the other: the balance is exact for any volatility. */ + xl = noEvent(max(0, min(1, (hl - hls)/(hvs - hls)))); + xv = noEvent(max(0, min(1, (hv - hls)/(hvs - hls)))); + if Medium.nC > 0 then + C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); + C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + end if; SubCSaS = SaS(); - BSubCl = Cas.Q*Cas.SubC - Cex.Q*Cex.SubC + Qcond*C_record.Cl - Qevap*SubCl; - BSubCv = Qevap*SubCl - Cs.Q*Cs.SubC - Qcond*C_record.Cg; + BSubCl = Cas.Q*Cas.SubC - Cex.Q*Cex.SubC + Qcond*C_v.Cl - Qevap*C_l.Cg; + BSubCv = Qevap*C_l.Cg - Cs.Q*Cs.SubC - Qcond*C_v.Cl; if dynamic_energy_balance then rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo index 3f42a259..8cad5c88 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo @@ -4,7 +4,6 @@ model TwoPhaseCavity "TwoPhaseCavity for one shell pass " extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; @@ -79,7 +78,9 @@ protected parameter Units.SI.Area S4=1 "Heat exchange surface"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_in "Trace partition of the water inlet mixture (Ce)"; + Medium.C_BiPhase C_l "Trace partition of the liquid phase"; + Medium.C_BiPhase C_v "Trace partition of the gas phase"; public Units.SI.Length L(start=15) "Cavity length"; @@ -432,11 +433,18 @@ equation W4t = noEvent(if (Cv.h > hvsat) then -Cv.Q*(Cv.h - hvsat) else -0.0001); /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); + /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to + every mass transfer between phases. Each transfer removes from one phase + exactly what it adds to the other: the balance is exact for any volatility. */ + if Medium.nC > 0 then + C_in = Medium.equilibriumPartition(Ce.SubC, Medium.vapourQuality(state_in_l), Tsat); + C_l = Medium.equilibriumPartition(SubCl, xl, Tsat); + C_v = Medium.equilibriumPartition(SubCv, xv, Tsat); + end if; SubCSaS = SaS(); - BSubCl = (1 - Medium.vapourQuality(state_in_l))*Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_record.Cl - Qevap*SubCl; - BSubCv = Cv.Q*Cv.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*Ce.SubC + Qevap*SubCl - Qcond*C_record.Cg; + BSubCl = Ce.Q*Ce.SubC - Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg - Cl.Q*Cl.SubC + Qcond*C_v.Cl - Qevap*C_l.Cg; + BSubCv = Cv.Q*Cv.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg + Qevap*C_l.Cg - Qcond*C_v.Cl; if dynamic_energy_balance then rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo index 7977c081..48c2eba9 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo @@ -4,7 +4,6 @@ model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass " extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = CvBP.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; @@ -54,7 +53,10 @@ protected constant Real pi=Modelica.Constants.pi; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_in "Trace partition of the water inlet mixture (Ce)"; + Medium.C_BiPhase C_bp "Trace partition of the steam inlet mixture CvBP"; + Medium.C_BiPhase C_gct "Trace partition of the steam inlet mixture CvGCT"; + Medium.C_BiPhase C_v "Trace partition of the gas phase"; public Units.SI.Pressure P(start=10000) "Fluid average pressure"; @@ -313,11 +315,23 @@ equation end if; /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); + /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to + every mass transfer between phases. Each transfer removes from one phase + exactly what it adds to the other: the balance is exact for any volatility. */ + if Medium.nC > 0 then + C_in = Medium.equilibriumPartition(Ce.SubC, Medium.vapourQuality(state_in_l), sat.Tsat); + C_bp = Medium.equilibriumPartition(CvBP.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); + C_gct = Medium.equilibriumPartition(CvGCT.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); + C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + end if; SubCSaS = SaS(); - BSubCl = (1 - Medium.vapourQuality(state_in_l))*Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + (Qcond + QcondS)*C_record.Cl; - BSubCv = CvBP.Q*CvBP.SubC + CvGCT.Q*CvGCT.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*Ce.SubC - (Qcond + QcondS)*C_record.Cg; + /* The liquid part QcondS of the incoming steam carries the liquid share of its traces */ + BSubCl = Ce.Q*Ce.SubC - Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg + + CvBP.Q*CvBP.SubC + CvGCT.Q*CvGCT.SubC - Medium.vapourQuality(state_in_v)*(CvBP.Q*C_bp.Cg + CvGCT.Q*C_gct.Cg) + - Cl.Q*Cl.SubC + Qcond*C_v.Cl; + BSubCv = Medium.vapourQuality(state_in_v)*(CvBP.Q*C_bp.Cg + CvGCT.Q*C_gct.Cg) + + Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg - Qcond*C_v.Cl; if dynamic_energy_balance then rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo index 9231e899..2975927b 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo @@ -4,7 +4,6 @@ model TwoPhaseVolume "TwoPhaseVolume" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable function PhasesSeparationFunction = Medium.HomogeneousPhasesSeparation(SubC = Cv.SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; @@ -41,7 +40,8 @@ protected constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant"; parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - Medium.C_BiPhase C_record; + Medium.C_BiPhase C_l "Trace partition of the liquid phase"; + Medium.C_BiPhase C_v "Trace partition of the gas phase"; public Units.SI.AbsolutePressure P "Fluid average pressure"; @@ -212,11 +212,17 @@ equation yLevel.signal = Vl/A; /* Traces composition balance equations */ - C_record = PhasesSeparationFunction(); + /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to + every mass transfer between phases. Each transfer removes from one phase + exactly what it adds to the other: the balance is exact for any volatility. */ + if Medium.nC > 0 then + C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); + C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + end if; SubCSaS = SaS(); - BSubCl = Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_record.Cl - Qevap*SubCl; - BSubCv = Cv.Q*Cv.SubC + Qevap*SubCl - Qcond*C_record.Cg; + BSubCl = Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_v.Cl - Qevap*C_l.Cg; + BSubCv = Cv.Q*Cv.SubC + Qevap*C_l.Cg - Qcond*C_v.Cl; if dynamic_energy_balance then rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo deleted file mode 100644 index 7aebdec9..00000000 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/HomogeneousPhasesSeparation.mo +++ /dev/null @@ -1,18 +0,0 @@ -within ThermoSysPro.Properties.Media.PartialSubCMedium; -function HomogeneousPhasesSeparation - extends partialPhasesSeparation; -// input Real x(min=0, max=1) "Title"; - -algorithm - // HomogeneousSubstance - C_record.Cl := SubC; - C_record.Cg := SubC; - -// // Non-volatile -// C_record.Cl := SubC / (1-x); -// C_record.Cg := fill(0,size(SubC,1)); - -// // Fully-volatile -// C_record.Cl := fill(0,size(SubC,1)); -// C_record.Cg := SubC / x; -end HomogeneousPhasesSeparation; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo new file mode 100644 index 00000000..8a6900de --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +function equilibriumPartition + "Liquid and vapour trace concentrations of a two-phase mixture at phase equilibrium" + extends Modelica.Icons.Function; + input Real SubC[nSubC] "Trace concentrations of the mixture"; + input Real x "Vapour mass fraction of the mixture"; + input ThermoSysPro.Units.SI.Temperature T "Saturation temperature"; + output C_BiPhase C_record "Liquid (Cl) and vapour (Cg) trace concentrations"; +protected + Real RV[nSubC] "Relative volatility"; + Real xc "Vapour mass fraction bounded to [0, 1]"; +algorithm + RV := relativeVolatility(T); + xc := min(max(x, 0), 1); + for k in 1:nSubC loop + C_record.Cl[k] := SubC[k]/max(1 - xc + xc*RV[k], 1e-12); + C_record.Cg[k] := RV[k]*C_record.Cl[k]; + end for; + annotation (Inline=true, Documentation(info=" +

    With RV = relativeVolatility(T), equilibrium Cg = RV*Cl +and conservation (1 - x)*Cl + x*Cg = SubC give

    +
      Cl = SubC/(1 - x + x*RV),   Cg = RV*Cl
    +

    This is the only phase-partition law of the library. Components apply it to every +mass transfer between phases, at the vapour mass fraction of the transferred stream. +To keep their balances exact whatever the volatility, components give one phase the +vapour (or liquid) part and the other phase the remainder.

    +

    The denominator is bounded below by 1e-12 to cover the limit of a +non-volatile trace (RV = 0) in dry steam (x = 1).

    +")); +end equilibriumPartition; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo index c689fdcb..93cecb91 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo @@ -3,4 +3,34 @@ partial package PartialSubCMedium constant Integer nSubC; constant Boolean isCompressible; + partial function partialRelativeVolatility + "Interface of relativeVolatility: media redeclare relativeVolatility by extending it" + extends Modelica.Icons.Function; + input ThermoSysPro.Units.SI.Temperature T "Saturation temperature"; + output Real RV[nSubC] "Relative volatility C_vapour/C_liquid (1: homogeneous, 0: non-volatile)"; + end partialRelativeVolatility; + + replaceable function relativeVolatility + "Relative volatility of the traces, ratio of the vapour to the liquid concentration at phase equilibrium" + extends partialRelativeVolatility; + algorithm + RV := fill(1, nSubC); + annotation (Documentation(info=" +

    Ratio RV = Cg/Cl of the trace concentration in the vapour phase to +the trace concentration in the liquid phase, when both phases are at equilibrium +at the saturation temperature T.

    +

    The default value RV = 1 is the homogeneous separation: both phases +carry the bulk concentration. A medium with traces that prefer one phase redeclares +this function, for instance RV = 0 for a non-volatile trace, or a +temperature-dependent law for a conditioning amine:

    +
      redeclare function relativeVolatility
    +    extends partialRelativeVolatility;
    +  algorithm
    +    RV := fill(0, nSubC);
    +  end relativeVolatility;
    +

    All two-phase Fluid components split traces between phases with +equilibriumPartition, which is built on this function.

    +")); + end relativeVolatility; + end PartialSubCMedium; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order index 62ead749..f7597a9c 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order @@ -1,7 +1,8 @@ nSubC isCompressible -partialPhasesSeparation -HomogeneousPhasesSeparation +partialRelativeVolatility +relativeVolatility +equilibriumPartition C_BiPhase partialSaS noSaS diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo deleted file mode 100644 index 4f208f63..00000000 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPhasesSeparation.mo +++ /dev/null @@ -1,64 +0,0 @@ -within ThermoSysPro.Properties.Media.PartialSubCMedium; -partial function partialPhasesSeparation - input Real SubC[:] "Total Species Concentrations"; - output C_BiPhase C_record; - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Ellipse( - extent={{-60,60},{60,-60}}, - lineColor={0,0,255}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Polygon( - points={{60,0},{58,14},{54,26},{48,36},{38,46},{26,54},{14,58},{0,60}, - {0,0},{60,0}}, - fillColor={170,255,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Polygon( - points={{-60,0},{-58,14},{-54,26},{-48,36},{-38,46},{-26,54},{-14,58}, - {0,60},{0,0},{-60,0}}, - fillColor={170,255,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Ellipse( - extent={{-42,28},{-26,12}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-18,48},{-6,36}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-4,24},{16,4}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{26,34},{42,18}}, - lineColor={28,108,200}, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{24,-12},{40,-28}}, - lineColor={28,108,200}, - fillColor={85,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-40,-22},{-24,-38}}, - lineColor={28,108,200}, - fillColor={85,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{10,-36},{22,-48}}, - lineColor={28,108,200}, - fillColor={85,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-20,-4},{2,-26}}, - lineColor={28,108,200}, - fillColor={85,255,255}, - fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem( - preserveAspectRatio=false))); -end partialPhasesSeparation; From 8ae6835392d8f5fb3577b19732adbdfe7e8a2bf6 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Wed, 18 Nov 2026 14:17:44 +0100 Subject: [PATCH 202/213] The Medium port of DynamicTwoPhaseFlowPipe evaluated viscosity and thermal conductivity (mul1, muv1, kl1, kv1, mul2, muv2, kl2, kv2) at bubble/dew states unconditionally. WaterSteam and Fluid 4.2 evaluate them at the actual node state, which differs strongly in superheated steam and subcooled water (hi about 25 % too high in the CombinedCycle HP superheaters). Use the node state in single phase and saturation states only in two-phase flow, as already done for cpl1/cpv1. --- .../HeatExchangers/DynamicTwoPhaseFlowPipe.mo | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo index 1d39b2fa..fc2f5e86 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo @@ -413,11 +413,13 @@ equation lv[i] = Medium.dewEnthalpy(sat1[i]) - Medium.bubbleEnthalpy(sat1[i]); end if; - mul1[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat1[i])); - muv1[i] = Medium.dynamicViscosity(Medium.setDewState(sat1[i])); + /* Transport properties at the actual node state in single phase (as in WaterSteam and ThermoSysPro 4.2), + at saturation only in two-phase flow */ + mul1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.dynamicViscosity(state1[i]) else Medium.dynamicViscosity(Medium.setBubbleState(sat1[i])); + muv1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.dynamicViscosity(state1[i]) else Medium.dynamicViscosity(Medium.setDewState(sat1[i])); - kl1[i] = Medium.thermalConductivity(Medium.setBubbleState(sat1[i])); - kv1[i] = Medium.thermalConductivity(Medium.setDewState(sat1[i])); + kl1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.thermalConductivity(state1[i]) else Medium.thermalConductivity(Medium.setBubbleState(sat1[i])); + kv1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.thermalConductivity(state1[i]) else Medium.thermalConductivity(Medium.setDewState(sat1[i])); Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple); end for; @@ -492,11 +494,13 @@ equation cpv2[i] = if noEvent(xv2[i] >= 1.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat2[i])); end if; - mul2[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat2[i])); - muv2[i] = Medium.dynamicViscosity(Medium.setDewState(sat2[i])); + /* Transport properties at the actual node state in single phase (as in WaterSteam and ThermoSysPro 4.2), + at saturation only in two-phase flow */ + mul2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.dynamicViscosity(state2[i]) else Medium.dynamicViscosity(Medium.setBubbleState(sat2[i])); + muv2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.dynamicViscosity(state2[i]) else Medium.dynamicViscosity(Medium.setDewState(sat2[i])); - kl2[i] = Medium.thermalConductivity(Medium.setBubbleState(sat2[i])); - kv2[i] = Medium.thermalConductivity(Medium.setDewState(sat2[i])); + kl2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.thermalConductivity(state2[i]) else Medium.thermalConductivity(Medium.setBubbleState(sat2[i])); + kv2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.thermalConductivity(state2[i]) else Medium.thermalConductivity(Medium.setDewState(sat2[i])); end for; /* Fluid densities at the boundaries of the nodes */ From 744a3234d131eb8de130e29e1dd4ed670c9068d4 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 19 Nov 2026 08:21:42 +0100 Subject: [PATCH 203/213] The energy balance of the combustion components subtracts the reference enthalpies Hrair = 2501.569e3*XeaH2O and Hrfg (Hrfum) = 2501.569e3*XsfH2O. These values are the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h (mixture enthalpy at 0.01 degC plus Xh2o*Hlat), which Fluid 4.2 used for Hea and Hsf. The #125 port computes Hea and Hsf with Medium_FlueGases.specificEnthalpy_pTX, whose offset with respect to FlueGases_h depends on the composition (about +2.46 MJ/kg for humid air, +2.34 MJ/kg for flue gases). The balance therefore created energy: +50 K at the GTCombustionChamber outlet, +100 K flame temperature in FossilFuelBoiler. Take the reference as the Medium_FlueGases enthalpy of the same mixture at 273.16 K, which is equivalent to the FlueGases_h convention. Components: GTCombustionChamber, GenericCombustion, GenericCombustion1D, FossilFuelBoiler. InternalCombustionEngine still computes Hea/Hsf with FlueGases_h and is left for a separate port. --- ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo | 6 ++++-- .../Combustion/CombustionChambers/GTCombustionChamber.mo | 6 ++++-- .../Combustion/CombustionChambers/GenericCombustion.mo | 6 ++++-- .../Combustion/CombustionChambers/GenericCombustion1D.mo | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo index 90d9290e..2899579c 100644 --- a/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo +++ b/ThermoSysPro/Fluid/Boilers/FossilFuelBoiler.mo @@ -311,9 +311,11 @@ equation 0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps); /* Reference specific enthalpies */ - Hrair = 2501.569e3*XeaH2O; + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); Hrcomb = 0; - Hrfum = 2501.569e3*XsfH2O; + Hrfum = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); /* Water/steam thermodynamic properties */ state_ws_m = Medium.setState_phX(p=(Pee + Pse)/2, h=(Hee + Hse)/2, X=Xws); diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo index a2123400..c4396b66 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo @@ -244,10 +244,12 @@ equation end if; /* Reference specific enthalpies */ - Hrair = 2501.569e3*XeaH2O; + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); Hrfuel = 0; Hrws = 2501.569e3; - Hrfg = 2501.569e3*XsfH2O; + Hrfg = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); /* Air specific enthalpy at the inlet */ Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo index 4b51fa9a..3a3bab63 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo @@ -220,10 +220,12 @@ equation Cfg.diff_on_1 = diffusion; /* Reference specific enthalpies */ - Hrair = 2501.569e3*XeaH2O; + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); Hrfuel = 0; Hrws = 2501.569e3; - Hrfg = 2501.569e3*XsfH2O; + Hrfg = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); Hrcd = 0; /* Air specific enthalpy at the inlet */ diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo index e909e4b6..a0bf3025 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo @@ -235,10 +235,12 @@ equation Cfg.diff_on_1 = diffusion; /* Reference specific enthalpies */ - Hrair = 2501.569e3*XeaH2O; + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); Hrfuel = 0; Hrws = 2501.569e3; - Hrfg = 2501.569e3*XsfH2O; + Hrfg = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); Hrcd = 0; /* Air specific enthalpy at the inlet */ From c3494ee462297e8ef7bfdba2a915e90a6f3402c4 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 19 Nov 2026 09:38:44 +0100 Subject: [PATCH 204/213] Port InternalCombustionEngine to Medium flue gases and fix TestGenericCombustion - InternalCombustionEngine: compute air/flue gases enthalpy, cp and density with Medium_FlueGases instead of FlueGases_h/_cp/_rho, and take the reference enthalpies at 273.16 K as in the other combustion components. - Book TestGenericCombustion1D: restore the 4.2 formulation (water sink with imposed flow rate and computed pressure, dynamic pipe). --- .../TestGenericCombustion1D.mo | 6 ++--- .../Machines/InternalCombustionEngine.mo | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo index 776e25dc..ba5e270f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo @@ -43,8 +43,6 @@ model TestGenericCombustion1D "TestGenericCombustion1D" ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe PipeWaterSteam( redeclare package Medium = Medium, Ns=7, - inertia=false, - dynamic_energy_balance=false, z2=56, rugosrel=5e-5, ntubes=403, @@ -64,9 +62,9 @@ model TestGenericCombustion1D "TestGenericCombustion1D" ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam2( redeclare package Medium = Medium, option_temperature=false, - Q(start=486.69), + Q(start=486.69, fixed=true), h0=2.5e+06, - P0=19621600) annotation( + P0(fixed=false) = 19621600) annotation( Placement(transformation(origin = {90, 90.5}, extent = {{14.5, -15}, {-14.5, 15}}, rotation = 270))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceEcrans( redeclare package Medium = Medium, diff --git a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo index b2a953da..bddec6ab 100644 --- a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo +++ b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo @@ -124,6 +124,8 @@ public Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; @@ -272,13 +274,15 @@ equation Cfg.diff_on_1 = diffusion; /* Air thermodynamic properties at the inlet */ - Hea = ThermoSysPro.Properties.FlueGases.FlueGases_h(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); - Cpair = ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); - rhoea = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Pea, Tea, XeaCO2, XeaH2O, XeaO2, XeaSO2); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); + Hea = Medium_FlueGases.specificEnthalpy(state_air_in); + Cpair = Medium_FlueGases.specificHeatCapacityCp(state_air_in); + rhoea = Medium_FlueGases.density(state_air_in); /* Flue gases thermodynamic properties at the outlet */ - Hsf = ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); - rhosf = ThermoSysPro.Properties.FlueGases.FlueGases_rho(Psf, Tsf, XsfCO2, XsfH2O, XsfO2, XsfSO2); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); + Hsf = Medium_FlueGases.specificEnthalpy(state_fg_out); + rhosf = Medium_FlueGases.density(state_fg_out); // -------------------- // BEAU DE ROCHAS CYCLE @@ -295,7 +299,7 @@ equation MMfumees = (1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2)*28 + XsfCO2*44 + XsfH2O*18 + XsfO2*32 + XsfSO2*64; Pfcb = Pfcp*Tfcb/Tfcp*MMairgaz/MMfumees; //Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp; - Tfcb = Wcomb/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/Qsf + Tfcp; + Tfcb = Wcomb/Medium_FlueGases.specificHeatCapacityCp(Medium_FlueGases.setState_pTX(p=Pfcp, T=(Tfcp + Tfcb)/2, X=Xsf))/Qsf + Tfcp; /* (4) Polytropic expansion */ Tfd = Tfcb *(1/RV)^(Kd - 1); @@ -313,7 +317,7 @@ equation Rmeca = Coef_Rm_a * Wcomb/1000*Wcomb/1000 + Coef_Rm_b*Wcomb/1000 + Coef_Rm_c; else Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair)) - -(Qsf*(ThermoSysPro.Properties.FlueGases.FlueGases_h(Psf, Tfe, XsfCO2, XsfH2O, XsfO2, XsfSO2) + -(Qsf*(Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tfe, X=Xsf) -Hrfum) + Wpth_ref))/Wcomb; end if; @@ -331,9 +335,11 @@ equation Wact = Welec*Cosphi; /* Reference specific enthalpies */ - Hrair = 2501.569e3*XeaH2O; + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); Hrcomb = 0; - Hrfum = 2501.569e3*XsfH2O; + Hrfum = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); annotation (Diagram(graphics={ Rectangle( From c55e1b7744c62ff459dd33bf06be9ef33ab0a5de Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 17 Sep 2026 17:49:30 +0200 Subject: [PATCH 205/213] #125 PTSC example --- .../ConcentratedSolarPowerPlant_PTSC.mo | 76 ++++++++++--------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo index 4df33c48..83cd1cb5 100644 --- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo +++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo @@ -1,6 +1,8 @@ within ThermoSysPro.Fluid.Examples.Book.PowerPlants; model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plant with PTSC" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam "Water/steam medium"; + replaceable package Medium_Oil = ThermoSysPro.Properties.Media.Oil_TherminolVP1 "Heat transfer fluid of the solar field"; parameter Real L1 = 500 "Longueur de la première chaine de capteurs"; parameter Integer Ns1 = 20 "Nombre de mailles de la première chaine de capteurs"; parameter Real L2 = 80 "Longueur de la deuxième chaine de capteurs"; @@ -10,11 +12,11 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan //parameter Real L4 = 7.9254 "Longueur de la première chaine de capteurs"; parameter Real L4 = 20 "Longueur de la première chaine de capteurs"; parameter Integer Ns4 = 3 "Nombre de mailles de la première échangeur"; - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_2(option_temperature = false, L = L2, Ns = Ns2, T0 = {659.137, 684.387, 693.983, 697.543, 698.861}, h0 = fill(650e3, Ns2), D = 0.04, hcCorr = 2, ntubes = 3, inertia = false, advection = false, P(start = {100000.0, 8120050.0, 8098500.0, 8074750.0, 8050150.0, 8025170.0, 8000000.0}), h(start = {2756570.0, 3040300.0, 3147840.0, 3187560.0, 3202330.0, 3208020.0, 3208020.0}), mu2(start = {1.94524E-005, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002}), rho2(start = {43.2944, 998.0, 998.0, 998.0, 998.0, 998.0})) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_2(redeclare package Medium = Medium, option_temperature = false, L = L2, Ns = Ns2, T0 = {659.137, 684.387, 693.983, 697.543, 698.861}, h0 = fill(650e3, Ns2), D = 0.04, hcCorr = 2, ntubes = 3, inertia = false, advection = false, P(start = {100000.0, 8120050.0, 8098500.0, 8074750.0, 8050150.0, 8025170.0, 8000000.0}), h(start = {2756570.0, 3040300.0, 3147840.0, 3187560.0, 3202330.0, 3208020.0, 3208020.0}), mu2(start = {1.94524E-005, 0.0002, 0.0002, 0.0002, 0.0002, 0.0002}), rho2(start = {43.2944, 998.0, 998.0, 998.0, 998.0, 998.0})) annotation( Placement(transformation(extent = {{-31, 34}, {25, 78}}, rotation = 0))); Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi2(cpw = 1000, steady_state = true, lambda = 26, L = L2, Ns = Ns2, D = 0.04, ntubes = 3, e = 0.003, Tp2(start = {699.6, 697.841, 694.783, 686.553, 664.851}), Tp(start = {662.094, 685.508, 694.397, 697.697, 698.921})) annotation( Placement(transformation(extent = {{-34, 54}, {26, 102}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_3(K = 1e-6, p_rho = 900, C1(h_vol_2(start = 462620.0)), C2(h_vol_1(start = 462620.0))) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_3(redeclare package Medium = Medium_Oil, K = 1e-6, p_rho = 900, C1(h_vol_2(start = 462620.0)), C2(h_vol_1(start = 462620.0))) annotation( Placement(transformation(origin = {-134, 138.5}, extent = {{6, -9.5}, {-6, 9.5}}, rotation = 180))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Tatm(Table = [0, 300; 1, 300]) annotation( Placement(transformation(extent = {{-322, 186}, {-306, 202}}, rotation = 0))); @@ -24,87 +26,87 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(extent = {{-105, 134}, {-45, 182}}, rotation = 0))); ThermoSysPro.Solar.Collectors.SolarCollector SolarCollector1(EpsGlass = 0.86, Gamma = 0.83, h = 3.06, AlphaGlass = 0.0302, RimAngle = 70, TauN = 0.95, AlphaN = 0.96, EpsTube = 0.14, R = 0.93, Lambda = 2.891407518e-2, f = 1.78518, AReflector(fixed = false, start = 2750), DGlass = 0.115, L = L3, Ns = Ns3, DTube = 0.07, e = 1.e-3, Tglass(start = {364.716, 365.398, 366.082, 366.767, 367.453, 368.14, 368.829, 369.519, 370.209, 370.901, 371.594, 372.288, 372.982, 373.678, 374.374, 375.071, 375.768, 376.466, 377.165, 377.864, 378.564, 379.264, 379.964, 380.665, 381.366, 382.067, 382.769, 383.47, 384.172, 384.873, 385.575, 386.276, 386.978, 387.679, 388.38, 389.081, 389.782, 390.482, 391.182, 391.882, 392.581, 393.28, 393.979, 394.677, 395.375, 396.072, 396.769, 397.465, 398.161, 398.856, 399.551, 400.245, 400.939, 401.632, 402.324, 403.017, 403.708, 404.399, 405.09, 405.78, 406.47, 407.16, 407.849, 408.538, 409.226, 409.915, 410.603, 411.29, 411.978, 412.665, 413.352, 414.039, 414.726, 415.413, 416.099, 416.786, 417.472, 418.158, 418.843, 419.528})) annotation( Placement(transformation(extent = {{-108, 166}, {-43, 200}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_3(P(each start = 2.3e6), option_temperature = false, L = L3, Ns = Ns3, T0 = {539.521, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0}, h0 = fill(800e3, Ns3), advection = false, dpfCorr = 0.4, hcCorr = 2, D = 0.06, h(start = {463696.125, 468056.0, 473485.0, 478907.0, 484321.0, 489728.0, 495127.0, 500518.0, 505902.0, 511278.0, 516646.0, 522007.0, 527360.0, 532705.0, 538041.0, 543370.0, 548691.0, 554004.0, 559309.0, 564606.0, 569895.0, 575175.0, 580447.0, 585711.0, 590967.0, 596214.0, 601453.0, 606683.0, 611905.0, 617118.0, 622323.0, 627519.0, 632707.0, 637886.0, 643056.0, 648217.0, 653370.0, 658514.0, 663649.0, 668775.0, 673893.0, 679001.0, 684100.0, 689191.0, 694272.0, 699345.0, 704408.0, 709462.0, 714507.0, 719542.0, 724569.0, 729586.0, 734594.0, 739593.0, 744582.0, 749562.0, 754532.0, 759493.0, 764445.0, 769387.0, 774320.0, 779242.0, 784156.0, 789059.0, 793953.0, 798837.0, 803712.0, 808577.0, 813431.0, 818276.0, 823111.0, 827936.0, 832752.0, 837557.0, 842352.0, 847137.0, 851911.0, 856676.0, 861430.0, 866175.0, 870908.0, 870908.0})) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_3(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, P(each start = 2.3e6), option_temperature = false, L = L3, Ns = Ns3, T0 = {539.521, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0, 700.0}, h0 = fill(800e3, Ns3), advection = false, dpfCorr = 0.4, hcCorr = 2, D = 0.06, h(start = {463696.125, 468056.0, 473485.0, 478907.0, 484321.0, 489728.0, 495127.0, 500518.0, 505902.0, 511278.0, 516646.0, 522007.0, 527360.0, 532705.0, 538041.0, 543370.0, 548691.0, 554004.0, 559309.0, 564606.0, 569895.0, 575175.0, 580447.0, 585711.0, 590967.0, 596214.0, 601453.0, 606683.0, 611905.0, 617118.0, 622323.0, 627519.0, 632707.0, 637886.0, 643056.0, 648217.0, 653370.0, 658514.0, 663649.0, 668775.0, 673893.0, 679001.0, 684100.0, 689191.0, 694272.0, 699345.0, 704408.0, 709462.0, 714507.0, 719542.0, 724569.0, 729586.0, 734594.0, 739593.0, 744582.0, 749562.0, 754532.0, 759493.0, 764445.0, 769387.0, 774320.0, 779242.0, 784156.0, 789059.0, 793953.0, 798837.0, 803712.0, 808577.0, 813431.0, 818276.0, 823111.0, 827936.0, 832752.0, 837557.0, 842352.0, 847137.0, 851911.0, 856676.0, 861430.0, 866175.0, 870908.0, 870908.0})) annotation( Placement(transformation(extent = {{-103, 117}, {-47, 161}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_4(K = 1e-6, p_rho = 650, C2(h_vol_1(start = 870908.0))) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_4(redeclare package Medium = Medium_Oil, K = 1e-6, p_rho = 650, C2(h_vol_1(start = 870908.0))) annotation( Placement(transformation(origin = {-5, 139}, extent = {{6, -10}, {-6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_22(P(each start = 2.3e6), option_temperature = false, Ns = Ns2, T0 = {698.976, 700.0, 700.0, 700.0, 700.0}, h0 = fill(800e3, Ns2), L = L2, D = 0.04, advection = false, hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {871999.6875, 870017.0, 867699.0, 861464.0, 844586.0, 800057.0, 800057.0})) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_22(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, P(each start = 2.3e6), option_temperature = false, Ns = Ns2, T0 = {698.976, 700.0, 700.0, 700.0, 700.0}, h0 = fill(800e3, Ns2), L = L2, D = 0.04, advection = false, hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {871999.6875, 870017.0, 867699.0, 861464.0, 844586.0, 800057.0, 800057.0})) annotation( Placement(transformation(extent = {{24, 122}, {-33, 78}}, rotation = 0))); Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi1(cpw = 1000, steady_state = true, lambda = 26, L = L1, Ns = Ns1, D = 0.04, ntubes = 3, e = 0.003, Tp1(start = {532.912, 533.493, 534.161, 534.93, 535.816, 536.836, 538.01, 539.364, 540.926, 542.728, 544.809, 547.216, 550.002, 553.232, 556.986, 561.36, 566.473, 572.131, 573.043, 574.577}), Tp2(start = {589.9, 577.664, 573.793, 567.743, 562.426, 557.888, 553.999, 550.657, 547.777, 545.292, 543.143, 541.284, 539.674, 538.278, 537.068, 536.017, 535.105, 534.312, 533.624, 533.026}), Tp(start = {532.971, 533.561, 534.239, 535.021, 535.92, 536.956, 538.149, 539.525, 541.111, 542.943, 545.059, 547.506, 550.341, 553.629, 557.453, 561.912, 567.13, 572.991, 575.434, 581.427})) annotation( Placement(transformation(extent = {{-174, 54}, {-114, 102}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_1(option_temperature = false, L = L1, Ns = Ns1, T0 = fill(300, Ns1), h0 = fill(650e3, Ns1), D = 0.04, ntubes = 3, inertia = false, advection = false, P(start = {8716030.0, 8695070.0, 8674080.0, 8653070.0, 8632030.0, 8610950.0, 8589840.0, 8568690.0, 8547480.0, 8526210.0, 8504870.0, 8483450.0, 8461930.0, 8440290.0, 8418510.0, 8396570.0, 8374420.0, 8352020.0, 8329300.0, 8305110.0, 8256160.0, 8135653.0}), h(start = {1130270.0, 1132680.0, 1135470.0, 1138670.0, 1142370.0, 1146630.0, 1151550.0, 1157240.0, 1163810.0, 1171420.0, 1180240.0, 1190480.0, 1202400.0, 1216300.0, 1232580.0, 1251720.0, 1274350.0, 1301310.0, 1336580.0, 1434650.0, 1715580.0, 2756578.25})) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_1(redeclare package Medium = Medium, option_temperature = false, L = L1, Ns = Ns1, T0 = fill(300, Ns1), h0 = fill(650e3, Ns1), D = 0.04, ntubes = 3, inertia = false, advection = false, P(start = {8716030.0, 8695070.0, 8674080.0, 8653070.0, 8632030.0, 8610950.0, 8589840.0, 8568690.0, 8547480.0, 8526210.0, 8504870.0, 8483450.0, 8461930.0, 8440290.0, 8418510.0, 8396570.0, 8374420.0, 8352020.0, 8329300.0, 8305110.0, 8256160.0, 8135653.0}), h(start = {1130270.0, 1132680.0, 1135470.0, 1138670.0, 1142370.0, 1146630.0, 1151550.0, 1157240.0, 1163810.0, 1171420.0, 1180240.0, 1190480.0, 1202400.0, 1216300.0, 1232580.0, 1251720.0, 1274350.0, 1301310.0, 1336580.0, 1434650.0, 1715580.0, 2756578.25})) annotation( Placement(transformation(extent = {{-171, 34}, {-115, 78}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_11(P(each start = 2.2e6), option_temperature = false, L = L1, Ns = Ns1, T0 = {587.815, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0}, h0 = fill(650e3, Ns1), D = 0.04, advection = false, hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {801122.25, 638880.0, 582613.0, 562383.0, 546913.0, 533929.0, 522949.0, 513609.0, 505631.0, 498794.0, 492917.0, 487857.0, 483492.0, 479721.0, 476460.0, 473637.0, 471191.0, 469070.0, 467231.0, 465634.0, 464248.0, 464248.0})) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_11(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, P(each start = 2.2e6), option_temperature = false, L = L1, Ns = Ns1, T0 = {587.815, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0, 550.0}, h0 = fill(650e3, Ns1), D = 0.04, advection = false, hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {801122.25, 638880.0, 582613.0, 562383.0, 546913.0, 533929.0, 522949.0, 513609.0, 505631.0, 498794.0, 492917.0, 487857.0, 483492.0, 479721.0, 476460.0, 473637.0, 471191.0, 469070.0, 467231.0, 465634.0, 464248.0, 464248.0})) annotation( Placement(transformation(extent = {{-116, 122}, {-173, 78}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(proe(x(start = 0.273553))) annotation( + ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(redeclare package Medium = Medium, xe(start = 0.273553)) annotation( Placement(transformation(extent = {{-86, 39}, {-62, 63}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(A = 5, Kvl = 100, e = 0.0005, L = 3.5, Vf0 = 0.15, ntubes = 300, steady_state = false, V = 30, P0 = 5000, Cv(Q(start = 1.13)), Pfond(start = 5000.53), proe(d(start = 995.533))) annotation( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, A = 5, Kvl = 100, e = 0.0005, L = 3.5, Vf0 = 0.15, ntubes = 300, steady_state = false, V = 30, P0 = 5000, Cv(Q(start = 1.13)), Pfond(start = 5000.53), rhom(start = 995.533)) annotation( Placement(transformation(extent = {{116, -51}, {156, -11}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, option_temperature = false) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(redeclare package Medium = Medium, P0 = 1e5, option_temperature = false) annotation( Placement(transformation(extent = {{178, -48}, {206, -22}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(K = 1e-6, C2(h_vol_1(start = 137765.0)), Pm(start = 5000.53), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(redeclare package Medium = Medium, K = 1e-6, C2(h_vol_1(start = 137765.0)), Pm(start = 5000.53)) annotation( Placement(transformation(origin = {117, -82.5}, extent = {{-6, -9.5}, {6, 9.5}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss Connection_HQ_Secheur_Ballon(Q(start = 1)) annotation( + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss Connection_HQ_Secheur_Ballon(redeclare package Medium = Medium, Q(start = 1)) annotation( Placement(transformation(origin = {-73, -15}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(Pm(fixed = false, start = 3502560.0), a1(fixed = false) = -4.9345734425e8, hn(start = 716.167), a3 = 2000, b1 = -3500, b2 = 510, Q(fixed = true, start = 1.13), C2(h_vol_1(start = 150161.0)), Qv(start = 0.00113454), h(start = 143963.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(redeclare package Medium = Medium, Pm(fixed = false, start = 3502560.0), a1(fixed = false) = -4.9345734425e8, hn(start = 716.167), a3 = 2000, b1 = -3500, b2 = 510, Q(fixed = true, start = 1.13), C2(h_vol_1(start = 150161.0)), Qv(start = 0.00113454), h(start = 143963.0)) annotation( Placement(transformation(extent = {{84, -91}, {64, -71}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC Ballon(V = 1, h0 = 3e5, h(start = 1125640.0), P0 = 7000000, dynamic_mass_balance = true, P(start = 7000000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC Ballon(redeclare package Medium = Medium, V = 1, h0 = 3e5, h(start = 1125640.0), P0 = 7000000, dynamic_mass_balance = true, P(start = 7000000)) annotation( Placement(transformation(extent = {{-63, -91}, {-83, -71}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(redeclare package Medium = Medium, Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(origin = {-30, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(redeclare package Medium = Medium, Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( Placement(transformation(origin = {-212, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(option_temperature = false, h0 = 63.03e3, P0(fixed = false) = 500000, Q(fixed = true, start = 14.9263)) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(redeclare package Medium = Medium, option_temperature = false, h0 = 63.03e3, P0(fixed = false) = 500000, Q(fixed = true, start = 14.9263)) annotation( Placement(transformation(extent = {{66, -49}, {94, -22}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(K = 1e-6) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(redeclare package Medium = Medium, K = 1e-6) annotation( Placement(transformation(origin = {171, -35}, extent = {{6, -10}, {-6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(K = 1e-6, rho(start = 999.099)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(redeclare package Medium = Medium, K = 1e-6, rho(start = 999.099)) annotation( Placement(transformation(origin = {101, -36}, extent = {{6, -10}, {-6, 10}}, rotation = 180))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv(k = 0.5) annotation( Placement(transformation(extent = {{-48, -62}, {-38, -52}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Ouv1(k = 0.5) annotation( Placement(transformation(extent = {{-231, -62}, {-221, -52}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(Pm(fixed = false), hn(start = 466.292), a3 = 2000, b2 = 510, b1 = -3500, a1(fixed = false) = -9.5e8, Q(fixed = false, start = 0.65), C2(P(fixed = false, start = 75e5)), C1(P(fixed = true, start = 70e5), h_vol_2(start = 1125640.0)), Qv(start = 0.00521975), h(start = 1126540.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(redeclare package Medium = Medium, Pm(fixed = false), hn(start = 466.292), a3 = 2000, b2 = 510, b1 = -3500, a1(fixed = false) = -9.5e8, Q(fixed = false, start = 0.65), C2(P(fixed = false, start = 75e5)), C1(P(fixed = true, start = 70e5), h_vol_2(start = 1125640.0)), Qv(start = 0.00521975), h(start = 1126540.0)) annotation( Placement(transformation(extent = {{-158, -91}, {-178, -71}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(K = 1e-6, region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(redeclare package Medium = Medium, K = 1e-6) annotation( Placement(transformation(origin = {-120, -81}, extent = {{-6, -10}, {6, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(W_fric = 1, Cst(fixed = false, start = 6.8e10) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.92, Pe(fixed = true, start = 8000000), Ps(fixed = false, start = 1800000), pros(d(start = 8.36949))) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(redeclare package Medium = Medium, W_fric = 1, Cst(fixed = false, start = 6.8e10) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 8.36949), eta_is_nom = 0.92, Pe(fixed = true, start = 8000000), Ps(fixed = false, start = 1800000)) annotation( Placement(transformation(extent = {{47, 72}, {73, 40}}, rotation = 0))); ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur annotation( Placement(transformation(extent = {{168, 90}, {198, 130}}, rotation = 0))); Thermal.HeatTransfer.HeatExchangerWallCounterFlow Paroi4(cpw = 1000, steady_state = true, lambda = 26, D = 0.04, L = L4, Ns = Ns4, ntubes = 3, e = 0.003, Tp1(start = {532.06, 532.262, 532.478}), Tp2(start = {533.3, 532.429, 532.217}), Tp(start = {532.141, 532.349, 532.57})) annotation( Placement(transformation(origin = {-269, -12}, extent = {{-24, -30}, {24, 30}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(option_temperature = false, D = 0.04, L = L4, Ns = Ns4, T0 = fill(300, Ns4), h0 = fill(650e3, Ns4), ntubes = 3, inertia = false, advection = false, P(start = {8751668.0, 8729230.0, 8724830.0, 8720430.0, 8733863.0}), h(start = {1128519.5, 1128310.0, 1129260.0, 1130270.0, 1131729.0}), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(redeclare package Medium = Medium, option_temperature = false, D = 0.04, L = L4, Ns = Ns4, T0 = fill(300, Ns4), h0 = fill(650e3, Ns4), ntubes = 3, inertia = false, advection = false, P(start = {8751668.0, 8729230.0, 8724830.0, 8720430.0, 8733863.0}), h(start = {1128519.5, 1128310.0, 1129260.0, 1130270.0, 1131729.0})) annotation( Placement(transformation(origin = {-245.5, -11.5}, extent = {{-23.5, -23.5}, {23.5, 23.5}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_44(P(each start = 1.6e6), option_temperature = false, L = L4, Ns = Ns4, T0 = {532.656, 550.0, 550.0}, h0 = fill(650e3, Ns4), advection = false, D(fixed = true) = 0.04, C2(P(fixed = false, start = 16.99e5), Q(fixed = false, start = 2)), hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {465547.78125, 463670.0, 463128.0, 462620.0, 462620.0})) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_44(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, P(each start = 1.6e6), option_temperature = false, L = L4, Ns = Ns4, T0 = {532.656, 550.0, 550.0}, h0 = fill(650e3, Ns4), advection = false, D(fixed = true) = 0.04, C2(P(fixed = false, start = 16.99e5), Q(fixed = false, start = 2)), hcCorr = 2, dpfCorr = 0.4, ntubes = 3, h(start = {465547.78125, 463670.0, 463128.0, 462620.0, 462620.0})) annotation( Placement(transformation(origin = {-293, -12}, extent = {{23, 24}, {-23, -24}}, rotation = 90))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe2(Pm(fixed = false), b2 = 510, b1 = -3500, hn(start = 350), adiabatic_compression = true, C1(P(fixed = false, start = 17e5), h_vol_2(start = 462620.0)), a3(fixed = true) = 500, C2(P(fixed = false, start = 24.5146e5)), p_rho = 900, Q(fixed = true, start = 7.2), a1(fixed = false) = -1e8) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe2(redeclare package Medium = Medium_Oil, Pm(fixed = false), b2 = 510, b1 = -3500, hn(start = 350), adiabatic_compression = true, C1(P(fixed = false, start = 17e5), h_vol_2(start = 462620.0)), a3(fixed = true) = 500, C2(P(fixed = false, start = 24.5146e5)), p_rho = 900, Q(fixed = true, start = 7.2), a1(fixed = false) = -1e8) annotation( Placement(transformation(extent = {{-184, 129}, {-164, 149}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_2(K = 1e-6, p_rho = 900) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_2(redeclare package Medium = Medium_Oil, K = 1e-6, p_rho = 900) annotation( Placement(transformation(origin = {-212, 138.5}, extent = {{6, -9.5}, {-6, 9.5}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(K = 1e-6, p_rho = 900) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(redeclare package Medium = Medium_Oil, K = 1e-6, p_rho = 900) annotation( Placement(transformation(origin = {-286, 138.5}, extent = {{6, -9.5}, {-6, 9.5}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(W_fric = 1, Cst(fixed = false, start = 8.3e9) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 10), eta_is_nom = 0.94, Pe(fixed = true, start = 1800000), Ps(fixed = false, start = 5000), pros(d(start = 0.0434309)), xm(start = 0.908482)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(redeclare package Medium = Medium, W_fric = 1, Cst(fixed = false, start = 8.3e9) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 0.0434309), eta_is_nom = 0.94, Pe(fixed = true, start = 1800000), Ps(fixed = false, start = 5000), xm(start = 0.908482)) annotation( Placement(transformation(extent = {{105, 72}, {131, 40}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Tank(p_rho = 895, A = 0.1, z0 = 1, h0 = 423600, steady_state = true, h(start = 462620.0), rho(start = 895), Patm = 1670000, P(start = 1699000), ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.Oil_TherminolVP1) annotation( + ThermoSysPro.Fluid.Volumes.Tank Tank(redeclare package Medium = Medium_Oil, p_rho = 895, A = 0.1, z0 = 1, h0 = 423600, steady_state = true, h(start = 462620.0), rho(start = 895), Patm = 1670000, P(start = 1699000)) annotation( Placement(transformation(origin = {-248, 142}, extent = {{6, 6}, {-6, -6}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeA VolumeMP(V = 1, rho(start = 10), h0 = 2.4e6, h(start = 2868560.0), P0 = 1800000, dynamic_mass_balance = true, P(start = 1800000), Cs2(Q(start = 0.255955), h_vol_2(start = 2.87e6))) annotation( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeMP(redeclare package Medium = Medium, V = 1, rho(start = 10), h0 = 2.4e6, h(start = 2868560.0), P0 = 1800000, dynamic_mass_balance = true, P(start = 1800000), Cs2(Q(start = 0.255955), h_vol_2(start = 2.87e6))) annotation( Placement(transformation(extent = {{84, 50}, {94, 62}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeA VolumeCond(V = 1, rho(start = 10), h(start = 1837610.0), h0 = 2.1e6, P0 = 5000, dynamic_mass_balance = false, P(start = 5000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeCond(redeclare package Medium = Medium, V = 1, rho(start = 10), h(start = 1837610.0), h0 = 2.1e6, P0 = 5000, dynamic_mass_balance = false, P(start = 5000)) annotation( Placement(transformation(extent = {{141, 24}, {130, 34}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(KPurge = 10, SPurge = 0.3, Se(h(fixed = true, start = 600e3)), SCondDes(fixed = false, start = 9.57697) = 3, HDesF(start = 583561.0), HeiF(start = 150619.0), Hep(start = 884611.0), SDes(start = 0.932441), h(start = 882589.0), lambdaE = 1, KCond = 500, region_eeF = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1, region_seF = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(redeclare package Medium_e = Medium, redeclare package Medium_c = Medium, KPurge = 10, SPurge = 0.3, Se(h(fixed = true, start = 600e3)), SCondDes(fixed = false, start = 9.57697) = 3, HDesF(start = 583561.0), HeiF(start = 150619.0), Hep(start = 884611.0), SDes(start = 0.932441), h(start = 882589.0), lambdaE = 1, KCond = 500) annotation( Placement(transformation(extent = {{42, -106}, {0, -56}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(rho(start = 10), h(start = 2400e3), Q(start = 0.1), K = 1e-4, Pm(start = 1800000)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(redeclare package Medium = Medium, rho(start = 10), h(start = 2400e3), Q(start = 0.1), K = 1e-4, Pm(start = 1800000)) annotation( Placement(transformation(origin = {31.5, -13.5}, extent = {{5.5, -5.5}, {-5.5, 5.5}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss annotation( + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss(redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{108, -106}, {122, -90}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Cond_2(K = 1e-4, rho(start = 10), Q(start = 0.35), Pm(start = 5000.53), h(start = 2100e3)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Cond_2(redeclare package Medium = Medium, K = 1e-4, rho(start = 10), Q(start = 0.35), Pm(start = 5000.53), h(start = 2100e3)) annotation( Placement(transformation(origin = {135.5, 8.5}, extent = {{5.5, -5.5}, {-5.5, 5.5}}, rotation = 90))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps Rayonnement(Table = [0, 700; 200, 2; 1200, 2; 1800, 2; 2400, 0.1; 3000, 0.1; 3600, 0.1; 4200, 327; 4800, 287; 5400, 176; 6000, 410; 6600, 299; 7200, 26; 7800, 168; 8400, 485; 9000, 482; 9600, 664; 10200, 344; 10800, 684; 11400, 564; 12000, 460; 12600, 560; 13200, 611; 13800, 557; 14400, 682; 15000, 785; 15600, 321; 16200, 850; 16800, 330; 17400, 619; 18000, 480; 18600, 192; 19200, 750; 19800, 650; 20400, 450; 21000, 350; 21600, 763; 22200, 455; 22800, 290; 23400, 494; 24000, 800; 24600, 565; 25200, 320; 25800, 110; 26400, 479; 27000, 263; 27600, 747; 28200, 805; 28800, 576; 29400, 550; 30000, 470; 30600, 395; 31200, 315; 31800, 657; 32400, 670; 33000, 381; 33600, 209; 34200, 457; 34800, 320; 35400, 13; 36000, 0.1; 36600, 0.1; 37200, 0.1; 37800, 0.1; 38400, 0.1; 39000, 0.1; 39600, 0.1; 40200, 0.1; 40800, 0; 41400, 0; 42000, 0; 42600, 0; 43200, 0; 43800, 0]) annotation( Placement(transformation(extent = {{-322, 166}, {-306, 182}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha = 3, P(start = 2300000)) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium_Oil, alpha = 3, P(start = 2300000)) annotation( Placement(transformation(extent = {{21, 128}, {37, 150}}))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier2(alpha = 1/3, P(start = 2400000)) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier2(redeclare package Medium = Medium_Oil, alpha = 1/3, P(start = 2400000)) annotation( Placement(transformation(extent = {{-7.75, -9.75}, {7.75, 9.75}}, rotation = 0, origin = {-158.25, 139.75}))); equation From 76efbff07ba8e7e348eb72a4b15b5875d1b35a72 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 19 Nov 2026 11:02:41 +0100 Subject: [PATCH 206/213] CombinedCycle_Load_100_50 Fluid ok with Dymola26x --- .../CombinedCycle_Load_100_50.mo | 216 +++++++++--------- 1 file changed, 109 insertions(+), 107 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo index 7c325cd9..cd5344e9 100644 --- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo +++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo @@ -1,199 +1,201 @@ within ThermoSysPro.Fluid.Examples.CombinedCyclePowerPlant; model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 100% to 50%" - parameter Real CstHP(fixed = false, start = 8316103.829776841) "Stodola's ellipse coefficient HP"; - parameter Real CstMP(fixed = false, start = 254110.8564593821) "Stodola's ellipse coefficient MP"; - parameter Real CstBP(fixed = false, start = 10713.964292543395) "Stodola's ellipse coefficient BP"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam "Water/steam medium"; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases "Flue gases medium"; + parameter Real CstHP(fixed = false, start = 7870372.0) "Stodola's ellipse coefficient HP"; + parameter Real CstMP(fixed = false, start = 250029.328125) "Stodola's ellipse coefficient MP"; + parameter Real CstBP(fixed = false, start = 10565.39453125) "Stodola's ellipse coefficient BP"; parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed = false, start = 135) "Maximum CV: alim. valve HP Drum "; parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed = false, start = 70) "Maximum CV: alim. valve MP Drum "; parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed = false, start = 32000) "Maximum CV: steam valve BP Drum "; - parameter Real Encras_SHP1(fixed = false, start = 1) "Sur HP1: heat exchange fouling coefficient"; - parameter Real Encras_SHP2(fixed = false, start = 1) "Sur HP2: heat exchange fouling coefficient"; - parameter Real Encras_SHP3(fixed = false, start = 1) "Sur HP3: heat exchange fouling coefficient"; - parameter Real Encras_EHP1(fixed = false, start = 1) "Eco HP1: heat exchange fouling coefficient"; - parameter Real Encras_EHP2(fixed = false, start = 1) "Eco HP2: heat exchange fouling coefficient"; - parameter Real Encras_EHP3(fixed = false, start = 1) "Eco HP3: heat exchange fouling coefficient"; - parameter Real Encras_EHP4(fixed = false, start = 1) "Eco HP4: heat exchange fouling coefficient"; - parameter Real Encras_SMP1(fixed = false, start = 1) "Sur MP1: heat exchange fouling coefficient"; - parameter Real Encras_SMP2(fixed = false, start = 1) "Sur MP2: heat exchange fouling coefficient"; - parameter Real Encras_SMP3(fixed = false, start = 1) "Sur MP3: heat exchange fouling coefficient"; - parameter Real Encras_EMP(fixed = false, start = 1) "Eco MP: heat exchange fouling coefficient"; - parameter Real Encras_EvHP(fixed = false, start = 1) "Evapo HP: heat exchange fouling coefficient"; - parameter Real Encras_EvMP(fixed = false, start = 1) "Evapo MP: heat exchange fouling coefficient"; - parameter Real Encras_EvBP(fixed = false, start = 1) "Evapo BP: heat exchange fouling coefficient"; - parameter Real Encras_SBP(fixed = false, start = 1) "Sur BP: heat exchange fouling coefficient"; - parameter Real Encras_EBP(fixed = false, start = 1) "Eco BP: heat exchange fouling coefficient"; - parameter Real KgainChargeHP(fixed = false, start = 720.183) "HP: Friction pressure loss coefficient"; - parameter Real KgainChargeMP(fixed = false, start = 1090.9) "MP: Friction pressure loss coefficient"; - parameter Real Kin_SMP2(fixed = false, start = 10.) "SMPin: Friction pressure loss coefficient"; - parameter Real K_PerteChargeZero2(fixed = false, start = 1e-4) "TurbineMP out: Friction pressure loss coefficient"; + parameter Real Encras_SHP1(fixed = false, start = 0.01957226) "Sur HP1: heat exchange fouling coefficient"; + parameter Real Encras_SHP2(fixed = false, start = 0.04979854) "Sur HP2: heat exchange fouling coefficient"; + parameter Real Encras_SHP3(fixed = false, start = 0.06854334) "Sur HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP1(fixed = false, start = 0.07060027) "Eco HP1: heat exchange fouling coefficient"; + parameter Real Encras_EHP2(fixed = false, start = 0.11225893) "Eco HP2: heat exchange fouling coefficient"; + parameter Real Encras_EHP3(fixed = false, start = 0.0589451) "Eco HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP4(fixed = false, start = 0.02870644) "Eco HP4: heat exchange fouling coefficient"; + parameter Real Encras_SMP1(fixed = false, start = 0.03562396) "Sur MP1: heat exchange fouling coefficient"; + parameter Real Encras_SMP2(fixed = false, start = 0.06445078) "Sur MP2: heat exchange fouling coefficient"; + parameter Real Encras_SMP3(fixed = false, start = 0.05669266) "Sur MP3: heat exchange fouling coefficient"; + parameter Real Encras_EMP(fixed = false, start = 0.08260051) "Eco MP: heat exchange fouling coefficient"; + parameter Real Encras_EvHP(fixed = false, start = 0.02220076) "Evapo HP: heat exchange fouling coefficient"; + parameter Real Encras_EvMP(fixed = false, start = 0.05100356) "Evapo MP: heat exchange fouling coefficient"; + parameter Real Encras_EvBP(fixed = false, start = 0.05506011) "Evapo BP: heat exchange fouling coefficient"; + parameter Real Encras_SBP(fixed = false, start = 0.04970671) "Sur BP: heat exchange fouling coefficient"; + parameter Real Encras_EBP(fixed = false, start = 0.05872156) "Eco BP: heat exchange fouling coefficient"; + parameter Real KgainChargeHP(fixed = false, start = 1397.64331055) "HP: Friction pressure loss coefficient"; + parameter Real KgainChargeMP(fixed = false, start = 2109.40600586) "MP: Friction pressure loss coefficient"; + parameter Real Kin_SMP2(fixed = false, start = 200.53651428) "SMPin: Friction pressure loss coefficient"; + parameter Real K_PerteChargeZero2(fixed = false, start = 128.79850769) "TurbineMP out: Friction pressure loss coefficient"; parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed = false, start = 8000) "Maximum CV input Turbine HP "; parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed = false, start = 1500) "Maximum CV input Turbine MP "; - ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(L = 16.27, Vertical = false, hl(fixed = false, start = 1490815.1478051024), hv(fixed = false, start = 2666681.973890458), Vv(fixed = false), R = 1.05, xmv(fixed = false), P(fixed = false, start = 12723768.606734423), zl(start = 1.05, fixed = true), Mp = 5000, Kpa = 5, Kvl = 1000, Pfond(start = 12730534.85594967), Tp(start = 593.1308910047013)) annotation( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(redeclare package Medium = Medium, L = 16.27, Vertical = false, hl(start = 1460157.0, fixed = false), hv(start = 2664771.25, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, xmv(fixed = false), P(start = 12726798.0, fixed = false), zl(start = 1.05, fixed = true), Mp = 5000, Kpa = 5, Kvl = 1000, Pfond(start = 12733709.0), Tp(start = 589.4727172851562), state_out_l(d(start = 671.1120605)), Cd(h_vol_1(start = 1460157)), Ce2(h_vol_1(start = 1460157)), Ce3(h_vol_1(start = 1460157)), Cs(h_vol_2(start = 1460157))) annotation( Placement(transformation(extent = {{38, 10}, {-2, 50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(Cvmax = CvmaxValveAHP, C1(P(start = 13463260.282381449), h_vol_2(start = 1398250.7267619045)), h(start = 1398000), Cv(start = 178), Pm(start = 13050700)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(redeclare package Medium = Medium, Cvmax = CvmaxValveAHP, C1(P(start = 13377830.0), h_vol_2(start = 1398733.0)), h(start = 1398733.0), Cv(start = 177.89662170410156), Pm(start = 13052314.0)) annotation( Placement(transformation(extent = {{78, 46}, {58, 66}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_vanne_vapeurHP(k = 0.5) annotation( Placement(transformation(extent = {{-18, 70}, {-28, 78}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(Cvmax = 47829.4, C2(h_vol_1(start = 2664756.9335524077)), h(start = 2674000), Cv(start = 23914.7), Pm(start = 12722334.038901985)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2664771.25)), h(start = 2664771.25), Cv(start = 23914.69921875), Pm(start = 12725285.0)) annotation( Placement(transformation(extent = {{-22, 46}, {-42, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(z2 = 0, Q(start = 150, fixed = true), z1 = 10.83, K = KgainChargeHP, C2(P(start = 12755543.553810954)), h(start = 1474422.14552527), Pm(start = 12704000)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(redeclare package Medium = Medium, z2 = 0, Q(start = 150, fixed = true), z1 = 10.83, K = KgainChargeHP, C2(P(start = 12758131.0)), h(start = 1460157.0), Pm(start = 12745920.0)) annotation( Placement(transformation(origin = {28, -90}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(V = 5, h(start = 1490815.1478051024), P(start = 12704000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(redeclare package Medium = Medium, V = 5, h(start = 1460157.0), P(start = 12758131.0), Ce2(h_vol_1(start = 1460157)), Ce3(h_vol_1(start = 1460157))) annotation( Placement(transformation(extent = {{8, -100}, {-12, -80}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurHP(Dint = 32.8e-3, Ntubes = 1476, L = 20.7, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-5.74e7, -2.67e7, -1.24e7}), Tp(start = {607.0686256839474, 605.4340763016401, 604.369250336098}), Tp1(start = {605.8809866549195, 604.7482278053628, 603.9735475960298})), Ns = 3, ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.092, step_T = 0.0869, St = 1, Fa = 1, K(fixed = true, start = 37.69), CSailettes = 11.86442072, p_rho = 1.05, Encras = Encras_EvHP, deltaT(start = {106, 49, 23}), T2(start = {755.54833984375, 674.4067359457392, 636.0812177546504, 618.193603515625}), T1(start = {714.9775457406769, 655.2439768501948, 627.1374112677474}), Tp(start = {608.1720536506299, 606.0712938344541, 604.7368952679157}), h(start = {733599.3125, 656358.4375, 611752.6709052362, 586017.25, 579857.8125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 10.83, option_temperature(start = false) = false, continuous_flow_reversal = true, inertia = true, dW1(start = {5.74e7, 2.67e7, 1.24e7}), h(start = {1490815.125, 1802974.8785231041, 1983243.6948464876, 2087250.43237827, 1490815.125}), hb(start = {1459929.875, 1760591.32331318, 1893494.15765019, 1954976.19646134}), P(start = {12755544.0, 12738060.440301126, 12731944.445232479, 12727558.331339812, 12723769.0}), T0(start = {290.0, 290.0, 290.0})), Cfg1(Xo2(start = 0.1115701174007655), h_vol_1(start = 733599.3042437045), h_vol_2(start = 656358.4284245522)), Cfg2(h_vol_1(start = 586017.2197643318), h_vol_2(start = 579857.8163754256))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurHP(steady_state = false, option_temperature = false, h0 = {1842996.125, 2021168.75, 2103751.5}, T0 = fill(605.824, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, Ntubes = 1476, L = 20.7, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-57425876.0, -26725888.0, -12387397.0}), Tp(start = {607.973388671875, 605.4445190429688, 604.0555419921875}), Tp1(start = {606.516845703125, 604.7666015625, 603.7413330078125})), Ns = 3, ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.092, step_T = 0.0869, St = 1, Fa = 1, K(fixed = true, start = 37.69), CSailettes = 11.86442072, p_rho = 1.05, Encras = Encras_EvHP, deltaT(start = {106, 49, 23}), T2(start = {755.54833984375, 674.4067359457392, 636.0812177546504, 618.193603515625}), T1(start = {714.9775457406769, 655.2439768501948, 627.1374112677474}), Tp(start = {609.32666015625, 606.0742797851562, 604.3474731445312}), h(start = {3060028.5, 2965298.75, 2921211.75, 2900777.25, 2895017})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 10.83, option_temperature(start = false) = false, continuous_flow_reversal = true, inertia = true, dW1(start = {57425876.0, 26725888.0, 12387397.0}), h(start = {1460157.0, 1842996.125, 2021168.75, 2103751.5, 1460157.0}), hb(start = {1460157.0, 1842996.125, 2021168.75, 2103751.5}), P(start = {12758131.0, 12740277.0, 12734658.0, 12730511.0, 12726798.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {13419.6875, 10783.772461, 8669.30957}), Q(start = {150.0, 150.0, 150.0, 150.0})), Cfg1(Xi(start = {0.7542451793792345, 0.1115701174007655, 0.07254632562, 0.06163837761, 0}), h_vol_1(start = 3060028.5), h_vol_2(start = 2965298.75)), Cfg2(h_vol_1(start = 2900777.25), h_vol_2(start = 2895017))) annotation( Placement(transformation(origin = {-14, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP4(Ns = 3, L = 20.726, Dint = 0.0266, Ntubes = 246, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-3.5e6, -2.63e6, -2e6}), Tp(start = {586.8045312098105, 592.233932288974, 596.2487558411457}), Tp1(start = {586.1107280703657, 591.70094527162, 595.8370299676952})), Cws1(P(start = 13392085.206996098), h_vol_2(start = 1291418.4097512758)), Cws2(h_vol_1(start = 1398250.726761905)), ExchangerFlueGasesMetal(Dext = 0.0318, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 11.39069779, K(fixed = true, start = 47.53), p_rho = 1.06, Encras = Encras_EHP4, deltaT(start = {38, 29, 22}), T2(start = {618.193603515625, 613.1248964422501, 609.3035158562986, 606.41162109375}), T1(start = {615.6592506115472, 611.2142061492743, 607.857569142044}), Tp(start = {587.4391153803123, 592.7214266588746, 596.6253392075643}), h(start = {586017.25, 579857.8125, 575126.0965916426, 571470.875, 568995.125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, z2 = 0, option_temperature(start = false) = false, inertia = true, dW1(start = {3.5e6, 2.63e6, 2e6}), h(start = {1340827.875, 1391283.256558695, 1430043.6648856928, 1459985.6005320582, 1490815.125}), hb(start = {1291418.875, 1336078.18827954, 1370718.78680301, 1396865.59043578}), P(start = {13392085.0, 13410597.999476302, 13428564.988335809, 13446090.481250245, 13463260.0}), T0(start = {290.0, 290.0, 290.0})), Cfg2(h_vol_1(start = 571470.9016291047), h_vol_2(start = 568995.1352316155))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP4(steady_state = false, option_temperature = false, h0 = {1338057.875, 1372606.625, 1398733.0}, T0 = fill(581.72, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 0.0266, Ntubes = 246, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-3491887.0, -2629980.25, -1988833.5}), Tp(start = {577.0819702148438, 582.1712646484375, 585.9067993164062}), Tp1(start = {576.43310546875, 581.6826171875, 585.5372314453125})), Cws1(P(start = 13304374.0), h_vol_2(start = 1292186.75)), Cws2(h_vol_1(start = 1398733.0)), ExchangerFlueGasesMetal(Dext = 0.0318, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 11.39069779, K(fixed = true, start = 47.53), p_rho = 1.06, Encras = Encras_EHP4, deltaT(start = {38, 29, 22}), T2(start = {618.193603515625, 613.1248964422501, 609.3035158562986, 606.41162109375}), T1(start = {615.6592506115472, 611.2142061492743, 607.857569142044}), Tp(start = {577.6754150390625, 582.6182861328125, 586.2448120117188}), h(start = {2900777.25, 2895017, 2890678.75, 2887398, 2885295.5})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, z2 = 0, option_temperature(start = false) = false, inertia = true, dW1(start = {3491887.0, 2629980.25, 1988833.5}), h(start = {1292186.75, 1338057.875, 1372606.625, 1398733.0, 1398733.0}), hb(start = {1292186.75, 1338057.875, 1372606.625, 1398733.0}), P(start = {13304374.0, 13323348.0, 13341852.0, 13359985.0, 13377830.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {6917.688965, 6996.496094, 7062.208496}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg2(h_vol_1(start = 2887398), h_vol_2(start = 2885295.5))) annotation( Placement(transformation(origin = {86, -50}, extent = {{20, 20}, {-20, -20}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP1(Ns = 3, L = 20.4, Dint = 0.0324, Ntubes = 246, ExchangerWall(e = 0.0028, lambda = 37.61, dW1(start = {-9.8e6, -7.7e6, -5.9e6}), Tp(start = {642.2528493064303, 660.2252788975977, 676.0185839771161}), Tp1(start = {640.2457872857126, 658.6370135480385, 674.7830152370668})), Cws1(h_vol_2(start = 2664756.9335524077)), Cws2(P(start = 12717986.08142511), h_vol_1(start = 2973076.465167672)), ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 10.25056, K(fixed = true, start = 34.71), p_rho = 1.04, Encras = Encras_SHP1, deltaT(start = {138, 108, 84}), T2(start = {788.2433471679688, 774.636330839027, 763.888258455914, 755.54833984375}), T1(start = {781.4398445109163, 769.2622946474705, 759.7183069957642}), Tp(start = {644.10620941112, 661.6919140110865, 677.1595321818904}), h(start = {771604.625, 755814.75, 743319.68570567, 733599.3125, 656358.4375})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, option_temperature(start = false) = false, inertia = true, dW1(start = {9.8e6, 7.7e6, 5.9e6}), h(start = {2666682.0, 2796026.041774324, 2898380.976036657, 2978006.560766205, 3093060.25}), hb(start = {2664757.0, 2808108.09290342, 2916825.81170239, 2998229.34382983}), P(start = {12720899.0, 12720947.316355772, 12720381.982283436, 12719355.693542536, 12717986.0}), T0(start = {290.0, 290.0, 290.0})), Cfg1(h_vol_1(start = 771604.5980597589), h_vol_2(start = 755814.7776905377))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP1(steady_state = false, option_temperature = false, h0 = {2793338.75, 2894601.25, 2972997.5}, T0 = fill(658.513, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 0.0324, Ntubes = 246, ExchangerWall(e = 0.0028, lambda = 37.61, dW1(start = {-9787038.0, -7708485.5, -5967831.5}), Tp(start = {641.7616577148438, 659.242431640625, 674.5349731445312}), Tp1(start = {639.70947265625, 657.6260986328125, 673.2836303710938})), Cws1(h_vol_2(start = 2664771.25)), Cws2(P(start = 12720380.0), h_vol_1(start = 2972997.5)), ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 10.25056, K(fixed = true, start = 34.71), p_rho = 1.04, Encras = Encras_SHP1, deltaT(start = {138, 108, 84}), T2(start = {788.2433471679688, 774.636330839027, 763.888258455914, 755.54833984375}), T1(start = {781.4398445109163, 769.2622946474705, 759.7183069957642}), Tp(start = {643.6566772460938, 660.7349853515625, 675.6904907226562}), h(start = {3098733.75, 3082589, 3069873, 3060028.5, 2965298.75})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, option_temperature(start = false) = false, inertia = true, dW1(start = {9787038.0, 7708485.5, 5967831.5}), h(start = {2664771.25, 2793338.75, 2894601.25, 2972997.5, 2972997.5}), hb(start = {2664771.25, 2793338.75, 2894601.25, 2972997.5}), P(start = {12723773.0, 12723715.0, 12723035.0, 12721883.0, 12720380.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {2799.019043, 2370.857422, 2135.596191}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 3098733.75), h_vol_2(start = 3082589))) annotation( Placement(transformation(origin = {-54, -50}, extent = {{-20, 20}, {20, -20}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP3(Dint = 26.6e-3, Ntubes = 1476, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.6e7, -5.6e6, -2.1e6}), Tp(start = {561.796823652815, 571.4588678419677, 575.4628803966649}), Tp1(start = {561.3366476058077, 571.262479097038, 575.3781133321203})), L = 20.726, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 12.451, K(fixed = true, start = 36.0300000000857), p_rho = 1.08, Encras = Encras_EHP3, St = 5, deltaT(start = {34, 12, 4.4}), T2(start = {602.6719360351563, 579.980900946576, 571.7829862725544, 568.8102416992188}), T1(start = {591.3264094805266, 575.8819436095652, 570.2965996068247}), Tp(start = {562.2177217699727, 571.63849399485, 575.5404122414816}), h(start = {566350.125, 541838.1875, 531377.2730086804, 526862.0625, 524994.875})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {1.6e7, 5.6e6, 2.1e6}), h(start = {1017356.625, 1218148.8764511738, 1303840.734184985, 1340827.8193574403, 1391283.25}), hb(start = {986348.9375, 1189594.8774342, 1263384.6284551, 1290000.70037855}), P(start = {13311571.0, 13333449.940013096, 13353656.79078459, 13373055.807696301, 13392085.0}), T0(start = {290.0, 290.0, 290.0})), Cfg1(h_vol_1(start = 566350.1392976114), h_vol_2(start = 541838.2014676201)), Cfg2(h_vol_1(start = 526862.0336133951), h_vol_2(start = 524994.8479453246))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP3(steady_state = false, option_temperature = false, h0 = {1192151.75, 1265586.75, 1292186.75}, T0 = fill(562.167, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ntubes = 1476, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-15527223.0, -5590150.0, -2024889.125}), Tp(start = {556.9667358398438, 563.5999145507812, 565.9346923828125}), Tp1(start = {556.4859008789062, 563.4267578125, 565.8719482421875})), L = 20.726, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 12.451, K(fixed = true, start = 36.0300000000857), p_rho = 1.08, Encras = Encras_EHP3, St = 5, deltaT(start = {34, 12, 4.4}), T2(start = {602.6719360351563, 579.980900946576, 571.7829862725544, 568.8102416992188}), T1(start = {591.3264094805266, 575.8819436095652, 570.2965996068247}), Tp(start = {557.4065551757812, 563.7582397460938, 565.9920043945312}), h(start = {2883137, 2857523.25, 2848301.75, 2844961.5, 2843184.25})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {15527223.0, 5590150.0, 2024889.125}), h(start = {988178.3125, 1192151.75, 1265586.75, 1292186.75, 1292186.75}), hb(start = {988178.3125, 1192151.75, 1265586.75, 1292186.75}), P(start = {13222570.0, 13244666.0, 13265102.0, 13284865.0, 13304374.0}), T0(start = {300.0, 300.0, 300.0}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 2883137), h_vol_2(start = 2857523.25)), Cfg2(h_vol_1(start = 2844961.5), h_vol_2(start = 2843184.25))) annotation( Placement(transformation(origin = {206, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP2(Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-5e6, -3e6, -2.e6}), Tp(start = {497.4826387258949, 505.30719485126787, 510.35203444054224}), Tp1(start = {497.280376159525, 505.1760138457019, 510.2668260105936})), L = 20.767, Ntubes = 1107, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_T = 86.9e-3, Fa = 1, step_L = 111e-3, CSailettes = 2.76134577, K(fixed = true, start = 65.5300000000393), p_rho = 1.11, Encras = Encras_EHP2, St = 5, deltaT(start = {36, 23, 14}), T2(start = {531.16064453125, 523.8360138077611, 519.2214124321695, 516.3124389648438}), T1(start = {527.4983362936189, 521.5287131199652, 517.7669224567446}), Tp(start = {497.66763734525006, 505.42717901517375, 510.4299699783979}), h(start = {480418.125, 472321.78125, 467070.7664465268, 463659.96875, 459024.375})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {5e6, 3e6, 2.e6}), h(start = {880080.3125, 946402.3420877852, 989416.7007043775, 1017356.6143159299, 1017356.625}), hb(start = {854494.5625, 915007.018247822, 957243.396653824, 983786.364226731}), P(start = {13222388.0, 13245245.535219172, 13267635.410096379, 13289708.936642656, 13311571.0}), T0(start = {290.0, 290.0, 290.0})), Cfg1(h_vol_1(start = 480418.1309072992), h_vol_2(start = 472321.79192425753)), Cfg2(h_vol_1(start = 463659.97054164804), h_vol_2(start = 459024.3888915999))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP2(steady_state = false, option_temperature = false, h0 = {922134.562, 962653.5, 988178.312}, T0 = fill(498.43, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-5e6, -3e6, -2.e6}), Tp(start = {492.0558166503906, 499.33734130859375, 503.8979187011719}), Tp1(start = {491.85382080078125, 499.2102355957031, 503.81787109375})), L = 20.767, Ntubes = 1107, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_T = 86.9e-3, Fa = 1, step_L = 111e-3, CSailettes = 2.76134577, K(fixed = true, start = 65.5300000000393), p_rho = 1.11, Encras = Encras_EHP2, St = 5, deltaT(start = {36, 23, 14}), T2(start = {531.16064453125, 523.8360138077611, 519.2214124321695, 516.3124389648438}), T1(start = {527.4983362936189, 521.5287131199652, 517.7669224567446}), Tp(start = {492.2405700683594, 499.45361328125, 503.9711608886719}), h(start = {2802681.25, 2794595.5, 2789507.25, 2786302, 2782058.75})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {5e6, 3e6, 2.e6}), h(start = {857742.5, 922134.5625, 962653.5, 988178.3125, 988178.3125}), hb(start = {857742.5, 922134.5625, 962653.5, 988178.3125}), P(start = {13132658.0, 13155663.0, 13178223.0, 13200491.0, 13222570.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {1831.615479, 1859.022339, 1875.480103}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 2802681.25), h_vol_2(start = 2794595.5)), Cfg2(h_vol_1(start = 2786302), h_vol_2(start = 2782058.75))) annotation( Placement(transformation(origin = {406, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP1(Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9.9999e6, -5e6, -2.4e6}), Tp(start = {463.9321072661506, 474.9929739228467, 480.7691364010327}), Tp1(start = {463.5249231636951, 474.78082392813104, 480.65874049533926})), L = 20.726, Ntubes = 1107, Cws1(h_vol_2(start = 618649.6677733721)), ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 8.30057632, K(fixed = true, start = 40.24), p_rho = 1.13, Encras = Encras_EHP1, St = 5, deltaT(start = {41, 20, 10}), T2(start = {509.31475830078125, 493.76452187742854, 486.23046610566547, 482.5950622558594}), T1(start = {501.5396335543568, 489.997493991547, 484.4127676365523}), Tp(start = {464.30453652050693, 475.18701603762264, 480.87010955935017}), h(start = {454937.0, 438670.0625, 430194.70910967304, 425784.40625, 406989.71875})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, z1 = 10.767, inertia = true, dW1(start = {9.9999e6, 5e6, 2.4e6}), h(start = {571589.625, 774526.0247459969, 843952.8413327619, 880080.2817637667, 880080.3125}), hb(start = {618651.9375, 752176.893518976, 816707.727773953, 847728.424287614}), advection = true, dynamic_mass_balance = true, P(start = {13128535.0, 13152879.589094872, 13176430.551414272, 13199531.42642672, 13222388.0}), T0(start = {290.0, 290.0, 290.0})), Cfg1(h_vol_1(start = 454936.9990189345), h_vol_2(start = 438670.0646527905)), Cfg2(h_vol_1(start = 425784.41179849324), h_vol_2(start = 406989.7250411841))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP1(steady_state = false, option_temperature = false, h0 = {760481.0, 826108.812, 857742.5}, T0 = fill(469.09, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-10336913.0, -4995835.0, -2408076.5}), Tp(start = {461.0337829589844, 470.7584533691406, 475.4774169921875}), Tp1(start = {460.6069641113281, 470.5521545410156, 475.37799072265625})), L = 20.726, Ntubes = 1107, Cws1(h_vol_2(start = 624690.125)), ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 8.30057632, K(fixed = true, start = 40.24), p_rho = 1.13, Encras = Encras_EHP1, St = 5, deltaT(start = {41, 20, 10}), T2(start = {509.31475830078125, 493.76452187742854, 486.23046610566547, 482.5950622558594}), T1(start = {501.5396335543568, 489.997493991547, 484.4127676365523}), Tp(start = {461.4241943359375, 470.9471130371094, 475.568359375}), h(start = {2778575.75, 2761524, 2753282.75, 2749310.5, 2729320.5})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, z1 = 10.767, inertia = true, dW1(start = {10336913.0, 4995835.0, 2408076.5}), h(start = {624690.125, 760481.0, 826108.8125, 857742.5, 857742.5}), hb(start = {624690.125, 760481.0, 826108.8125, 857742.5}), advection = true, dynamic_mass_balance = true, P(start = {13038369.0, 13062802.0, 13086438.0, 13109653.0, 13132658.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {1703.350342, 1759.462891, 1784.450073}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 2778575.75), h_vol_2(start = 2761524)), Cfg2(h_vol_1(start = 2749310.5), h_vol_2(start = 2729320.5))) annotation( Placement(transformation(origin = {526, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP2(Ns = 3, L = 20.4, Dint = 32e-3, Ntubes = 246, ExchangerWall(e = 3e-3, lambda = 27, dW1(start = {-8.8e6, -6.6e6, -4.9e6}), Tp(start = {718.9678163326367, 740.0767692096435, 756.604413623004}), Tp1(start = {716.2791829167277, 738.0462739865401, 755.0829558745072})), Cws2(P(start = 12709302.607974846), h_vol_1(start = 3240813.8516343245)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 34.74), CSailettes = 10.2505424803872, p_rho = 1.02, Encras = Encras_SHP2, St = 5, deltaT(start = {124, 93, 70}), T2(start = {850.646484375, 838.5707346201303, 829.4749488031354, 822.6819458007813}), T1(start = {844.6086089059804, 834.0228417116329, 826.0784372242802}), Tp(start = {721.435205827699, 741.940177792463, 758.000672720138}), h(start = {844515.9375, 830470.625, 819863.3783947699, 811915.375, 793532.125})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.83, inertia = true, dW1(start = {8.8e6, 6.6e6, 4.9e6}), h(start = {2978006.5, 3093060.285806892, 3179950.539313758, 3245057.7348208814, 3327367.0}), hb(start = {2973076.25, 3118965.9792171, 3205920.08101435, 3268474.17308722}), P(start = {12717986.0, 12716434.741873961, 12714386.551930543, 12711976.726767521, 12709303.0}), T0(start = {290.0, 290.0, 290.0})), Cfg1(h_vol_1(start = 844515.913281604), h_vol_2(start = 830470.6023452462)), Cfg2(h_vol_1(start = 811915.3453800348), h_vol_2(start = 793532.1532110969))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP2(steady_state = false, option_temperature = false, h0 = {3088810.75, 3175837.75, 3240716.25}, T0 = fill(737.382, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 32e-3, Ntubes = 246, ExchangerWall(e = 3e-3, lambda = 27, dW1(start = {-8816137.0, -6624821.0, -4938789.5}), Tp(start = {718.056396484375, 738.9192504882812, 755.1716918945312}), Tp1(start = {715.2724609375, 736.8273315429688, 753.6121215820312})), Cws2(P(start = 12711013.0), h_vol_1(start = 3240716.25)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 34.74), CSailettes = 10.2505424803872, p_rho = 1.02, Encras = Encras_SHP2, St = 5, deltaT(start = {124, 93, 70}), T2(start = {850.646484375, 838.5707346201303, 829.4749488031354, 822.6819458007813}), T1(start = {844.6086089059804, 834.0228417116329, 826.0784372242802}), Tp(start = {720.6112060546875, 740.839111328125, 756.6029052734375}), h(start = {3173470.25, 3158927, 3147998.75, 3139851.75, 3120912.5})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.83, inertia = true, dW1(start = {8816137.0, 6624821.0, 4938789.5}), h(start = {2972997.5, 3088810.75, 3175837.75, 3240716.25, 3240716.25}), hb(start = {2972997.5, 3088810.75, 3175837.75, 3240716.25}), P(start = {12720380.0, 12718686.0, 12716472.0, 12713880.0, 12711013.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {1977.683594, 1886.197876, 1841.59021}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 3173470.25), h_vol_2(start = 3158927)), Cfg2(h_vol_1(start = 3139851.75), h_vol_2(start = 3120912.5))) annotation( Placement(transformation(origin = {-174, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP3(Ns = 3, L = 20.4, Ntubes = 246, ExchangerWall(lambda = 27, e = 5e-3, dW1(start = {-6.3e6, -4.7e6, -3.6e6}), Tp(start = {790.194354484117, 807.7071433884553, 821.1209947971915}), Tp1(start = {786.6677403770077, 805.0457823271269, 819.1194288821613})), Dint = 28e-3, Cws2(h_vol_1(start = 3433271.775819776), h_vol_2(start = 3436197.0248581353)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 49.33), CSailettes = 6.59672842597229, p_rho = 1, Encras = Encras_SHP3, St = 5, deltaT(start = {97, 73, 55}), T2(start = {894.2188110351563, 885.636025090525, 879.1746662824661, 874.3292236328125}), T1(start = {889.9274067093704, 882.4053456864956, 876.7519418617093}), Tp(start = {793.2224770352475, 809.9923175531776, 822.8396367298765}), h(start = {1667213.25, 885985.75, 878403.0483138687, 872700.1875, 859769.0})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.726, inertia = true, dW1(start = {6.3e6, 4.7e6, 3.6e6}), h(start = {3245057.75, 3327366.927704592, 3389481.600384113, 3436197.0248581353, 3436197.0}), hb(start = {3240813.5, 3348361.34780186, 3407279.82422176, 3450835.48993987}), P(start = {12709303.0, 12702950.046102656, 12696025.294905605, 12688672.774977181, 12681000.0}), T0(start = {290.0, 290.0, 290.0})), Cfg1(h_vol_2(start = 885985.7657894278)), Cfg2(h_vol_1(start = 872700.2111216835), h_vol_2(start = 859769.0004719263))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP3(steady_state = false, option_temperature = false, h0 = {3323878.25, 3386384.25, 3433201.75}, T0 = fill(805.437, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 246, ExchangerWall(lambda = 27, e = 5e-3, dW1(start = {-6330595.0, -4758206.5, -3563920.25}), Tp(start = {789.3624877929688, 806.8161010742188, 820.1324462890625}), Tp1(start = {785.697265625, 804.0612182617188, 818.0690307617188})), Dint = 28e-3, Cws2(h_vol_1(start = 3433201.75), h_vol_2(start = 3433201.75)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 49.33), CSailettes = 6.59672842597229, p_rho = 1, Encras = Encras_SHP3, St = 5, deltaT(start = {97, 73, 55}), T2(start = {894.2188110351563, 885.636025090525, 879.1746662824661, 874.3292236328125}), T1(start = {889.9274067093704, 882.4053456864956, 876.7519418617093}), Tp(start = {792.5096435546875, 809.1815185546875, 821.9041748046875}), h(start = {3226298.5, 3215855.5, 3208006.25, 3202127.25, 3188843.25})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.726, inertia = true, dW1(start = {6330595.0, 4758206.5, 3563920.25}), h(start = {3240716.25, 3323878.25, 3386384.25, 3433201.75, 3433201.75}), hb(start = {3240716.25, 3323878.25, 3386384.25, 3433201.75}), P(start = {12711013.0, 12704275.0, 12696931.0, 12689134.0, 12681000.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {2295.884033, 2276.14624, 2267.704834}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_2(start = 3215855.5)), Cfg2(h_vol_1(start = 3202127.25), h_vol_2(start = 3188843.25))) annotation( Placement(transformation(origin = {-294, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(L = 16.27, Vertical = false, P0 = 27.29e5, hl(fixed = false, start = 982393.5767040529), hv(fixed = false, start = 2799922.9214887), Vv(fixed = false), R = 1.05, P(fixed = false, start = 2735928.760015618), zl(start = 1.05, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 2744469.1253284975), Tp(start = 497.67337438326825)) annotation( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(redeclare package Medium = Medium, L = 16.27, Vertical = false, P0 = 27.29e5, hl(start = 980845.5, fixed = false), hv(start = 2798679.25, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, P(start = 2733888.0, fixed = false), zl(start = 1.05, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 2742433.0), Tp(start = 497.4056091308594), state_out_l(d(start = 829.8590088)), Cd(h_vol_1(start = 980845.5)), Ce2(h_vol_1(start = 980845.5)), Ce3(h_vol_1(start = 980845.5)), Cs(h_vol_2(start = 980845.5))) annotation( Placement(transformation(extent = {{358, 10}, {320, 50}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_vanne_vapeurMP(k = 0.5) annotation( Placement(transformation(extent = {{304, 70}, {292, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(Cvmax = CvmaxValveAMP, C1(P(start = 3167631.503685111), h_vol_2(start = 944504.749093579)), h(start = 944000), Cv(start = 28), Pm(start = 2975000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(redeclare package Medium = Medium, Cvmax = CvmaxValveAMP, C1(P(start = 3235124.75), h_vol_2(start = 946338.375)), h(start = 946338.375), Cv(start = 27.634977340698242), Pm(start = 2984506.25)) annotation( Placement(transformation(extent = {{398, 46}, {378, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(Cvmax = 47829.4, C2(h_vol_1(start = 2798574.7604119307)), h(fixed = false, start = 2798000), Cv(start = 23914.7), Pm(fixed = false, start = 2734363.102702573)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2798679.25)), h(fixed = false, start = 2798000), Cv(start = 23914.69921875), Pm(fixed = false, start = 2732628.5)) annotation( Placement(transformation(extent = {{298, 46}, {278, 66}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurMP(Dint = 32.8e-3, L = 20.767, Ntubes = 738, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9.7e7, -7.6e6, -5.8e6}), Tp(start = {505.16819175410103, 504.47653316985316, 503.9096834697299}), Tp1(start = {504.6351775530387, 504.05161319744064, 503.5710085659467})), Ns = 3, TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.83, continuous_flow_reversal = true, inertia = true, dW1(start = {9.7e7, 7.6e6, 5.8e6}), P(start = {2774374.0, 2752246.9598328522, 2744979.3658251367, 2740042.865359723, 2735928.75}), h(start = {982393.5625, 1052669.185607329, 1108693.0397347796, 1153345.8558491606, 982393.5625}), hb(start = {980708.125, 1028103.09460604, 1066178.43156513, 1095633.31556464}), T0(start = {290.0, 290.0, 290.0})), Cws1(P(start = 2774374.0890979404)), ExchangerFlueGasesMetal(K(fixed = true, start = 30.22), Dext = 38e-3, step_L = 111e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 10.0676093, p_rho = 1.1, Encras = Encras_EvMP, St = 5, deltaT(start = {53, 41, 32}), T2(start = {565.2481689453125, 550.9126306026692, 539.787269523939, 531.16064453125}), T1(start = {558.0803978580261, 545.349950063304, 535.4739641517078}), Tp(start = {505.6634119015416, 504.8713236488558, 504.224344196615}), h(start = {522718.59375, 505329.59375, 491467.03403307416, 480418.125, 472321.78125})), Cfg1(h_vol_1(start = 522718.6023168775), h_vol_2(start = 505329.58942935336))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurMP(steady_state = false, option_temperature = false, h0 = {1046149.875, 1096680.0, 1135771.875}, T0 = fill(504.323, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, L = 20.767, Ntubes = 738, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9795648.0, -7579518.5, -5863791.0}), Tp(start = {504.9960632324219, 504.2750244140625, 503.69677734375}), Tp1(start = {504.5007629394531, 503.89178466796875, 503.4002685546875})), Ns = 3, TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.83, continuous_flow_reversal = true, inertia = true, dW1(start = {9795648.0, 7579518.5, 5863791.0}), P(start = {2773379.25, 2751240.0, 2743512.5, 2738258.0, 2733888.0}), h(start = {980845.5, 1046149.875, 1096680.0, 1135771.875, 980845.5}), hb(start = {980845.5, 1046149.875, 1096680.0, 1135771.875}), T0(start = {300.0, 300.0, 300.0}), Q(start = {150.0, 150.0, 150.0, 150.0})), Cws1(P(start = 2773379.25)), ExchangerFlueGasesMetal(K(fixed = true, start = 30.22), Dext = 38e-3, step_L = 111e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 10.0676093, p_rho = 1.1, Encras = Encras_EvMP, St = 5, deltaT(start = {53, 41, 32}), T2(start = {565.2481689453125, 550.9126306026692, 539.787269523939, 531.16064453125}), T1(start = {558.0803978580261, 545.349950063304, 535.4739641517078}), Tp(start = {505.45623779296875, 504.631103515625, 503.9722595214844}), h(start = {2841016.25, 2824857.5, 2812354.25, 2802681.25, 2794595.5})), Cfg1(h_vol_1(start = 2841016.25), h_vol_2(start = 2824857.5))) annotation( Placement(transformation(origin = {306, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(z2 = 0, z1 = 10.83, Q(start = 150, fixed = true), K = KgainChargeMP, Pm(start = 2734000), h(start = 978914.570821827)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(redeclare package Medium = Medium, z2 = 0, z1 = 10.83, Q(start = 150, fixed = true), K = KgainChargeMP, Pm(start = 2757906.0), h(start = 980845.5)) annotation( Placement(transformation(origin = {348, -90}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(V = 5, h(start = 982393.5767040529), P(start = 2734000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(redeclare package Medium = Medium, V = 5, h(start = 980845.5), P(start = 2773379.25), Ce2(h_vol_1(start = 980845.5)), Ce3(h_vol_1(start = 980845.5))) annotation( Placement(transformation(extent = {{328, -100}, {308, -80}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurMP(ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-3e6, -1.4e6, -740379}), Tp(start = {472.3628584074194, 491.3438906316966, 502.0012847992062}), Tp1(start = {471.840700513395, 491.0496555837365, 501.83511098176496})), L = 20.726, Ns = 3, Dint = 26.6e-3, Ntubes = 246, Cws1(h_vol_2(start = 565106.2802015315), P(start = 3075398.079286396)), Cws2(h_vol_1(start = 944504.7490935794)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 47.78), CSailettes = 7.16188651, p_rho = 1.12, Encras = Encras_EMP, St = 5, deltaT(start = {45, 24, 13}), T2(start = {516.3124389648438, 512.4675048876576, 510.41305969109146, 509.31475830078125}), T1(start = {514.3899686844887, 511.4402822893745, 509.8639024611882}), Tp(start = {472.8404479644676, 491.6130115007493, 502.15327499369164}), h(start = {463659.96875, 459024.375, 456412.24684658495, 454937.0, 438670.0625})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.767, z2 = 0, inertia = true, dW1(start = {3e6, 1.4e6, 740379}), h(start = {571589.625, 787918.9315405625, 901666.2028313989, 965906.7425802368, 982393.5625}), hb(start = {565108.5, 727745.440528479, 829820.124314816, 892414.570867187}), P(start = {3075398.0, 3099880.3604684034, 3123147.6507597235, 3145628.859295243, 3167631.5}), T0(start = {290.0, 290.0, 290.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurMP(steady_state = false, option_temperature = false, h0 = {777225.0, 887380.812, 946338.375}, T0 = fill(485.041, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-2572232.0, -1375385.125, -736132.5625}), Tp(start = {469.9423828125, 487.818603515625, 497.3634033203125}), Tp1(start = {469.4644470214844, 487.5630187988281, 497.22662353515625})), L = 20.726, Ns = 3, Dint = 26.6e-3, Ntubes = 246, Cws1(h_vol_2(start = 571212.5625), P(start = 3142462.75)), Cws2(h_vol_1(start = 946338.375)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 47.78), CSailettes = 7.16188651, p_rho = 1.12, Encras = Encras_EMP, St = 5, deltaT(start = {45, 24, 13}), T2(start = {516.3124389648438, 512.4675048876576, 510.41305969109146, 509.31475830078125}), T1(start = {514.3899686844887, 511.4402822893745, 509.8639024611882}), Tp(start = {470.3795471191406, 488.0523376464844, 497.488525390625}), h(start = {2786302, 2782058.75, 2779790, 2778575.75, 2761524})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.767, z2 = 0, inertia = true, dW1(start = {2572232.0, 1375385.125, 736132.5625}), h(start = {571212.5625, 777225.0, 887380.8125, 946338.375, 946338.375}), hb(start = {571212.5625, 777225.0, 887380.8125, 946338.375}), P(start = {3142462.75, 3167032.0, 3190375.75, 3212966.75, 3235124.75}), T0(start = {300.0, 300.0, 300.0}), Q(start = {12.485812, 12.485812, 12.485812, 12.485812}))) annotation( Placement(transformation(origin = {466, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP1(ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.3e6, -0.80263e6, -501864}), Tp(start = {562.8136365409941, 580.9270260501409, 592.9171328387902}), Tp1(start = {562.3574073875994, 580.630547779683, 592.7261966839885})), L = 20.726, Ns = 3, Dint = 32.8e-3, Ntubes = 123, Cws1(h_vol_2(start = 2798574.7604119307)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 22.09), CSailettes = 14.46509765, p_rho = 1.07, Encras = Encras_SMP1, St = 5, deltaT(start = {45, 30, 19}), T2(start = {606.41162109375, 604.5654891969185, 603.4004814494892, 602.6719360351563}), T1(start = {605.488555812354, 603.9829853232038, 603.0361997319833}), Tp(start = {563.2375161835078, 581.202482150127, 593.0945304216444}), h(start = {571470.875, 568995.125, 567386.2706202245, 566350.125, 541838.1875})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 0, z1 = 10.77, inertia = true, dW1(start = {1.3e6, 0.80263e6, 501864}), h(start = {2799923.0, 2907731.6344967457, 2977790.5961721865, 3022909.547827688, 3044385.0}), hb(start = {2798574.75, 2904836.50693844, 2969862.15109307, 3009575.30461156}), P(start = {2732797.5, 2731565.0172964707, 2730091.858748362, 2728450.5104684294, 2726700.0}), T0(start = {290.0, 290.0, 290.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP1(steady_state = false, option_temperature = false, h0 = {2900753.0, 2965210.75, 3005554.0}, T0 = fill(572.207, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1274475.75, -804807.1875, -503716.96875}), Tp(start = {558.1707153320312, 574.1082763671875, 584.3428344726562}), Tp1(start = {557.7833251953125, 573.8636474609375, 584.189697265625})), L = 20.726, Ns = 3, Dint = 32.8e-3, Ntubes = 123, Cws1(h_vol_2(start = 2798679.25)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 22.09), CSailettes = 14.46509765, p_rho = 1.07, Encras = Encras_SMP1, St = 5, deltaT(start = {45, 30, 19}), T2(start = {606.41162109375, 604.5654891969185, 603.4004814494892, 602.6719360351563}), T1(start = {605.488555812354, 603.9829853232038, 603.0361997319833}), Tp(start = {558.5307006835938, 574.3355712890625, 584.485107421875}), h(start = {2887398, 2885295.5, 2883968, 2883137, 2857523.25})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 0, z1 = 10.77, inertia = true, dW1(start = {1274475.75, 804807.1875, 503716.96875}), h(start = {2798679.25, 2900753.0, 2965210.75, 3005554.0, 3040476.25}), hb(start = {2798679.25, 2900753.0, 2965210.75, 3005554.0}), P(start = {2731369.25, 2730428.5, 2729299.75, 2728041.0, 2726700.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {612.407593, 588.981079, 580.601746}), Q(start = {12.485812, 12.485812, 12.485812, 12.485812}))) annotation( Placement(transformation(origin = {146, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(Ce1(h(start = 3046256.0341363903), h_vol_1(start = 3048424.856388378)), h(start = 3044384.9881097865), P(start = 2726000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(redeclare package Medium = Medium, Ce1(h(start = 3046204.25), h_vol_1(start = 3040476.25)), h(start = 3040476.25), P(start = 2726700.0), Cs1(h_vol_2(start = 3040476.25))) annotation( Placement(transformation(origin = {148, -110}, extent = {{-10, 10}, {10, -10}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP2(Ns = 3, L = 20.4, Dint = 39.3e-3, Ntubes = 369, ExchangerWall(e = 2.6e-3, lambda = 36.86, dW1(start = {-1.15e7, -7.9e6, -5.5e6}), Tp(start = {688.4468686536222, 714.033199611363, 732.1920347309398}), Tp1(start = {687.218391177629, 713.1710194015468, 731.5888814252561})), Cws1(P(start = 2575212.183613983), h_vol_2(start = 3040562.6721177064)), Cws2(P(start = 2558092.5174766793), h_vol_1(start = 3321940.994604838)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 92e-3, K(fixed = true, start = 45.22), CSailettes = 5.814209831, p_rho = 1.03, Encras = Encras_SMP2, St = 5, deltaT(start = {125, 86, 60}), T2(start = {822.6819458007813, 806.8523532375756, 795.852828640494, 788.2433471679688}), T1(start = {814.7671394415003, 801.3525909390348, 792.0480934116497}), Tp(start = {689.6013638823948, 714.8434569893178, 732.7588645078285}), h(start = {811915.375, 793532.125, 780630.3094320802, 771604.625, 755814.75})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {1.15e7, 7.9e6, 5.5e6}), h(start = {3044385.0, 3171130.1833912637, 3260083.5432993243, 3322312.4282463193, 3411468.25}), hb(start = {3040562.25, 3176242.27636476, 3267406.25678814, 3329559.35651389}), P(start = {2575212.25, 2571568.1301815873, 2567405.441864329, 2562877.7123048743, 2558092.5}), T0(start = {290.0, 290.0, 290.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP2(steady_state = false, option_temperature = false, h0 = {3170044.75, 3259807.75, 3321777.5}, T0 = fill(711.74, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 39.3e-3, Ntubes = 369, ExchangerWall(e = 2.6e-3, lambda = 36.86, dW1(start = {-11481016.0, -7953862.5, -5491113.5}), Tp(start = {689.0643310546875, 714.2538452148438, 731.902587890625}), Tp1(start = {687.7987060546875, 713.3770141601562, 731.2972412109375})), Cws1(P(start = 2575616.0), h_vol_2(start = 3040476.25)), Cws2(P(start = 2558251.25), h_vol_1(start = 3321777.5)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 92e-3, K(fixed = true, start = 45.22), CSailettes = 5.814209831, p_rho = 1.03, Encras = Encras_SMP2, St = 5, deltaT(start = {125, 86, 60}), T2(start = {822.6819458007813, 806.8523532375756, 795.852828640494, 788.2433471679688}), T1(start = {814.7671394415003, 801.3525909390348, 792.0480934116497}), Tp(start = {690.2537231445312, 715.0778198242188, 732.471435546875}), h(start = {3139851.75, 3120912.5, 3107791.75, 3098733.75, 3082589})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {11481016.0, 7953862.5, 5491113.5}), h(start = {3040476.25, 3170044.75, 3259807.75, 3321777.5, 3321777.5}), hb(start = {3040476.25, 3170044.75, 3259807.75, 3321777.5}), P(start = {2575616.0, 2571929.75, 2567706.0, 2563108.75, 2558251.25}), T0(start = {300.0, 300.0, 300.0}), hi(start = {821.471375, 831.789978, 841.549561}), Q(start = {88.609566, 88.609566, 88.609566, 88.609566}))) annotation( Placement(transformation(origin = {-114, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP3(Ns = 3, L = 20.4, Ntubes = 369, Dint = 45.6e-3, ExchangerWall(e = 2.6e-3, lambda = 27, dW1(start = {-8e6, -5.5e6, -3.8e6}), Tp(start = {784.9199768014527, 801.9559375893245, 813.881408346332}), Tp1(start = {783.8988186940742, 801.245223096765, 813.3876096599773})), Cws2(h_vol_1(start = 3517975.7051807973), h_vol_2(start = 3516632.5605054162)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, step_L = 92e-3, Dext = 50.8e-3, K(fixed = true, start = 43.23), CSailettes = 5.695842178, p_rho = 1.01, Encras = Encras_SMP3, St = 5, deltaT(start = {82, 56, 38}), T2(start = {874.3292236328125, 863.3655435931397, 855.822658205448, 850.646484375}), T1(start = {868.8473805170461, 859.5941008992938, 853.2345706986391}), Tp(start = {785.8874729590412, 802.6293039717932, 814.3492578675946}), h(start = {872700.1875, 859769.0, 850769.0241228014, 844515.9375, 830470.625})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {8e6, 5.5e6, 3.8e6}), h(start = {3322312.5, 3411468.261681972, 3473519.713324085, 3516632.5605054167, 3516632.5}), hb(start = {3321940.75, 3420707.89900972, 3482716.02631475, 3524890.37222916}), P(start = {2558092.5, 2555937.2008945565, 2553603.1383043886, 2551144.9258610248, 2548600.0}), T0(start = {290.0, 290.0, 290.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP3(steady_state = false, option_temperature = false, h0 = {3412658.5, 3475062.5, 3517830.25}, T0 = fill(801.1, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 369, Dint = 45.6e-3, ExchangerWall(e = 2.6e-3, lambda = 27, dW1(start = {-8052911.0, -5529594.5, -3789643.25}), Tp(start = {786.1732788085938, 802.8152465820312, 814.31103515625}), Tp1(start = {785.124267578125, 802.094970703125, 813.8173828125})), Cws2(h_vol_1(start = 3517830.25), h_vol_2(start = 3517830.25)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, step_L = 92e-3, Dext = 50.8e-3, K(fixed = true, start = 43.23), CSailettes = 5.695842178, p_rho = 1.01, Encras = Encras_SMP3, St = 5, deltaT(start = {82, 56, 38}), T2(start = {874.3292236328125, 863.3655435931397, 855.822658205448, 850.646484375}), T1(start = {868.8473805170461, 859.5941008992938, 853.2345706986391}), Tp(start = {787.1671752929688, 803.4977416992188, 814.77880859375}), h(start = {3202127.25, 3188843.25, 3179721.5, 3173470.25, 3158927})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {8052911.0, 5529594.5, 3789643.25}), h(start = {3321777.5, 3412658.5, 3475062.5, 3517830.25, 3517830.25}), hb(start = {3321777.5, 3412658.5, 3475062.5, 3517830.25}), P(start = {2558251.25, 2556062.0, 2553688.0, 2551187.75, 2548600.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {656.760193, 666.429688, 673.31543}), Q(start = {88.609566, 88.609566, 88.609566, 88.609566}))) annotation( Placement(transformation(origin = {-234, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(Vertical = false, P0 = 5e5, Vv(fixed = false), L = 8, hl(fixed = false, start = 571589.6558240334), hv(fixed = false, start = 2689372.23552223), R = 2, P(fixed = false, start = 555006.6148534557), zl(start = 1.75, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 570965.3592810449), Tp(start = 411.19945476835005)) annotation( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(redeclare package Medium = Medium, Vertical = false, P0 = 5e5, Vv(start = 58.244598, fixed = false), L = 8, hl(start = 556201.6875, fixed = false), hv(start = 2683834.25, fixed = false), R = 2, P(start = 512417.21875, fixed = false), zl(start = 1.75, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 528429.3125), Tp(start = 407.79571533203125), state_out_l(d(start = 933.0153198)), Cd(h_vol_1(start = 556201.6875)), Ce2(h_vol_1(start = 556201.6875)), Ce3(h_vol_1(start = 556201.6875))) annotation( Placement(transformation(extent = {{618, 10}, {578, 50}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_vanne_vapeurBP(k = 0.5) annotation( Placement(transformation(extent = {{666, 76}, {654, 86}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(p_rho = 3, Cvmax = CvmaxValveVBP, C2(P(start = 510158.3929231321), h_vol_1(start = 2684673.580149807)), h(start = 2685000), Cv(start = 1), Pm(start = 498000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(redeclare package Medium = Medium, p_rho = 3, Cvmax = CvmaxValveVBP, C2(P(start = 510105.625), h_vol_1(start = 2683834.25)), h(start = 2683834.25), Cv(start = 93443.7890625), Pm(start = 511261.4375)) annotation( Placement(transformation(extent = {{558, 46}, {538, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(Cvmax = 285, C1(h_vol_2(start = 509236.1596958067)), h(fixed = false, start = 509000), Cv(start = 142.5), Pm(fixed = false, start = 1021309.6581195585)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(redeclare package Medium = Medium, Cvmax = 285, C1(h_vol_2(start = 513770.84375)), h(fixed = false, start = 509000), Cv(start = 142.5), Pm(start = 982596.875, fixed = false)) annotation( Placement(transformation(extent = {{650, 44}, {630, 64}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(z2 = 0, z1 = 10.767, Q(start = 50, fixed = false), K = 32766, rho(start = 929.9117790585748), Pm(start = 564000), h(start = 549249.519022482)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(redeclare package Medium = Medium, z2 = 0, z1 = 10.767, Q(start = 50, fixed = false), K = 32766, rho(start = 933.0189819335938), Pm(start = 533961.8125), h(start = 556201.6875)) annotation( Placement(transformation(origin = {610, -90}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(h(start = 571589.6558240334), V = 5, P(start = 564000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(redeclare package Medium = Medium, h(start = 556201.6875), V = 5, P(start = 539494.25), Ce2(h_vol_1(start = 556201.6875)), Ce3(h_vol_1(start = 556201.6875))) annotation( Placement(transformation(extent = {{592, -100}, {572, -80}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurBP(Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.24e7, -8.5e6, -5.8e6}), Tp(start = {432.59535605574797, 431.6255977090002, 430.8591280369125}), Tp1(start = {432.16242526836834, 431.3108320909342, 430.62996395048594})), L = 20.726, Ntubes = 984, Ns = 3, ExchangerFlueGasesMetal(Dext = 38e-3, step_T = 86.9e-3, Fa = 1, step_L = 138e-3, K(fixed = true, start = 30.62), CSailettes = 11.07985, p_rho = 1.14, Encras = Encras_EvBP, St = 5, deltaT(start = {45, 31, 21}), T2(start = {482.5950622558594, 464.01748118772224, 451.30051770870455, 442.58880615234375}), T1(start = {473.3062751775807, 457.6589994482134, 446.94466391603106}), Tp(start = {432.9975893355074, 431.918044468841, 431.07204294951407}), h(start = {425784.40625, 406989.71875, 393324.9053433096, 383376.28125, 345485.03125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, continuous_flow_reversal = true, inertia = true, dW1(start = {1.24e7, 8.5e6, 5.8e6}), h(start = {571589.625, 800925.2190091099, 967665.3813576263, 1089060.0143937408, 571589.625}), hb(start = {550075.0, 765243.011613326, 912673.256542569, 1013555.73710231}), Q(start = {49.68034838099436, 49.68034838099436, 49.68034838099436, 49.68034838099436}), P(start = {582186.75, 557630.6861652867, 556428.158876046, 555687.7128874982, 555006.625}), T0(start = {290.0, 290.0, 290.0})), Cfg2(h_vol_1(start = 383376.2777938952), h_vol_2(start = 345485.01719053386))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurBP(steady_state = false, option_temperature = false, h0 = {799038.938, 964745.875, 1078052.375}, T0 = fill(428.658, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-12117996.0, -8269060.0, -5654191.5}), Tp(start = {429.7086181640625, 428.56280517578125, 427.70245361328125}), Tp1(start = {429.2481689453125, 428.24859619140625, 427.48760986328125})), L = 20.726, Ntubes = 984, Ns = 3, ExchangerFlueGasesMetal(Dext = 38e-3, step_T = 86.9e-3, Fa = 1, step_L = 138e-3, K(fixed = true, start = 30.62), CSailettes = 11.07985, p_rho = 1.14, Encras = Encras_EvBP, St = 5, deltaT(start = {45, 31, 21}), T2(start = {482.5950622558594, 464.01748118772224, 451.30051770870455, 442.58880615234375}), T1(start = {473.3062751775807, 457.6589994482134, 446.94466391603106}), Tp(start = {430.1364440917969, 428.854736328125, 427.9020690917969}), h(start = {2749310.5, 2729320.5, 2715680, 2706352.75, 2665392.25})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, continuous_flow_reversal = true, inertia = true, dW1(start = {12117996.0, 8269060.0, 5654191.5}), h(start = {556201.6875, 799038.9375, 964745.875, 1078052.375, 556201.6875}), hb(start = {556201.6875, 799038.9375, 964745.875, 1078052.375}), Q(start = {49.90171432495117, 49.90171432495117, 49.90171432495117, 49.90171432495117}), P(start = {539494.25, 514856.03125, 513786.09375, 513081.78125, 512417.21875}), T0(start = {300.0, 300.0, 300.0}), hi(start = {5481.984863, 5281.962402, 5290.007812})), Cfg2(h_vol_1(start = 2706352.75), h_vol_2(start = 2665392.25))) annotation( Placement(transformation(origin = {566, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_ballonBP(k = 1) annotation( Placement(transformation(extent = {{742, 6}, {728, 18}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(Cvmax = 308.931, C1(h_vol_2(start = 550072.7232069891)), h(start = 550000), Cv(start = 308.931), Pm(start = 473826.9860082782)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(redeclare package Medium = Medium, Cvmax = 308.931, C1(h_vol_2(start = 556201.6875)), h(start = 556201.6875), Cv(start = 308.9309997558594), Pm(start = 430516.15625)) annotation( Placement(transformation(extent = {{710, -14}, {730, 6}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurBP(Ns = 3, L = 20.726, Dint = 39.3e-3, Ntubes = 123, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.1e6, -782901, -559798}), Tp(start = {483.5879234710947, 510.03490701889103, 529.1506909427684}), Tp1(start = {483.29897049125907, 509.8288453180465, 529.0044963209424})), Cws1(h_vol_2(start = 2684673.580149807)), Cws2(h_vol_1(start = 2914519.282601244), h_vol_2(start = 2935965.8606590154)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 222.1e-3, K(fixed = true, start = 30.46), CSailettes = 3.25763059984175, p_rho = 1.09, Encras = Encras_SBP, St = 5, deltaT(start = {92, 66, 47}), T2(start = {568.8102416992188, 567.2151210721856, 566.0683353396659, 565.2481689453125}), T1(start = {568.0126670066404, 566.6417282059258, 565.6582502265244}), Tp(start = {483.8594749183778, 510.2285591249387, 529.2880813277524}), h(start = {526862.0625, 524994.875, 523663.2975499146, 522718.59375, 505329.59375})), TwoPhaseFlowPipe(advection = false, z2 = 0, rugosrel = 1e-5, z1 = 10.767, inertia = true, dW1(start = {1.1e6, 782901, 559798}), h(start = {2689372.25, 2800496.5790294725, 2879742.9368326054, 2935965.8606590154, 2935965.75}), hb(start = {2684673.5, 2819292.38908571, 2893584.12921908, 2943776.05560762}), P(start = {510158.40625, 508396.8288525169, 506425.5320020969, 504223.40958995325, 501850.0}), T0(start = {290.0, 290.0, 290.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurBP(steady_state = false, option_temperature = false, h0 = {2789058.5, 2864136.25, 2917424.75}, T0 = fill(499.111, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 39.3e-3, Ntubes = 123, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1077319.25, -768670.0625, -545585.3125}), Tp(start = {476.5025939941406, 501.4080810546875, 519.423583984375}), Tp1(start = {476.2275695800781, 501.21185302734375, 519.2843017578125})), Cws1(h_vol_2(start = 2683834.25)), Cws2(h_vol_1(start = 2917424.75), h_vol_2(start = 2917424.75)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 222.1e-3, K(fixed = true, start = 30.46), CSailettes = 3.25763059984175, p_rho = 1.09, Encras = Encras_SBP, St = 5, deltaT(start = {92, 66, 47}), T2(start = {568.8102416992188, 567.2151210721856, 566.0683353396659, 565.2481689453125}), T1(start = {568.0126670066404, 566.6417282059258, 565.6582502265244}), Tp(start = {476.76104736328125, 501.5924987792969, 519.554443359375}), h(start = {2844961.5, 2843184.25, 2841916.25, 2841016.25, 2824857.5})), TwoPhaseFlowPipe(advection = false, z2 = 0, rugosrel = 1e-5, z1 = 10.767, inertia = true, dW1(start = {1077319.25, 768670.0625, 545585.3125}), h(start = {2683834.25, 2789058.5, 2864136.25, 2917424.75, 2917424.75}), hb(start = {2683834.25, 2789058.5, 2864136.25, 2917424.75}), P(start = {510105.625, 508332.65625, 506373.03125, 504193.3125, 501850.0}), T0(start = {300.0, 300.0, 300.0}), Q(start = {10.238324, 10.238324, 10.238324, 10.238324}))) annotation( Placement(transformation(origin = {266, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0 = 1.013e5, C(h_vol_1(start = 329093.3007791504))) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(redeclare package Medium = Medium_FlueGases, P0 = 1.013e5, C(h_vol_1(start = 2654311.25)), X(start = {0.7536821216, 0.1121331751, 0.07254632562, 0.06163837761, 0})) annotation( Placement(transformation(origin = {722, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurBP(Ns = 3, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-2.45e7, -5.5e6, -1.17e6}), Tp(start = {396.2481159869425, 399.78388129181906, 401.13111161783405}), Tp1(start = {395.99874013762894, 399.70202906319594, 401.105084136553})), Ntubes = 3444, L = 20.726, Cws1(h_vol_2(start = 194584.50261459063)), Cws2(h_vol_1(start = 509236.15969580685)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 92e-3, K(fixed = true, start = 31.53), CSailettes = 11.673758598919, p_rho = 1.15, Encras = Encras_EBP, St = 5, deltaT(start = {23.5, 5.3, 1.1}), T2(start = {442.58880615234375, 405.54898708865323, 397.2418326138536, 395.4642028808594}), T1(start = {424.0688986060054, 401.3954098512534, 396.353024695102}), Tp(start = {396.4798095231228, 399.8599296836186, 401.15529358730896}), h(start = {383376.28125, 345485.03125, 333048.03047244134, 329093.3125, 206282.203125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, inertia = true, dW1(start = {2.45e7, 5.5e6, 1.17e6}), h(start = {194692.265625, 428815.5293291671, 505661.4245378703, 530096.9852149182, 571589.625}), hb(start = {194584.515625, 462556.370989432, 494648.45288738, 501287.069880104}), P(start = {1588738.375, 1562590.7775307859, 1537310.419233922, 1512399.026918416, 1487612.75}), T0(start = {290.0, 290.0, 290.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurBP(steady_state = false, option_temperature = false, h0 = {445813.0, 501821.062, 513770.844}, T0 = fill(398.305, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-24830472.0, -5536280.5, -1181209.875}), Tp(start = {401.4523620605469, 397.1709289550781, 396.2907409667969}), Tp1(start = {401.18280029296875, 397.1108093261719, 396.2779235839844})), Ntubes = 3444, L = 20.726, Cws1(h_vol_2(start = 194614.1875)), Cws2(h_vol_1(start = 513770.84375)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 92e-3, K(fixed = true, start = 31.53), CSailettes = 11.673758598919, p_rho = 1.15, Encras = Encras_EBP, St = 5, deltaT(start = {23.5, 5.3, 1.1}), T2(start = {442.58880615234375, 405.54898708865323, 397.2418326138536, 395.4642028808594}), T1(start = {424.0688986060054, 401.3954098512534, 396.353024695102}), Tp(start = {401.70281982421875, 397.2267761230469, 396.30267333984375}), h(start = {2706352.75, 2665392.25, 2656259.75, 2654311.25, 2654311.25})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, inertia = true, dW1(start = {24830472.0, 5536280.5, 1181209.875}), h(start = {194614.1875, 445813.0, 501821.0625, 513770.84375, 513770.84375}), hb(start = {194614.1875, 445813.0, 501821.0625, 513770.84375}), P(start = {1553925.0, 1527777.625, 1502576.125, 1477646.0, 1452776.625}), T0(start = {300.0, 300.0, 300.0}), hi(start = {461.386383, 487.565826, 492.916229}), Q(start = {98.847893, 98.847893, 98.847893, 98.847893}))) annotation( Placement(transformation(origin = {680, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(W_fric = 1, eta_stato = 1, eta_is(start = 0.88057), Qmax = 140, eta_is_nom = 0.88057, eta_is_min = 0.75, Cst(start = 8182844.56002535) = CstHP, pros(d(start = 10.64336641432295)), Hrs(start = 3048424.856388379), Pe(fixed = true, start = 12431000), Ps(fixed = false, start = 2726700)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.8805699944496155), Qmax = 140, eta_is_nom = 0.88057, eta_is_min = 0.75, Cst(start = 8182844.56002535) = CstHP, rhos(start = 10.664762496948242), Hrs(start = 3046204.25), Pe(fixed = true, start = 12431000), Ps(fixed = false, start = 2726700)) annotation( Placement(transformation(extent = {{-2, -250}, {38, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(W_fric = 1, eta_stato = 1, eta_is(start = 0.9625), Qmax = 150, eta_is_nom = 0.9625, eta_is_min = 0.75, Cst(start = 256335.364995961) = CstMP, pros(d(start = 1.884386603984167)), Hrs(start = 3028846.077881056), Pe(fixed = true, start = 2548500), Ps(fixed = false, start = 476800)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9624999761581421), Qmax = 150, eta_is_nom = 0.9625, eta_is_min = 0.75, Cst(start = 256335.364995961) = CstMP, rhos(start = 1.8829431533813477), Hrs(start = 3029680.75), Pe(fixed = true, start = 2548500), Ps(fixed = false, start = 476800)) annotation( Placement(transformation(extent = {{318, -250}, {358, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(h(start = 3019203.192090637), P(start = 476799.99999954), Ce1(h(start = 3029780))) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(redeclare package Medium = Medium, h(start = 3018053.5), P(start = 476800.0), Ce1(h(start = 3029680.75)), Ce2(Q(start = 20.476648)), Ce3(h_vol_1(start = 3018053.5))) annotation( Placement(transformation(origin = {418, -230}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(W_fric = 1, eta_stato = 1, eta_is(start = 0.9538), Qmax = 150, eta_is_nom = 0.9538, eta_is_min = 0.75, Cst(start = 11944.9445735985) = CstBP, Cs(h(start = 2401954.6559323)), Hrs(start = 2401030), Pe(fixed = true, start = 476799.99999954), Ps(start = 10053)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9538000226020813), Qmax = 150, eta_is_nom = 0.9538, eta_is_min = 0.75, Cst(start = 11944.9445735985) = CstBP, Cs(h(start = 2401340.5)), Hrs(start = 2401340.5), Pe(fixed = true, start = 476799.99999954), Ps(start = 10052.8291015625)) annotation( Placement(transformation(extent = {{576, -250}, {616, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {-292, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {-232, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(alpha = 0.5, Ce(h(start = 3046260)), P(start = 2726700)) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(redeclare package Medium = Medium, alpha = 0.5, Ce(h(start = 3046204.25)), P(start = 2726700.0)) annotation( Placement(transformation(extent = {{114, -180}, {134, -160}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(D = 0.018, V = 1000, A = 100, lambda = 0.01, ntubes = 28700, continuous_flow_reversal = true, Vf0 = 0.15, steady_state = false, yNiveau(signal(start = 1.5)), Cse(h(start = 128076)), P(fixed = false, start = 6136), Pfond(start = 10000.0), Cl(h(start = 191812.29519356362), Q(start = 196.22097932320875), h_vol_2(start = 194692.2720118419)), proe(d(start = 996.0237398943773))) annotation( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, D = 0.018, V = 1000, A = 100, lambda = 0.01, ntubes = 28700, continuous_flow_reversal = true, Vf0 = 0.15, steady_state = false, yNiveau(signal(start = 1.5)), Cse(h(start = 128035.9921875), h_vol_1(start = 70825.89844)), P(start = 10000.0, fixed = false), Pfond(start = 10000.0), Cl(h(start = 191812.296875), Q(start = 197.69578552246094), h_vol_2(start = 191812.296875)), rhom(start = 996.0200805664062), hv(start = 2583886.75), Vv(start = 850.0), state_d(d(start = 989.8436279)), Cee(P(start = 146447.2031), h(start = 113380), h_vol_2(start = 113380))) annotation( Placement(transformation(extent = {{637, -384}, {717, -304}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(h0 = 113.38e3, Q0 = 29804.5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(redeclare package Medium = Medium, h0 = 113.38e3, Q0 = 29804.5) annotation( Placement(transformation(extent = {{572, -377}, {620, -329}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur(redeclare package Medium = Medium, C(h_vol_1(start = 70825.89844))) annotation( Placement(transformation(extent = {{736, -374}, {780, -330}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(K = 1e-4, h(start = 2400000), C1(h_vol_2(start = 2400000), h(start = 2400000)), Pm(start = 10026.029972250988)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(redeclare package Medium = Medium, K = 1e-4, h(start = 2401340.5), C1(h_vol_2(start = 2401340.5), h(start = 2401340.5)), Pm(start = 10026.4140625)) annotation( Placement(transformation(extent = {{640, -240}, {660, -220}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(Ce3(h(start = 194584.50261452305)), h(start = 194692.2720118418), P(start = 1540500)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(redeclare package Medium = Medium, Ce3(h(start = 194614.1875)), h(start = 194614.1875), P(start = 1553925.0), Ce1(h_vol_1(start = 194614.1875)), Ce2(h_vol_1(start = 194614.1875))) annotation( Placement(transformation(origin = {902, -318}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(K = 1e-4, rho(start = 990.3728941875843), Pm(start = 1540000)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(redeclare package Medium = Medium, K = 1e-4, rho(start = 990.3626098632812), Pm(start = 1553925.0)) annotation( Placement(transformation(origin = {902, -270}, extent = {{12, -12}, {-12, 12}}, rotation = 270))); - ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(h(start = 571589.6558240333), P(start = 322430)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(redeclare package Medium = Medium, h(start = 556201.6875), P(start = 348615.09375), Ce2(h_vol_1(start = 556201.6875)), Cs1(h(start = 556201.6875)), Cs2(h(start = 556201.6875))) annotation( Placement(transformation(extent = {{742, -20}, {762, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(a3 = 350, b1(fixed = true) = -3.7751, a1 = -244551, Q(fixed = false), C1(h_vol_2(start = 550072.7232069891)), C2(h_vol_1(start = 565106.2802015315)), Qv(start = 0.014981930996429617), rho(start = 929.199477777818), Pm(start = 1725850)) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(redeclare package Medium = Medium, a3 = 350, b1(fixed = true) = -3.7751, a1 = -244551, Q(fixed = false), C1(h_vol_2(start = 556201.6875), P(start = 348615.0938)), C2(h_vol_1(start = 571212.5625), P(start = 3147558.25)), Qv(start = 0.013392460532486439), rho(start = 932.3015747070312), Pm(start = 1748086.625), h(start = 563707.125)) annotation( Placement(transformation(extent = {{804, -20}, {824, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(a3 = 1600, a1 = -28056.2, b1 = -12.7952660447433, Q(fixed = false), C1(h_vol_2(start = 550072.7232069891)), C2(h_vol_1(start = 618649.6677733721)), Qv(start = 0.079840086308535), rho(start = 926.8951785877663), Pm(start = 6851620.819939703)) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(redeclare package Medium = Medium, a3 = 1600, a1 = -28056.2, b1 = -12.7952660447433, Q(fixed = false), C1(h_vol_2(start = 556201.6875), P(start = 348615.0938)), C2(h_vol_1(start = 624690.125), P(start = 13229581)), Qv(start = 0.08183819055557251), rho(start = 930.1739501953125), Pm(start = 6789098.0), h(start = 590445.875)) annotation( Placement(transformation(extent = {{804, -60}, {824, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(alpha = 0.5, h(start = 194585), P(start = 1540500), Cs(h(start = 194585))) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(redeclare package Medium = Medium, alpha = 0.5, h(start = 194614.1875), P(start = 1553925.0), Cs(h(start = 194614.1875))) annotation( Placement(transformation(extent = {{872, -328}, {886, -308}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {268, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(z2 = 0, z1 = 0, K = K_PerteChargeZero2, h(start = 3000000), C1(h_vol_2(start = 3000000), h(start = 3000000), P(fixed = true, start = 501850)), Pm(start = 490000)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(redeclare package Medium = Medium, z2 = 0, z1 = 0, K = K_PerteChargeZero2, h(start = 2917424.75), C1(h_vol_2(start = 2917424.75), h(start = 2917424.75), P(fixed = true, start = 501850)), Pm(start = 489325.0), rho(start = 2.155861378)) annotation( Placement(transformation(origin = {344, -278}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(K = 1e-4, Pm(start = 392647.35686859826)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(redeclare package Medium = Medium, K = 1e-4, Pm(start = 348615.09375)) annotation( Placement(transformation(origin = {780, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(K = 1e-4, Pm(start = 392647.3571526791)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(redeclare package Medium = Medium, K = 1e-4, Pm(start = 348615.09375)) annotation( Placement(transformation(origin = {780, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur annotation( Placement(transformation(extent = {{402, -448}, {522, -348}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(K = 1e-4, C1(h_vol_2(start = 191812.29519356362)), C2(h_vol_1(start = 191812.29519356362)), rho(start = 989.7481065917054), Pm(start = 6200)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(redeclare package Medium = Medium, K = 1e-4, C1(h_vol_2(start = 191812.296875)), C2(h_vol_1(start = 191812.296875), P(start = 9999.996094)), rho(start = 989.83837890625), Pm(start = 9999.998046875)) annotation( Placement(transformation(extent = {{702, -446}, {722, -426}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(Qv(start = 0.19818087844720814), a3 = 400, a1(fixed = true) = -6000, Q(start = 194.502, fixed = false), C2(h_vol_1(start = 194584.50261452305)), Pm(start = 807872.6942171099)) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(redeclare package Medium = Medium, Qv(start = 0.1996714472770691), a3 = 400, a1(fixed = true) = -6000, Q(start = 194.502, fixed = false), C2(h_vol_1(start = 194614.1875), P(start = 1571189)), Pm(start = 790594.5), h(start = 193213.2344)) annotation( Placement(transformation(extent = {{742, -446}, {762, -426}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(K = 1e-4, rho(start = 990.3728941888568), C1(h_vol_2(start = 194584.50261452305), h(start = 194585)), Pm(start = 1546000)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(redeclare package Medium = Medium, K = 1e-4, rho(start = 990.3626098632812), C1(h_vol_2(start = 194614.1875), h(start = 194614.1875), P(start = 1553925)), Pm(start = 1553925.0)) annotation( Placement(transformation(extent = {{840, -446}, {860, -426}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(Cvmax = 2000, h(start = 194500), Cv(start = 2000), Pm(start = 1597241.885640957)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(redeclare package Medium = Medium, Cvmax = 2000, h(start = 194614.1875), Cv(start = 2000.0), Pm(start = 1562557.0)) annotation( Placement(transformation(extent = {{802, -440}, {822, -420}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol_2(start = 2674000), h(start = 2674000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(redeclare package Medium = Medium, C1(h_vol_2(start = 2664771.25), h(start = 2664771.25))) annotation( Placement(transformation(origin = {-58, 8}, extent = {{-6, 6}, {6, -6}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol_1(start = 1398000), h(start = 1398000))) " " annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(redeclare package Medium = Medium, C2(h_vol_1(start = 1398733.0), h(start = 1398733.0))) " " annotation( Placement(transformation(origin = {91.5, 32}, extent = {{6, -6.5}, {-6, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol_1(start = 944000), h(start = 944000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(redeclare package Medium = Medium, C2(h_vol_1(start = 946338.375), h(start = 946338.375))) annotation( Placement(transformation(extent = {{424, 49}, {409, 63}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol_2(start = 2798000), h(start = 2798000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(redeclare package Medium = Medium, C1(h_vol_2(start = 2798679.25), h(start = 2798679.25))) annotation( Placement(transformation(origin = {236, 56}, extent = {{-8, 8}, {8, -8}}, rotation = 180))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol_1(start = 2685000), h(start = 2685000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(redeclare package Medium = Medium, C2(h_vol_1(start = 2683834.25), h(start = 2683834.25))) annotation( Placement(transformation(origin = {514, 56}, extent = {{-8, 8}, {8, -8}}, rotation = 180))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol_1(start = 550000), h(start = 550000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(redeclare package Medium = Medium, C2(h_vol_1(start = 513770.84375), h(start = 513770.84375))) annotation( Placement(transformation(origin = {663.5, 34}, extent = {{6, -6.5}, {-6, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol_1(start = 550000), h(start = 550000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(redeclare package Medium = Medium, C2(h_vol_1(start = 556201.6875), h(start = 556201.6875))) annotation( Placement(transformation(extent = {{687, -11}, {700, 1}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol_1(start = 194585), h(start = 194585))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 191812.296875), h(start = 191812.296875))) annotation( Placement(transformation(origin = {685.5, -412}, extent = {{-10, -6.5}, {10, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol_1(start = 2401000), h(start = 2401000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 2583886.75), h(start = 2401340.5))) annotation( Placement(transformation(origin = {684.5, -264}, extent = {{-10, -6.5}, {10, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(K = Kin_SMP2, Pm(start = 2651000), C1(P(fixed = true, start = 2726700), h_vol_2(start = 3046000), h(start = 3046000))) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(redeclare package Medium = Medium, K = Kin_SMP2, Pm(start = 2651158.0), C1(P(fixed = true, start = 2726700), h_vol_2(start = 3040476.25), h(start = 3040476.25))) annotation( Placement(transformation(extent = {{114, -120}, {94, -100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(C1(P(fixed = true, start = 12680999.9999969)), Cvmax = Cvmax_THP, h(fixed = false, start = 3433000), Cv(start = 10875), Pm(fixed = false, start = 12550000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(redeclare package Medium = Medium, C1(P(fixed = true, start = 12680999.9999969)), Cvmax = Cvmax_THP, h(fixed = false, start = 3433000), Cv(start = 10876.2412109375), Pm(fixed = false, start = 12550000), deltaP(start = 250000)) annotation( Placement(transformation(extent = {{-124, -234}, {-104, -214}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauEauHP(k = 1.05) annotation( Placement(transformation(extent = {{-158, 113}, {-124, 131}}, rotation = 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), add(k1 = -1, k2 = +1), Ti = 500) annotation( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), add(k1 = -1, k2 = +1), Ti = 500) annotation( Placement(transformation(extent = {{-40, 106}, {-20, 126}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauEauMP(k = 1.05) annotation( Placement(transformation(extent = {{173, 113}, {207, 131}}, rotation = 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), add(k1 = -1, k2 = +1), Ti = 500) annotation( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), add(k1 = -1, k2 = +1), Ti = 500) annotation( Placement(transformation(extent = {{262, 106}, {282, 126}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauEauBP(k = 1.75) annotation( Placement(transformation(extent = {{470, 126}, {504, 144}}, rotation = 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(add(k1 = -1, k2 = +1), pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), Ti = 10) annotation( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(add(k1 = -1, k2 = +1), pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), Ti = 10) annotation( Placement(transformation(extent = {{568, 108}, {588, 128}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauCondenseur1(k = 1.5) annotation( Placement(transformation(extent = {{716, -246}, {740, -230}}, rotation = 0))); - ThermoSysPro.Examples.Control.Condenser_LevelControl regulation_Niveau_Condenseur(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), add(k1 = +1, k2 = -1), edge(uL(signal(start = true)))) annotation( + ThermoSysPro.Examples.Control.Condenser_LevelControl regulation_Niveau_Condenseur(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), add(k1 = +1, k2 = -1), edge(uL(signal(start = true)))) annotation( Placement(transformation(extent = {{758, -282}, {778, -262}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps ConstantVanneTurbineHP(Table = [0, 0.8; 10, 0.8; 600, 0.8; 650, 0.8; 3000, 0.8; 3100, 0.8]) annotation( Placement(transformation(extent = {{-208, -216}, {-138, -142}}, rotation = 0))); @@ -203,23 +205,23 @@ model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 10 Placement(transformation(extent = {{945, -96}, {907, -64}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(Initialvalue = 1400, Finalvalue = 1000, Duration = 1000, Starttime = 200000) annotation( Placement(transformation(extent = {{945, -458}, {907, -426}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(V = 1, h0 = 988332, h(start = 880080.2817637667), dynamic_mass_balance = true, P0 = 7010000, P(start = 13222388.265425779)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(redeclare package Medium = Medium, V = 1, h0 = 988332, h(start = 857742.5), dynamic_mass_balance = true, P0 = 7010000, P(start = 13132658.0), Ce2(h_vol_1(start = 857742.5)), Ce3(h_vol_1(start = 857742.5))) annotation( Placement(transformation(extent = {{456, -98}, {436, -78}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(V = 1, h0 = 983786, h(start = 1017356.6143159299), dynamic_mass_balance = true, P0 = 7000000, P(start = 13311571.308698103)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(redeclare package Medium = Medium, V = 1, h0 = 983786, h(start = 988178.3125), dynamic_mass_balance = true, P0 = 7000000, P(start = 13222570.0), Ce2(h_vol_1(start = 988178.3125)), Ce3(h_vol_1(start = 988178.3125))) annotation( Placement(transformation(extent = {{252, -20}, {232, 0}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(Cvmax = 308.931, h(start = 618600), Cv(start = 308.931), Pm(start = 13219564.708897255)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(redeclare package Medium = Medium, Cvmax = 308.931, h(start = 624690.125), Cv(start = 247.14480590820312), Pm(start = 13133975.0)) annotation( Placement(transformation(extent = {{754, -98}, {730, -122}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(Cvmax = 308.931, h(start = 565000), Cv(start = 308.931), Pm(start = 3078586.376751058)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(redeclare package Medium = Medium, Cvmax = 308.931, h(start = 571212.5625), Cv(start = 247.14480590820312), Pm(start = 3145010.5)) annotation( Placement(transformation(extent = {{804, -138}, {780, -162}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(Initialvalue = 0.8, Finalvalue = 0.01, Duration = 1000, Starttime = 200000) annotation( Placement(transformation(extent = {{946, -150}, {908, -118}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(Initialvalue = 0.8, Finalvalue = 0.01, Duration = 1000, Starttime = 200000) annotation( Placement(transformation(extent = {{946, -194}, {908, -162}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(h0 = 3e6, h(start = 3436197.0248581353), dynamic_mass_balance = true, P0 = 12700000, P(start = 12700000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(redeclare package Medium = Medium, h0 = 3e6, h(start = 3433201.75), dynamic_mass_balance = true, P0 = 12700000, P(start = 12431000.0), Cs1(h_vol_2(start = 3433201.75)), Cs2(h_vol_2(start = 3433201.75))) annotation( Placement(transformation(origin = {-52, -230}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(h0 = 3523910, h(start = 3516632.5605054167), dynamic_mass_balance = true, P0 = 2400000, P(start = 2400000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(redeclare package Medium = Medium, h0 = 3523910, h(start = 3517830.25), dynamic_mass_balance = true, P0 = 2400000, P(start = 2548500.0), Ce2(h_vol_1(start = 3517830.25)), Ce3(h_vol_1(start = 3517830.25))) annotation( Placement(transformation(origin = {-50, -314}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(C1(P(fixed = true, start = 25.486e5)), Cvmax = Cvmax_TMP, h(fixed = false, start = 3518000), Cv(start = 3.312e6), Pm(fixed = false, start = 2547000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(redeclare package Medium = Medium, C1(P(fixed = true, start = 25.486e5)), Cvmax = Cvmax_TMP, h(fixed = false, start = 3518000), Cv(start = 3313994.0), Pm(fixed = false, start = 2547000), deltaP(start = 100)) annotation( Placement(transformation(extent = {{-124, -318}, {-104, -298}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps ConstantVanneTurbineMP(Table = [0, 0.8; 10, 0.8; 600, 0.8; 2000, 0.8; 3000, 0.8; 3100, 0.8]) annotation( Placement(transformation(extent = {{-208, -300}, {-138, -226}}, rotation = 0))); @@ -233,13 +235,13 @@ model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 10 Placement(transformation(extent = {{-18, -448}, {2, -428}}, rotation = 0))); ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceCombustible(Hum = 0, Xo = 0, Xn = 0, Xs = 0, rho = 0.838, Q0 = 13.4368286133, T0 = 185 + 273.16, Xc = 0.755, Xh = 0.245, Cp = 2255, LHV = 46989e3) annotation( Placement(transformation(extent = {{-421, 24}, {-385, 60}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceEau(Q0 = 0.0) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceEau(redeclare package Medium = Medium, Q0 = 0.0) annotation( Placement(transformation(extent = {{-473, 27}, {-445, 57}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante Humidite(k = 0.93) annotation( Placement(transformation(extent = {{-539, 23}, {-518, 43}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceFumees(Xso2 = 0, Xco2 = 0, Xh2o = 0, Xo2 = 0.20994, Q0 = 600, T0 = 29.4 + 273.16, P0 = 1.013e5, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceFumees(redeclare package Medium = Medium_FlueGases, X0 = {0.79006, 0.20994, 0, 0, 0}, option_temperature = true, Q0 = 600, T0 = 29.4 + 273.16, P0 = 1.013e5) annotation( Placement(transformation(extent = {{-539, -74}, {-495, -28}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.GasTurbine GasTurbine(comp_tau_n = 14.0178, comp_eff_n = 0.87004, exp_tau_n = 0.06458, exp_eff_n = 0.89045, TurbQred = 0.0175634, Kcham = 2.02088, chambreCombustionTAC(Pea(fixed = false, start = 14.0e5), Psf(start = 1334276.752202393), Tsf(start = 1494.4009297392777), Hrfg(start = 188188.8402613545), Tea(start = 681.5380510358129)), Wpth = 1e6, Compresseur(is_eff(fixed = false, start = 0.88), Xtau(fixed = false, start = 1.00), Ps(start = 1420538.874033405), Ts(start = 681.538051035813), Tis(start = 634.0826153738103), Te(start = 304.3515709150396)), TurbineAgaz(Ps(fixed = false), is_eff(fixed = false, start = 0.87), Pe(fixed = false, start = 1333900), Te(start = 1493.59), Ts(fixed = false, start = 893.16), Tis(start = 815.7265261633758)), xAIR(rho_air(start = 1.0865538789495581), ppvap0(start = 4235.17632590997), rho_vap(start = 0.030206053717024672))) annotation( + ThermoSysPro.Fluid.Machines.GasTurbine GasTurbine(redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, comp_tau_n = 14.0178, comp_eff_n = 0.87004, exp_tau_n = 0.06458, exp_eff_n = 0.89045, TurbQred = 0.0175634, Kcham = 2.02088, chambreCombustionTAC(Pea(fixed = false, start = 14.0e5), Psf(start = 1333895.5), Tsf(start = 1493.547119140625), Hrfg(start = 181479.640625), Tea(start = 678.0772094726562)), Wpth = 1e6, Compresseur(is_eff(fixed = false, start = 0.88), Xtau(fixed = false, start = 1.00), Ps(start = 1419887.5), Ts(start = 678.0772094726562), Tis(start = 630.7854614257812), Te(start = 302.55999755859375)), TurbineAgaz(Ps(fixed = false), is_eff(fixed = false, start = 0.87), Pe(fixed = false, start = 1333900), Te(start = 1493.547119140625), Ts(fixed = false, start = 893.16), Tis(start = 814.7440795898438)), xAIR(rho_air(start = 1.0994528532028198), ppvap0(start = 3817.616455), rho_vap(start = 0.02738765999674797), C2(Xi(start = {0.7708577346, 0.2048374414, 0.02430482395, 0, 0})), pro(h(start = 2554653.25)))) annotation( Placement(transformation(extent = {{-471, -115}, {-341, 13}}, rotation = 0))); InstrumentationAndControl.Blocks.Sources.Rampe rampeQfuel(Starttime = 200, Duration = 800, Initialvalue = 13.507, Finalvalue = 8.756) annotation( Placement(transformation(extent = {{-539, 64}, {-519, 84}}, rotation = 0))); From b5073cf2d74162a98dc3dc02212c676d072d3736 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 19 Nov 2026 11:32:48 +0100 Subject: [PATCH 207/213] Remove component region parameter in 4 components and an example which was using it --- .../Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo | 4 ++-- ThermoSysPro/Fluid/Junctions/SteamDryer.mo | 5 +---- ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo | 5 +---- ThermoSysPro/Fluid/PressureLosses/ControlValve.mo | 3 --- ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo | 4 ---- 5 files changed, 4 insertions(+), 17 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo index 83cd1cb5..8641c9d9 100644 --- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo +++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo @@ -52,9 +52,9 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan Placement(transformation(extent = {{84, -91}, {64, -71}}, rotation = 0))); ThermoSysPro.Fluid.Volumes.VolumeC Ballon(redeclare package Medium = Medium, V = 1, h0 = 3e5, h(start = 1125640.0), P0 = 7000000, dynamic_mass_balance = true, P(start = 7000000)) annotation( Placement(transformation(extent = {{-63, -91}, {-83, -71}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(redeclare package Medium = Medium, Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(redeclare package Medium = Medium, Cvmax(fixed = true) = 300, C2(P(fixed = false, start = 70e5)), Pm(start = 7000060.0)) annotation( Placement(transformation(origin = {-30, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(redeclare package Medium = Medium, Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(redeclare package Medium = Medium, Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0)) annotation( Placement(transformation(origin = {-212, -75}, extent = {{-10, 10}, {10, -10}}, rotation = 180))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(redeclare package Medium = Medium, option_temperature = false, h0 = 63.03e3, P0(fixed = false) = 500000, Q(fixed = true, start = 14.9263)) annotation( Placement(transformation(extent = {{66, -49}, {94, -22}}, rotation = 0))); diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo index 35a9999b..4dad6d6d 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo @@ -3,7 +3,6 @@ within ThermoSysPro.Fluid.Junctions; model SteamDryer "Steam dryer" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); @@ -12,12 +11,10 @@ model SteamDryer "Steam dryer" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; Medium.C_BiPhase C_e "Trace partition of the inlet mixture"; Real xsv "Vapor mass fraction at the vapor outlet"; @@ -125,7 +122,7 @@ equation Csl.diff_on_1 = diffusion; /* Fluid thermodynamic properties */ - state_e=Medium.setState_phX(p=Cev.P, h=Cev.h, X=Cev.Xi, region=mode_e); + state_e=Medium.setState_phX(p=Cev.P, h=Cev.h, X=Cev.Xi); rho = state_e.d; /* Vapor mass fraction at the inlet */ diff --git a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo index c6e6bdba..928073fa 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo @@ -5,7 +5,6 @@ model SteamExtractionSplitter "Splitter for steam extraction" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter Real alpha = 1 "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)"; @@ -13,12 +12,10 @@ model SteamExtractionSplitter "Splitter for steam extraction" "true: continuous flow reversal - false: discontinuous flow reversal"; parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - parameter IF97Region region_e=IF97Region.All_regions "IF97 region at the inlet (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected parameter Units.SI.MassFlowRate gamma0=1.e-4 "Pseudo-diffusion conductance use for continuous flow reversal (active if diffusion=false and continuous_flow_reversal = true)"; - parameter Integer mode_e=Integer(region_e) - 1 "IF97 region at the inlet. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; Medium.C_BiPhase C_e "Trace partition of the inlet mixture"; public @@ -117,7 +114,7 @@ equation Cex.diff_on_1 = diffusion; /* Fluid thermodynamic properties at the inlet */ - state_e=Medium.setState_phX(p=P, h=Ce.h, X=Ce.Xi, region=mode_e); + state_e=Medium.setState_phX(p=P, h=Ce.h, X=Ce.Xi); xe = Medium.vapourQuality(state_e); /* Vapor mass fraction at the extraction outlet */ diff --git a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo index d7925da4..7326b6e7 100644 --- a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo @@ -2,7 +2,6 @@ within ThermoSysPro.Fluid.PressureLosses; model ControlValve "Control valve" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; parameter ThermoSysPro.Units.xSI.Cv Cvmax=8005.42 "Maximum CV (active if mode_caract=0)"; @@ -18,10 +17,8 @@ extends ThermoSysPro.Fluid.Interfaces.IconColors; "Diffusion conductance (active if diffusion=true in neighbouring volumes)"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); protected - parameter Integer mode=Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; parameter Real eps=1.e-3 "Small number for pressure loss equation"; parameter Units.SI.Density rho_15=999 "density of the water at 15.5556 °C"; diff --git a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo index f8c78285..9311e85b 100644 --- a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo +++ b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo @@ -1,7 +1,6 @@ within ThermoSysPro.Fluid.PressureLosses; model ThreeWayValve "Three way valve" extends ThermoSysPro.Fluid.Interfaces.IconColors; - import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); @@ -28,7 +27,6 @@ model ThreeWayValve "Three way valve" "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; parameter Units.SI.Density p_rho=0 "If > 0, fixed fluid density" annotation (Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); - parameter IF97Region region=IF97Region.All_regions "IF97 region (active for IF97 water/steam only)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); parameter Boolean dynamic_composition_balance=false "true: dynamic fluid composition balance equation
    false: static fluid composition balance equation" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties")); @@ -53,7 +51,6 @@ model ThreeWayValve "Three way valve" caract=caract1, mode_caract=mode_caract1, p_rho=p_rho, - region=region, gamma_diff=gamma_diff) annotation (Placement(transformation( origin={-6,-50}, @@ -67,7 +64,6 @@ model ThreeWayValve "Three way valve" caract=caract2, mode_caract=mode_caract2, p_rho=p_rho, - region=region, gamma_diff=gamma_diff) annotation (Placement(transformation(extent={{40,-4},{60,16}}, rotation=0))); From 091954527758245a410cad17b81fa0ed44f69218 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 19 Nov 2026 11:39:05 +0100 Subject: [PATCH 208/213] CombinedCycle_TripTAC fluid ok with Dymola --- .../CombinedCycle_TripTAC.mo | 221 +++++++++--------- 1 file changed, 114 insertions(+), 107 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo index 5fb08a99..578b084d 100644 --- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo +++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo @@ -1,199 +1,202 @@ within ThermoSysPro.Fluid.Examples.CombinedCyclePowerPlant; model CombinedCycle_TripTAC "CCPP model to simulate a load variation from 100% to 50%" - parameter Real CstHP(fixed = false, start = 7921079.316566086) "Stodola's ellipse coefficient HP"; - parameter Real CstMP(fixed = false, start = 251309.80339850043) "Stodola's ellipse coefficient MP"; - parameter Real CstBP(fixed = false, start = 10675.291494903773) "Stodola's ellipse coefficient BP"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam "Water/steam medium"; + package Medium_Liquid = ThermoSysPro.Properties.Media.WaterSteam(Region=1) "Water/steam forced in IF97 region 1 (liquid), as mode = 1 in the WaterSteam example"; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases "Flue gases medium"; + parameter Real CstHP(fixed = false, start = 7919515.5) "Stodola's ellipse coefficient HP"; + parameter Real CstMP(fixed = false, start = 251048.328125) "Stodola's ellipse coefficient MP"; + parameter Real CstBP(fixed = false, start = 10720.13671875) "Stodola's ellipse coefficient BP"; parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAHP(fixed = false, start = 135) "Maximum CV: alim. valve HP Drum "; parameter ThermoSysPro.Units.xSI.Cv CvmaxValveAMP(fixed = false, start = 70) "Maximum CV: alim. valve MP Drum "; parameter ThermoSysPro.Units.xSI.Cv CvmaxValveVBP(fixed = false, start = 32000) "Maximum CV: steam valve BP Drum "; - parameter Real Encras_SHP1(fixed = false, start = 1) "Sur HP1: heat exchange fouling coefficient"; - parameter Real Encras_SHP2(fixed = false, start = 1) "Sur HP2: heat exchange fouling coefficient"; - parameter Real Encras_SHP3(fixed = false, start = 1) "Sur HP3: heat exchange fouling coefficient"; - parameter Real Encras_EHP1(fixed = false, start = 1) "Eco HP1: heat exchange fouling coefficient"; - parameter Real Encras_EHP2(fixed = false, start = 1) "Eco HP2: heat exchange fouling coefficient"; - parameter Real Encras_EHP3(fixed = false, start = 1) "Eco HP3: heat exchange fouling coefficient"; - parameter Real Encras_EHP4(fixed = false, start = 1) "Eco HP4: heat exchange fouling coefficient"; - parameter Real Encras_SMP1(fixed = false, start = 1) "Sur MP1: heat exchange fouling coefficient"; - parameter Real Encras_SMP2(fixed = false, start = 1) "Sur MP2: heat exchange fouling coefficient"; - parameter Real Encras_SMP3(fixed = false, start = 1) "Sur MP3: heat exchange fouling coefficient"; - parameter Real Encras_EMP(fixed = false, start = 1) "Eco MP: heat exchange fouling coefficient"; - parameter Real Encras_EvHP(fixed = false, start = 1) "Evapo HP: heat exchange fouling coefficient"; - parameter Real Encras_EvMP(fixed = false, start = 1) "Evapo MP: heat exchange fouling coefficient"; - parameter Real Encras_EvBP(fixed = false, start = 1) "Evapo BP: heat exchange fouling coefficient"; - parameter Real Encras_SBP(fixed = false, start = 1) "Sur BP: heat exchange fouling coefficient"; - parameter Real Encras_EBP(fixed = false, start = 1) "Eco BP: heat exchange fouling coefficient"; - parameter Real KgainChargeHP(fixed = false, start = 720.183) "HP: Friction pressure loss coefficient"; - parameter Real KgainChargeMP(fixed = false, start = 1090.9) "MP: Friction pressure loss coefficient"; - parameter Real Kin_SMP2(fixed = false, start = 10.) "SMPin: Friction pressure loss coefficient"; - parameter Real K_PerteChargeZero2(fixed = false, start = 1e-4) "TurbineMP out: Friction pressure loss coefficient"; + parameter Real Encras_SHP1(fixed = false, start = 0.01957859) "Sur HP1: heat exchange fouling coefficient"; + parameter Real Encras_SHP2(fixed = false, start = 0.04982952) "Sur HP2: heat exchange fouling coefficient"; + parameter Real Encras_SHP3(fixed = false, start = 0.06859577) "Sur HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP1(fixed = false, start = 0.07054558) "Eco HP1: heat exchange fouling coefficient"; + parameter Real Encras_EHP2(fixed = false, start = 0.11222337) "Eco HP2: heat exchange fouling coefficient"; + parameter Real Encras_EHP3(fixed = false, start = 0.05893945) "Eco HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP4(fixed = false, start = 0.02870633) "Eco HP4: heat exchange fouling coefficient"; + parameter Real Encras_SMP1(fixed = false, start = 0.03562902) "Sur MP1: heat exchange fouling coefficient"; + parameter Real Encras_SMP2(fixed = false, start = 0.06448392) "Sur MP2: heat exchange fouling coefficient"; + parameter Real Encras_SMP3(fixed = false, start = 0.05672803) "Sur MP3: heat exchange fouling coefficient"; + parameter Real Encras_EMP(fixed = false, start = 0.08256767) "Eco MP: heat exchange fouling coefficient"; + parameter Real Encras_EvHP(fixed = false, start = 0.02220394) "Evapo HP: heat exchange fouling coefficient"; + parameter Real Encras_EvMP(fixed = false, start = 0.05100306) "Evapo MP: heat exchange fouling coefficient"; + parameter Real Encras_EvBP(fixed = false, start = 0.05495019) "Evapo BP: heat exchange fouling coefficient"; + parameter Real Encras_SBP(fixed = false, start = 0.04966641) "Sur BP: heat exchange fouling coefficient"; + parameter Real Encras_EBP(fixed = false, start = 0.0586358) "Eco BP: heat exchange fouling coefficient"; + parameter Real KgainChargeHP(fixed = false, start = 1395.875) "HP: Friction pressure loss coefficient"; + parameter Real KgainChargeMP(fixed = false, start = 2111.61694336) "MP: Friction pressure loss coefficient"; + parameter Real Kin_SMP2(fixed = false, start = 201.48884583) "SMPin: Friction pressure loss coefficient"; + parameter Real K_PerteChargeZero2(fixed = false, start = 144.01260376) "TurbineMP out: Friction pressure loss coefficient"; parameter ThermoSysPro.Units.xSI.Cv Cvmax_THP(fixed = false, start = 8000) "Maximum CV input Turbine HP "; parameter ThermoSysPro.Units.xSI.Cv Cvmax_TMP(fixed = false, start = 1500) "Maximum CV input Turbine MP "; - ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(L = 16.27, Vertical = false, hl(fixed = false, start = 1460508.128907675), hv(fixed = false, start = 2664791.3052738607), Vv(fixed = false), R = 1.05, xmv(fixed = false), zl(start = 1.05, fixed = true), Mp = 5000, Kpa = 5, Kvl = 1000, P(fixed = false, start = 12726424.235625941), Pfond(start = 12733333.038455429), Tp(start = 589.5151351323206)) annotation( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(redeclare package Medium = Medium, L = 16.27, Vertical = false, hl(start = 1460690.625, fixed = false), hv(start = 2664802.75, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, xmv(fixed = false), zl(start = 1.05, fixed = true), Mp = 5000, Kpa = 5, Kvl = 1000, P(start = 12726434.0, fixed = false), Pfond(start = 12733342.0), Tp(start = 589.5374755859375), Cd(h_vol_1(start = 1460690.625)), Ce2(h_vol_1(start = 1460690.625)), Ce3(h_vol_1(start = 1460690.625)), Cs(h_vol_2(start = 1460690.625)), state_out_l(d(start = 670.8724976))) annotation( Placement(transformation(extent = {{5, 10}, {-35, 50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(Cvmax = CvmaxValveAHP, C1(P(start = 13394232.807871036), h_vol_2(start = 1399087.0448386343)), h(start = 1398000), Cv(start = 178), Pm(start = 13050700)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(redeclare package Medium = Medium, Cvmax = CvmaxValveAHP, C1(P(start = 13398096.0), h_vol_2(start = 1399475.5)), h(start = 1399475.5), Cv(start = 174.68450927734375), Pm(start = 13062265.0)) annotation( Placement(transformation(extent = {{45, 46}, {25, 66}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_vanne_vapeurHP(k = 0.5) annotation( Placement(transformation(extent = {{-51, 70}, {-61, 78}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(Cvmax = 47829.4, C2(h_vol_1(start = 2664791.3052738607)), h(start = 2674000), Cv(start = 23914.7), Pm(start = 12724920.902023433)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2664802.75)), h(start = 2664802.75), Cv(start = 23914.69921875), Pm(start = 12724930.0)) annotation( Placement(transformation(extent = {{-55, 46}, {-75, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(z2 = 0, Q(start = 150, fixed = true), z1 = 10.83, K = KgainChargeHP, C2(P(start = 12757776.366696326)), h(start = 1474422.14552527), Pm(start = 12704000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(redeclare package Medium = Medium_Liquid, z2 = 0, Q(start = 150, fixed = true), z1 = 10.83, K = KgainChargeHP, C2(P(start = 12757782.0)), h(start = 1460690.625), Pm(start = 12745562.0)) annotation( Placement(transformation(origin = {-5, -90}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(V = 5, h(start = 1460508.128907675), P(start = 12704000), ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.WaterSteam) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(redeclare package Medium = Medium_Liquid, V = 5, h(start = 1460690.625), P(start = 12757782.0), Ce2(h_vol_1(start = 1460690.625)), Ce3(h_vol_1(start = 1460690.625))) annotation( Placement(transformation(extent = {{-25, -100}, {-45, -80}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurHP(Dint = 32.8e-3, Ntubes = 1476, L = 20.7, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-5.74e7, -2.67e7, -1.24e7}), Tp(start = {607.95945081921, 605.4313602675011, 604.0450760348469}), Tp1(start = {606.5065615724875, 604.7563153894058, 603.7327223072098})), Ns = 3, ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.092, step_T = 0.0869, St = 1, Fa = 1, K(fixed = true, start = 37.69), CSailettes = 11.86442072, p_rho = 1.05, Encras = Encras_EvHP, deltaT(start = {106, 49, 23}), T2(start = {755.2099609375, 674.1281000784297, 635.8939469832528, 618.0787353515625}), T1(start = {714.669037024263, 655.0110235308413, 626.9863546635906}), Tp(start = {609.3093210980612, 606.0585402262541, 604.3352819224443})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 10.83, option_temperature = false, continuous_flow_reversal = true, inertia = true, dW1(start = {5.74e7, 2.67e7, 1.24e7}), h(start = {1460508.125, 1842386.3805685563, 2019815.5675635953, 2101914.802366878, 1460508.125}), hb(start = {1459929.875, 1760591.32331318, 1893494.15765019, 1954976.19646134}), P(start = {12757776.0, 12739926.315661393, 12734300.718607338, 12730145.067304946, 12726424.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurHP(steady_state = false, option_temperature = false, h0 = {1842497.375, 2019893.75, 2101978.0}, T0 = fill(605.812, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, Ntubes = 1476, L = 20.7, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-57271024.0, -26609444.0, -12312660.0}), Tp(start = {607.958740234375, 605.4310302734375, 604.044921875}), Tp1(start = {606.506103515625, 604.756103515625, 603.7326049804688})), Ns = 3, ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.092, step_T = 0.0869, St = 1, Fa = 1, K(fixed = true, start = 37.69), CSailettes = 11.86442072, p_rho = 1.05, Encras = Encras_EvHP, deltaT(start = {106, 49, 23}), h(start = {3057821.75, 2963461.75, 2919619.75, 2899333.25, 2893620}), T2(start = {755.2099609375, 674.1281000784297, 635.8939469832528, 618.0787353515625}), T1(start = {714.669037024263, 655.0110235308413, 626.9863546635906}), Tp(start = {609.308349609375, 606.0580444335938, 604.3350830078125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 10.83, option_temperature = false, continuous_flow_reversal = true, inertia = true, dW1(start = {57271024.0, 26609444.0, 12312660.0}), h(start = {1460690.625, 1842497.375, 2019893.75, 2101978.0, 1460690.625}), hb(start = {1460690.625, 1842497.375, 2019893.75, 2101978.0}), P(start = {12757782.0, 12739934.0, 12734309.0, 12730154.0, 12726434.0}), hi(start = {13411.995117, 10775.180664, 8658.856445}), Q(start = {150.0, 150.0, 150.0, 150.0}), state1(h(start = {1842497.375, 2019893.75, 2101978}))), Cfg1(h_vol_1(start = 3057821.75), h_vol_2(start = 2963461.75)), Cfg2(h_vol_1(start = 2899333.25), h_vol_2(start = 2893620))) annotation( Placement(transformation(origin = {-47, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP4(Ns = 3, L = 20.726, Dint = 0.0266, Ntubes = 246, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-3.5e6, -2.63e6, -2e6}), Tp(start = {577.1652678885227, 582.2393934514894, 585.9616914189281}), Tp1(start = {576.5195841307088, 581.753378536046, 585.5943808718256})), Cws1(P(start = 13320777.811415095), h_vol_2(start = 1292777.0058783418)), Cws2(h_vol_1(start = 1399087.0448386343)), ExchangerFlueGasesMetal(Dext = 0.0318, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 11.39069779, K(fixed = true, start = 47.53), p_rho = 1.06, Encras = Encras_EHP4, deltaT(start = {38, 29, 22}), T2(start = {618.0787353515625, 613.037602447671, 609.2389186305828, 606.3656616210938}), T1(start = {615.5581823957998, 611.1382605391269, 607.8022941316214}), Tp(start = {577.7558398657263, 582.6839249827347, 586.2976504908789})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, z2 = 0, option_temperature = false, inertia = true, dW1(start = {3.5e6, 2.63e6, 2e6}), h(start = {1292777.0, 1338569.0293807227, 1373037.3060893763, 1399087.0448386343, 1399087.0}), hb(start = {1291418.875, 1336078.18827954, 1370718.78680301, 1396865.59043578}), P(start = {13320778.0, 13339750.403131645, 13358253.29250947, 13376387.23615858, 13394233.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP4(steady_state = false, option_temperature = false, h0 = {1339086.5, 1373480.25, 1399475.5}, T0 = fill(581.861, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 0.0266, Ntubes = 246, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-3467507.0, -2610240.0, -1972859.0}), Tp(start = {577.249755859375, 582.3107299804688, 586.023681640625}), Tp1(start = {576.6054077148438, 581.82568359375, 585.6571044921875})), Cws1(P(start = 13324661.0), h_vol_2(start = 1293397.125)), Cws2(h_vol_1(start = 1399475.5)), ExchangerFlueGasesMetal(Dext = 0.0318, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 11.39069779, K(fixed = true, start = 47.53), p_rho = 1.06, Encras = Encras_EHP4, deltaT(start = {38, 29, 22}), h(start = {2899333.25, 2893620, 2889319.5, 2886069, 2883965.75}), T2(start = {618.0787353515625, 613.037602447671, 609.2389186305828, 606.3656616210938}), T1(start = {615.5581823957998, 611.1382605391269, 607.8022941316214}), Tp(start = {577.8390502929688, 582.7543334960938, 586.3590087890625})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, z2 = 0, option_temperature = false, inertia = true, dW1(start = {3467507.0, 2610240.0, 1972859.0}), h(start = {1293397.125, 1339086.5, 1373480.25, 1399475.5, 1399475.5}), hb(start = {1293397.125, 1339086.5, 1373480.25, 1399475.5}), P(start = {13324661.0, 13343628.0, 13362125.0, 13380254.0, 13398096.0}), hi(start = {6902.874512, 6981.29834, 7046.654297}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {1339086.5, 1373480.25, 1399475.5}))), Cfg2(h_vol_1(start = 2886069), h_vol_2(start = 2883965.75))) annotation( Placement(transformation(origin = {53, -50}, extent = {{20, 20}, {-20, -20}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP1(Ns = 3, L = 20.4, Dint = 0.0324, Ntubes = 246, ExchangerWall(e = 0.0028, lambda = 37.61, dW1(start = {-9.8e6, -7.7e6, -5.9e6}), Tp(start = {641.7766266045941, 659.2542181292313, 674.5323393956571}), Tp1(start = {639.7295258289556, 657.6427819154001, 673.2854985024741})), Cws1(h_vol_2(start = 2664791.3052738607)), Cws2(P(start = 12720084.224503415), h_vol_1(start = 2973079.185217006)), ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 10.25056, K(fixed = true, start = 34.71), p_rho = 1.04, Encras = Encras_SHP1, deltaT(start = {138, 108, 84}), T2(start = {787.8693237304688, 774.2709985521502, 763.5355376271307, 755.2099609375}), T1(start = {781.0701669240514, 768.9032680896405, 759.3727557986135}), Tp(start = {643.6669592742874, 660.7422496694279, 675.683696525852})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, option_temperature = false, inertia = true, dW1(start = {9.8e6, 7.7e6, 5.9e6}), h(start = {2664791.25, 2793445.279188231, 2894719.078252342, 2973079.185217006, 2973079.25}), hb(start = {2664757.0, 2808108.09290342, 2916825.81170239, 2998229.34382983}), P(start = {12723418.0, 12723372.064267773, 12722706.076957166, 12721569.805902744, 12720084.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP1(steady_state = false, option_temperature = false, h0 = {2793422.5, 2894672.25, 2973015.75}, T0 = fill(658.506, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 0.0324, Ntubes = 246, ExchangerWall(e = 0.0028, lambda = 37.61, dW1(start = {-9761341.0, -7684141.0, -5945731.5}), Tp(start = {641.7667236328125, 659.2384033203125, 674.5120849609375}), Tp1(start = {639.7199096679688, 657.627197265625, 673.265380859375})), Cws1(h_vol_2(start = 2664802.75)), Cws2(P(start = 12720091.0), h_vol_1(start = 2973015.75)), ExchangerFlueGasesMetal(Dext = 0.038, step_L = 0.111, step_T = 0.0869, St = 1, Fa = 1, CSailettes = 10.25056, K(fixed = true, start = 34.71), p_rho = 1.04, Encras = Encras_SHP1, deltaT(start = {138, 108, 84}), h(start = {3096361.5, 3080278.5, 3067618, 3057821.75, 2963461.75}), T2(start = {787.8693237304688, 774.2709985521502, 763.5355376271307, 755.2099609375}), T1(start = {781.0701669240514, 768.9032680896405, 759.3727557986135}), Tp(start = {643.65673828125, 660.7262573242188, 675.663330078125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, option_temperature = false, inertia = true, dW1(start = {9761341.0, 7684141.0, 5945731.5}), h(start = {2664802.75, 2793422.5, 2894672.25, 2973015.75, 2973015.75}), hb(start = {2664802.75, 2793422.5, 2894672.25, 2973015.75}), P(start = {12723426.0, 12723380.0, 12722714.0, 12721577.0, 12720091.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {2793422.5, 2894672.25, 2973015.75}))), Cfg1(h_vol_1(start = 3096361.5), h_vol_2(start = 3080278.5))) annotation( Placement(transformation(origin = {-87, -50}, extent = {{-20, 20}, {20, -20}}, rotation = 270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP3(Dint = 26.6e-3, Ntubes = 1476, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.6e7, -5.6e6, -2.1e6}), Tp(start = {557.1357570088924, 563.7223638401374, 566.037182893163}), Tp1(start = {556.657781456147, 563.5505466405001, 565.9750435970707})), L = 20.726, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 12.451, K(fixed = true, start = 36.0300000000857), p_rho = 1.08, Encras = Encras_EHP3, St = 5, deltaT(start = {34, 12, 4.4}), T2(start = {602.606689453125, 580.0827929934445, 571.956039969206, 569.0130004882813}), T1(start = {591.3447334381658, 576.0194164813253, 570.4845269121585}), Tp(start = {557.5729353703138, 563.879515730797, 566.0940183432008})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {1.6e7, 5.6e6, 2.1e6}), h(start = {989834.8125, 1193223.55215195, 1266335.416732016, 1292777.0058783418, 1292777.0}), hb(start = {986348.9375, 1189594.8774342, 1263384.6284551, 1290000.70037855}), P(start = {13239006.0, 13261089.90163249, 13281516.713631846, 13301273.845180616, 13320778.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP3(steady_state = false, option_temperature = false, h0 = {1194111.25, 1267023.125, 1293397.125}, T0 = fill(562.423, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ntubes = 1476, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-15390955.0, -5533500.5, -2001599.0}), Tp(start = {557.2764282226562, 563.8421630859375, 566.1499633789062}), Tp1(start = {556.7998046875, 563.6707763671875, 566.0880126953125})), L = 20.726, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 12.451, K(fixed = true, start = 36.0300000000857), p_rho = 1.08, Encras = Encras_EHP3, St = 5, deltaT(start = {34, 12, 4.4}), h(start = {2881802.25, 2856444, 2847326.75, 2844029, 2842288.5}), T2(start = {602.606689453125, 580.0827929934445, 571.956039969206, 569.0130004882813}), T1(start = {591.3447334381658, 576.0194164813253, 570.4845269121585}), Tp(start = {557.71240234375, 563.9989013671875, 566.2066650390625})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {15390955.0, 5533500.5, 2001599.0}), h(start = {991313.25, 1194111.25, 1267023.125, 1293397.125, 1293397.125}), hb(start = {991313.25, 1194111.25, 1267023.125, 1293397.125}), P(start = {13242920.0, 13264994.0, 13285413.0, 13305163.0, 13324661.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {1194111.25, 1267023.125, 1293397.125})), state2(h(start = {991313.25, 1194111.25, 1267023.125, 1293397.125}))), Cfg1(h_vol_1(start = 2881802.25), h_vol_2(start = 2856444)), Cfg2(h_vol_1(start = 2844029), h_vol_2(start = 2842288.5))) annotation( Placement(transformation(origin = {173, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP2(Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-5e6, -3e6, -2.e6}), Tp(start = {492.5265031447411, 499.7298617398276, 504.2372403374727}), Tp1(start = {492.3269425182926, 499.6044056390882, 504.15828372038055})), L = 20.767, Ntubes = 1107, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_T = 86.9e-3, Fa = 1, step_L = 111e-3, CSailettes = 2.76134577, K(fixed = true, start = 65.5300000000393), p_rho = 1.11, Encras = Encras_EHP2, St = 5, deltaT(start = {36, 23, 14}), T2(start = {531.2528686523438, 524.0786479337396, 519.5624877991071, 516.7178344726563}), T1(start = {527.6657680129605, 521.8205678664233, 518.1401706426662}), Tp(start = {492.70903044592376, 499.8446096432236, 504.3094576805689})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {5e6, 3e6, 2.e6}), h(start = {860655.375, 924469.2991480937, 964586.6772085332, 989834.8113335292, 989834.8125}), hb(start = {854494.5625, 915007.018247822, 957243.396653824, 983786.364226731}), P(start = {13149154.0, 13172140.227906534, 13194684.103908138, 13216938.318123804, 13239006.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP2(steady_state = false, option_temperature = false, h0 = {926522.188, 966285.25, 991313.25}, T0 = fill(499.187, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-5e6, -3e6, -2.e6}), Tp(start = {492.93975830078125, 500.0770263671875, 504.5434875488281}), Tp1(start = {492.7419738769531, 499.9526672363281, 504.4652099609375})), L = 20.767, Ntubes = 1107, ExchangerFlueGasesMetal(Dext = 31.8e-3, step_T = 86.9e-3, Fa = 1, step_L = 111e-3, CSailettes = 2.76134577, K(fixed = true, start = 65.5300000000393), p_rho = 1.11, Encras = Encras_EHP2, St = 5, deltaT(start = {36, 23, 14}), h(start = {2801776.5, 2793868.25, 2788896.25, 2785766.75, 2781592.5}), T2(start = {531.2528686523438, 524.0786479337396, 519.5624877991071, 516.7178344726563}), T1(start = {527.6657680129605, 521.8205678664233, 518.1401706426662}), Tp(start = {493.12066650390625, 500.1907653808594, 504.6151123046875})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {5e6, 3e6, 2.e6}), h(start = {863278.8125, 926522.1875, 966285.25, 991313.25, 991313.25}), hb(start = {863278.8125, 926522.1875, 966285.25, 991313.25}), P(start = {13153124.0, 13176093.0, 13198622.0, 13220864.0, 13242920.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {926522.1875, 966285.25, 991313.25}))), Cfg1(h_vol_1(start = 2801776.5), h_vol_2(start = 2793868.25)), Cfg2(h_vol_1(start = 2785766.75), h_vol_2(start = 2781592.5))) annotation( Placement(transformation(origin = {373, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP1(Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9.9999e6, -5e6, -2.4e6}), Tp(start = {461.83700038875077, 471.4458881656956, 476.1007075853514}), Tp1(start = {461.41562496249884, 471.24253667400546, 476.002824325766})), L = 20.726, Ntubes = 1107, Cws1(h_vol_2(start = 630040.8772883223)), ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 8.30057632, K(fixed = true, start = 40.24), p_rho = 1.13, Encras = Encras_EHP1, St = 5, deltaT(start = {41, 20, 10}), T2(start = {509.81195068359375, 494.60709242744036, 487.25141439639447, 483.7066345214844}), T1(start = {502.2095163065458, 490.92925341191744, 485.4790272730564}), Tp(start = {462.22240967868714, 471.63188276609173, 476.1902361036878})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, z1 = 10.767, inertia = true, dW1(start = {9.9999e6, 5e6, 2.4e6}), h(start = {630040.875, 764519.0167009356, 829416.7979796123, 860655.3510811749, 860655.375}), hb(start = {618651.9375, 752176.893518976, 816707.727773953, 847728.424287614}), advection = true, dynamic_mass_balance = true, P(start = {13054959.0, 13079363.233486831, 13102973.863543343, 13126167.933420062, 13149154.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP1(steady_state = false, option_temperature = false, h0 = {768078.438, 832342.438, 863278.812}, T0 = fill(470.423, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-10106326.0, -4877192.0, -2347854.75}), Tp(start = {462.5415954589844, 472.0587463378906, 476.6681213378906}), Tp1(start = {462.1242980957031, 471.85736083984375, 476.5711975097656})), L = 20.726, Ntubes = 1107, Cws1(h_vol_2(start = 634913.0)), ExchangerFlueGasesMetal(Dext = 31.8e-3, step_L = 74e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 8.30057632, K(fixed = true, start = 40.24), p_rho = 1.13, Encras = Encras_EHP1, St = 5, deltaT(start = {41, 20, 10}), h(start = {2778157.75, 2761506.5, 2753470.75, 2749602.5, 2730474.25}), T2(start = {509.81195068359375, 494.60709242744036, 487.25141439639447, 483.7066345214844}), T1(start = {502.2095163065458, 490.92925341191744, 485.4790272730564}), Tp(start = {462.9233093261719, 472.2429504394531, 476.7568054199219})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, z1 = 10.767, inertia = true, dW1(start = {10106326.0, 4877192.0, 2347854.75}), h(start = {634913.0, 768078.4375, 832342.4375, 863278.8125, 863278.8125}), hb(start = {634913.0, 768078.4375, 832342.4375, 863278.8125}), advection = true, dynamic_mass_balance = true, P(start = {13059016.0, 13083393.0, 13106981.0, 13130156.0, 13153124.0}), hi(start = {1705.988037, 1760.190674, 1784.338379}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {768078.4375, 832342.4375, 863278.8125}))), Cfg1(h_vol_1(start = 2778157.75), h_vol_2(start = 2761506.5)), Cfg2(h_vol_1(start = 2749602.5), h_vol_2(start = 2730474.25))) annotation( Placement(transformation(origin = {493, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP2(Ns = 3, L = 20.4, Dint = 32e-3, Ntubes = 246, ExchangerWall(e = 3e-3, lambda = 27, dW1(start = {-8.8e6, -6.6e6, -4.9e6}), Tp(start = {718.0595138013858, 738.8988421059552, 755.1216906441867}), Tp1(start = {715.284148781996, 736.8146275114044, 753.568899547355})), Cws2(P(start = 12710803.048741188), h_vol_1(start = 3240679.101987554)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 34.74), CSailettes = 10.2505424803872, p_rho = 1.02, Encras = Encras_SHP2, St = 5, deltaT(start = {124, 93, 70}), T2(start = {850.2295532226563, 838.165359685431, 829.0838172755421, 822.3056030273438}), T1(start = {844.1974477839519, 833.6245884804865, 825.6946997760892}), Tp(start = {720.6064978764006, 740.8115495674804, 756.5467047118})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.83, inertia = true, dW1(start = {8.8e6, 6.6e6, 4.9e6}), h(start = {2973079.25, 3088900.225778996, 3175878.2994419048, 3240679.101987554, 3240679.0}), hb(start = {2973076.25, 3118965.9792171, 3205920.08101435, 3268474.17308722}), P(start = {12720084.0, 12718408.787041187, 12716215.067117244, 12713645.694467228, 12710803.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP2(steady_state = false, option_temperature = false, h0 = {3088828.0, 3175801.75, 3240601.0}, T0 = fill(737.334, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 32e-3, Ntubes = 246, ExchangerWall(e = 3e-3, lambda = 27, dW1(start = {-8789339.0, -6600706.0, -4917819.0}), Tp(start = {718.035400390625, 738.872802734375, 755.0946655273438}), Tp1(start = {715.2599487304688, 736.7884521484375, 753.541748046875})), Cws2(P(start = 12710808.0), h_vol_1(start = 3240601.0)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 34.74), CSailettes = 10.2505424803872, p_rho = 1.02, Encras = Encras_SHP2, St = 5, deltaT(start = {124, 93, 70}), h(start = {3170799.5, 3156318.25, 3145442.75, 3137340.25, 3118458.25}), T2(start = {850.2295532226563, 838.165359685431, 829.0838172755421, 822.3056030273438}), T1(start = {844.1974477839519, 833.6245884804865, 825.6946997760892}), Tp(start = {720.58251953125, 740.78564453125, 756.5198364257812})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.83, inertia = true, dW1(start = {8789339.0, 6600706.0, 4917819.0}), h(start = {2973015.75, 3088828.0, 3175801.75, 3240601.0, 3240601.0}), hb(start = {2973015.75, 3088828.0, 3175801.75, 3240601.0}), P(start = {12720091.0, 12718416.0, 12716221.0, 12713652.0, 12710808.0}), hi(start = {1972.852539, 1881.643066, 1837.180298}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {3088828, 3175801.75, 3240601})), state2(h(start = {2973015.75, 3088828, 3175801.75, 3240601}))), Cfg1(h_vol_1(start = 3170799.5), h_vol_2(start = 3156318.25)), Cfg2(h_vol_1(start = 3137340.25), h_vol_2(start = 3118458.25))) annotation( Placement(transformation(origin = {-207, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP3(Ns = 3, L = 20.4, Ntubes = 246, ExchangerWall(lambda = 27, e = 5e-3, dW1(start = {-6.3e6, -4.7e6, -3.6e6}), Tp(start = {789.2881838358564, 806.7088039780044, 819.9912755140301}), Tp1(start = {785.6370057524725, 803.9662515359148, 817.9384055160485})), Dint = 28e-3, Cws2(h_vol_1(start = 3432930.991856911)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 49.33), CSailettes = 6.59672842597229, p_rho = 1, Encras = Encras_SHP3, St = 5, deltaT(start = {97, 73, 55}), T2(start = {893.75, 885.1796729176981, 878.7316754228791, 873.8992309570313}), T1(start = {889.464836458849, 881.9556741702886, 876.315464574507}), Tp(start = {792.4232630808997, 809.0636930146954, 821.7539696298131})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.726, inertia = true, dW1(start = {6.3e6, 4.7e6, 3.6e6}), h(start = {3240679.0, 3323783.054261407, 3386205.9057494565, 3432930.991856911, 3432931.0}), hb(start = {3240813.5, 3348361.34780186, 3407279.82422176, 3450835.48993987}), P(start = {12710803.0, 12704112.803652512, 12696819.484746953, 12689077.136342296, 12681000.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP3(steady_state = false, option_temperature = false, h0 = {3323713.5, 3386144.0, 3432876.0}, T0 = fill(805.309, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 246, ExchangerWall(lambda = 27, e = 5e-3, dW1(start = {-6307650.5, -4738049.5, -3546629.0}), Tp(start = {789.2659301757812, 806.6884765625, 819.9727783203125}), Tp1(start = {785.6139526367188, 803.9453125, 817.91943359375})), Dint = 28e-3, Cws2(h_vol_1(start = 3432876.0)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 111e-3, K(fixed = true, start = 49.33), CSailettes = 6.59672842597229, p_rho = 1, Encras = Encras_SHP3, St = 5, deltaT(start = {97, 73, 55}), h(start = {3223385, 3212992.25, 3205186, 3199342.5, 3186106.25}), T2(start = {893.75, 885.1796729176981, 878.7316754228791, 873.8992309570313}), T1(start = {889.464836458849, 881.9556741702886, 876.315464574507}), Tp(start = {792.4016723632812, 809.0439453125, 821.7359619140625})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.726, inertia = true, dW1(start = {6307650.5, 4738049.5, 3546629.0}), h(start = {3240601.0, 3323713.5, 3386144.0, 3432876.0, 3432876.0}), hb(start = {3240601.0, 3323713.5, 3386144.0, 3432876.0}), P(start = {12710808.0, 12704117.0, 12696822.0, 12689079.0, 12681000.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {3323713.5, 3386144, 3432876})), state2(h(start = {3240601, 3323713.5, 3386144, 3432876}))), Cfg1(h_vol_2(start = 3212992.25)), Cfg2(h_vol_1(start = 3199342.5), h_vol_2(start = 3186106.25))) annotation( Placement(transformation(origin = {-327, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(L = 16.27, Vertical = false, P0 = 27.29e5, hl(fixed = false, start = 980960.1562978515), hv(fixed = false, start = 2798761.3254371085), Vv(fixed = false), R = 1.05, P(fixed = false, start = 2733918.2848144253), zl(start = 1.05, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 2742462.980913138), Tp(start = 497.4249792990277)) annotation( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(redeclare package Medium = Medium, L = 16.27, Vertical = false, P0 = 27.29e5, hl(start = 981073.3125, fixed = false), hv(start = 2798846.0, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, P(start = 2733970.0, fixed = false), zl(start = 1.05, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 2742514.5), Tp(start = 497.4441833496094), Cd(h_vol_1(start = 981073.3125)), Ce2(h_vol_1(start = 981073.3125)), Ce3(h_vol_1(start = 981073.3125)), Cs(h_vol_2(start = 981073.3125)), state_out_l(d(start = 829.7919922))) annotation( Placement(transformation(extent = {{325, 10}, {287, 50}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_vanne_vapeurMP(k = 0.5) annotation( Placement(transformation(extent = {{271, 70}, {259, 80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(Cvmax = CvmaxValveAMP, C1(P(start = 3253417.522956237), h_vol_2(start = 947830.5281155076)), h(start = 944000), Cv(start = 28), Pm(start = 2975000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(redeclare package Medium = Medium, Cvmax = CvmaxValveAMP, C1(P(start = 3269445.75), h_vol_2(start = 949320.25)), h(start = 949320.25), Cv(start = 26.902315139770508), Pm(start = 3001708.0)) annotation( Placement(transformation(extent = {{365, 46}, {345, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(Cvmax = 47829.4, C2(h_vol_1(start = 2798761.3254371085)), h(fixed = false, start = 2798000), Cv(start = 23914.7), Pm(fixed = false, start = 2732653.9482791456)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2798846.0)), h(fixed = false, start = 2798000), Cv(start = 23914.69921875), Pm(fixed = false, start = 2732653.9482791456)) annotation( Placement(transformation(extent = {{265, 46}, {245, 66}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurMP(Dint = 32.8e-3, L = 20.767, Ntubes = 738, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9.7e7, -7.6e6, -5.8e6}), Tp(start = {504.9993271430632, 504.2768804788304, 503.69756244079724}), Tp1(start = {504.503193578626, 503.89321384657916, 503.40091865289605})), Ns = 3, TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.83, continuous_flow_reversal = true, inertia = true, dW1(start = {9.7e7, 7.6e6, 5.8e6}), P(start = {2773378.75, 2751240.3575119935, 2743530.0500684776, 2738283.631137228, 2733918.25}), h(start = {980960.1875, 1046373.213452734, 1096957.9937272775, 1136069.1896699532, 980960.1875}), hb(start = {980708.125, 1028103.09460604, 1066178.43156513, 1095633.31556464})), Cws1(P(start = 2773378.6567335734)), ExchangerFlueGasesMetal(K(fixed = true, start = 30.22), Dext = 38e-3, step_L = 111e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 10.0676093, p_rho = 1.1, Encras = Encras_EvMP, St = 5, deltaT(start = {53, 41, 32}), T2(start = {565.5570068359375, 551.1237970278224, 539.9287004763471, 531.2528686523438}), T1(start = {558.3404164937012, 545.5262487520847, 535.5907942842642}), Tp(start = {505.4602817233831, 504.6333427384495, 503.9731723219999}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurMP(steady_state = false, option_temperature = false, h0 = {1046648.0, 1097357.125, 1136563.875}, T0 = fill(504.329, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, L = 20.767, Ntubes = 738, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9836201.0, -7606364.5, -5881023.0}), Tp(start = {505.00445556640625, 504.2812805175781, 503.7012634277344}), Tp1(start = {504.5071105957031, 503.89666748046875, 503.4039001464844})), Ns = 3, TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.83, continuous_flow_reversal = true, inertia = true, dW1(start = {9836201.0, 7606364.5, 5881023.0}), P(start = {2773389.0, 2751251.75, 2743562.25, 2738327.25, 2733970.0}), h(start = {981073.3125, 1046648.0, 1097357.125, 1136563.875, 981073.3125}), hb(start = {981073.3125, 1046648.0, 1097357.125, 1136563.875}), Q(start = {150.0, 150.0, 150.0, 150.0}), state1(h(start = {1046648, 1097357.125, 1136563.875}))), Cws1(P(start = 2773389.0)), ExchangerFlueGasesMetal(K(fixed = true, start = 30.22), Dext = 38e-3, step_L = 111e-3, step_T = 86.9e-3, Fa = 1, CSailettes = 10.0676093, p_rho = 1.1, Encras = Encras_EvMP, St = 5, deltaT(start = {53, 41, 32}), h(start = {2840204.5, 2823998.25, 2811466, 2801776.5, 2793868.25}), T2(start = {565.5570068359375, 551.1237970278224, 539.9287004763471, 531.2528686523438}), T1(start = {558.3404164937012, 545.5262487520847, 535.5907942842642}), Tp(start = {505.466552734375, 504.63861083984375, 503.9775390625})), Cfg1(h_vol_2(start = 2823998.25))) annotation( Placement(transformation(origin = {273, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(z2 = 0, z1 = 10.83, Q(start = 150, fixed = true), K = KgainChargeMP, Pm(start = 2734000), h(start = 978914.570821827), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(redeclare package Medium = Medium_Liquid, z2 = 0, z1 = 10.83, Q(start = 150, fixed = true), K = KgainChargeMP, Pm(start = 2757951.75), h(start = 981073.3125)) annotation( Placement(transformation(origin = {315, -90}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(V = 5, h(start = 980960.1562978515), P(start = 2734000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(redeclare package Medium = Medium_Liquid, V = 5, h(start = 981073.3125), P(start = 2773389.0), Ce2(h_vol_1(start = 981073.3125)), Ce3(h_vol_1(start = 981073.3125))) annotation( Placement(transformation(extent = {{295, -100}, {275, -80}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurMP(ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-3e6, -1.4e6, -740379}), Tp(start = {470.48677107325835, 488.1938632909576, 497.65207032563256}), Tp1(start = {470.01280565475304, 487.9402946158829, 497.51626768286917})), L = 20.726, Ns = 3, Dint = 26.6e-3, Ntubes = 246, Cws1(h_vol_2(start = 576430.3612424443)), Cws2(h_vol_1(start = 947830.5281155076)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 47.78), CSailettes = 7.16188651, p_rho = 1.12, Encras = Encras_EMP, St = 5, deltaT(start = {45, 24, 13}), T2(start = {516.7178344726563, 512.927875284067, 510.89894284399503, 509.81195068359375}), T1(start = {514.8228643851462, 511.91340906403104, 510.35544151482316}), Tp(start = {470.920281581991, 488.4257888303293, 497.7762816508864})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.767, z2 = 0, inertia = true, dW1(start = {3e6, 1.4e6, 740379}), h(start = {576430.375, 780326.2782299566, 889409.3790325949, 947830.5281155076, 947830.5}), hb(start = {565108.5, 727745.440528479, 829820.124314816, 892414.570867187}), P(start = {3160828.5, 3185369.6108956896, 3208693.506993564, 3231270.1974957627, 3253417.5}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurMP(steady_state = false, option_temperature = false, h0 = {783226.25, 891345.188, 949320.25}, T0 = fill(485.834, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-2533582.5, -1356953.375, -727620.0625}), Tp(start = {470.99713134765625, 488.55792236328125, 497.9468994140625}), Tp1(start = {470.5263671875, 488.3057556152344, 497.81170654296875})), L = 20.726, Ns = 3, Dint = 26.6e-3, Ntubes = 246, Cws1(h_vol_2(start = 581356.1875)), Cws2(h_vol_1(start = 949320.25)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 47.78), CSailettes = 7.16188651, p_rho = 1.12, Encras = Encras_EMP, St = 5, deltaT(start = {45, 24, 13}), h(start = {2785766.75, 2781592.5, 2779356.75, 2778157.75, 2761506.5}), T2(start = {516.7178344726563, 512.927875284067, 510.89894284399503, 509.81195068359375}), T1(start = {514.8228643851462, 511.91340906403104, 510.35544151482316}), Tp(start = {471.427734375, 488.7885437011719, 498.0705871582031})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.767, z2 = 0, inertia = true, dW1(start = {2533582.5, 1356953.375, 727620.0625}), h(start = {581356.1875, 783226.25, 891345.1875, 949320.25, 949320.25}), hb(start = {581356.1875, 783226.25, 891345.1875, 949320.25}), P(start = {3176926.5, 3201441.25, 3224746.25, 3247309.5, 3269445.75}), Q(start = {12.550562, 12.550562, 12.550562, 12.550562}), state1(h(start = {783226.25, 891345.1875, 949320.25})))) annotation( Placement(transformation(origin = {433, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP1(ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.3e6, -0.80263e6, -501864}), Tp(start = {558.0934551632172, 574.0136440053798, 584.242260992374}), Tp1(start = {557.706011115662, 573.7688585895307, 584.0889760553388})), L = 20.726, Ns = 3, Dint = 32.8e-3, Ntubes = 123, Cws1(h_vol_2(start = 2798761.3254371085)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 22.09), CSailettes = 14.46509765, p_rho = 1.07, Encras = Encras_SMP1, St = 5, deltaT(start = {45, 30, 19}), T2(start = {606.3656616210938, 604.5120304885253, 603.3404748736327, 602.606689453125}), T1(start = {605.4388500605926, 603.926252681079, 602.9735743782599}), Tp(start = {558.4534269956265, 574.2410725985397, 584.3846770655402})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 0, z1 = 10.77, inertia = true, dW1(start = {1.3e6, 0.80263e6, 501864}), h(start = {2798761.25, 2900642.773718668, 2965011.0169332824, 3005318.492253628, 3040245.5}), hb(start = {2798574.75, 2904836.50693844, 2969862.15109307, 3009575.30461156}), P(start = {2731389.5, 2730444.2277886732, 2729310.613093969, 2728046.4038641006, 2726700.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP1(steady_state = false, option_temperature = false, h0 = {2900559.5, 2964876.0, 3005185.25}, T0 = fill(572.064, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1276559.875, -807207.9375, -505905.21875}), Tp(start = {558.0389404296875, 573.9583740234375, 584.1954956054688}), Tp1(start = {557.65087890625, 573.7130126953125, 584.041748046875})), L = 20.726, Ns = 3, Dint = 32.8e-3, Ntubes = 123, Cws1(h_vol_2(start = 2798846.0)), ExchangerFlueGasesMetal(step_L = 111e-3, step_T = 86.9e-3, Fa = 1, Dext = 31.8e-3, K(fixed = true, start = 22.09), CSailettes = 14.46509765, p_rho = 1.07, Encras = Encras_SMP1, St = 5, deltaT(start = {45, 30, 19}), h(start = {2886069, 2883965.75, 2882635.75, 2881802.25, 2856444}), T2(start = {606.3656616210938, 604.5120304885253, 603.3404748736327, 602.606689453125}), T1(start = {605.4388500605926, 603.926252681079, 602.9735743782599}), Tp(start = {558.3994750976562, 574.1863403320312, 584.33837890625})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 0, z1 = 10.77, inertia = true, dW1(start = {1276559.875, 807207.9375, 505905.21875}), h(start = {2798846.0, 2900559.5, 2964876.0, 3005185.25, 3040176.25}), hb(start = {2798846.0, 2900559.5, 2964876.0, 3005185.25}), P(start = {2731424.75, 2730471.75, 2729329.5, 2728056.0, 2726700.0}), hi(start = {615.04425, 591.511108, 583.069275}), Q(start = {12.550562, 12.550562, 12.550562, 12.550562}), state1(h(start = {2900559.5, 2964876, 3005185.25})))) annotation( Placement(transformation(origin = {113, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(Ce1(h(start = 3046003.380872726)), h(start = 3040245.422545259), P(start = 2726000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(redeclare package Medium = Medium, Ce1(h(start = 3045962.75), h_vol_1(start = 3040176.25)), h(start = 3040176.25), P(start = 2726700.0), Cs1(h_vol_2(start = 3040176.25))) annotation( Placement(transformation(origin = {115, -110}, extent = {{-10, 10}, {10, -10}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP2(Ns = 3, L = 20.4, Dint = 39.3e-3, Ntubes = 369, ExchangerWall(e = 2.6e-3, lambda = 36.86, dW1(start = {-1.15e7, -7.9e6, -5.5e6}), Tp(start = {688.9747491924221, 714.1387227867799, 731.7594455240543}), Tp1(start = {687.7117385985722, 713.2642402785228, 731.156085252147})), Cws1(P(start = 2575477.4929098235), h_vol_2(start = 3040245.422545259)), Cws2(P(start = 2558200.620927911), h_vol_1(start = 3321522.540904887)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 92e-3, K(fixed = true, start = 45.22), CSailettes = 5.814209831, p_rho = 1.03, Encras = Encras_SMP2, St = 5, deltaT(start = {125, 86, 60}), T2(start = {822.3056030273438, 806.4713844816748, 795.4738313791455, 787.8693237304688}), T1(start = {814.3884833791556, 800.9726079304102, 791.671583337549}), Tp(start = {690.1616978609907, 714.9605415853846, 732.3264698030932})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {1.15e7, 7.9e6, 5.5e6}), h(start = {3040245.5, 3169860.5211362485, 3259603.344415277, 3321522.540904887, 3321522.5}), hb(start = {3040562.25, 3176242.27636476, 3267406.25678814, 3329559.35651389}), P(start = {2575477.5, 2571810.3704688977, 2567607.9202979314, 2563033.661146952, 2558200.5}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP2(steady_state = false, option_temperature = false, h0 = {3169752.75, 3259477.5, 3321390.75}, T0 = fill(711.567, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 39.3e-3, Ntubes = 369, ExchangerWall(e = 2.6e-3, lambda = 36.86, dW1(start = {-11460208.0, -7935598.5, -5475816.5}), Tp(start = {688.9197387695312, 714.0809326171875, 731.7014770507812}), Tp1(start = {687.6563720703125, 713.2061157226562, 731.0978393554688})), Cws1(P(start = 2575504.75), h_vol_2(start = 3040176.25)), Cws2(P(start = 2558210.5), h_vol_1(start = 3321390.75)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 92e-3, K(fixed = true, start = 45.22), CSailettes = 5.814209831, p_rho = 1.03, Encras = Encras_SMP2, St = 5, deltaT(start = {125, 86, 60}), h(start = {3137340.25, 3118458.25, 3105383.5, 3096361.5, 3080278.5}), T2(start = {822.3056030273438, 806.4713844816748, 795.4738313791455, 787.8693237304688}), T1(start = {814.3884833791556, 800.9726079304102, 791.671583337549}), Tp(start = {690.10693359375, 714.9030151367188, 732.2687377929688})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {11460208.0, 7935598.5, 5475816.5}), h(start = {3040176.25, 3169752.75, 3259477.5, 3321390.75, 3321390.75}), hb(start = {3040176.25, 3169752.75, 3259477.5, 3321390.75}), P(start = {2575504.75, 2571833.75, 2567627.25, 2563048.25, 2558210.5}), hi(start = {820.215881, 830.493896, 840.220764}), Q(start = {88.443581, 88.443581, 88.443581, 88.443581}), state1(h(start = {3169752.75, 3259477.5, 3321390.75})))) annotation( Placement(transformation(origin = {-147, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP3(Ns = 3, L = 20.4, Ntubes = 369, Dint = 45.6e-3, ExchangerWall(e = 2.6e-3, lambda = 27, dW1(start = {-8e6, -5.5e6, -3.8e6}), Tp(start = {786.0003533757151, 802.6089712721623, 814.0750543986999}), Tp1(start = {784.9544439166481, 801.8912118855588, 813.583437630984})), Cws2(h_vol_1(start = 3517381.1285517)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, step_L = 92e-3, Dext = 50.8e-3, K(fixed = true, start = 43.23), CSailettes = 5.695842178, p_rho = 1.01, Encras = Encras_SMP3, St = 5, deltaT(start = {82, 56, 38}), T2(start = {873.8992309570313, 862.9376291442026, 855.3997728669909, 850.2295532226563}), T1(start = {868.4184414351687, 859.1687010055967, 852.814654374732}), Tp(start = {786.9913001992309, 803.2890123388494, 814.5408366613608})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {8e6, 5.5e6, 3.8e6}), h(start = {3321522.5, 3412353.763453483, 3474687.0390689597, 3517381.1285517, 3517381.25}), hb(start = {3321940.75, 3420707.89900972, 3482716.02631475, 3524890.37222916}), P(start = {2558200.5, 2556022.8892716086, 2553661.4076231164, 2551174.061990546, 2548600.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP3(steady_state = false, option_temperature = false, h0 = {3412222.25, 3474561.75, 3517264.5}, T0 = fill(800.845, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 369, Dint = 45.6e-3, ExchangerWall(e = 2.6e-3, lambda = 27, dW1(start = {-8033471.0, -5513534.5, -3776766.75}), Tp(start = {785.9468383789062, 802.5588989257812, 814.0285034179688}), Tp1(start = {784.900390625, 801.8406982421875, 813.5364990234375})), Cws2(h_vol_1(start = 3517264.5)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, step_L = 92e-3, Dext = 50.8e-3, K(fixed = true, start = 43.23), CSailettes = 5.695842178, p_rho = 1.01, Encras = Encras_SMP3, St = 5, deltaT(start = {82, 56, 38}), h(start = {3199342.5, 3186106.25, 3177022.25, 3170799.5, 3156318.25}), T2(start = {873.8992309570313, 862.9376291442026, 855.3997728669909, 850.2295532226563}), T1(start = {868.4184414351687, 859.1687010055967, 852.814654374732}), Tp(start = {786.9383544921875, 803.2393798828125, 814.49462890625})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {8033471.0, 5513534.5, 3776766.75}), h(start = {3321390.75, 3412222.25, 3474561.75, 3517264.5, 3517264.5}), hb(start = {3321390.75, 3412222.25, 3474561.75, 3517264.5}), P(start = {2558210.5, 2556030.5, 2553666.5, 2551176.75, 2548600.0}), hi(start = {655.709778, 665.350952, 672.213684}), Q(start = {88.443581, 88.443581, 88.443581, 88.443581}), state1(h(start = {3412222.25, 3474561.75, 3517264.5})), state2(h(start = {3321390.75, 3412222.25, 3474561.75, 3517264.5})))) annotation( Placement(transformation(origin = {-267, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(Vertical = false, P0 = 5e5, Vv(fixed = false), L = 8, hl(fixed = false, start = 561432.6820300646), hv(fixed = false, start = 2682927.2097681486), R = 2, P(fixed = false, start = 536006.6647383622), zl(start = 1.75, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 552000.8087452435), Tp(start = 409.09918124890646)) annotation( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(redeclare package Medium = Medium, Vertical = false, P0 = 5e5, Vv(start = 58.244598, fixed = false), L = 8, hl(start = 566377.1875, fixed = false), hv(start = 2682039.0, fixed = false), R = 2, P(start = 559147.5625, fixed = false), zl(start = 1.75, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 575124.6875), Tp(start = 410.3314514160156), Cd(h_vol_1(start = 566377.1875)), Ce2(h_vol_1(start = 566377.1875)), Ce3(h_vol_1(start = 566377.1875)), state_out_l(d(start = 930.9786377))) annotation( Placement(transformation(extent = {{585, 10}, {545, 50}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_vanne_vapeurBP(k = 0.5) annotation( Placement(transformation(extent = {{633, 76}, {621, 86}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(p_rho = 3, Cvmax = CvmaxValveVBP, C2(P(start = 509651.8053666252), h_vol_1(start = 2682927.2097681486)), h(start = 2685000), Cv(start = 1), Pm(start = 498000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(redeclare package Medium = Medium, p_rho = 3, Cvmax = CvmaxValveVBP, C2(P(start = 509256.375), h_vol_1(start = 2682039.0)), h(start = 2682039.0), Cv(start = 18973.1328125), Pm(start = 534202.0)) annotation( Placement(transformation(extent = {{525, 46}, {505, 66}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(Cvmax = 285, C1(h_vol_2(start = 517521.1338868904)), h(fixed = false, start = 509000), Cv(start = 142.5), Pm(fixed = false, start = 1001940.4305634197)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(redeclare package Medium = Medium, Cvmax = 285, C1(h_vol_2(start = 521173.59375)), h(fixed = false, start = 509000), Cv(start = 142.5), Pm(start = 1023636.3125, fixed = false)) annotation( Placement(transformation(extent = {{617, 44}, {597, 64}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(z2 = 0, z1 = 10.767, Q(start = 50, fixed = false), K = 32766, rho(start = 931.9744461081724), Pm(start = 564000), h(start = 549249.519022482), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(redeclare package Medium = Medium_Liquid, z2 = 0, z1 = 10.767, Q(start = 50, fixed = false), K = 32766, rho(start = 930.9823608398438), Pm(start = 580761.8125), h(start = 566377.1875)) annotation( Placement(transformation(origin = {577, -90}, extent = {{-10, -10}, {10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(h(start = 561432.682030064), V = 5, P(start = 564000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(redeclare package Medium = Medium_Liquid, h(start = 566377.1875), V = 5, P(start = 586398.9375), Ce2(h_vol_1(start = 566377.1875)), Ce3(h_vol_1(start = 566377.1875))) annotation( Placement(transformation(extent = {{559, -100}, {539, -80}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurBP(Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.24e7, -8.5e6, -5.8e6}), Tp(start = {431.3608522222893, 430.24126699702373, 429.39686929842486}), Tp1(start = {430.9104943759602, 429.93425668934924, 429.1871126238492})), L = 20.726, Ntubes = 984, Ns = 3, ExchangerFlueGasesMetal(Dext = 38e-3, step_T = 86.9e-3, Fa = 1, step_L = 138e-3, K(fixed = true, start = 30.62), CSailettes = 11.07985, p_rho = 1.14, Encras = Encras_EvBP, St = 5, deltaT(start = {45, 31, 21}), T2(start = {483.7066345214844, 465.9440370193418, 453.7982409323057, 445.483154296875}), T1(start = {474.8253385845301, 459.8711389758238, 449.6406958379268}), Tp(start = {431.7792768702483, 430.5265083466735, 429.59175290805825})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, continuous_flow_reversal = true, inertia = true, dW1(start = {1.24e7, 8.5e6, 5.8e6}), h(start = {561432.6875, 799363.0194709267, 961560.8510406071, 1072378.2305328134, 561432.6875}), hb(start = {550075.0, 765243.011613326, 912673.256542569, 1013555.73710231}), Q(start = {49.81331881379377, 49.81331881379377, 49.81331881379377, 49.81331881379377}), P(start = {563167.375, 538556.7569255093, 537410.7752779912, 536682.3739734262, 536006.6875}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurBP(steady_state = false, option_temperature = false, h0 = {799848.25, 959006.75, 1067765.75}, T0 = fill(431.922, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-11609618.0, -7914340.5, -5408166.0}), Tp(start = {432.92791748046875, 431.8335876464844, 431.004638671875}), Tp1(start = {432.4867858886719, 431.5328369140625, 430.79913330078125})), L = 20.726, Ntubes = 984, Ns = 3, ExchangerFlueGasesMetal(Dext = 38e-3, step_T = 86.9e-3, Fa = 1, step_L = 138e-3, K(fixed = true, start = 30.62), CSailettes = 11.07985, p_rho = 1.14, Encras = Encras_EvBP, St = 5, deltaT(start = {45, 31, 21}), h(start = {2749602.5, 2730474.25, 2717434.5, 2708524, 2666933.25}), T2(start = {483.7066345214844, 465.9440370193418, 453.7982409323057, 445.483154296875}), T1(start = {474.8253385845301, 459.8711389758238, 449.6406958379268}), Tp(start = {433.3377990722656, 432.11297607421875, 431.195556640625})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, continuous_flow_reversal = true, inertia = true, dW1(start = {11609618.0, 7914340.5, 5408166.0}), h(start = {566377.1875, 799848.25, 959006.75, 1067765.75, 566377.1875}), hb(start = {566377.1875, 799848.25, 959006.75, 1067765.75}), Q(start = {49.726158142089844, 49.726158142089844, 49.726158142089844, 49.726158142089844}), P(start = {586398.9375, 561814.5, 560589.375, 559835.75, 559147.5625}), hi(start = {5420.776855, 5164.606934, 5127.338379}), state1(h(start = {799848.25, 959006.75, 1067765.75}))), Cfg2(h_vol_1(start = 2708524), h_vol_2(start = 2666933.25))) annotation( Placement(transformation(origin = {533, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante_ballonBP(k = 1) annotation( Placement(transformation(extent = {{709, 6}, {695, 18}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(Cvmax = 308.931, C1(h_vol_2(start = 561432.6820300646)), h(start = 550000), Cv(start = 308.931), Pm(start = 454319.5384961263), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(redeclare package Medium = Medium_Liquid, Cvmax = 308.931, C1(h_vol_2(start = 566377.1875)), h(start = 566377.1875), Cv(start = 308.9309997558594), Pm(start = 477195.5625)) annotation( Placement(transformation(extent = {{677, -14}, {697, 6}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurBP(Ns = 3, L = 20.726, Dint = 39.3e-3, Ntubes = 123, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1.1e6, -782901, -559798}), Tp(start = {477.52260500819597, 502.61487297914, 520.6394670364305}), Tp1(start = {477.2504107508904, 502.4219869045609, 520.5035062463255})), Cws1(h_vol_2(start = 2682927.2097681486)), Cws2(h_vol_1(start = 2919992.1127030067)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 222.1e-3, K(fixed = true, start = 30.46), CSailettes = 3.25763059984175, p_rho = 1.09, Encras = Encras_SBP, St = 5, deltaT(start = {92, 66, 47}), T2(start = {569.0130004882813, 567.4482541171128, 566.3390581546068, 565.5570068359375}), T1(start = {568.2306339861118, 566.8936561358598, 565.9480470570934}), Tp(start = {477.77840698873644, 502.79614293098246, 520.7672398988061})), TwoPhaseFlowPipe(advection = false, z2 = 0, rugosrel = 1e-5, z1 = 10.767, inertia = true, dW1(start = {1.1e6, 782901, 559798}), h(start = {2682927.25, 2790287.093854774, 2866365.945824299, 2919992.1127030067, 2919992.0}), hb(start = {2684673.5, 2819292.38908571, 2893584.12921908, 2943776.05560762}), P(start = {509651.8125, 507980.5977658856, 506129.5447082628, 504067.5333025372, 501850.0}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurBP(steady_state = false, option_temperature = false, h0 = {2791421.0, 2868442.25, 2922385.0}, T0 = fill(501.331, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 39.3e-3, Ntubes = 123, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1056375.625, -743847.4375, -520961.90625}), Tp(start = {478.4757385253906, 503.7419738769531, 521.7748413085938}), Tp1(start = {478.2060546875, 503.5520935058594, 521.641845703125})), Cws1(h_vol_2(start = 2682039.0)), Cws2(h_vol_1(start = 2922385.0)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 44.5e-3, step_L = 222.1e-3, K(fixed = true, start = 30.46), CSailettes = 3.25763059984175, p_rho = 1.09, Encras = Encras_SBP, St = 5, deltaT(start = {92, 66, 47}), h(start = {2844029, 2842288.5, 2841063, 2840204.5, 2823998.25}), T2(start = {569.0130004882813, 567.4482541171128, 566.3390581546068, 565.5570068359375}), T1(start = {568.2306339861118, 566.8936561358598, 565.9480470570934}), Tp(start = {478.7291564941406, 503.9204406738281, 521.8997802734375})), TwoPhaseFlowPipe(advection = false, z2 = 0, rugosrel = 1e-5, z1 = 10.767, inertia = true, dW1(start = {1056375.625, 743847.4375, 520961.90625}), h(start = {2682039.0, 2791421.0, 2868442.25, 2922385.0, 2922385.0}), hb(start = {2682039.0, 2791421.0, 2868442.25, 2922385.0}), P(start = {509256.375, 507673.78125, 505917.34375, 503957.90625, 501850.0}), Q(start = {9.657684, 9.657684, 9.657684, 9.657684}), state1(h(start = {2791421, 2868442.25, 2922385})))) annotation( Placement(transformation(origin = {233, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0 = 1.013e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(redeclare package Medium = Medium_FlueGases, P0 = 1.013e5) annotation( Placement(transformation(origin = {689, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurBP(Ns = 3, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-2.45e7, -5.5e6, -1.17e6}), Tp(start = {402.39147626030376, 398.05961040088295, 397.171667377241}), Tp1(start = {402.1199525074059, 397.9993065179613, 397.15885396154556})), Ntubes = 3444, L = 20.726, Cws1(h_vol_2(start = 194669.37425632242)), Cws2(h_vol_1(start = 517521.1338868904)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 92e-3, K(fixed = true, start = 31.53), CSailettes = 11.673758598919, p_rho = 1.15, Encras = Encras_EBP, St = 5, deltaT(start = {23.5, 5.3, 1.1}), T2(start = {445.483154296875, 407.64728846356843, 399.20963445670407, 397.4152526855469}), T1(start = {426.56521960355815, 403.42846146013625, 398.31244500376624}), Tp(start = {402.64374727467464, 398.11563835995787, 397.18357224132967})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, inertia = true, dW1(start = {2.45e7, 5.5e6, 1.17e6}), h(start = {194669.375, 449026.540992922, 505517.82265620184, 517521.1338868904, 517521.125}), hb(start = {194584.515625, 462556.370989432, 494648.45288738, 501287.069880104}), P(start = {1578579.375, 1542823.2506358635, 1517636.5908885582, 1492724.792065889, 1467874.25}))) annotation( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurBP(steady_state = false, option_temperature = false, h0 = {452010.875, 509069.875, 521173.594}, T0 = fill(400.077, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-25243184.0, -5597562.0, -1187388.0}), Tp(start = {403.2759704589844, 398.9235534667969, 398.032958984375}), Tp1(start = {403.0019226074219, 398.86279296875, 398.02008056640625})), Ntubes = 3444, L = 20.726, Cws1(h_vol_2(start = 194693.25)), Cws2(h_vol_1(start = 521173.59375)), ExchangerFlueGasesMetal(step_T = 86.9e-3, Fa = 1, Dext = 38e-3, step_L = 92e-3, K(fixed = true, start = 31.53), CSailettes = 11.673758598919, p_rho = 1.15, Encras = Encras_EBP, St = 5, deltaT(start = {23.5, 5.3, 1.1}), h(start = {2708524, 2666933.25, 2657710.5, 2655754.25, 2655754.25}), T2(start = {445.483154296875, 407.64728846356843, 399.20963445670407, 397.4152526855469}), T1(start = {426.56521960355815, 403.42846146013625, 398.31244500376624}), Tp(start = {403.53057861328125, 398.9800109863281, 398.0449523925781})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, inertia = true, dW1(start = {25243184.0, 5597562.0, 1187388.0}), h(start = {194693.25, 452010.875, 509069.875, 521173.59375, 521173.59375}), hb(start = {194693.25, 452010.875, 509069.875, 521173.59375}), P(start = {1589172.0, 1563024.375, 1537851.5, 1512957.25, 1488125.0}), hi(start = {461.55191, 487.833466, 493.167328}), Q(start = {98.101273, 98.101273, 98.101273, 98.101273}), state1(h(start = {452010.875, 509069.875, 521173.5938})))) annotation( Placement(transformation(origin = {647, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(W_fric = 1, eta_stato = 1, eta_is(start = 0.88057), Qmax = 140, eta_is_nom = 0.88057, eta_is_min = 0.75, Cst(start = 8182844.56002535) = CstHP, pros(d(start = 10.66670150764929)), Hrs(start = 3046003.380872726), Pe(fixed = true, start = 12431000), Ps(fixed = false, start = 2726700)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.8805699944496155), Qmax = 140, eta_is_nom = 0.88057, eta_is_min = 0.75, Cst(start = 8182844.56002535) = CstHP, rhos(start = 10.667095184326172), Hrs(start = 3045962.75), Pe(fixed = true, start = 12431000), Ps(fixed = false, start = 2726700)) annotation( Placement(transformation(extent = {{-35, -250}, {5, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(W_fric = 1, eta_stato = 1, eta_is(start = 0.9625), Qmax = 150, eta_is_nom = 0.9625, eta_is_min = 0.75, Cst(start = 256335.364995961) = CstMP, pros(d(start = 1.883484197675123)), Hrs(start = 3029367.6706168973), Pe(fixed = true, start = 2548500), Ps(fixed = false, start = 476800)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9624999761581421), Qmax = 150, eta_is_nom = 0.9625, eta_is_min = 0.75, Cst(start = 256335.364995961) = CstMP, rhos(start = 1.883624792098999), Hrs(start = 3029286.25), Pe(fixed = true, start = 2548500), Ps(fixed = false, start = 476800)) annotation( Placement(transformation(extent = {{285, -250}, {325, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(h(start = 3018320.043117248), P(start = 476799.99999954), Ce1(h(start = 3029780))) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(redeclare package Medium = Medium, h(start = 3018762.25), P(start = 476800.0), Ce1(h(start = 3029286.25)), Ce3(h_vol_1(start = 3018762.25))) annotation( Placement(transformation(origin = {385, -230}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(W_fric = 1, eta_stato = 1, eta_is(start = 0.9538), Qmax = 150, eta_is_nom = 0.9538, eta_is_min = 0.75, Cst(start = 11944.9445735985) = CstBP, Cs(h(start = 2401478.8015108025)), Hrs(start = 2401030), Pe(fixed = true, start = 476799.99999954), Ps(start = 10053)) annotation( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9538000226020813), Qmax = 150, eta_is_nom = 0.9538, eta_is_min = 0.75, Cst(start = 11944.9445735985) = CstBP, Cs(h(start = 2401715.75)), Hrs(start = 2401715.75), Pe(fixed = true, start = 476799.99999954), Ps(start = 10052.044921875)) annotation( Placement(transformation(extent = {{543, -250}, {583, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {-325, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {-265, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(alpha = 0.5, Ce(h(start = 3046260)), P(start = 2726700)) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(redeclare package Medium = Medium, alpha = 0.5, Ce(h(start = 3045962.75)), P(start = 2726700.0)) annotation( Placement(transformation(extent = {{81, -180}, {101, -160}}, rotation = 0))); - ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(D = 0.018, V = 1000, A = 100, lambda = 0.01, ntubes = 28700, continuous_flow_reversal = true, Vf0 = 0.15, steady_state = false, yNiveau(signal(start = 1.5)), Cse(h(start = 128076)), P(fixed = false, start = 6136), Pfond(start = 10000.0), Cl(h(start = 191812.29519356362)), proe(d(start = 996.0227362797892))) annotation( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, D = 0.018, V = 1000, A = 100, lambda = 0.01, ntubes = 28700, continuous_flow_reversal = true, Vf0 = 0.15, steady_state = false, yNiveau(signal(start = 1.5)), Cse(h(start = 127927.7578125), h_vol_1(start = 70825.89844)), P(start = 10000.0, fixed = false), Pfond(start = 10000.0), Cl(h(start = 191812.296875)), rhom(start = 996.0238647460938), hv(start = 2583886.75), Vv(start = 850.0), Cee(P(start = 146447.0156), h(start = 113380), h_vol_2(start = 113380)), state_d(d(start = 989.8436279))) annotation( Placement(transformation(extent = {{604, -384}, {684, -304}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(h0 = 113.38e3, Q0 = 29804.5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(redeclare package Medium = Medium, h0 = 113.38e3, Q0 = 29804.5) annotation( Placement(transformation(extent = {{539, -377}, {587, -329}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur(redeclare package Medium = Medium, C(h_vol_1(start = 70825.89844))) annotation( Placement(transformation(extent = {{703, -374}, {747, -330}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(K = 1e-4, h(start = 2400000), C1(h_vol_2(start = 2400000), h(start = 2400000)), Pm(start = 10026.138683139128)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(redeclare package Medium = Medium, K = 1e-4, h(start = 2401715.75), C1(h_vol_2(start = 2401715.75), h(start = 2401715.75)), Pm(start = 10026.0224609375)) annotation( Placement(transformation(extent = {{607, -240}, {627, -220}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(Ce3(h(start = 194669.37425631672)), h(start = 194669.37425632242), P(start = 1540500), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(redeclare package Medium = Medium_Liquid, Ce3(h(start = 194693.25)), h(start = 194693.25), P(start = 1589172.0), Ce1(h_vol_1(start = 194693.25)), Ce2(h_vol_1(start = 194693.25))) annotation( Placement(transformation(origin = {869, -318}, extent = {{10, -10}, {-10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(K = 1e-4, rho(start = 990.3699122081223), Pm(start = 1540000)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(redeclare package Medium = Medium_Liquid, K = 1e-4, rho(start = 990.373046875), Pm(start = 1589172.0)) annotation( Placement(transformation(origin = {869, -270}, extent = {{12, -12}, {-12, 12}}, rotation = 270))); - ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(h(start = 561432.6820300613), P(start = 322430), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(redeclare package Medium = Medium_Liquid, h(start = 566377.1875), P(start = 395243.53125), Ce2(h_vol_1(start = 566377.1875)), Cs1(h(start = 566377.1875)), Cs2(h(start = 566377.1875))) annotation( Placement(transformation(extent = {{709, -20}, {729, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(a3 = 350, b1(fixed = true) = -3.7751, a1 = -244551, Q(fixed = false), C1(h_vol_2(start = 561432.6820300613)), C2(h_vol_1(start = 576430.3612424443)), Qv(start = 0.013433660889458656), rho(start = 931.2517020786314), Pm(start = 1725850), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(redeclare package Medium = Medium_Liquid, a3 = 350, b1(fixed = true) = -3.7751, a1 = -244551, Q(fixed = false), C1(h_vol_2(start = 566377.1875), P(start = 395243.5312)), C2(h_vol_1(start = 581356.1875), P(start = 3182097.75)), Qv(start = 0.013491539284586906), rho(start = 930.2542724609375), Pm(start = 1788670.625), h(start = 573866.6875)) annotation( Placement(transformation(extent = {{771, -20}, {791, 0}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(a3 = 1600, a1 = -28056.2, b1 = -12.7952660447433, Q(fixed = false), C1(h_vol_2(start = 561432.6820300613)), C2(h_vol_1(start = 630040.8772883223)), Qv(start = 0.08167585768192882), rho(start = 929.0940034498418), Pm(start = 6774000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(redeclare package Medium = Medium_Liquid, a3 = 1600, a1 = -28056.2, b1 = -12.7952660447433, Q(fixed = false), C1(h_vol_2(start = 566377.1875), P(start = 395243.5312)), C2(h_vol_1(start = 634913.0), P(start = 13249950)), Qv(start = 0.08177389204502106), rho(start = 928.083740234375), Pm(start = 6822597.0), h(start = 600645.0625)) annotation( Placement(transformation(extent = {{771, -60}, {791, -40}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(alpha = 0.5, h(start = 194585), P(start = 1540500), Cs(h(start = 194585))) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(redeclare package Medium = Medium, alpha = 0.5, h(start = 194693.25), P(start = 1589172.0), Cs(h(start = 194693.25))) annotation( Placement(transformation(extent = {{839, -328}, {853, -308}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {235, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(z2 = 0, z1 = 0, K = K_PerteChargeZero2, h(start = 3000000), C1(h_vol_2(start = 3000000), h(start = 3000000), P(fixed = true, start = 501850)), Pm(start = 490000)) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(redeclare package Medium = Medium, z2 = 0, z1 = 0, K = K_PerteChargeZero2, h(start = 2922385.0), C1(h_vol_2(start = 2922385.0), h(start = 2922385.0), P(fixed = true, start = 501850)), Pm(start = 489325.0), rho(start = 2.144859076)) annotation( Placement(transformation(origin = {311, -278}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(K = 1e-4, Pm(start = 372632.41194491077), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(redeclare package Medium = Medium_Liquid, K = 1e-4, Pm(start = 395243.53125)) annotation( Placement(transformation(origin = {747, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(K = 1e-4, Pm(start = 372632.41224549303), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(redeclare package Medium = Medium_Liquid, K = 1e-4, Pm(start = 395243.53125)) annotation( Placement(transformation(origin = {747, -10}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); ThermoSysPro.ElectroMechanics.Machines.Generator Alternateur annotation( Placement(transformation(extent = {{369, -448}, {489, -348}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(K = 1e-4, C1(h_vol_2(start = 191812.29519356362)), C2(h_vol_1(start = 191812.29519356362)), rho(start = 989.8383588386666), Pm(start = 6200), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(redeclare package Medium = Medium_Liquid, K = 1e-4, C1(h_vol_2(start = 191812.296875)), C2(h_vol_1(start = 191812.296875), P(start = 9999.996094)), rho(start = 989.83837890625), Pm(start = 9999.998046875)) annotation( Placement(transformation(extent = {{669, -446}, {689, -426}}, rotation = 0))); - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(Qv(start = 0.19861699733512259), a3 = 400, a1(fixed = true) = -6000, Q(start = 194.502, fixed = false), C2(h_vol_1(start = 194669.37425631672)), Pm(start = 802830.7060548771), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(redeclare package Medium = Medium_Liquid, Qv(start = 0.198162242770195), a3 = 400, a1(fixed = true) = -6000, Q(start = 194.502, fixed = false), C2(h_vol_1(start = 194693.25), P(start = 1606175.875)), Pm(start = 808087.9375), h(start = 193252.7656)) annotation( Placement(transformation(extent = {{709, -446}, {729, -426}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(K = 1e-4, rho(start = 990.3699122094005), C1(h_vol_2(start = 194669.37425631672), h(start = 194585)), Pm(start = 1546000), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(redeclare package Medium = Medium_Liquid, K = 1e-4, rho(start = 990.373046875), C1(h_vol_2(start = 194693.25), h(start = 194693.25), P(start = 1589172)), Pm(start = 1589172.0)) annotation( Placement(transformation(extent = {{807, -446}, {827, -426}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(Cvmax = 2000, h(start = 194500), Cv(start = 2000), Pm(start = 1587120.4167526974), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(redeclare package Medium = Medium_Liquid, Cvmax = 2000, h(start = 194693.25), Cv(start = 2000.0), Pm(start = 1597674.0)) annotation( Placement(transformation(extent = {{769, -440}, {789, -420}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(C1(h_vol_2(start = 2674000), h(start = 2674000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(redeclare package Medium = Medium, C1(h_vol_2(start = 2664802.75), h(start = 2664802.75))) annotation( Placement(transformation(origin = {-91, 8}, extent = {{-6, 6}, {6, -6}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(C2(h_vol_1(start = 1398000), h(start = 1398000))) " " annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(redeclare package Medium = Medium, C2(h_vol_1(start = 1399475.5), h(start = 1399475.5))) " " annotation( Placement(transformation(origin = {58.5, 32}, extent = {{6, -6.5}, {-6, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(C2(h_vol_1(start = 944000), h(start = 944000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(redeclare package Medium = Medium, C2(h_vol_1(start = 949320.25), h(start = 949320.25))) annotation( Placement(transformation(extent = {{391, 49}, {376, 63}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(C1(h_vol_2(start = 2798000), h(start = 2798000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(redeclare package Medium = Medium, C1(h_vol_2(start = 2798846.0), h(start = 2798846.0))) annotation( Placement(transformation(origin = {203, 56}, extent = {{-8, 8}, {8, -8}}, rotation = 180))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(C2(h_vol_1(start = 2685000), h(start = 2685000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(redeclare package Medium = Medium, C2(h_vol_1(start = 2682039.0), h(start = 2682039.0))) annotation( Placement(transformation(origin = {481, 56}, extent = {{-8, 8}, {8, -8}}, rotation = 180))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(C2(h_vol_1(start = 550000), h(start = 550000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(redeclare package Medium = Medium, C2(h_vol_1(start = 521173.59375), h(start = 521173.59375))) annotation( Placement(transformation(origin = {630.5, 34}, extent = {{6, -6.5}, {-6, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(C2(h_vol_1(start = 550000), h(start = 550000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(redeclare package Medium = Medium, C2(h_vol_1(start = 566377.1875), h(start = 566377.1875))) annotation( Placement(transformation(extent = {{654, -11}, {667, 1}}, rotation = 0))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(C2(h_vol_1(start = 194585), h(start = 194585))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 191812.296875), h(start = 191812.296875))) annotation( Placement(transformation(origin = {652.5, -412}, extent = {{-10, -6.5}, {10, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(C2(h_vol_1(start = 2401000), h(start = 2401000))) annotation( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 2583886.75), h(start = 2401715.75))) annotation( Placement(transformation(origin = {651.5, -264}, extent = {{-10, -6.5}, {10, 6.5}}, rotation = 270))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(K = Kin_SMP2, Pm(start = 2651000), C1(P(fixed = true, start = 2726700), h_vol_2(start = 3046000), h(start = 3046000))) annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(redeclare package Medium = Medium, K = Kin_SMP2, Pm(start = 2651102.5), C1(P(fixed = true, start = 2726700), h_vol_2(start = 3040176.25), h(start = 3040176.25))) annotation( Placement(transformation(extent = {{81, -120}, {61, -100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(C1(P(fixed = true, start = 12680999.9999969)), Cvmax = Cvmax_THP, h(fixed = false, start = 3433000), Cv(start = 10875), Pm(fixed = false, start = 12550000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(redeclare package Medium = Medium, C1(P(fixed = true, start = 12680999.9999969)), Cvmax = Cvmax_THP, h(fixed = false, start = 3433000), Cv(start = 10840.94140625), Pm(fixed = false, start = 12550000), deltaP(start = 250000)) annotation( Placement(transformation(extent = {{-157, -234}, {-137, -214}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauEauHP(k = 1.05) annotation( Placement(transformation(extent = {{-191, 113}, {-157, 131}}, rotation = 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), add(k1 = -1, k2 = +1), Ti = 500, minval = 0.007) annotation( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), add(k1 = -1, k2 = +1), Ti = 500, minval = 0.007) annotation( Placement(transformation(extent = {{-73, 106}, {-53, 126}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauEauMP(k = 1.05) annotation( Placement(transformation(extent = {{140, 113}, {174, 131}}, rotation = 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), add(k1 = -1, k2 = +1), Ti = 500) annotation( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), add(k1 = -1, k2 = +1), Ti = 500) annotation( Placement(transformation(extent = {{229, 106}, {249, 126}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauEauBP(k = 1.75) annotation( Placement(transformation(extent = {{437, 126}, {471, 144}}, rotation = 0))); - ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(add(k1 = -1, k2 = +1), pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), Ti = 10, minval = 0.006) annotation( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(add(k1 = -1, k2 = +1), pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), Ti = 10, minval = 0.006) annotation( Placement(transformation(extent = {{535, 108}, {555, 128}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante ConsigneNiveauCondenseur1(k = 1.5) annotation( Placement(transformation(extent = {{683, -246}, {707, -230}}, rotation = 0))); - ThermoSysPro.Examples.Control.Condenser_LevelControl regulation_Niveau_Condenseur(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.8)))), add(k1 = +1, k2 = -1), edge(uL(signal(start = true)))) annotation( + ThermoSysPro.Examples.Control.Condenser_LevelControl regulation_Niveau_Condenseur(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), add(k1 = +1, k2 = -1), edge(uL(signal(start = true)))) annotation( Placement(transformation(extent = {{725, -282}, {745, -262}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps ConstantVanneTurbineHP(Table = [0, 0.8; 10, 0.8; 600, 0.8; 650, 0.8; 3000, 0.8; 3100, 0.8]) annotation( Placement(transformation(extent = {{-241, -216}, {-171, -142}}, rotation = 0))); @@ -203,23 +206,23 @@ model CombinedCycle_TripTAC "CCPP model to simulate a load variation from 100% t Placement(transformation(extent = {{912, -96}, {874, -64}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesBP(Initialvalue = 1400, Finalvalue = 1000, Duration = 1000, Starttime = 200000) annotation( Placement(transformation(extent = {{912, -458}, {874, -426}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(V = 1, h0 = 988332, h(start = 860655.3510813401), dynamic_mass_balance = true, P0 = 7010000, P(start = 13149153.870557636), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(redeclare package Medium = Medium_Liquid, V = 1, h0 = 988332, h(start = 863278.8125), dynamic_mass_balance = true, P0 = 7010000, P(start = 13153124.0), Ce2(h_vol_1(start = 863278.8125)), Ce3(h_vol_1(start = 863278.8125))) annotation( Placement(transformation(extent = {{423, -98}, {403, -78}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(V = 1, h0 = 983786, h(start = 989834.8113335292), dynamic_mass_balance = true, P0 = 7000000, P(start = 13239005.657249678), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(redeclare package Medium = Medium_Liquid, V = 1, h0 = 983786, h(start = 991313.25), dynamic_mass_balance = true, P0 = 7000000, P(start = 13242920.0), Ce2(h_vol_1(start = 991313.25)), Ce3(h_vol_1(start = 991313.25))) annotation( Placement(transformation(extent = {{219, -20}, {199, 0}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(Cvmax = 308.931, h(start = 618600), Cv(start = 308.931), Pm(start = 13150193.68579806), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(redeclare package Medium = Medium_Liquid, Cvmax = 308.931, h(start = 634913.0), Cv(start = 247.14480590820312), Pm(start = 13154483.0)) annotation( Placement(transformation(extent = {{721, -98}, {697, -122}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(Cvmax = 308.931, h(start = 565000), Cv(start = 308.931), Pm(start = 3163391.8442005403), region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(redeclare package Medium = Medium_Liquid, Cvmax = 308.931, h(start = 581356.1875), Cv(start = 247.14480590820312), Pm(start = 3179512.25)) annotation( Placement(transformation(extent = {{771, -138}, {747, -162}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesMp1(Initialvalue = 0.8, Duration = 1000, Starttime = 3000, Finalvalue = 0.005) annotation( Placement(transformation(extent = {{913, -150}, {875, -118}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Rampe arretPomesHP1(Initialvalue = 0.8, Duration = 1000, Starttime = 3000, Finalvalue = 0.005) annotation( Placement(transformation(extent = {{913, -194}, {875, -162}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(h0 = 3e6, h(start = 3432930.9918569606), dynamic_mass_balance = true, P0 = 12700000, P(start = 12700000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(redeclare package Medium = Medium, h0 = 3e6, h(start = 3432876.0), dynamic_mass_balance = true, P0 = 12700000, P(start = 12431000.0), Cs1(h_vol_2(start = 3432876)), Cs2(h_vol_2(start = 3432876))) annotation( Placement(transformation(origin = {-85, -230}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(h0 = 3523910, h(start = 3517381.1285518324), dynamic_mass_balance = true, P0 = 2400000, P(start = 2400000)) annotation( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(redeclare package Medium = Medium, h0 = 3523910, h(start = 3517264.5), dynamic_mass_balance = true, P0 = 2400000, P(start = 2548500.0), Ce2(h_vol_1(start = 3517264.5)), Ce3(h_vol_1(start = 3517264.5))) annotation( Placement(transformation(origin = {-83, -314}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); - ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(C1(P(fixed = true, start = 25.486e5)), Cvmax = Cvmax_TMP, h(fixed = false, start = 3518000), Cv(start = 3.312e6), Pm(fixed = false, start = 2547000)) annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(redeclare package Medium = Medium, C1(P(fixed = true, start = 25.486e5)), Cvmax = Cvmax_TMP, h(fixed = false, start = 3518000), Cv(start = 3306662.0), Pm(fixed = false, start = 2547000), deltaP(start = 100)) annotation( Placement(transformation(extent = {{-157, -318}, {-137, -298}}, rotation = 0))); ThermoSysPro.InstrumentationAndControl.Blocks.Tables.Table1DTemps ConstantVanneTurbineMP(Table = [0, 0.8; 10, 0.8; 600, 0.8; 2000, 0.8; 3000, 0.8; 3100, 0.8]) annotation( Placement(transformation(extent = {{-241, -300}, {-171, -226}}, rotation = 0))); @@ -229,7 +232,7 @@ model CombinedCycle_TripTAC "CCPP model to simulate a load variation from 100% t Placement(transformation(extent = {{293, 68}, {319, 98}}, rotation = 0))); ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(T0 = {303.16}) annotation( Placement(transformation(extent = {{552, 64}, {578, 94}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceFumees(Xco2 = 0.0613, Xso2 = 0, Xh2o = 0.0706, T0 = 893.75, Xo2 = 0.1380, Q0 = 606.94, ftype = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType.FlueGases) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceFumees(redeclare package Medium = Medium_FlueGases, X0 = {0.7301, 0.1380, 0.0706, 0.0613, 0}, option_temperature = true, T0 = 893.75, Q0 = 606.94) annotation( Placement(transformation(extent = {{-473, -91}, {-371, -7}}, rotation = 0))); InstrumentationAndControl.Blocks.Tables.Table1DTemps Debit(Table = [0, 606.94; 10, 606.94; 600, 50; 650, 50]) annotation( Placement(transformation(extent = {{-527, -19}, {-457, 55}}, rotation = 0))); @@ -504,7 +507,11 @@ equation experimentSetupOutput, Icon(graphics = {Rectangle(lineColor = {200, 200, 200}, fillColor = {248, 248, 248}, fillPattern = FillPattern.HorizontalCylinder, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Rectangle(lineColor = {128, 128, 128}, extent = {{-100.0, -100.0}, {100.0, 100.0}}, radius = 25.0), Polygon(origin = {8.0, 14.0}, lineColor = {78, 138, 73}, fillColor = {78, 138, 73}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-58.0, 46.0}, {42.0, -14.0}, {-58.0, -74.0}, {-58.0, 46.0}})}), Documentation(info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + +Adaptation to `Fluid` of the WaterSteam model `ThermoSysPro.Examples.CombinedCyclePowerPlant.CombinedCycle_TripTAC`. + +In the WaterSteam model, 22 components of the feedwater circuit force the liquid IF97 region (`mode = 1`): the water stays liquid even when the pressure drops below saturation during the gas turbine trip. `Fluid` components have no such parameter, the IF97 region is carried by the medium. These 22 components therefore use `Medium_Liquid = ThermoSysPro.Properties.Media.WaterSteam(Region=1)`, the water/steam medium forced in region 1 (liquid). ")); end CombinedCycle_TripTAC; \ No newline at end of file From cc49582e1de3439e4bb698d55e33e202edef6d99 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Thu, 19 Nov 2026 14:18:40 +0100 Subject: [PATCH 209/213] Replaceable trace partition law in the two-phase Fluid components - PartialSubCMedium: add the partialPartition interface (SubC, x, T -> C_BiPhase); equilibriumPartition extends it (signature and result unchanged). - DynamicDrum, Pressurizer, TwoPhaseCavity, TwoPhaseCavityOnePipe, TwoPhaseVolume, SimpleDynamicCondenser, SteamDryer, SteamExtractionSplitter: replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition, used for all their trace partitions (18 calls). - Example partition law approachToEquilibriumPartition(eta) in SimpleExamples.Media.WaterSteam_NonVolatileTrace, used by the new example Junctions.TestDryer_Traces_ApproachToEquilibrium (extends TestDryer_Traces). - PartialSubCMedium: short descriptions and Markdown documentation for all elements (partialRelativeVolatility, partialSaS, noSaS, C_BiPhase, ...). - Properties.Media: new package icon (ThermoSysProPackageIcon) and description. --- .../TestDryer_Traces_ApproachToEquilibrium.mo | 12 ++ .../SimpleExamples/Junctions/package.order | 1 + .../WaterSteam_NonVolatileTrace/package.mo | 39 +++++- .../HeatExchangers/SimpleDynamicCondenser.mo | 5 +- ThermoSysPro/Fluid/Junctions/SteamDryer.mo | 3 +- .../Junctions/SteamExtractionSplitter.mo | 3 +- ThermoSysPro/Fluid/Volumes/DynamicDrum.mo | 7 +- ThermoSysPro/Fluid/Volumes/Pressurizer.mo | 5 +- ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo | 7 +- .../Fluid/Volumes/TwoPhaseCavityOnePipe.mo | 9 +- ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo | 5 +- .../Media/PartialSubCMedium/C_BiPhase.mo | 11 +- .../PartialSubCMedium/equilibriumPartition.mo | 28 ++--- .../Media/PartialSubCMedium/noSaS.mo | 5 +- .../Media/PartialSubCMedium/package.mo | 47 ++++--- .../Media/PartialSubCMedium/package.order | 1 + .../PartialSubCMedium/partialPartition.mo | 20 +++ .../Media/PartialSubCMedium/partialSaS.mo | 30 ++++- ThermoSysPro/Properties/Media/package.mo | 119 +----------------- 19 files changed, 177 insertions(+), 180 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces_ApproachToEquilibrium.mo create mode 100644 ThermoSysPro/Properties/Media/PartialSubCMedium/partialPartition.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces_ApproachToEquilibrium.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces_ApproachToEquilibrium.mo new file mode 100644 index 00000000..087782d2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces_ApproachToEquilibrium.mo @@ -0,0 +1,12 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer_Traces_ApproachToEquilibrium + "Steam dryer with a non-volatile trace that does not reach the phase equilibrium" + extends TestDryer_Traces( + steamDryer(redeclare function tracePartition = Medium.approachToEquilibriumPartition(eta=0.5))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +Same configuration as `TestDryer_Traces` (non-volatile trace), but the steam dryer uses the example partition law `Media.WaterSteam_NonVolatileTrace.approachToEquilibriumPartition` with `eta = 0.5` instead of the default `equilibriumPartition`: the inlet traces only reach half of their phase equilibrium. + +At equilibrium (`TestDryer_Traces`) the vapour phase of the inlet carries no trace. Here it carries half of the mixture concentration, so the vapour outlet `sink` receives more trace and the liquid outlet `sink_cond` less. The trace mass balance of the dryer remains exact. +")); +end TestDryer_Traces_ApproachToEquilibrium; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order index f44cdf65..0a0a2573 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -1,5 +1,6 @@ TestDryer TestDryer_Traces +TestDryer_Traces_ApproachToEquilibrium TestSplitter2 TestSplitter2_Traces TestSplitter2_FlueGases diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo index bdbe4907..0c9d142d 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_NonVolatileTrace/package.mo @@ -8,9 +8,38 @@ package WaterSteam_NonVolatileTrace "Water/steam carrying one non-volatile trace RV := fill(0, nSubC); end relativeVolatility; - annotation (Documentation(info=" -

    Water/steam with one trace that does not evaporate: relativeVolatility = 0. -The vapour phase carries no trace at equilibrium, the liquid phase carries -SubC/(1 - x).

    -")); + function approachToEquilibriumPartition + "Example of partition law: partial approach to the phase equilibrium" + extends partialPartition; + input Real eta(min=0, max=1) = 1 + "Approach to the phase equilibrium: 0 = no partition (both phases carry the mixture concentration), 1 = equilibrium"; + protected + C_BiPhase C_eq "Partition at phase equilibrium"; + algorithm + C_eq := equilibriumPartition(SubC, x, T); + C_record.Cl := SubC + eta*(C_eq.Cl - SubC); + C_record.Cg := SubC + eta*(C_eq.Cg - SubC); + annotation (Documentation(info=" +Example of a partition law other than `equilibriumPartition`, for a component where the traces do not have the time to reach the phase equilibrium. Each phase concentration moves from the mixture concentration `SubC` towards its equilibrium value by the fraction `eta`: + +``` +Cl = SubC + eta*(Cl_eq - SubC), Cg = SubC + eta*(Cg_eq - SubC) +``` + +The trace mass of the mixture is conserved for any `eta`, since both `SubC` and the equilibrium partition satisfy `(1 - x)*Cl + x*Cg = SubC`. + +It is used in a single component by redeclaring its partition law, see `Junctions.TestDryer_Traces_ApproachToEquilibrium`: + +```modelica +SteamDryer steamDryer(redeclare package Medium = Medium, + redeclare function tracePartition = Medium.approachToEquilibriumPartition(eta=0.5)); +``` +")); + end approachToEquilibriumPartition; + + annotation (Documentation(info=" +Water/steam with one trace that does not evaporate: `relativeVolatility = 0`. The vapour phase carries no trace at equilibrium, the liquid phase carries `SubC/(1 - x)`. + +The package also defines `approachToEquilibriumPartition`, an example of a partition law that a single component can use instead of the equilibrium. +")); end WaterSteam_NonVolatileTrace; diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo index 32c05624..6ca73e7e 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo @@ -5,6 +5,7 @@ model SimpleDynamicCondenser "Simple dynamic condenser" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; @@ -266,8 +267,8 @@ equation every mass transfer between phases. Each transfer removes from one phase exactly what it adds to the other: the balance is exact for any volatility. */ if Medium.nC > 0 then - C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); - C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + C_l = tracePartition(SubCl, xl, sat.Tsat); + C_v = tracePartition(SubCv, xv, sat.Tsat); end if; SubCSaS = SaS(); diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo index 4dad6d6d..9317ee38 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo @@ -6,6 +6,7 @@ model SteamDryer "Steam dryer" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real eta=1 "Steam dryer efficiency (0 <= eta <= 1)"; parameter Boolean continuous_flow_reversal=false "true: continuous flow reversal - false: discontinuous flow reversal"; @@ -74,7 +75,7 @@ equation outlet keeps the liquid not removed by the dryer (eta < 1): it carries the mixture concentration at its own vapor mass fraction xsv. The liquid outlet follows from the balance. */ if Medium.nC > 0 then - C_e = Medium.equilibriumPartition(Cev.SubC, xe, sat.Tsat); + C_e = tracePartition(Cev.SubC, xe, sat.Tsat); end if; xsv = noEvent(if (xe > 0) then xe/(1 - eta*(1 - xe)) else 0); Csv.SubC = xsv*C_e.Cg + (1 - xsv)*C_e.Cl; diff --git a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo index 928073fa..a9d51eba 100644 --- a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo +++ b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo @@ -5,6 +5,7 @@ model SteamExtractionSplitter "Splitter for steam extraction" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Real alpha = 1 "Vapor mass fraction at the extraction/Vapor mass fraction at the inlet (0 <= alpha <= 1)"; @@ -61,7 +62,7 @@ equation carries the mixture concentration at its vapor mass fraction x_ex = alpha*xe. The main outlet follows from the balance. */ if Medium.nC > 0 then - C_e = Medium.equilibriumPartition(Ce.SubC, xe, sat.Tsat); + C_e = tracePartition(Ce.SubC, xe, sat.Tsat); end if; Cex.SubC = x_ex*C_e.Cg + (1 - x_ex)*C_e.Cl; diff --git a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo index ab0dcb49..026c886e 100644 --- a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo +++ b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo @@ -3,6 +3,7 @@ model DynamicDrum "Dynamic drum" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; @@ -332,9 +333,9 @@ equation every mass transfer between phases. Each transfer removes from one phase exactly what it adds to the other: the balance is exact for any volatility. */ if Medium.nC > 0 then - C_m = Medium.equilibriumPartition(Cm.SubC, xmv, sat.Tsat); - C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); - C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + C_m = tracePartition(Cm.SubC, xmv, sat.Tsat); + C_l = tracePartition(SubCl, xl, sat.Tsat); + C_v = tracePartition(SubCv, xv, sat.Tsat); end if; SubCSaS = SaS(); diff --git a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo index 8bd940a7..ea466549 100644 --- a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo +++ b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo @@ -4,6 +4,7 @@ model Pressurizer "Pressurizer" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=61.1 "Pressurizer volume"; parameter Units.SI.Radius Rp=1.265 "Pressurizer cross-sectional radius"; @@ -249,8 +250,8 @@ equation xl = noEvent(max(0, min(1, (hl - hls)/(hvs - hls)))); xv = noEvent(max(0, min(1, (hv - hls)/(hvs - hls)))); if Medium.nC > 0 then - C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); - C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + C_l = tracePartition(SubCl, xl, sat.Tsat); + C_v = tracePartition(SubCv, xv, sat.Tsat); end if; SubCSaS = SaS(); diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo index 8cad5c88..0b39c728 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo @@ -4,6 +4,7 @@ model TwoPhaseCavity "TwoPhaseCavity for one shell pass " extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; @@ -437,9 +438,9 @@ equation every mass transfer between phases. Each transfer removes from one phase exactly what it adds to the other: the balance is exact for any volatility. */ if Medium.nC > 0 then - C_in = Medium.equilibriumPartition(Ce.SubC, Medium.vapourQuality(state_in_l), Tsat); - C_l = Medium.equilibriumPartition(SubCl, xl, Tsat); - C_v = Medium.equilibriumPartition(SubCv, xv, Tsat); + C_in = tracePartition(Ce.SubC, Medium.vapourQuality(state_in_l), Tsat); + C_l = tracePartition(SubCl, xl, Tsat); + C_v = tracePartition(SubCv, xv, Tsat); end if; SubCSaS = SaS(); diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo index 48c2eba9..528a3581 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo @@ -4,6 +4,7 @@ model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass " extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Boolean Vertical=true "true: vertical cylinder - false: horizontal cylinder"; parameter Units.SI.Radius R=1.05 "Radius of the Cavity cross-sectional area"; @@ -319,10 +320,10 @@ equation every mass transfer between phases. Each transfer removes from one phase exactly what it adds to the other: the balance is exact for any volatility. */ if Medium.nC > 0 then - C_in = Medium.equilibriumPartition(Ce.SubC, Medium.vapourQuality(state_in_l), sat.Tsat); - C_bp = Medium.equilibriumPartition(CvBP.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); - C_gct = Medium.equilibriumPartition(CvGCT.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); - C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + C_in = tracePartition(Ce.SubC, Medium.vapourQuality(state_in_l), sat.Tsat); + C_bp = tracePartition(CvBP.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); + C_gct = tracePartition(CvGCT.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); + C_v = tracePartition(SubCv, xv, sat.Tsat); end if; SubCSaS = SaS(); diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo index 2975927b..89501ffb 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo @@ -4,6 +4,7 @@ model TwoPhaseVolume "TwoPhaseVolume" extends ThermoSysPro.Fluid.Interfaces.IconColors; replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); parameter Units.SI.Volume V=1 "Cavity volume"; parameter Units.SI.Area A=1 "Cavity cross-sectional area"; @@ -216,8 +217,8 @@ equation every mass transfer between phases. Each transfer removes from one phase exactly what it adds to the other: the balance is exact for any volatility. */ if Medium.nC > 0 then - C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); - C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + C_l = tracePartition(SubCl, xl, sat.Tsat); + C_v = tracePartition(SubCv, xv, sat.Tsat); end if; SubCSaS = SaS(); diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo index e117fa5c..4dd5f2de 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/C_BiPhase.mo @@ -1,6 +1,9 @@ within ThermoSysPro.Properties.Media.PartialSubCMedium; -record C_BiPhase - Real Cl[nSubC]; - Real Cg[nSubC]; - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +record C_BiPhase "Liquid and vapour trace concentrations of a two-phase mixture" + Real Cl[nSubC] "Trace concentrations in the liquid phase"; + Real Cg[nSubC] "Trace concentrations in the vapour phase"; + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +Result of the trace partition laws (`partialPartition`, `equilibriumPartition`): concentrations `Cl` in the liquid phase and `Cg` in the vapour phase of a two-phase mixture, one value per trace. +")); end C_BiPhase; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo index 8a6900de..9d257600 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/equilibriumPartition.mo @@ -1,11 +1,7 @@ within ThermoSysPro.Properties.Media.PartialSubCMedium; function equilibriumPartition "Liquid and vapour trace concentrations of a two-phase mixture at phase equilibrium" - extends Modelica.Icons.Function; - input Real SubC[nSubC] "Trace concentrations of the mixture"; - input Real x "Vapour mass fraction of the mixture"; - input ThermoSysPro.Units.SI.Temperature T "Saturation temperature"; - output C_BiPhase C_record "Liquid (Cl) and vapour (Cg) trace concentrations"; + extends partialPartition; protected Real RV[nSubC] "Relative volatility"; Real xc "Vapour mass fraction bounded to [0, 1]"; @@ -16,15 +12,15 @@ algorithm C_record.Cl[k] := SubC[k]/max(1 - xc + xc*RV[k], 1e-12); C_record.Cg[k] := RV[k]*C_record.Cl[k]; end for; - annotation (Inline=true, Documentation(info=" -

    With RV = relativeVolatility(T), equilibrium Cg = RV*Cl -and conservation (1 - x)*Cl + x*Cg = SubC give

    -
      Cl = SubC/(1 - x + x*RV),   Cg = RV*Cl
    -

    This is the only phase-partition law of the library. Components apply it to every -mass transfer between phases, at the vapour mass fraction of the transferred stream. -To keep their balances exact whatever the volatility, components give one phase the -vapour (or liquid) part and the other phase the remainder.

    -

    The denominator is bounded below by 1e-12 to cover the limit of a -non-volatile trace (RV = 0) in dry steam (x = 1).

    -")); + annotation (Inline=true, Documentation(info=" +With `RV = relativeVolatility(T)`, the phase equilibrium `Cg = RV*Cl` and the conservation `(1 - x)*Cl + x*Cg = SubC` give: + +``` +Cl = SubC/(1 - x + x*RV), Cg = RV*Cl +``` + +This is the default of the replaceable function `tracePartition` of the two-phase components (see `partialPartition`). Components apply it to every mass transfer between phases, at the vapour mass fraction of the transferred stream. To keep their balances exact whatever the volatility, components give one phase the vapour (or liquid) part and the other phase the remainder. + +The denominator is bounded below by `1e-12` to cover the limit of a non-volatile trace (`RV = 0`) in dry steam (`x = 1`). +")); end equilibriumPartition; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo index e00d5bc8..e17b546a 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/noSaS.mo @@ -1,6 +1,9 @@ within ThermoSysPro.Properties.Media.PartialSubCMedium; -function noSaS +function noSaS "No trace sink nor source" extends partialSaS; algorithm C := fill(0,nSubC); + annotation (Documentation(info=" +Default sink and source law of the components: no trace is consumed nor produced in the control volume (`C = 0`). +")); end noSaS; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo index 93cecb91..4ba9026d 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.mo @@ -1,13 +1,21 @@ within ThermoSysPro.Properties.Media; -partial package PartialSubCMedium - constant Integer nSubC; - constant Boolean isCompressible; +partial package PartialSubCMedium "Trace substances (SubC) common to the ThermoSysPro media: number, phase partition and sink/source laws" + constant Integer nSubC "Number of trace substances carried by the fluid (= nC of the medium)"; + constant Boolean isCompressible "true: compressible fluid (dynamic mass balance available in the volumes) - false: incompressible fluid"; partial function partialRelativeVolatility "Interface of relativeVolatility: media redeclare relativeVolatility by extending it" extends Modelica.Icons.Function; input ThermoSysPro.Units.SI.Temperature T "Saturation temperature"; - output Real RV[nSubC] "Relative volatility C_vapour/C_liquid (1: homogeneous, 0: non-volatile)"; + output Real RV[nSubC] "Relative volatility Cg/Cl of each trace"; + annotation (Documentation(info=" +Interface of the relative volatility of the traces, `RV = Cg/Cl`: ratio of the trace concentration in the vapour phase `Cg` to the trace concentration in the liquid phase `Cl`, at phase equilibrium. + +- `T`: saturation temperature; +- `RV[nSubC]`: one value per trace. `RV = 1` for a homogeneous trace (both phases carry the mixture concentration), `RV = 0` for a non-volatile trace, `RV >> 1` for a trace that goes to the vapour phase. + +A medium with traces redeclares `relativeVolatility` by extending this interface. +")); end partialRelativeVolatility; replaceable function relativeVolatility @@ -15,22 +23,21 @@ partial package PartialSubCMedium extends partialRelativeVolatility; algorithm RV := fill(1, nSubC); - annotation (Documentation(info=" -

    Ratio RV = Cg/Cl of the trace concentration in the vapour phase to -the trace concentration in the liquid phase, when both phases are at equilibrium -at the saturation temperature T.

    -

    The default value RV = 1 is the homogeneous separation: both phases -carry the bulk concentration. A medium with traces that prefer one phase redeclares -this function, for instance RV = 0 for a non-volatile trace, or a -temperature-dependent law for a conditioning amine:

    -
      redeclare function relativeVolatility
    -    extends partialRelativeVolatility;
    -  algorithm
    -    RV := fill(0, nSubC);
    -  end relativeVolatility;
    -

    All two-phase Fluid components split traces between phases with -equilibriumPartition, which is built on this function.

    -")); + annotation (Documentation(info=" +Ratio `RV = Cg/Cl` of the trace concentration in the vapour phase to the trace concentration in the liquid phase, when both phases are at equilibrium at the saturation temperature `T`. + +The default value `RV = 1` is the homogeneous separation: both phases carry the mixture concentration. A medium with traces that prefer one phase redeclares this function, for instance `RV = 0` for a non-volatile trace, or a temperature-dependent law for a conditioning amine: + +```modelica +redeclare function relativeVolatility + extends partialRelativeVolatility; +algorithm + RV := fill(0, nSubC); +end relativeVolatility; +``` + +The two-phase Fluid components split traces between phases with their replaceable function `tracePartition`, whose default `equilibriumPartition` is built on this function. +")); end relativeVolatility; end PartialSubCMedium; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order index f7597a9c..15665895 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/package.order @@ -2,6 +2,7 @@ nSubC isCompressible partialRelativeVolatility relativeVolatility +partialPartition equilibriumPartition C_BiPhase partialSaS diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPartition.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPartition.mo new file mode 100644 index 00000000..353179b2 --- /dev/null +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialPartition.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Properties.Media.PartialSubCMedium; +partial function partialPartition + "Interface of the liquid/vapour trace partition laws (tracePartition function of the components)" + extends Modelica.Icons.Function; + input Real SubC[nSubC] "Trace concentrations of the mixture"; + input Real x "Vapour mass fraction of the mixture"; + input ThermoSysPro.Units.SI.Temperature T "Saturation temperature"; + output C_BiPhase C_record "Liquid (Cl) and vapour (Cg) trace concentrations"; + annotation (Documentation(info=" +Interface of the functions that split the trace concentrations `SubC` of a two-phase mixture of vapour mass fraction `x` into a liquid concentration `Cl` and a vapour concentration `Cg`. + +The two-phase components (drums, cavities, condenser, steam dryer, extraction splitter, ...) declare a replaceable function `tracePartition` constrained by this interface, with `equilibriumPartition` as default. A dedicated law can be used in a single component, for instance when the residence time is too short for the traces to reach the phase equilibrium: + +```modelica +redeclare function tracePartition = MyPartitionLaw(...) +``` + +A partition law should conserve the trace mass of the mixture, `(1 - x)*Cl + x*Cg = SubC`. The components compute one phase from the balance anyway, so their balances remain exact. +")); +end partialPartition; diff --git a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo index 69547374..3c2dacf4 100644 --- a/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo +++ b/ThermoSysPro/Properties/Media/PartialSubCMedium/partialSaS.mo @@ -1,5 +1,29 @@ within ThermoSysPro.Properties.Media.PartialSubCMedium; -partial function partialSaS - input Real SubC[:] "Total Species Concentrations"; - output Real C[size(SubC,1)]; +partial function partialSaS "Interface of the trace sink and source laws (replaceable function SaS of the components)" + extends Modelica.Icons.Function; + input Real SubC[:] "Trace concentrations in the control volume"; + output Real C[size(SubC,1)] "Trace removal rate (concentration per second)"; + annotation (Documentation(info=" +Interface of the functions that model a sink or a source of traces inside a control volume (chemical reaction, degradation, injection, ...). + +- `SubC`: trace concentrations of the fluid in the control volume; +- `C`: rate at which each trace concentration is removed, in concentration per second. `C > 0` means that the trace is consumed, `C < 0` that it is produced. + +The components declare a replaceable function `SaS`, with `noSaS` as default, and add its result to their trace balance, for instance in `DynamicDrum`: + +```modelica +rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv; // SubCSaS = SaS() +``` + +A dedicated law is used in a single component by redeclaring `SaS`, for instance a first-order degradation of rate constant `k`: + +```modelica +function firstOrderDegradation + extends partialSaS; + input Real k = 1e-3 \"Degradation rate constant (1/s)\"; +algorithm + C := k*SubC; +end firstOrderDegradation; +``` +")); end partialSaS; diff --git a/ThermoSysPro/Properties/Media/package.mo b/ThermoSysPro/Properties/Media/package.mo index 921e6fe5..2144fd43 100644 --- a/ThermoSysPro/Properties/Media/package.mo +++ b/ThermoSysPro/Properties/Media/package.mo @@ -1,115 +1,8 @@ within ThermoSysPro.Properties; -package Media - annotation (Icon(graphics={ - Text( - extent={{-102,0},{24,-26}}, - lineColor={242,148,0}, - textString= - "Thermo"), - Text( - extent={{-4,8},{68,-34}}, - lineColor={46,170,220}, - textString= - "SysPro"), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-32,12},{-16,14},{6,14},{26,12},{42,8},{52,2},{42,6},{28,10},{6,12},{-12,12},{-16,12},{-34,10},{-50,6},{-62,2}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-44,38},{-24,38},{-26,30},{-26,22},{-24,14},{-24,12},{-46,8},{-42,22},{-42,30},{-44,38}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-26,20},{-20,20},{-20,22},{-14,22},{-14,20},{-12,20},{-12,12},{-26,12},{-28,12},{-26,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-8,14},{-8,24},{-6,24},{-6,14},{-8,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,30},{-6,26}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,36},{-6,32}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,42},{-6,38}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-8,48},{-6,44}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-4,14},{-4,26},{-2,26},{-2,14},{-4,14}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,32},{-2,28}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,38},{-2,34}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,44},{-2,40}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-4,50},{-2,46}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-2,20},{8,20},{8,22},{10,22},{18,22},{18,12},{-4,14},{-2,20}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-62,2},{-58,4},{-48,8},{-36,10},{-18,12},{6,12},{26,10},{42,6},{52,0},{42,4},{28,8},{6,10},{-12,10},{-18,10},{-38,8},{-50,6},{-62,2}}, - lineColor={242,148,0}, - fillColor={242,148,0}, - fillPattern=FillPattern.Solid), - Line( - points={{22,12},{22,14},{22,16},{24,14},{20,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{26,12},{26,14},{26,16},{28,14},{24,18}}, - color={46,170,220}, - thickness=0.5), - Line( - points={{30,10},{30,12},{30,14},{32,12},{28,16}}, - color={46,170,220}, - thickness=0.5), - Polygon( - points={{36,8},{36,30},{34,34},{36,38},{40,38},{40,8},{36,8}}, - lineColor={46,170,220}, - fillColor={46,170,220}, - fillPattern=FillPattern.Solid), - Rectangle(extent={{-100,80},{80,-100}}, lineColor={0,0,255}), - Line( - points={{-100,80},{-80,100},{100,100},{100,-80},{80,-100}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{80,80},{100,100}}, - color={0,0,255}, - smooth=Smooth.None)})); +package Media "Fluid media of the Fluid library (based on Modelica.Media, with trace substances)" + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; + annotation(Documentation(info = " +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + ")); end Media; From ab6e83a5eb48c70dafafe9910c78ae6351d6d513 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Nov 2026 09:46:47 +0100 Subject: [PATCH 210/213] Fixed Fluid DynamicPlateHeatExchanger as in WaterSteam --- .../HeatExchangers/TestDynamicPlateHeatExchanger.mo | 6 +++--- .../HeatExchangers/TestDynamicPlateHeatExchangerW.mo | 4 ++-- .../TestDynamicPlateHeatExchanger_FlueGases.mo | 6 +++++- .../HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo | 4 ++++ ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo | 2 +- .../Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo | 6 +++--- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo index 48836bb0..db2f7dd6 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo @@ -17,7 +17,7 @@ model TestDynamicPlateHeatExchanger state_f2(p(each start=3e5)), Ec( P(start=300000), - Q(fixed=true, start=1036), + Q(start=1036), h(start=280050)), Sc(P(start=100000), h(start=275103), Q(start=1000)), Ef(P(start=300000), h(start=280104), Q(start=1000)), @@ -39,9 +39,9 @@ model TestDynamicPlateHeatExchanger P0=300000, option_temperature=false, h0=280104) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkPc( redeclare package Medium = Medium, - P0(fixed=false) = 100000, + Q0=1036, option_temperature=false, h0=275103) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo index abbd9039..d7ec2ada 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo @@ -6,10 +6,10 @@ model TestDynamicPlateHeatExchangerW redeclare package Medium_c = Medium, redeclare package Medium_f = Medium, Ns=5, - Sc(Q(fixed=true, start=1036))) annotation (Placement(transformation(extent={{-14,6},{6,26}}, rotation=0))); + Sc(Q(start=1036))) annotation (Placement(transformation(extent={{-14,6},{6,26}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(redeclare package Medium = Medium, T0=340) annotation (Placement(transformation(extent={{-74,6},{-54,26}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,-14},{-34,6}}, rotation=0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium, P0(fixed=false) = 100000) annotation (Placement(transformation(extent={{46,6},{66,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ puitsP2(redeclare package Medium = Medium, Q0=1036) annotation (Placement(transformation(extent={{46,6},{66,26}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{26,-14},{46,6}}, rotation=0))); equation connect(sourceP2.C, echangeurAPlaques1D1.Ec) annotation (Line(points={{-54,16},{-14,16}}, color={0,0,255})); diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo index 06417c77..4ffb344c 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo @@ -28,7 +28,11 @@ model TestDynamicPlateHeatExchanger_FlueGases Tc1(start=fill(573.15, 5)), Tf1(start=fill(573.15, 5)), Tc2(start=fill(573.15, 6)), - Tf2(start=fill(573.15, 6))) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + Tf2(start=fill(573.15, 6)), + Pc(start=linspace(4500000, 4450000, 7)), + Pf(start=linspace(100000, 300000, 7)), + Qc(start=fill(117275.047014, 6)), + Qf(start=fill(49585.430645, 6))) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( redeclare package Medium = Medium_c, P0=4500000, diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo index bfc63f33..5d28ed67 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo @@ -18,6 +18,10 @@ model TestDynamicPlateHeatExchanger_Traces p_Kc=1e-4, p_Kf=1e-4, Ec(P(start=300000), h(start=280050)), + Pc(start=linspace(300000, 100000, 7)), + Pf(start=linspace(100000, 300000, 7)), + Qc(start=fill(1.4e6, 6)), + Qf(start=fill(1.4e6, 6)), Sc(P(start=100000), h(start=275103), Q(start=1000)), Ef(P(start=300000), h(start=280104), Q(start=1000)), Sf(P(start=100000), h(start=280076)), diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo index 8d53fee4..9a3c9369 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo @@ -235,7 +235,7 @@ equation -96,-64},{-100,-60},{-100,-60},{98,-60},{100,-60},{96,-64},{92, -68},{80,-80},{60,-90},{40,-96},{20,-98},{0,-100}}, lineColor={0,0,255}, - fillColor= DynamicSelect({53,117,255}, if fluid==1 then {53,117,255} else if fluid==2 then {0,255,255} else if fluid==3 then {175,175,175} else if fluid==4 then {255,170,213} else if fluid==5 then {0,127,0} else if fluid==6 then {170,215,215} else {213,255,170}), + fillColor={53,117,255}, fillPattern=FillPattern.Solid, lineThickness=0.5), Polygon( diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo index 0ba50c23..6575e513 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo @@ -425,10 +425,10 @@ equation /* Flow reversal */ if continuous_flow_reversal then hbc[i + 1] = ThermoSysPro.Functions.SmoothCond(Qc[i + 1]/gamma_c[i + 1], hc[i + 1], hc[i + 2], 1); - hbf[i + 1] = ThermoSysPro.Functions.SmoothCond(Qf[i + 1]/gamma_f[i + 1], hf[i + 1], hf[i + 2], 1); + hbf[i] = ThermoSysPro.Functions.SmoothCond(Qf[i]/gamma_f[i], hf[i + 1], hf[i], 1); else hbc[i + 1] = if (Qc[i + 1] > 0) then hc[i + 1] else hc[i + 2]; - hbf[i + 1] = if (Qf[i + 1] > 0) then hf[i + 1] else hf[i + 2]; + hbf[i] = if (Qf[i] > 0) then hf[i + 1] else hf[i]; end if; /* Fluid thermodynamic properties */ @@ -466,7 +466,7 @@ equation for i in 1:N loop /* Pressure losses */ Pc[i + 1] = if Qc[i] > 0 then Pc[i] - DPc[i]/N else Pc[i] + DPc[i]/N; - Pf[i + 1] = if Qf[i] > 0 then Pf[i] - DPf[i]/N else Pf[i] + DPf[i]/N; + Pf[i + 1] = if Qf[i] > 0 then Pf[i] + DPf[i]/N else Pf[i] - DPf[i]/N; qmc2[i] = noEvent(abs(Qc[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muc2[i])*M)); qmf2[i] = noEvent(abs(Qf[i])/(max(ThermoSysPro.Properties.WaterSteam.InitLimits.ETAMIN, muf2[i])*M)); From cb0884bb4bb492ce39cc11b23700dff3f7439459 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Fri, 20 Nov 2026 14:57:25 +0100 Subject: [PATCH 211/213] Added geom to SG and deleted 4SG --- .../HeatExchangers/TestSteamGenerator_1SG.mo | 142 ++++-- .../TestSteamGenerator_1SG_Purge.mo | 19 + .../TestSteamGenerator_1SG_Traces.mo | 2 +- .../HeatExchangers/TestSteamGenerator_4SG.mo | 27 -- .../TestSteamGenerator_4SG_Traces.mo | 7 - .../HeatExchangers/package.order | 3 +- .../HeatExchangers/SteamGenerator_1SG.mo | 253 ++++++----- .../HeatExchangers/SteamGenerator_4SG.mo | 410 ------------------ .../Fluid/HeatExchangers/package.order | 1 - 9 files changed, 278 insertions(+), 586 deletions(-) create mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Purge.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo delete mode 100644 ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo delete mode 100644 ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo index 850ef506..e19b8e06 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo @@ -5,48 +5,110 @@ model TestSteamGenerator_1SG replaceable package Medium = Properties.Media.WaterSteam; replaceable package Medium_Primary = Properties.Media.WaterSteam; + parameter Units.SI.Pressure P_Prim=155e5 annotation (Dialog(group="Primary")); + parameter Units.SI.Temperature Thot_Prim=320 + 273.15 annotation (Dialog(group="Primary")); + parameter Units.SI.Temperature Tcold_Prim=288.8 + 273.15 annotation (Dialog(group="Primary")); + parameter Units.SI.MassFlowRate Q_Prim=5000 "Primary side flow rate per SG" annotation (Dialog(group="Primary")); + + parameter Units.SI.Temperature T_Feedwater=227 + 273.15 annotation (Dialog(group="Secondary")); + parameter Units.SI.SpecificEnthalpy h_Feedwater=977100 annotation (Dialog(group="Secondary")); + parameter Units.SI.MassFlowRate Q_Secondary=520 "Secondary side flow rate per SG" annotation (Dialog(group="Secondary")); + parameter Units.SI.Pressure P_Secondary=67.3e5 annotation (Dialog(group="Secondary")); + + parameter Real K_steam(fixed=false, start=43.9) + "Pressure loss coefficient of the steam line, computed so that the drum level is 1 m (inverse problem)" annotation (Dialog(group="Secondary")); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare package Medium = Medium_Primary, Q0=Q_Prim, h0=1.278e6) annotation (Placement(transformation(extent={{60,-44},{80,-24}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium_Primary, + P0=P_Prim, + T0=Thot_Prim, + h0=1.478e6, + option_temperature=false) annotation (Placement(transformation(extent={{-80,-46},{-60,-26}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ1( + redeclare package Medium = Medium, + h0=h_Feedwater, + Q0=Q_Secondary, + option_temperature=false) annotation (Placement(transformation(extent={{100,20},{80,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium, + h0=2764e3, + option_temperature=false, + P0=P_Secondary) annotation (Placement(transformation(extent={{80,50},{100,70}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=K_steam, + Pm(start=6895125.5), h(start=2771781.2), Q(start=520), rho(start=35.961479)) annotation (Placement(transformation( + origin={50,60}, + extent={{10,-10},{-10,10}}, + rotation=180))); ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_1SG steamGenerator( redeclare package Medium = Medium, redeclare package Medium_Primary = Medium_Primary, - DomeGV( - Cm(h_vol_1(start=1467382.1491761294), - Q(start=3682.6323348377664)), - hl(start=1239103.1618852438), - Tp(start=1085.1630860204652, displayUnit="degC"), - Pfond(start=6537896.329041586, displayUnit="bar")), - DownComerGV(C2(P(start=6652618.15111204, displayUnit="bar"))), - fluidInlet(h_vol_2(start=1203352.0170161917)), - fluidInlet1(P(start=15603447.190394623, displayUnit="bar")), - fluidOutletI(h_vol_1(start=2.82156e6)), - fluidOutletI1(h(start=1266398.0525517925)), - MixAlimDomeGV(P(start=6597719.510802327, displayUnit="bar"), - Cs(h_vol_2(start=1203352.0170161917))), - outputReal(signal(start=-6.329123415280561)), - RiserGV( - h(start={1.20335e6,1.28046e6,1.34313e6,1.39379e6,1.43460e6,1.46738e6,1.46738e6}), - P(start={6.65262e6,6.63846e6,6.62828e6,6.62094e6,6.61445e6,6.60826e6,6.53790e6}), - Tp1(start={556.156,555.899,555.700,555.537,555.398}), - Tp2(start={557.644,557.097,556.655,556.295,555.999}), - state1(h(start={1280461.0750118925,1343134.833335842,1393794.5882590986,1434595.9090880589,1467382.1491761294}), p(start={6638456.595608159,6628277.414901627,6620936.90876653,6614447.789782153,6608263.233348276}, each displayUnit="bar"))), - UtubeColdtLeg( - P(start={1.54474e7,1.54475e7,1.54477e7,1.54482e7,1.54487e7,1.54493e7,1.54500e7}), - Tp(start={565.892673062783,563.7423137333859,562.0024887705413,560.5974122265403,559.4633025748175}, each displayUnit="degC")), - UtubeHotLeg( - P(start={1.56034e7,1.55774e7,1.55514e7,1.55254e7,1.54994e7,1.54734e7,1.54474e7}), - Tp(start={586.895939774836,580.9426855874689,575.9677586513063,571.864684816329,568.5110695637635}, each displayUnit="degC")), - DPnulle_AlimDwnc(rho(start=830.6664450130019, displayUnit="g/cm3")), - dynamic_energy_balance=false, - dynamic_mass_balance=false, - inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, Q0=531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP steamSink(redeclare package Medium = Medium, P0=6600000, h0=2.77257e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, Q0=4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); + n_tubes=5500, + S=7000, + e_tubes=1.09e-3, + Dext_tubes=19.05e-3, + hcCorr=1.0, + V_sep=12, + L_sep=2.9, + V_Riser=75, + V_Dome=100, + L_Dome=6.3, + V_MixARE=22.5, + K_riser=0.6, + volumeA(dynamic_mass_balance=false), + UtubeHotLeg(Q(start={5000,5000,5000,5000,5000,5000}), state2(p(start={15500000,15470475,15441022,15411612,15382228,15352859})), P(start={15500000,15470475,15441022,15411612,15382228,15352859,15323499}), h(start={1478000,1437996.6,1405566.4,1379131.4,1357572.5,1340007.1,1340007.1}), Tp(start={583.25378,579.10779,575.58075,572.63025,570.18518})), + UtubeColdLeg(Q(start={5000,5000,5000,5000,5000,5000}), state2(p(start={15323499,15322608,15321934,15321431,15321063,15320805})), P(start={15323499,15322608,15321934,15321431,15321063,15320805,15320634}), h(start={1340007.1,1325737.9,1314275.8,1304999.8,1297471.1,1291353.1,1291353.1}), Tp(start={568.18042,566.58685,565.26953,564.18793,563.30261})), + RiserGV(state2(p(start={7102785,7087560,7079207.5,7074296,7070380.5,7066886.5})), P(start={7102785,7087560,7079207.5,7074296,7070380.5,7066886.5,7063601.5}), h(start={1188296.2,1334547.2,1452826.2,1549058.2,1627441.8,1691262.8,1691262.8}), Q(start={1855.46,1855.46,1855.46,1855.46,1855.46,1855.46}), Tp1(start={563.6377,562.93787,562.31647,561.79114,561.35492}), Tp2(start={570.51843,568.78345,567.16504,565.76685,564.59314})), + heatExchangerWall(Tp(start={576.69275,573.78888,571.24512,569.09436,567.30426})), + heatExchangerWall1(Tp(start={565.84009,564.70697,563.74817,562.95319,562.29919})), + DomeGV(Pfond(start=7067494.5), P(start=7060251), hl(start=1270562.4), hv(start=2771781.2), Tp(start=559.56055), zl(fixed=true, start=1.0)), + volumeA(P(start=7105473), h(start=1188296.2)), + volumeA1(P(start=7063601.5), h(start=1691262.8)), + MixAlimDomeGV(P(start=7067079), h(start=1188296.2)), + DPnulle_Tcirc(Pm(start=7104129), h(start=1188296.2), Q(start=1855.46), rho(start=768.50885)), + DPnulle_AlimDwnc(Pm(start=7067079), h(start=977100), Q(start=520), rho(start=835.24182)), + DPnulle_DomeDwnc(Pm(start=7067287), h(start=1270531.6), Q(start=1335.46), rho(start=738.66504)), + DPSeparateurCyclone(Pm(start=7061926), h(start=1691262.8), Q(start=1855.46), rho(start=116.6667)), + DownComerGV(Pm(start=7086276), h(start=1188296.2), rho(start=768.48517), Q(start=1855.46))) annotation (Placement(transformation(extent={{-34,-36},{32,40}}))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_ThotPrim(redeclare package Medium = Medium_Primary) annotation (Placement(transformation( + origin={-40,-28}, + extent={{-10,-10},{10,10}}, + rotation=0))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_TcoldPrim(redeclare package Medium = Medium_Primary) annotation (Placement(transformation( + origin={40,-26}, + extent={{-10,-10},{10,10}}, + rotation=0))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_TARE(redeclare package Medium = Medium, T(start=T_Feedwater)) annotation (Placement(transformation( + origin={50,38}, + extent={{10,-10},{-10,10}}, + rotation=0))); equation - connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); - connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,34},{0,60},{-10,60}}, - color={0,0,255})); - connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); - connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); - annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + connect(sinkP1.C, singularPressureLoss1.C2) annotation (Line(points={{80,60},{60,60}})); + connect(singularPressureLoss1.C1, steamGenerator.fluidOutletI) annotation (Line(points={{40,60},{0,60},{0,39.7467},{-1,39.7467}}, color={0,0,255})); + connect(sourceP.C, SensorT_ThotPrim.C1) annotation (Line(points={{-60,-36},{-50,-36}}, color={0,0,255})); + connect(SensorT_ThotPrim.C2, steamGenerator.fluidInlet1) annotation (Line(points={{-29.8,-36},{-12,-36}}, color={0,0,255})); + connect(sinkQ.C, SensorT_TcoldPrim.C2) annotation (Line(points={{60,-34},{50.2,-34}}, color={0,0,255})); + connect(SensorT_TcoldPrim.C1, steamGenerator.fluidOutletI1) annotation (Line(points={{30,-34},{10,-34},{10,-36}}, color={0,0,255})); + connect(sourceQ1.C, SensorT_TARE.C1) annotation (Line(points={{80,30},{60,30}}, color={0,0,255})); + connect(SensorT_TARE.C2, steamGenerator.fluidInlet) annotation (Line(points={{39.8,30},{26,30},{26,29.8667},{10.44,29.8667}}, color={0,0,255})); + annotation (experiment(StopTime=1, Tolerance=1e-6), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +Fluid counterpart of `ThermoSysPro.Examples.SimpleExamples.TestSteamGenerator_1SG`, with the same parameters and boundary conditions: +primary pressure and enthalpy imposed at the inlet, primary flow rate imposed at the outlet, feedwater flow rate and enthalpy imposed, +steam outlet connected to a pressure sink through a singular pressure loss. + +As in the WaterSteam example, the drum level is imposed (`steamGenerator.DomeGV.zl(fixed=true, start=1.0)`) and the pressure loss +coefficient of the steam line is computed (inverse problem). The computed coefficient is the parameter `K_steam(fixed=false)`, declared +without binding and passed to `singularPressureLoss1`: a `fixed=false` modifier on `singularPressureLoss1.K` itself would keep the +default binding of `K`, which OpenModelica uses as an equation. + +The mass balance of the riser inlet volume `steamGenerator.volumeA` is static (`dynamic_mass_balance=false`), whereas the component +(as the WaterSteam one) uses a dynamic mass balance. At steady state both settings give the same equations (`der(P) = 0` reduces +the dynamic mass balance to `0 = BQ`) and the same solution. They however change the set of states, hence the tearing of the large +nonlinear initialisation system chosen by OpenModelica: without purge flow and with the dynamic mass balance, the torn system is +ill-conditioned (near-null directions along wall temperatures of the tubes) and OpenModelica does not converge, whereas with the static +mass balance it converges to the same steady state as Dymola. `TestSteamGenerator_1SG_Purge` restores the dynamic mass balance. +")); end TestSteamGenerator_1SG; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Purge.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Purge.mo new file mode 100644 index 00000000..5b0d5b81 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Purge.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG_Purge + extends TestSteamGenerator_1SG(steamGenerator(volumeA(dynamic_mass_balance=true))); + + parameter Units.SI.MassFlowRate Q_Purges=5.55 "Purge massflowrate per SG" annotation (Dialog(group="Secondary")); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(redeclare package Medium = Medium, Q0=Q_Purges, h0=1.278e6) annotation (Placement(transformation(extent={{80,-10},{100,10}}))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_Tpurge(redeclare package Medium = Medium) annotation (Placement(transformation( + origin={58,8}, + extent={{-10,-10},{10,10}}, + rotation=0))); +equation + connect(SensorT_Tpurge.C2, sinkQ1.C) annotation (Line(points={{68.2,0},{80,0}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI_purge, SensorT_Tpurge.C1) annotation (Line(points={{7.8,-20.8},{7.8,-20},{26,-20},{26,0},{48,0}}, color={255,0,0})); + annotation (Documentation(info=" +Fluid counterpart of `ThermoSysPro.Examples.SimpleExamples.TestSteamGenerator_1SG_Purge`: same as `TestSteamGenerator_1SG`, with a purge +flow rate imposed on the purge outlet of the steam generator. +")); +end TestSteamGenerator_1SG_Purge; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo index dd461219..60584657 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo @@ -3,5 +3,5 @@ model TestSteamGenerator_1SG_Traces extends TestSteamGenerator_1SG( redeclare package Medium = Properties.Media.WaterSteam, redeclare package Medium_Primary = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, - primaryInlet(SubC0={10})); + sourceP(SubC0={10})); end TestSteamGenerator_1SG_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo deleted file mode 100644 index 823a3933..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG.mo +++ /dev/null @@ -1,27 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; -model TestSteamGenerator_4SG - extends ThermoSysPro.UsersGuide.Icons.Example; - - replaceable package Medium = Properties.Media.WaterSteam; - replaceable package Medium_Primary = Properties.Media.WaterSteam; - - ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_4SG steamGenerator( - redeclare package Medium = Medium, - redeclare package Medium_Primary = Medium_Primary, - dynamic_energy_balance=false, - dynamic_mass_balance=false, - inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ feedwater(redeclare package Medium = Medium, - Q0=4*531.242, h0=991272, option_temperature=false) annotation (Placement(transformation(extent={{50,30},{70,50}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP steamSink(redeclare package Medium = Medium, P0=6600000, h0=2.77257e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ primaryInlet(redeclare package Medium = Medium_Primary, - Q0=4*4756, h0=1.47084e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-70},{-50,-50}}))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP primaryOutlet(redeclare package Medium = Medium_Primary, P0=15450000, h0=1.27187e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-70},{70,-50}}))); -equation - connect(feedwater.C, steamGenerator.fluidInlet) annotation (Line(points={{70,40},{52,40},{52,7.46667},{3.46667,7.46667}}, color={0,0,255})); - connect(steamGenerator.fluidOutletI, steamSink.C) annotation (Line(points={{0,9.93333},{0,34},{0,60},{-10,60}}, - color={0,0,255})); - connect(primaryInlet.C, steamGenerator.fluidInlet1) annotation (Line(points={{-50,-60},{-3.06667,-60},{-3.06667,-8.13333}}, color={0,0,255})); - connect(steamGenerator.fluidOutletI1, primaryOutlet.C) annotation (Line(points={{3.06667,-8.13333},{3.06667,-60},{50,-60}}, color={0,0,255})); - annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); -end TestSteamGenerator_4SG; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo deleted file mode 100644 index 2b9eb78f..00000000 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_4SG_Traces.mo +++ /dev/null @@ -1,7 +0,0 @@ -within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; -model TestSteamGenerator_4SG_Traces - extends TestSteamGenerator_4SG( - redeclare package Medium = Properties.Media.WaterSteam, - redeclare package Medium_Primary = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, - primaryInlet(SubC0={10})); -end TestSteamGenerator_4SG_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order index a33c9fb7..0465a1fd 100644 --- a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -56,6 +56,5 @@ TestDynamicWaterHeaterOnePipe_Traces TestDynamicWaterSteamMultiFluidsHeatExchanger TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces TestSteamGenerator_1SG +TestSteamGenerator_1SG_Purge TestSteamGenerator_1SG_Traces -TestSteamGenerator_4SG -TestSteamGenerator_4SG_Traces diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo index 560db0ae..9af2f3a1 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo +++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo @@ -5,7 +5,44 @@ model SteamGenerator_1SG "Single steam generator" replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the secondary water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); replaceable package Medium_Primary = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the primary side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - parameter Real H0_Mix_AlimDomeGV=1194812.89980521; + parameter Integer Ns=5 "Number of segments in tubes and riser" annotation (Dialog(tab="General", group="Geometry")); + + parameter Integer n_tubes=4085 "Number of pipes in parallel" annotation (Dialog(tab="General", group="Geometry")); + parameter Units.SI.Area S=4669 "Heat exchange area" annotation (Dialog(tab="General", group="Geometry")); + parameter Units.SI.Length e_tubes=1.2e-3 "Pipe's wall thickness" annotation (Dialog(tab="General", group="Geometry")); + parameter Units.SI.Length Dext_tubes=22.0e-3 "Pipe's external Diameter" annotation (Dialog(tab="General", group="Geometry")); + parameter Units.SI.Length Leq=S/(n_tubes*(Dext_tubes - 2*e_tubes)*Modelica.Constants.pi) "Equivalent length for pipes and riser" annotation (Dialog(tab="General", group="Geometry")); + parameter Real hcCorr=5.0 "Corrective term for the heat exchange coefficient (hc) inside all pipes - to tune correct Tcold_primary" annotation (Dialog(tab="General", group="Geometry")); + + parameter Units.SI.Volume V_sep=7.0 "Volume of the separator" annotation (Dialog(tab="General", group="Separator: from Riser volume to Dome")); + parameter Units.SI.Length L_sep=3.0 "Length of the separator" annotation (Dialog(tab="General", group="Separator: from Riser volume to Dome")); + parameter Units.SI.Length D_sep=fromVtoDeq(V_sep, L_sep, 1) "Equivalent diameter of the separator (considered one pipe)" annotation (Dialog(tab="General", group="Separator: from Riser volume to Dome")); + + parameter Units.SI.Volume V_Riser=45.0 "Riser's volume " annotation (Dialog(tab="General", group="Riser (Tube bundle in the secondary)")); + parameter Units.SI.Length D_Riser=fromVtoDeq( + V_Riser, + Leq/2, + n_tubes) "Equivalent diameter of the riser" annotation (Dialog(tab="General", group="Riser (Tube bundle in the secondary)")); + parameter Real K_riser=10 "Pressure loss coefficient to tune correct recirculation rate" annotation (Dialog(tab="General", group="Riser (Tube bundle in the secondary)")); + + parameter Units.SI.Volume V_Dome=60.0 "Volume of the dome" annotation (Dialog(tab="General", group="Dome")); + parameter Units.SI.Length L_Dome=5.0 "Length of the dome" annotation (Dialog(tab="General", group="Dome")); + parameter Units.SI.Length R_Dome=sqrt(V_Dome/(L_Dome*Modelica.Constants.pi)) "Radius of the dome" annotation (Dialog(tab="General", group="Dome")); + + parameter Units.SI.Volume V_DownComer=8.0 "Volume of the downcomer" annotation (Dialog(tab="General", group="DownComer")); + parameter Units.SI.Diameter Dint_DownComer=4.0 "Inner diameter of the annular downcomer" annotation (Dialog(tab="General", group="DownComer")); + final parameter AnnularHydraulicEquivalence downComerHydraulicEquivalence= + fromAnnularVtoHydraulicEquivalence( + V_DownComer, + Leq/2, + Dint_DownComer); + final parameter Units.SI.Diameter Dh_DownComer= + downComerHydraulicEquivalence.Dh "Hydraulic diameter of the annular downcomer"; + final parameter Real neq_DownComer=downComerHydraulicEquivalence.neq + "Equivalent number of circular pipes preserving the downcomer flow area"; + + parameter Units.SI.Volume V_MixARE=12.0 "Volume where feedwater mixes with recirculation" annotation (Dialog(tab="General", group="MixARE")); + parameter Boolean inertia=false "true: momentum balance equation with inertia - false: without inertia"; parameter Boolean advection=false @@ -30,18 +67,20 @@ model SteamGenerator_1SG "Single steam generator" parameter Boolean diffusion=false "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; + Real CirculationRate "Circulation rate"; + Units.SI.Power W_GV_primary "Power from primary to SG"; + Units.SI.Power W_GV_secondary "Power from SG to secondary"; + public ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg( redeclare package Medium = Medium_Primary, - L=10.848, - D=0.01687, - z2=10.848, - h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393, - 1346263.00297153,1326153.46646787,1326153}), - Ns=5, + L=Leq/2, + D=Dext_tubes - 2*e_tubes, + ntubes=n_tubes, + z2=Leq/2, + hcCorr=hcCorr, + Ns=Ns, dpfCorr=0.17, - hcCorr=5, - ntubes=5340, advection=advection, dynamic_energy_balance=dynamic_energy_balance, dynamic_mass_balance=dynamic_mass_balance, @@ -50,26 +89,21 @@ public inertia=inertia, continuous_flow_reversal=continuous_flow_reversal, diffusion=diffusion, - option_temperature=option_temperature, - P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988, - 15410560.642776,15395560}), - Tp(start={564,562,560,559,568})) + option_temperature=option_temperature) annotation (Placement(transformation( origin={-67,-41.5}, extent={{30.5,-15},{-30.5,15}}, rotation=270))); - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdLeg( redeclare package Medium = Medium_Primary, - L=10.848, - D=0.01687, - h(start={1326153.46646787,1310848.36111251,1299218.76228131, - 1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}), - Ns=5, + L=Leq/2, + D=Dext_tubes - 2*e_tubes, + ntubes=n_tubes, + z1=Leq/2, + hcCorr=hcCorr, + Ns=Ns, dpfCorr=0.17, - hcCorr=5, - z1=10.848, - ntubes=5340, inertia=inertia, advection=advection, dynamic_energy_balance=dynamic_energy_balance, @@ -78,10 +112,7 @@ public steady_state=steady_state, continuous_flow_reversal=continuous_flow_reversal, diffusion=diffusion, - option_temperature=option_temperature, - P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752, - 15393000.834432,15393020}), - Tp(start={584,580,575,571,568})) + option_temperature=option_temperature) annotation (Placement(transformation( origin={67,-41.5}, extent={{30.5,-14},{-30.5,14}}, @@ -89,13 +120,9 @@ public ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV( redeclare package Medium = Medium, - hl(start=1257382.15477056), - hv(start=2771260.46625813), cpp=500, - L=8.625, - Cd(P(start=67.9e5)), - zl(fixed=false, start=0.66), - R=4.2818979, + L=L_Dome, + R=R_Dome, Mp=32000, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, @@ -105,11 +132,11 @@ public P0=P0) annotation (Placement(transformation(extent={{-22,64},{22,107}}, rotation=0))); -protected ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone( redeclare package Medium = Medium, - L=1, - D=0.95886, + L=L_sep, + D=D_sep, + z2=L_sep, lambda=0.03, inertia=inertia) annotation (Placement(transformation( @@ -119,9 +146,7 @@ protected public ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV( redeclare package Medium = Medium, - h0=H0_Mix_AlimDomeGV, - h(start=1194851.37111438), - V=0.01, + V=V_MixARE, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, dynamic_mass_balance=dynamic_mass_balance, @@ -141,7 +166,6 @@ public ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc( redeclare package Medium = Medium, p_rho=0, - C2(P(start=6829391.22090726), Q(fixed=false, start=6643)), K=0.172144) annotation (Placement(transformation(extent={{53,53}, {63,73}}, rotation=0))); @@ -162,6 +186,8 @@ public ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1(redeclare package Medium = Medium_Primary) annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation= 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI_purge(redeclare package Medium = Medium) "Purge outlet (optional)" + annotation (Placement(transformation(extent={{140,-130},{160,-110}}, rotation=0), iconTransformation(extent={{36,-100},{56,-80}}))); ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation= 0))); @@ -169,53 +195,39 @@ public ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV( redeclare package Medium = Medium, p_rho=0, - h(start=1194851.3), - z1=10.8, - C1( - h_vol_1(start=1.1733e6), - h(start=1.1733e6), - Q(start=7525.84), - P(start=6829391.22090726)), - L=10.8, - D=0.216, - C2( - h_vol_1(start=1.1733e6), - Q(start=7525.84), - h(start=1.1733e6), - P(fixed=false, start=68.4935e5)), - lambda=0.08, - ntubes=32, - Q(start=7525.84/4), + L=Leq/2, + D=Dh_DownComer, + ntubes=neq_DownComer, + z1=Leq/2, + lambda=0.09, inertia=inertia) "DownComerGV" annotation (Placement(transformation( origin={94.5,-41}, extent={{-31,16.5},{31,-16.5}}, rotation=270))); Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( - L=10.848, - D=0.01687, - e=2.18e-3, + ntubes=UtubeHotLeg.ntubes, + L=UtubeHotLeg.L, + D=UtubeHotLeg.D, + e=e_tubes, + Ns=UtubeHotLeg.Ns, lambda=23, cpw=503, rhow=8430, - Ns=5, - ntubes=5340, - dynamic_energy_balance=dynamic_energy_balance, - Tp(start={571,568,566,564,562})) + dynamic_energy_balance=dynamic_energy_balance) annotation (Placement(transformation( origin={-44,-41}, extent={{-33,-16},{33,16}}, rotation=270))); Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1( - L=10.848, - D=0.01687, - e=2.18e-3, + ntubes=UtubeColdLeg.ntubes, + L=UtubeColdLeg.L, + D=UtubeColdLeg.D, + e=e_tubes, + Ns=UtubeColdLeg.Ns, lambda=23, cpw=503, rhow=8430, - Ns=5, - ntubes=5340, - dynamic_energy_balance=dynamic_energy_balance, - Tp(start={563,560,558,557,556})) + dynamic_energy_balance=dynamic_energy_balance) annotation (Placement(transformation( origin={44,-41}, extent={{-33,16},{33,-16}}, @@ -223,16 +235,13 @@ public ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV( redeclare package Medium = Medium, - Ns=5, - h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846, - 1525552.01981793,1595519.78942018,1595519.78863864}), - D=0.03689, - L=10.848, - z2=10.848, - hcCorr=5, + L=Leq/2, + D=D_Riser, + ntubes=n_tubes, + z2=Leq/2, + hcCorr=hcCorr, + Ns=Ns, dpfCorr=1, - ntubes=5340, - Q(start={8600/4,8600/4,8600/4,8600/4,8600/4,8600/4}), inertia=inertia, advection=advection, dynamic_energy_balance=dynamic_energy_balance, @@ -241,31 +250,28 @@ public steady_state=steady_state, continuous_flow_reversal=continuous_flow_reversal, diffusion=diffusion, - option_temperature=option_temperature, - P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501, - 6834912.1497303,6828884.4924605}), - Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}), - Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902})) + option_temperature=option_temperature) annotation (Placement( transformation( origin={-2.5,-41}, extent={{-32,31.5},{32,-31.5}}, rotation=90))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeA( + ThermoSysPro.Fluid.Volumes.VolumeA volumeA( redeclare package Medium = Medium, + P0=68.4935e5, h0=1185.2e3, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, dynamic_mass_balance=dynamic_mass_balance, continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - P0=6849350) annotation (Placement(transformation( - origin={1,-90}, + diffusion=diffusion) annotation (Placement(transformation( + origin={1,-110}, extent={{-10,-10},{10,10}}, rotation=90))); ThermoSysPro.Fluid.Volumes.VolumeC volumeA1( redeclare package Medium = Medium, + V=0.1, dynamic_energy_balance=dynamic_energy_balance, steady_state=steady_state, dynamic_mass_balance=dynamic_mass_balance, @@ -275,8 +281,60 @@ public origin={0,18}, extent={{-10,-10},{10,10}}, rotation=90))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Tcirc( + redeclare package Medium = Medium, + p_rho=0, + K=K_riser) annotation (Placement(transformation( + extent={{-6,-7},{6,7}}, + rotation=90, + origin={1,-86}))); + + function fromVtoDeq "Equivalent diameter of ntubes circular pipes of total volume V and length L" + input Units.SI.Volume V; + input Units.SI.Length L; + input Integer ntubes; + output Units.SI.Length D; + algorithm + D := sqrt((4*V)/(L*Modelica.Constants.pi*ntubes)); + end fromVtoDeq; + + record AnnularHydraulicEquivalence "Hydraulic equivalence of an annular duct" + Units.SI.Diameter Dh "Hydraulic diameter"; + Real neq "Equivalent number of circular pipes preserving the flow area"; + end AnnularHydraulicEquivalence; + + function fromAnnularVtoHydraulicEquivalence "Hydraulic diameter and equivalent number of pipes of an annular duct of volume V, length L and inner diameter Dint" + input Units.SI.Volume V; + input Units.SI.Length L; + input Units.SI.Diameter Dint; + output AnnularHydraulicEquivalence hydraulicEquivalence; + protected + Units.SI.Area A; + Units.SI.Diameter Dext; + algorithm + assert(V > 0, "The annular volume must be strictly positive"); + assert(L > 0, "The annular length must be strictly positive"); + assert(Dint >= 0, "The annular inner diameter must be positive or zero"); + A := V/L; + Dext := sqrt(Dint^2 + 4*A/Modelica.Constants.pi); + hydraulicEquivalence.Dh := Dext - Dint; + hydraulicEquivalence.neq := + A/(Modelica.Constants.pi*hydraulicEquivalence.Dh^2/4); + end fromAnnularVtoHydraulicEquivalence; equation - connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line( + CirculationRate = DownComerGV.Q/fluidOutletI.Q; + W_GV_primary = (fluidInlet1.h - fluidOutletI1.h)*fluidInlet1.Q; + W_GV_secondary = -(fluidInlet.h - fluidOutletI.h)*fluidInlet.Q; + + /* Unconnected purge outlet */ + if (cardinality(fluidOutletI_purge) == 1) then + fluidOutletI_purge.Q = 0; + fluidOutletI_purge.h_vol_2 = 1.e5; + fluidOutletI_purge.diff_res_2 = 0; + fluidOutletI_purge.diff_on_2 = false; + end if; + + connect(UtubeHotLeg.C2, UtubeColdLeg.C1) annotation (Line( points={{-67,-11},{-67,-2},{67,-2},{67,-11}}, color={127,0,0}, thickness=0.5)); @@ -296,7 +354,7 @@ equation points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}}, color={127,0,0}, thickness=0.5)); - connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line( + connect(UtubeColdLeg.C2, fluidOutletI1) annotation (Line( points={{67,-72},{68,-78},{68,-122},{46,-122}}, color={127,0,0}, thickness=0.5)); @@ -308,15 +366,15 @@ equation points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}}, color={191,95,0}, thickness=0.5)); - connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line( + connect(heatExchangerWall1.WT1, UtubeColdLeg.CTh) annotation (Line( points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}}, color={191,95,0}, thickness=0.5)); connect(DownComerGV.C2, volumeA.Ce1) annotation (Line(points={{94.5,-72}, - {94.5,-108},{1,-108},{1,-100}}, color={0,0,255})); - connect(volumeA.Cs, RiserGV.C1) - annotation (Line(points={{1,-80},{0.65,-80},{ - 0.65,-73}}, color={0,0,255})); + {94.5,-128},{1,-128},{1,-120}}, color={0,0,255})); + connect(volumeA.Cs1, DPnulle_Tcirc.C1) annotation (Line(points={{1,-100},{1,-92}}, color={0,0,255})); + connect(DPnulle_Tcirc.C2, RiserGV.C1) annotation (Line(points={{1,-80},{0.65,-80},{0.65,-73}}, color={0,0,255})); + connect(volumeA.Cs2, fluidOutletI_purge) annotation (Line(points={{11,-110},{130,-110},{130,-120},{150,-120}}, color={0,0,255})); connect(RiserGV.C2, volumeA1.Ce1) annotation (Line(points={{0.65,-9},{ -6.12303e-016,-9},{-6.12303e-016,8}}, color={0,0,255})); @@ -333,8 +391,7 @@ equation 0,124},{0,149}}, color={255,0,0})); connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{ 6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255})); - connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{40, - 76.9},{40,63},{53,63}}, color={0,0,255})); + connect(DomeGV.Cd, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,64},{40,64},{40,63},{53,63}}, color={0,0,255})); connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5}, {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255})); annotation (Diagram(coordinateSystem( @@ -348,7 +405,7 @@ equation extent={{-126,153},{-84,123}}, lineColor={0,0,255}, textString= - "= 1GV")}), + "= 1 SG")}), Icon(coordinateSystem( preserveAspectRatio=false, extent={{-150,-150},{150,150}}, diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo deleted file mode 100644 index 570e0781..00000000 --- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo +++ /dev/null @@ -1,410 +0,0 @@ -within ThermoSysPro.Fluid.HeatExchangers; -model SteamGenerator_4SG "Single steam generator equivalent to four steam generators" - extends ThermoSysPro.Fluid.Interfaces.IconColors; - - replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the secondary water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - replaceable package Medium_Primary = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the primary side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); - - parameter Real H0_Mix_AlimDomeGV=1194812.89980521; - parameter Boolean inertia=false - "true: momentum balance equation with inertia - false: without inertia"; - parameter Boolean advection=false - "true: momentum balance equation with advection terme - false: without advection terme"; - parameter Boolean dynamic_energy_balance=true - "true: dynamic energy balance equation - false: static energy balance equation"; - parameter Boolean dynamic_mass_balance=true - "true: dynamic mass balance equation - false: static mass balance equation (active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter Boolean simplified_dynamic_energy_balance=true - "true: simplified dynamic energy balance equation - false: full dynamic energy balance equation (active if dynamic_energy_balance=true and dynamic_mass_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and dynamic_mass_balance)); - parameter Boolean steady_state=true - "true: start from steady state - false: start from T0 (if option_temperature = true) or h0 (if option_temperature=false)(active if dynamic_energy_balance=true)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance)); - parameter Real Vf0=0.1 "Fraction of initial water volume in the drum (active if dynamic_energy_balance=true and steady_state=false)" annotation(Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state)); - parameter Units.SI.AbsolutePressure P0=50.e5 - "Fluid initial pressure in the drum (active if dynamic_energy_balance=true and steady_state=false)" - annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not - steady_state)); - parameter Boolean option_temperature=false - "true: initial temperature is fixed - false: initial specific enthalpy is fixed (active if steady_state=false)" annotation(Evaluate=true, Dialog(enable=not steady_state)); - parameter Boolean continuous_flow_reversal=false - "true: continuous flow reversal - false: discontinuous flow reversal"; - parameter Boolean diffusion=false - "true: energy balance equation with diffusion - false: energy balance equation without diffusion"; - -public - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg( - redeclare package Medium = Medium_Primary, - L=10.848, - D=0.01687, - z2=10.848, - h(start={1483455.66417054,1452982.36179149,1407381.72335656,1372666.398393, - 1346263.00297153,1326153.46646787,1326153}), - Ns=5, - ntubes=21360, - dpfCorr=0.17, - hcCorr=5, - inertia=inertia, - advection=advection, - dynamic_energy_balance=dynamic_energy_balance, - dynamic_mass_balance=dynamic_mass_balance, - simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, - steady_state=steady_state, - option_temperature=option_temperature, - continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - P(start={15548026.576998,15539261.540558,15513354.885726,15479081.11289,15444819.569988, - 15410560.642776,15395560}), - Tp(start={564,562,560,559,568})) - annotation (Placement(transformation( - origin={-67,-41.5}, - extent={{30.5,-15},{-30.5,15}}, - rotation=270))); - - ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdtLeg( - redeclare package Medium = Medium_Primary, - L=10.848, - D=0.01687, - z1=10.848, - h(start={1326153.46646787,1310848.36111251,1299218.76228131, - 1290360.28876122,1283604.94388924,1280654.73156587,1280654.73156587}), - ntubes=21360, - dpfCorr=0.17, - hcCorr=5, - Ns=5, - inertia=inertia, - advection=advection, - dynamic_energy_balance=dynamic_energy_balance, - dynamic_mass_balance=dynamic_mass_balance, - simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, - steady_state=steady_state, - option_temperature=option_temperature, - continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - P(start={15393431.104025,15393244.26355,15392971.944187,15392877.066005,15392915.646752, - 15393000.834432,15393020}), - Tp(start={584,580,575,571,568})) - annotation (Placement(transformation( - origin={67,-41.5}, - extent={{30.5,-14},{-30.5,14}}, - rotation=90))); - - ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV( - redeclare package Medium = Medium, - hl(start=1257382.15477056), - hv(start=2771260.46625813), - Mp=32000, - cpp=500, - R=4.2818979, - L=8.625, - Cd(P(start=67.9e5)), - zl(fixed=false, start=0.66), - dynamic_energy_balance=dynamic_energy_balance, - steady_state=steady_state, - Vf0=Vf0, - P0=P0, - continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion) annotation (Placement(transformation(extent={{ - -22,64},{22,107}}, rotation=0))); -protected - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone( - redeclare package Medium = Medium, - L=1, - D=0.95886, - lambda=0.03, - inertia=inertia) - annotation (Placement(transformation( - origin={0,39.5}, - extent={{-7.5,-10},{7.5,10}}, - rotation=90))); -public - ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV( - redeclare package Medium = Medium, - h0=H0_Mix_AlimDomeGV, - h(start=1194851.37111438), - V=0.01, - dynamic_energy_balance=dynamic_energy_balance, - dynamic_mass_balance=dynamic_mass_balance, - steady_state=steady_state, - continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion) " " - annotation (Placement(transformation( - origin={94,63}, - extent={{-8,-8},{8,8}}, - rotation=270))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc( - redeclare package Medium = Medium, K=1e-4, rho(start=839)) - annotation (Placement(transformation( - origin={94,88}, - extent={{-6,-7},{6,7}}, - rotation=270))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc( - redeclare package Medium = Medium, - p_rho=0, - C2(P(start=6829391.22090726), Q(fixed=false, start=6643)), - K=0.172144, - rho(start=742)) annotation (Placement(transformation(extent= - {{53,53},{63,73}}, rotation=0))); - -public - ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim(redeclare package Medium = Medium) - annotation (Placement(transformation( - origin={99,26}, - extent={{-6,-6},{6,6}}, - rotation=270))); - - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation= - 0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet(redeclare package Medium = Medium) annotation ( - Placement(transformation(extent={{42,102},{62,122}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1(redeclare package Medium = Medium_Primary) annotation ( - Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0))); - ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1(redeclare package Medium = Medium_Primary) - annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation= - 0))); - ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal - annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation= - 0))); -public - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV( - redeclare package Medium = Medium, - p_rho=0, - h(start=1194851.3), - z1=10.8, - C1( - h_vol_1(start=1.1733e6), - h(start=1.1733e6), - Q(start=7525.84), - P(start=6829391.22090726)), - Q(start=7525.84), - L=10.8, - D=0.216, - ntubes=128, - C2( - h_vol_1(start=1.1733e6), - Q(start=7525.84), - h(start=1.1733e6), - P(fixed=false, start=68.4935e5)), - lambda=0.08, - inertia=inertia) - "DownComerGV" annotation (Placement(transformation( - origin={94.5,-41}, - extent={{-31,16.5},{31,-16.5}}, - rotation=270))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall( - L=10.848, - D=0.01687, - e=2.18e-3, - lambda=23, - cpw=503, - rhow=8430, - ntubes=21360, - Ns=5, - dynamic_energy_balance=dynamic_energy_balance, - Tp(start={571,568,566,564,562})) - annotation (Placement(transformation( - origin={-44,-41}, - extent={{-33,-16},{33,16}}, - rotation=270))); - Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1( - L=10.848, - D=0.01687, - e=2.18e-3, - lambda=23, - cpw=503, - rhow=8430, - ntubes=21360, - Ns=5, - dynamic_energy_balance=dynamic_energy_balance, - Tp(start={563,560,558,557,556})) - annotation (Placement(transformation( - origin={44,-41}, - extent={{-33,16},{33,-16}}, - rotation=270))); - - ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV( - redeclare package Medium = Medium, - Ns=5, - Q(start={8600,8600,8600,8600,8600,8600}), - h(start={1194851.37008144,1260885.3160958,1364323.64228458,1450411.24087846, - 1525552.01981793,1595519.78942018,1595519.78863864}), - D=0.03689, - ntubes=22056, - L=10.848, - z2=10.848, - hcCorr=5, - inertia=inertia, - advection=advection, - dynamic_energy_balance=dynamic_energy_balance, - dynamic_mass_balance=dynamic_mass_balance, - simplified_dynamic_energy_balance=simplified_dynamic_energy_balance, - steady_state=steady_state, - option_temperature=option_temperature, - continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion, - P(start={6866734.6044951,6862203.9025063,6853535.2456408,6846247.0825137,6840314.8313501, - 6834912.1497303,6828884.4924605}), - Tp1(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902}), - Tp2(start={563.83109489963,562.97171435789,562.21322867383,561.55248247184,560.97588254902})) - annotation (Placement(transformation( - origin={-2.5,-41}, - extent={{-32,31.5},{32,-31.5}}, - rotation=90))); - - ThermoSysPro.Fluid.Volumes.VolumeC volumeA( - redeclare package Medium = Medium, - h0=1185.2e3, - dynamic_energy_balance=dynamic_energy_balance, - dynamic_mass_balance=dynamic_mass_balance, - P0=6849350) annotation (Placement(transformation( - origin={0.5,-92}, - extent={{-8,-8.5},{8,8.5}}, - rotation=90))); - ThermoSysPro.Fluid.Volumes.VolumeC volumeA1( - redeclare package Medium = Medium, - dynamic_energy_balance=dynamic_energy_balance, - dynamic_mass_balance=dynamic_mass_balance, - steady_state=steady_state, - continuous_flow_reversal=continuous_flow_reversal, - diffusion=diffusion) annotation ( - Placement(transformation( - origin={-0.5,17}, - extent={{-9,-9.5},{9,9.5}}, - rotation=90))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Vapeur(redeclare package Medium = Medium, K= - 1e-4, Q(start=2113)) - annotation (Placement(transformation( - origin={-0.5,124}, - extent={{6,-6.5},{-6,6.5}}, - rotation=270))); -equation - connect(UtubeHotLeg.C2, UtubeColdtLeg.C1) annotation (Line( - points={{-67,-11},{-67,-2},{67,-2},{67,-11}}, - color={127,0,0}, - thickness=0.5)); - connect(MixAlimDomeGV.Ce1, DPnulle_AlimDwnc.C2) - annotation (Line(points={{94,71},{94,82}}, thickness=0.5)); - connect(DPnulle_DomeDwnc.C2, MixAlimDomeGV.Ce3) annotation (Line( - points={{63,63},{86,63}}, - color={0,0,255}, - thickness=0.5)); - connect(MixAlimDomeGV.Cs, CapteurPAlim.C1) annotation (Line( - points={{94,55},{94.2,32}}, - color={0,0,255}, - thickness=0.5)); - connect(DPnulle_AlimDwnc.C1, fluidInlet) - annotation (Line(points={{94,94},{94,100.5},{52,100.5},{52,112}})); - connect(fluidInlet1, UtubeHotLeg.C1) annotation (Line( - points={{-46,-122},{-66,-122},{-66,-72},{-67,-72}}, - color={127,0,0}, - thickness=0.5)); - connect(UtubeColdtLeg.C2, fluidOutletI1) annotation (Line( - points={{67,-72},{68,-78},{68,-122},{46,-122}}, - color={127,0,0}, - thickness=0.5)); - connect(CapteurPAlim.C2, DownComerGV.C1) annotation (Line( - points={{94.2,19.88},{94.2,18},{94,18},{94,4},{94.5,4},{94.5,-10}}, - color={0,0,255}, - thickness=0.5)); - connect(UtubeHotLeg.CTh, heatExchangerWall.WT1) annotation (Line( - points={{-62.5,-41.5},{-57.25,-41.5},{-57.25,-41},{-47.2,-41}}, - color={191,95,0}, - thickness=0.5)); - connect(heatExchangerWall1.WT1, UtubeColdtLeg.CTh) annotation (Line( - points={{47.2,-41},{58,-41},{58,-41.5},{62.8,-41.5}}, - color={191,95,0}, - thickness=0.5)); - connect(DownComerGV.C2, volumeA.Ce1) annotation (Line(points={{94.5,-72}, - {94.5,-108},{0.5,-108},{0.5,-100}}, color={0,0,255})); - connect(volumeA.Cs, RiserGV.C1) - annotation (Line(points={{0.5,-84},{0.65,-84},{ - 0.65,-73}}, color={0,0,255})); - connect(RiserGV.C2, volumeA1.Ce1) - annotation (Line(points={{0.65,-9},{-0.5,-9},{ - -0.5,8}}, color={0,0,255})); - connect(volumeA1.Cs, DPSeparateurCyclone.C1) annotation (Line(points={{-0.5,26}, - {-6.12303e-016,26},{-6.12303e-016,32}}, color={0,0, - 255})); - connect(heatExchangerWall.WT2, RiserGV.CTh2) - annotation (Line(points={{-40.8, - -41},{-18.25,-41}}, color={191,95,0})); - connect(RiserGV.CTh1, heatExchangerWall1.WT2) - annotation (Line(points={{19.55,-41}, - {30,-41},{40.8,-41}}, color={191,95,0})); - connect(DPSeparateurCyclone.C2, DomeGV.Cm) annotation (Line(points={{ - 6.12303e-016,47},{6.12303e-016,52},{22,52},{22,64}}, color={0,0,255})); - connect(DomeGV.Cs, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,76.9},{ - 40,76.9},{40,63},{53,63}}, color={0,0,255})); - connect(DomeGV.Cv, DPnulle_Vapeur.C1) annotation (Line(points={{22,107},{22, - 118},{-0.5,118}}, color={255,0,0})); - connect(DPnulle_Vapeur.C2, fluidOutletI) annotation (Line(points={{-0.5,130}, - {0,130},{0,149}}, color={255,0,0})); - connect(DomeGV.yLevel, outputReal) annotation (Line(points={{24.2,85.5},{32,85.5}, - {32,114},{-36,114},{-36,96},{-52,96}}, color={0,0,255})); - annotation (Diagram(coordinateSystem( - preserveAspectRatio=false, - extent={{-150,-150},{150,150}}, - initialScale=0.1), graphics={Text( - extent={{55,81},{55,75}}, - lineColor={0,0,255}, - textString= - "petit DP"), Text( - extent={{-126,153},{-84,123}}, - lineColor={0,0,255}, - textString= - "= 4GV")}), - Icon(coordinateSystem( - preserveAspectRatio=false, - extent={{-150,-150},{150,150}}, - initialScale=0.1), graphics={ - Ellipse( - extent={{-42,150},{42,108}}, - lineColor={0,0,0}, - fillPattern=DynamicSelect(FillPattern.VerticalCylinder, - if dynamic_energy_balance then FillPattern.VerticalCylinder - else FillPattern.Solid), - fillColor={0,128,255}), - Rectangle( - extent={{-42,131},{42,80}}, - lineColor={0,0,0}, - fillPattern=DynamicSelect(FillPattern.VerticalCylinder, - if dynamic_energy_balance then FillPattern.VerticalCylinder - else FillPattern.Solid), - fillColor={0,128,255}), - Ellipse( - extent={{-36,-108},{36,-150}}, - lineColor={0,0,0}, - fillPattern=DynamicSelect(FillPattern.VerticalCylinder, - if dynamic_energy_balance then FillPattern.VerticalCylinder - else FillPattern.Solid), - fillColor={0,128,255}), - Rectangle( - extent={{-42,86},{42,56}}, - lineColor={0,0,0}, - fillPattern=DynamicSelect(FillPattern.VerticalCylinder, - if dynamic_energy_balance then FillPattern.VerticalCylinder - else FillPattern.Solid), - fillColor={170,213,255}), - Rectangle( - extent={{-36,42},{36,-128}}, - lineColor={0,0,0}, - fillPattern=DynamicSelect(FillPattern.VerticalCylinder, - if dynamic_energy_balance then FillPattern.VerticalCylinder - else FillPattern.Solid), - fillColor={170,213,255}), - Polygon( - points={{-42,56},{42,56},{36,42},{-36,42},{-42,56}}, - lineColor={0,0,0}, - fillPattern=DynamicSelect(FillPattern.VerticalCylinder, - if dynamic_energy_balance then FillPattern.VerticalCylinder - else FillPattern.Solid), - fillColor={170,213,255})}), - Documentation(revisions = " -Author - -Baligh El Hefni - - ", info = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 - ")); -end SteamGenerator_4SG; diff --git a/ThermoSysPro/Fluid/HeatExchangers/package.order b/ThermoSysPro/Fluid/HeatExchangers/package.order index 74e2004c..0198cde3 100644 --- a/ThermoSysPro/Fluid/HeatExchangers/package.order +++ b/ThermoSysPro/Fluid/HeatExchangers/package.order @@ -23,4 +23,3 @@ StaticExchangerKS StaticPlateHeatExchanger StaticWallFlueGasesExchanger SteamGenerator_1SG -SteamGenerator_4SG From 10193cdcdc411eb19f9d2b9a7c0113b23a95a7f7 Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 23 Nov 2026 11:50:27 +0100 Subject: [PATCH 212/213] fix trace balance for Qevap/Qcond if negative --- ThermoSysPro/Fluid/Volumes/Pressurizer.mo | 18 +++++++++++++++--- .../Fluid/Volumes/TwoPhaseCavityOnePipe.mo | 16 +++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo index 8bd940a7..59899a3e 100644 --- a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo +++ b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo @@ -107,6 +107,10 @@ public "Liquid phase trace substances"; Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Vapor phase trace substances"; + Medium.ExtraProperty Jcond[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace flow carried by Qcond from the gas phase to the liquid phase"; + Medium.ExtraProperty Jevap[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace flow carried by Qevap from the liquid phase to the gas phase"; Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; Medium.ThermodynamicState state_l "Liquid state in the pressurizer"; @@ -245,17 +249,25 @@ equation /* Traces composition balance equations */ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to every mass transfer between phases. Each transfer removes from one phase - exactly what it adds to the other: the balance is exact for any volatility. */ + exactly what it adds to the other: the balance is exact for any volatility. + Each transfer carries the concentration of the phase it leaves, in the + state given by the energy balances: Qcond is saturated liquid (hls), + Qevap saturated vapour (hvs), in both directions. Qevap is negative when + the liquid phase is subcooled (vapour of the gas phase condenses into it, + at C_v.Cg); Qcond is negative when the gas phase is superheated (liquid + of the liquid phase moves to the gas phase, at C_l.Cl). */ xl = noEvent(max(0, min(1, (hl - hls)/(hvs - hls)))); xv = noEvent(max(0, min(1, (hv - hls)/(hvs - hls)))); if Medium.nC > 0 then C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); end if; + Jcond = noEvent(max(Qcond, 0))*C_v.Cl + noEvent(min(Qcond, 0))*C_l.Cl; + Jevap = noEvent(max(Qevap, 0))*C_l.Cg + noEvent(min(Qevap, 0))*C_v.Cg; SubCSaS = SaS(); - BSubCl = Cas.Q*Cas.SubC - Cex.Q*Cex.SubC + Qcond*C_v.Cl - Qevap*C_l.Cg; - BSubCv = Qevap*C_l.Cg - Cs.Q*Cs.SubC - Qcond*C_v.Cl; + BSubCl = Cas.Q*Cas.SubC - Cex.Q*Cex.SubC + Jcond - Jevap; + BSubCv = Jevap - Cs.Q*Cs.SubC - Jcond; if dynamic_energy_balance then rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo index 48c2eba9..8ce12bfe 100644 --- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo +++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo @@ -57,6 +57,7 @@ protected Medium.C_BiPhase C_bp "Trace partition of the steam inlet mixture CvBP"; Medium.C_BiPhase C_gct "Trace partition of the steam inlet mixture CvGCT"; Medium.C_BiPhase C_v "Trace partition of the gas phase"; + Medium.C_BiPhase C_l "Trace partition of the liquid phase"; public Units.SI.Pressure P(start=10000) "Fluid average pressure"; @@ -141,6 +142,8 @@ public "Liquid phase trace substances"; Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Vapor phase trace substances"; + Medium.ExtraProperty Jcond[Medium.nC](quantity=Medium.extraPropertiesNames) + "Trace flow carried by Qcond from the gas phase to the liquid phase"; Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation"; @@ -317,21 +320,28 @@ equation /* Traces composition balance equations */ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to every mass transfer between phases. Each transfer removes from one phase - exactly what it adds to the other: the balance is exact for any volatility. */ + exactly what it adds to the other: the balance is exact for any volatility. + Each transfer carries the concentration of the phase it leaves, in the + state given by the energy balances. Qcond is transferred at hlsat: it is + saturated liquid in both directions. It is negative when the tubes heat + the gas phase; liquid of the liquid phase then moves to the gas phase, + at C_l.Cl. */ if Medium.nC > 0 then C_in = Medium.equilibriumPartition(Ce.SubC, Medium.vapourQuality(state_in_l), sat.Tsat); C_bp = Medium.equilibriumPartition(CvBP.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); C_gct = Medium.equilibriumPartition(CvGCT.SubC, Medium.vapourQuality(state_in_v), sat.Tsat); C_v = Medium.equilibriumPartition(SubCv, xv, sat.Tsat); + C_l = Medium.equilibriumPartition(SubCl, xl, sat.Tsat); end if; + Jcond = noEvent(max(Qcond, 0))*C_v.Cl + noEvent(min(Qcond, 0))*C_l.Cl; SubCSaS = SaS(); /* The liquid part QcondS of the incoming steam carries the liquid share of its traces */ BSubCl = Ce.Q*Ce.SubC - Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg + CvBP.Q*CvBP.SubC + CvGCT.Q*CvGCT.SubC - Medium.vapourQuality(state_in_v)*(CvBP.Q*C_bp.Cg + CvGCT.Q*C_gct.Cg) - - Cl.Q*Cl.SubC + Qcond*C_v.Cl; + - Cl.Q*Cl.SubC + Jcond; BSubCv = Medium.vapourQuality(state_in_v)*(CvBP.Q*C_bp.Cg + CvGCT.Q*C_gct.Cg) - + Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg - Qcond*C_v.Cl; + + Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg - Jcond; if dynamic_energy_balance then rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl; From 410ac0a5a5a59a90f1bc4ee5b07b9ecd2d55e41b Mon Sep 17 00:00:00 2001 From: Baptiste MAZURIE Date: Mon, 23 Nov 2026 11:58:53 +0100 Subject: [PATCH 213/213] Fix Fluid example to copy WS one --- .../Book/SimpleExamples/Volume/TestPressurizer.mo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo index d304aea2..a41aa3f4 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo @@ -53,8 +53,8 @@ model TestPressurizer hl(start=1629887.98290107), hv(start=2596216.59571565), Zl(start=5.5900717167325), - Yw0=32.92, - steady_state=false, + Yw0=60, + steady_state=true, V=61.12, Rp=1.27, Ae=96.23, @@ -65,9 +65,9 @@ model TestPressurizer Ccond=0.02, Cevap=0.05, Yw(start=32.92), - y(start=0.3292), + y(start=0.3292, fixed=true), P0=15500000, - P(start=15500000), + P(start=15500000, fixed=true), Tp(start=617.94155291055)) annotation( Placement(transformation(extent = {{-92, -12}, {32, 118}}, rotation = 0))); ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(