diff --git a/test/runtests.jl b/test/runtests.jl index d0714d197..f4432f06d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,4 +4,5 @@ using Clapeyron, Test include("test_database.jl") include("test_models.jl") include("test_methods.jl") + include("test_methods_density.jl") end diff --git a/test/test_methods_density.jl b/test/test_methods_density.jl new file mode 100644 index 000000000..d31a61b12 --- /dev/null +++ b/test/test_methods_density.jl @@ -0,0 +1,10 @@ +using Unitful,Clapeyron,Test +@testset "testing density methods for GERG2008" begin + model = Clapeyron.GERG2008(["nitrogen","methane","ethane","propane","butane","isobutane","pentane"]) + lng_composition = [0.93,92.1,4.64,1.7,0.42,0.32,0.09] + lng_composition_molar_fractions = lng_composition ./sum(lng_composition) + @test Clapeyron.molar_density(model,(380.5+101.3)*1000.0,-153.0+273.15,lng_composition_molar_fractions)/1000 ≈ 24.98 rtol = 1E-2 + @test Clapeyron.mass_density(model,(380.5+101.3)*1000.0,-153.0+273.15,lng_composition_molar_fractions) ≈ 440.73 rtol = 1E-2 + @test Clapeyron.molar_density(model,(380.5+101.3)u"kPa",-153.0u"°C",lng_composition_molar_fractions;output=u"mol/L") ≈ 24.98*u"mol/L" rtol=1E-2 + @test Clapeyron.mass_density(model,(380.5+101.3)u"kPa",-153.0u"°C",lng_composition_molar_fractions;output=u"kg/m^3") ≈ 440.73*u"kg/m^3" rtol=1E-2 +end