\documentclass[xcolor=table]{beamer} %\documentclass[xcolor=table, mathserif]{beamer} \usetheme{Madrid} %\usecolortheme{beaver} % \usecolortheme{spruce} \usepackage[utf8]{inputenc} \usepackage[english]{babel} %\usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{url} %\usepackage{multicol} \usepackage{enumerate} % \usepackage[table,xcdraw]{xcolor} %\usepackage{biblatex} % \usepackage{hyperref} % \hypersetup{backref = true, pagebackref = true, colorlinks= true, linkcolor = black, citecolor = black, urlcolor = black} \usepackage{color} \usepackage{fancyvrb} \usepackage{framed} \usepackage{tikz} \usetikzlibrary{trees} \usepackage{sistyle} \SIunitsep{{\;}} \SIunitspace{{\,}} \usepackage[Euler]{upgreek} \newcommand*{\micro}{\ensureupmath{\upmu}} \author[]{Youngseob Kim} \title[TP POLU1]{Travaux Pratiques POLU1} \setbeamercovered{transparent} %\setbeamertemplate{bibliography item}{\insertbiblabel} \setbeamertemplate{bibliography item}{} %\setbeamertemplate{navigation symbols}{} \institute[]{CEREA (ENPC -- EDF R\&D)} \date{23 mai 2022} %\date{\today} \subject{Modélisation de qualité de l'air} \graphicspath{{figures/}} %\newcommand{\code}[1]{\texttt{#1}} \newcommand{\code}[1]{\texttt{\color{brown}#1}} \begin{document} %%%% Cover page %%%% \begin{frame} \begin{figure}[h] \includegraphics[angle=0,width=0.08\textwidth]{enpc_logo.png} \hspace{3cm} \includegraphics[angle=0,width=0.15\textwidth]{Logo-Cerea-RVB.png} \hspace{3cm} \includegraphics[angle=0,width=0.08\textwidth]{EDF-logo-modif.png} \end{figure} \titlepage % \tiny{ % \url{http://cerea.enpc.fr/munich}\\ % \url{https://gitlab.enpc.fr/cerea/munich} % } \end{frame} %%%% \begin{frame}{Plan} \tableofcontents \end{frame} \section{Introduction} %%%%%%% \begin{frame}{Air pollution modeling} \centering \includegraphics[width=0.7\textwidth]{air_quality.png} \begin{block}{} \begin{itemize} \item Estimation of pollutants concentrations \item Governing phenomena: emissions/removals, transport, physico-chemical transformation. \end{itemize} \end{block} \end{frame} %%%%%%% \begin{frame}{Schematic representation of an air pollution modeling} \centering \includegraphics[width=0.7\textwidth]{scheme.png} \begin{block}{} \begin{itemize} \item Input data: initial/boundary conditions, meteo, emissions \item Model: transport and transformation \item Output data: concentration, deposition flux \end{itemize} \end{block} \end{frame} %%%%%%% \begin{frame}{Numerical resolution of the model} \centering \includegraphics[width=0.8\textwidth]{modeling.png} \begin{block}{} \begin{itemize} \item 3-dimensional grid cells \item Mass conservation equation \end{itemize} \end{block} \end{frame} \begin{frame}{Introduction to Polyphemus} \begin{block}{Polyphemus} \begin{itemize} \item \small Air quality moldeling system \item \small Several models from small/local scale to continental scale \item \small Multiple polluants: passive, radionuclides, gas (including ozone and NO$_x$), aerosols \end{itemize} \end{block} \begin{block}{Technical characteristics} \begin{itemize} \item \small Open-source code \item \small Main frame written with C++ (C, Fortran also used) \item \small Parallel computing implmented \item \small Post-processing with Python libraries \end{itemize} \end{block} \begin{block}{Source code} \begin{itemize} \item \small Homepage: \url{http://cerea.enpc.fr/polyphemus/} \item \small Gitlab: \url{https://gitlab.com/polyphemus} \end{itemize} \end{block} \end{frame} %%%%% \begin{frame}{Studied area for hands-on session: pollution peak during late autumn 2016} \begin{block}{\scriptsize Background} \tiny High PM$_{10}$ concentration observed, exceeding the air quality standard 50 $\micro$g m$^{-3}$ (\^Ile-de-France, 2016) \end{block} \begin{block}{} \begin{itemize} \item \scriptsize 3 simulation domains from the continental scale to the regional scale using Polair3d model of Polyphemus (Eulerian 3D chemistry-transport model) \begin{itemize} \item \scriptsize Domain 1 (Europe): 0.5$^\circ$ X 0.5$^\circ$ \item \scriptsize Domain 2 (France): 0.1$^\circ$ X 0.1$^\circ$ \item \scriptsize Domain 3 (Île-de-France): 0.02$^\circ$X 0.02$^\circ$ \end{itemize} \end{itemize} \end{block} \centering \includegraphics[width=0.4\textwidth]{domains_map.png} \includegraphics[width=0.4\textwidth]{PM10_speciation.png}\\ \end{frame} % On-line workshop using the connection to CEREA server. % %%%% % \begin{frame}[fragile]{Connection via SSH to CEREA server} % \begin{block}{Linux or Mac} % - Open Terminal application if you are on a linux system or Mac.\\ % - Type \code{ssh YourID@cerea.enpc.fr} and password % \end{block} % \begin{block}{Windows} % - Launch MobaXterm application\\ % - Type \code{ssh YourID@cerea.enpc.fr} and password % \end{block} % If your login is successful, please follow the next step % \begin{Verbatim}[fontsize=\small] % > ssh YourMachine % > mkdir /net/libre//YourID % > cd /net/libre//YourID % \end{Verbatim} % \end{frame} %%%% \begin{frame}[fragile]{Download source files and configuration files} \scriptsize{Choose Ubuntu in the booting page and login using ENPC id (\code{xxx.xxx@enpc.fr}). Download the files from POLU1 on Teams (\code{teams.microsoft.com}). Open a Terminal application. \\} \begin{block}{} Extract it and move to your working directory for this hands-on session. \begin{Verbatim}[fontsize=\scriptsize] > mv Téléchargement/tp_polu1.tar.bz2 . > tar xjvf tp_polu1.tar.bz2 > cd tp_polu1 \end{Verbatim} \end{block} \begin{block}{} Please check if you have the following sub-folders in \code{tp\_polu1}: \tikzstyle{every node}=[draw=black,thick,anchor=west] \tikzstyle{selected}=[draw=red,fill=red!30] \tikzstyle{optional}=[dashed,fill=gray!50] \begin{tikzpicture}[% grow via three points={one child at (0.5,-0.7) and two children at (0.5,-0.7) and (0.5,-1.4)}, edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.west)}] \node {tp\_polu1} child { node {\code{Polyphemus-1.11.1}: Polyphemus source files}} child { node {\code{simulation\_2016}} child { node {\code{config}: configurations files}} child { node {\code{data}: input data files}} } child [missing] {} child [missing] {} child { node {\code{utils}: useful scripts}}; \end{tikzpicture} \end{block} \end{frame} %%% \begin{frame}[fragile]{Input and output files} \begin{block}{Input data} % You need to download and extract the archive % \code{data.tar.bz2} in your working directory. % Download from \code{\url{https://cerea.enpc.fr/tp_polu1}} \begin{Verbatim}[fontsize=\small] > cd simulation_2016 > ls data emissions: emissions data ground: geographical data ic: initial condition meteo: meteorological data photolysis: photolysis rate \end{Verbatim} \end{block} \begin{block}{Make a folder to save results data} \begin{Verbatim}[fontsize=\small] > mkdir results \end{Verbatim} \end{block} \end{frame} %%%% \section{Processing} \begin{frame}[fragile]{Compile \textbf{Polair3d}} It is compiled by typing \code{scons}. \begin{Verbatim}[fontsize=\small] > cd ../Polyphemus-1.11.1/processing/scram-soap > scons mpi=yes \end{Verbatim} Check if the executable \code{polair3d-scram-soap-cb05} has been generated \begin{Verbatim}[fontsize=\small] > ls polair3d-scram-soap-cb05 \end{Verbatim} \end{frame} %%%% \begin{frame}[fragile]{Configuration files} Move to \code{config} directory to check Configuration files \begin{verbatim} > cd ../../../simulation_2016/config \end{verbatim} \begin{block}{Prepare the configuration files} Three configuration files \begin{itemize} \item \code{polair3d.cfg}: main configuration file (informations on the options of the simulation \item \code{polair3d-data.cfg}: configuration file to describe input data files \item \code{polair3d-saver.cfg}: parameters to save output results \end{itemize} Three input data files \begin{itemize} \item \code{levels.dat}: list of vertical levels \item \code{species\_cb05.dat}: list of chemical species \end{itemize} \end{block} \end{frame} %%%%%%%%%%%%%%% %%%% \begin{frame}[fragile]{Configuration files} \begin{block}{\code{polair3d.cfg}} \begin{Verbatim}[fontsize=\scriptsize] [domain] Date_min = 20161130+00-00 Delta_t = 600. Nt = 48 x_min = 1.2 Delta_x = 0.02 Nx = 115 y_min = 47.9 Delta_y = 0.02 Ny = 110 Nz = 14 Vertical_levels: levels.dat # Species list and associated data. Species: species_cb05.dat Bin_bounds: 0.01 0.0398 0.1585 1.0 2.5119 10. \end{Verbatim} \end{block} \begin{block}{\code{Bin\_bounds}: particle size distribution} In this simulation, there are 5 aerosol size bins (0 to 4). \\ Size bin 0: particle with a diameter between 0.01 $\micro$m and 0.0398 $\micro$m \end{block} \end{frame} %%%% \begin{frame}[fragile]{Configuration files} \begin{block}{} Please make sure that all paths in the configuration files are correct. In particular, \code{Directory\_data} in \code{polair3d-data.cfg} should point to the input data files. \end{block} \begin{verbatim} Directory_data: ../data/ \end{verbatim} \begin{block}{} And \code{Result\_dir} in \code{polair3d-saver.cfg} should be checked. Default folder is \code{../results}. \end{block} \begin{verbatim} Result_dir: ../results/ \end{verbatim} \vspace{-15pt} \end{frame} \begin{frame}[fragile]{Gas-phase chemical species} To open \code{species\_cb05.dat} \begin{verbatim} > vi species_cb05.dat \end{verbatim} \begin{Verbatim}[fontsize=\tiny] [species] HC8 NH3 HCL O1D ETOH CH4 ETHA TOL XYL SO2 . . O OH NO3 ALD2 O3 CXO3 XO2 C2O3 NO NO2 HO2 \end{Verbatim} \begin{block}{NO$_x$} \begin{itemize} \item \small Nitric oxide: \code{NO} \item \small Nitrogen dioxide: \code{NO2} \end{itemize} \end{block} \begin{block}{Photochemical oxidants} \begin{itemize} \item \small Ozone: \code{O3} \item \small (Day-time) Hydroxyl radical: \code{OH} \item \small (Night-time) Nitrate radical: \code{NO3} \end{itemize} \end{block} \end{frame} %%%%%%%%%%% \begin{frame}[fragile]{Particle species} \begin{Verbatim}[fontsize=\scriptsize] [aerosol_species] # Water must be the last species. PMD PBC PNA PSO4 PNH4 PNO3 PHCL PBiA2D PBiA1D PBiA0D PAGLY PAMGLY PBiMT PBiPER PBiDER PBiMGA PAnBlP PAnBmP PBiBlP PBiBmP PBiNGA PBiNIT3 PBiNIT PAnClP PSOAlP PSOAmP PSOAhP PPOAlP PPOAmP PPOAhP PH2O \end{Verbatim} \begin{block}{} \begin{itemize} \item \small Dust: \code{PMD} \item \small Black carbon: \code{PBC} \item \small Secondary inorgainc aerosols: sulfate (\code{PSO4}), nitrate (\code{PNO3}), ammonium (\code{PNH4}) \item \small Organic aerosols: see Table \item \small Others \end{itemize} \end{block} type \code{:q} to exit \code{vi} \end{frame} %%%%% \begin{frame}[fragile]{Particle species} \centering \includegraphics[width=0.8\textwidth]{surrogate.png} \begin{block}{} \begin{itemize} \item \small Anthropogenic organic aerosols: primary SVOC and aromatics \item \small Biogenic organic aerosols: isoprene, monoterpenes, sesquiterpenes \end{itemize} \end{block} \end{frame} %%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%% Frame \begin{frame}[fragile]{Launch a simulation} \begin{block}{} \scriptsize Check your current directory is \code{\$HOME/tp\_polu1/simulation\_2016/config/} \begin{Verbatim}[fontsize=\scriptsize] > pwd \end{Verbatim} Check if a link to the compiled program is generated. \begin{Verbatim}[fontsize=\scriptsize] > ls polair3d-scram-soap-cb05 \end{Verbatim} If there is no link, you can make it. \begin{Verbatim}[fontsize=\scriptsize] > ln -s ../../Polyphemus-1.11.1/processing/scram-soap/polair3d-scram-soap-cb05 \end{Verbatim} Finally, you can launch a simulation (parallel computing using 8 cores). \begin{Verbatim}[fontsize=\scriptsize] > mpirun -n 8 polair3d-scram-soap-cb05 polair3d.cfg \end{Verbatim} \end{block} \begin{Verbatim}[fontsize=\scriptsize] . . . Module: SOA computation approach:equilibrium Module: without sea salt in isorropia Performing iteration #0 Current date: 2016-11-30 00:00 Performing iteration #1 Current date: 2016-11-30 00:10 Performing iteration #2 Current date: 2016-11-30 00:20 \end{Verbatim} \end{frame} \section{Post-processing} \begin{frame}[fragile]{Post-processing program: disp.py} \begin{block}{} This script \code{disp.py} is used to display concentrations of a species. \end{block} \begin{Verbatim}[fontsize=\scriptsize] > cd ../../utils/atmopy/talos > scons extract_configuration > cd ../.. > vi disp.cfg \end{Verbatim} \begin{block}{} Please make sure that \code{Directory1} in \code{disp.cfg} should point to the results folder. \code{Species} is followed by the species name. \end{block} To close, type \code{:wq} \begin{Verbatim}[fontsize=\scriptsize] > python disp.py disp.cfg \end{Verbatim} \begin{Verbatim}[fontsize=\scriptsize] O3 mean concentration: 29.52510071289041 O3 max concentration: 58.29098129272461 O3 min concentration: 4.253175706048738e-14 \end{Verbatim} \begin{block}{} Visualize the results for O3 and NO2 species. PNG-format figures are automatically generated in \code{figures} folder. \begin{verbatim} > eog figures/O3_20161130_05.png \end{verbatim} \end{block} \end{frame} %%%%%%%%%%% %%%%%% \begin{frame}[fragile]{Simulation results: ozone concentrations} \begin{figure} \centering \vspace{-0.3cm} \includegraphics[width=0.45\textwidth]{O3_20161130_05.png} \includegraphics[width=0.45\textwidth]{O3_20161130_09.png}\\ \vspace{-0.4cm} \includegraphics[width=0.45\textwidth]{O3_20161130_13.png} \includegraphics[width=0.45\textwidth]{O3_20161130_17.png} \end{figure} \end{frame} %%%%%%%%%%% \begin{frame}[fragile]{Concentrations of particle species} \begin{block}{Particulate Matter: composition} \begin{itemize} \item \small Dust: \code{PMD\_X.bin} \item \small Black carbon: \code{PBC\_X.bin} \item \small Secondary inorgainc aerosols: sulfate (\code{PSO4\_X.bin}), nitrate (\code{PNO3\_X.bin}), ammonium (\code{PNH4\_X.bin}) \end{itemize} \end{block} Total mass for a particle species is a sum of all size bins. For dust, the total mass of \code{PMD} is \code{PMD\_0 + PMD\_1 + PMD\_2 + PMD\_3 + PMD\_4} \begin{block}{Regulated Particulate Matter: by size} \begin{itemize} \item \small PM$_{10}$ (diameter less than 10 $\micro$m) \item \small Fine particles: PM$_{2.5}$ (diameter less than 2.5 $\micro$m) \end{itemize} \end{block} \end{frame} %%%%% \begin{frame}[fragile]{Post-processing program: MakePM.py} Check the path in \code{MakePM.cfg} \begin{block}{} \begin{Verbatim}[fontsize=\scriptsize] InputDirectory = ../simulation_2016/results/ output_species = PM2.5 PM10 \end{Verbatim} \end{block} Edit \code{MakePM.cfg} in \code{vi}\\ press the key \code{i} to begin editing.\\ press the key \code{Ctrl + c} to stop editing.\\ type \code{:wq} to save changes and exit \code{vi} \begin{verbatim} > python MakePM.py MakePM.cfg > cd ../simulation_2016/results > ls PM* \end{verbatim} Check if you have new files including \code{PM10.bin} and \code{PM2.5.bin} \end{frame} %%%%%% \begin{frame}[fragile]{Visualize PM$_{10}$ concentrations using \code{disp.py}} \scriptsize \begin{Verbatim}[fontsize=\scriptsize] > python disp.py disp.cfg \end{Verbatim} \begin{figure} \centering \vspace{-0.3cm} \includegraphics[width=0.45\textwidth]{PM10_20161130_05.png} \includegraphics[width=0.45\textwidth]{PM10_20161130_09.png}\\ \vspace{-0.4cm} \includegraphics[width=0.45\textwidth]{PM10_20161130_13.png} \includegraphics[width=0.45\textwidth]{PM10_20161130_17.png} \end{figure} \end{frame} %%%%% \begin{frame}[fragile]{Exercise 1: Computed concentrations} 1. Compute the concentration of the following species using \code{disp.py}. \begin{block}{Concentrations of pollutants (in $\micro$g m$^{-3}$)} \begin{itemize} \item \small Ozone, NO$_x$, OH \item \small PM$_{10}$, PM$_{2.5}$ \end{itemize} \end{block} \begin{block}{Chemical composition of PM$_{10}$ (in $\micro$g m$^{-3}$)} \begin{itemize} \item \small Dust, Black carbon \item \small Secondary inorgainc aerosols (sulfate, nitrate, ammonium): \item \small Total anthropogenic organic aerosols: \item \small Total biogenic organic aerosols: \end{itemize} \end{block} 2. Which chemical species are dominating in PM$_{10}$ concentration in Paris and what would you suggest to reduce PM$_{10}$ concentration in Paris ? \end{frame} \section{Scenario for an emission reduction} %%%%%%%%%%%%%%%%%%%%%%%% Frame \begin{frame}[fragile]{Scenario for an emission reduction} \begin{block}{Background} European emission standards for exhaust emissions of new vehicles changed from Euro 5 to Euro 6 in 2014. Standards for NO$_x$ emission have reduced by 45\% for diesel vehicles. \end{block} \begin{block}{Correction on NOx emissions} \begin{Verbatim}[fontsize=\scriptsize] > cp ../Polyphemus-1.11.1/utils/ > scons mult_nb_float > cd ../../simulation_2016 > mkdir data_modif > cd data_modif > ln -s ../../Polyphemus-1.11.1/utils/mult_nb_float > ./mult_nb_float ../data/emissions/surface-emissions/NO.bin 0.45 NO.bin > ./mult_nb_float ../data/emissions/surface-emissions/NO2.bin 0.45 NO2.bin \end{Verbatim} \end{block} \end{frame} % %%%%%%%%%%%%%%%%%%%%%%%% Frame \begin{frame}[fragile]{Configuration file} \begin{Verbatim}[fontsize=\scriptsize] > cd .. > cp -rf config config_sim2 > cd config_sim2 > vi polair3d-data.cfg \end{Verbatim} % {\scriptsize % Edit \code{polair3d-data.cfg} using \code{vi}\\ % press the key \code{i} to begin editing.\\ % press the key \code{Ctrl + c} to stop editing.\\ % type \code{:wq} to save changes and exit \code{vi} % } \begin{block}{NO and NO2 emission files are changed in polair3d-data.cfg} \begin{Verbatim}[fontsize=\scriptsize] [surface_emission] Date_min: 2016-11-25 Delta_t = 3600. Fields: ALD2 CH4 ETHA IOLE MEOH SO2 XYL ALDX CO ETOH HC8 ISOP NH3 OLE TERP ETH FORM HONO PAR TOL API LIM SULF POAhP POAlP POAmP Filename: /emissions/surface-emissions/&f.bin NO: ../data_modif/NO.bin NO2: ../data_modif/NO2.bin \end{Verbatim} \end{block} Remove NO and NO2 from ''Fields'' to use the new ones instead of the old ones. \end{frame} % %%%%%%%%%%%%%%%%%%%%%%%% Frame \begin{frame}[fragile]{Configuration file} 1. Open \code{polair3d-saver.cfg} using \code{vi} application \begin{Verbatim}[fontsize=\scriptsize] > vi polair3d-saver.cfg \end{Verbatim} 2. Edit \code{polair3d-saver.cfg} in \code{vi}\\ press the key \code{i} to begin editing.\\ press the key \code{Ctrl + c} to stop editing.\\ type \code{:wq} to save changes and exit \code{vi} \begin{block}{Modification in polair3d-saver.cfg} \begin{Verbatim}[fontsize=\scriptsize] Result_dir: ../results_sim2/ \end{Verbatim} \end{block} \begin{Verbatim}[fontsize=\scriptsize] > cd .. > mkdir results_sim2 \end{Verbatim} \end{frame} %%%%% \begin{frame}[fragile]{Launch a simulation and run again MakePM.py} To launch a simulation, \begin{Verbatim}[fontsize=\scriptsize] > cd config_sim2 > mpirun -n 12 polair3d-scram-soap-cb05 polair3d.cfg \end{Verbatim} Post-processing program \code{MakePM.py} \begin{verbatim} > cd ../../utils/ \end{verbatim} Edit \code{MakePM.cfg} in \code{vi}\\ press the key \code{i} to begin editing.\\ \begin{block} \code{InputDirectory = ../simulation\_2016/results\_sim2/} \end{block} press the key \code{Ctrl + c} to stop editing.\\ type \code{:wq} to save changes and exit \code{vi} \begin{verbatim} > python MakePM.py MakePM.cfg \end{verbatim} \end{frame} %%%%% \begin{frame}[fragile]{Post-processing program: disp\_diff.py} Check \code{disp\_diff.cfg} in \code{vi}\\ \begin{verbatim} Species: O3 ModelName1: Reference Directory1: ../simulation_2016/results/ ModelName2: Emission_reduction Directory2: ../simulation_2016/results_sim2/ \end{verbatim} \begin{verbatim} > python disp_diff.py disp_diff.cfg \end{verbatim} \begin{block}{Exercise 2} Compare differences between the simulation results and explain why the ozone and nitrate concentration are changed in the second simulation. \end{block} \end{frame} % %%%% % \begin{frame}[allowframebreaks] % \frametitle{References} % %\nocite{*} % \bibliographystyle{apalike} % {\tiny % \bibliography{munich-ref} % %\printbibliography % } % \end{frame} \end{document}