Evolving convection of a Darcy fluid in an isotropic porous rectangle

Evolving convection of a Darcy fluid in an isotropic porous rectangle#

\[\begin{split} \mathbb{S} \begin{cases} \Omega = [0, \mathcal{A}X] \times [0, X] & \text{aspect ratio }\mathcal{A}=\mathcal{O}(1)\\ \textbf{e}_g=-\textbf{e}_y & \text{vertically downward gravity}\\ \phi = 1 & \text{constant porosity} \\ \mathsf{D} = \mathsf{I} & \text{constant isotropic dispersion}\\ \mathsf{K} = \mathsf{I} & \text{constant isotropic permeability}\\ \mu = 1 & \text{constant viscosity} \\ \rho(c) = c & \text{linear density}\\ c_0(x,y)=\lim_{\epsilon\to0}\left(1+\text{erf}\left(\frac{y-X}{\epsilon X}\right)\right)+\mathcal{N}(x,y) & \text{perturbed diffusive base state} \\ c_{\text{D}}(x,y=X)=1 & \text{`solute-rich' upper boundary} \\ c_{\text{N}}(x,y=0)=0 & \text{no-flux on lower boundary}\\ c_{\text{N}}(x=0,y)=0 & \text{no-flux on left boundary}\\ c_{\text{N}}(x=\mathcal{A}X,y)=0 &\text{no-flux on right boundary}\\ \psi_{\text{D}}\vert_{\partial\Omega}=0 & \text{no-penetration on entire boundary} \end{cases} \end{split}\]
from lucifex.fdm import AB2, CN
from lucifex.sim import run
from lucifex.utils import as_indices
from lucifex.viz import plot_colormap, plot_line, save_figure, create_animation, display_animation
from py.C01_darcy_evolving import darcy_convection_evolving_rectangle

simulation = darcy_convection_evolving_rectangle(
    aspect=2.0,
    Nx=64,
    Ny=64,
    cell='quadrilateral', 
    scaling='advective',
    Ra=500.0, 
    c_ampl=1e-4, 
    c_freq=(14, 14), 
    c_seed=(456, 987), 
    D_adv=AB2,
    D_diff=CN,
    diagnostic=True,
)

n_stop = 200
dt_init = 1e-6
n_init = 5
run(simulation, n_stop=n_stop, dt_init=dt_init, n_init=n_init)

c = simulation['c']
time_slice = slice(0, None, 2)
titles = [f'${c.name}(t={t:.3f})$' for t in c.time_series[time_slice]]

anim = create_animation(
    plot_colormap,
    colorbar=False,
)(c.series[time_slice], title=titles)
anim_path = save_figure(f'{c.name}(x,y,t)', get_path=True)(anim)

display_animation(anim_path)
time_indices = as_indices(c.time_series, (0, 0.25, 0.5, -1), fraction=True)
for i in time_indices:
    fig, ax = plot_colormap(c.series[i], title=f'${c.name}(t={c.time_series[i]:.2f})$')
    save_figure(f'{c.name}(x,y,t={c.time_series[i]:.2f})', thumbnail=(i == -1))(fig)
../../_images/447b27e3a833fdcb8f1ddf6963cd1c6f2f1bf59014911711607c4ccbf525a02f.png ../../_images/ba320c58ab9ee44ecdb4ef7edf0f825c440a37357d79ca2fe3153a7741b483a6.png ../../_images/c175f9908169904efb6e7d0139a6870c1e30fd5e90a89b239e471265ad9ca207.png ../../_images/addf0bd5bfa82a001808b964a537e44616d53c52f0c257bd571326fa2edf4a19.png
uRMS, uMinMax = simulation['uRMS', 'uMinMax']
uMax = uMinMax.sub(1)

fig, ax = plot_line(
    (uRMS.time_series, uRMS.value_series),
    x_label='$t$',
    y_label='$\mathrm{rms}(\mathbf{u})$',
)
save_figure('uRMS(t)')(fig)

fig, ax = plot_line(
    (uMax.time_series, uMax.value_series),
    x_label='$t$',
    y_label='$\max_{\mathbf{x}}|\mathbf{u}|$',
)
save_figure('uMax(t)')(fig)
../../_images/6cd09e1ca99a9fef190ecfa9895a195f90ae45dad15207cc364db315d6319c2a.png ../../_images/ad770a1e2ba664d11cc12f653c13cf77ec56b977dfb8b06fce9d8eb96b62d4d9.png
The Kernel crashed while executing code in the current cell or a previous cell. 

Please review the code in the cell(s) to identify a possible cause of the failure. 

Click <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. 

View Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details.