|
| 1 | +2D Burgers (Dirichlet BCs) |
| 2 | +========================== |
| 3 | + |
| 4 | +This problem solves the 2D nonlinear viscous Burgers equations |
| 5 | + |
| 6 | +.. math:: |
| 7 | +
|
| 8 | + \frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} + v \frac{\partial u}{\partial y} &= D \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} \right) |
| 9 | +
|
| 10 | + \frac{\partial v}{\partial t} + u \frac{\partial v}{\partial x} + v \frac{\partial v}{\partial y} &= D \left( \frac{\partial^2 v}{\partial x^2} + \frac{\partial^2 v}{\partial y^2} \right) |
| 11 | +
|
| 12 | +
|
| 13 | +* Domain is :math:`[-1,1]^2` with homogeneous Dirichlet BC |
| 14 | + |
| 15 | +* Initial conditions are: :math:`u = v = \alpha \exp( - \frac{(x-x_0)^2+(y-y_0)^2}{\delta} )` |
| 16 | + |
| 17 | +* Default settings: :math:`\alpha = 0.5`, :math:`\delta = 0.15`, :math:`x_0=0, y_0=-0.2`, :math:`D = 0.00001` |
| 18 | + |
| 19 | +Mesh |
| 20 | +---- |
| 21 | + |
| 22 | +.. code-block:: shell |
| 23 | +
|
| 24 | + python3 pressio-demoapps/meshing_scripts/create_full_mesh_for.py \ |
| 25 | + --problem burgers2d_dirichlet_s<stencilSize> -n Nx Ny --outDir <destination-path> |
| 26 | +
|
| 27 | +where |
| 28 | + |
| 29 | +- ``Nx, Ny`` is the number of cells you want along :math:`x` and :math:`y` respectively |
| 30 | + |
| 31 | +- ``<stencilSize> = 3 or 5 or 7``: defines the neighboring connectivity of each cell |
| 32 | + |
| 33 | +- ``<destination-path>`` is where you want the mesh files to be generated. |
| 34 | + The script creates the directory if it does not exist. |
| 35 | + |
| 36 | + |
| 37 | +.. Important:: |
| 38 | + |
| 39 | + When you set the ``<stencilSize>``, keep in mind the following constraints (more on this below): |
| 40 | + |
| 41 | + - ``InviscidFluxReconstruction::FirstOrder`` requires ``<stencilSize> >= 3`` |
| 42 | + |
| 43 | + - ``InviscidFluxReconstruction::Weno3`` requires ``<stencilSize> >= 5`` |
| 44 | + |
| 45 | + - ``InviscidFluxReconstruction::Weno5`` requires ``<stencilSize> >= 7`` |
| 46 | + |
| 47 | +.. Currently, the viscous reconstruction uses a three-point stencil, so it is always supported. |
| 48 | +
|
| 49 | +
|
| 50 | +C++ synopsis |
| 51 | +------------ |
| 52 | + |
| 53 | +.. code-block:: c++ |
| 54 | + |
| 55 | + #include "pressiodemoapps/advection_diffusion2d.hpp" |
| 56 | + // ... |
| 57 | + namespace pda = pressiodemoapps; |
| 58 | + |
| 59 | + const auto meshObj = pda::load_cellcentered_uniform_mesh_eigen("path-to-mesh"); |
| 60 | + |
| 61 | + const auto inviscidScheme = pda::InviscidFluxReconstruction::FirstOrder; // or Weno3, Weno5 |
| 62 | + const auto viscousScheme = pda::ViscousFluxReconstruction::FirstOrder; // must be FirstOrder |
| 63 | + |
| 64 | + // A. constructor for problem using default values |
| 65 | + { |
| 66 | + const auto probId = pda::AdvectionDiffusion2d::BurgersDirichlet; |
| 67 | + auto problem = pda::create_problem_eigen(meshObj, probId, inviscidScheme, viscousScheme); |
| 68 | + } |
| 69 | + |
| 70 | + // B. setting custom coefficients |
| 71 | + { |
| 72 | + using scalar_type = typename decltype(meshObj)::scalar_t; |
| 73 | + const auto alpha = /* something */; |
| 74 | + const auto delta = /* something */; |
| 75 | + const auto D = /* something */; |
| 76 | + const auto x0 = /* something */; |
| 77 | + const auto y0 = /* something */; |
| 78 | + auto problem = pda::create_dirichlet_burgers_2d_problem_eigen(meshObj, inviscidScheme, |
| 79 | + viscousScheme, alpha, |
| 80 | + delta, D, x0, y0) |
| 81 | + } |
| 82 | +
|
| 83 | +Python synopsis |
| 84 | +--------------- |
| 85 | + |
| 86 | +.. code-block:: py |
| 87 | +
|
| 88 | + import pressiodemoapps as pda |
| 89 | +
|
| 90 | + meshObj = pda.load_cellcentered_uniform_mesh("path-to-mesh") |
| 91 | +
|
| 92 | + inviscidScheme = pda.InviscidFluxReconstruction.FirstOrder; # or Weno3, Weno5 |
| 93 | + viscousScheme = pda.ViscousFluxReconstruction.FirstOrder; # must be FirstOrder |
| 94 | +
|
| 95 | + # A. constructor for problem using default values |
| 96 | + probId = pda.AdvectionDiffusion2d.BurgersPeriodic |
| 97 | + problem = pda.create_problem(meshObj, probId, inviscidScheme, viscousScheme) |
| 98 | +
|
| 99 | + # B. setting custom coefficients |
| 100 | + alpha = # something |
| 101 | + delta = # something |
| 102 | + D = # something |
| 103 | + x0 = # something |
| 104 | + y0 = # something |
| 105 | + problem = pda.create_dirichlet_burgers_2d_problem(meshObj, inviscidScheme, |
| 106 | + viscousScheme, alpha, |
| 107 | + delta, D, x0, y0) |
| 108 | +
|
| 109 | +
|
| 110 | +
|
| 111 | +Notes: |
| 112 | +------ |
| 113 | + |
| 114 | +.. important:: |
| 115 | + |
| 116 | + Note that we currently support only first order *viscous* |
| 117 | + flux reconstruction, which leads to a second-order scheme. |
0 commit comments