FELiCS configuration file#

FELiCS runs are controlled by a main configuration file, written in the json format.

This file defines both the parameters of the run (i.e. numerical and physical options) as well as the paths to the other FELiCS input files.

The configuration file is directly passed to FELiCS from the command line with the -f (or --file) option:

FELiCS -f <configuration_file.json>

💡 Note: The configuration file is expected to be located in the running directory of the case, and the paths to other FELiCS files are interpreted relative that directory.

File format#

The configuration file uses the JSON format.

Some important JSON rules are:

  • strings must use double quotes,

  • boolean values are written as true or false,

  • comments are not allowed,

  • trailing commas are not allowed.

For example:

{
    "Case": {
        "AnalysisMode":         "Resolvent",
        "CoordinateSystem":     "Cartesian",
        "nDim":                 2,
        "needInterpolation":    true
    }
}

FELiCS parameters#

The settings.json file is organized into 6 parameter categories.

Each category groups parameters related to one aspect of the simulation setup. Use the following links to access the parameters definition of each category:

Category

Purpose

BoundaryCondition

Path to the boundary-condition file

Case

Physical model, geometry, analysis type, mesh, and equation setup

Export

Output directory and export options

FlowInput

Mean-flow input settings

IOResolvent

Resolvent and input-output analysis settings

Numerics

Discretization and solver-related parameters

A typical configuration file will look like:

{
    "BoundaryCondition": {},
    "Case": {},
    "Export": {},
    "FlowInput": {},
    "IOResolvent": {},
    "Numerics": {}
}

Defaults and parameter handling#

FELiCS does not read arbitrary parameters from the configuration file. When a run starts, FELiCS initializes its internal dictionary of supported parameters and default values. The values provided in <your_settings>.json then overwrite these defaults.

This has two important consequences:

  • parameters omitted from <your_settings>.json keep their default value;

  • parameters that are not registered in FELiCS are ignored.

The list of supported parameters and their defaults is defined in the getAllSettingsDict() method of the FELiCS source code, in:

src/FELiCS/parameters/config.py

💡 Note for developers: When adding a new parameter to FELiCS, remember to add it to the default parameter dictionary in config.py; otherwise, it will not be read from <your_settings>.json.

FELiCS-specific formatting conventions#

Some FELiCS inputs uses additional conventions from JSON standards.

Real/complex valued numbers#

Real-valued parameters can be given as standard JSON numbers:

"Omegas": [1.0, 2.0, 5.0e-1]

However, complex-valued parameters are given as strings:

"EigenValueGuess": ["1.0+0.1j", "1.0-0.1j"]

Real and complex values can also be combined when the parameter accepts a list:

"Omegas": [1.0, "2.0+0.5j"]

Paths#

File paths are interpreted relative to the directory from which FELiCS is executed, unless absolute paths are provided.

Example#

The following example is the configuration file from tutorial 2: Modal Analysis:

{
    "BoundaryCondition": {
        "BCsFilePath":              "bc_modal.json"
    },
    "Case": {
        "AnalysisMode":             "Modal",
        "CoordinateSystem":         "Cartesian",
        "m":                        0.0,
        "MeshFilePath":             "cylinder_wake.msh",
        "MolVisc":                  0.02,
        "MolViscModel":             "Constant",
        "nDim":                     2,
        "Reaction":                 false,
        "SetOfEquations": {
            "Momentum": {
                "Equation":         "NSPrimitive",
                "Variable":         "u"
            },
            "Mass": {
                "Equation":         "Continuity",
                "Variable":         "p"
            },
            "Energy": {
                "Equation":         "None",
                "Variable":         "None"
            },
            "Species": {
                "Equation":         "None",
                "Variable":         "None"
            },
            "EquationOfState": {
                "Equation":         "None",
                "Variable":         "None"
            }
        },
        "SpeciesFilePath":          "",
        "TurbulenceModel":          "None"
    },
    "Export": {
        "ExportFolder":             "output_dir"
    },
    "FlowInput": {
        "MeanFlowFilePath":         "base_flow_for_FELiCS.fel"
    },
    "IOResolvent": {
        "ForcingBoundaryIndices":   [],
        "ForcingMode":              "Body",
        "Omegas":                   [],
        "ResponseCoeff":            []
    },
    "Numerics": {
        "EigenValueGuess":          ["0.7"],
        "nSolut":                   100,
        "PolynomialOrder": {
            "u":                    2,
            "p":                    1
        }
    }
}