Skip to content

Commit

Permalink
final mecc code
Browse files Browse the repository at this point in the history
  • Loading branch information
viviantran27 committed Jul 27, 2023
1 parent ef04a17 commit 5909a27
Show file tree
Hide file tree
Showing 32 changed files with 29,021 additions and 32,011 deletions.
11 changes: 10 additions & 1 deletion examples/notebooks/models/SPMe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
"\n",
"\n",
"#### Particles: \n",
"$$\n",
"\\begin{align}\n",
"\\mathcal{C}_{\\text{k}} \\frac{\\partial c_{\\text{s,k}}}{\\partial t} &= -\\frac{1}{r_{\\text{k}}^2} \\frac{\\partial}{\\partial r_{\\text{k}}} \\left(r_{\\text{k}}^2 N_{\\text{s,k}}\\right), \\\\\n",
"N_{\\text{s,k}} &= -D_{\\text{s,k}}(c_{\\text{s,k}}) \\frac{\\partial c_{\\text{s,k}}}{\\partial r_{\\text{k}}}, \\quad \\text{k} \\in \\text{n, p}, \\end{align}\n",
"$$\n",
"\n",
"$$\n",
"N_{\\text{s,k}}\\big|_{r_{\\text{k}}=0} = 0, \\quad \\text{k} \\in \\text{n, p}, \\quad \\ \\ - \\frac{a_{R, \\text{k}}\\gamma_{\\text{k}}}{\\mathcal{C}_{\\text{k}}} N_{\\text{s,k}}\\big|_{r_{\\text{k}}=1} = \n",
"\\begin{cases}\n",
"\t\t \\frac{I}{L_{\\text{n}}}, \\quad &\\text{k}=\\text{n}, \\\\ \n",
Expand All @@ -43,6 +46,7 @@
"\n",
"\n",
"#### Electrolyte: \n",
"$$\n",
"\\begin{align}\n",
"\\mathcal{C}_{\\text{e}} \\epsilon_{\\text{k}} \\gamma_{\\text{e}} \\frac{\\partial c_{\\text{e,k}}}{\\partial t} &= -\\gamma_{\\text{e}} \\frac{\\partial N_{\\text{e,k}}}{\\partial x} + \n",
"\\begin{cases} \n",
Expand All @@ -58,6 +62,7 @@
"\\end{cases}\n",
"\\end{align}\n",
"$$\n",
"$$\n",
"N_{\\text{e,n}}\\big|_{x=0} = 0, \\quad N_{\\text{e,p}}\\big|_{x=1}=0, \\\\\n",
"c_{\\text{e,k}}(x,0) = 0, \\quad \\text{k} \\in \\text{n, s, p},$$\n",
"where $D_{\\text{e}}$ is the diffusion coefficient in the solid, $N_{\\text{e,k}}$ denotes the flux of lithium ions in the electrolyte within the region $\\text{k}$, and $x\\in[0,1]$ is the macroscopic through-cell distance. This equation is also solved subject to continuity of concentration and flux at the electrode/separator interfaces.\n",
Expand All @@ -68,6 +73,8 @@
"V = U_{\\text{eq}} + \\eta_r + \\eta_c + \\Delta\\Phi_{\\text{Elec}} + \\Delta\\Phi_{\\text{Solid}}\n",
"$$ \n",
"where \n",
"\n",
"$$\n",
"\\begin{align}\n",
"U_{\\text{eq}} &= U_{\\text{p}}(c_{\\text{p}})\\big|_{r_{\\text{p}}=1} - U_{\\text{n}}(c_{\\text{n}})\\big|_{r_{\\text{n}}=1}, \\\\ \n",
"\\eta_{r} &= -2\\sinh^{-1}\\left(\\frac{I}{\\bar{j}_{\\text{0,p}} L_{\\text{p}}}\\right) - 2\\sinh^{-1}\\left(\\frac{I}{\\bar{j}_{\\text{0,n}} L_{\\text{n}}}\\right), \\\\\n",
Expand All @@ -77,12 +84,14 @@
"\\Delta \\Phi_{\\text{Elec}} &= -\\frac{\\mathcal{C}_{\\text{e}}I}{\\gamma_{\\text{e}} \\kappa_{\\text{e}}(1)} \\left(\\frac{L_{\\text{n}}}{3\\epsilon_{\\text{n}}^{\\text{b}}} + \\frac{L_{\\text{s}}}{\\epsilon_{\\text{s}}^{\\text{b}}} + \\frac{L_{\\text{p}}}{3\\epsilon_{\\text{p}}^{\\text{b}}} \\right), \\\\\n",
"\\Delta \\Phi_{\\text{Solid}} &= -\\frac{I}{3}\\left(\\frac{L_{\\text{p}}}{\\sigma_{\\text{p}}} + \\frac{L_{\\text{n}}}{\\sigma_{\\text{n}}} \\right), \n",
"\\end{align} \n",
"$$\n",
"where\n",
"$$\n",
"\\begin{equation} \n",
" \\bar{c}_{\\text{e,n}} = \\frac{1}{L_{\\text{n}}}\\int_0^{L_{\\text{n}}} c_{\\text{e,n}} \\, \\text{d}x, \\quad\n",
" \\bar{c}_{\\text{e,p}} = \\frac{1}{L_{\\text{p}}}\\int_{1-L_{\\text{p}}}^{1} c_{\\text{e,p}} \\, \\text{d}x.\n",
"\\end{equation} \n",
"\n",
"$$\n",
"More details can be found in [[3]](#References)."
]
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"c:\\Users\\Vivian\\Dropbox (University of Michigan)\\from_box\\Research\\PyBaMM\\PyBaMM\\pybamm\n"
"c:\\Users\\Vivian\\Dropbox (University of Michigan)\\from_box\\Research\\PyBaMM\\PyBaMM\\venv\\lib\\site-packages\\pybamm\n"
]
}
],
Expand Down Expand Up @@ -213,21 +213,6 @@
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"tol = pybamm.settings.tolerances[\"j0__c_e\"]\n",
"c_e = pybamm.maximum(c_e, tol)\n",
"tol = pybamm.settings.tolerances[\"j0__c_s\"]\n",
"c_s_surf = pybamm.maximum(pybamm.minimum(c_s_surf, 1 - tol), tol)\n",
"c_s_max = \n",
"T = \n",
"modified_graphite_electrolyte_exchange_current_density_PeymanMPM()"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5909a27

Please sign in to comment.