Skip to content
Back to skills

21 Environment Setup

ASecurity

Sub-skill of openfoam: 2.1 Environment Setup (+6).

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
toolsgobash

Works with

  • cli

Security analysis

A93/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill 21-environment-setup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 21 Environment Setup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 21 Environment Setup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-21-environment-setup/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-21-environment-setup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: openfoam-21-environment-setup
description: 'Sub-skill of openfoam: 2.1 Environment Setup (+6).'
version: 1.0.0
category: engineering
type: reference
scripts_exempt: true
---

# 2.1 Environment Setup (+6)

## 2.1 Environment Setup


```bash
source /usr/lib/openfoam/openfoam2312/etc/bashrc
```


## 2.2 Serial Workflow


```bash
# 1. Generate mesh
blockMesh

# 2. Check mesh quality
checkMesh
checkMesh -allTopology -allGeometry          # comprehensive

# 3. Initialize flow (optional, helps convergence)
potentialFoam -writephi

# 4. Run solver
simpleFoam > log.simpleFoam 2>&1             # steady-state
pimpleFoam > log.pimpleFoam 2>&1             # transient
interFoam > log.interFoam 2>&1               # multiphase
icoFoam > log.icoFoam 2>&1                   # laminar transient

# 5. Post-process
simpleFoam -postProcess -func yPlus -latestTime
foamToVTK -latestTime                        # export for ParaView
foamLog log.simpleFoam                       # extract residuals to logs/
```


## 2.3 Parallel Workflow


```bash
# 1. Decompose
decomposePar

# 2. Run in parallel
mpirun -np 4 simpleFoam -parallel > log.simpleFoam 2>&1

# 3. Reconstruct
reconstructPar -latestTime                   # latest time only
reconstructPar                               # all times

# 4. Cleanup processor directories (after reconstruction)
rm -rf processor*
```


## 2.4 Complex Geometry Workflow (snappyHexMesh)


```bash
surfaceFeatureExtract                        # extract feature edges from STL
blockMesh                                    # background mesh
decomposePar
mpirun -np 6 snappyHexMesh -overwrite -parallel
mpirun -np 6 potentialFoam -writephi -parallel
mpirun -np 6 simpleFoam -parallel > log.simpleFoam 2>&1
reconstructPar -latestTime
```


## 2.5 Multiphase Workflow (interFoam)


```bash
blockMesh
setFields                                    # initialize alpha field from setFieldsDict
interFoam > log.interFoam 2>&1
```


## 2.6 Solver Selection Guide


| Scenario | Solver | Algorithm |
|----------|--------|-----------|
| Steady incompressible RANS | simpleFoam | SIMPLE |
| Transient incompressible | pimpleFoam | PIMPLE |
| Transient laminar | icoFoam | PISO |
| VOF multiphase | interFoam | PIMPLE |
| Potential flow init | potentialFoam | — |
| Compressible | rhoSimpleFoam | SIMPLE |
| Buoyant convection | buoyantSimpleFoam | SIMPLE |


## 2.7 Key CLI Flags


| Flag | Purpose |
|------|---------|
| `-case <dir>` | Specify case directory |
| `-parallel` | Run in parallel (after decomposePar) |
| `-postProcess` | Execute function objects only |
| `-latestTime` | Process latest time directory only |
| `-overwrite` | Overwrite existing mesh (snappyHexMesh) |
| `-writephi` | Write flux field (potentialFoam) |
| `-dry-run` | Check setup without running |

---

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.