Repository for the PX915 Peer-to-peer assessment, containing necessary files to run the simulation(s) and a Jupyter notebook for the UQ part.
Note: this project was done using SPARTA version 18 July 2022.
- Go to https://sjplimp.github.io//download.html and download SPARTA (under Other software).
- Extract the files, prefarably on a remote server (e.g.
hetmathsys1.scrtp.warwick.ac.uk) with ability to parallel process. - Go to
sparta/sparta-{Version date}/srcand run the commandmake mpi. This should produce thespa_mpiexecutable. This needs to be present inside whichever folder containing the input scripts for simulations. - If this does not work/ more details are needed, please visit https://sparta.github.io/doc/Section_start.html for more guidance.
- Create a folder (henceforth
nozzlein this document) withinsparta/sparta-{Version date}. - Copy the core files in this repository into the folder. These are:
a.
air.species- contains parameters for molecules that form the air mixture; e.g. molecular mass b.air.vss- contains collision parameters for different gases for the VSS model c.data.flatnz- contains the geometry used in the nozzle simulation d.flatnz.in- the input script for the simulation - Copy
spa_mpiinto the folder. - Run the simulation using the command
./spa_mpi < flatnz.in. A typical run takes 10-30 minutes.
There are many parameters in the input file required to generate a valid simulation, all detailed at the SPARTA website (https://sparta.github.io/). However, for the purposes of UQ, there are only three sections for alteration and the rest may be ignored (do not alter!). The key numbers are indicated in asterisks as follows (remove the asterisks in the actual file):
- Changing h (Channel width)
- Go to the geometry file and alter the y coordinates (third column) of the 2nd and 3rd points. This value should not exceed those for the simulation box (0.0045).
- An example row for the points should read
2 0.0000 *0.0040*.
- Changing alpha (accommodation coefficient)
- Look for the line starting
surf_collideand change the final number in the row. This value should not exceed 1 and fall below 0. - The line should read
surf_collide diffuse_423K diffuse 423.15 *1*
- Changing T (temperature)
- Look for the lines containing
mixtureandsurf_collide. - The numbers in hundreds represent the temperature - these can be altered. There should be two
mixturelines; the one with atempkeyword is the one we are after. - These lines should read:
mixture gas_in N2 vstream 0 0 0 temp *423.15* nrho 3.424e21
surf_collide diffuse_423K diffuse *423.15* 1
- Changing the output filename
It is useful to be able to save multiple output files to be processed at once as is in the UQ Jupyter notebook. To do this:
- Look for the line
fix mfr ave/time 1 10 10 c_mfr[*] mode vector file tmp.outH401 - This should be just after the comment line "After the simulation reaches steady state".
- Change the final entry in the line to your preferred file name; for example,
tmp.outT424for a temperature variation.
- Look for the line
The Jupyter notebook titled UQ - nozzle.ipynb should contain all explanations to perform the UQ.