Last active
December 15, 2020 22:35
-
-
Save julesghub/6127b0da6c62d86c9e1068a7275ab671 to your computer and use it in GitHub Desktop.
3D Stokes sinker for UWGeo - 2.10.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Stokes Sinker\n", | |
"\n", | |
"Demonstration example for setting up particle swarms with different material properties. This system consists of a dense, high viscosity sphere falling through a background lower density and viscosity fluid.\n", | |
"\n", | |
"![Stokes 2D](./images/Stokes2D.gif)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"loaded rc file /opt/venv/lib/python3.7/site-packages/UWGeodynamics/uwgeo-data/uwgeodynamicsrc\n" | |
] | |
} | |
], | |
"source": [ | |
"import UWGeodynamics as GEO\n", | |
"from UWGeodynamics import visualisation as vis" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"u = GEO.UnitRegistry" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"velocity = 1.0 * u.centimeter / u.hour\n", | |
"model_length = 2. * u.meter\n", | |
"model_height = 1. * u.meter\n", | |
"refViscosity = 1e6 * u.pascal * u.second\n", | |
"bodyforce = 200 * u.kilogram / u.metre**3 * 9.81 * u.meter / u.second**2\n", | |
"\n", | |
"KL = model_height\n", | |
"Kt = KL / velocity\n", | |
"KM = bodyforce * KL**2 * Kt**2\n", | |
"\n", | |
"GEO.scaling_coefficients[\"[length]\"] = KL\n", | |
"GEO.scaling_coefficients[\"[time]\"] = Kt\n", | |
"GEO.scaling_coefficients[\"[mass]\"]= KM" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Initialise the Model\n", | |
"\n", | |
"This will set up a 2 meters x 1 meter box, the resolution is 64 x 64." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"Model = GEO.Model(elementRes=(16, 16, 16), \n", | |
" minCoord=(-1. * u.meter, -50. * u.centimeter, -1. * u.meter), \n", | |
" maxCoord=(1. * u.meter, 50. * u.centimeter, 1. * u.meter),\n", | |
" gravity = (0.0, -9.8 * u.meter / u.second**2, 0.))\n", | |
"\n", | |
"Model.outputDir= \"3DStokesSinker\"" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Define the Materials\n", | |
"\n", | |
"We define a `heavyMaterial` which will represent the background medium in which the ball will fall.\n", | |
"The Ball itself is defined using a `lightMaterial` with an initial disk shape." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"lightMaterial = Model.add_material(name=\"Light\", shape=GEO.shapes.Layer3D(top=Model.top, bottom=Model.bottom))\n", | |
"heavyMaterial = Model.add_material(name=\"Heavy\", shape=GEO.shapes.Sphere(center=(0.,30.*u.centimetre,0.), radius=10. * u.centimetre))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Material properties\n", | |
"\n", | |
"The materials have the same viscosity but their density differs, the `heavyMaterial` is 50 times heavier than the\n", | |
"surrounding materials." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"lightMaterial.density = 10 * u.kilogram / u.metre**3\n", | |
"heavyMaterial.density = 500 * u.kilogram / u.metre**3\n", | |
"\n", | |
"lightMaterial.viscosity = 1e6 * u.pascal * u.second\n", | |
"heavyMaterial.viscosity = 1e6 * u.pascal * u.second" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Define Boundary Conditions\n", | |
"\n", | |
"The boundary conditions are freeslip everywhere (zero shear stress)." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<underworld.conditions._conditions.DirichletCondition at 0x7f6f5eda69e8>" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"Model.set_velocityBCs(left=[0,None,0], right=[0,None,0], \n", | |
" top=[None,0,0], bottom=[None,0,0],\n", | |
" front=[0,0,None], back=[0,0,None])" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Visualise Initial Set up" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Analysis tools\n", | |
"-----\n", | |
"\n", | |
"We define a set of metrics to monitor the evolution of the model through time." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import underworld as uw\n", | |
"import underworld.function as fn\n", | |
"import math" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"**RMS velocity**\n", | |
"\n", | |
"The root mean squared velocity is defined by intergrating over the entire simulation domain via\n", | |
"\n", | |
"\\\\[\n", | |
"\\begin{aligned}\n", | |
"v_{rms} = \\sqrt{ \\frac{ \\int_V (\\mathbf{v}.\\mathbf{v}) dV } {\\int_V dV} }\n", | |
"\\end{aligned}\n", | |
"\\\\]\n", | |
"\n", | |
"where $V$ denotes the volume of the box." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"vdotv = fn.math.dot(Model.velocityField, Model.velocityField)\n", | |
"v2sum_integral = uw.utils.Integral(mesh=Model.mesh, fn=vdotv )\n", | |
"volume_integral = uw.utils.Integral(mesh=Model.mesh, fn=1. )\n", | |
"vrms = math.sqrt(v2sum_integral.evaluate()[0] / volume_integral.evaluate()[0])" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"**Position of the bottom of the Ball**\n", | |
"\n", | |
"We will use a passive tracers, initially located at the bottom of the disk.\n", | |
"Note that because the ball is going to deform, the position of the passive tracers may change lateraly.\n", | |
"In practice this is very minimal." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import numpy as np\n", | |
"coords = np.ndarray((1, 3))\n", | |
"coords[...] = 0.\n", | |
"coords[:, 1] = GEO.nd(20. * u.centimetre)\n", | |
"\n", | |
"pt = Model.add_passive_tracers(name=\"tip\", vertices=coords)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Once the tools have been defined, we need a way to get them to execute after each time step.\n", | |
"This can be done using the `Model.postSolveHook` entry point. \n", | |
"\n", | |
"We need to define a python function that will process the output of Model and extract information: In the following we define 2 containers in the form of python list objects. The position of the passive tracers and the vrms will be appended to their respective list after each timestep using the `post_solve_hook` python function. Note that the lists must be defined as global inside the python function so that we can retrieve them." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# parallel safe way of finding the particles vertical coordinate.\n", | |
"fn_y = fn.coord()[1]\n", | |
"fn_y_minmax = fn.view.min_max(fn_y)\n", | |
"\n", | |
"tSinker = [0.]\n", | |
"fn_y_minmax.reset()\n", | |
"fn_y_minmax.evaluate(pt)\n", | |
"ypos = fn_y_minmax.max_global()\n", | |
"\n", | |
"ypos = GEO.dimensionalise(ypos, u.centimetre)\n", | |
"ypos = ypos.magnitude\n", | |
"ySinker = [ypos]\n", | |
"vrms = [math.sqrt(v2sum_integral.evaluate()[0] / volume_integral.evaluate()[0])]\n", | |
"\n", | |
"def post_solve_hook():\n", | |
" global tSinker\n", | |
" global ySinker\n", | |
" global vrms\n", | |
" \n", | |
" time = Model.time.to(u.hour).magnitude\n", | |
" fn_y_minmax.reset()\n", | |
" fn_y_minmax.evaluate(pt)\n", | |
" ypos = fn_y_minmax.max_global()\n", | |
" \n", | |
" ypos = GEO.dimensionalise(ypos, u.centimetre)\n", | |
" ypos = ypos.magnitude\n", | |
" \n", | |
" tSinker.append(time)\n", | |
" ySinker.append(ypos)\n", | |
" vrms.append(math.sqrt(v2sum_integral.evaluate()[0] / volume_integral.evaluate()[0]))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The `post_solve_hook` function is \"attached\" to `Model.postSolveHook`" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"Model.post_solve_functions[\"Measurements\"] = post_solve_hook" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"Model.init_model()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Running with UWGeodynamics version 2.10.2\n", | |
"Options: -Q22_pc_type uw -ksp_type bsscr -pc_type none -ksp_k2_type NULL -rescale_equations False -remove_constant_pressure_null_space False -change_backsolve False -change_A11rhspresolve False -restore_K False -A11_ksp_type fgmres -A11_ksp_rtol 1e-06 -scr_ksp_type fgmres -scr_ksp_rtol 1e-05\n", | |
"Step: 1 Model Time: 37.1 minute dt: 37.1 minute (2020-12-15 22:13:13)\n", | |
"Step: 2 Model Time: 1.2 hour dt: 36.1 minute (2020-12-15 22:13:24)\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"1" | |
] | |
}, | |
"execution_count": 14, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"Model.run_for(nstep=2, checkpoint_interval=1)#, restartStep=2)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Visualisation of the results\n", | |
"\n", | |
"**Material Field**" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Quick Analysis\n", | |
"\n", | |
"The position of the Sinker through time can be plotted using the `tSinker` and `ySinker` lists.\n", | |
"\n", | |
"Here we use Matplotlib to make the plot. Matplotlib is not parallel safe and will return message errors when attempting to run\n", | |
"this Model on multiple processors. To avoid this, the user will need to run the Matplotlib function on one CPUs.\n", | |
"This can be achieved using a condition on the processor `rank`:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3dfZyNdf7H8ddnhhEiZPKLtDZbWt1RQyKJLLqjkFXRnchN97tabW27bVtbqW1rQwnRbomNUBGKUnLTKIWSVCpUVMTWlJv5/P64LrvTdGbmGOec68zM+/l4nMecc53rOud9ZfTxvb7X9/s1d0dERKSwjKgDiIhIelKBEBGRmFQgREQkJhUIERGJSQVCRERiqhR1gESqW7euN2rUKOoYIiJlxrJly7509+xY75WrAtGoUSNyc3OjjiEiUmaY2cdFvadLTCIiEpMKhIiIxKQCISIiMalAiIhITCoQIiISU9IKhJk1NLP5Zvauma0ys2vC7XXMbK6ZvR/+rF3E8ReH+7xvZhcnK+e0NzfQ5s55/HzYc7S5cx7T3tyQrK8SESlTktmC2AX8xt1/CbQChphZU2AY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7p6XymAiJdElJpHozQGu3PPCzJpFmEXkv1QgRKJ3NZATLkD/DsGsnSKR022uIiISk1oQIiISkwqEiIjEpAIhIiIxqUCIiEhMKhAiIhKTCoSIiMSkAiEiIjH9P41SxPIt8kmxAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"if(GEO.rank==0):\n", | |
" import matplotlib.pyplot as plt\n", | |
" plt.plot(tSinker, ySinker, \"o\") \n", | |
" plt.plot(tSinker, ySinker) \n", | |
" plt.xlabel('Time')\n", | |
" plt.ylabel('Sinker position')\n", | |
" plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"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.7.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment