test_r13_convergence module

Module to gather tests for convergence of decoupled stress system.

This file is executed by pytest to have good CI.

class test_r13_convergence.TestR13Convergence[source]

Bases: object

Class to bundle all stress convergence tests.

All tests are compared against reference errors.

working_dir = 'tests/2d_r13'
solver_path = 'fenicsR13'
run_solver(inputfile)[source]

Run the solver as subprocess with the given input file.

Test fails if subprocess return Exception or error.

compare_errors(errorsfile, ref_errorsfile)[source]

Check against reference errors. Compares absolute differences.

Absolute Error allowed: 1E-10 Return exception if diff returns with !=0 A comparison for complete equalness can be obtained with:

subprocess.check_call([
    "diff", "-u", "--strip-trailing-cr", errorsfile, ref_errorsfile
], cwd=self.working_dir)
create_meshes()[source]

Create the test meshes. Executed before any test of the class.

Often not needed if meshes are in Git through LFS for reproducability.

test_r13_1_coeffs_nosources_norot_inflow_p1p1p1p1p1_gls()[source]

Execute full linear R13 system test and check with reference errors.

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\(0\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(10^{-3}\)

\(\theta_w^2\)

\(2.0\)

\(v_t^2\)

\(-1.00 \sin(\phi)\)

\(v_n^2\)

\(+1.00 \cos(\phi)\)

\(p_w^2\)

\(-0.27 \cos(\phi)\)

\(\epsilon_w^2\)

\(10^{3}\)

Elements

\(P_1P_1P_1P_1P_1\)

Stabilization

GLS

test_r13_1_coeffs_nosources_norot_inflow_p1p1p1p1p1_stab()[source]

Execute full linear R13 system test and check with reference errors.

Test case is similar to [TOR2017].

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\(0\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(10^{-3}\)

\(\theta_w^2\)

\(2.0\)

\(v_t^2\)

\(-1.00 \sin(\phi)\)

\(v_n^2\)

\(+1.00 \cos(\phi)\)

\(p_w^2\)

\(-0.27 \cos(\phi)\)

\(\epsilon_w^2\)

\(10^{3}\)

Elements

\(P_1P_1P_1P_1P_1\)

Stabilization

CIP: \(\delta_\theta,\delta_u=1,\delta_p=0.01\)

test_r13_1_coeffs_nosources_norot_inflow_p1p2p1p1p2_nostab()[source]

Execute full linear R13 system test and check with reference errors. Use Generalized Taylor-Hood elements (P2P1P2P1P1) w.o. stabilization.

Test case is similar to [TOR2017].

TOR2017(1,2,3)

Torrilhon, M. et al. (2017). “Hierarchical Boltzmann simulations and model error estimation”. In: Journal of Computational Physics 342 (2017), pp. 66–84.

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\(0\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(10^{-3}\)

\(\theta_w^2\)

\(2.0\)

\(v_t^2\)

\(-1.00 \sin(\phi)\)

\(v_n^2\)

\(+1.00 \cos(\phi)\)

\(p_w^2\)

\(-0.27 \cos(\phi)\)

\(\epsilon_w^2\)

\(10^{3}\)

Elements

\(P_1P_2P_1P_1P_2\)

Stabilization

Off

test_r13_1_coeffs_nosources_norot_inflow_p2p2p2p2p2_gls()[source]

Execute full linear R13 system test and check with reference errors. Use second order equal elements.

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\(0\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(10^{-3}\)

\(\theta_w^2\)

\(2.0\)

\(v_t^2\)

\(-1.00 \sin(\phi)\)

\(v_n^2\)

\(+1.00 \cos(\phi)\)

\(p_w^2\)

\(-0.27 \cos(\phi)\)

\(\epsilon_w^2\)

\(10^{3}\)

Elements

\(P_2P_2P_2P_2P_2\)

Stabilization

GLS

test_r13_1_coeffs_nosources_norot_inflow_p2p2p2p2p2_stab()[source]

Execute full linear R13 system test and check with reference errors. Use second order equal elements.

Test case is similar to [TOR2017].

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\(0\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(10^{-3}\)

\(\theta_w^2\)

\(2.0\)

\(v_t^2\)

\(-1.00 \sin(\phi)\)

\(v_n^2\)

\(+1.00 \cos(\phi)\)

\(p_w^2\)

\(-0.27 \cos(\phi)\)

\(\epsilon_w^2\)

\(10^{3}\)

Elements

\(P_2P_2P_2P_2P_2\)

Stabilization

CIP

test_r13_1_coeffs_sources_rot_noinflow_p1p1p1p1p1_gls()[source]

Execute full linear R13 system test and check with reference errors.

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\((1-\frac{5R^2}{18{Kn}^2})\cos(\phi)\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(10.0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(0\)

\(\theta_w^2\)

\(0.5\)

\(v_t^2\)

\(0.0\)

\(v_n^2\)

\(0\)

\(p_w^2\)

\(0\)

\(\epsilon_w^2\)

\(0\)

Elements

\(P_1P_1P_1P_1P_1\)

Stabilization

GLS

test_r13_1_coeffs_sources_rot_noinflow_p1p1p1p1p1_stab()[source]

Execute full linear R13 system test and check with reference errors.

Test case is similar to [WES2019].

WES2019(1,2)

A. Westerkamp and M. Torrilhon. “Finite Element Methods for the Linear Regularized 13-Moment Equations Describing Slow Rarefied Gas Flows”. In: Journal of Computational Physics 389 (2019).

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\((1-\frac{5R^2}{18{Kn}^2})\cos(\phi)\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(10.0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(0\)

\(\theta_w^2\)

\(0.5\)

\(v_t^2\)

\(0.0\)

\(v_n^2\)

\(0\)

\(p_w^2\)

\(0\)

\(\epsilon_w^2\)

\(0\)

Elements

\(P_1P_1P_1P_1P_1\)

Stabilization

CIP: \(\delta_\theta,\delta_u=1,\delta_p=0.01\)

test_r13_1_coeffs_sources_rot_noinflow_p2p2p2p2p2_gls()[source]

Execute full linear R13 system test and check with reference errors.

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\((1-\frac{5R^2}{18{Kn}^2})\cos(\phi)\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(10.0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(0\)

\(\theta_w^2\)

\(0.5\)

\(v_t^2\)

\(0.0\)

\(v_n^2\)

\(0\)

\(p_w^2\)

\(0\)

\(\epsilon_w^2\)

\(0\)

Elements

\(P_2P_2P_2P_2P_2\)

Stabilization

CIP: \(\delta_\theta,\delta_u=1,\delta_p=0.01\)

test_r13_1_coeffs_sources_rot_noinflow_p2p2p2p2p2_stab()[source]

Execute full linear R13 system test and check with reference errors.

Test case is similar to [WES2019].

Parameter Value

\(Kn\)

\(1.0\)

\(\dot{m}\)

\((1-\frac{5R^2}{18{Kn}^2})\cos(\phi)\)

\(r\)

\(0\)

\(\theta_w^1\)

\(1.0\)

\(v_t^1\)

\(10.0\)

\(v_n^1\)

\(0\)

\(p_w^1\)

\(0\)

\(\epsilon_w^1\)

\(0\)

\(\theta_w^2\)

\(0.5\)

\(v_t^2\)

\(0.0\)

\(v_n^2\)

\(0\)

\(p_w^2\)

\(0\)

\(\epsilon_w^2\)

\(0\)

Elements

\(P_2P_2P_2P_2P_2\)

Stabilization

CIP: \(\delta_\theta,\delta_u=1,\delta_p=0.01\)

__annotations__ = {}