Skip to content

Draft: Initial implementation of a driver to automatically run a Monte Carlo Ensemble Run for a single parameter

Issue/feature addressed

This is an initial implementation of functionality to enable the running of a Monte Carlo Ensemble Run, varying a single parameter.

Proposed solution

The proposed solution is to use a driver - similar in principle to the Arnaldi drivers - that generates a series of randomised values for a chosen parameter following a chosen distribution (currently, the uniform and normal distributions are available), and that runs the set of simulations with each of the randomised values set for the chosen parameter automatically. The randomisation is conducted by taking each random sample across the entire distribution specified. The .fld files and any files created by filters should be re-named to specify which iteration number these correspond to, and an additional .in file should be created specifying the input value at each iteration.

Implementation

  • A new base driver class has been created, DriverUQ1D. This base class is implemented to be used for any methods common between different 1-dimensional Uncertainty Quantification implementations (such as the method specified here). This includes the initialisation process, the solve process for an individual iteration, a function to write out a 1-D array of values out to a file, and a function corresponding to the console output with specific information relating to the 1-D UQ process.
  • A new Driver1DMCEnsemble class has also been created. This class contains the functions specific to the Monte Carlo Ensemble run process.
  • Working with @ccantwel, the SetParameter methods of the SessionReader class have been updated to update the parameter of the interpreter in the SessionReader instance in addition to updating the parameter map.
  • A new Output method has been added to the EquationSystem class that allows for the specification of a custom filename to be used when creating the new output file.

Tests

Suggested reviewers

Notes

In order to use the driver implemented, the following parameters and solverinfo properties must be set in the session file:

  1. The "Driver" solverinfo property must be added to the case being run with a value of "1DMCEnsemble".
  2. The "1DUQProbabilityDistribution" solverinfo property must be added with a value of either "Uniform" or "Normal".
  3. If using a uniform distribution, the "1DUQLowerBound" and "1DUQUpperBound" parameters must be added with the bounds of the distribution, or, if using a normal distribution, the "1DUQMean" and "1DUQStandardDeviation" parameters must be added.
  4. The "1UQSampleNum" parameter must be added with the chosen number of simulations to be run.
  5. The "1DUQParameterUnderTest" solverinfo property must be added with a value specifying the parameter to be varied.

Checklist

  • Functions and classes, or changes to them, are documented.
  • User guide/documentation is updated.
  • Changelog is updated.
  • Suitable tests added for new functionality.
  • Contributed code is correctly formatted. (See the contributing guidelines).
  • License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).

Merge request reports

Loading