Shock-Turbulence Interaction with compressible turbulence (vortical, entropic, and acoustic disturbances)#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCKTURBULENCE_COMPRESSIBLE
 3%
 4% This example computes the Linear Interaction Analysis (LIA) solution for 
 5% a compressible shock–turbulence interaction involving upstream vortical
 6% and acoustic fluctuations.
 7% 
 8% The upstream turbulent field is modeled as a superposition of solenoidal
 9% (vortical) and dilatational modes. The dilatational content is partitioned
10% into:
11%
12%   (i) entropic fluctuations correlated with vortical disturbances, and
13%  (ii) acoustic (traveling-wave) fluctuations.
14% 
15% The interaction with a normal shock is analyzed under the assumptions of 
16% linear perturbations, inviscid flow, and thermochemical equilibrium across
17% a thin relaxation layer.
18%
19% The formulation follows the LIA framework described in:
20%
21%   Cuadra, A., Williams, C. T., Di Renzo, M., & Huete, C., The role of 
22%   compressibility and vibrational-excitation in hypersonic shock–turbulence
23%   interactions, Journal of Fluid Mechanics (under review).
24%
25% The relative contribution of acoustic (dilatational) fluctuations to the
26% upstream turbulent kinetic energy is prescribed through the parameter
27% :math:`\eta`, defined as the ratio of dilatational to solenoidal TKE,
28% 
29% .. math::
30% 
31%    \eta = \frac{\mathrm{TKE}_{1,a}}{\mathrm{TKE}_{1,r}}
32% 
33% where subscripts :math:`a` and :math:`r` denote acoustic and rotational
34% (vortical–entropic) components, respectively.
35% 
36% In this example, the compressible case corresponds to
37% 
38% .. math::
39% 
40%    \eta = 0.1
41% 
42% indicating that 10% of the upstream turbulent kinetic energy is associated
43% with acoustic (dilatational) fluctuations.
44%
45% The correlation parameter :math:`\chi` characterizes the entropic (dilatational)
46% density fluctuations that are correlated with vortical disturbances.
47% Although chi also represents dilatational content, it is implicit in the
48% vortical–entropic mode and does not correspond to propagating acoustic
49% energy.
50%
51% In this example, :math:`\chi` is set to zero, corresponding to vortical
52% fluctuations without correlated entropic disturbances.
53%
54% @author: Alberto Cuadra Lara
55%                 
56% Last update January 12, 2026
57% -------------------------------------------------------------------------
58
59% Import packages
60import combustiontoolbox.databases.NasaDatabase
61import combustiontoolbox.core.*
62import combustiontoolbox.shockturbulence.*
63import combustiontoolbox.utils.display.*
64
65% Definitions
66mach = combustiontoolbox.utils.clusteredMesh1D([1, 1.2], [1.2, 10], 32, 70); mach(1) = [];
67caloricGasModel = CaloricGasModel.imperfect;
68
69% Get Nasa database
70DB = NasaDatabase();
71
72% Define chemical system
73system = ChemicalSystem(DB, 'air ions');
74
75% Initialize mixture
76mix = Mixture(system);
77
78% Define chemical state
79set(mix, {'N2', 'O2'}, [79/21, 1]);
80
81% Define properties
82mixArray = setProperties(mix, 'temperature', 300, 'pressure', 1 * 1.01325, 'mach', mach, 'eta', 0.1);
83
84% Invoke ShockTurbulenceSolver and select problem
85shockTurbulence = ShockTurbulenceSolver('problemType', 'compressible', 'caloricGasModel', caloricGasModel);
86
87% Update viscosity model
88shockTurbulence.shockTurbulenceModel.viscosityModel = 'sutherland';
89
90% Solve LIA
91[averages, mixArray1, mixArray2] = shockTurbulence.solve(mixArray);
92
93% Report results
94shockTurbulence.report(averages, mixArray1, mixArray2);