MurderousCoder's picture
Update
2ef91ed verified
|
Raw History Blame Contribute Delete
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.