Solution Overrides

Christian Kongsgaard
2021-03-01

Solution Overrides
Solution Overrides

Solution overrides is an easy way for applying case-wide adjustments to the simulation case you are running.

The override input on the CFD Solution component accepts the following keys:

{
  "fields": [],
  "caseFiles": [],
  "presets": [],
  "setup": []
}

Each of the four keys (fields, caseFiles, presets, setup) is a list overrides. Below in this article is an explanation of how to use each of the override keys.

Fields

This defines overrides that will be applied to the "fields" definition of your case. The fields dictionary defines which fields will be used (the files in the 0 folder). Applying overrides here allows you to define additional fields for the simulation.

A field will look like this:

{
  "U": {
    "classType": "volVectorField",
    "dimensions": [
      0,
      1,
      -1,
      0,
      0,
      0,
      0
    ],
    "internalField": "uniform (0 0 0)"
  }
}

Case Files

This override will override settings within case files. The case file that you specify will be created if it does not exist. Note that we use a > to define path separators (not a slash /) this is because the backend data structure does not support slashes in a dictionary key.

A case file override looks like this:

{
  "folder>file": {
    "testKey": "value"
  }
}

If you for example wanted override the relaxation factors, an override could look like this:

{
  "system>fvSolution": {
    "relaxationFactors": {
      "fields": {
        "p": 0.3
      }
    }
  }
}

Setup

This override will be run BEFORE setting up from template files. The setup makes adjustments (mostly removeIn) to files that have been inherited from below. This is required because the basic merging of inherited templates does not handle removeIn operations nicely (nested dictionaries cannot be wiped and re-created). But with setup they can.

Presets

This override lets you adjust presets globally, for example if you wanted to update a boundary condition preset, then you would do it with the presest override.

Useful links

Convergence Criteria

By default, our presets doesn't include any convergence criteria. They can however be applied through the caseFiles override. To see the format for convergence criteria go to OpenFOAM's documentation

Relaxation Factors

The syntax for relaxation factors can be found here:



Are you ready to start you journey with Compute?

Sign Up