{"cells":[{"cell_type":"markdown","metadata":{},"source":["# Droplets\n","\n","## Different morphologies of the droplet state\n","\n","Let us consider the equilibrium droplet state, _i.e._, $\\alpha<0$ and $-\\sqrt{\\frac{-\\alpha}{\\beta}}<\\phi_0<\\sqrt{\\frac{-\\alpha}{\\beta}}$, at $t\\rightarrow\\infty$.\n","For a fixed value of $\\alpha$, depending on the global average density $\\phi_0$, we can have 3 different types of droplet state.\n","For $\\phi_0<0$, we have a liquid droplet surrounded by vapour phase.\n","For $\\phi_0>0$, we have a vapour bubble surrounded by liquid phase.\n","Finally for $\\phi_0=0$, the liquid droplet forms a strip, as we can see from the figure below.\n","Note that periodic boundary condition is assumed in both $x$ and $y$-direction."]},{"cell_type":"code","execution_count":210,"metadata":{"tags":[],"trusted":false},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAlAAAADWCAYAAAAelLypAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAmIElEQVR4nO3da4xc93nf8d8zMzt74/K2pKjlRbZkWVZkJZZaQoljJ3B8CRy1hZ0WRuO2gVu4UYrUQBL4RWQ3SOK8CBwgdmAgtyqwIblIk7qxDSutklg1HBhODMe0pCiUdbMlhaK44p3c5S73/vTFjiwun2e45+zM7s7Mfj8AseTDufzPOfOc898zz3mOubsAAABQXGWzBwAAANBtmEABAACUxAQKAACgJCZQAAAAJTGBAgAAKIkJFAAAQElMoAAAAEpiAgUAAFASE6g2MrNvm9mHN3scQKchN4CIvOhuTKDaxMxqkt4o6bFNHkpgZr9gZs+b2UwjYX9slcd/xMy+ZWYTZnbazP7CzG7fqPGit3RKbpTNg7U+ByiiW/OC48OrmEC1z62S+tVhEygz+7eSPiXptyTdKenvJP2lmd1wjae9TdIfSPpRSW+XtCDp/5nZ7vUdLXrUpufGWvJgjbkDFNWVeSGOD99n3A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EUk/3OnL0ws50Yv50Bg7ObE5YyUnOvQPObHyz0Z/hVfoxpJdaJ+7j0tS4+d1mzyeUszstZLulPRNdfGymFnVzB6TdErSw+7eDcvTiznR6et8VeTEpiInOhA5EW30BKrQjSWxccxsm6TPS/old5/Y7PG0wt0X3f0OLd9v6y4zu32Th1QEOdFhyIlNR050GHIit9ETqF69seRJMxuTpMbPU5s8nkLMrE/LSfEn7v6FRrgrl+VK7n5B0t9ouQ6h05enF3Oi09d5U+RERyAnOgg50dxGT6C+Jen1ZnajmdUl/YykBzd4DOvhQUkfaPz9A1r+nrijmZlJ+rSkJ939k1f8V9ctiySZ2V4z29n4+6Ckd0p6Sp2/PL2YE52+zlPkRMcgJzoEObGKTSjculvLd+f+nqT/ttmFZGsY/59KGpc0r+XflD4oaVTLlfvPNn7u3uxxFliOt2r5tPjjkh5r/Lm7G5elsTw/JOnRxvIclfRrjXjHL08350Sv5ENjWciJDvlDTnTGH3Li2n/oRA4AAFASncgBAABKYgIFAABQEhMoAACAkphAAQAAlMQECgAAoCQmUAAAACUxgQIAACiJCRQAAEBJ/x9bPQOgDt98MAAAAABJRU5ErkJggg==","text/plain":[""]},"execution_count":210,"metadata":{},"output_type":"execute_result"}],"source":["from IPython.display import Image\n","Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/droplet-morphologies.png')"]},{"cell_type":"markdown","metadata":{},"source":["## Flat interface ($d=1$ dimension)\n","\n","Let us consider the strip geometry ($\\phi_0=0$).\n","As we can see from the middle picture above, the interface between the liquid and the gas phase is completely flat, reducing the problem to a one-dimensional problem $\\phi(x,t)$.\n","In the steady (or equilibrium) state $t\\rightarrow\\infty$, the density profile might look something like in the plot below:"]},{"cell_type":"code","execution_count":208,"metadata":{"trusted":false},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAhYAAAENCAYAAABTviwWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM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vh6Tg/CJ9/Zrr4Pk6EbleHVAC5JrZRHcvjW2bSkSvT4pk8vVKJKN+zlIgUr8n26uVe12Hr1+3fGLRTncBRwDfdPc9zfY9ARxpZrPNLA/438DyTOqQZGa5sdhzgBwzyzOz3Ni+E83sMDPrYWZDgP8EFrl788dikdXa+ZEF1y+emQ00s5lN52hmc4DTgBfDjq0jYm25jwO3mlm+mZ0MzCL4H1XGy7br1crPWlb8nCU6v2z4PRmT6F7X8evn7no1exG0mTlQS/A4qOk1J67M14BVwB5gETA27LiTPMdbYucY/7oltu+7wGdADbAZuB84KOyYU3V+2XD9mp1rIfAOwSPKncCbwJlhx9XJcxoMPBn7N7geuCjsmHS9Ep5Pa79LMv7nLNH5ZcnvyVbvdR29flqETERERFJGTSEiIiKSMkosREREJGWUWIiIiEjKKLEQERGRlFFiISIiIimjxEJERERSRomFiIiIpIwSCxEREUkZJRYiIiKSMkosRCRSzOwCM9trZofEbfsPM1tjZsPDjE1E2qYpvUUkUmKrLb4DvO/u/2Jm1wL/EzjZv1jtVEQiqlsumy4i0eXubmY3AH81szXA/wLOUFIhkhn0xEJEIsnMlgInECzn/HzY8YhI+6iPhYhEjpmdAUwFDNgacjgikgQ9sRCRSDGzqcDfgZ8C5wD93H1muFGJSHspsRCRyIiNBFkK3O3ut5rZkcBygj4Wi0INTkTaRYmFiESCmQ0GlgCvufsP4rYvAMa4+0mhBSci7abEQkRERFJGnTdFREQkZZRYiIiISMoosRAREZGUUWIhIiIiKaPEQkRERFJGiYWIiIikjBILERERSRklFiIiIpIy/x+SatpQcYXf+QAAAABJRU5ErkJggg==","text/plain":[""]},"execution_count":208,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/interfacial-profile.png')"]},{"cell_type":"markdown","metadata":{},"source":["The plot above shows the typical steady state density field $\\phi(x)$ in an infinite one-dimensional system.\n","At $x=-\\infty$, we have the gas phase, where $\\phi=-\\sqrt{\\frac{-\\alpha}{\\beta}}$ and at $x=+\\infty$, we have the liquid phase, where $\\phi=\\sqrt{\\frac{-\\alpha}{\\beta}}$.\n","We then have an interface, assumed to be located at the origin $x=0$, which separates the liquid from the gas phase.\n","As we can see, the interface is not sharp, but rather is spread across some interfacial width $\\xi$.\n","In real physical situations, the interfacial width is typically a few molecular lengths ($\\sim\\text{nm}$), however in simulations, we usually use a much wider interfacial width for numerical stability.\n","This is fine as long as the lengthscales of the problem we are interested in are much larger than $\\xi$.\n","\n","### Interfacial profile $\\phi(x)$ and interfacial width $\\xi$\n","\n","In this subsection, we will derive the interfacial profile $\\phi(x)$ and the interfacial width $\\xi$ for a flat interface, which is effectively a one-dimensional (1d) system.\n","\n","In 1d, the coarse-grained free energy can be written as:\n","\\begin{equation}\n","\\mathcal{F}[\\phi] = \n","A\\int_{-\\infty}^\\infty dx \n","\\underbrace{\\bigg\\{ \\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{4}\\phi^4 + \\frac{\\kappa}{2}|\\nabla\\phi|^2 \\bigg\\}}_{\\text{1d energy density}},\n","\\end{equation}\n","where $A$ is the area of the system along $y$ and $z$ direction.\n","(In 1d, the system is translationally invariant along $y$ and $z$.)\n","The 1d energy density consists of the local term: $\\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{4}\\phi^4=f(\\phi)$, which we will call $f(\\phi)$, and the semi-local term $\\frac{\\kappa}{2}|\\nabla\\phi|^2$.\n","\n","The steady state density, is given by the solution to the equation:\n","\\begin{equation}\n","\\mu(x) = \\frac{\\delta\\mathcal{F}}{\\delta\\phi} = 0 \\quad\\Rightarrow\\quad\n","\\frac{df}{d\\phi} - \\kappa\\frac{d^2\\phi}{dx^2} = 0,\n","\\end{equation}\n","where $f(\\phi) = \\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{4}\\phi^4$ is the local energy density.\n","To solve the above equation, we multiply both sides of the equation by $d\\phi/dx$ to get:\n","\\begin{align}\n","\\frac{df}{dx} - \\kappa\\frac{d^2\\phi}{dx^2}\\frac{d\\phi}{dx} = 0 \n","\\quad\\Rightarrow\\quad \n","\\frac{df}{dx} - \\frac{\\kappa}{2}\\frac{d}{dx}\\left(\\frac{d\\phi}{dx}\\right)^2 = 0\n","\\end{align}\n","Now we can integrate with respect to $x$ to get the __Noether equation__:\n","\\begin{equation}\n","f(\\phi) - \\frac{\\kappa}{2}\\left(\\frac{d\\phi}{dx}\\right)^2 = C, \n","\\end{equation}\n","where $C$ is the constant of integration. \n","The above equation can also be derived from Noether's theorem and the constant $C$ is a Noether current.\n","The constant of integration can be found by substituting $x=\\infty$ to get \n","$C=f\\left(\\sqrt{\\frac{\\alpha}{\\beta}}\\right)=-\\frac{\\alpha^2}{4\\beta}$.\n","After rearranging, we get:\n","\\begin{align}\n","\\frac{d\\phi}{\\sqrt{f(\\phi) + \\frac{\\alpha^2}{4\\beta}}} = \\sqrt{\\frac{2}{\\kappa}} dx,\n","\\end{align}\n","which we can integrate from $x=0$ to $x$.\n","\\begin{align}\n","\\int_{0}^{\\phi(x)} \\frac{d\\phi}{\\sqrt{f(\\phi) + \\frac{\\alpha^2}{4\\beta}}} \n","= \\sqrt{\\frac{2}{\\kappa}}x\n","\\end{align}\n","Note that we can factorize:\n","\\begin{align}\n","\\underbrace{\\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{2}\\phi^4}_{f(\\phi)} + \\frac{\\alpha^2}{4\\beta} \n","= \\frac{1}{4\\beta}\\left(\\alpha+\\beta\\phi^2\\right)^2,\n","\\end{align}\n","so that the integral becomes:\n","\\begin{align}\n","\\int_{0}^{\\phi(x)} \\frac{d\\phi}{\\alpha + \\beta\\phi^2} = \\sqrt{\\frac{1}{2\\kappa\\beta}}x \\quad\\Rightarrow\\quad\n","\\frac{1}{\\alpha}\\int_{0}^{\\phi(x)} \\frac{d\\phi}{1 - \\frac{\\beta}{-\\alpha}\\phi^2} = \\sqrt{\\frac{1}{2\\kappa\\beta}}x\n","\\end{align}\n","Note that $\\alpha<0$. \n","Using $\\frac{d}{dx}\\tanh^{-1}(x)=\\frac{1}{1-x^2}$, we can then solve this integral to get:\n","\\begin{equation}\n","\\phi(x) = \\sqrt{\\frac{-\\alpha}{\\beta}}\\tanh\\left(\\frac{x}{\\xi}\\right), \\quad\\text{where}\\quad\n","\\xi = \\sqrt{\\frac{2\\kappa}{-\\alpha}}\n","\\end{equation}\n","is the interfacial width.\n","\n","### Surface tension $\\gamma$\n","\n","In this subsection, we will introduce the concept of surface tension $\\gamma$ and derive its expression for a flat interface.\n","First, let us consider the local free energy density $f(\\phi)+\\frac{\\kappa}{2}\\left(\\frac{d\\phi}{dx}\\right)^2$, which consists of the local and semi-local terms."]},{"cell_type":"code","execution_count":193,"metadata":{"trusted":false},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAhcAAAESCAYAAABO/PdmAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAoI0lEQVR4nO3deXhdd33n8fdHkq1dsmXLjmPHsbMvJiaJaQCHkIY1LUsgZR6alAnQEghDWVqGZgqhIYVCGYYp85BmGkqmkGGgUByaEiCsaZNASRxoFkNiZ/FuSbZlS5asxZK/88e91yiKJN/l3EVXn9fz3Ce+5/zOOd+jk3v11e/8zveniMDMzMwsKTXlDsDMzMyqi5MLMzMzS5STCzMzM0uUkwszMzNLlJMLMzMzS5STCzMzM0uUkwszMzNLVNUkF5I6JN0haVDSNklXTdPuzZKekNQnqUfSlyS1lTpeMzOzalU1yQVwMzAKLAWuBm6RdO4U7e4H1kdEO3AKUAd8vGRRmpmZVbmqSC4kNQNXAjdExEBE3AfcCbxlctuI2BER+yYsGgdOK02kZmZm1a+u3AEk5AxgPCI2T1j2MPDSqRpLuhi4C2gDDgNvmKbdtcC1AM3NzReeddZZScZsZmZW0R566KF9EdGZ63bVkly0AH2TlvUBrVM1Tvdst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cM+FmVUsST8FfovUNNDfLXc8ZpYdj7kws4ok6TJgLSCgu8zhmFkO3HNhZhVH0lrgX4E/AX4XaImIV5U3KjPLlpMLM6so6SdEfgr8XUTcJGkN8AipMRf3lDU4M8uKkwszqxiSOoD7gX+LiHdOWP6PwMqIeFHZgjOzrDm5MDMzs0R5QKeZmZklysmFmZmZJcrJhZmZmSXKyYWZmZklysmFmZmZJcrJhZmZmSXKyYWZmZklysmFmZmZJer/Az5pp7tWGe4fAAAAAElFTkSuQmCC","text/plain":[""]},"execution_count":193,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/interfacial-energy.png')"]},{"cell_type":"markdown","metadata":{},"source":["The plot above shows the free energy density $f(\\phi(x))+\\frac{\\kappa}{2}\\left(\\frac{d\\phi}{dx}\\right)^2$ as a function of $x$ for the density profile $\\phi(x)$, shown in the previous plot.\n","In the bulk, the energy density is mostly flat and negative, which is equal to $f\\left(\\sqrt{\\frac{-\\alpha}{\\beta}}\\right)=-\\frac{\\alpha^2}{4\\beta}$.\n","Across the interface, the energy density goes up and then goes down, back to its bulk value.\n","The interfacial energy is defined to be excess free energy across this interface, _i.e._, the shaded region in the plot above.\n","More specifically, the interfacial energy is defined to be:\n","\\begin{equation}\n","\\mathcal{F}_{\\text{interface}} = A\\int_{-\\infty}^{\\infty}\n","\\left\\{f(\\phi(x)) + \\frac{\\kappa}{2}\\left(\\frac{d\\phi}{dx}\\right)^2 + \\frac{\\alpha^2}{4\\beta} \\right\\}dx.\n","\\end{equation}\n","Now we can refer to the __Noether equation__ which we derived above, _i.e._:\n","\\begin{equation}\n","f(\\phi) - \\frac{\\kappa}{2}\\left(\\frac{d\\phi}{dx}\\right)^2 = C = -\\frac{\\alpha^2}{4\\beta}\n","\\end{equation}\n","Substituting this to $\\mathcal{F}_{\\text{interface}}$, the interfacial energy becomes:\n","\\begin{equation}\n","\\mathcal{F}_{\\text{interface}} = A\\kappa\\int_{-\\infty}^{\\infty} \\left(\\frac{d\\phi}{dx}\\right)^2 dx.\n","\\end{equation}\n","Finally the surface tension $\\gamma$ is defined to be the interfacial energy per interfacial area. Thus we get:\n","\\begin{equation}\n","\\gamma = \\kappa\\int_{-\\infty}^{\\infty} \\left(\\frac{d\\phi}{dx}\\right)^2 dx = \\kappa\\int_{-\\sqrt{-\\alpha/\\beta}}^{\\sqrt{-\\alpha/\\beta}} \\frac{d\\phi}{dx} \\, d\\phi\n","\\end{equation}\n","Using Noether's equation, we can substitute $\\frac{d\\phi}{dx}$: \n","\\begin{equation}\n","\\frac{d\\phi}{dx} = \\sqrt{\\frac{2}{\\kappa}} \\sqrt{ f(\\phi) - f\\left(\\sqrt{\\frac{-\\alpha}{\\beta}}\\right) }\n","= \\sqrt{\\frac{2}{\\kappa}} \\sqrt{ f(\\phi) + \\frac{\\alpha^2}{4\\beta} },\n","\\end{equation}\n","so the surface tension becomes:\n","\\begin{equation}\n","\\gamma = \\sqrt{2\\kappa} \\int_{-\\sqrt{-\\alpha/\\beta}}^{\\sqrt{-\\alpha/\\beta}} \\sqrt{f(\\phi) + \\frac{\\alpha^2}{4\\beta}}\\,d\\phi\n","\\end{equation}\n","Substituting $f(\\phi)=\\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{4}\\phi^4$, we can solve the above integral to get:\n","\\begin{equation}\n","\\gamma = \\sqrt{\\frac{-8\\kappa\\alpha^3}{9\\beta^2}}.\n","\\end{equation}\n","Note that $\\alpha<0$.\n","\n","## Curved interface ($d>1$ dimension)\n","\n","We will now go back to $d>1$ dimensional problems.\n","In general, the interface between the liquid and the gas phase is not always flat but often curved.\n","\n","### Microscopic picture of surface tension\n","\n","Let us consider a liquid water droplet. \n","Inside the bulk liquid, each water molecule has $z$ nearest neighbours. \n","However, the water molecules at the liquid/gas interface only have $z/2$ nearest neighbours. \n","That means to create a new interface, some bonds have to be broken.\n","The energy required to break these bonds (per unit interfacial area) is called the surface tension $\\gamma$. \n","\n","### Macroscopic picture of surface tension\n","\n","Let us consider a liquid droplet in three-dimension and far from the boundaries (such as solid walls).\n","The total free energy of the liquid droplet has two contributions:\n","\\begin{equation}\n","\\mathcal{F} = \\mathcal{F}_{\\text{bulk}} + \\mathcal{F}_{\\text{interface}}.\n","\\end{equation}\n","The first contribution comes from the bulk free energy $\\mathcal{F}_{\\text{bulk}}$, which is equal to the local free energy density $f(\\phi)$ multiplied by the volume of the droplet $V$:\n","\\begin{equation}\n","\\mathcal{F}_{\\text{bulk}} \\simeq f(\\phi_{l}) V = \\text{constant}.\n","\\end{equation}\n","Note that we have assumed the density of the liquid inside the droplet, $\\phi_{l}$, to be constant throughout the bulk of the droplet.\n","Consequently, the volume of the liquid droplet is also constant by conservation of mass.\n","Thus $\\mathcal{F}_{\\text{bulk}}$ is constant.\n","The second contribution to $\\mathcal{F}$ comes from the interfacial energy $\\mathcal{F}_{\\text{interface}}$, \n","which is equal to the surface tension $\\gamma$ multiplied by the surface area of the droplet $S$:\n","\\begin{equation}\n","\\mathcal{F}_{\\text{interface}} \\simeq \\gamma S.\n","\\end{equation}\n","Since $\\gamma>0$, the equilibrium shape of the liquid droplet, which minimizes the total free energy $\\mathcal{F}$, is therefore a sphere.\n","\n","The surface tension $\\gamma$ can also be thought as a force per unit length.\n","To illustrate this, let us consider a thin film of soap, as shown in the picture below.\n","Technically, a soap film is an air-liquid-air interface, so the surface tension would be doubled.\n","Let us imagine that this two-dimensional soap film is confined between three fixed rods (black colour in the picture below) and a movable rod which can move laterally along $x$ (red colour in the picture below).\n","The energy stored inside this soap film is then:\n","\\begin{equation}\n","\\mathcal{F}_{\\text{interface}} = \\gamma S = \\gamma \\ell x.\n","\\end{equation}\n","Therefore the force by the soap film on the red rod is equal to:\n","\\begin{equation}\n","F_{\\text{interface}} = -\\frac{d\\mathcal{F}_{\\text{interface}}}{dx} = -\\gamma \\ell.\n","\\end{equation}\n","$F_{\\text{interface}}$ is negative since the direction is to the left in the picture below.\n","Thus a surface tension $\\gamma$ is a force (per unit length) which tends to minimize the surface area of the interface."]},{"cell_type":"code","execution_count":192,"metadata":{"trusted":false},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAASEAAADrCAYAAAAmGSB9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPqUlEQVR4nO3dfXRU9Z3H8c9NJmTCU0xICJBVERqEQJBKqA+0iHULy1KRIkJdRaBVUbYgItiiHBSOPHRJV4WqcFyOeLClGMUICBaP2MpuqWtyKCQSskBDErA8BIRASEkmc/ePwCg2gUkkfGcm79c5OTJzf3PvN3p8596E3HFc1xUAWImyHgBAy0aEAJgiQgBMESEApogQAFNECIApT2MWJyUluV27dm2mUQBEqry8vHLXdZPr29aoCHXt2lW5ubmXZyoALYbjOCUNbeNyDIApIgTAFBECYIoIATBFhACYIkIATBEhAKaIEABTRAiAKSIEwBQRAmCKCAEwRYQAmCJCAEwRIQCmiBAAU0QIgCkiBMAUEQJgiggBMEWEAJgiQgBMESEApogQAFNECIApIgTAFBECYIoIATBFhACYIkIATBEhAKaIEABTRAiAKSIEwBQRQljLzs5WbGysSkpKAs899thj6t69uw4fPmw4GYJFhBDWRo8erYyMDD333HOSpKysLK1evVrvv/++UlJSjKdDMDzWAwDfhOM4WrBggYYPH67u3btr/vz52rJli9LS0qxHQ5CIEMLekCFDNGDAAM2ePVvr16/XgAEDrEdCI3A5hpBUUVEh13WDWrtlyxbt2LFDrutyCRaGiBBC0qRJk3TTTTdp48aNF43Rjh07NGrUKC1dulQjR47UrFmzruCUuBycYL/aSFJmZqabm5vbjOPY8fl82rdvn/UYOMfv92vz5s166aWX5PV6NX36dE2YMOGCNSUlJbr11ls1adIkzZkzRwUFBerbt6+2bNmiwYMHm8yN+jmOk+e6bma924hQnY8++kiPPPKI9Rj4murqah08eFB+v19lZWXq3LmzJOn48eMa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GhUhALjcuBwDYIoIATBFhACYIkIATBEhAKaIEABTRAiAKSIEwBQRAmDq/wF7dbTfY0mkhAAAAABJRU5ErkJggg==","text/plain":[""]},"execution_count":192,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/work.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Stress tensor \n","\n","Consider a smooth surface $S$, which can be open or closed.\n","For an open surface, we can arbitrarily define one side of the surface to be the _inner_ side and \n","the other side to be the _outer_ side.\n","For a closed surface, on the other hand, the inner side is always defined to be the volume which is enclosed by the surface.\n","At any point $P$ on the surface, we may then define the outward normal unit vector $\\hat{\\mathbf{n}}$ to be perpendicular to $S$ and point in the outer direction.\n","\n","Let us consider some surface element $d\\mathbf{S}=dS\\,\\hat{\\mathbf{n}}$ inside some fluid, \n","as depicted in the picture below.\n","The direction of $d\\mathbf{S}$ is defined to be the outward unit normal, which in this case is assumed to point to the right.\n","The differential force acting on the inner fluid by the outer fluid (or by the boundary if it is a solid wall on the other side) is then given by:\n","\\begin{equation}\n","dF_\\alpha = \\sigma_{\\alpha\\beta} dS_{\\beta},\n","\\end{equation}\n","where $\\sigma_{\\alpha\\beta}(\\mathbf{r})$ is the surface tensor, which is evaluated at a point on this surface element.\n","In the case of an isotropic stress, the stress tensor can be written as:\n","\\begin{equation}\n","\\sigma_{\\alpha\\beta}(\\mathbf{r}) = -p(\\mathbf{r})\\delta_{\\alpha\\beta},\n","\\end{equation}\n","where $p(\\mathbf{r})$ is called the pressure of the fluid at point $\\mathbf{r}$ in space.\n","Notice the negative sign. \n","If we have a fluid inside a cubic box of size $L\\times L\\times L$, \n","the fluid will push each side of the box, with force magnitude $pL^2$ (if $p$ is positive).\n","\n","Let us consider a fluid inside some volume $V$.\n","$V$ can be enclosed by other fluid or solid walls.\n","Let us denote $\\mathbf{f}(\\mathbf{r})$ to be the force density (force per unit volume) acting on the fluid at $\\mathbf{r}$.\n","The net force acting on the fluid (by the surrounding fluid or the solid boundaries) is then given by the integral of $\\mathbf{f}$ over the whole fluid volume:\n","\\begin{equation}\n","\\mathbf{F} = \\int_V \\mathbf{f} \\, dV.\n","\\end{equation}\n","However, from the definition of the stress tensor, the net force acting on the fluid by the boundary can also be written as:\n","\\begin{equation}\n","F_\\alpha = \\oint_{\\partial V} \\sigma_{\\alpha\\beta} \\, dS_\\beta.\n","\\end{equation}\n","Thus,\n","\\begin{align}\n","\\int_V f_\\alpha \\, dV = \\oint_{\\partial V} \\sigma_{\\alpha\\beta} \\, dS_\\beta = \\int_V \\partial_\\beta\\sigma_{\\alpha\\beta} \\, dV,\n","\\end{align}\n","and therefore,\n","\\begin{equation}\n","f_\\alpha = \\partial_\\beta\\sigma_{\\alpha\\beta}.\n","\\end{equation}"]},{"cell_type":"code","execution_count":191,"metadata":{"trusted":false},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAASEAAADrCAYAAAAmGSB9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZH0lEQVR4nO3deViU9f7/8Sc7bkipCMqAG5qpKGnkkrsokB47mYqmpuVJSg23wsyU7ER+zbTS1BaPlJJLZbSoqJT2w1+5YJl6rKOmLCWu39SDrDJ8/zAnSXJJ4MPyelwX14G577l5z5x8Xvfc93CPXUFBASIiptibHkBEKjdFSESMUoRExChFSESMUoRExChFSESMcryZlWvVql3g69ughEYRkYrqu+92ny4oKKhT1LKbipCvbwO++iqpeKYSkUrDzc0u5c+W6eWYiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQiBilCImIUYqQi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oRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQoRUhEjFKERMQou4KCghtf2c7uFJBScuOISAXlW1BQUKeoBTcVIRGR4qaXYyJilCIkIkYpQiJilCIkIkYpQiJilCIkIkYpQiJilCIkIkYpQiJi1P8BFwQcfhmTT9AAAAAASUVORK5CYII=","text/plain":[""]},"execution_count":191,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/stress-tensor.png')"]},{"cell_type":"markdown","metadata":{},"source":["Now we will derive the formula for the _elastic_ stress tensor for our free energy:\n","\\begin{equation}\n","\\mathcal{F}[\\phi] = \\int_V \\bigg\\{ \\underbrace{\\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{2}\\phi^4 + \n","\\frac{\\kappa}{2}|\\nabla\\phi|^2}_{g(\\phi,\\partial_\\alpha\\phi)} \\bigg\\}\\,dV.\n","\\end{equation}\n","Suppose that we have some fluid, confined to a trapezoidal box of volume $V$ in space, \n","as we can see in the picture below.\n","Now we can deform the fluid _affinely_ (_e.g._ by shearing the box) through some infinitesimal strain $\\delta\\mathbf{r}$.\n","In other words we displace every small patch of material at $\\mathbf{r}$ to $\\mathbf{r}+\\delta\\mathbf{r}$.\n","Under this _affine_ deformation, the fluid density $\\phi(\\mathbf{r})$ and the volume of the box $V$ transform as:\n","\\begin{align}\n","\\phi(\\mathbf{r}) \\rightarrow \\phi(\\mathbf{r}-\\delta\\mathbf{r}) \\quad\\text{and}\\quad\n","V &\\rightarrow V + \\delta V.\n","\\end{align}\n","In other words, affine deformation simply translates the value of $\\phi$ through space by $\\delta\\mathbf{r}$.\n","By Taylor expanding $\\phi(\\mathbf{r}-\\delta\\mathbf{r})$, we can find:\n","\\begin{equation}\n","\\phi(\\mathbf{r}-\\delta\\mathbf{r}) = \\phi(\\mathbf{r}) - \\underbrace{\\delta\\mathbf{r}\\cdot\\nabla\\phi}_{\\delta\\phi}.\n","\\end{equation}\n","Now we can calculate the change in the total free energy due to this affine deformation:\n","\\begin{align}\n","\\delta \\mathcal{F} &= \\mathcal{F}[\\phi+\\delta\\phi] - \\mathcal{F}[\\phi] \\\\\n","&= \\int_{V+\\delta V} g(\\phi+\\delta\\phi,\\partial_\\alpha\\phi+\\delta\\partial_\\alpha\\phi) \\, dV - \n","\\int_{V} g(\\phi,\\partial_\\alpha\\phi) \\, dV \\\\\n","&= \\int_{V} g(\\phi+\\delta\\phi,\\partial_\\alpha\\phi+\\delta\\partial_\\alpha\\phi) \\, dV + \n","\\int_{\\delta V} g(\\phi+\\delta\\phi,\\partial_\\alpha\\phi+\\delta\\partial_\\alpha\\phi) \\, dV - \n","\\int_{V} g(\\phi,\\partial_\\alpha\\phi) \\, dV\n","\\end{align}\n","Now we can Taylor expand:\n","\\begin{equation}\n","g(\\phi+\\delta\\phi,\\partial_\\alpha\\phi+\\delta\\partial_\\alpha\\phi) = \n","g(\\phi,\\partial_\\alpha\\phi) + \n","\\delta\\phi \\frac{\\partial g}{\\partial\\phi} + \n","(\\delta\\partial_\\alpha\\phi) \\frac{\\partial g}{\\partial(\\partial_\\alpha\\phi)}\n","\\end{equation}\n","In particular, the second integral becomes:\n","\\begin{equation}\n","\\int_{\\delta V} g(\\phi+\\delta\\phi,\\partial_\\alpha\\phi+\\delta\\partial_\\alpha\\phi) \\, dV\n","\\simeq \\int_{\\delta V} g(\\phi,\\partial_\\alpha\\phi) \\, dV,\n","\\end{equation}\n","where we have neglected order $\\sim\\delta^2$.\n","Thus the change in the total energy is\n","\\begin{align}\n","\\delta \\mathcal{F} &= \n","\\int_{V} \\bigg\\{ \\delta\\phi \\frac{\\partial g}{\\partial\\phi} + (\\partial_\\alpha\\delta\\phi) \\frac{\\partial g}{\\partial(\\partial_\\alpha\\phi)} \\bigg\\}\\,dV + \n","\\int_{\\delta V} g(\\phi,\\partial_\\alpha\\phi) \\, dV \\\\\n","&= \n","\\int_{V} \\bigg\\{ \\delta\\phi \\frac{\\partial g}{\\partial\\phi} + (\\partial_\\alpha\\delta\\phi) \\frac{\\partial g}{\\partial(\\partial_\\alpha\\phi)} \\bigg\\}\\,dV + \n","\\oint_{\\partial V} g(\\phi,\\partial_\\alpha\\phi) \\, \\delta\\mathbf{r}\\cdot d\\mathbf{S}.\n","\\end{align}\n","Note that when you displace a surface element $d\\mathbf{S}$ by $\\delta\\mathbf{r}$, the volume covered by this travelling surface element is $\\delta\\mathbf{r}\\cdot d\\mathbf{S}$.\n","Next we can use the integration by parts on the first term:\n","\\begin{align}\n","\\delta \\mathcal{F} &= \n","\\int_{V} \\bigg\\{ \n"," \\frac{\\partial g}{\\partial\\phi} -\n"," \\partial_\\alpha\\left(\\frac{\\partial g}{\\partial(\\partial_\\alpha\\phi)}\\right) \\bigg\\} \\delta\\phi \\,dV + \n","\\oint_{\\partial V} \\frac{\\partial g}{\\partial(\\partial_\\alpha\\phi)} \\delta\\phi \\, dS_\\alpha + \n","\\oint_{\\partial V} g \\delta r_\\alpha \\, dS_\\alpha \\\\\n","&= \n","-\\int_{V} \\mu \\delta r_\\alpha \\partial_\\alpha\\phi \\, dV - \n","\\oint_{\\partial V} \\frac{\\partial g}{\\partial(\\partial_\\alpha\\phi)} \\delta r_\\beta \\partial_\\beta\\phi \\, dS_\\alpha + \n","\\oint_{\\partial V} g \\delta r_\\alpha \\, dS_\\alpha \\\\\n","&= \n","\\int_{V} \\phi \\partial_\\alpha(\\mu \\delta r_\\alpha) \\, dV - \n","\\oint_{\\partial V} \\phi \\mu \\delta r_\\alpha \\, dS_\\alpha + \n","\\oint_{\\partial V} \\left\\{ g\\delta_{\\alpha\\beta} - \n","(\\partial_\\alpha\\phi)\\frac{\\partial g}{\\partial(\\partial_\\beta\\phi)} \\right\\} \\delta r_\\alpha \\, dS_\\beta \\\\\n","&= \\oint_{\\partial V} \\left\\{ (g - \\phi\\mu)\\delta_{\\alpha\\beta} - \n","(\\partial_\\alpha\\phi)\\frac{\\partial g}{\\partial(\\partial_\\beta\\phi)} \\right\\} \\delta r_\\alpha \\, dS_\\beta + \n","\\int_{V} (\\phi \\partial_\\alpha\\mu) \\delta r_\\alpha \\, dV\n","\\end{align}\n","In the last line we assumed the fluid to be incompressible, _i.e._ $\\partial_\\alpha\\delta r_\\alpha=0$.\n","Using the first law of thermodynamics, the change in the free energy is also equal to:\n","\\begin{align}\n","\\delta \\mathcal{F} = \\delta E - T\\delta S = \\delta W - \\delta Q - T\\delta S,\n","\\end{align}\n","where $\\delta W$ is the work done on the system, $\\delta Q$ is the heat dissipated into the environment and $\\delta S$ is the increase in the system's entropy.\n","The heat dissipated into the environment causes the the entropy of the environment (or heat reservoir) $S_r$ to increase.\n","Assuming the reservoir to be frictionless, we can write $\\delta Q = T\\delta S_r$.\n","Thus, the change in the free energy is:\n","\\begin{align}\n","\\delta\\mathcal{F} = \\delta W - T \\underbrace{(\\delta S + \\delta S_r)}_{=0} = \\delta W.\n","\\end{align}\n","Note that $\\delta S + \\delta S_r$ is the change in the total entropy (_i.e._ entropy of the universe).\n","For all affine deformations, the process is time-reversible and thus should not contribute to the entropy of the universe.\n","Therefore, the change in the free energy is simply the work done on the system by the external forces: $\\delta F = \\delta W$.\n","\n","Now we will look at these external forces in more detail.\n","In order to apply the affine deformation to the system, we must exert:\n","1. some external surface force $\\mathbf{F}^{\\text{surface}}$ to the walls (using our hands), and/or\n","2. some external body force density $\\mathbf{f}^{\\text{body}}$ to the bulk of the fluid (such as gravity and electric field).\n","\n","Let us consider the external surface force first. \n","The force acting on the walls by the external force (such as our hands) is $\\mathbf{F}^{\\text{surface}}$.\n","The force acting on the walls by the fluid is $-\\oint_{\\partial V}\\sigma_{\\alpha\\beta}\\,dS_\\beta$.\n","Since we assume mechanical equilibrium throughout the deformation process, the net force on the walls has to be zero:\n","\\begin{equation}\n","F^{\\text{surface}}_\\alpha - \\oint_{\\partial V}\\sigma_{\\alpha\\beta}\\,dS_\\beta = 0, \\quad\\text{for } \\alpha=x,y,z.\n","\\end{equation}\n","Similar principle also applies for the external body force.\n","Let's consider some fluid element $dV$ inside the bulk of the fluid.\n","The force acting on this fluid element by the external force (such as gravity and electric field) is $\\mathbf{f}^{\\text{body}}\\,dV$.\n","The force acting on this fluid element by the surrounding fluid is $\\partial_\\beta\\sigma_{\\alpha\\beta}\\,dV$.\n","Since this fluid element is always in mechanical equilibrium, we also must have the force balance:\n","\\begin{equation}\n","f^{\\text{body}}_\\alpha + \\partial_\\beta\\sigma_{\\alpha\\beta} = 0, \\quad\\text{for } \\alpha=x,y,z.\n","\\end{equation}\n","Thus the work done by the external forces is $\\delta W = \\mathbf{F}\\cdot\\delta\\mathbf{r}$, or:\n","\\begin{equation}\n","\\delta W = \n","\\underbrace{\\oint_{\\partial V} \\sigma_{\\alpha\\beta} \\delta r_\\alpha \\, dS_\\beta}_{\\text{from external surface force}} - \n","\\underbrace{\\int_{V} (\\partial_\\beta\\sigma_{\\alpha\\beta}) \\delta r_\\alpha \\, dV}_{\\text{from external body force}} \n","= \\int_V \\underbrace{\\sigma_{\\alpha\\beta}}_{\\text{stress}} \\underbrace{\\partial_\\beta \\delta r_\\alpha}_{\\text{strain}} \\, dV\n","\\end{equation}\n","Note that $\\partial_\\beta\\delta r_\\alpha$ is also called the strain tensor.\n","Now we can then equate $\\delta\\mathcal{F} = \\delta W$.\n","Comparing the surface term, we get the elatic stress tensor:\n","\\begin{equation}\n","\\sigma_{\\alpha\\beta} = \\underbrace{(g - \\phi\\mu)}_{-p}\\delta_{\\alpha\\beta} - (\\partial_\\alpha\\phi)\\frac{\\partial g}{\\partial(\\partial_\\beta\\phi)}, \n","\\end{equation}\n","where we have also identified the isotropic pressure to be $p=\\phi\\mu-g$.\n","Equating the volume term, we get the elastic force density:\n","\\begin{equation}\n","\\mathbf{f} = -\\phi\\nabla\\mu.\n","\\end{equation}\n","One can also verify that $f_\\alpha=\\partial_\\beta\\sigma_{\\alpha\\beta}$.\n","In the derivation above, we have assumed the fluid to be incompressible, _i.e._ $\\partial_\\alpha\\delta r_\\alpha=0$, for a compressible fluid, the results remain the same."]},{"cell_type":"code","execution_count":190,"metadata":{"trusted":false},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAdAAAADfCAYAAABGfIJhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAf9ElEQVR4nO3deXhU5d3G8W8IkADBsgQCwUDCJhBkV3YERItWkFXEAiKFigJWcakQKliC1FoQkVYotVCqIhTB10apC5ZF2SPQorIpRkhCMcFEAglZmPcPnJCQZSYnM3PmnLk/1+XVZtYnrWfunN/9zEyQw+FAREREKqaK2QsQERGxIgWoiIiIAQpQERERAxSgIiIiBihARUREDKhakRuHh4c7oqOjvbQUERER/5KYmJjmcDgalHZdhQI0Ojqa/fv3e2ZVIiIifi4oKCiprOs0whURETFAASoiImKAAlRERMQABaiIiIgBClAREREDFKAiIiIGKEBFREQMUICKiIgYoAAVERExQAEqIiJigAJURETEAAWoiIiIAQpQERERAxSgIiIiBihARUREDFCAioiIGKAAFRERMUABKiIiYoACVERExAAFqIiIiAEKUBEREQMUoCIiIgYoQEVERAxQgIqIiBigABURETFAASoiImKAAlRERMQABaiIiIgBClAREREDFKAiIiIGKEBFREQMqGr2Aipq1apVFBQUmL0MsYBbb72VmJgYs5chRXzyySccOXLE7GWIBTRt2pTbb7/d7GWUy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2PzF7OeLHZs/+tdlLsAzLBajGtuKu4OBgs5fgN2rUqEFOTo7ZyxAL0HHjPssFaHp6utlLELGc5ORks5cgYjuW20QkIiLiDxSgIiIiBihARUREDFCAioiIGKAAFRERMUABKiIiYoACVERExAAFqIiIiAEKUBEREQMUoCIiIgYoQEVERAxQgIqIiBigABURETFAASoiImKAAlRERMQABaiIiIgBClAREREDFKAiIiIGKEBFREQMUICKiIgYoAAVERExQAEqIiJigAJURETEAAWoiIiIAQpQERERAxSgIiIiBihARUREDFCAioiIGKAAFRERMUABKiIiYoACVERExAAFqIiIiAFBDofD/RsHBX0HJHlvOSIiIn6lmcPhaFDaFRUKUBEREblCI1wREREDFKAiIiIGKEBFREQMUICKiIgYoAAVERExQAEqIiJigAJURETEAAWoiIiIAQpQERERA/4fLH0NdeQfNogAAAAASUVORK5CYII=","text/plain":[""]},"execution_count":190,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/affine-deformation.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Equation of state\n","\n","Let us consider the shifted Landau free energy for liquid/gas phase separation:\n","\\begin{equation}\n","\\mathcal{F}[n] = \\int dV \\bigg\\{ \n","\\underbrace{\\frac{\\alpha}{2}(n-n_c)^2 + \\frac{\\beta}{4}(n-n_c)^4}_{f(n)= \\text{bulk energy density}} + \n","\\frac{\\kappa}{2}|\\nabla n|^2 \\bigg\\},\n","\\end{equation}\n","where $n_c,\\beta,\\kappa$ are positive and $\\alpha$ can be positive or negative.\n","Here $n(\\mathbf{r})>0$ represents the absolute number density of the fluid, rather than rescaled density $\\phi(\\mathbf{r})$, which can be positive or negative.\n","They are related through:\n","\\begin{equation}\n","\\phi(\\mathbf{r}) = \\frac{n(\\mathbf{r})-n_c}{n_c}.\n","\\end{equation}\n","For example, the number density of water molecules in liquid water at room temperature is $n\\simeq 33.4\\times 10^{27}\\,\\text{m}^{-3}$.\n","You can think of Landau free energy as a Taylor expansion of $\\mathcal{F}[n]$ around the critical point $(\\alpha=0,n=n_c)$ for small $n-n_c$.\n","In practice, one often uses Landau free energy even for large values of $n-n_c$, due to its simplicity.\n","\n","For $\\alpha<0$, the system favours phase separation into liquid and gas phase, whose number densities are given by the minima of the bulk energy density $f(n)$:\n","\\begin{align}\n","n_l = n_c + \\sqrt{\\frac{-\\alpha}{\\beta}} \\quad\\text{and}\\quad\n","n_g = n_c - \\sqrt{\\frac{-\\alpha}{\\beta}},\n","\\end{align}\n","respectively.\n","Note that the parameter $n_c$ has to be large enough such that $0"]},"execution_count":189,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/Maxwell-construction.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Convection vs diffusion\n","\n","Thus we have derived the formula for the elastic stress for the given free energy.\n","Under affine deformation, the fluid exerts some elastic stress to the walls, and also to each other inside the bulk.\n","However for a general deformation, this is not the only stress present in the fluid.\n","We also have a viscous stress, whose coefficient is called the viscosity, which is responsible for heat dissipation.\n","\n","One might also notice that the presence or absence of a mechanical stress does not affect the Cahn-Hiliard equation:\n","\\begin{equation}\n","\\frac{\\partial\\phi}{\\partial t} = M\\nabla^2\\frac{\\delta\\mathcal{F}}{\\delta\\phi} \\quad \\text{(Cahn-Hiliard equation)}\n","\\end{equation}\n","This is because Cahn-Hiliard equation only describes the diffusion process in the binary fluid.\n","In general, there are two ways a fluid can move inside the system: 1) diffusion and 2) convection.\n","\n","An example of diffusion process is when we put a drop of red ink inside a static and viscous solvent.\n","This ink will spread slowly until the whole fluid becomes homogenously red.\n","This diffusion process is due to the Brownian motion of the ink molecules.\n","Typically the higher the temperature is, the faster the diffusion process will be.\n","\n","An example of convection is when we put a beach ball on a flowing river. \n","This beach ball will move with the same velocity as the water.\n","If we put a drop of red ink on a flowing river, this blob of red ink will also move with the same velocity as the water, while at the same time diffuses around its centre of mass.\n","To describe the convection process in a binary fluid, we need to define another field, which is the velocity field $\\mathbf{u}(\\mathbf{r},t)$ (in addition to $\\phi(\\mathbf{r},t)$).\n","The time evolution of $\\mathbf{u}(\\mathbf{r},t)$ will be described by the Navier-Stokes equation:\n","\\begin{equation}\n","\\underbrace{\\rho}_{\\text{mass density}} \\underbrace{\\left(\\frac{\\partial}{\\partial t} + \\mathbf{u}\\cdot\\nabla\\right)u_\\alpha}_{\\text{acceleration}} = \n","\\underbrace{\\partial_\\beta\\sigma_{\\alpha\\beta}}_{\\text{force density}}.\\quad\\text{(Navier-Stokes equation)}\n","\\end{equation}\n","In essence, the Navier-Stokes equation is just a momentum conservation or Newton's second law.\n","Thus to take into account of both diffusion and convection process in a binary fluid properly, \n","we need to solve the coupled Cahn-Hiliard-Navier-Stokes equation:\n","\\begin{align}\n","\\frac{\\partial\\phi}{\\partial t} + (\\mathbf{u}\\cdot\\nabla)\\phi &= \n","M\\nabla^2\\frac{\\delta\\mathcal{F}}{\\delta\\phi} \\quad\\text{(Cahn-Hiliard equation)} \\\\\n","\\rho \\left(\\frac{\\partial}{\\partial t} + \\mathbf{u}\\cdot\\nabla\\right)u_\\alpha &= \n","\\partial_\\beta\\sigma_{\\alpha\\beta} \\quad\\text{(Navier-Stokes equation)} \\\\\n","\\nabla\\cdot\\mathbf{u} &= 0 \\quad\\text{(incompressibility condition)}. \n","\\end{align}\n","Notice that the first two equations are coupled through the stress tensor $\\sigma_{\\alpha\\beta}$, which depends on $\\phi$,\n","and the convection term $(\\mathbf{u}\\cdot\\nabla)\\phi$.\n","\n","In practice, we can also define the diffusion timescale $t_{\\text{diffusion}}$ and the convection timescale $t_{\\text{convection}}$ to be:\n","\\begin{align}\n","t_{\\text{diffusion}} = \\frac{L^2}{M\\alpha} \\quad\\text{and}\\quad\n","t_{\\text{convection}} = \\frac{L}{U},\n","\\end{align}\n","where $L$ is the system size and $U$ is the typical magnitude of the fluid velocity in the system (such the velocity of the flowing river under gravity).\n","If $t_{\\text{diffusion}}\\ll t_{\\text{convection}}$, then the diffusion process dominates over convection and the problem can be simply described by Cahn-Hiliard equation alone.\n","\n","### Laplace pressure\n","\n","Let us recall the Hamiltonian:\n","\\begin{equation}\n","\\mathcal{F}[\\phi] = \\int_V \\bigg\\{ \\underbrace{\\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{4}\\phi^4}_{f(\\phi)} + \\frac{\\kappa}{2}|\\nabla\\phi|^2 \\bigg\\},\n","\\end{equation}\n","where $f(\\phi)$ is the bulk (or local) free energy density.\n","In equilibrium, and far from any boundary or curved interface, the density of the fluid is given by the minima of this bulk energy density.\n","We call this density the binodal density $\\pm\\phi_B$:\n","\\begin{equation}\n","\\frac{df}{d\\phi} = 0 \\quad\\Rightarrow\\quad \\phi=\\pm\\phi_B \\quad\\text{where}\\quad \\phi_B=\\sqrt{\\frac{-\\alpha}{\\beta}}.\n","\\end{equation}\n","As we have seen above, for a flat interface, the equilibrium density of the fluid on either side of the flat interface is given by the binodal densities $\\pm\\phi_B$.\n","On the other hand if the interface is curved, such as a liquid droplet surrounded by the gas phase, the density of the liquid and the gas are not exactly at the binodals (shown in the figure below).\n","They are in fact shifted away from the binodal values due to Laplace pressure.\n","Let us denote $\\phi_+$ to be the density of the liquid inside the droplet and $\\phi_-$ to be the density of the gas outside. \n","$\\phi_\\pm$ will be slightly shifted away from the binodal values, _i.e._:\n","\\begin{equation}\n","\\phi_\\pm = \\pm\\phi_B + \\epsilon_\\pm \\text{ (for curved interface)}.\n","\\end{equation}\n","This is because the pressure inside the droplet will be slightly higher than that outside.\n","The difference in this pressure is called the Laplace pressure.\n","\n","To illustrate this, let us consider a spherical liquid droplet of radius $R$ surrounded by gas phase, as shown in the figure below.\n","Let us denote $P_+$ and $P_-$ to be the pressure inside and outside the droplet respectively.\n","Now let us consider the upper hemispherical surface.\n","There are two forces acting on this hemispherical surface.\n","The first one is due to the pressure difference $\\Delta P = P_+ - P_-$ (Laplace pressure).\n","The force acting on the upper hemispherical surface is equal to $\\Delta P\\,\\pi R^2$ in the upwards direction.\n","The second force is due to the surface tension $\\gamma$: the upper hemispherical surface is pulled by the lower hemisphere right at the equator.\n","This force is equal to $\\gamma 2\\pi R$ in the downwards direction.\n","Thus balancing the two forces, we get:\n","\\begin{equation}\n","P_+ - P_- = \\frac{2\\gamma}{R}.\n","\\end{equation}\n","Note that for $d$-dimensional spherical droplet, the Laplace pressure is given by:\n","\\begin{equation}\n","P_+ - P_- = \\frac{\\gamma(d-1)}{R}.\n","\\end{equation}\n","\n","Apart from the force balance, the chemical potential inside the droplet also has to be the same as that outside the droplet.\n","If not, there will be a diffusive current from high chemical potential regions to low chemical potential regions.\n","Equating the two chemical potentials, we get:\n","\\begin{equation}\n","\\mu(\\phi_+) = \\mu(\\phi_-).\n","\\end{equation}\n","Now from the previous section, the chemical potential is given by the formula:\n","\\begin{equation}\n","\\mu = f'(\\phi) - \\kappa\\nabla^2\\phi.\n","\\end{equation}\n","However since we are only interested in the value of $\\mu$ in the bulk (where $\\phi$ is uniform), we can ignore the gradient in $\\phi$, and thus we get:\n","\\begin{equation}\n","f'(\\phi_+) = f'(\\phi_-) \\quad\\Rightarrow\\quad f'(\\phi_B + \\epsilon_+) = f'(-\\phi_B + \\epsilon_-).\n","\\end{equation}\n","Next, we can Taylor expand:\n","\\begin{align}\n","f'(\\phi_B + \\epsilon_+) &= f''(\\phi_B) \\epsilon_+ + \\mathcal{O}(\\epsilon^2) \\\\\n","f'(-\\phi_B + \\epsilon_-) &= f''(\\phi_B) \\epsilon_- + \\mathcal{O}(\\epsilon^2).\n","\\end{align}\n","Note that since $f(\\phi)$ is symmetric, $f''(\\phi_B)=f''(-\\phi_B)$.\n","Thus the equality of chemical potential implies that $\\epsilon_+=\\epsilon_-$, \n","_i.e._ the values of $\\phi_\\pm$ are shifted by the same amount from the binodals.\n","\n","Now let us go back to the Laplace pressure.\n","From the previous section, we have the formula for the pressure:\n","\\begin{align}\n","P = \\phi\\mu - g, \\text{ where } \n","g = f(\\phi) + \\frac{\\kappa}{2}|\\nabla\\phi|^2 \\text{ and }\n","\\mu = f'(\\phi) - \\kappa\\nabla^2\\phi.\n","\\end{align}\n","Since we are only interested in the value of $P$ in the bulk, we can ignore the gradient terms to get:\n","\\begin{equation}\n","P(\\phi) = \\phi f'(\\phi) - f(\\phi).\n","\\end{equation}\n","Now subsituting this to the Laplace pressure equation, we get:\n","\\begin{align}\n","\\phi_+ f'(\\phi_+) - \\phi_- f'(\\phi_-) - f(\\phi_+) + f(\\phi_-) &= \\frac{2\\gamma}{R} \\\\\n","(\\phi_B+\\epsilon) f'(\\phi_B+\\epsilon) - (-\\phi_B+\\epsilon) f'(-\\phi_B+\\epsilon) - f(\\phi_B+\\epsilon) + f(-\\phi_B+\\epsilon) &= \\frac{2\\gamma}{R}\n","\\end{align}\n","We can then Taylor expand for small $\\epsilon$ and simplify to get\n","\\begin{align}\n","\\epsilon = \\frac{\\gamma}{R\\phi_B f''(\\phi_B)}.\n","\\end{align}"]},{"cell_type":"code","execution_count":186,"metadata":{"trusted":false},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAOsAAADrCAYAAACICmHVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA0RklEQVR4nO3deVwU9R/H8dcu53KKIqIo4H0D3veRinnklZpoaFqaZd6VmnmWlaVmmUfmbR55n8mvVEzyVgQVvFHSPLgPBTl2d35/rKyiaCC7LAPf5+OxD9yZ3e98lnozszPf+X4VkiQhCELhpzR1AYIg5I4IqyDIhAirIMiECKsgyIQIqyDIhAirIMiEeV5e7OzsLHl6ehqpFEEQgoODYyVJKp3TujyF1dPTkzNnzhimKkEQnqNQKP550TpxGCwIMiHCKggyIcIqCDIhwioIMiHCKggyIcIqCDIhwioIMiHCKggyIcIqCDIhwioIMiHCKggyIcIqCDIhwioIMiHCKuTf7dvQti3UqgXe3rB9u6krKpLydIucIOTI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EVZBkAkRVkGQCRFWQZAJEVZBkAkRVkGQif8DGRHrmAvQhB4AAAAASUVORK5CYII=","text/plain":[""]},"execution_count":186,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/Laplace-pressure.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Droplet evaporation\n","\n","Now let us consider a single spherical liquid droplet of radius $R$, surrounded by the gas phase, as depicted in the figure below.\n","The density of the liquid inside the droplet and that of the gas just immediately outside the droplet will be shifted away from the binodal values due to the Laplace pressure as described in the previous section.\n","In particular, the density of the liquid inside the droplet and that of the gas on the surface of the droplet will be $\\phi_B+\\epsilon$ and $-\\phi_B+\\epsilon$ respectively, where\n","\\begin{equation}\n","\\phi_B = \\sqrt{\\frac{-\\alpha}{\\beta}}, \\quad\\text{and}\\quad \\epsilon = \\frac{\\gamma}{R\\phi_B f''(\\phi_B)}.\n","\\end{equation}\n","Very far away from the droplet, the density of the gas phase will go back to its equilibrium bulk value, _i.e._ $-\\phi_B$, as depicted in the figure below. \n","Thus, we expect a chemical potential gradient from $\\mu_R$ on the surface of the droplet to $0$ at infinity.\n","This chemical potential gradient will induce a current from the surface of the droplet to infinity, which then causes the droplet to shrink.\n","\n","Assuming the radius of the droplet $R(t)$ shrinks slowly, we can assume the chemical potential of the gas phase to be quasi-static: $\\nabla^2\\mu=0$.\n","Assuming spherical symmetry, $\\mu=\\mu(r)$, we then have:\n","\\begin{equation}\n","\\frac{1}{r^2}\\frac{d}{dr}\\left(r^2 \\frac{d\\mu}{dr}\\right) = 0 \\quad\\Rightarrow\\quad\n","\\mu(r) = \\frac{A}{r} + B.\n","\\end{equation}\n","Fixing the boundary conditions $\\mu(R)=\\mu_R$ and $\\mu(\\infty)=0$, we can solve the integration constants $A$ and $B$ to get $\\mu(r)$ and subsequently $\\mathbf{J}(r)$:\n","\\begin{equation}\n","\\mu(r) =\n","\\begin{cases}\n","\t\t\t\\mu_R & \\text{, } r"]},"execution_count":185,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/droplet-evaporation.png')"]},{"cell_type":"markdown","metadata":{},"source":["## Wetting\n","\n","In this section we will consider a liquid droplet on a flat solid surface, surrounded by the gas phase (see figure below).\n","In this case, we have three different interfaces:\n","- liquid-gas interface\n","- solid-gas interface\n","- solid-liquid interface,\n","\n","and three different surface tension: $\\gamma_{lg}$, $\\gamma_{sg}$, and $\\gamma_{sl}$ for each respective interface.\n","The line where all the three interfaces meet is called the contact line (indicated by the red dot in the figure below).\n","In our two-dimensional case, the contact line extends in the $z$-direction.\n","\n","The contact angle $\\theta$ is defined to be the angle between the tangent line to the liquid-gas interface and the surface at the contact line at equilibrium (see figure below). \n","If $\\theta<90^\\circ$, the surface is said to be hydrophilic (in the case of water), _i.e._, it attracts water.\n","If $\\theta>90^\\circ$, the surface is said to be hydrophobic, _i.e._, it repels water.\n","\n","The goal of this section is to derive the suitable boundary conditions for the density field $\\phi(\\mathbf{r},t)$ at the surface (which we assume to be at $y=0$ and $y=L$) for a given contact angle $\\theta$."]},{"cell_type":"code","execution_count":184,"metadata":{"tags":["hide_code"]},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAVgAAADrCAYAAAAsRY4vAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAArDklEQVR4nO3dd1hW9f/H8efNni5wbxEVBy5woWTulag5vhqaYCgFpZKpmSaY2wBTU9FcOclZrnJQrlIEc/40FcWdCmYiyL5/f1AkORLl3Ofmvt+P6+Iqz30453Vn94vD55zzORqtVosQQoiCZ6J2ACGEMFRSsEIIoRApWCGEUIgUrBBCKEQKVgghFCIFK4QQCjHLz8qOjo7aKlWqKBRFCCEKn9jY2AStVlvyaa/lq2CrVKlCTExMwaQS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EXQuRfyVJFQEfl+l/0smDRmIClYT2+VwhhfPRyDFYIIQyBFKwQQihEClYIIRQiBSuEEAqRghVCCIVIwQohhEKkYIUQQiFSsEIIoRApWCGEUIgUrBBCKEQKVgghFCIFK4QQCsnXdIUajeYucEW5OEIIUehU1mq1JZ/2Qr4KVgghxIuTIQIhhFCIFKwQQihEClYIIRQiBSuEEAqRghVCCIVIwQohhEKkYIUQQiFSsEIIoRApWCGEUMj/A0cXAhnUPpuiAAAAAElFTkSuQmCC","text/plain":[""]},"execution_count":184,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/contact-angle.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Young's equation\n","\n","First we will express the contact angle $\\theta$ in terms of the three surface tension: $\\gamma_{lg}$, $\\gamma_{sg}$, and $\\gamma_{sl}$.\n","To do this let us consider one of the contact lines, indicated by the red dot in the figure below.\n","Note that the contact line extends infinitely in the $z$-direction (out of the screen).\n","The solid-liquid interface tends to pull this contact line to the right with magnitude $\\gamma_{sl}$ (per unit length of the contact line).\n","The gas-solid interface, on the other hand, tends to pull this contact line to the left with magnitude $\\gamma_{sg}$.\n","Finally the liquid-gas interface tends to pull the contact line upwards at an angle $\\theta$, relative to the $x$-axis, with magnitude $\\gamma_{lg}$.\n","These three interfacial forces acting on a single contact line are indicated by purple arrows in the figure below.\n","\n","In equilibrium, the contact line should not move, so we balance the net force in the $x$-direction to get the Young's equation for the contact angle:\n","\\begin{equation}\n","\\gamma_{sg} = \\gamma_{sl} + \\gamma_{lg}\\cos\\theta \\quad\\Rightarrow\\quad\n","\\cos\\theta = \\frac{\\gamma_{sg}-\\gamma_{sl}}{\\gamma_{lg}}.\n","\\end{equation}"]},{"cell_type":"code","execution_count":205,"metadata":{"tags":["hide_code"]},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAASEAAADrCAYAAAAmGSB9AAAAOXRFWHRTb2Z0d2FyZQBNY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wzXjlCiHyqMnBMp9O1+e8PshRCQghhaHI5JoRQlISQEEJREkJCCEVJCAkhFCUhJIRQlISQEEJREkJCCEVJCAkhFCUhJIRQ1P8BxHcJTrLkkZoAAAAASUVORK5CYII=","text/plain":[""]},"execution_count":205,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/Youngs-equation.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Surface free energy\n","\n","So far we have written down the contact angle $\\theta$ in terms of the three surface tension: $\\gamma_{lg}$, $\\gamma_{sg}$, and $\\gamma_{sl}$, however, \n","we have not yet discussed how we are going to implement the contact angle $\\theta$ into our equation of motion, _i.e._, the Cahn-Hiliard equation. \n","This is actually done by modifying our free energy functional to include the contribution from the surface energy:\n","\\begin{equation}\n","\\mathcal{F}[\\phi] = \\int_V \\bigg[ \\underbrace{\\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{4}\\phi^4}_{f(\\phi)} + \\frac{\\kappa}{2}|\\nabla\\phi|^2 \\bigg] dV - \\int_\\text{walls} h\\phi \\, dS,\n","\\end{equation}\n","where $h$ is some constant, which depends on the contact angle $\\theta$. \n","The last term above is a surface integral over the two wall surfaces at $y=0$ and $y=L$ (assuming they both have the same contact angle $\\theta$).\n","Thus, $h$ acts like an external field for $\\phi$ on the surface. \n","If $h>0$, it is more energetically favourable for the value of $\\phi$ to go up on the surface (compared to that in the bulk).\n","This corresponds to an hydrophilic surface or $\\theta<90^\\circ$.\n","On the other hand if $h<0$, it more energetically favourable for the value of $\\phi$ to go down on the surface.\n","This corresponds to an hydrophobic surface or $\\theta>90^\\circ$.\n","\n","The equilibrium state of the droplet corresponds to the minimum of the free energy $F[\\phi]$.\n","Let us now consider the variation in the free energy $F[\\phi]$, when we vary the density field $\\phi\\rightarrow\\phi+\\delta\\phi$:\n","\\begin{align}\n","\\delta F &= \\int_V \\bigg[ f'(\\phi)\\delta\\phi + \\kappa\\nabla\\phi\\cdot\\nabla\\delta\\phi \\bigg]dV - \n","\\int_\\text{walls} h\\delta\\phi \\, dS \\\\\n","&= \\int_V \\bigg[ f'(\\phi) - \\kappa\\nabla^2\\phi \\bigg]\\delta\\phi \\, dV + \n"," \\int_V \\kappa\\nabla\\cdot(\\delta\\phi\\nabla\\phi) \\, dV - \n"," \\int_\\text{walls} h\\delta\\phi \\, dS,\n","\\end{align}\n","where we have used integration by parts in the second line above.\n","Now using divergence theorem, the second term above becomes a surface integral over the whole system (see figure below):\n","\\begin{align}\n","\\int_V \\kappa\\nabla\\cdot(\\delta\\phi\\nabla\\phi) \\, dV &= \n","\\oint_{\\partial V} \\kappa \\delta\\phi\\nabla\\phi \\cdot \\hat{\\mathbf{n}}\\,dS \\\\\n","&= \\int_{y=0} \\kappa \\delta\\phi\\nabla\\phi\\cdot(-\\hat{\\mathbf{y}})\\,dS + \n"," \\int_{y=L} \\kappa \\delta\\phi\\nabla\\phi\\cdot\\hat{\\mathbf{y}}\\,dS + \n","\\underbrace{\n"," \\int_{x=0} \\kappa \\delta\\phi\\nabla\\phi\\cdot(-\\hat{\\mathbf{x}})\\,dS + \n"," \\int_{x=L_x} \\kappa \\delta\\phi\\nabla\\phi\\cdot\\hat{\\mathbf{x}}\\,dS \n","}_{=0}.\n","\\end{align}\n","Note that $\\hat{\\mathbf{n}}$ is the outward unit normal to the surface (see figure below). \n","Using periodic boundary condition, the integral over $x=0$ and $x=L_x$ surface vanish.\n","Thus we end up with just the surface integrals over $y=0$ and $y=L$.\n","Finally, the variation in the free energy is then given by:\n","\\begin{align}\n","\\delta F = \\int_V \\bigg[ f'(\\phi) - \\kappa\\nabla^2\\phi \\bigg]\\delta\\phi\\,dV - \n"," \\int_{y=0} \\bigg( \\kappa \\left.\\frac{\\partial\\phi}{\\partial y}\\right|_{y=0} + h \\bigg)\\delta\\phi\\,dS +\n"," \\int_{y=L} \\bigg( \\kappa \\left.\\frac{\\partial\\phi}{\\partial y}\\right|_{y=L} - h \\bigg)\\delta\\phi\\,dS.\n","\\end{align}\n","Now in equilibrium, the variation in the free energy (with respect to $\\delta\\phi$) is equal to zero, _i.e._ $\\delta F=0$.\n","Thus the volume term and the surface terms above should be equal to zero.\n","Equating the volume term to zero, we get:\n","\\begin{equation}\n","f'(\\phi) - \\kappa\\nabla^2\\phi = 0,\n","\\end{equation}\n","which is the same statement as the chemical potential being equal to zero: $\\mu=0$.\n","Now equating the surface terms to zero, we get a boundary condition for $\\phi$ at $y=0$ and $y=L$ respectively:\n","\\begin{equation}\n","\\left.\\frac{\\partial\\phi}{\\partial y}\\right|_{y=0} = -\\frac{h}{\\kappa}, \\quad\\text{and}\\quad\n","\\left.\\frac{\\partial\\phi}{\\partial y}\\right|_{y=L} = \\frac{h}{\\kappa}.\n","\\end{equation}"]},{"cell_type":"code","execution_count":211,"metadata":{},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAVgAAADrCAYAAAAsRY4vAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAev0lEQVR4nO3deVxU9eL/8dewo6YW5IY7kYILKuACaaWG4m6afvWHllhetzK5almWmplaKd7cLbdMA7FcUitxKUtzATf0aiqGVu4aRaggOL8/6Frkkgtnzgy8n4/HeTB+Zuact4/i7ZnPnMVitVoREZH852R2ABGRgkoFKyJiEBWsiIhBVLAiIgZRwYqIGEQFKyJiEJc7ebG3t7e1cuXKBkUREXE8SUlJ56xW64M3eu6OCrZy5cokJibmTyoRkQLAYrEcu9lzmiIQETGIClZExCAqWBERg6hgRUQMooIVETGIClZExCAqWBERgzhkwZYvX55JkyblGUtOTsbDw4P//ve/JqUSEcnLIQu2UaNG7NixI8/Yiy++yLPPPktAQIBJqURE8ioQBbt8+XJ27drF6NGjTUwlIpKXQxZsw4YNSUlJ4cKFC2RmZjJkyBBef/11vLy8zI4m9ujsWRg1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sTiBu5fZKURE7oldzsGKiBQEKlgREYOoYEVEDKKCFRExiApWRMQgKlgREYOoYEVEDKKCFRExiApWRMQgKlgREYOoYEVEDKKCFRExyB1dTctisZwFjhkXR0TE4VSyWq0P3uiJOypYERG5fZoiEBExiApWRMQgKlgREYOoYEVEDKKCFRExiApWRMQgKlgREYOoYEVEDKKCFRExyP8H2UcsEhk8MYEAAAAASUVORK5CYII=","text/plain":[""]},"execution_count":211,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/surface-integral.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Densities at the walls\n","\n","Now using the free energy functional given above, we will calculate the value of the density field $\\phi$ at the bottom wall $y=0$.\n","(The calculation for the top wall is similar.)\n","For simplicity, let us assume a homogenous liquid inside the system.\n","The density of the liquid is equal to $\\sqrt{\\frac{-\\alpha}{\\beta}}$ everywhere in the system \n","(except close to the walls).\n","Assuming $h>0$ for now, the density of the liquid at the walls, $\\phi_{\\text{wall}}$, will be slightly higher than that in the bulk, _i.e._ $\\phi_{\\text{wall}}>\\sqrt{\\frac{-\\alpha}{\\beta}}$ (see figure below).\n","Let us now calculate the value for $\\phi_\\text{wall}$.\n","From the previous section, we know that in equilibrium, the density field $\\phi(y)$ satisfies the equation:\n","\\begin{equation}\n","f'(\\phi) - \\kappa\\frac{d^2\\phi}{dy^2} = 0.\n","\\end{equation}\n","Note that we assume the system to be homogenous along $x$.\n","Now multiplying the above equation with $\\frac{d\\phi}{dy}$, and then integrating over $y$ from $y=0$ to $y=\\frac{L}{2}$, we get the __Noether's equation__:\n","\\begin{align}\n","\\int_0^{\\frac{L}{2}} \\frac{df}{dy} \\, dy - \n","\\frac{\\kappa}{2}\\int_0^{\\frac{L}{2}} \\frac{d}{dy}\\left(\\frac{d\\phi}{dy}\\right)^2 dy &= 0 \\\\\n","f\\left(\\phi\\left(\\frac{L}{2}\\right)\\right) - f(\\phi(y=0)) - \n","\\frac{\\kappa}{2} \n","\\left[ \n"," \\left(\\left.\\frac{d\\phi}{dy}\\right|_{y=\\frac{L}{2}}\\right)^2 - \\left(\\left.\\frac{d\\phi}{dy}\\right|_{y=0}\\right)^2 \n","\\right] &= 0.\n","\\end{align}\n","However, we know that the value of $\\phi(y)$ at $y=0$ is equal to $\\phi_\\text{wall}$ and the first derivative of $\\phi(y)$ at $y=0$ is equal to $-\\frac{h}{\\kappa}$.\n","Furthermore, $\\phi(y)$ at $y=\\frac{L}{2}$ takes the bulk value $\\sqrt{\\frac{-\\alpha}{\\beta}}$ and its derivative is zero since $\\phi$ is constant in the bulk (see figure below).\n","Therefore, the Noether's equation becomes:\n","\\begin{align}\n","f\\left(\\sqrt{\\frac{-\\alpha}{\\beta}}\\right) - f(\\phi_\\text{wall}) + \\frac{h^2}{2\\kappa} = 0.\n","\\end{align}\n","Now we can subsitute the $f(\\phi) = \\frac{\\alpha}{2}\\phi^2 + \\frac{\\beta}{4}\\phi^4$ to the equation above to get a quartic equation:\n","\\begin{align}\n","\\frac{\\alpha}{2}\\phi_\\text{wall}^2 + \\frac{\\beta}{4}\\phi_\\text{wall}^4 + \\frac{\\alpha^2}{4\\beta} - \\frac{h^2}{2\\kappa} = 0.\n","\\end{align}\n","We can then solve this quartic equation to get density of the fluid at the wall (_i.e._ at $y=0$ in this case):\n","\\begin{align}\n","\\phi_\\text{wall} = \\pm\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1\\pm\\Omega}, \\quad\\text{where}\\quad\n","\\Omega = \\sqrt{\\frac{2\\beta}{\\kappa\\alpha^2}}h.\n","\\end{align}\n","In this case, since the density of the bulk is equal to $\\sqrt{\\frac{-\\alpha}{\\beta}}$ and $h>0$, \n","the density of the fluid at the wall has to be larger than $\\sqrt{\\frac{-\\alpha}{\\beta}}$.\n","Therefore, the appropriate solution to the quartic equation is:\n","\\begin{align}\n","\\phi_\\text{wall} = \\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1+\\Omega}.\n","\\end{align}\n","\n","We can easily generalize the result above to all four different cases: $h>0$, $h<0$, and liquid or gas bulk density.\n","The results are summarized in the table below:\n","\\begin{equation}\n","\\begin{array}{ |c|c|c| } \n"," \\hline\n"," & h>0 & h<0 \\\\ \n"," \\hline\n"," \\text{liquid} & \\phi_\\text{wall}=\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1+\\Omega} & \\phi_\\text{wall}=\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1+\\Omega} \\\\ \n"," \\hline\n"," \\text{gas} & \\phi_\\text{wall}=-\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1-\\Omega} & \\phi_\\text{wall}=-\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1-\\Omega} \\\\ \n"," \\hline\n","\\end{array},\n","\\end{equation}\n","where,\n","\\begin{equation}\n","\\Omega = \\sqrt{\\frac{2\\beta}{\\kappa\\alpha^2}}h \\quad\\Leftrightarrow\\quad\n","h = \\sqrt{\\frac{\\kappa\\alpha^2}{2\\beta}}\\Omega.\n","\\end{equation}\n"]},{"cell_type":"code","execution_count":217,"metadata":{},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAWAAAADCCAYAAAB3whgdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAhz0lEQVR4nO3de3xMZ/4H8M/knkppiKZRdxG3IBFCoqtoXIoibZfdpdsoi5W6VNNqbbfKht1tsdVWb2HFbrR0GxRFm1o0P1bJRS6kWiE0EksulNwv5/fHdyeR+0xmJmdm8nm/XvOamTPnPPOdiG+e+Z7nPI9GURQQEVHLs1E7ACKi1ooJmIhIJUzAREQqYQImIlIJEzARkUqYgImIVGKnz85ubm5K9+7dTRQKEZF1io+Pz1EUpWPt7Xol4O7duyMuLs54URERtQIajeZKfdtZgiAiUgk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AaZFGT8aSlpSE2Nhbz589XLQYiIn1ZxWQ8/fr1M7uvEEREzWXxJ+GIiCwVEzARkUqYgImIVMIETESkEiZgIiKVMAETEamECZiISCVMwEREKmECJiJSCRMwEZFKmICJiFTCBExEpBImYCIilTABExGphAmYiEglTMBERCrRa0UMjUZzE8AV04VDRGSVuimK0rH2Rr0SMBERGQ9LEEREKmECJiJSCRMwEZFKmICJiFTCBExEpBImYCIilTABExGphAmYiEglTMBERCr5f3SO38aROsbBAAAAAElFTkSuQmCC","text/plain":[""]},"execution_count":217,"metadata":{},"output_type":"execute_result"}],"source":["Image('https://raw.githubusercontent.com/elsentjhung/cahn-hilliard-droplet/master/figures/wall-density.png')"]},{"cell_type":"markdown","metadata":{},"source":["### Three surface tensions\n","\n","After knowing the values of $\\phi$ at the walls for the four different cases, we can now compute the three surface tensions: $\\gamma_{lg}$, $\\gamma_{sg}$, and $\\gamma_{sl}$.\n","From the previous previous section, we have derived the liquid-gas surface tension:\n","\\begin{equation}\n","\\gamma_{lg} = \\sqrt{\\frac{-8\\kappa\\alpha^3}{9\\beta^2}}.\n","\\end{equation}\n","We are left two more surface tensions to compute.\n","\n","Recall that the surface tension is the excess free energy of the interface (per surface area of the interface).\n","Therefore, the solid-liquid surface tension is given by (we approximate the bulk $y=\\frac{L}{2}$ to be at infinity):\n","\\begin{equation}\n","\\gamma_{sl} = \\int_0^\\infty \\bigg[ f(\\phi) + \\frac{\\kappa}{2}\\left(\\frac{d\\phi}{dy}\\right)^2 \\bigg]dy - h\\phi_\\text{wall} - \\int_0^\\infty f\\left(\\sqrt{\\frac{-\\alpha}{\\beta}}\\right)\\,dy\n","\\end{equation} \n","We can then use Noether's equation again:\n","\\begin{equation}\n","f(\\phi) - \\frac{\\kappa}{2}\\left(\\frac{d\\phi}{dy}\\right)^2 = f\\left(\\sqrt{\\frac{-\\alpha}{\\beta}}\\right),\n","\\end{equation}\n","so we get:\n","\\begin{align}\n","\\gamma_{sl} &= \\kappa\\int_0^\\infty \\left(\\frac{d\\phi}{dy}\\right)^2 dy - h\\phi_\\text{wall} \\\\\n","&= \\kappa\\int_{\\phi_\\text{wall}}^{\\sqrt{-\\alpha/\\beta}} \\left(\\frac{d\\phi}{dy}\\right) d\\phi - h\\phi_\\text{wall}\n","\\end{align}\n","Using Noether's equation again, we get:\n","\\begin{align}\n","\\gamma_{sl} &= \\sqrt{2\\kappa}\\int_{\\phi_\\text{wall}}^{\\sqrt{-\\alpha/\\beta}} \\sqrt{f(\\phi)+\\frac{\\alpha^2}{4\\beta}}\\,d\\phi - h\\phi_\\text{wall}\n","\\end{align}\n","However, we know that $\\phi_\\text{wall}=\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1+\\Omega}$, thus,\n","\\begin{align}\n","\\gamma_{sl} &= \\sqrt{2\\kappa}\\int_{\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1+\\Omega}}^{\\sqrt{\\frac{-\\alpha}{\\beta}}} \\sqrt{f(\\phi)+\\frac{\\alpha^2}{4\\beta}}\\,d\\phi - \\sqrt{\\frac{\\kappa\\alpha^2}{2\\beta}}\\Omega\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1+\\Omega}.\n","\\end{align}\n","Substituting $f(\\phi)=\\frac{\\alpha}{2}\\phi^2+\\frac{\\beta}{4}\\phi^4$, we can evaluate the integral:\n","\\begin{align}\n","\\gamma_{sl} &= \\sqrt{\\frac{-2\\kappa\\alpha^3}{9\\beta^2}}\\left[1-\\left(1-\\frac{\\Omega}{2}\\right)\\sqrt{1+\\Omega}\\right] -\n","\\sqrt{\\frac{-\\kappa\\alpha^3}{2\\beta^2}}\\Omega\\sqrt{1+\\Omega} \\\\\n","&= \\frac{\\gamma_{lg}}{2}\\left[1-\\left(1-\\frac{\\Omega}{2}\\right)\\sqrt{1+\\Omega}\\right] - \n","\\frac{3\\gamma_{lg}}{4}\\Omega\\sqrt{1+\\Omega} \\\\\n","&= \\frac{\\gamma_{lg}}{2} - \\frac{\\gamma_{lg}}{2}(1+\\Omega)^{3/2}.\n","\\end{align}\n","\n","Similarly, we can compute the solid-gas surface tension:\n","\\begin{align}\n","\\gamma_{sg} &= \\sqrt{2\\kappa}\\int_{-\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1-\\Omega}}^{-\\sqrt{\\frac{-\\alpha}{\\beta}}} \\sqrt{f(\\phi)+\\frac{\\alpha^2}{4\\beta}}\\,d\\phi + \\sqrt{\\frac{\\kappa\\alpha^2}{2\\beta}}\\Omega\\sqrt{\\frac{-\\alpha}{\\beta}}\\sqrt{1-\\Omega} \\\\\n","&= \\sqrt{\\frac{-2\\kappa\\alpha^3}{9\\beta^2}}\\left[1 - \\left(1+\\frac{\\Omega}{2}\\right)\\sqrt{1-\\Omega}\\right] +\n","\\sqrt{\\frac{-\\kappa\\alpha^3}{2\\beta^2}}\\Omega\\sqrt{1-\\Omega} \\\\\n","&= \\frac{\\gamma_{lg}}{2} - \\frac{\\gamma_{lg}}{2}(1-\\Omega)^{3/2}.\n","\\end{align}\n","\n","Finally, applying the Young's equation, we get:\n","\\begin{align}\n","\\cos\\theta = \\frac{\\gamma_{sg}-\\gamma_{sl}}{\\gamma_{lg}} = \n","\\frac{1}{2}\\left[ (1+\\Omega)^{3/2} - (1-\\Omega)^{3/2} \\right].\n","\\end{align}\n","The equation above can be inverted (??) to get $\\Omega$ in terms of $\\theta$:\n","\\begin{equation}\n","\\Omega = 2 \\,\\text{sign}\\left(\\frac{\\pi}{2}-\\theta\\right)\n","\\sqrt{ \\cos\\left(\\frac{\\alpha}{3}\\right) \\left[ 1 - \\cos\\left(\\frac{\\alpha}{3}\\right) \\right]},\n","\\quad\\text{where}\\quad\n","\\alpha = \\cos^{-1}\\left(\\sin^2\\theta\\right).\n","\\end{equation}\n","Thus for a given contact angle $\\theta$, we can then find the appropriate value of $h$:\n","\\begin{equation}\n","h = \\sqrt{\\frac{2\\kappa\\alpha^2}{\\beta}} \\,\\text{sign}\\left(\\frac{\\pi}{2}-\\theta\\right)\n","\\sqrt{ \\cos\\left(\\frac{\\cos^{-1}\\left(\\sin^2\\theta\\right)}{3}\\right) \\left[ 1 - \\cos\\left(\\frac{\\cos^{-1}\\left(\\sin^2\\theta\\right)}{3}\\right) \\right]}\n","\\end{equation}"]},{"cell_type":"markdown","metadata":{},"source":["### Computer simulations\n","\n","Now we will put everything we have learnt above into practice.\n","Let us simulate a liquid droplet sitting on a flat solid surface with a given contact angle $\\theta$.\n","Our dynamical variable is the density field $\\phi(\\mathbf{r},t)$.\n","In computer simulations, space is discretized into: $x\\rightarrow i\\Delta x$ and $x\\rightarrow j\\Delta y$,\n","where $i=0,1,2,\\dots,N_x-1$ and $j=0,1,2,\\dots,N_y-1$.\n","$\\Delta x$ and $\\Delta y$ are the lattice spacing in the $x$- and $y$-direction respectively.\n","Ideally we require $\\Delta x$ and $\\Delta y$ to be much smaller than $1$.\n","The system size is then $L_x=N_x\\Delta x$ and $L_y=N_y\\Delta y$.\n","Similarly, time is also discretized into $t\\rightarrow n\\Delta t$, where $n=0,1,2,\\dots,N_t-1$, where $\\Delta t$ is the time step.\n","The total time of the simulation is then $N_t\\Delta t$.\n","Thus the density field becomes $\\phi(\\mathbf{r},t)\\rightarrow\\phi^n_{ij}$, which is represented as an array in Python:\n","\\begin{align}\n","\\phi_{ij} &=\n","\\begin{pmatrix}\n","\\phi_{00} & \\phi_{01} & \\ldots & \\phi_{0,N_y-1} \\\\\n","\\phi_{10} & \\phi_{11} & & \\phi_{1,N_y-1} \\\\\n","\\vdots & & \\ddots & \\vdots \\\\\n","\\phi_{N_x-1,0} & \\phi_{N_x-1,1} & \\ldots & \\phi_{N_x-1,N_y-1} \\\\\n","\\end{pmatrix} \\downarrow i\\text{-direction} \\\\\n","&\\quad\\quad\\quad\\quad\\quad\\longrightarrow j\\text{-direction}\n","\\end{align}\n","Note that the $x$- and $y$-axis are transposed.\n","The first and second derivatives are computed numerically as follow:\n","\\begin{align}\n","\\frac{\\partial\\phi}{\\partial x} &= \\frac{\\phi_{i+1,j}-\\phi_{i,j}}{\\Delta x} + \\mathcal{O}(\\Delta x) \\\\\n","\\frac{\\partial^2\\phi}{\\partial x^2} &= \\frac{\\phi_{i+1,j}-2\\phi_{i,j}+\\phi_{i-1,j}}{\\Delta x^2} + \\mathcal{O}(\\Delta x)\n","\\end{align}\n","The array $\\phi_{i+1,j}$ is then equivalent to shifting every elements inside the array $\\phi_{ij}$ upwards.\n","This is represented by the `np.roll` function in Python:\n","\n","`phi_i_plus_1 = np.roll(phi, -1, axis=0)`\n"]},{"cell_type":"code","execution_count":77,"metadata":{},"outputs":[],"source":["import numpy as np\n","import matplotlib.pyplot as plt\n","\n","class Wetting():\n"," # initialization\n"," def __init__(self, theta):\n"," # lattice parameters\n"," self.dx, self.dy = 1.0, 1.0 \n"," self.Nx, self.Ny = 64, 32\n"," self.dt = 0.01 \n"," self.Nt = 10000000\n","\n"," # parameters of the free energy\n"," self.M, self.alpha, self.beta, self.kappa = 1.0, -1.0, 1.0, 1.0 \n","\n"," # contact angle in radian\n"," self.theta = theta \n"," a = np.arccos(np.sin(self.theta)**2)\n"," self.h = np.sqrt(2.0*self.kappa*a**2/self.beta) \\\n"," * np.sign(0.5*np.pi-self.theta) \\\n"," * np.sqrt(np.cos(a/3.0)*(1.0-np.cos(a/3.0)))\n","\n"," # global variables\n"," self.phi = np.zeros((self.Nx, self.Ny))\n"," self.mu = np.zeros((self.Nx, self.Ny))\n","\n"," # array of cartesian coordinates (needed for plotting)\n"," self.x = np.arange(0, self.Nx)*self.dx\n"," self.y = np.arange(0, self.Ny)*self.dx\n"," self.y, self.x = np.meshgrid(self.y, self.x) \n","\n"," # initialize phi to be a half-spherical droplet\n"," radius = self.Nx*self.dx/4.0\n"," for i in range(0, self.Nx, 1):\n"," for j in range(0, self.Ny, 1):\n"," if (i*self.dx-0.5*self.Nx*self.dx)**2 + (j*self.dx)**2 < radius**2:\n"," self.phi[i,j] = np.sqrt(-self.alpha/self.beta)\n"," else:\n"," self.phi[i,j] = -np.sqrt(-self.alpha/self.beta)\n","\n"," # function to calculate second derivative\n"," def derivative_x_x(self, field):\n"," field_plus = np.roll(field, -1, axis=0)\n"," field_minus = np.roll(field, +1, axis=0)\n"," return (field_plus - 2*field + field_minus)/(self.dx**2)\n","\n"," def derivative_y_y(self, field):\n"," field_plus = np.roll(field, -1, axis=1)\n"," field_minus = np.roll(field, +1, axis=1)\n","\n"," # wall boundary condition\n"," if np.array_equiv(field, self.phi):\n"," field_minus[:,0] = field[:,0] + self.dx*self.h/self.kappa\n"," field_plus[:,self.Ny-1] = field[:,self.Ny-1]\n"," else:\n"," field_minus[:,0] = field[:,0]\n"," field_plus[:,self.Ny-1] = field[:,self.Ny-1]\n","\n"," return (field_plus - 2*field + field_minus)/(self.dy**2)\n","\n"," def laplacian(self, field):\n"," return self.derivative_x_x(field) + self.derivative_y_y(field)\n","\n"," # function to update phi\n"," def update(self):\n"," self.mu = self.alpha*self.phi + self.beta*self.phi*self.phi*self.phi - self.kappa*self.laplacian(self.phi)\n"," self.phi = self.phi + self.dt*self.M*self.laplacian(self.mu)\n","\n"," # simulation run\n"," def run(self):\n"," for nt in range(0, self.Nt, 1):\n"," self.update()\n"," if nt % 1000000 == 0:\n"," phi0 = np.sum(self.phi)/(self.Nx*self.dx*self.Ny*self.dy)\n"," print(f't = {nt*self.dt}, phi0 = {phi0}')"]},{"cell_type":"code","execution_count":78,"metadata":{},"outputs":[{"name":"stdout","output_type":"stream","text":["t = 0.0, phi0 = -0.59765625\n","t = 10000.0, phi0 = -0.5976562499999795\n","t = 20000.0, phi0 = -0.5976562499999944\n","t = 30000.0, phi0 = -0.5976562499949978\n","t = 40000.0, phi0 = -0.5976562499932141\n","t = 50000.0, phi0 = -0.5976562499823828\n","t = 60000.0, phi0 = -0.5976562499550506\n","t = 70000.0, phi0 = -0.597656249932575\n","t = 80000.0, phi0 = -0.5976562499109468\n","t = 90000.0, phi0 = -0.5976562498893808\n"]}],"source":["# hydrophilic case theta = 45 degrees\n","hydrophilic = Wetting(np.pi/4.0)\n","hydrophilic.run()"]},{"cell_type":"code","execution_count":91,"metadata":{},"outputs":[{"name":"stdout","output_type":"stream","text":["t = 0.0, phi0 = -0.59765625\n","t = 10000.0, phi0 = -0.5976562499999762\n","t = 20000.0, phi0 = -0.5976562499984726\n","t = 30000.0, phi0 = -0.5976562499917414\n","t = 40000.0, phi0 = -0.597656249988029\n","t = 50000.0, phi0 = -0.597656249988029\n","t = 60000.0, phi0 = -0.597656249988029\n","t = 70000.0, phi0 = -0.597656249988029\n","t = 80000.0, phi0 = -0.597656249988029\n","t = 90000.0, phi0 = -0.597656249988029\n"]}],"source":["# hydrophobic case theta = 135 degrees\n","hydrophobic = Wetting(3.0*np.pi/4.0)\n","hydrophobic.run()"]},{"cell_type":"code","execution_count":109,"metadata":{},"outputs":[{"data":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAYMAAAHWCAYAAACVJ+VWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA22UlEQVR4nO3deZRdVZ33//e3blUlNVdlJCGBIhAM8xQjEVQMIMEJH1fTDt3+WL+FTa9+1NZWuwHt32PbTz8PoO2A3YoGRAMIyKREBAWDqEyBROYxgAwhIQkhUw2p4db398c9gSJ7F6lKVd1zz72f11q1bt1d95773Xeo793nu88+5u6IiEhlq0o7ABERSZ+SgYiIKBmIiIiSgYiIoGQgIiIoGYiICEoGIgCY2VFmdpeZdZnZfWa2zxhue66Z7TCzKwa13ZG0dSQ/Tw1x31PN7DYz+85YxSMSo2QgFc/MZgE3AxcAk4HngH8dw4f4PnB/pP2z7t6Y/LxtiPu+D/groGkM4xEJKBmIwLeAi919mbt3A1cDbx+LDZvZx4EtwPI93MQPgYuBP45FPCJDUTKQimZmzcBpwCWDmquAHbvc7iYz2zLEz01vse1/B740xMOfZ2avJrunTojdwN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9OhSoSZNQLXA19w9/g5KDPC3fPufiSFb9QLzOzQlEPaY2b2QWCDu69KO5Yxdpy7H01ht/FnzOzdaQc0CtXA0cBF7n4U0EmRd3FlLRkMa9mKjFpvZjMAkssNKcczImZWQyER/Mzdd56EINN9AnD3LcAdFGo8We3PccCHzex5CisCLzKzK8hufwBw97XJ5QbgFxRWP85qn9YAa5IRKMB1FJJD0fqTtWRQzstWLAPOSH4/g8J+90wwMwN+DDzh7t8e9KdM9snMpppZa/J7HXAS8CQZ7Y+7n+vus9y9ncJn5nZ3/1sy2h8AM2sws6advwPvo7BwZSb75O6vAC+Z2duSphOBxylmf9IunOxBoeX9wNPAs8BX045nD/twFbAO6KPwjeBMYDKFAt/q5HJS2nGOoD/HU9hd9zDwYPLz/qz2CTgceCDpz6PA/0raM9mfXfp2Am8UkDPbHwr72B9Kfh7b+b8g4306EliZvO9+CbQVsz86AllERDK3m0hERMaBkoGIiCgZiIiIkoGIiKBkICIiKBmIiAhKBiIigpKBiIigZCAyJszsdDPrMbN9B7VdaGbPmtn0NGMTGQ4dgSwyBpL1me4HHnD3vzOzL1NYMvo4d1+dbnQiu1eddgAi5cDd3cy+AvzazJ4FvkrhbGlKBJIJGhmIjCEzu5vCUsofcvdb0o5HZLhUMxAZI2a2iMK5aw1Yn3I4IiOikYHIGDCzI4A/AF8EPgA0uvsp6UYlMnxKBiKjlMwguhv4kbv/e3KKzIcp1AzuSDU4kWFSMhAZBTObBNwF/NHd/35Q+8+Bfdx9YWrBiYyAkoGIiKiALCIiSgYiIoKSgYiIoGQgIiIoGYiICEoGIiKCkoGIiKBkICIiKBmIiAjw/wPDAmsLHhTIjgAAAABJRU5ErkJggg==","text/plain":["
"]},"metadata":{"needs_background":"light"},"output_type":"display_data"}],"source":["# initialize figure and movie objects\n","fig, ax = plt.subplots(2, 1, figsize=(6,8)) \n","\n","for n in range(0, 2, 1):\n"," # set label\n"," ax[n].set_xlabel('$x$', fontsize=14)\n"," ax[n].set_ylabel('$y$', fontsize=14)\n","\n"," # set x range and y range\n"," ax[n].set_xlim(0, hydrophilic.Nx*hydrophilic.dx)\n"," ax[n].set_ylim(0, hydrophilic.Ny*hydrophilic.dy)\n","\n"," # set tick interval\n"," ax[n].tick_params(axis='both')\n"," ax[n].set_xticks(np.arange(0, hydrophilic.Nx, 10)*hydrophilic.dx)\n"," ax[n].set_yticks(np.arange(0, hydrophilic.Ny, 10)*hydrophilic.dy)\n","\n"," # set aspect ratio\n"," ax[n].set_aspect('equal')\n","\n","# create colormap of phi\n","ax[0].set_title('$\\\\theta=45^\\circ$')\n","colormap = ax[0].pcolormesh(hydrophilic.x, hydrophilic.y, hydrophilic.phi, shading='auto', vmin=-1.2, vmax=1.2)\n","ax[0].annotate('', xy=(5.5,0), xytext=(5.5+20,0+20), arrowprops=dict(edgecolor='red', arrowstyle='-', linestyle='--', linewidth=1))\n","ax[1].set_title('$\\\\theta=135^\\circ$')\n","colormap = ax[1].pcolormesh(hydrophilic.x, hydrophilic.y, hydrophobic.phi, shading='auto', vmin=-1.2, vmax=1.2)\n","ax[1].annotate('', xy=(24,0), xytext=(24-20,0+20), arrowprops=dict(edgecolor='red', arrowstyle='-', linestyle='--', linewidth=1))\n","\n","plt.show()"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["References:\n","1. L. D. Landau and E. M. Lifshitz, _Theory of Elasticity, 3rd Edition_ (Elsevier, 1986).\n","2. M. E. Cates and E. Tjhung, Theory of binary fluid mixtures: from phase-separation kinetics to active emulsions, _J. Fluid Mech._ (2017).\n","3. T. Kruger, H. Kusumaatmaja, A. Kuzmin, O. Shardt, G. Silva, and E. M. Viggen, _The Lattice Boltzmann Method_ (Springer, 2017)"]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.7"},"vscode":{"interpreter":{"hash":"cae271c71fdd3cc871ab10677ba94a2a4bc532d008bc675b95ab71698b6079a6"}}},"nbformat":4,"nbformat_minor":2}