1.8. OpenFOAM and pyFoam

pyFoam was created by Bernhard F.W. Gschaider.

I am using pyFoam version 0.6.6.

1.8.1. Training Materials

The materials in the list below were created by Bernhard F.W. Gschaider.

This page is based on his training material (anything before 0.6.0 is categorised as “history”):

1.8.2. pyFoam Commands

Command

Meaning

$ pyFoamClearCase.py <caseDirectory>

Removes all timesteps but the first from a case-directory. Also removes other data that is generated by sovers/utilities/PyFoam

CourantNumber
{
expr "Courant Number mean: (%f%) max: (%f%)";
name Custom01_Courant_Number;
theTitle "Custom 1 - Courant Number";
titles
(
    min
    max
);
type regular;
}

customRegex file (put in case directory) to measure Courant Number

$ blockMesh -case damBreak
$ setFields -case damBreak
$ pyFoamPlotRunner.py --clear interFoam -case damBreak

Runs blockMesh and setFields, removes all timesteps, solver is interFoam, case directory is damBreak logfile PyFoamRunner.interFoam.logfile is found in the case directory