Skip to content

Commit

Permalink
add test for ps_flash (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
longemen3000 committed Dec 20, 2024
1 parent 7c8e255 commit 7f12919
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/methods/property_solvers/multicomponent/flash/PS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
7 changes: 6 additions & 1 deletion test/test_methods_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 7f12919

Please sign in to comment.