anisotropy/data/analyze.ipynb

378 lines
76 KiB
Plaintext
Raw Normal View History

2022-03-04 17:19:56 +05:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from anisotropy.database import Database, tables\n",
"import pathlib\n",
2022-03-05 01:08:18 +05:00
"import peewee as pw\n",
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt"
2022-03-04 17:19:56 +05:00
]
},
{
"cell_type": "code",
2022-03-05 01:08:18 +05:00
"execution_count": 2,
2022-03-04 17:19:56 +05:00
"metadata": {},
"outputs": [],
"source": [
"db = Database(pathlib.Path(\"anisotropy.db\").resolve())\n",
2022-03-05 01:08:18 +05:00
"savefig = False\n",
"execution = 5"
2022-03-04 17:19:56 +05:00
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
2022-03-05 01:08:18 +05:00
"def load_data(execution: int, field: str):\n",
" if not db.getExecution(execution):\n",
" print(\"Execution not found\")\n",
2022-03-04 17:19:56 +05:00
"\n",
2022-03-05 01:08:18 +05:00
" for model in db.tables:\n",
" try:\n",
" column = getattr(model, field)\n",
" \n",
" except AttributeError:\n",
" pass\n",
2022-03-04 17:19:56 +05:00
"\n",
2022-03-05 01:08:18 +05:00
" else:\n",
" break\n",
"\n",
" query = model.select(tables.Shape.alpha, column, tables.Shape.direction, tables.Shape.label)\n",
" idn = db.tables.index(model)\n",
"\n",
" for table in reversed(db.tables[ :idn]):\n",
" query = query.join(table, pw.JOIN.LEFT_OUTER)\n",
" \n",
" query = query.switch(tables.Shape)\n",
" query = query.where(\n",
" tables.Shape.exec_id == execution,\n",
" # tables.Shape.label == structure,\n",
" )\n",
" query = query.order_by(tables.Shape.label, tables.Shape.direction, tables.Shape.alpha)\n",
"\n",
" with db:\n",
" if query.exists():\n",
" table = []\n",
" for row in query.dicts():\n",
" for k in row.keys():\n",
" if type(row[k]) == list:\n",
" row[k] = str(row[k])\n",
"\n",
" table.append(row)\n",
" \n",
" else:\n",
" table = None\n",
"\n",
" if table is None:\n",
" print(\"Results not found\")\n",
2022-03-04 17:19:56 +05:00
"\n",
" else:\n",
2022-03-05 01:08:18 +05:00
" return pd.DataFrame(table)\n",
2022-03-04 17:19:56 +05:00
"\n",
"\n",
2022-03-05 01:08:18 +05:00
"def nanmean(arr):\n",
" temp = arr.copy()\n",
"\n",
" for n, item in enumerate(temp):\n",
" if np.all(np.isnan(item)):\n",
" \n",
" vals = temp[n - 1 : n + 2]\n",
"\n",
" if np.sum(~np.isnan(vals)) <= 1:\n",
" vals = temp[n - 2 : n + 3]\n",
"\n",
" temp[n] = vals[~np.isnan(vals)].mean()\n",
"\n",
" return temp\n",
"\n",
"def filter_group(arr, nan = True, qhigh = True):\n",
" temp = arr.copy()\n",
" check = True\n",
" quan = np.quantile(temp[~np.isnan(temp)], 0.97)\n",
" limit = 1000\n",
"\n",
" while check:\n",
" if nan and np.any(np.isnan(temp)):\n",
" temp = nanmean(temp)\n",
" check = True\n",
" \n",
" elif qhigh and np.any(quan < temp):\n",
" temp[quan < temp] = np.nan\n",
" check = True\n",
"\n",
" else:\n",
" check = False \n",
" \n",
" if limit <= 0:\n",
" break\n",
"\n",
" else:\n",
" limit -= 1\n",
"\n",
" return temp"
2022-03-04 17:19:56 +05:00
]
},
{
2022-03-05 01:08:18 +05:00
"cell_type": "markdown",
2022-03-04 17:19:56 +05:00
"metadata": {},
"source": [
2022-03-05 01:08:18 +05:00
"Porosity"
2022-03-04 17:19:56 +05:00
]
},
{
"cell_type": "code",
2022-03-05 01:08:18 +05:00
"execution_count": 4,
2022-03-04 17:19:56 +05:00
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
2022-03-05 01:08:18 +05:00
"/tmp/ipykernel_53258/3263217096.py:3: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
" simple = df[df.label == \"simple\"][df.direction == \"[0.0, 0.0, 1.0]\"][\"porosity\"].to_numpy()\n",
"/tmp/ipykernel_53258/3263217096.py:4: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
" bodyCentered = df[df.label == \"bodyCentered\"][df.direction == \"[0.0, 0.0, 1.0]\"][\"porosity\"].to_numpy()\n",
"/tmp/ipykernel_53258/3263217096.py:5: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n",
" faceCentered = df[df.label == \"faceCentered\"][df.direction == \"[0.0, 0.0, 1.0]\"][\"porosity\"].to_numpy()\n"
2022-03-04 17:19:56 +05:00
]
2022-03-05 01:08:18 +05:00
},
2022-03-04 17:19:56 +05:00
{
2022-03-05 01:08:18 +05:00
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA6iklEQVR4nO3dd3xUVfr48c8zk0kChIRQDEKAIAEUkGIQpAqKioUigm1FdEVsrO6i7urXFV3Lb21rW1nFtmBbBBWNCNhIUFQUEJQOoUhHCDVA+vP74w4xYIBAcnMnk+f9es2LW+c+h4F55txzzzmiqhhjjDGH83kdgDHGmNBkCcIYY0yJLEEYY4wpkSUIY4wxJbIEYYwxpkQRXgdQXurWratJSUlF6/v27aNGjRreBVRBqko5wcoajqpKOSF0yzpv3rztqlqvpH1hkyCSkpKYO3du0Xp6ejq9evXyLqAKUlXKCVbWcFRVygmhW1YR+eVI++wWkzHGmBJZgjDGGFMiSxDGGGNKFDZtEMYYc6Ly8vLYsGED2dnZrl0jLi6OpUuXuvb+xxIdHU1iYiKBQKDU57iaIESkL/Ac4AdeVdXHjnDcZcB7wJmqOje47V7gBqAAuF1VP3UzVmNM1bVhwwZq1qxJUlISIuLKNfbu3UvNmjVdee9jUVUyMzPZsGEDTZs2LfV5rt1iEhE/MAa4EGgFXCUirUo4riZwB/B9sW2tgCuB1kBf4D/B9zPGmH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ByQMYmDyQndk7GZU+6pBj/9v3v6W6bknzQXjJxmIKcyJC+0a
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-03-04 17:19:56 +05:00
}
],
"source": [
2022-03-05 01:08:18 +05:00
"df = load_data(execution, \"porosity\")\n",
"alpha = df[\"alpha\"].unique()\n",
"simple = df[df.label == \"simple\"][df.direction == \"[0.0, 0.0, 1.0]\"][\"porosity\"].to_numpy()\n",
"bodyCentered = df[df.label == \"bodyCentered\"][df.direction == \"[0.0, 0.0, 1.0]\"][\"porosity\"].to_numpy()\n",
"faceCentered = df[df.label == \"faceCentered\"][df.direction == \"[0.0, 0.0, 1.0]\"][\"porosity\"].to_numpy()\n",
"\n",
"fig, ax = plt.subplots(nrows = 1, ncols = 1)\n",
"ax.plot(alpha, np.pad(simple, (0, alpha.size - simple.size), 'constant', constant_values = np.nan), \":\", label = \"КП\")\n",
"ax.plot(alpha, np.pad(bodyCentered, (0, alpha.size - bodyCentered.size), 'constant', constant_values = np.nan), \"--\", label = \"КОП\")\n",
"ax.plot(alpha, np.pad(faceCentered, (0, alpha.size - faceCentered.size), 'constant', constant_values = np.nan), \"-.\", label = \"КГЦ\")\n",
"plt.legend()\n",
"plt.grid(True)\n",
"plt.xlabel(r\"$\\alpha$\")\n",
"plt.ylabel(r\"$m$\")\n",
"plt.show()\n",
2022-03-04 17:19:56 +05:00
"\n",
2022-03-05 01:08:18 +05:00
"if savefig:\n",
" fig.savefig(\"porosity-rounded.png\")"
2022-03-04 17:19:56 +05:00
]
},
{
2022-03-05 01:08:18 +05:00
"cell_type": "markdown",
2022-03-04 17:19:56 +05:00
"metadata": {},
"source": [
2022-03-05 01:08:18 +05:00
"Simple structure"
2022-03-04 17:19:56 +05:00
]
},
{
"cell_type": "code",
2022-03-05 01:08:18 +05:00
"execution_count": 5,
2022-03-04 17:19:56 +05:00
"metadata": {},
"outputs": [
{
"data": {
2022-03-05 01:08:18 +05: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77LADp512GgcddBArV67k+OOPZ5999mGXXfrnuEbjA333d9hhh7Fy5cohxWhmVk9pYwQR8QTwRHp/qaS5wBbA/TWbvR+4MCICuF3SRpI2T59birJG4M8444w196dMmcKUKVP4zne+ww033MCSJUuYP38+U6dOfcVzbrvtNr71rW/l2t8ee+zBiBEjWLx4MSeeeCJ33XUXX/va1/j85z9fSnnMrDqU1MElv4g0HrgJ2Ckinq9ZfjXw9Yi4JX18I3B8RNzR5/lHkbQYGDt27ITp06evWdfT08MWW2zBa1/72tLL0U6rVq2qO8W0nvnz57NkyZKSIypPT08Po0aNancYpatKOaE6Ze3kck6ePHl2REyst670WUOSRgGXA5+pTQJFRMS5wLkAEydOjNqLQ8+cOZORI0cOeK7+bpfnegS9Ro4c2dUHonXyBcCbqSrlhOqUtVvLWeqsIUkjSJLARRFxRZ1NHgO2qnm8ZbrMzMxapMxZQwJ+DMyNiDMzNrsK+Ld09tA7gCVljg+YmVl/ZXYNvQs4FLhX0t3pshOArQEiYhrwG2BfYD7wAnBEifGYmVkdZc4augVoeD6EdLZQ/wn2ZmbWMj6y2Mys4pwIzMwqzonAzKzinAjMzCrOiaCJfKlKM+tG1U0ESxfB+fvA0icH3janoVyq8h3veEfT9mdmVkR1E8Gs0+GR22HWaU3bZW/FvXz5cg4//HBOOOEEBjqX00CXquzd39SpU3Ptz8ysqGomgqWL4O6LIFYnf5vUKvClKs2sGw14QJmke4Han6EiORbszaVFVbZZpydJAJK/s06DKVlnwcin3qU
2022-03-04 17:19:56 +05:00
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
2022-03-05 01:08:18 +05:00
"df = load_data(execution, \"flowRate\")\n",
"simple = df[df.label == \"simple\"].groupby(df.direction)\n",
"alpha = simple.get_group(\"[0.0, 0.0, 1.0]\")[\"alpha\"].to_numpy()\n",
"\n",
"anisotropy_21 = 2 * simple.get_group('[0.0, 0.0, 1.0]')[\"flowRate\"].to_numpy() / simple.get_group('[1.0, 0.0, 0.0]')[\"flowRate\"].to_numpy()\n",
"anisotropy_31 = 2 * simple.get_group('[1.0, 1.0, 1.0]')[\"flowRate\"].to_numpy() / simple.get_group('[1.0, 0.0, 0.0]')[\"flowRate\"].to_numpy()\n",
"#poly = np.polynomial.Polynomial.fit(alpha, anisotropy_21, 1)\n",
"\n",
"anisotropy_21 = filter_group(anisotropy_21, qhigh = False)\n",
"anisotropy_31 = filter_group(anisotropy_31, qhigh = False)\n",
"\n",
2022-03-04 17:19:56 +05:00
"fig, ax = plt.subplots(nrows = 1, ncols = 1)\n",
2022-03-05 01:08:18 +05:00
"ax.plot(alpha, anisotropy_21, \"s\", label = \"$k_2$ / $k_1$\")\n",
"ax.plot(alpha, anisotropy_31, \"^\", label = \"$k_3$ / $k_1$\")\n",
"#ax.plot(alpha, poly(alpha), \"-\")\n",
2022-03-04 17:19:56 +05:00
"plt.legend()\n",
"plt.grid(True)\n",
2022-03-05 01:08:18 +05:00
"plt.xlabel(r\"$\\alpha$\")\n",
2022-03-04 17:19:56 +05:00
"plt.ylabel(\"Анизотропия проницаемости\")\n",
"plt.title(\"Простая кубическая\")\n",
"plt.show()\n",
"\n",
"if savefig:\n",
" fig.savefig(\"anisotropy-simple.png\")"
]
},
{
"cell_type": "code",
2022-03-05 01:08:18 +05:00
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Body-centered structure"
]
},
{
"cell_type": "code",
"execution_count": 6,
2022-03-04 17:19:56 +05:00
"metadata": {},
"outputs": [
{
"data": {
2022-03-05 01:08:18 +05:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEWCAYAAABrDZDcAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAvcElEQVR4nO3deZwU1b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J2ruqqhnj17Wp8+fdIOY62lS5ey6aabph1Gq7IeH2Q/xqzHBx5jOWQ9PuhYjFOnTl1gZlsWnGhmVfXq16+fZcnEiRPTDqFNWY/PLPsxZj0+M48x39NvP21Pv/10SfPU+jYEplgr+9WqOyNwzrlizn88uiWhcWhjuoFUCW8jcM65OueJwDnn6pwnAuecq3OJthHEt68vIXrQwyoz6583fQBRl8v/jEfdY2aXJBmTc865dVWisXigmS1oY/qTZjYoqZX3v/RRFjSvWG98z4YNmXLhYUmt1jnnqkbNXzVUKAm0Nt6ThnOuHiXaxYSkfxJ1m2tEj9q7IW/6AKLulOcSdVV7rpm9WmA5w4ge10evXr36jR3b2iN61zf04aWtThtzxLo3ZpRStkVzczMNDQ3B8VRa1uOD7MdY6fjOemIpiwscv3TbEK4+uDr/D6GyMZ794tkA/HaP3wbPU+vbcODAgVPzq+dbJH1GcJCZzZO0FfCopNfN7O8506cBnzOzZklHET2qcOf8hcQJ5AaA/v3724ABA8IjePiBViett5zAsuueOYiom/n1zxyycIbR2Ni4/ufMmKzHWOn4Frfyf7h4RYH/2VjWtyFUNsbN52wOtL69CqnnbZhoIrDoyVGY2YeS7gX
2022-03-04 17:19:56 +05:00
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
2022-03-05 01:08:18 +05:00
"df = load_data(execution, \"flowRate\")\n",
"bodyCentered = df[df.label == \"bodyCentered\"].groupby(df.direction)\n",
"alpha = bodyCentered.get_group(\"[0.0, 0.0, 1.0]\")[\"alpha\"].to_numpy()\n",
"\n",
"anisotropy_21 = 2 * bodyCentered.get_group('[0.0, 0.0, 1.0]')[\"flowRate\"].to_numpy() / bodyCentered.get_group('[1.0, 0.0, 0.0]')[\"flowRate\"].to_numpy()\n",
"anisotropy_31 = 2 * bodyCentered.get_group('[1.0, 1.0, 1.0]')[\"flowRate\"].to_numpy() / bodyCentered.get_group('[1.0, 0.0, 0.0]')[\"flowRate\"].to_numpy()\n",
"\n",
"anisotropy_21 = filter_group(anisotropy_21)\n",
"anisotropy_31 = filter_group(anisotropy_31)\n",
"#poly = np.polynomial.Polynomial.fit(alpha, anisotropy_21, 10)\n",
"\n",
2022-03-04 17:19:56 +05:00
"fig, ax = plt.subplots(nrows = 1, ncols = 1)\n",
2022-03-05 01:08:18 +05:00
"ax.plot(alpha, anisotropy_21, \"s\", label = r\"$k_2$ / $k_1$\")\n",
"ax.plot(alpha, anisotropy_31, \"^\", label = r\"$k_3$ / $k_1$\")\n",
"ax.axvline(0.134, linestyle = \"-.\", color = \"green\")\n",
"#ax.plot(alpha, poly(alpha), \"-\")\n",
2022-03-04 17:19:56 +05:00
"plt.legend()\n",
"plt.grid(True)\n",
2022-03-05 01:08:18 +05:00
"plt.xlabel(r\"$\\alpha$\")\n",
2022-03-04 17:19:56 +05:00
"plt.ylabel(\"Анизотропия проницаемости\")\n",
"plt.title(\"Кубическая объемноцентрированная\")\n",
"\n",
"if savefig:\n",
" fig.savefig(\"anisotropy-bodycentered.png\")"
]
},
2022-03-05 01:08:18 +05:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Face-centered structure"
]
},
2022-03-04 17:19:56 +05:00
{
"cell_type": "code",
2022-03-05 01:08:18 +05:00
"execution_count": 7,
2022-03-04 17:19:56 +05:00
"metadata": {},
"outputs": [
{
"data": {
2022-03-05 01:08:18 +05:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEWCAYAAABrDZDcAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAApYklEQVR4nO3de5gcZZn+8e9NSIyQBDCRCARMUFCRVYFwEncNiBAUwdWICQsryMGssuhPQUQREBGEBRVWJIJyENGAUdi4gJHTRAU5JRCUhLgxIISDQIAwEyTH5/dH1YSiM4fqnq7q6Z77c119Tdf5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B4zKwktRwsyz7A1rq9ss/sRw0b0m2c9VJkItgKeDwzvATYvWKeecDHgAuAfwWGSxqZeS4qAJKOBY4FGD16NG1tbUXFXFcdHR2Fx3r8bct5qYvv34ghcOE+xd2FsYyyNVIrl6+astX6/erpYNndtmtZpssY0+6VRcTYmyKWO+99g4HBQPLZDRs2rM/bq9Toi8UnAN9Pn4/6O5KHTq+pnCkiLgEuARg/fnw0y90Fq7lTYK1nJy+lX/r1xq+k223X48zLd3lsLq/9zAUsB4r5fgHrDsZd6Xa5Wpah5BgbsVxGUd/LIhPBE8DWmeEx6bh1IuJJkhoBkoYBH4+IFwuMqXC1/vijzOpmrdsq44ctVoz+fKFyoCijiadWRSaCe4HtJI0jSQCTgUOzM0gaBTwfEWuBk4HLCoynFK38D1d22VrxolxfeZ80r/78+RSWCCJitaTjgFnAIOCyiHhI0hnAfRExE5gAnC0pSJqGPldUPNZ86lZzSfV2sGyGGk8rn2g0i/58Zl+rQq8RRMS
2022-03-04 17:19:56 +05:00
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
2022-03-05 01:08:18 +05:00
"df = load_data(execution, \"flowRate\")\n",
"faceCentered = df[df.label == \"faceCentered\"].groupby(df.direction)\n",
"alpha = faceCentered.get_group(\"[0.0, 0.0, 1.0]\")[\"alpha\"].to_numpy()\n",
"\n",
"anisotropy_21 = 2 * faceCentered.get_group('[0.0, 0.0, 1.0]')[\"flowRate\"].to_numpy() / faceCentered.get_group('[1.0, 0.0, 0.0]')[\"flowRate\"].to_numpy()\n",
"anisotropy_31 = 2 * faceCentered.get_group('[1.0, 1.0, 1.0]')[\"flowRate\"].to_numpy() / faceCentered.get_group('[1.0, 0.0, 0.0]')[\"flowRate\"].to_numpy()\n",
"\n",
"anisotropy_21 = filter_group(anisotropy_21)\n",
"anisotropy_31 = filter_group(anisotropy_31)\n",
"#poly = np.polynomial.Polynomial.fit(alpha, anisotropy_21, 10)\n",
"\n",
2022-03-04 17:19:56 +05:00
"fig, ax = plt.subplots(nrows = 1, ncols = 1)\n",
2022-03-05 01:08:18 +05:00
"ax.plot(alpha, anisotropy_21, \"s\", label = r\"$k_2$ / $k_1$\")\n",
"ax.plot(alpha, anisotropy_31, \"^\", label = r\"$k_3$ / $k_1$\")\n",
"#ax.plot(alpha, poly(alpha), \"-\")\n",
2022-03-04 17:19:56 +05:00
"plt.legend()\n",
"plt.grid(True)\n",
2022-03-05 01:08:18 +05:00
"plt.xlabel(r\"$\\alpha$\")\n",
2022-03-04 17:19:56 +05:00
"plt.ylabel(\"Анизотропия проницаемости\")\n",
"plt.title(\"Кубическая гранецентрированная\")\n",
2022-03-05 01:08:18 +05:00
"plt.show()\n",
2022-03-04 17:19:56 +05:00
"\n",
"if savefig:\n",
" fig.savefig(\"anisotropy-facecentered.png\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"interpreter": {
"hash": "19649669bd52b0be75e091dcf60d2128e4a347083ff474cfec5ff9275df3ceed"
},
"kernelspec": {
"display_name": "Python 3.9.9 64-bit ('anisotropy': conda)",
"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.10"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}