How to use pyFoam to parameterize OpenFOAM schemes using aliases

The definition of OpenFOAM schemes in configuration dictionaries can contain a variable number of parameters. Alias names can be used in order to parameterize the case with different schemes.

Step-by-step guide

  1. Define aliases for used schemes either within a dictionary file, or a separate file that is to be included by an OpenFOAM dictionary.

    Linear Gauss linear;
    PLSQ   pointCellsLeastSquares;
    
  2. Parameterize the case using the aliases, by adding the parameter vector to the parameter file

     gradScheme (Linear PLSQ);
    
  3. Use the pyFoam templates to refer to the aliases inside the appropriate configuration dictionary:

    #include "../path/to/alias/file" 
    
    grad(U) |-gradScheme-|
    

An example cavity case is available at the SFB 1194/Z-Inf example repository and the README.md has a description of this how-to for the cavity case.

See also