================================================================================
    OPENFOAM HYPERSONIC FLOW INTAKE ANALYSIS - COMPLETE GUIDE
================================================================================

PROJECT OVERVIEW
================================================================================

This repository contains a comprehensive set of hypersonic flow simulations for
intake analysis using OpenFOAM. The project includes:

  • 4 ANSYS mesh-based cases (Mach 5, 6, 7, 8 analysis)
  • 1 blockMesh-generated case for mesh creation demonstration
  • Fully automated execution with interactive master script
  • Professional CFD workflow with automated boundary condition management

SIMULATION CONFIGURATION
================================================================================

Solver:              rhoCentralFoam (compressible, hypersonic flows)
Turbulence Model:    SST k-ω (Shear Stress Transport)
Mesh Type:           ANSYS Meshing (4 cases) + blockMesh utility (1 case)

Mach Numbers:
  • blockMesh:  Mesh generation case (preliminary)
  • Mach-5:     Velocity = 793.26 m/s,  Pressure = 1228.52 Pa
  • Mach-6:     Velocity = 814.26 m/s
  • Mach-7:     Velocity = 827.76 m/s
  • Mach-8:     Velocity = 836.89 m/s

QUICK START (AUTOMATED - RECOMMENDED)
================================================================================

1. Navigate to case folder:
   $ cd case_folder

2. Run the interactive master script:
   $ ./masterall.sh

3. Select a case (a-e):
   Select a case (a-e): b
   
   Menu:
   a) blockMesh  - Mesh generation
   b) Mach-5     - Mach 5 flow analysis
   c) Mach-6     - Mach 6 flow analysis
   d) Mach-7     - Mach 7 flow analysis
   e) Mach-8     - Mach 8 flow analysis

4. The script will:
   ✓ Navigate to selected case folder
   ✓ Set executable permissions (chmod +x A*)
   ✓ Execute Allrun script
   ✓ Display execution time and status

MANUAL EXECUTION (ALTERNATIVE)
================================================================================

For manual case execution:

   $ cd case_folder/Mach-5
   $ chmod +x A*
   $ ./Allrun

WHAT HAPPENS WHEN YOU RUN ./Allrun
================================================================================

The Allrun script executes the following steps automatically:

1. restore0Dir
   └─ Copies initial conditions from 0.orig/ to 0/

2. changeDictionary -dict system/changeDictionaryDict
   └─ Automatically applies boundary condition changes
   └─ No manual file editing required!

3. decomposePar
   └─ Decomposes domain for parallel execution

4. mpirun -np N rhoCentralFoam -parallel 2>&1 | tee log.rhoCentralFoam
   └─ Runs solver in parallel
   └─ Full terminal output visible in real-time
   └─ Results saved to log.rhoCentralFoam

5. reconstructPar
   └─ Reconstructs parallel results into single solution

MESH PREPARATION (OPTIONAL - PRE-CONVERTED MESHES PROVIDED)
================================================================================

If you have ANSYS mesh files (.msh):

  $ cd Mach-5
  $ fluentMeshToFoam ansysMesh.msh

NOTE: Pre-converted polyMesh folders are already provided in constant/
directory of each case. This step is only needed if updating the mesh.

After mesh conversion, the changeDictionary step (part of Allrun) will
automatically set boundary conditions correctly - no manual editing!

FILE STRUCTURE
================================================================================

case_folder/
├── masterall.sh              # Interactive case selection script
├── README.md                 # Comprehensive technical documentation
├── readme.txt               # This file
│
├── blockMesh/
│   ├── Allrun              # Mesh generation script
│   ├── 0.orig/             # Initial fields
│   ├── constant/           # Mesh and properties
│   └── system/             # Solver configuration
│
├── Mach-5/
│   ├── Allrun              # Automated execution script
│   ├── 0.orig/             # Initial fields (velocity, pressure, k, ω, etc.)
│   ├── constant/
│   │   ├── thermophysicalProperties
│   │   ├── turbulenceProperties
│   │   └── polyMesh/       # Pre-converted ANSYS mesh
│   ├── system/
│   │   ├── blockMeshDict
│   │   ├── controlDict
│   │   ├── decomposeParDict
│   │   ├── fvSchemes
│   │   ├── fvSolution
│   │   └── changeDictionaryDict  # ← Automatic patch changes!
│   └── ansysMesh.msh       # Original ANSYS mesh file (optional)
│
├── Mach-6/                 # Same structure as Mach-5
├── Mach-7/                 # Same structure as Mach-5
└── Mach-8/                 # Same structure as Mach-5

DOMAIN DECOMPOSITION (PARALLEL EXECUTION)
================================================================================

The decomposeParDict controls parallel execution:
  • numberOfSubdomains: Number of processor cores
  • method: 'simple' or 'hierarchical'
  • Processor arrangement: Defined in simpleCoeffs

The Allrun script automatically reads numberOfSubdomains and runs:
  $ mpirun -np $nProcs rhoCentralFoam -parallel

TROUBLESHOOTING
================================================================================

Issue: "Allrun: command not found"
Solution: chmod +x Allrun

Issue: "Mesh not found"
Solution: Verify constant/polyMesh/ contains: boundary, faces, neighbour,
         owner, points (files, not folders)

Issue: Simulation diverges or crashes
Solution: Check boundary conditions are correct (changeDictionary ran)
         Verify farfield is 'symmetry', not 'wall'

Issue: Parallel execution fails
Solution: Check numberOfSubdomains in system/decomposeParDict
         Ensure value matches available CPU cores

BOUNDARY CONDITIONS SUMMARY
================================================================================

Inlet:
  Type: freestreamVelocity (fixed freestream)
  Velocity: Case-specific (793.26, 814.26, 827.76, or 836.89 m/s)
  Pressure: Fixed value at freestream condition

Outlet:
  Type: inletOutlet with waveTransmissive pressure
  Allows flow reversal with freestream values
  Compressibility correction via thermo:psi

Symmetry Boundaries:
  Type: symmetry (geometric and flow symmetry)
  Applied to upper/lower planes and farfield

Wall (Solid Surfaces):
  Velocity: noSlip (u = 0)
  Pressure: zeroGradient

Front & Back Planes:
  Type: empty (2D simulation, no z-direction variation)


================================================================================
End of readme.txt
================================================================================

