Skip to content

Commit

Permalink
Merge pull request #5 from rameshputalapattu/new_functions
Browse files Browse the repository at this point in the history
added test cases for molar_density and mass_density functions
  • Loading branch information
rameshputalapattu authored Aug 2, 2021
2 parents 8232204 + 9fcf3e9 commit 05a6b93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions test/test_methods_density.jl
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 05a6b93

Please sign in to comment.