From 363b8f7be75a5c26bf5e8dbeaf949878c248ee99 Mon Sep 17 00:00:00 2001 From: Anna Doner Date: Wed, 8 Nov 2023 14:32:02 -0500 Subject: [PATCH 1/2] quick fix to allow VaporLiquidMassTransferInternalInterfaceConstantT to accept T as a function --- src/Interface.jl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Interface.jl b/src/Interface.jl index b4dd8727..30a28ee7 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -392,14 +392,20 @@ function VaporLiquidMassTransferInternalInterfaceConstantT(domaingas,domainliq,i T = domainliq.T phase = domainliq.phase ignoremasstransferspcinds = getinterfaceignoremasstransferspcinds(domaingas,domainliq,ignoremasstransferspcnames) - kLAs = [kLA(T=T) for kLA in getfield.(phase.species,:liquidvolumetricmasstransfercoefficient)] - kHs = [kH(T=T) for kH in getfield.(phase.species,:henrylawconstant)] + kLAs = [kLA(T=T(0)) for kLA in getfield.(phase.species,:liquidvolumetricmasstransfercoefficient)] + kHs = [kH(T=T(0)) for kH in getfield.(phase.species,:henrylawconstant)] return VaporLiquidMassTransferInternalInterfaceConstantT(domaingas,domainliq,ignoremasstransferspcnames,ignoremasstransferspcinds,kLAs,kHs,[1,length(domainliq.phase.species)],[0,0],ones(length(domainliq.phase.species))),ones(length(domainliq.phase.species)) end export VaporLiquidMassTransferInternalInterfaceConstantT + + + + function getkLAkHs(vl::VaporLiquidMassTransferInternalInterfaceConstantT,Tgas,Tliq) - return vl.kLAs, vl.kHs + kLAs = [kLA(T=Tliq) for kLA in getfield.(vl.domainliq.phase.species,:liquidvolumetricmasstransfercoefficient)] + kHs = [kH(T=Tliq) for kH in getfield.(vl.domainliq.phase.species,:henrylawconstant)] + return kLAs, kHs end function evaluate(vl::VaporLiquidMassTransferInternalInterfaceConstantT,dydt,Vgas,Vliq,Tgas,Tliq,N1,N2,P1,P2,Cvave1,Cvave2,ns1,ns2,Us1,Us2,cstot,p) @@ -534,4 +540,4 @@ function evaluate(ri::FragmentBasedReactiveFilmGrowthInterfaceConstantT,dydt,dom addreactionratecontributions!(dydt,ri.fragmentbasedrxnarray,ri.rxnarray,cstot,kfs,krevs,Vfilm,domainfilm.indexes[3],ri.Mws,domainfilm.indexes[1]:domainfilm.indexes[2]) end -export evaluate \ No newline at end of file +export evaluate From 294f1eebe2c33c692dd9ff585645ee97e30edb8b Mon Sep 17 00:00:00 2001 From: Anna Doner <47831564+donerancl@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:33:48 -0500 Subject: [PATCH 2/2] Update Interface.jl added check if T is a function for LiquidVaporTransferInternalInterfaceConstantT --- src/Interface.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Interface.jl b/src/Interface.jl index 30a28ee7..2bf26268 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -392,8 +392,13 @@ function VaporLiquidMassTransferInternalInterfaceConstantT(domaingas,domainliq,i T = domainliq.T phase = domainliq.phase ignoremasstransferspcinds = getinterfaceignoremasstransferspcinds(domaingas,domainliq,ignoremasstransferspcnames) - kLAs = [kLA(T=T(0)) for kLA in getfield.(phase.species,:liquidvolumetricmasstransfercoefficient)] - kHs = [kH(T=T(0)) for kH in getfield.(phase.species,:henrylawconstant)] + if T isa Function + kLAs = [kLA(T=T(0)) for kLA in getfield.(phase.species,:liquidvolumetricmasstransfercoefficient)] + kHs = [kH(T=T(0)) for kH in getfield.(phase.species,:henrylawconstant)] + else + kLAs = [kLA(T=T) for kLA in getfield.(phase.species,:liquidvolumetricmasstransfercoefficient)] + kHs = [kH(T=T) for kH in getfield.(phase.species,:henrylawconstant)] + end return VaporLiquidMassTransferInternalInterfaceConstantT(domaingas,domainliq,ignoremasstransferspcnames,ignoremasstransferspcinds,kLAs,kHs,[1,length(domainliq.phase.species)],[0,0],ones(length(domainliq.phase.species))),ones(length(domainliq.phase.species)) end export VaporLiquidMassTransferInternalInterfaceConstantT