Skip to content

qp_flash at dew point #390

@Sush1090

Description

@Sush1090

Hello,

There seems to be a bug for qp_flash at the q = 1.0, my guess is that in originates in qp_flash_x0(model,β,p,z,method::FlashMethod).

The computations at dew point return NaN for temperature. But the computation through direct dew_temperature returns expected values.

example:

using Clapeyron, Plots

model = cPR(["isopentane","toluene"],idealmodel=ReidIdeal)
z = [0.5,0.5]
_,p_crit,_ = crit_mix(model,z)
p = collect(range(101325,p_crit,100))
T_bubble = similar(p)
T_dew = similar(p)
s_bubble = similar(p)
s_dew = similar(p)
q0 = 0.0; q1 = 1.0
for i in eachindex(p)
    @show i

    T_bubble[i] = Clapeyron.temperature(qp_flash(model,q0,p[i],z))
    T_dew[i] = Clapeyron.temperature(qp_flash(model,q1,p[i],z))
    s_bubble[i] = Clapeyron.entropy(model,qp_flash(model,q0,p[i],z))
    s_dew[i] = Clapeyron.entropy(model,qp_flash(model,q1,p[i],z))
end

fig1 = plot(s_bubble,T_bubble,label = "Bubble temperature",xlabel = "Entropy (J/K)", ylabel = "Temperature (K)", title = "$(model.components) ,  $z")
plot!(s_dew,T_dew,label = "Dew temperature")

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    FlashIssues related to flash calculationsmethod improvementsThere is a faster method to implement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions