Classical Hydrodynamics#
This notebook describes the feature of the code to solve simple classical hydrodynamics problems. We use these to match to coarse-grained superfluid hydrodynamics simulations, for example, to extract the effective viscosity.
Example#
As a sample problem, we consider here a harmonically trapped gas oscillating back and forth in a harmonic trap with a small barrier potential inserted. The idea is that the barrier will produce some drag, slowing the oscillations as energy is dissipated. For comparison, a superfluid will not lose energy, but will generate phonons (wave turbulence) resulting in a slow decay of the center of mass oscillations.
from gpe.Examples.hydro_1d import Experiment, u
expt = Experiment()
state = expt.get_state()
state.plot()
state.evolve(steps=200, t__final=10*u.ms);
[I 03:37:43 numexpr.utils] NumExpr defaulting to 2 threads.
[I 03:37:44 root] Patching zope.interface.document.asReStructuredText to format code
/home/docs/checkouts/readthedocs.org/user_builds/gpe/checkouts/latest/src/gpe/hydro_1d.py:122: UserWarning: Coupling constant g should have the correct dimensions.
warnings.warn("Coupling constant g should have the correct dimensions.")
Linearization of Equation#
Linearization of the above equation is little difficult in the current form. So let’s do some redefinitions: $\( h=-\frac{V}{g} \qquad \eta = n-h \qquad g' = \frac{g}{m} \)\( Then the shallow water equation in 1D takes the form \)\( \dot{\eta} = -\frac{\partial (\eta+h)u}{\partial x} \\ \dot{u} = -\frac{\partial (\frac{u^2}{2}+g'\eta)}{\partial x} + \nu \frac{\partial^2 u}{\partial x^2} \)$
The jacobian matrix for transforming fluxes for \(X = (n, nu)\)is given by:
The eigenvalues are \(u \pm \sqrt{g'h}\)
Now, we can linearize this equation to get $\( \dot{\eta} = -\frac{\partial hu}{\partial x} \\ \dot{u} = -\frac{\partial (g\eta)}{\partial x} + \nu \frac{\partial^2 u}{\partial x^2} \)\( I am little unclear on whether to include the double derivative in linear version. For simpler version of stability analysis, we drop the double derivative \)\( \dot{\eta} = -\frac{\partial hu}{\partial x} \\ \dot{u} = -\frac{\partial (g\eta)}{\partial x} \)\( i.e. \)\( \dot{Y} = -\mathbf{C} \frac{\partial Y}{\partial x} \)$ where
Von-Neumann Stability Analysis: Convection Equation#
Consider the Finite Difference discretization $\( \frac{Y_{i}^{r+1} - Y_{i}^{r}}{\delta t} = - C \frac{Y_{i+1}^{r} - Y_{i}^{r}}{\delta x} \)\( Putting, \)Y_{i}^{r} = A^r (1, 1) e^{ikx}\( \)\( \frac{A-1}{\delta t} = -C \frac{e^{ik\delta x} - 1}{\delta x} \\ A = 1 - \frac{\delta t}{\delta x}C\left(e^{ik\delta x} - 1\right) \)\( \)\( |A|^2 = (1-\frac{\delta t}{\delta x}C (\cos(k \delta x)-1))^2 + (\frac{\delta t}{\delta x}C \sin(k \delta x))^2 \)$
Now, \(|A|^2 \leq 1\), for stability $\( (1+\frac{\delta t}{\delta x}|C|)(1-\cos(k \delta x)) \leq 0 \)$ Hence it is unconditionally unstable
The Formulation (Finite Volume Method):#