Skip to content

Commit

Permalink
Added predefined mixtures (like R448A, R449A, R450A, etc.) to the Flu…
Browse files Browse the repository at this point in the history
…idsList
  • Loading branch information
portyanikhin committed Sep 18, 2021
1 parent 5519a48 commit 69b2fec
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 14 deletions.
28 changes: 16 additions & 12 deletions SharpProp.Tests/Enums/TestFluidsList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ public static class TestFluidsList
[Test]
public static void TestCoolPropName([Values] FluidsList coolPropFluid)
{
switch (coolPropFluid)
{
case FluidsList.Butene:
Assert.AreEqual("1-Butene", coolPropFluid.CoolPropName());
break;
case FluidsList.WaterIncomp:
Assert.AreEqual("Water", coolPropFluid.CoolPropName());
break;
default:
Assert.AreEqual(coolPropFluid.CoolPropName().RemoveChars('-', '(', ')'), coolPropFluid.ToString());
break;
}
if (coolPropFluid.CoolPropName().EndsWith(".mix"))
Assert.Pass();
else
switch (coolPropFluid)
{
case FluidsList.Butene:
Assert.AreEqual("1-Butene", coolPropFluid.CoolPropName());
break;
case FluidsList.WaterIncomp:
Assert.AreEqual("Water", coolPropFluid.CoolPropName());
break;
default:
Assert.AreEqual(coolPropFluid.CoolPropName().RemoveChars('-', '(', ')'),
coolPropFluid.ToString());
break;
}
}

private static string RemoveChars(this string s, params char[] charsToRemove) =>
Expand Down
1 change: 1 addition & 0 deletions SharpProp.Tests/Fluids/TestFluid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public void TestWithState()
public void TestUpdate([Values] FluidsList name, [Values(1e7, 1e8)] double pressure)
{
if (name is FluidsList.AL or FluidsList.AN) Assert.Pass(); // Cause CoolProp error
if (name.CoolPropName().EndsWith(".mix")) Assert.Pass();
SetUp(name, pressure);
var actual = new List<double?>
{
Expand Down
1 change: 1 addition & 0 deletions SharpProp.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dichloroethane/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Diethyl/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dodecane/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ekofisk/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=HEOS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Hexafluoride/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=INCOMP/@EntryIndexedValue">True</s:Boolean>
Expand Down
109 changes: 108 additions & 1 deletion SharpProp/Enums/FluidsList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,113 @@ public enum FluidsList
[FluidInfo("ZFC", "INCOMP", false, Mix.Volume, 0.3, 0.6)] ZFC,
[FluidInfo("ZLC", "INCOMP", false, Mix.Volume, 0.3, 0.7)] ZLC,
[FluidInfo("ZM", "INCOMP", false, Mix.Volume)] ZM,
[FluidInfo("ZMC", "INCOMP", false, Mix.Volume, 0.3, 0.7)] ZMC
[FluidInfo("ZMC", "INCOMP", false, Mix.Volume, 0.3, 0.7)] ZMC,

// Predefined mixtures
[FluidInfo("Air.mix")] AirMix,
[FluidInfo("Amarillo.mix")] Amarillo,
[FluidInfo("Ekofisk.mix")] Ekofisk,
[FluidInfo("GulfCoast.mix")] GulfCoast,
[FluidInfo("GulfCoastGas(NIST1).mix")] GulfCoastGasNIST,
[FluidInfo("HighCO2.mix")] HighCO2,
[FluidInfo("HighN2.mix")] HighN2,
[FluidInfo("NaturalGasSample.mix")] NaturalGasSample,
[FluidInfo("R401A.mix")] R401A,
[FluidInfo("R401B.mix")] R401B,
[FluidInfo("R401C.mix")] R401C,
[FluidInfo("R402A.mix")] R402A,
[FluidInfo("R402B.mix")] R402B,
[FluidInfo("R403A.mix")] R403A,
[FluidInfo("R403B.mix")] R403B,
[FluidInfo("R404A.mix")] R404AMix,
[FluidInfo("R405A.mix")] R405A,
[FluidInfo("R406A.mix")] R406A,
[FluidInfo("R407A.mix")] R407A,
[FluidInfo("R407B.mix")] R407B,
[FluidInfo("R407C.mix")] R407CMix,
[FluidInfo("R407D.mix")] R407D,
[FluidInfo("R407E.mix")] R407E,
[FluidInfo("R407F.mix")] R407F,
[FluidInfo("R408A.mix")] R408A,
[FluidInfo("R409A.mix")] R409A,
[FluidInfo("R409B.mix")] R409B,
[FluidInfo("R410A.mix")] R410AMix,
[FluidInfo("R410B.mix")] R410B,
[FluidInfo("R411A.mix")] R411A,
[FluidInfo("R411B.mix")] R411B,
[FluidInfo("R412A.mix")] R412A,
[FluidInfo("R413A.mix")] R413A,
[FluidInfo("R414A.mix")] R414A,
[FluidInfo("R414B.mix")] R414B,
[FluidInfo("R415A.mix")] R415A,
[FluidInfo("R415B.mix")] R415B,
[FluidInfo("R416A.mix")] R416A,
[FluidInfo("R417A.mix")] R417A,
[FluidInfo("R417B.mix")] R417B,
[FluidInfo("R417C.mix")] R417C,
[FluidInfo("R418A.mix")] R418A,
[FluidInfo("R419A.mix")] R419A,
[FluidInfo("R419B.mix")] R419B,
[FluidInfo("R420A.mix")] R420A,
[FluidInfo("R421A.mix")] R421A,
[FluidInfo("R421B.mix")] R421B,
[FluidInfo("R422A.mix")] R422A,
[FluidInfo("R422B.mix")] R422B,
[FluidInfo("R422C.mix")] R422C,
[FluidInfo("R422D.mix")] R422D,
[FluidInfo("R422E.mix")] R422E,
[FluidInfo("R423A.mix")] R423A,
[FluidInfo("R424A.mix")] R424A,
[FluidInfo("R425A.mix")] R425A,
[FluidInfo("R426A.mix")] R426A,
[FluidInfo("R427A.mix")] R427A,
[FluidInfo("R428A.mix")] R428A,
[FluidInfo("R429A.mix")] R429A,
[FluidInfo("R430A.mix")] R430A,
[FluidInfo("R431A.mix")] R431A,
[FluidInfo("R432A.mix")] R432A,
[FluidInfo("R433A.mix")] R433A,
[FluidInfo("R433B.mix")] R433B,
[FluidInfo("R433C.mix")] R433C,
[FluidInfo("R434A.mix")] R434A,
[FluidInfo("R435A.mix")] R435A,
[FluidInfo("R436A.mix")] R436A,
[FluidInfo("R436B.mix")] R436B,
[FluidInfo("R437A.mix")] R437A,
[FluidInfo("R438A.mix")] R438A,
[FluidInfo("R439A.mix")] R439A,
[FluidInfo("R440A.mix")] R440A,
[FluidInfo("R441A.mix")] R441A,
[FluidInfo("R442A.mix")] R442A,
[FluidInfo("R443A.mix")] R443A,
[FluidInfo("R444A.mix")] R444A,
[FluidInfo("R444B.mix")] R444B,
[FluidInfo("R445A.mix")] R445A,
[FluidInfo("R446A.mix")] R446A,
[FluidInfo("R447A.mix")] R447A,
[FluidInfo("R448A.mix")] R448A,
[FluidInfo("R449A.mix")] R449A,
[FluidInfo("R449B.mix")] R449B,
[FluidInfo("R450A.mix")] R450A,
[FluidInfo("R451A.mix")] R451A,
[FluidInfo("R451B.mix")] R451B,
[FluidInfo("R452A.mix")] R452A,
[FluidInfo("R453A.mix")] R453A,
[FluidInfo("R454A.mix")] R454A,
[FluidInfo("R454B.mix")] R454B,
[FluidInfo("R500.mix")] R500,
[FluidInfo("R501.mix")] R501,
[FluidInfo("R502.mix")] R502,
[FluidInfo("R503.mix")] R503,
[FluidInfo("R504.mix")] R504,
[FluidInfo("R507A.mix")] R507AMix,
[FluidInfo("R508A.mix")] R508A,
[FluidInfo("R508B.mix")] R508B,
[FluidInfo("R509A.mix")] R509A,
[FluidInfo("R510A.mix")] R510A,
[FluidInfo("R511A.mix")] R511A,
[FluidInfo("R512A.mix")] R512A,
[FluidInfo("R513A.mix")] R513A,
[FluidInfo("TypicalNaturalGas.mix")] TypicalNaturalGas
}
}
2 changes: 1 addition & 1 deletion SharpProp/SharpProp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<PackageIconFullPath>$(MSBuildThisFileDirectory)pictures\icon.png</PackageIconFullPath>
<PackageVersion>1.0.6</PackageVersion>
<PackageVersion>1.1.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 69b2fec

Please sign in to comment.