{"id":16569006,"url":"https://github.com/jakobhaervig/openfoam-docker-vscode-workflow","last_synced_at":"2025-03-21T11:33:42.148Z","repository":{"id":38948037,"uuid":"384790434","full_name":"jakobhaervig/openfoam-docker-vscode-workflow","owner":"jakobhaervig","description":"This repo accompanies the openfoam-dockerfiles repo and explains how Visual Studio Code can be set up to work efficiently with OpenFOAM installed in Docker.","archived":false,"fork":false,"pushed_at":"2022-10-25T10:54:33.000Z","size":15373,"stargazers_count":32,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T06:09:06.966Z","etag":null,"topics":["computational-fluid-dynamics","containers","docker","openfoam","visual-studio-code","workflow"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakobhaervig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-10T21:01:05.000Z","updated_at":"2025-01-30T21:28:59.000Z","dependencies_parsed_at":"2023-01-19T16:47:11.618Z","dependency_job_id":null,"html_url":"https://github.com/jakobhaervig/openfoam-docker-vscode-workflow","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/jakobhaervig%2Fopenfoam-docker-vscode-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobhaervig%2Fopenfoam-docker-vscode-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobhaervig%2Fopenfoam-docker-vscode-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobhaervig%2Fopenfoam-docker-vscode-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakobhaervig","download_url":"https://codeload.github.com/jakobhaervig/openfoam-docker-vscode-workflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244135908,"owners_count":20403798,"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":["computational-fluid-dynamics","containers","docker","openfoam","visual-studio-code","workflow"],"created_at":"2024-10-11T21:12:11.548Z","updated_at":"2025-03-21T11:33:41.684Z","avatar_url":"https://github.com/jakobhaervig.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visual Studio Code workflow for OpenFOAM with Docker\nRepository describing my favourite workflow combining Visual Studio Code, OpenFOAM and Docker. Make sure to first follow the guide at [https://github.com/jakobhaervig/openfoam-dockerfiles](https://github.com/jakobhaervig/openfoam-dockerfiles) before continuing with this guide.\n\n## 1. Install Visual Studio Code\nFirst, install the text editor [Visual Studio Code](https://code.visualstudio.com).\n\n## 2. Install extensions\nIn the left panel find \"Extensions\". Search for and install the following extensions, which will help our OpenFOAM workflow:\n1. *Docker*\n2. *Dev Containers*\n3. *OpenFOAM*\n\n## 3. Associate OpenFOAM-specific files to enable syntax highlighting\n\n![](associateFileExtensions.gif)\n\n## 4. Start Docker container\nFirst, make sure Docker is running and you have a Docker image avialable with your OpenFOAM installation. I have a created a guide [github.com/jakobhaervig/openfoam-dockerfiles](https://github.com/jakobhaervig/openfoam-dockerfiles), which will guide you through the process if in doubt.\n\nUse the alias ``of`` to start a Docker container:\n\n```shell\nof\n\n```\n\nIf your alias isn't set up correctly, you can start a Docker container by the full command::\n\n```shell\ndocker container run -ti --rm -v $HOME/openfoam-data:/data -w /data openfoam:latest\n```\n\n![](startContainer.gif)\n\n## 5. Attach Visual Studio Code to the running Docker container\nAttach Visual Studio Code to the running Docker container. This enables us to access the file system within the container directly in VS Code.\n\n![](attachVSCode.gif)\n\n## 6. Open a folder to access the file system within the Docker container\nFrom within the newly opened window open a folder at root ``/`` to gain full access to the file system of the Docker container.\n\n![](openFolder.gif)\n\n## 7. Open a terminal from within the Docker container\nOpen a new terminal within the Docker container and test if OpenFOAM is sourced correctly:\n```shell\nsimpleFoam -help\n\n```\n![](terminalInContainer.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakobhaervig%2Fopenfoam-docker-vscode-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakobhaervig%2Fopenfoam-docker-vscode-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakobhaervig%2Fopenfoam-docker-vscode-workflow/lists"}