From b3b250a5bc0cbc847840a095ac230d71115881cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 11:27:17 +0000 Subject: [PATCH 1/3] Bump SharpProp from 7.2.11 to 7.3.0 Bumps [SharpProp](https://github.com/portyanikhin/SharpProp) from 7.2.11 to 7.3.0. - [Release notes](https://github.com/portyanikhin/SharpProp/releases) - [Commits](https://github.com/portyanikhin/SharpProp/compare/v7.2.11...v7.3.0) --- updated-dependencies: - dependency-name: SharpProp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/VCRC/VCRC.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VCRC/VCRC.csproj b/src/VCRC/VCRC.csproj index 2167be9..a947753 100644 --- a/src/VCRC/VCRC.csproj +++ b/src/VCRC/VCRC.csproj @@ -10,7 +10,7 @@ - + From 21a50baaa46364d686421ea8682327fbe8254048 Mon Sep 17 00:00:00 2001 From: Vladimir Portyanikhin <86243191+portyanikhin@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:45:07 +0300 Subject: [PATCH 2/3] Updated settings --- VCRC.sln.DotSettings | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/VCRC.sln.DotSettings b/VCRC.sln.DotSettings index 0ff626f..3093acc 100644 --- a/VCRC.sln.DotSettings +++ b/VCRC.sln.DotSettings @@ -1,6 +1,4 @@ - + CIC @@ -55,6 +53,9 @@ True + + True + True From 8fcdc0e8d0fec4d9bb9d906ac4696544ccc03354 Mon Sep 17 00:00:00 2001 From: Vladimir Portyanikhin <86243191+portyanikhin@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:45:52 +0300 Subject: [PATCH 3/3] Refactoring --- src/VCRC/Fluids/IRefrigerant.cs | 6 ++++++ src/VCRC/Fluids/Refrigerant.cs | 7 ++++--- tests/VCRC.Tests/Fluids/RefrigerantTests.cs | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/VCRC/Fluids/IRefrigerant.cs b/src/VCRC/Fluids/IRefrigerant.cs index e96f6c1..845b63d 100644 --- a/src/VCRC/Fluids/IRefrigerant.cs +++ b/src/VCRC/Fluids/IRefrigerant.cs @@ -90,6 +90,12 @@ public interface IRefrigerant : IFluid /// Invalid superheat! IRefrigerant Superheated(Pressure pressure, TemperatureDelta superheat); + /// + new IRefrigerant SpecifyPhase(Phases phase); + + /// + new IRefrigerant UnspecifyPhase(); + /// new IRefrigerant WithState( IKeyedInput firstInput, diff --git a/src/VCRC/Fluids/Refrigerant.cs b/src/VCRC/Fluids/Refrigerant.cs index 615df9a..b552100 100644 --- a/src/VCRC/Fluids/Refrigerant.cs +++ b/src/VCRC/Fluids/Refrigerant.cs @@ -32,11 +32,8 @@ public Refrigerant(FluidsList name) .ToUnit(TemperatureDeltaUnit.Kelvin); public bool HasGlide => Glide > 0.01.Kelvins(); - public bool IsSingleComponent => !IsAzeotropicBlend && !IsZeotropicBlend; - public bool IsAzeotropicBlend => BlendRegex(false).IsMatch(Name.ToString()); - public bool IsZeotropicBlend => BlendRegex(true).IsMatch(Name.ToString()); public IRefrigerant Subcooled( @@ -64,6 +61,10 @@ public IRefrigerant Superheated(Pressure pressure, TemperatureDelta superheat) = : superheat.Equals(TemperatureDelta.Zero, Tolerance.Kelvins()) ? DewPointAt(pressure) : DewPointAt(pressure).HeatingTo(DewPointAt(pressure).Temperature + superheat); + public new IRefrigerant SpecifyPhase(Phases phase) => (Refrigerant)base.SpecifyPhase(phase); + + public new IRefrigerant UnspecifyPhase() => (Refrigerant)base.UnspecifyPhase(); + public new IRefrigerant WithState( IKeyedInput firstInput, IKeyedInput secondInput diff --git a/tests/VCRC.Tests/Fluids/RefrigerantTests.cs b/tests/VCRC.Tests/Fluids/RefrigerantTests.cs index 672ee0a..dd39b7f 100644 --- a/tests/VCRC.Tests/Fluids/RefrigerantTests.cs +++ b/tests/VCRC.Tests/Fluids/RefrigerantTests.cs @@ -256,6 +256,7 @@ public void Methods_New_ReturnsInstancesOfTheRefrigerantType() { _sut.Clone().Should().BeOfType(); _sut.Factory().Should().BeOfType(); + _sut.SpecifyPhase(Phases.Gas).UnspecifyPhase().Should().BeOfType(); _sut.IsentropicCompressionTo(HighPressure).Should().BeOfType(); _sut.CompressionTo(HighPressure, _isentropicEfficiency).Should().BeOfType(); _sut.IsenthalpicExpansionTo(LowPressure).Should().BeOfType();