{"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/guaranteed-conservation-of-momentum-for","title":"Guaranteed Conservation of Momentum for Learning Particle-based Fluid Dynamics","arxiv_id":"2210.06036","date":"2022-10-12","proceeding":null,"authors":["Lukas Prantl","Benjamin Ummenhofer","Vladlen Koltun","Nils Thuerey"],"abstract":"We present a novel method for guaranteeing linear momentum in learned physics simulations. Unlike existing methods, we enforce conservation of momentum with a hard constraint, which we realize via antisymmetrical continuous convolutional layers. We combine these strict constraints with a hierarchical network architecture, a carefully constructed resampling scheme, and a training approach for temporal coherence. In combination, the proposed method allows us to increase the physical accuracy of the learned simulator substantially. In addition, the induced physical bias leads to significantly better generalization performance and makes our method more reliable in unseen test cases. We evaluate our method on a range of different, challenging fluid scenarios. Among others, we demonstrate that our approach generalizes to new scenarios with up to one million particles. Our results show that the proposed algorithm can learn complex dynamics while outperforming existing approaches in generalization and training performance. An implementation of our approach is available at https://github.com/tum-pbs/DMCF.","url_abs":"https://arxiv.org/abs/2210.06036v2","url_pdf":"https://arxiv.org/pdf/2210.06036v2.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":"abstracts"},"code_links":[{"paper_slug":"guaranteed-conservation-of-momentum-for","repo_url":"https://github.com/tum-pbs/dmcf","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2210.06036","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.06036"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/tum-pbs/dmcf","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":12},"by_repo_kind":{"official":{"samples":12,"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":"ae3f795ff6ed6081","entry":"align_vector","repo":"tum-pbs/dmcf","repo_kind":"official","path":"models/pbf_model.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/models/pbf_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ae3f795ff6ed6081"}},{"code_sha256_prefix":"1b0c88e4ca0cf441","entry":"align_vector","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/dataset_reader_physics.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/dataset_reader_physics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1b0c88e4ca0cf441"}},{"code_sha256_prefix":"82414e2580de1f2f","entry":"dict_hash","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/dataset_reader_physics.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/dataset_reader_physics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"82414e2580de1f2f"}},{"code_sha256_prefix":"581865281c139f39","entry":"gen_data","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/column_gen.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/column_gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"581865281c139f39"}},{"code_sha256_prefix":"e0098d40a9e04a2a","entry":"gen_dict","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/column_gen.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/column_gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e0098d40a9e04a2a"}},{"code_sha256_prefix":"c77df885068434af","entry":"gen_dict","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/free_fall_gen.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/free_fall_gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c77df885068434af"}},{"code_sha256_prefix":"c583d2d47369eb21","entry":"load_ckpt","repo":"tum-pbs/dmcf","repo_kind":"official","path":"run_sample.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/run_sample.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c583d2d47369eb21"}},{"code_sha256_prefix":"2c6afc6f30f0eb06","entry":"random_rotation_matrix","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/dataset_reader_physics.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/dataset_reader_physics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c6afc6f30f0eb06"}},{"code_sha256_prefix":"842cdabb9a891360","entry":"run_inference","repo":"tum-pbs/dmcf","repo_kind":"official","path":"run_sample.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/run_sample.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"842cdabb9a891360"}},{"code_sha256_prefix":"efb41573197fb0f6","entry":"run_rollout","repo":"tum-pbs/dmcf","repo_kind":"official","path":"run_sample.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/run_sample.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"efb41573197fb0f6"}},{"code_sha256_prefix":"8efa0beb5787dff2","entry":"sample_sphere","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/free_fall_gen.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/free_fall_gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8efa0beb5787dff2"}},{"code_sha256_prefix":"40a148b6fb7749bc","entry":"step","repo":"tum-pbs/dmcf","repo_kind":"official","path":"datasets/free_fall_gen.py","file_url":"https://github.com/tum-pbs/dmcf/blob/HEAD/datasets/free_fall_gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"40a148b6fb7749bc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}