GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - stijnrommens/GM_pressure: Numerical solver for the modified Poisson-Boltzmann equation

BranchesTags
Open more actions menu

Latest commit

 

History

100 Commits
100 Commits

Folders and files

NameName
Last commit message
Last commit date
code
code
 
 
.gitignore
.gitignore
 
 
Project.toml
Project.toml
 
 
README.md
README.md
 
 
Uqr_fig.PNG
Uqr_fig.PNG
 
 
example.ipynb
example.ipynb
 
 
ionS_fig.PNG
ionS_fig.PNG
 
 
mBPE_fig.png
mBPE_fig.png
 
 
ntot_fig.PNG
ntot_fig.PNG
 
 

Repository files navigation

Gibbs-Marangoni pressure

Numerical solver of the modified Poisson-Boltzmann equation from Duignan (2021) in Julia. This equation is modified as it not only includes an electrostatic potential but also an adsorption energy function of the present ions [1].

The model needs the following input:

  • ionic concentrations;
  • hydrated radius and charge of each ion;

As output, the electrostatic potential of salts at the interface is obtained. This can be used to calculate the surface excess of ions, which results in the Gibbs-Marangoni pressure (at 10 nm separation).

Sources:
[1] Duignan, T. T. (2021). The surface potential explains ion-specific bubble coalescence inhibition. Journal of Colloid and Interface Science, 600, 338–343. https://doi.org/10.1016/j.jcis.2021.04.144

Requirements

Julia (v1.9) needs to be installed. The attached .tomls in this repo should automatically install the required packages.

How to use

Open a Julia REPL in the base folder (~\GM_pressure>julia), and activate the environment (julia>] activate .).

In the Julia REPL, include the file main.jl (julia>include("code/main.jl")). This gives you access to the main() function which is used to calculate the GM pressure for an electrolyte mixture.

The first and most important input to main() is the list of ions. In this list, each input is expected to be a list describing an individual ion as [concentration, charge, hydrated radius, type].

The function returns three values: a float for the GM pressure in Pa, a float for the surface tension gradient ($\delta\gamma/\delta c$) in $\mathrm{\left[mN* m^{-1}* M^{-1}\right]}$ and a bool success flag indicating if the system solved successfully.

Example 1:

Calculating the GM pressure for an 0.5 M NaCl solution:

main([
  [0.5, +1, 2.5e-10, "alpha"],
  [0.5, -1, 2.0e-10, "alpha"]
])

which will return

(8759.22..., 1.471..., true)

Example 2:

Calculating the GM pressure for an 0.95 M NaCH3COO solution:

main([
  [0.95, +1, 2.5e-10, "alpha"],
  [0.95, -1, 3.22e-10, "beta"]
])

which will return

(6048.09..., 0.886..., true)

In this case, the solver will throw some warnings during the solution finding. As long as the final return flag is true, these warnings were overcome later during the solving of the system of equations and can safely be ignored.

Debugging & Tweaking

Certain scenarios (e.g. high ionic strengths) may result in warnings/errors from the BVP-solver. This will most likely return values which go to infinity. main() accepts several keyword arguments that can help increase stability (at the cost of speed) or increase speed (at the cost of stability):

  • absolute tolerance (abstol); currently at 1e-9 (default is 1e-6)
  • relative tolerance (reltol); currently at 1e-9 (default is 1e-3)

Additionally, the algorithm used can be changed around line 166.

Accuracy/validity are tested by checking if the surface excess of all ions fulfils the electroneutrality condition by checking that $\sum^n \Gamma_i * q_i * c_i = 0$.

About

Numerical solver for the modified Poisson-Boltzmann equation

Topics

adsorption-energyboundary-value-problemelectrostatic-potentialmarangoninumerical-methodspoisson-boltzmann

Resources

Readme
Activity

Stars

0 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.