{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/on-the-kelvin-helmholtz-instability-with","title":"On the Kelvin-Helmholtz instability with smooth initial conditions -- Linear theory and simulations","arxiv_id":"1902.01403","date":"2019-02-04","proceeding":null,"authors":["Thomas Berlok","Christoph Pfrommer"],"abstract":"The Kelvin-Helmholtz instability (KHI) is a standard test of hydrodynamic and magnetohydrodynamic (MHD) simulation codes and finds many applications in astrophysics. The classic linear theory considers a discontinuity in density and velocity at the interface of two fluids. However, for numerical simulations of the KHI such initial conditions do not yield converged results even at the linear stage of the instability. Instead, smooth profiles of velocity and density are required for convergence. This renders analytical theory to be only approximately valid and hinders quantitative comparisons between the classical theory and simulations. In this paper we derive a linear theory for the KHI with smooth profiles and illustrate code testing with the MHD code Athena. We provide the linear solution for the KHI with smooth initial conditions in three different limits: inviscid hydrodynamics, ideal MHD and Braginskii-MHD. These linear solutions are obtained numerically with the framework Psecas (Pseudo-Spectral Eigenvalue Calculator with an Automated Solver), which generates and solves numerical eigenvalue problems using an equation-parser and pseudo-spectral methods. The Athena simulations are carried out on a periodic, Cartesian domain which is useful for code testing purposes. Using Psecas and analytic theory, we outline the differences between this artificial numerical setup and the KHI on an infinite Cartesian domain and the KHI in cylindrical geometry. We discuss several astrophysical applications, such as cold flows in galaxy formation and cold fronts in galaxy cluster mergers. Psecas, and the linear solutions used for code testing, are publicly available and can be downloaded from the web.","url_abs":"http://arxiv.org/abs/1902.01403v1","url_pdf":"http://arxiv.org/pdf/1902.01403v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"on-the-kelvin-helmholtz-instability-with","repo_url":"https://github.com/tberlok/psecas","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/1902.01403","atlas_url":"https://app.syntology.ai/?focus=1902.01403","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1902.01403"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tberlok/psecas","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"54164a91f74cce6d","entry":"get_2D_cylindrical_map","repo":"tberlok/psecas","repo_kind":"official","path":"psecas/plotting.py","file_url":"https://github.com/tberlok/psecas/blob/HEAD/psecas/plotting.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"54164a91f74cce6d"}},{"code_sha256_prefix":"c02ef653e9847056","entry":"get_2D_cylindrical_map_in_cylindrical_coords","repo":"tberlok/psecas","repo_kind":"official","path":"psecas/plotting.py","file_url":"https://github.com/tberlok/psecas/blob/HEAD/psecas/plotting.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"c02ef653e9847056"}},{"code_sha256_prefix":"a0c64bbdfcd4c675","entry":"get_2Dmap","repo":"tberlok/psecas","repo_kind":"official","path":"psecas/plotting.py","file_url":"https://github.com/tberlok/psecas/blob/HEAD/psecas/plotting.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a0c64bbdfcd4c675"}},{"code_sha256_prefix":"a02023397920ae8a","entry":"golden_section","repo":"tberlok/psecas","repo_kind":"official","path":"psecas/utils.py","file_url":"https://github.com/tberlok/psecas/blob/HEAD/psecas/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a02023397920ae8a"}},{"code_sha256_prefix":"afecd0a258a990a5","entry":"load_system","repo":"tberlok/psecas","repo_kind":"official","path":"psecas/serial_io.py","file_url":"https://github.com/tberlok/psecas/blob/HEAD/psecas/serial_io.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"afecd0a258a990a5"}},{"code_sha256_prefix":"a46ca7fa7814294f","entry":"var_replace","repo":"tberlok/psecas","repo_kind":"official","path":"psecas/string_methods.py","file_url":"https://github.com/tberlok/psecas/blob/HEAD/psecas/string_methods.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a46ca7fa7814294f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}