{"id":18242761,"url":"https://github.com/jnywong/convect-jl","last_synced_at":"2025-04-08T17:45:51.235Z","repository":{"id":180484593,"uuid":"392711058","full_name":"jnywong/convect-jl","owner":"jnywong","description":"Welcome! Here is my Julia code to simulate 2D linear or nonlinear convection in a Cartesian box.","archived":false,"fork":false,"pushed_at":"2022-07-11T11:58:13.000Z","size":19789,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T14:18:35.234Z","etag":null,"topics":["convection","julia"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jnywong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-08-04T14:05:09.000Z","updated_at":"2021-10-13T10:04:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ce87ace-f340-40e4-869d-ac874e6627fc","html_url":"https://github.com/jnywong/convect-jl","commit_stats":null,"previous_names":["jnywong/convect-jl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnywong%2Fconvect-jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnywong%2Fconvect-jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnywong%2Fconvect-jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnywong%2Fconvect-jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jnywong","download_url":"https://codeload.github.com/jnywong/convect-jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247895761,"owners_count":21014381,"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":["convection","julia"],"created_at":"2024-11-05T07:41:51.030Z","updated_at":"2025-04-08T17:45:51.214Z","avatar_url":"https://github.com/jnywong.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# convect-jl\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/figures/video.gif\" /\u003e\n\u003c/p\u003e\n\nWelcome! Here is my Julia code to simulate 2D convection in a Cartesian box. Theory and methods used can be found in [Introduction to Modeling Convection in Planets and Stars: Magnetic Field, Density Stratification, Rotation](https://press.princeton.edu/books/hardcover/9780691141725/introduction-to-modeling-convection-in-planets-and-stars). \n\n## Getting Started\n\n### Pre-requisites\n- [Julia](https://julialang.org/) (version 1.6)\n\n## Package structure\n```\nconvect-jl\n    docs/\n    src/\n        convect_linear.jl\n        convect_nonlinear.jl\n        critical_ra.jl\n        data_utils.jl\n        postprocess.jl\n        routines.jl\n    LICENSE.md\n    README.md\n```\n\n## Examples\n\n### Linear convection\n\n1. Open `src/convect_linear.jl`\n\n2. Specify input parameters\n   \n```\n# Inputs\nnz = 101 # no. of vertical gridpoints\nnn = 30 # no. of horizontal Fourier modes (excluding zeroth mode)\na = 5 # L/D aspect ratio\nRa = 2700 # Rayleigh number\nPr = 0.5 # Prandtl number\nnt = 1e5 # no. of timesteps\nnout = 1e3 # output every nout timesteps\nzeroth = 0 # include zeroth order temperature in plot?\ninitOn = 1\nsaveDir = \"/Users/wongj/Documents/convect-out/linear/2021-09-03\"\n```\n3. Run script from terminal using `julia \u003cworking directory\u003e/convect-jl/src/convect_linear.jl` (or from julia REPL using `include(\"\u003cworking directory\u003e/convect-jl/src/convect_linear.jl\")` )\n\n4. Admire the output:\n\n![](docs/figures/linear.png)\n\n### Nonlinear convection\n\n1. Open `src/convect_nonlinear.jl`\n\n2. Specify input parameters\n   \n```\n# Inputs\nnz = 101 # no. of vertical gridpoints\nnn = 50 # no. of Fourier modes (excluding zeroth mode)\na = 3 # L/D aspect ratio\nRa = 1e6 # Rayleigh number\nPr = 0.5 # Prandtl number\ndt = 3e-6 # timestep size\nnt = 1e4 # no. of timesteps\nnout = 1e2 # save output every nout timesteps\ninitOn = 1 # initialise run, otherwise load existing data\nsaveDir = \"/Users/wongj/Documents/convect-out/2021-09-03\" # save directory\n```\n3. Run script from terminal using `julia \u003cworking directory\u003e/convect-jl/src/convect_nonlinear.jl` (or from julia REPL using `include(\"\u003cworking directory\u003e/convect-jl/src/convect_nonlinear.jl\")` )\n\n4. Postprocess and visualise the data using `julia \u003cworking directory\u003e/convect-jl/src/postprocess.jl` (or from julia REPL using `include(\"\u003cworking directory\u003e/convect-jl/src/postprocess.jl\")` ) with the following input parameters\n\n```\n# Inputs\nsaveDir = \"/Users/wongj/Documents/convect-out/2021-09-03\" # save directory\nnStart = 1\nnEnd = 500\nzeroth= 1 # plot zeroth mode?\n```\n\n5. Admire the output:\n\n![](docs/figures/video.gif)\n\n## Authors\n\n* [**Jenny Wong**](https://jnywong.github.io/) - *Institut des Sciences de la Terre*\n  \n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n:tada:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnywong%2Fconvect-jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjnywong%2Fconvect-jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnywong%2Fconvect-jl/lists"}