|
Download README.md from MurderousCoder/openfoam-blockmesh-api: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/spaces/MurderousCoder/openfoam-blockmesh-api/resolve/main/README.md
- Command line
-
hf download hf://spaces/MurderousCoder/openfoam-blockmesh-api/README.md
-
curl -L -o README.md https://huggingface.co/spaces/MurderousCoder/openfoam-blockmesh-api/resolve/main/README.md
1.52 kB
| title: OpenFOAM blockMesh API | |
| emoji: π§ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: docker | |
| app_port: 7860 | |
| # OpenFOAM blockMesh API | |
| This Space provides an API endpoint for running OpenFOAM's blockMesh utility. | |
| ## π API Endpoints | |
| ### Health Check | |
| ```bash | |
| GET /health | |
| ``` | |
| ### Run blockMesh | |
| ```bash | |
| POST /blockmesh | |
| Content-Type: application/json | |
| { | |
| "blockMeshDict": "your blockMeshDict content here" | |
| } | |
| ``` | |
| ## π Usage Example | |
| ```bash | |
| curl -X POST https://YOUR-USERNAME-openfoam-blockmesh-api.hf.space/blockmesh \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "blockMeshDict": "/*--------------------------------*- C++ -*----------------------------------*\\\nFoamFile\n{\n version 2.0;\n format ascii;\n class dictionary;\n object blockMeshDict;\n}\n..." | |
| }' | |
| ``` | |
| ## π§ Response Format | |
| ```json | |
| { | |
| "output": "blockMesh output...", | |
| "success": true, | |
| "mesh_info": { | |
| "checkMesh": "mesh statistics..." | |
| } | |
| } | |
| ``` | |
| ## βοΈ Technical Details | |
| - **OpenFOAM Version**: 11 | |
| - **Python**: 3.x | |
| - **Framework**: Flask with CORS enabled | |
| - **Port**: 7860 (Hugging Face default) | |
| ## π¦ What's Included | |
| - Full OpenFOAM 11 installation | |
| - ParaView 5.10 (for potential future visualization) | |
| - Python Flask API | |
| - Automatic mesh validation with checkMesh | |
| ## β±οΈ Execution | |
| - Maximum execution time: 30 seconds per blockMesh run | |
| - Cases are automatically cleaned up after execution | |
| ## π Security | |
| This is a public API. Do not use for sensitive or production workloads. |