{'fraction_non_alphanumeric': 0.029022082018927444, 'fraction_numerical': 0.0, 'mean_word_length': 5.171206225680934, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A new shock/discontinuity detector

A new effective shock/discontinuity detector has been developed in this work. The detector has two steps. The first step is to check the ratio of the truncation errors on the coarse and fine grids, and the second step is to check the local ratio of the left- and right-hand slopes. The currently popular shock/discontinuity detectors such as Harten's, Jameson's and WENO can detect shock, but mistake high-frequency waves and critical points as shock and then damp the physically important high-frequency waves. Preliminary results show that the new shock/discontinuity detector is very delicate and can detect all shocks including strong, weak and oblique shocks or discontinuity in function and first-, second- and third-order derivatives without artificial case-related constants, but never mistake high-frequency waves and critical points or expansion waves as shock. This will overcome the bottleneck problem with numerical simulation for the shock–boundary layer interaction, shock–acoustic interaction, image process, porous media flow, multiple phase flow, detonation wave, and anywhere the high-frequency waves are important, but discontinuity exists and is mixed with high-frequency waves. After detecting the shock, we can then use one-side high-order scheme for shocks and high-order central compact scheme for the smooth parts if the shock is appropriately located. Then a high-order universal subroutine for the finite difference method is developed, which can be used for any finite difference code for accurate numerical derivatives.