Skip to content

Commit 4306389

Browse files
author
Francesco Rizzi
committed
preparing release
1 parent c9dc6b4 commit 4306389

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+737
-162
lines changed
16.9 KB
Binary file not shown.
16.8 KB
Binary file not shown.
4 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.

docs/.doctrees/environment.pickle

3.3 KB
Binary file not shown.
5 Bytes
Binary file not shown.

docs/.doctrees/problems_2d.doctree

37 Bytes
Binary file not shown.

docs/.doctrees/swe_2d.doctree

52 Bytes
Binary file not shown.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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.

docs/_sources/burgers_2d.rst.txt renamed to docs/_sources/burgers_2d_periodic.rst.txt

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
2D Burgers
2-
==========
3-
TODO: Add Initial conditions and parameters. Fix code blocks.
1+
2D Burgers (Periodic BCs)
2+
=========================
43

5-
This problem solves the 2D Burgers equations. We consider a two-dimensional nonlinear viscous Burgers equations
4+
This problem solves the 2D nonlinear viscous Burgers equations
65

76
.. math::
87
9-
\frac{\partial u}{\partial t} + u \nabla u = D \nabla^2 u
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)
109
11-
with:
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)
1211
13-
* Domain is :math:`[0,1]^2` with periodic BC
1412
15-
* initial condition is: :math:`u = \alpha \exp( - \frac{(x-x_0)^2+(y-y_0)^2}{\delta} )`
13+
* Domain is :math:`[-1,1]^2` with periodic BC
14+
15+
* Initial conditions are: :math:`u = v = \alpha \exp( - \frac{(x-x_0)^2+(y-y_0)^2}{\delta} )`
1616

1717
* Default settings: :math:`\alpha = 0.5`, :math:`\delta = 0.15`, :math:`x_0=0, y_0=-0.2`, :math:`D = 0.00001`
1818

@@ -22,7 +22,7 @@ Mesh
2222
.. code-block:: shell
2323
2424
python3 pressio-demoapps/meshing_scripts/create_full_mesh_for.py \
25-
--problem burgers2d_s<stencilSize> -n Nx Ny --outDir <destination-path>
25+
--problem burgers2d_periodic_s<stencilSize> -n Nx Ny --outDir <destination-path>
2626
2727
where
2828

@@ -63,7 +63,7 @@ C++ synopsis
6363

6464
// A. constructor for problem using default values
6565
{
66-
const auto probId = pda::AdvectionDiffusion2d::Burgers;
66+
const auto probId = pda::AdvectionDiffusion2d::BurgersPeriodic;
6767
auto problem = pda::create_problem_eigen(meshObj, probId, inviscidScheme, viscousScheme);
6868
}
6969

@@ -75,8 +75,9 @@ C++ synopsis
7575
const auto D = /* something */;
7676
const auto x0 = /* something */;
7777
const auto y0 = /* something */;
78-
auto problem = pda::create_burgers_2d_problem_eigen(meshObj, inviscidScheme, viscousScheme,
79-
alpha, delta, D, x0, y0)
78+
auto problem = pda::create_periodic_burgers_2d_problem_eigen(meshObj, inviscidScheme,
79+
viscousScheme, alpha,
80+
delta, D, x0, y0)
8081
}
8182
8283
Python synopsis
@@ -92,17 +93,18 @@ Python synopsis
9293
viscousScheme = pda.ViscousFluxReconstruction.FirstOrder; # must be FirstOrder
9394
9495
# A. constructor for problem using default values
95-
probId = pda.AdvectionDiffusion2d::Burgers
96-
problem = pda.create_problem(meshObj, probId, scheme)
96+
probId = pda.AdvectionDiffusion2d.BurgersPeriodic
97+
problem = pda.create_problem(meshObj, probId, inviscidScheme, viscousScheme)
9798
9899
# B. setting custom coefficients
99-
alpha = /* something */
100-
delta = /* something */
101-
D = /* something */
102-
x0 = /* something */
103-
y0 = /* something */
104-
problem = pda.create_burgers_2d_problem(meshObj, inviscidScheme, viscousScheme,
105-
alpha, delta, D, x0, y0)
100+
alpha = # something
101+
delta = # something
102+
D = # something
103+
x0 = # something
104+
y0 = # something
105+
problem = pda.create_periodic_burgers_2d_problem(meshObj, inviscidScheme,
106+
viscousScheme, alpha,
107+
delta, D, x0, y0)
106108
107109
108110

0 commit comments

Comments
 (0)