1% -------------------------------------------------------------------------
2% EXAMPLE: SHOCKTURBULENCE_ACOUSTIC
3%
4% This example computes the Linear Interaction Analysis (LIA) solution for
5% a shock–turbulence interaction involving upstream acoustic fluctuations
6% only, with no vortical or entropic disturbances present in the incoming
7% flow.
8%
9% The upstream turbulent field is modeled as a purely dilatational acoustic
10% mode, consisting of propagating pressure and velocity fluctuations that
11% satisfy the linearized isentropic relations. No solenoidal (vortical)
12% component or correlated entropic density fluctuations are prescribed.
13%
14% The interaction with a normal shock is analyzed under the assumptions of
15% linear perturbations, inviscid flow, and thermochemical equilibrium across
16% a thin relaxation layer.
17%
18% The formulation follows the LIA framework described in:
19%
20% Cuadra, A., Williams, C. T., Di Renzo, M., & Huete, C., The role of
21% compressibility and vibrational-excitation in hypersonic shock–turbulence
22% interactions, Journal of Fluid Mechanics (under review).
23%
24% In this acoustic configuration, all upstream dilatational content is
25% associated with propagating acoustic waves. Consequently, the entropic–
26% vortical correlation parameter :math:`\chi` is not defined, and the
27% vortical turbulent kinetic energy is identically zero.
28%
29% @author: Alberto Cuadra Lara
30%
31% Last update: December 16, 2025
32% -------------------------------------------------------------------------
33
34% Import packages
35import combustiontoolbox.databases.NasaDatabase
36import combustiontoolbox.core.*
37import combustiontoolbox.shockturbulence.*
38import combustiontoolbox.utils.display.*
39
40% Definitions
41mach = combustiontoolbox.utils.clusteredMesh1D([1, 5], [5, 10], 32, 70); mach(1) = [];
42
43% Define caloric gas model
44caloricGasModel = CaloricGasModel.imperfect;
45
46% Get Nasa database
47DB = NasaDatabase();
48
49% Define chemical system
50system = ChemicalSystem(DB, 'air ions');
51
52% Initialize mixture
53mix = Mixture(system);
54
55% Define chemical state
56set(mix, {'N2', 'O2'}, [79/21, 1]);
57
58% Define propertiescle
59mixArray = setProperties(mix, 'temperature', 300, 'pressure', 1 * 1.01325, 'mach', mach);
60
61% Invoke ShockTurbulenceSolver and select problem
62shockTurbulence = ShockTurbulenceSolver('problemType', 'acoustic', 'caloricGasModel', caloricGasModel);
63
64% Solve LIA
65[averages, mixArray1, mixArray2] = shockTurbulence.solve(mixArray);
66
67% Report results
68shockTurbulence.report(averages, mixArray1, mixArray2);