EntropyScaling.jl
Modeling transport properties of fluids (viscosity, thermal conductivity, diffusion coefficients) based on entropy scaling and the Chapman-Enskog theory
Install / Use
/learn @se-schmitt/EntropyScaling.jlREADME
EntropyScaling.jl
Transport property modeling based on entropy scaling and equations of state (EOS).
This package provides models for
- the viscosity,
- the thermal conductivity, and
- diffusion coefficients.
The documentation of the package can be found here.
For the EOS calculations, additional packages need to be imported. Alternatively, custom EOS functions might be defined. Implementations of EOS models are not included in this package.
Installation
The package can be installed by:
Pkg> add EntropyScaling
Package mode can reached by typing ] in REPL.
Then, the module can be loaded by
using EntropyScaling
Examples
Chapman-Enskog viscosity (zero-density limit) of methane
julia> using EntropyScaling
julia> model = ChapmanEnskogModel("methane")
ChapmanEnskogModel{methane}
σ: [3.758] Å
ε: [148.6] K
M: [0.01604] kg/m³
Collision integral: KimMonroe
julia> η = viscosity(model, NaN, 300.) # gas viscosity of methane at 300 K in Pa s
1.1189976373570321e-5
Fitting a new entropy scaling model
julia> using EntropyScaling, Clapeyron
julia> (T_exp,ϱ_exp,η_exp) = EntropyScaling.load_sample_data(); # Load sample data
┌ Info: Experimental data for the viscosity of n-butane.
└ Units: [T] = K, [ϱ] = mol/m³, [η] = Pa·s
julia> data = ViscosityData(T_exp, [], ϱ_exp, η_exp, :unknown)
TransportPropertyData{Viscosity}
15 data points.
julia> eos_model = PCSAFT("butane") # Clapeyron.jl EOS model
PCSAFT{BasicIdeal, Float64} with 1 component:
"butane"
Contains parameters: Mw, segment, sigma, epsilon, epsilon_assoc, bondvol
julia> model = FrameworkModel(eos_model, [data]) # Fit model parameters
FrameworkModel with 1 component:
"butane"
Available properties: viscosity
Equation of state: Clapeyron.EoSVectorParam{PCSAFT{BasicIdeal, Float64}}("butane")
julia> η = viscosity(model, 1e5, 300.; phase=:liquid) # viscostiy at p=1 bar and T=300 K
0.0001605897169488518
Integration with Unitful.jl
It is possible to work woth units using Unitful.jl.
The following example uses the model from above, but calculates the viscosity with units.
julia> using Unitful
julia> η = viscosity(model, 1u"bar", 26.85u"°C", phase=:liquid, output = u"cP")
0.16058971694885213 cP
Related Skills
node-connect
335.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.5kCommit, push, and open a PR
