API Reference

AeroTrixi.AnalysisCallback — Type
AnalysisCallback(semi; interval=0,
                       save_analysis=false,
                       output_directory="out",
                       analysis_filename="analysis.dat",
                       extra_analysis_errors=Symbol[],
                       extra_analysis_integrals=(),
                       analysis_pointwise=())

Analyze a numerical solution every interval time steps and print the results to the screen. If save_analysis, the results are also saved in joinpath(output_directory, analysis_filename).

Additional errors can be computed, e.g. by passing extra_analysis_errors = (:l2_error_primitive, :linf_error_primitive) or extra_analysis_errors = (:conservation_error,).

If you want to omit the computation (to safe compute-time) of the default_analysis_errors, specify analysis_errors = Symbol[]. Note: default_analysis_errors are :l2_error and :linf_error for all equations. If you want to compute extra_analysis_errors such as :conservation_error solely, i.e., without :l2_error, :linf_error you need to specify analysis_errors = [:conservation_error] instead of extra_analysis_errors = [:conservation_error].

Further scalar functions func in extra_analysis_integrals are applied to the numerical solution and integrated over the computational domain. Some examples for this are entropy, energy_kinetic, energy_internal, and energy_total. You can also write your own function with the same signature as the examples listed above and pass it via extra_analysis_integrals. The default analysis_integrals is (entropy_timederivative,). You can also request extra_analysis_integrals such as LiftCoefficientPressure or DragCoefficientPressure by constructing an AnalysisSurfaceIntegral with one of the previously mentioned functions.

Similarly, pointwise, i.e., per quadrature/interpolation point, quantities such at SurfacePressureCoefficient or SurfaceFrictionCoefficient can be computed. Instances of these need to be passed into AnalysisSurfacePointwise which is then in turn passed to analysis_pointwise.

See the developer comments about Trixi.analyze, Trixi.pretty_form_utf, and Trixi.pretty_form_ascii for further information on how to create custom analysis quantities.

In addition, the analysis callback records and outputs a number of quantities that are useful for evaluating the computational performance, such as the total runtime, the performance index (time/DOF/rhs!), the time spent in garbage collection (GC), or the current memory usage (alloc'd memory).

source
AeroTrixi.AnalysisSurfacePointwise — Type
AnalysisSurfacePointwise{Variable, NBoundaries}(boundary_symbol_or_boundary_symbols,
                                                variable, output_directory = "out")

This struct is used to compute pointwise surface values of a quantity of interest variable alongside the boundary/boundaries associated with particular names given in boundary_symbols. For instance, this can be used to compute the surface pressure coefficient SurfacePressureCoefficient or surface friction coefficient SurfaceFrictionCoefficient of e.g. an 2D airfoil with the boundary names :AirfoilTop, :AirfoilBottom which would be supplied as boundary_symbols = (:AirfoilTop, :AirfoilBottom). A single boundary name can also be supplied, e.g. boundary_symbols = (:AirfoilTop,).

  • boundary_symbols::NTuple{NBoundaries, Symbol}: Name(s) of the boundary/boundaries where the quantity of interest is computed
  • variable::Variable: Quantity of interest, like lift or drag
  • output_directory = "out": Directory where the pointwise value files are stored.
source
AeroTrixi.CompressibleEulerEquationsMs1T2D — Type
CompressibleEulerEquationsMs1T2D(ref_q, mass_arr, e_int_function, c_int_function;
                                 T_min = 10.0, T_max = 3.0e4, T_tol = 1e-9,
                                 dT = 1.0, min_T_jump = 1e-6,
                                 interpolation = :linear, cv_table_offset = false)

Multicomponent compressible Euler equations in two space dimensions for a flow in thermal equilibrium, i.e. a single temperature $T$ shared by all degrees of freedom of all species:

\[\frac{\partial}{\partial t} \begin{pmatrix} \rho v_1 \\ \rho v_2 \\ \rho e_{\text{total}} \\ \rho_1 \\ \vdots \\ \rho_{n} \end{pmatrix} + \frac{\partial}{\partial x} \begin{pmatrix} \rho v_1^2 + p \\ \rho v_1 v_2 \\ ( \rho e_{\text{total}} + p) v_1 \\ \rho_1 v_1 \\ \vdots \\ \rho_{n} v_1 \end{pmatrix} + \frac{\partial}{\partial y} \begin{pmatrix} \rho v_1 v_2 \\ \rho v_2^2 + p \\ ( \rho e_{\text{total}} + p) v_2 \\ \rho_1 v_2 \\ \vdots \\ \rho_{n} v_2 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ \vdots \\ 0 \end{pmatrix}\]

Here $\rho_i$ is the density of species $i$, $\rho = \sum_{i=1}^n \rho_i$, $v_1$, $v_2$ the velocities and $e_{\text{total}}$ the specific total energy. Unlike a calorically perfect gas there is no constant $\gamma$: the pressure follows from the number density rather than from the internal energy,

\[p = n k_B T, \qquad n = \sum_{i=1}^{n} \frac{\rho_i}{m_i}\]

and the internal energy is tabulated,

\[\rho e_{\text{total}} = \sum_{i=1}^{n} \rho_i e_i(T) + \frac{1}{2} \rho (v_1^2 + v_2^2)\]

with $e_i(T)$ carrying the translational, rotational and vibrational contributions of species $i$. Recovering $T$ from $e$ therefore requires a Newton iteration against the tables, which are held in a ThermoData1T instance in the thermodata field.

The conservative variables are $(\rho v_1, \rho v_2, \rho e_{\text{total}}, \rho_1, \ldots, \rho_n)$ — note that the momenta come first, there is no $\rho$ entry — and the primitive variables are $(v_1, v_2, T, \rho_1, \ldots, \rho_n)$, with $T$ in place of the pressure.

All quantities are non-dimensionalised by ref_q, so $k_B = 1$ in the equations as implemented and $p = n T$.

flux_oblapenko_etal is an entropy-conservative two-point flux for this system, available for both an orientation and a normal_direction.

Arguments

  • ref_q: ReferenceFlowQuantities (see FlowRef.jl) used to scale every quantity.
  • mass_arr: species masses in kg. Not modified.
  • e_int_function, c_int_function: one callable of T per species returning the specific internal energy and specific heat of the internal degrees of freedom; the translational parts are added internally by ThermoData1T.
  • T_min, T_max, dT: tabulation range and step, in K. Temperatures are clamped to $[1.0001\,T_{\min},\; 0.9999\,T_{\max}]$.
  • T_tol: relative tolerance of the Newton solver for $T(e)$.
  • min_T_jump: in units of dT. Below this temperature jump flux_oblapenko_etal replaces its divided differences by the equivalent midpoint expressions, which avoids the $0/0$ as $T_{rr} \to T_{ll}$.
  • interpolation: only :linear is implemented.
  • cv_table_offset: tabulate $c_v$ on a grid shifted by $-\Delta T/2$, see ThermoData1T.

References

source
AeroTrixi.CvOffset — Type
CvOffset <: CvTableOffset

Tabulate $c_v(T)$ at cell midpoints, $T_{\min} - \Delta T/2 + i \Delta T$, i.e. offset by half a step from the internal energy grid. See ThermoData1T.

source
AeroTrixi.SurfaceFrictionCoefficient — Method

SurfaceFrictionCoefficient(rhoinf, uinf)

Compute the surface skin friction coefficient

\[C_f \coloneqq \frac{\boldsymbol \tau_w \boldsymbol n^\perp} {0.5 \rho_{\infty} U_{\infty}^2 L_{\infty}}\]

based on the wall shear stress vector $\tau_w$ along a boundary. Supposed to be used in conjunction with AnalysisSurfacePointwise which stores the boundary information and semidiscretization.

  • rho_inf::Real: Free-stream density
  • u_inf::Real: Free-stream velocity
source
AeroTrixi.SurfacePressureCoefficient — Method
SurfacePressureCoefficient(p_inf, rho_inf, u_inf)

Compute the surface pressure coefficient

\[C_p \coloneqq \frac{p - p_{\infty}} {0.5 \rho_{\infty} U_{\infty}^2}\]

based on the pressure distribution along a boundary. Supposed to be used in conjunction with AnalysisSurfacePointwise which stores the boundary information and semidiscretization.

  • p_inf::Real: Free-stream pressure
  • rho_inf::Real: Free-stream density
  • u_inf::Real: Free-stream velocity
source
AeroTrixi.ThermoData1T — Type
ThermoData1T(ref_q, mass_arr, e_c_int_function_arr;
             T_min = 10.0, T_max = 3.0e4, T_tol = 1e-9, dT = 1.0,
             interpolation = :linear, cv_table_offset = false)

Tabulated thermodynamic data for a flow of NCOMP species in thermal equilibrium, i.e. a single temperature $T$ shared by all degrees of freedom.

For each species $i$ the specific internal energy and the specific heat at constant volume are split into a translational part, which is added internally, and a part carrying the internal degrees of freedom, which is supplied by the caller:

\[e_i(T) = \frac{3}{2} \frac{k_B T}{m_i} + e_i^{\text{int}}(T), \qquad c_{v,i}(T) = \frac{3}{2} \frac{k_B}{m_i} + c_{v,i}^{\text{int}}(T)\]

Both are sampled on a uniform grid of step $\Delta T$ and evaluated by linear interpolation. The entropy integral

\[\int_{T_0}^{T} \frac{c_{v,i}(\tau)}{\tau} \, \mathrm{d}\tau\]

is accumulated over the tabulation points and completed with an exact partial-cell contribution, $T_0$ being the first point of the $c_v$ grid.

The energy table holds $N_T$ points at $T_{\min} + (i-1)\Delta T$. Where the $c_v$ table lives is set by cv_table_offset:

  • false (NoCvOffset): the same grid as the energy table.
  • true (CvOffset): a grid shifted by $-\Delta T/2$, i.e. $T_{\min} - \Delta T/2 + (i-1)\Delta T$ with $N_T + 2$ points. The two extra points keep $[T_{\min}, T_{\max}]$ strictly bracketed. Sampling $c_v$ at cell midpoints makes it consistent with the slope of the piecewise-linear energy.

Both index pairs are returned together by get_index_lower_fracpos; with an offset table they differ, and mixing them up is silently wrong.

$T(e)$ is inverted by a Newton iteration with tolerance T_tol, clamped to $[1.0001\,T_{\min},\; 0.9999\,T_{\max}]$.

All stored quantities are dimensionless, scaled by the ReferenceFlowQuantities instance ref_q, which is retained in the ref_q field.

Arguments

  • ref_q: ReferenceFlowQuantities used to non-dimensionalise every table.
  • mass_arr: species masses in kg. Not modified.
  • e_c_int_function_arr: one callable per species, (m, T) -> (e, c_v), returning the internal-degree-of-freedom contributions only. The translational parts must not be included.
  • T_min, T_max, dT: tabulation range and step, in K.
  • T_tol: relative tolerance of the Newton solver for $T(e)$.
  • interpolation: only :linear is implemented.
  • cv_table_offset: place $c_v$ on the midpoint grid, see above.
source
AeroTrixi.examples_dir — Method
examples_dir()

Return the directory where the example files provided with AeroTrixi.jl are located. If AeroTrixi.jl is installed as a regular package (with ]add AeroTrixi), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir:

Examples

readdir(examples_dir())
source
AeroTrixi.flux_oblapenko_etal — Method
flux_oblapenko_etal(u_ll, u_rr, orientation_or_normal_direction,
                    equations::CompressibleEulerEquationsMs1T2D)

This flux is the multi-species entropy-conservative flux described in

The multi-species version is also described in

  • Georgii Oblapenko, Arseniy Tarnovskiy, Moritz Ertl, Manuel Torrilhon (2026) Entropy-Stable Fluxes for High-Order Discontinuous Galerkin Simulations of High-Enthalpy Flows DOI: 10.1007/978-3-032-11115-9_36
source
Trixi.boundary_condition_slip_wall — Method
boundary_condition_slip_wall(u_inner, normal_direction::AbstractVector,
                             x, t,
                             surface_flux_function,
                             equations::CompressibleEulerEquationsMs1T2D)

Determine the boundary numerical surface flux for a slip wall condition. Imposes a zero normal velocity at the wall. Density is taken from the internal solution state and pressure is computed as an exact solution of a 1D Riemann problem. Further details about this boundary state are available in the paper:

  • J. J. W. van der Vegt and H. van der Ven (2002) Slip flow boundary conditions in discontinuous Galerkin discretizations of the Euler equations of gas dynamics PDF

Details about the 1D pressure Riemann solution can be found in Section 6.3.3 of the book

  • Eleuterio F. Toro (2009) Riemann Solvers and Numerical Methods for Fluid Dynamics: A Practical Introduction 3rd edition DOI: 10.1007/b79761

The implementation is modified to ensure non-negativity of p_star. This modification preserves entropy stability based on the analysis in the paper:

  • F. J. Hindenlang, G. J. Gassner, D. A. Kopriva (2020) Stability of wall boundary condition procedures for discontinuous Galerkin spectral element approximations of the compressible Euler equations DOI: 10.1007/978-3-030-39647-3_1

Should be used together with UnstructuredMesh2D, P4estMesh, or T8codeMesh.

source