---
# System prepended metadata

title: Osmotic Pressure (Gabriel)
tags: [Osmotic Pressure, granular, Granular Simulations]

---

# Osmotic Pressure (Gabriel)

###### tags: `Granular Simulations` `granular` `Osmotic Pressure`



---


---


### Owners (the only one with the permission to edit the main test)

AP, GM, FS, GF



---


---


## Background



## Plans



## To Do
:::success
green is for finished tasks
:::
### Numerical part
:::success
* Writting code as discussed 
* Bug report
* Run simulations for rectangular box 2:1 extreme cases (full mixing and only one side mixed)
* Data analysis for identical particles 
:::

* Explore with other parameters variations 
* Explore dissipation effects
* Find the bug with the dissipation coefficient 
* Improve interaction comparison



### Theoretical part

:::success
* A basic model done
:::
* Model out of equilibrium ?
 
### OPEN QUESTIONS

* Why do I have Van't Hoff for high solute concentration out of equilibrium ?

## Data

### [April] First try

#### Figures with $\alpha$ varying

![](https://i.imgur.com/ZRMyqKW.png)

Run with harmonic wall with a parameter $\alpha$ define such that $N_{s}^l = \frac{\alpha}{1-\alpha} N_{s}^r$, and varying between 0 and 0.5 (corresponding to the extreme cases). We can clearly see that the "small" particles (i.e the solvent) are going toward the region with less solute particles.
N.B : I wrote "density" but I chose to represent the number of particles instead in each region. Similarly the "density average" is not a well defined term for what is represented.

![](https://i.imgur.com/Dnma7bP.png)

Run with the hertz/history granular interaction. Seems similar for density profil. Need to check it in more details. With naked eyes, can clearly see that wall aggregation effects are way more imporant with the Hertz one (as we expected because no dissipation with harmonic)

#### Comparison of the different interactions wall/gran

![](https://i.imgur.com/fGt1Sh4.png)

GRAN = Hertz Mindlin model 
GRANCONS = same model without tangential force or any dissipative forces (it should be)
THE = harmonic potential

Clearly see a difference with and without dissipation for the same model. 
Also see a difference due to the spatial variation of the potential. 
Indeed hard to tell which mechanism is dominant.
(Need better discretisation or better data to average)

#### Is there osmotic pressure ?

![](https://i.imgur.com/ja71FjJ.png)


Figures for $\alpha$ between 0 and 0.5 with steps=0.1. We define the renormalized density as $\rho_{norm} = \frac{\rho}{\rho^{tot}_{mean}}$, with $\rho^{tot}_{mean} = \frac{N}{V}$, so that everything is adimensional. It seems that the ratio $\frac{\rho^l}{\rho^r}$ is dependent of the value $\alpha$ as it should be for osmosis. Evolution of this ratio with density for packing fraction $\phi$ between 0.2 and 0.4 are shown under.

![](https://i.imgur.com/mVLFbZH.png)


Recalling osmosis effect for highly dilute solute in a liquid, we should find that $\frac{\rho_s^l}{\rho_w^l} = \frac{\rho_s^r}{\rho_w^r}$ where "$w$" denotes the solvent and "s" the solute. However, this figure shows that the semi-permeable wall for granular system gives indeed a less important osmosis effect that the one standardly studied. I need to think what kind of different mechanism(s) are at the origin of such difference.(Link to pressure study in progress) 


#### Osmotic pressure for different $\phi$

From Van' Hoff law and identical particles, one should have $\Pi \propto \phi$, where$\Pi$ denotes the osmotic pressure:
$\Pi$ = $P^r-P^l$ = $k_B T (\rho_s^r-\rho_s^l)$ 
Using, $\rho_i^k = \frac{N_i^k}{V^k}$, $N_s = x_L N$, and previous relation between $N_s^r$ and $N_s^l$  
$\Pi$ = $k_B T \frac{N}{V} x_L (1-2\alpha)$
Finally recalling that for identical particles $\phi = \frac{N^r {v}}{V} = ((1-\alpha)x_L+ (1-x_L) \frac{N_w^r}{N_w} ){v} \frac{N}{V}$ : 
$\Pi$ = $k_B T \frac{x_L (1-2\alpha)}{{v} ((1-\alpha) x_L + (1-x_L)\frac{N_w^r}{N_w})} \phi = A(x_L,\alpha ,T) \phi$

Here we measure the pressure due to the solute hitting the wall and the difference of pressure beween the two sides of the box (using the force applied by the exernal walls on the particles). The pressure measured on this figure is for $\alpha =0$

![](https://i.imgur.com/RrpAVLX.png)

It looks like that the pressure on the middle wall, exerted by the solute only, correspond to the difference of pressure between the 2 part of the box (as we expected).
Moreover, for "low" packing fraction, the relation between $\Pi$ and $\phi$ seems linear. Therefore the Van't Hoff law may be a good model to represent osmotic effects in granular systems. 
To keep trying to check if Van't Hoff formula describes well our system, I push the simulation for $\phi$ values between O.2 and 0.4 (0.05 between each) and $\alpha$ between 0 and 0.5 (0.1 between each). 

I fit the pressure on the wall with the formula above in two cases : either $\phi$ or $\alpha$ is evolving. I again fit with the other parameter for consistency.
NO THE TWO WAYS DESCRIBE DO NOT WORK ACTUALLY

![](https://i.imgur.com/hhD3He3.png)


I found $\frac{k_B T}{v} = 0.623$ with fits that looks OK graĥically but I need to compare with 'real' value for such system.

#### Far from van't Hoff law ?

![](https://i.imgur.com/lFCLv9O.png)


$\Delta c_s$ is the difference of solute concentration. Does look like linear for small packing fractions but for the same value of $\Delta c_s$ we have clearly different pression (which does not seem to be due to incertitude).
One should note that because of the differences of density and packing fraction, the systems did not have the same temperature. 
**PB : How can we f=define the temperature properlly to measure it on the simulation?**

Doing the fit again but this time with the same method as previously and an overall fit to compute $\frac{k_B T}{v}$ : 

![](https://i.imgur.com/kccVoGd.png)


First way to fit is clearly going nowhere because $\Pi$ is not linear in $\phi$ as said previously . In fact, $\frac{N^r_w}{N_w}$ is dependent on the final packing fracion and $\alpha$. Overall fit is also not that much great (the 2 that seems to fit might be by luck because in that case the middle bottom one should have fitted too).

From litterature, derivations of van't Hoff always imply small solute concentration $c_s$ which is not the case in our simulations. Quesion remains can we have a correction law here (not find yet).

### [May] Simulations at "low" solute concentration

#### Van't Hoff out of equilibrium ?

Simulations with fixed box size ($L_y = \frac{L_x}{2} = 0.2$) for different number of solvent/solute particles ($N_A$ and $N_B$ respectively) were done. The $k_B T$ is computed from the translational kinetic energy (XY plane only).
**Is it the right T to take into account ?**



![](https://hackmd.io/_uploads/SkYuCR_E3.png)



From these figures, we can consider that there is no $c_a$ dependence for the osmotic pressure out of equilibrium. Meaning it is acting as a thermal bath from the solute particles view. Interestingly those simulations **are not** at low ratio $\frac{c_B}{c_A}$ but we still have a linear relation between $\frac{\Pi}{k_B T}$ and $c_B$ (slope $\approx$ 7.2 [adim]).

**Q1 :** Why is it still linear for high $c_B$ ? 
**Q2 :** To which parameter(s) is the linear coefficient dependent ? 

**A1 :** Here average packing fraction between 0.06 and 0.2. I will check for higer ones if the behaviour is the same but the real hypothesis behind van't Hoff law might be a low packing fraction of solute (when the say small $c_B$) and be at equilibrium, which seems the case for low total packing fraction.

**A2 :** Probably coarse-graining of delta model to have the answer here. We need to check.

### Comparison with hard disks at low $\phi$ regime

![](https://hackmd.io/_uploads/H1CkgucE2.png)

Black curve correspond to Van't Hoff and red one to the virial at first order for hard disks. The renormalised pressure by the temperature follows well the correction to van't Hoff obtained from the virial -> behave as an equilibrium state.

**Q :** Is it similar at high $\phi$ ?

Something that I don't understand : 

![](https://hackmd.io/_uploads/HkAQzu943.png)

Left plot : red and black virial for hard disks at first and second order
Righ plot : compressibility factor from solana equation $Z= \frac{1+\phi /8 - \phi /10}{(1-\phi)^2}$ in black

**PB :** Problem with equation of state, we can see that 2 points are given for the same $\rho_r$ from 2 different values of number of solvent particles in the box.from the simulations is it really possible to plot the EOS for the right-hand side only if the solvent can pass through ? 


### Comparison with hard disks at high $\phi$ regime

![](https://hackmd.io/_uploads/S1E3HO9N2.png)

Similarly to the low $\phi$ case the renormalised pressure keeps following the virial correction of the van't Hoff equation. However copare to the low $\phi$ case, here the temperature T is solute concentration dependent. To see if the pressure is only due to the solute concentration variation or not, here I plot with the pressure only. The theoretical curve from the virial correction was computed with T constant (mean of all T in simulations).
![](https://hackmd.io/_uploads/HyhsjdqV2.png)
From the plot, we can say that the pressure evolves only with the solute concentration $c_s$


Also here, the EOS for hard disks is similar to the granular one.
![](https://hackmd.io/_uploads/HJuCduqN2.png)

But I still have the 2 values thing which is less apparent here from the choices of values.


## Report condensing most information 

Can get the report with the link : https://www.overleaf.com/read/mgscpktvmkbp

## Post-report work 
We wanted to compare the osmotic pressure for hard disks with the one obtained with DEM simulations. Here are the plot obtain for monodispere aand bidisperse cases: 

![](https://hackmd.io/_uploads/HJvx8fvu3.png)


![](https://hackmd.io/_uploads/Hyg0HMDd2.png)

Conclusion : Equilibrium like behavior for both cases, HD model gives a good description of the osmotic pressure in such granular systems.

## Main message

From van't hoff (and its extension) point of view: monodisperse and bidisperse are equilibrium-like

From phenomenology (density profile) point of view: monodisperse is equilibrium-like, bidisperse is genuinely out of equilibrium









## Bug comment
The fix wall/gran command is actually working with latest stable version of Lammps 23 Jun 2022 but not with the latest one 28 Marche 2023 



