Code repository for "Numerical Analysis of a Nonlinear Temperature Enhanced Diffusion Model for Drug Delivery"
This repository contais the code for "Numerical Analysis of a Nonlinear Temperature Enhanced Diffusion Model for Drug Delivery".
To run the code in this repository, first you should set up the prob1_env conda environment from environment.yml:
conda env create -f environment.yml
conda activate prob1_envCore source files are in src/. Convergence studies are in Jupyter Notebook files in the root directory.
Once the conda environment is set up, you can verify that all tests are passing by running:
pytest testsThen, running the notebooks for reproducing the convergence studies is the next step. To run a notebook, it should be in project's root folder. Simply open the notebook and run all cells. The first cell will add src/ to the Python's system path.
Here is a brief description of the purpose of the files in src/:
-
prob1base.py- Core logic, numerical method, discretization, etc. -
utils_for_testing.py- Utilities specifically for the test files intests/. -
cvg_studies_base.py- Contains helper functions for programming the convergence studies. Not notebook specific. Can be used for regular scripts whose purpose is to perform convergence studies as well. -
mms_trial_utils.py- Main utilities for running a simulation against a manufactured solution. -
prob1_mms_cases.py- A library of manufactured solutions for studies. -
notebook_studies_helpers.py- Similar tocvg_studies_base.py, however these target utilities specifically helpful to notebook studies.
The following list is a description of the notebook files, and the convergence studies they cover. Some remarks are in order: "MMS" refers to "Method of Manufactured Solutions", "reghcstriple" refers to "regularized Heaviside applied to
-
MMSCaseNonFullySmoothPol_cpcsH2_TclcdH2_reghcstriple_convergence_study- For this study, we'll use theMMSCaseNonFullySmoothPol_cpcsH2_TclcdH2MMS case: a solution which is just short regular enough on the$\mathbb P_1$ variables ($T, c_l, c_d$ ) for order 2 spatial convergence according to our results, while$\mathbb P_0$ variables ($c_p, c_s$ ) are just regular enough. More precisely, all$\mathbb P_0$ and$\mathbb P_1$ variables are in$H^2 \setminus H^3$ . See `src/prob1_mms_cases.py' for a precise definition. This study expects order 2 spatial convergence breakdown. -
MMSCaseNonFullySmoothPol_cpcsH1_TclcdH2_reghcstriple_convergence_study- For this study, we'll use theMMSCaseNonFullySmoothPol_cpcsH1_TclcdH2case: a solution which is just short of regular enough for order 2 spatial convergence. More precisely,$\mathbb P_0$ variables ($c_p, c_s$ ) are in$H^1 \setminus H^2$ , and$\mathbb P_1$ variables ($T, c_l, c_d$ ) are in$H^2 \setminus H^3$ . See `src/prob1_mms_cases.py' for a precise definition. This study expects order 2 spatial convergence breakdown. -
MMSCaseExpSin_reghcstriple_convergence_study- For this study, we'll use theMMSCaseExpSincase: smooth solution with sinusoidal behavior. See `src/prob1_mms_cases.py' for a precise definition. This study expects order 2 spatial and temporal convergence. -
MMSCaseNonFullySmoothPol_cpcsH2_TclcdH3_reghcstriple_convergence_study- For this study, we'll use theMMSCaseNonFullySmoothPol_cpcsH2_TclcdH3case. This provides a solution which is just regular enough for order 2 spatial convergence according to your results. More specifically,$\mathbb P_1$ variables ($T, c_l, c_d$ ) are in$H^3 \setminus H^4$ and$\mathbb P_0$ variables ($c_p, c_s$ ) are in$H^2 \setminus H^3$ . See `src/prob1_mms_cases.py' for a precise definition. This study expects order 2 spatial and temporal convergence. -
MMSCasePol_reghcstriple_convergence_study- For this study, we'll use theMMSCasePolcase: a smooth solution with a polynomial spacial profile. See `src/prob1_mms_cases.py' for a precise definition. This study expects order 2 spatial and temporal convergence. -
MMSCaseSlowlyChangingPeaks_Fast1e1_reghcstriple_convergence_study- For this study, we'll use theMMSCaseSlowlyChangingPeaks_Fast1e1case: a smooth solution designed to lead to larger errors. The objective is to better see the convergence happening. See `src/prob1_mms_cases.py' for a precise definition. This study expects order 2 spatial and temporal convergence.
This repository contains the code used to generate results for the associated scientific work and is provided as-is for reproducibility and research purposes.
The code is distributed under the MIT license. See LICENSE.