Skip to content

Commit bdd99b1

Browse files
committed
restore all performance of implicit ad in the saturation_pressure case
1 parent 3903181 commit bdd99b1

File tree

1 file changed

+7
-7
lines changed
  • src/methods/property_solvers/singlecomponent/saturation

1 file changed

+7
-7
lines changed

src/methods/property_solvers/singlecomponent/saturation/saturation.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ end
8484

8585
function saturation_pressure_ad(result,tup,tup_primal)
8686
if any(has_dual,tup) # do check here to avoid recomputation of pressure if no AD
87-
f(x,tups) = begin
87+
ff(x,tups) = begin
8888
model,T = tups
8989
vl,vv = x
9090
return μp_equality1_p(model,model,vl,vv,T,1.0,1.0)
9191
end
9292
λx = SVector(result[2],result[3])
93-
∂v = __gradients_for_root_finders(λx,tup,tup_primal,f)
94-
vl,vv = ∂v
93+
∂v = __gradients_for_root_finders(λx,tup,tup_primal,ff)
94+
vl,vv = ∂v
9595
∂model,∂T = tup
96-
p = pressure(∂model,vl,∂T)
97-
return p,vl,vv
96+
p = pressure(∂model,vl,∂T)
97+
return p,vl,vv
9898
end
9999
return result
100100
end
@@ -178,8 +178,8 @@ function saturation_temperature_ad(result,tup,tup_primal)
178178
return μp_equality1_T(model,model,vl,vv,p,T,1.0,1.0)
179179
end
180180
λx = SVector(result)
181-
T,vl,vv = __gradients_for_root_finders(λx,tup,tup_primal,f)
182-
return T,vl,vv
181+
∂T,∂vl,vv = __gradients_for_root_finders(λx,tup,tup_primal,f)
182+
return ∂T,∂vl,vv
183183
end
184184

185185
include("ChemPotV.jl")

0 commit comments

Comments
 (0)