0.6.0
Loading...
Searching...
No Matches
1D Poisson equation with Robin boundary conditions

1D Poisson test cases with Robin boundary conditions

1D Poisson test cases with Robin boundary conditions

This test case solves the 1D Poisson cell-scalar equation with Robin boundary conditions on 2 opposite boundaries (i.e. left/right or bottom/top or back/front) using a second or fourth-order centered scheme and different boundary schemes linear, quadratic and cubic using a non uniform grid. The aims of this test case are:

  1. verify the discretization of the diffusive term of a cell advection-diffusion equation;
  2. verify the discretization of Robin boundary conditions;
  3. verify the correctness of the implementation in all 3 directions.

Configuration

Setup

The domain is a cube, of opposite corner \((0,0,0)\) and \((1,1,1)\) with periodic boundary conditions for \(y\) and \(z\) directions.

We solve the Poisson equation \(- \Delta T=f\) in the whole domain, for which we chose the 1D solution in the \(x_i={x,y,z}\) direction:

\[ T(x_i) = \cos(\pi x_i) + \sin(\pi x_i)\]

with the associated source term:

\[ f(x_i) = \pi^2 (\cos(\pi x_i) + \sin(\pi x_i))\]

and Robin boundary condition:

\[ \beta T(x_i) + \alpha \nabla T(x_i) \cdot \vec{n}(x_i) = g.\]

\(\forall x_i \in \Gamma_i\) with \(\Gamma_i\) being the opposite boundaries in the \(x_i\) direction.

In practice, we chose \( \alpha \) and \( \beta \) arbitrarily and deduce the associated \(g\) to set the three constant Robin coefficients:

Boundary \(\alpha \) \(\beta \) \(g \)
Left 10 1 \( -\alpha + \beta \pi \)
Right 5 10 \( -\alpha - \beta \pi \)

Runtime parameters

Energy equation is used with:

Test cases

The file test_cases/verification/laplacian/bc_schemes_1D*.nts are used to check the convergence as well as to verify the non-regression.

Comments and Expectations

Since the analytical solution is infinitely smooth (regular), we expect the numerical schemes to reproduce the solution with very high accuracy.

Regarding the Robin boundary conditions:

In summary, because the solution is highly regular, the numerical error should decrease rapidly with mesh refinement, and the impact of the boundary condition discretization order will be clearly visible in the convergence rates.

Results

Case 1: Second-order diffusion scheme

boundary_condition_scheme linear | quadratic | cubic;
diffusion_scheme implicit o2_centered;

The convergence study is illustrated in figure 1. The grid size starts from 10 to 160 cells. Second-order convergence is observed with \(L_2\), \(L_1\) or \(L_\infty\) norms with all boundary schemes, restricted by the second-order diffusion scheme. While the convergence rate is the same, we can observe that high-order boundary schemes reduce the absolute accuracy of the numerical solution.

Figure 1: Convergence graph with all boundary schemes

Case 2: Fourth-order diffusion scheme

boundary_condition_scheme linear | quadratic | cubic;
diffusion_scheme implicit o4_centered;

The convergence study is illustrated in figure 2. The grid size starts from 10 to 160 cells. The lowest-order scheme's (between the diffusion scheme and boundary scheme) convergence rate is observed with \(L_2\), \(L_1\) or \(L_\infty\) norms for all the boundary schemes. The fourth-order diffusion scheme with cubic boundary scheme exhibits the best convergence and absolute errors.

Figure 2: Convergence graph with boundary schemes

Annexe

Diffusion O2 centered + linear

Mesh Temperature \( L_1 \) error order Temperature \( L_2 \) error order Temperature \( L_{\infty} \) error order
10×10 0.005274696791562957 n/a 0.007621919766144439 n/a 0.016146793250261915 n/a
20×20 0.0013196693064543776 1.999 0.0019084602207500344 1.998 0.004200008145001655 1.943
40×40 0.00032995756231637524 2.000 0.0004773000908782774 1.999 0.0010695783018768168 1.973
80×80 8.249722774167855e-05 2.000 0.00011933656805867394 2.000 0.0002697862216278768 1.987
160×160 2.0624048510926773e-05 2.000 2.983486273656589e-05 2.000 6.774195702374808e-05 1.994

Diffusion O2 centered + quadratic

Mesh Temperature \( L_1 \) error order Temperature \( L_2 \) error order Temperature \( L_{\infty} \) error order
10×10 0.012596886481344504 n/a 0.014249923980859293 n/a 0.019356085715015903 n/a
20×20 0.0035063569048826046 1.845 0.0039019075624953004 1.869 0.0052271348898316194 1.889
40×40 0.0009206205739936075 1.929 0.0010153826826934341 1.942 0.0013513934112519 1.952
80×80 0.00023543522727901252 1.967 0.0002586520410048707 1.973 0.0003431669986262431 1.977
160×160 5.9504371977014835e-05 1.984 6.525176313441727e-05 1.987 8.6439336951738e-05 1.989

Diffusion O2 centered + cubic

Mesh Temperature \( L_1 \) error order Temperature \( L_2 \) error order Temperature \( L_{\infty} \) error order
10×10 0.053327502582919864 n/a 0.05482855599950797 n/a 0.06797353183190724 n/a
20×20 0.014312761302067786 1.898 0.014755720353821226 1.894 0.018647790637535744 1.866
40×40 0.0036788104978365027 1.960 0.003797764339054156 1.958 0.004844526534936167 1.945
80×80 0.0009308893607647129 1.983 0.0009616249400276666 1.982 0.001232303116674549 1.975
160×160 0.0002340335517336661 1.992 0.00024183979049949167 1.991 0.0003106149823739468 1.988

Diffusion O4 centered + linear

Mesh Temperature \( L_1 \) error order Temperature \( L_2 \) error order Temperature \( L_{\infty} \) error order
10×10 0.08369105932756048 n/a 0.08866750458726419 n/a 0.12943283328566824 n/a
20×20 0.03303699178342671 1.341 0.03573650687008721 1.311 0.055396070685157506 1.224
40×40 0.014188424122188823 1.219 0.015607243550467062 1.195 0.025142419614984535 1.140
80×80 0.0064981349297776525 1.127 0.007228747330266369 1.110 0.011906863294447234 1.078
160×160 0.0030985177261090915 1.068 0.003469813247128246 1.059 0.005784353870955439 1.042

Diffusion O4 centered + quadratic

Mesh Temperature \( L_1 \) error order Temperature \( L_2 \) error order Temperature \( L_{\infty} \) error order
10×10 0.0017055591159594653 n/a 0.0017099318875461098 n/a 0.0019943213261199855 n/a
20×20 0.00020075037288440936 3.087 0.000200984315200849 3.089 0.00023193308685087732 3.104
40×40 2.4227981150468017e-05 3.051 2.424077751458529e-05 3.052 2.775719300307511e-05 3.063
80×80 2.971865261278806e-06 3.027 2.972597459555598e-06 3.028 3.388185069286287e-06 3.034
160×160 3.678700458656038e-07 3.014 3.679135207843796e-07 3.014 4.1830396924069646e-07 3.018

Diffusion O4 centered + cubic

Mesh Temperature \( L_1 \) error order Temperature \( L_2 \) error order Temperature \( L_{\infty} \) error order
10×10 0.00032832860266853424 n/a 0.0003391528129971056 n/a 0.00042915367645202096 n/a
20×20 2.380378580203322e-05 3.786 2.4509548390168937e-05 3.791 3.0201203690127798e-05 3.829
40×40 1.5788291776751893e-06 3.914 1.624193405240135e-06 3.916 1.9796588730525144e-06 3.931
80×80 1.01317489742874e-07 3.962 1.041958483611351e-07 3.962 1.2637946289473234e-07 3.969
160×160 6.411113391477513e-09 3.982 6.592370965330299e-09 3.982 7.977306371032e-09 3.986