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

1D Poisson test cases with Dirichlet boundary conditions

1D Poisson test cases with Dirichlet boundary conditions

This test case solves the pseudo-1D Poisson equation with Dirichlet boundary conditions on 2 opposite boundaries, in a 3D configuration. The aims of this test case are:

  1. verify the discretization of the diffusive term (using the Laplacian operator) of a cell advection/diffusion equation;
  2. verify the Dirichlet boundary condition of a cell scalar equation;
  3. verify each direction — x, y and z — separately.

Configuration

Domain is rectangular, its opposite corner coordinates being \((0,0,0)\) and \((1,2,2)\). We solve \(- \Delta T=f\) on the whole domain. 1D solution of the problem is set to \(x^p\). The right-end-side term \( f \) is equal to \(-p(p-1)x^{p-2}\). Figure 1 shows an illustration with \( p=2 \).

Figure 1: Elevation of the temperature field

The global boundary conditions are chosen as follows.

Boundary Condition Value
left Dirichlet \( T = 0 \)
right Dirichlet \( T = 1 \)
Other Boundaries Periodic

Runtime parameters

Energy equation is used:

Test cases

Files test_cases/verification/laplacian/dirichlet_3D_o2.nts and test_cases/verification/laplacian/dirichlet_3D_o4.nts are used to check the convergence as well as to verify the non-regression.

Comments

Since the problem is 1D, whatever the direction considered solutions should be equal up to computer precision. This is verified is the validation script of Notus on one mesh.

As regards to spatial convergence, when a centered second order scheme is used to discretize the Laplacian, we expect no error on the solution compared to the quadratic exact solution. This point is achieved only if a quadratic scheme is used to apply the boundary conditions (compared to a linear one).

Results

Second-order Laplacian

The case uses diffusion_scheme implicit o2_centered with bc_scheme linear. Second order convergence is observed with \(L_2\), \(L_1\) or \(L_\infty\) norms. The absolute error value is reduced when using quadratic boundary conditions.

Note
With bc_scheme quadratic former, the solution is reached up to computer precision whatever the mesh size.

Linear boundary conditions

Mesh Temperature L1 error order Temperature L2 error order Temperature Linf error order
4×4×4 0.062499999999999355 n/a 0.03124999999999967 n/a 0.01562500000000039 n/a
8×8×8 0.0156250000000012 2.000 0.007812500000000602 2.000 0.0039062500000101585 2.000
16×16×16 0.003906250000004143 2.000 0.001953125000002072 2.000 0.0009765625000227734 2.000
32×32×32 0.000976562500011836 2.000 0.0004882812500059154 2.000 0.000244140625022371 2.000
64×64×64 0.000244140625031188 2.000 0.0001220703125155971 2.000 6.103515635491608e-05 2.000

Quadratic boundary conditions

Mesh Temperature L1 error order Temperature L2 error order Temperature Linf error order
4×4×4 0.020833333333342093 n/a 0.010416666666671046 n/a 0.00520833333334858 n/a
8×8×8 0.005208333333341572 2.000 0.002604166666670785 2.000 0.0013020833333448056 2.000
16×16×16 0.0013020833333356285 2.000 0.0006510416666678146 2.000 0.000325520833341586 2.000
32×32×32 0.00032552083334009413 2.000 0.00016276041667004696 2.000 8.138020835524173e-05 2.000
64×64×64 8.138020831073147e-05 2.000 4.0690104155365815e-05 2.000 2.0345052129264185e-05 2.000

Fourth-order Laplacian

For this case, we set the power of the solution to \( p=4 \).

The case uses diffusion_scheme implicit o4_centered with bc_scheme linear | quadratic | cubic.

For cubic, fourth order convergence rate of 4 is expected with \(L_2\), \(L_1\) or \(L_\infty\) norms.

A convergence study shows that the global order of accuracy is limited by the lowest-order component: second-order when linear extrapolation is used, third-order with quadratic, and fourth-order only when cubic extrapolation is applied at the boundaries.

Results

Linear boundary conditions

Second order convergence is achieved, limited by the lower-order boundary treatment.

Mesh Temperature L1 error order Temperature L2 error order Temperature Linf error order
4×4×4 0.17154696132596295 n/a 0.0994857444352381 n/a 0.07822514225197674 n/a
8×8×8 0.04428274428274193 1.954 0.025690432405141402 1.953 0.021719769441647552 1.849
16×16×16 0.011253030971331495 1.976 0.00651641566706798 1.979 0.005711173189485219 1.927
32×32×32 0.002836352080065498 1.988 0.001640244926602669 1.990 0.001463622061681935 1.964
64×64×64 0.0007119875875616106 1.994 0.0004114156260152842 1.995 0.00037042629288164264 1.982

Quadratic boundary conditions

Third order convergence is achieved, limited by the boundary treatment.

Mesh Temperature L1 error order Temperature L2 error order Temperature Linf error order
4×4×4 0.02792633161511797 n/a 0.017629460048572364 n/a 0.015079237236130805 n/a
8×8×8 0.00394641723934086 2.823 0.002410251043293512 2.871 0.0022211568226787604 2.763
16×16×16 0.0005268617059392865 2.905 0.0003135759694213152 2.942 0.00029866130003275426 2.895
32×32×32 6.811443668498985e-05 2.951 3.994870491444693e-05 2.973 3.864620608029501e-05 2.950
64×64×64 8.660326340253145e-06 2.975 5.04008215663929e-06 2.987 4.9128722333646735e-06 2.976

Cubic boundary conditions

Optimal fourth order convergence is achieved, thanks to the high-order boundary treatment.

Mesh Temperature L1 error order Temperature L2 error order Temperature Linf error order
4×4×4 0.008333333333331364 n/a 0.004209782165601088 n/a 0.0023838141025644697 n/a
8×8×8 0.0004774477720420164 4.125 0.00024119064215383573 4.125 0.0001490926736268962 3.999
16×16×16 2.8470564766822627e-05 4.068 1.433264133987743e-05 4.073 9.318292277337506e-06 4.000
32×32×32 1.7366002492763991e-06 4.035 8.716854894495194e-07 4.039 5.823932698246232e-07 4.000
64×64×64 1.0719965210775657e-07 4.018 5.371120622412843e-08 4.021 3.6399578629483506e-08 4.000