{"id":13408602,"url":"https://github.com/markstock/vic2d","last_synced_at":"2025-03-14T13:31:42.743Z","repository":{"id":27443303,"uuid":"113942347","full_name":"markstock/vic2d","owner":"markstock","description":"Two-dimensional semi-Lagrangian vortex method for very low viscosity fluid simulation","archived":false,"fork":false,"pushed_at":"2024-02-10T21:06:22.000Z","size":2261,"stargazers_count":29,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T20:31:31.984Z","etag":null,"topics":["cfd","fluid-dynamics","fluid-solver","simulator","vorticity"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markstock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-12T04:14:19.000Z","updated_at":"2024-07-17T13:03:07.000Z","dependencies_parsed_at":"2024-02-10T22:24:20.059Z","dependency_job_id":null,"html_url":"https://github.com/markstock/vic2d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstock%2Fvic2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstock%2Fvic2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstock%2Fvic2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstock%2Fvic2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markstock","download_url":"https://codeload.github.com/markstock/vic2d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243584346,"owners_count":20314738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cfd","fluid-dynamics","fluid-solver","simulator","vorticity"],"created_at":"2024-07-30T20:00:53.989Z","updated_at":"2025-03-14T13:31:42.232Z","avatar_url":"https://github.com/markstock.png","language":"C","funding_links":[],"categories":["Computational Fluid Dynamics"],"sub_categories":["Vortex Methods / Panel Methods / Blade Element Methods"],"readme":"# vic2d\n\nA command-line two-dimensional fluid simulator using a novel semi-Lagrangian advection technique\n\n![vorticies in a flow](media/sampleA.png?raw=true \"vic2d simulation of vorticity rings\")\n\n## Building vic2d\n\nWe are now using CMake to build the code, though you can still use the unmaintained unix `Makefile`.\n\n    git clone https://github.com/markstock/vic2d.git\n    cd vic2d\n    mkdir build\n    cd buil\n    cmake -DCMAKE_BUILD_TYPE=Release -DUSE_OMP=ON ..\n    make\n\nWindows users can run the cross-compiled binary included in this distribution (`vic2d.exe`). Or, to build this Windows binary on a RedHat-flavor Linux machine, the following should work.\n\n    sudo dnf install mingw64-libpng-static.noarch mingw64-gcc-gfortran.x86_64 \\\n\t\tmingw64-gcc-c++.x86_64 mingw64-gcc.x86_64 mingw64-zlib-static.noarch \\\n\t\tmingw64-zlib.noarch mingw64-libpng.noarch mingw64-libgomp.x86_64\n    mkdir build_win\n    cd build_win\n    cmake -DCMAKE_SYSTEM_NAME=Windows \\\n\t\t-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \\\n\t\t-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \\\n\t\t-DCMAKE_Fortran_COMPILER=x86_64-w64-mingw32-gfortran \\\n\t\t-DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_OMP=ON ..\n    make\n\n## Running vic2d\n\nTo get a list of options, run\n\n    vic2d -h\n\nNote that all diffusivities are coefficients, so for Reynolds number 10000, you should set momentum diffusivity with `-vd 0.0001`\n\nAlso note that the actual resolution of the output images will be one higher than that given on the command-line. So `-x 1024 -y 1024` will generate square PNG images with 1025 pixels on a side. And any input images for such a run should have 1025 pixels on a side. I know, this is not intuitive. I created it this way because for the multigrid solver to function efficiently, you should try to run at resolutions that are small multiples of large factors of 2, so 2560 (5 * 128) is much better than 2544 (159 * 16), and those numbers are easier to remember.\n\nFor some sample command lines and output, including links to YouTube videos, check out the [old vic2d page](http://markjstock.org/vic2d/).\n\n## Theory\n\nThis code uses a vortex method solver, which means that pressure doesn't enter in the equations: the formulation is in velocity-vorticity coordinates. The velocity-vorticity inversion is accomplished with MUDPACK, a multigrid solution method. Interpolation to and from the grid is done with a 4th order kernel (M4'). Advection uses a semi-Lagrangian method, in which the vorticity at each grid point is drawn from a 4th order (Runge-Kutta) backward-looking projection. All of these methods contribute to the code's remarkable lack of numerical diffusion - you can run problems with Reynolds numbers in the hundreds of millions - though the drawback is that the simulation is not unconditionally stable.\n\nThe first implementation of a semi-Lagrangian vorticity-based solver is in Sawyer \u0026 Portnall (1963) A semi-Lagrangian method of solving the vorticity advection equation, Tellus, 15:4, 336-342, DOI: 10.3402/tellusa.v15i4.8862 [link](https://doi.org/10.3402/tellusa.v15i4.8862).\n\n## Notes\n\nThis program can create digital output very similar to that made by the traditional technique of ebru, or paper marbling. [Here](http://digital-marbling.de/) is an excellent web site about this art-making method.\n\n## Thanks\n\nThis code uses [libpng](https://github.com/glennrp/libpng) and [mudpack](https://www2.cisl.ucar.edu/resources/legacy/mudpack), a multigrid solver. All the rest of this ugly, ugly code is mine.\n\n## Citing vic2d\n\nI don't get paid for writing or maintaining this, so if you find this tool useful or mention it in your writing, please please cite it by using the following BibTeX entry.\n\n```\n@Misc{vic2d2004,\n  author =       {Mark J.~Stock},\n  title =        {vic2d:  A command-line two-dimensional fluid simulator using a novel semi-Lagrangian advection technique},\n  howpublished = {\\url{https://github.com/markstock/vic2d}},\n  year =         {2004}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkstock%2Fvic2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkstock%2Fvic2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkstock%2Fvic2d/lists"}