From 7f12919b51da13da14008372ba6fde7ef79935d1 Mon Sep 17 00:00:00 2001 From: longemen3000 Date: Fri, 20 Dec 2024 17:06:05 -0300 Subject: [PATCH] add test for ps_flash (#320) --- src/methods/property_solvers/multicomponent/flash/PS.jl | 2 +- test/test_methods_api.jl | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/methods/property_solvers/multicomponent/flash/PS.jl b/src/methods/property_solvers/multicomponent/flash/PS.jl index 6b15d642b..80968c42f 100644 --- a/src/methods/property_solvers/multicomponent/flash/PS.jl +++ b/src/methods/property_solvers/multicomponent/flash/PS.jl @@ -24,7 +24,7 @@ function init_preferred_method(method::typeof(ps_flash),model::EoSModel,kwargs) end function ps_flash(model,p,s,z,method::FlashMethod) - check_arraysize(model,n) + check_arraysize(model,z) if supports_reduction(method) model_r,idx_r = index_reduction(model,z) z_r = z[idx_r] diff --git a/test/test_methods_api.jl b/test/test_methods_api.jl index 8a2fee009..9c5f19a1f 100644 --- a/test/test_methods_api.jl +++ b/test/test_methods_api.jl @@ -379,7 +379,12 @@ end res1 = ph_flash(model,p,h,z) @test enthalpy(model,res1) ≈ h rtol = 1e-6 - + #test for ps_flash: + model = cPR(["ethane"],idealmodel = ReidIdeal); + s = 100;p=101325;z = [1.0]; + h = Clapeyron.PS.enthalpy(model,p,s,z) + s2 = Clapeyron.PH.entropy(model,p,h,z) + @test s ≈ s2 rtol = 1e-6 #examples for qt, qp flash (#314) model = cPR(["ethane","propane"],idealmodel=ReidIdeal) res2 = qt_flash(model,0.5,208.0,[0.5,0.5])