Skip to content

Commit

Permalink
Merge pull request #20 from ClapeyronThermo/vini/rename
Browse files Browse the repository at this point in the history
More adjustments in the docs
  • Loading branch information
viniviena authored Oct 27, 2024
2 parents 25ed7be + 76f08ba commit 7828c9e
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 38 deletions.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using Langmuir

makedocs(;
modules = Langmuir,
checkdocs=:none,
authors = "Andres Riedemann, Vinicius Viena Santana and contributors",
sitename = "Langmuir.jl",
format = Documenter.HTML(;
Expand All @@ -15,7 +16,7 @@ makedocs(;
"Home" => "index.md",
"Background" => "tutorials/background.md",
"Getting Started" => "tutorials/getting_started.md",
"Tutorial" => "tutorials/tutorial.md",
"Tutorials" => Any["tutorials/tutorial.md"],
"Supported models" => "models/models.md",
"Reference" => "reference.md",
],
Expand Down
4 changes: 3 additions & 1 deletion docs/src/models/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Pages = ["models.md"]
```

## No-parameter Isotherm Models

```@docs
Langmuir.ZeroIsotherm
```

## One-parameter Isotherm Models

Expand Down
9 changes: 0 additions & 9 deletions docs/src/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,10 @@ Pages = ["reference.md"]
```

```@docs
Langmuir.nlsolve
Langmuir.@MultiSite
Langmuir.isotherm_lower_bound
Langmuir.isosteric_heat
Langmuir.f∂f∂2f
Langmuir.pressure
Langmuir.saturated_loading
Langmuir.x_sol
Langmuir.loading
Langmuir.henry_coefficient
Langmuir.isotherm_upper_bound
Langmuir.sp_res
Langmuir.iast
Langmuir.@with_metadata
Langmuir.f∂f
```
4 changes: 2 additions & 2 deletions docs/src/tutorials/background.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ where $Q_st$ is the isosteric heat of the component being adsorbed, $T$ is the t

When the isotherm is of the form $N_i = f(T, P_i)$, one can write:

$Q_{st, i} = -T*(V_g - V_a)*\left( \frac{\frac{\partial N_i}{\partial T}\rvert_P_i}{\frac{\partial N_i}{\partial P}\rvert_T} \right)$
$Q_{st, i} = -T \cdot (V_g - V_a) \cdot \left( \frac{\partial N_i / \partial T \mid P_i}{\partial N_i / \partial P \mid T} \right)$


## Multi component adsorption
Expand All @@ -38,7 +38,7 @@ $\sum_i^{N_c} x_i = 1$

Combining the two above equations, the following nonlinear solve is set:

$f(\pi) = 1-\sum_1^{N_c}\frac{Py_i}{P_i^0\left(\pi\right)}$ = 0
$f(\pi) = 1-\sum_1^{N_c}\frac{Py_i}{P_i^0\left(\pi\right)} = 0$



Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/tutorial.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [A complete tutorial with Langmuir.jl](@id Tutorial)
# [A typical workflow with Langmuir.jl](@id Tutorial)

In this tutorial, we will go through a typical workflow for processing and analyzing adsorption equilibrium data:

Expand Down
1 change: 1 addition & 0 deletions src/models/models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export IsothermModel

include("freundlich.jl")
include("langmuirs1.jl")
include("null.jl")
include("langmuir_freundlich.jl")
include("redlich_peterson.jl")
include("sips.jl")
Expand Down
31 changes: 7 additions & 24 deletions src/models/multisite.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
"""
MultiSite(isotherms...)
MultiSite <: IsothermModel
MultiSite(isotherms::Vararg{IsothermModel}...)
The `MultiSite` isotherm model allows combining multiple single-site isotherms to model adsorption on surfaces with multiple distinct types of adsorption sites.
## Inputs
- `isotherms::Tuple{IsothermModel}`: A tuple of isotherm models representing the different adsorption sites.
## Description
given a list of isotherms, create a multisite isotherm model.
The `MultiSite` model combines multiple isotherm models (e.g., Langmuir) to represent systems where adsorption occurs at different types of sites, each described by its own isotherm. This model is useful when the adsorbent has heterogeneous surface characteristics, with different regions or adsorption sites behaving according to different isotherm models.
```julia
model1 = LangmuirS1(3.0,1.0,0.0)
model2 = LangmuirS1(3.0,0.9,3000.0)
double_site_LangmuirS1 = MultiSite(model1,model2) #create a multisite model with two LangmuirS1 isotherms
```
"""
struct MultiSite{T,𝕀} <: IsothermModel{T}
isotherms::𝕀
Expand Down Expand Up @@ -43,20 +40,6 @@ function Base.getindex(m::MultiSite{T,𝕀}) where {T,𝕀}
return m.isotherms[i]
end

"""
MultiSite(m1::IsothermModel,isotherms::Vararg{IsothermModel}...)
given a list of isotherms, create a multisite isotherm model.
```julia
model1 = LangmuirS1(3.0,1.0,0.0)
model2 = LangmuirS1(3.0,0.9,3000.0)
double_site_LangmuirS1 = MultiSite(model1,model2) #create a multisite model with two LangmuirS1 isotherms
@assert loading(model1,1.0,3000.0) + loading(model2,1.0,3000.0) = loading(double_site_LangmuirS1,1.0,3000.0)
```
"""

function model_length(::Type{MultiSite{T,I}}) where {T,I}
return _model_length_multi(I)
Expand Down
3 changes: 3 additions & 0 deletions src/models/null.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ sp_res(model::ZeroIsotherm, p, T) = zero(Base.promote_eltype(model,p,T))
loading(model::ZeroIsotherm, p, T) = zero(Base.promote_eltype(model,p,T))
henry_coefficient(model::ZeroIsotherm, T) = zero(Base.promote_eltype(model,T))
Base.iszero(::ZeroIsotherm) = true


export ZeroIsotherm
1 change: 1 addition & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Base.IndexStyle(::Type{<:FractionVector}) = IndexLinear()
returns f and ∂f/∂x evaluated in `x`, using `ForwardDiff.jl`, `DiffResults.jl` and `StaticArrays.jl` to calculate everything in one pass.
"""

@inline function f∂f(f::F, x::R) where {F,R<:Real}
T = typeof(ForwardDiff.Tag(f, R))
out = f(ForwardDiff.Dual{T,R,1}(x, ForwardDiff.Partials((oneunit(R),))))
Expand Down

0 comments on commit 7828c9e

Please sign in to comment.