Week 9 - Senstivity Analysis Assignment
Sensitivity Analysis:
For a set of chemical equations determining the effect of uncertainties in parameters and initial conditions on the solution of a set of ordinary differential equations is known as a sensitivity analysis.
Because there are a number of reactions (both intermediate reactions and final reactions) occurring for a given chemical reaction or combustion, the ignition delay varies.
The cause of variation in ignition delay is primarily associated with the sensitivity of these intermediate reactions.
Hence, for obtaining a refined chemical reaction the reaction mechanism has to be tuned to fulfil the given criteria for the fuel under consideration.
Since the number of intermediate reactions can vary anywhere between 100-1000s nitpicking an intermediate reaction for tuning becomes a laborious task when done manually.
To ease this process sensitivity analysis is performed and top `n` reactions are picked for tuning.
Sensitivity analysis can be deterministic or stochastic in nature. Using first-order elementary sensitivities to analyse the system-wide sensitivity is a form of deterministic sensitivity analysis.
This process is often referred to as local sensitivity analysis also.
In this process effect of small input, the parameter is evaluated against all the reactions. While this provides the effect of small perturbation caused by the input parameter, it fails to indicates the effect of simultaneous, large variations in all parameters on each species concentration.
Analysis done to include all such simultaneous, large variations caused due to any small variation in input parameter is termed as a global sensitivity analysis.
Example of such global sensitivity analysis includes brute force method where a single parameter value is changed to observe time history of species involved.
The code attached here performs a similar global sensitivity analysis on a GRI3.0 mechanism.
Coding Approach:
- Using
Canterapython library objects ofSolutionclass andIdealGasConstPressureReactorwere created. - The
IdealGasConstPressureReactoris a homogeneous, constant pressure, zero-dimensional reactor for ideal gas mixtures. - In this type, the volume of the reactor changes as a function of time in order to keep the pressure constant.
- A single object of such a reactor type was fed to a
ReactorNetsystem to create a 1D Reactor Net. - Furthermore, relative error tolerance for integrating the reactor equations and relative error tolerance for sensitivity analysis was set up.
- For storing the state of gas during the reactor simulation a
SolutionArraywas also used. nno of reactions was taken as user input to display topnand bottomnsensitive reaction.- The solution is finally advanced in time and sensitivity of the parameter fed by the user is recorded for all the equations that take place.
- Finally, the given
nreactions are sorted based upon user input and are also plotted using a bar plot. - The values of all such sensitivities are also stored in form of CSV.
From the graph, we can see that the reactions which are sensitive to a given parameter(for e.g. OH) may or may not be sensitive for any other given parameter like temperature.