.. _Chap:BrownianWalkerModel: Brownian walker *************** The Brownian walker model runs a single microscropic drift-diffusion using the :ref:`Chap:ItoSolver`, where the underlying transport kernel is .. math:: d\mathbf{X} = \mathbf{V}dt + \sqrt{2Ddt}\mathbf{W} where :math:`\mathbf{X}` is the spatial position of a particle :math:`\mathbf{V}` is the drift velocity and :math:`D` is the diffusion coefficient *in the continuum limit*. .. tip:: Source code is located in :file:`$DISCHARGE_HOME/Physics/BrownianWalker`. The model consists of the following implementation files: * :file:`CD_BrownianWalkerStepper.H/cpp` which implements :ref:`Chap:TimeStepper`. * :file:`CD_BrownianWalkerSpecies.H/cpp` which implements initial conditions through :ref:`Chap:ItoSpecies`. Initial data ------------ The initial data is randomly generated by sampling from an exponential distribution with specified radius and center. The user can specify the number of particles, and control this sampling through the respective input options, see :ref:`Chap:BrownianWalkerConfiguration`. Transport specification ----------------------- The default velocity field for this class is .. math:: v_x &= -r\omega\sin\theta, \\ v_y &= r\omega\cos\theta, \\ v_z &= 0, where :math:`r = \sqrt{x^2 + y^2}`, :math:`\tan\theta = \frac{x}{y}`. I.e. the flow field is a circulation around the Cartesian grid origin. The diffusion coefficient is simply set to a constant value. To adjust the velocity field or diffusion coefficients, adjust the configuration options given in :ref:`Chap:BrownianWalkerConfiguration`. Time stepping ------------- Time stepping in this module is performed using a simple Euler-Maruyama scheme, i.e., .. math:: \mathbf{X}^{k+1} = \mathbf{X}^{k} + \mathbf{V}\Delta t + \sqrt{2D\Delta t}\mathbf{W} It is possible to adjust the time step size by setting the appropriate option (``BrownianWalker.cfl``). The time step is then limited by a particle-like CFL time step condition on the advective part (i.e., on :math:`\mathbf{V}`). Superparticle handling ---------------------- Superparticle handling in this module occurs via :ref:`Chap:ItoSolver`, so the user needs to specify the superparticle algorithm through the :ref:`Chap:ItoSolver` configuration options. However, the *number* of superparticles is adjusted through ``BrownianWalkerStepper``, and is set through ``BrownianWalker.ppc``. Setting this value to anything less than 1 will turn off super-particle handling. .. _Chap:BrownianWalkerConfiguration: Solver configuration -------------------- The ``BrownianWalkerStepper`` class comes with user-configurable input options that can be adjusted at runtime. The configuration options for ``BrownianWalkerStepper`` are given below: .. literalinclude:: ../../../../Physics/BrownianWalker/CD_BrownianWalkerStepper.options :language: text Setting up a new problem ------------------------ To set up a new problem, using the Python setup tools in :file:`$DISCHARGE_HOME/Physics/BrownianWalker` is the simplest way. A full description is available in the ``README.md`` contained in the folder: .. literalinclude:: ../../../../Physics/BrownianWalker/README.md :language: markdown To see available setup options, use .. code-block:: bash python setup.py --help