You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scripts to run and plot the outputs of this example are located at: `$TCHEM_INSTALL_PATH/examples/runs/atmospheric_chemistry/Simpol`. The bash script to run this case is shown below:
Here, the `TChem_AerosolChemistry.x` executable is a box model that integrates (in time) a list of species using the mechanism file specified in the `chemfile` and aerosol species specified in the `aerofile`.
28
+
29
+
TChem-atm provides executables for CVODE, `$TCHEM_INSTALL_PATH/examples/TChem_AerosolChemistry_CVODE.x`, and Kokkos-Kernels, $`TCHEM_INSTALL_PATH/examples/TChem_AerosolChemistry_KokkosKernels.x`.
30
+
31
+
The time profiles for ethanol and its aqueous solution are depicted in the figures below. These profiles were generated using TChem-atm, employing ODE solvers such as Tines, Kokkos-kernels (BDF), and Sundials (CVODE). For the purpose of code-to-code verification, we additionally showcase profiles derived from CAMP.
32
+
33
+

34
+
35
+
36
+

Copy file name to clipboardExpand all lines: docs/index.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# **Overview**
2
2
3
-
Tchem-atm is a chemistry solver for problems in atmospheric chemistry.
3
+
TChem-atm is a chemistry solver for problems in atmospheric chemistry.
4
4
TChem-atm computes source terms and Jacobian matrices for chemical systems. It is a performance-portable software toolkit designed for complex kinetic mechanisms.
5
5
6
6
Software Design:
@@ -9,16 +9,15 @@ Software Design:
9
9
*[Kokkos](https://github.com/kokkos/kokkos.git) programming model for performance portability.
10
10
* CMake build system.
11
11
* Numerical and SACADO analytic Jacobian calculations for all models.
12
-
* Coupling to external ODE solvers, e.g., [Tines](https://github.com/sandialabs/Tines), [Sundials](https://computing.llnl.gov/projects/sundials) (CVODE).
* Online documentation deployed with GitHub Actions.
16
+
* Docker support.
13
17
14
18

15
19
16
-
TChem-atm is configured using a YAML input file to construct the internal representation of the kinetic model, containing relevant parameters for the computation of chemical source terms.
17
-
It computes reaction constants and rates of progress for all reactions and calculates the net production rate, or source terms, for all chemical species.
18
-
TChem-atm automatically calculates the Jacobian matrix for source terms using either finite differences (numerical Jacobian) or automatic differentiation (analytical Jacobian via SACADO).
19
-
Furthermore, the computation of the source term and associated Jacobian is independent of the time integration solver in TChem-atm.
20
-
As such, TChem-atm provides an interface for time-stepping solutions (Box model) for the Tines and CVODE libraries.
21
-
Finally, TChem-atm features a batched interface for all of the above calculations.
20
+
TChem-atm is configured using a YAML input file to construct the internal representation of the kinetic model, containing relevant parameters for the computation of chemical source terms. It computes reaction constants and rates of progress for all reactions and calculates the net production rate, or source terms, for all chemical species. Furthermore, it provides an interface for gas-aerosol interactions that allows coupling with aerosol models. TChem-atm automatically calculates the Jacobian matrix for source terms using either finite differences (numerical Jacobian) or automatic differentiation (analytical Jacobian via SACADO). Furthermore, the computation of the source term and associated Jacobian is independent of the time integration solver in TChem-atm. As such, TChem-atm provides an interface for time-stepping solutions (Box model) for the Tines, CVODE, and Kokkos-kernels libraries. Finally, TChem-atm features a batched interface for all of the above calculations.
Copy file name to clipboardExpand all lines: docs/input.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,24 @@ species:
50
50
51
51
A description of the reaction types currently implemented in TChem-atm is presented in [Methodology section](methodology.md). In addition, a set of examples of input files is presented under `/src/examples/runs/atmopheric_chemistry`.
52
52
53
+
## **Gas-Aerosol Chemistry Input File**
54
+
55
+
To execute a gas-aerosol case in TChem-atm, one needs an input file with the aerosol mechanisms, `aerofile`, and a file where scenario particle information is given, `inputfile_particles`. The aerosol mechanism utilizes a YAML file and follows to the [CAMP format](https://github.com/open-atmos/camp). The scenario particle information follows this format:
56
+
57
+
```yaml
58
+
particles:
59
+
initial_state:
60
+
species_name_1:
61
+
initial_value: [1.0e-8]
62
+
species_name_2:
63
+
initial_value: [1.4e-2]
64
+
num_concentration:
65
+
initial_value: [1.3e6]
66
+
67
+
```
68
+
In this structure, `species_name_1` denotes the initial concentration of species 1 within a single particle. It's important to note that the initial composition for species 1 is consistent across all particles.
69
+
70
+
Additionally, to incorporate gas-phase reactions into the simulation, a gas reaction mechanism can be seamlessly integrated into the gas-aerosol case.
These third-party libraries are submodules in TChem-atm.
20
21
Thus, we can initialize them (i.e., download and update) using the following command:
@@ -39,27 +40,43 @@ To build/install with CUDA `ON` or `OFF`, use the flag:
39
40
CUDA="ON"# Set to ON/OFF to compile TChem-atm with or without NVIDIA-GPUs support.
40
41
```
41
42
42
-
Additionally, specify the root directory for installing/building the third-party libraries:
43
+
To build/install with HIP `ON` or `OFF`, use the flag:
43
44
44
45
```bash
45
-
ROOT=/path/to/tchem-atm/.
46
+
HIP="ON"# Set to ON/OFF to compile TChem-atm with or without AMD-GPUs support.
46
47
```
47
48
48
-
This script initializes the submodules and installs/builds the third-party libraries in the `$ROOT/HOST` or `$ROOT/DEVICE` directory, depending on whether `CUDA=OFF` or `CUDA=ON` is chosen.
49
-
Since Kokkos can be installed/built with both CUDA `ON` or `OFF`, this script installs it in both `$ROOT/HOST` and `$ROOT/DEVICE`, while the other libraries are installed in `$ROOT/HOST`. Therefore, one must run this script using `CUDA=OFF` to install all third-party libraries and run it a second time with `CUDA=ON` if an NVIDIA GPU is available.
49
+
Note that both CUDA and HIP cannot be enabled simultaneously.
50
50
51
-
## **Building and installing TChem-atm and Tines**
52
-
The script `scripts/build_script.sh` builds and installs TChem-atm and Tines. Similarly to the script for third-party libraries, in `scripts/build_script.sh`, one must provide the same compiler information and CUDA flag.
51
+
To enable OpenMP.
53
52
54
-
<!-- ```bash
55
-
MY_CC=gcc # C++ compiler
56
-
MY_CXX=g++ # C++ compiler
57
-
MY_FC=gfortran # Fortran compiler
53
+
```bash
54
+
OPENMP="ON"
55
+
```
56
+
57
+
The following path specifies the location of the TChem-atm source code.
58
+
59
+
```bash
60
+
TCHEM_REPOSITORY_PATH=/path/to/tchem-atm/.
58
61
```
59
-
To build/install with CUDA ON (or OFF), use:
60
62
61
-
`CUDA="ON" # Set to ON/OFF to compile TChem with NVIDIA-GPUs` -->
63
+
Determine whether to install OpenBLAS using this script.
64
+
```bash
65
+
INSTALL_OPENBLAS="ON"
66
+
```
67
+
68
+
This script initializes submodules and manages the installation/building of third-party libraries within the `$PWD/HOST`, `$PWD/CUDA`, or `$PWD/HIP` directories, based on the selected settings: `CUDA/HIP=OFF`, `CUDA=ON`, or `HIP=ON`. Given that Kokkos and Kokkos-kernels support installation/building with both `CUDA` and `HIP` enabled (`ON`) or disabled (`OFF`), the script ensures their deployment in both `$PWD/HOST` and the relevant GPU-specific directories (`$PWD/CUDA` or `$PWD/HIP`). Other libraries, however, are exclusively installed in `$PWD/HOST`. To accommodate all third-party libraries, execute this script initially with `CUDA=OFF`. For systems equipped with NVIDIA or AMD GPUs, a subsequent run with CUDA=`ON` or `HIP=ON`, respectively, is necessary to leverage GPU-specific installations.
69
+
70
+
71
+
## **Building and installing TChem-atm and Tines**
72
+
73
+
The script `scripts/build_script.sh` builds and installs TChem-atm and Tines. Similarly to the script for third-party libraries, in `scripts/build_script.sh`, one must provide the same compiler information and CUDA/HIP flag.
62
74
63
75
In addition, this script adds the option to turn `SACADO="ON"` or `SACADO="OFF"` to enable or disable the SACADO library's automatic differentiation capability.
64
76
65
-
The installation path for the third-party libraries is specified by `INSTALL_BASE_HOST`, and `ROOT=/path/to/tchem-atm` is where TChem-atm and Tines are installed. If CUDA is `ON`, libraries will be installed in the `ROOT/DEVICE` directory. Otherwise, they will be installed in the `ROOT/HOST` directory.
77
+
If OpenBLAS is included as part of a module; `USE_THIS_OPENBLAS="MODULE"`.
78
+
79
+
The installation path for the third-party libraries is specified by `INSTALL_BASE_HOST`, and `ROOT=/path/to/tchem-atm` is where TChem-atm and Tines are installed. If CUDA is `ON`, libraries will be installed in the `ROOT/CUDA` directory. If HIP is `ON`, libraries will be installed in the `ROOT/HIP` directory. Otherwise, they will be installed in the `ROOT/HOST` directory.
80
+
81
+
Finally, To select the build type `BUILD_TYPE`, choose either `DEBUG` or `RELEASE`.
Copy file name to clipboardExpand all lines: docs/methodology.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,14 @@ where $N_{\text{spec}}$ is the number of species, ${k_f}_i$ is the reaction cons
34
34
35
35
<!-- Note that in $\eee{}$`s CAMPP solver, only forward reaction calculations are employed, and the single reaction constant values depend on the type of reaction. -->
36
36
37
+
## **Aerosol-Gas interations**
38
+
39
+
TChem-atm facilitates the construction of source terms (or RHS) for gas-aerosol cases. In these cases, the RHS is constructed as follows:
40
+
41
+

42
+
43
+
Where, the first part of the RHS corresponds to the concentration of gas species. Then, the concentration of each particle is appended. Currently, TChem-atm supports the [SIMPOL mass transfer](methodology.md#simpol-mass-transfer).
44
+
37
45
## **Reaction Types**
38
46
39
47
Currently, TChem-atm can reproduce gas chemistry for two complex reaction mechanisms: the gas chemistry of $\eee{}$ v3, i.e., the UCI chemistry system (University of California Irvine), and the Carbon Bond 2005 chemical mechanism, which is well-formulated for urban to remote tropospheric conditions ([Dawson](https://gmd.copernicus.org/articles/15/3663/2022/),[Yarwood](https://www.camx.com/Files/CB05_Final_Report_120805.pdf)).
@@ -182,7 +190,9 @@ $$
182
190
2HO_2 \rightarrow H_2O_2
183
191
$$
184
192
193
+
<!--
185
194
**Note: from here, onward, the equations and variable names don't agree, so I would make sure to provide a map between the corresponding quantities.**
195
+
-->
186
196
187
197
```yaml
188
198
- MUSICA_name: R34
@@ -361,6 +371,14 @@ The `reaction_list` gives the index of the reactions for which this modifier is
361
371
362
372
Future work will convert `reaction_list` from a list of indices to reaction IDs, as will `photolysis_reaction_index`. Thus, one does not need to know the index of each reaction before running a TChem simulation.
363
373
374
+
## **Gas-Aerosol Reaction Types**
375
+
376
+
### SIMPOL mass transfer
377
+
378
+
It calculates the evaporation rate of organic species that partition between the gas and aerosol phase, based on the parameterization by [Pankow and Asher (2008)](https://acp.copernicus.org/articles/8/2773/2008/acp-8-2773-2008.html).
379
+
380
+
TChem-atm utilizes a YAML file and follows to the [CAMP format](https://github.com/open-atmos/camp) to specify SIMPOL types.
0 commit comments