-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PH_property
bugs
#320
Comments
Uff, big bug, let me fix it and release a new version, if you find anything else let me know |
i saw the offending code, and the correct answer seems to remove the
if condition and replace it with just Clapeyron.jl/src/methods/property_solvers/Pproperty.jl Lines 191 to 194 in 1ff747f
Clapeyron.jl/src/methods/property_solvers/Tproperty.jl Lines 213 to 216 in 1ff747f
|
Hello, model = cPR(["ethane"],idealmodel = ReidIdeal);
p = 101325;h = 100; z = [1]; T = Clapeyron.PH.temperature(model,p,h,z) error: ERROR: UndefVarError: `T` not defined in local scope
Suggestion: check for an assignment to a local variable that shadows a global of the same name.
Stacktrace:
[1] px_flash_pure(model::PR{ReidIdeal, TwuAlpha, NoTranslation, vdW1fRule}, p::Int64, x::Int64, z::Vector{Int64}, spec::typeof(enthalpy), T0::Nothing) |
good catch, just fixed. If everything goes alright, I'm releasing after tests pass |
There is also one in model = cPR(["ethane"],idealmodel = ReidIdeal);
s = 100;p=101325;z = [1.0];
Clapeyron.PS.enthalpy(model,p,s,z) ERROR: UndefVarError: `n` not defined in `Clapeyron`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
[1] ps_flash(model::PR{ReidIdeal, TwuAlpha, NoTranslation, vdW1fRule}, p::Int64, s::Int64, z::Vector{Float64}, method::GeneralizedXYFlash{Nothing, Nothing}) |
There is another one here: model = cPR(["ethane"],idealmodel = ReidIdeal)
p = 101325; z = [5.0];
T = saturation_temperature(model,p)[1]
h_liq = enthalpy(model,p,T-0.1,z);h_gas = enthalpy(model,p,T+0.1,z)
h = (h_liq + h_gas)/2
PH.temperature(model,p,h,z) error: ERROR: LoadError: UndefVarError: `build_flash_result_pure` not defined in `Clapeyron`
Suggestion: check for spelling errors or missing imports. |
Hello,
using Clapeyron
using Clapeyron: PH
model = cPR(["ethane"],idealmodel = ReidIdeal)
p = 101325; z = [5.0];
T = saturation_temperature(model,p)[1]
h_liq = enthalpy(model,p,T-0.1,z);h_gas = enthalpy(model,p,T+0.1,z)
h = (h_liq + h_gas)/2
V = PH.volume(model,p,h,z)
VT_p = pressure(model,V,T,z)
@show p ≈ VT_p
using Clapeyron
using Clapeyron: PH
model = cPR(["methane"],idealmodel = ReidIdeal)
p = 101325; z = [5.0];
T = 210.0
h = enthalpy(model,p,T,z)
V = PH.volume(model,p,h,z) ERROR: MethodError: no method matching one(::StaticArraysCore.SVector{1, Float64})
The function `one` exists, but no method is defined for this combination of argument types. The one that was fixed fails now this one |
on 1. that is because the result is in a two phase state. the volume in a two phase state is the sum of the volumes in each phase. i cannot reproduce 2. (and all the reported problems here run in CI). btw i just added a |
the second one works now. I don't know what was wrong before |
Hello,
I have two points:
Error:
fix:
In
PH_property(...)
computeTproperty
outsidephase
if conditionTproperty
andPproperty
: I think if the input pressure or temperature given to the solver is above critical value the root finder can be initialized to critical value. I had mentioned it forTproperty
here but it can also be extended toPproperty
.Thank you
The text was updated successfully, but these errors were encountered: