Skip to content

TurboHeat/thermophone-tools

Repository files navigation

Multilayer model of thermoacoustic sound generation in steady periodic operation

Code for simulating thermophones, based upon

Guiraud, Pierre, et al. "Multilayer modeling of thermoacoustic sound generation for thermophone analysis and design." Journal of Sound and Vibration 455 (2019): 275-298. DOI

The implemented model considers:

  • Constant volumetric generation
  • Boundary generation
  • Convective losses

This simulator uses the non-free Multiprecision Computing Toolbox for MATLAB (aka mp toolbox) to perform some computations that require increased precision.

Contents:


Preparations

Multiprecision Computing Toolbox for MATLAB

  1. Download:

  2. Install:

    • On Windows - install, on Mac/Linux - extract.

    • Add the toolbox to MATLAB's PATH using the path tool or:

      addpath('path/to/AdvanpixMCT-4.7.0-1.13589')
  3. Trial reset:
    A method for doing this has only been discovered on Windows so far, and consists of going to %APPDATA%/MathWorks/MATLAB, then opening each of the R20### folders and deleting the empty folder of CommandHistory.


Simulator Configuration

  1. Layer definitions
    Data of each material layer is included in a matrix called MDM (Material Data Matrix). Each row represents the properties of a different layer of the thermophone design, in the order in which they appear. The column inputs are as follows:

    Material properties:

    Col. # Symbol Description Units
    1 L Thickness [m]
    2 ρ Density [kg m⁻³]
    3 B Bulk modulus [Pa]
    4 αT Coeff. thermal expansion [K⁻¹]
    5 λ 1ˢᵗ viscosity coeff. [kg m⁻¹ s⁻¹]
    6 μ 2ⁿᵈ viscosity coeff. [kg m⁻¹ s⁻¹]
    7 cp Specific heat, constant pressure [J kg⁻¹ K⁻¹]
    8 cv Specific heat, constant volume [J kg⁻¹ K⁻¹]
    9 κ Thermal conductivity [W m⁻¹ K⁻¹]

    Forcing parameters

    Col. # Symbol Description Units
    10 SL Lt. edge boundary generation [W]
    11 S0 Internal generation [W]
    12 SR Rt. edge boundary generation [W]

    Experimental Conditions

    Col. # Symbol Description Units
    13 hL Lt. edge heat transfer coeff. [W m⁻¹ K⁻²]
    14 T0 Internal mean temperature [K]
    15 hR Rt. edge heat transfer coeff. [W m⁻¹ K⁻²]

    Visualized example structure

    MDM = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14;...%(layer 1)
            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14;...%(layer 2)
            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14;...%(layer 3)
            1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]; %(layer 4)
  2. Running in parfor mode
    If solutionFunc is configured to run using parfor, it is necessary to initialize the mp toolbox on each node (i.e. worker of the parallel pool) using the following commands:

    gcp(); % Create a pool with the default settings (if needed)
    spmd   % Issue commands to all workers in pool (Single Program, Multiple Data)
      warning('off', 'MATLAB:nearlySingularMatrix') % Precision warning toggle
      mp.Digits(50);                                % mp toolbox precision setup
    end
  3. Enabling/disabling the progress bar
    A progress bar visualizes the progress of loop for or parfor A progress bar is always associated with some overhead, however, in cases where individual loop iterations are very short (i.e. the "business logic" takes a short time to execute), the overhead can be the main performance sink - as happens in this case - which is why it is commented out in the code.

    The ParforProgressbar utility is bundled with the code as a Git submodule. To enable progressbar one must add it to MATLAB's path (e.g. addpath(fullfile(pwd, 'progressbar'));), and uncomment the lines related to ppm in solutionFunc.m (3 lines in total).

About

Code for simulating thermophones

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages