Skip to content

Commit

Permalink
fix mw with JobackIdeal
Browse files Browse the repository at this point in the history
  • Loading branch information
longemen3000 committed Jan 20, 2025
1 parent bad674f commit 0f422be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/methods/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ end
comp_molecular_weight(mw,z = SA[1.0]) = 0.001*dot(mw,z)
molecular_weight(model) = molecular_weight(model,SA[1.0])
molecular_weight(model::EoSModel,z) = __molecular_weight(model,z)
molecular_weight(mw::AbstractVector,z) = comp_molecular_weight(mw,z)
molecular_weight(mw::SingleParam,z) = comp_molecular_weight(mw.values,z)

function __molecular_weight(model,z)
MW = mw(model)
if has_groups(model)
Expand Down
5 changes: 3 additions & 2 deletions src/models/ideal/JobackIdeal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The estimated critical point of a single component can be obtained via `crit_pur
"""
JobackIdeal
mw(model::JobackIdeal) = model.params.Mw.values
molecular_weight(model::JobackIdeal,z) = molecular_weight(ReidIdeal(model),z)
molecular_weight(model::JobackIdeal,z) = molecular_weight(model.params.Mw,z)
function recombine_impl!(model::JobackIdeal)
coeffs = model.params.coeffs
i_groups = model.groups.i_groups
Expand All @@ -172,7 +172,7 @@ end
function ReidIdeal(model::JobackIdeal)
comps = model.components
coeffs = model.params.coeffs
Mw = model.params.Mw,model
Mw = model.params.Mw
a = SingleParam("a",comps,getindex.(coeffs.values,1))
b = SingleParam("b",comps,getindex.(coeffs.values,2))
c = SingleParam("c",comps,getindex.(coeffs.values,3))
Expand All @@ -183,6 +183,7 @@ function ReidIdeal(model::JobackIdeal)
ReidIdeal(model.components,param,model.references)
end


"""
JobackGC
Expand Down

0 comments on commit 0f422be

Please sign in to comment.