diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff0614d..6ddc7c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,7 @@ # Global variables (will be set in every job): variables: MAX_DIM: "3" - LEGION_BRANCH: "control_replication" -# LEGION_BRANCH: "master" + LEGION_COMMIT: "e1ce6c67f58a0e6b70023c31d202eebc88efa265" HTR_DIR: "$CI_PROJECT_DIR" REALM_BACKTRACE: "1" # TIMELIMIT: "600" # each test should take less than 10 minutes @@ -63,6 +62,16 @@ variables: .prof: &prof USE_PROF: "1" +### +### Optional modules +### + +.noelectricSolver: &noelectricSolver + ELECTRIC_FIELD: "0" + +.electricSolver: &electricSolver + ELECTRIC_FIELD: "1" + ### ### Setup ### @@ -85,18 +94,10 @@ before_script: - | cd $LEGION_DIR/language git fetch - git checkout $LEGION_BRANCH - UPSTREAM=${1:-'@{u}'} - LOCAL=$(git rev-parse @) - REMOTE=$(git rev-parse "$UPSTREAM") - if [ $LOCAL != $REMOTE ]; then - echo "Updating Legion" - git reset --hard $REMOTE - fi - scripts/setup_env.py --llvm-version 38 + git checkout $LEGION_COMMIT + scripts/setup_env.py --llvm-version 90 cd $HTR_DIR - ### ### Tags ### @@ -146,20 +147,30 @@ before_script: ctr-205-1_release_unitTests: <<: [*ctr-205-1, *unitTests] variables: - <<: [*release, *openmp, *hdf5] + <<: [*release, *openmp, *hdf5, *noelectricSolver] ctr-205-1_release_solverTests: <<: [*ctr-205-1, *solverTests] variables: - <<: [*release, *openmp, *hdf5] + <<: [*release, *openmp, *hdf5, *noelectricSolver] ctr-205-1_debug_unitTests: <<: [*ctr-205-1, *unitTests] variables: - <<: [*debug, *openmp, *hdf5] + <<: [*debug, *openmp, *hdf5, *noelectricSolver] ctr-205-1_debug_quickSolverTests: <<: [*ctr-205-1, *quickSolverTests] variables: - <<: [*debug, *openmp, *hdf5] + <<: [*debug, *openmp, *hdf5, *noelectricSolver] + +ctr-205-1_release_electricSolver_unitTests: + <<: [*ctr-205-1, *unitTests] + variables: + <<: [*release, *openmp, *hdf5, *electricSolver] + +ctr-205-1_release_electricSolver_solverTests: + <<: [*ctr-205-1, *solverTests] + variables: + <<: [*release, *openmp, *hdf5, *electricSolver] diff --git a/CHANGES.txt b/CHANGES.txt index e523f72..05724af 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,13 +1,25 @@ This file lists the major changes as they appear in the master branch. +Version 1.3.0 (February 28, 2021) + - normalization of the multicomponent mixture + - NSCBCInflow is now available for yLeft BC + - new switch to select numerical scheme in the input file (choices are SkewSymmetric, TENOA, and Hybrid for now) + - Lu and Law 30 species chemical scheme added to the solver with the name CH4_30SpMix + - Speelman et al. (2015) added to the testcases folder + - TENO-LAD (Peng et al. JCP 425 (2021)) implemented in the solver + - new FFT-based Poisson solver for bi-periodic problems + - new optional module for ion-wind effects + - (n,6,4) interaction theory implemented for charge-neutral species interactions + - FFCM-1 added as a mixture model for the solver + - Boivin added as a H2 mixture model for the solver + Version 1.2.0 (September 30, 2020) - probe tools for the solver - initial support for legion tracing - new 1D average tools added as an option - optimization of the 2D average tools - unit test for the average tools - - new IncomingShock BC - - new RecycleRescaling BC + - new IncomingShock BC - BC routines are now launched on relevant ispaces - new RecycleRescaling boundary conditions - new volume probes tools diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..99509e1 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,196 @@ +# Required paths +ifndef LEGION_DIR + $(error LEGION_DIR is not set) +endif +ifndef HTR_DIR + $(error HTR_DIR is not set) +endif + +# OS-specific options +ifeq ($(shell uname),Darwin) + DYNLINK_PATH := DYLD_LIBRARY_PATH +else + DYNLINK_PATH := LD_LIBRARY_PATH +endif + +# CUDA options +USE_CUDA ?= 1 + +# OpenMP options +USE_OPENMP ?= 1 + +# HDF options +export USE_HDF ?= 1 +export HDF_HEADER ?= hdf5.h +HDF_LIBNAME ?= hdf5 + +# FFT options +export USE_FFTW ?= $(ELECTRIC_FIELD) +export FFTW_HEADER ?= fftw3.h +FFTW_LIBNAME ?= fftw3 -lfftw3_threads +CUFFT_LIBNAME ?= cufft + +###################################################### +# Baseline setup +###################################################### +# C and CUDA compilers options: +# - Warnings +C_FLAGS += -Wall -Werror -fno-strict-aliasing +CXX_FLAGS += -Wall -Werror +# - define standard +CXX_FLAGS += -std=c++11 +NVCC_FLAGS += -std=c++11 +# - Include paths +C_FLAGS += -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -I$(HTR_DIR)/src -I$(HTR_DIR)/src/Mixtures -I$(HTR_DIR)/src/Utils -I. -I$(HTR_DIR)/src/Poisson -I. +CXX_FLAGS += -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -I$(HTR_DIR)/src -I$(HTR_DIR)/src/Mixtures -I$(HTR_DIR)/src/Utils -I. -I$(HTR_DIR)/src/Poisson -I. +NVCC_FLAGS += -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -I$(HTR_DIR)/src -I$(HTR_DIR)/src/Mixtures -I$(HTR_DIR)/src/Utils -I. -I$(HTR_DIR)/src/Poisson -I. + +# Regent options +export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg;$(HTR_DIR)/src/Mixtures/?.rg;$(HTR_DIR)/src/Utils/?.rg;$(HTR_DIR)/src/Poisson/?.rg +export INCLUDE_PATH := .;$(HTR_DIR)/src;$(HTR_DIR)/src/Mixtures;$(HTR_DIR)/src/Utils;$(HTR_DIR)/src/Poisson +REGENT := $(LEGION_DIR)/language/regent.py +REGENT_FLAGS := -fflow 0 -finner 1 -foffline 1 + +# Link flags +LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent +LINK_FLAGS += -lm +ifdef CRAYPE_VERSION + LINK_FLAGS += -Bdynamic + LINK_FLAGS += $(CRAY_UGNI_POST_LINK_OPTS) -lugni + LINK_FLAGS += $(CRAY_UDREG_POST_LINK_OPTS) -ludreg +endif + +###################################################### +# If HDF5 is active +###################################################### +ifeq ($(USE_HDF), 1) +ifdef HDF_ROOT + export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include + export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib + LINK_FLAGS += -L$(HDF_ROOT)/lib +endif + LINK_FLAGS += -l$(HDF_LIBNAME) +endif + +###################################################### +# If FFTW is active +###################################################### +ifeq ($(USE_FFTW), 1) +ifdef FFTW_ROOT + export INCLUDE_PATH := $(INCLUDE_PATH);$(FFTW_ROOT)/include + export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(FFTW_ROOT)/lib + C_FLAGS += -I$(FFTW_ROOT)/include + CXX_FLAGS += -I$(FFTW_ROOT)/include + NVCC_FLAGS += -I$(FFTW_ROOT)/include + LINK_FLAGS += -L$(FFTW_ROOT)/lib +endif + LINK_FLAGS += -l$(FFTW_LIBNAME) +ifeq ($(USE_CUDA), 1) + LINK_FLAGS += -L$(CUDA_HOME)/lib64/stubs -l$(CUFFT_LIBNAME) +endif +endif + +###################################################### +# If DEBUG mode is active +###################################################### +ifeq ($(DEBUG), 1) + REGENT_FLAGS += -g -fbounds-checks 1 + C_FLAGS += -g -O0 -DLEGION_BOUNDS_CHECKS -DLEGION_PRIVILEGE_CHECKS + CXX_FLAGS += -g -O0 -DLEGION_BOUNDS_CHECKS -DLEGION_PRIVILEGE_CHECKS + NVCC_FLAGS += -g -O0 -DLEGION_BOUNDS_CHECKS -DLEGION_PRIVILEGE_CHECKS -G + LINK_FLAGS += -g +else + C_FLAGS += -O2 + CXX_FLAGS += -O3 + NVCC_FLAGS += -O3 +endif + +###################################################### +# If DEBUG_OUTPUT mode is active +###################################################### +ifneq ($(DEBUG_OUTPUT), 1) + C_FLAGS += -DCHECK_MIX + CXX_FLAGS += -DCHECK_MIX + NVCC_FLAGS += -DCHECK_MIX +endif + +###################################################### +# If OpenMP is active +###################################################### +ifeq ($(USE_OPENMP), 1) + C_FLAGS += -fopenmp + CXX_FLAGS += -fopenmp + REGENT_FLAGS += -fopenmp 1 +else + REGENT_FLAGS += -fopenmp 0 +endif + +###################################################### +# If CUDA is active +###################################################### +ifeq ($(USE_CUDA), 1) + NVCC ?= $(CUDA_HOME)/bin/nvcc + # Activate Regent's Cuda module only if we are not in debug mode +ifneq ($(DEBUG), 1) + REGENT_FLAGS += -fcuda 1 +else + REGENT_FLAGS += -fcuda 0 +endif + # Include thrust in C++ + CXX_FLAGS += -I$(CUDA_HOME)/include + # Link libcudadevrt for separate compilation of CUDA files + LINK_FLAGS += -L$(CUDA_HOME)/lib64 -lcudadevrt + # CUDA arch variables + GPU_ARCH ?= auto + # translate legacy arch names into numbers + ifeq ($(strip $(GPU_ARCH)),fermi) + GPU_ARCH_N = 20 + endif + ifeq ($(strip $(GPU_ARCH)),kepler) + GPU_ARCH_N = 30 + endif + ifeq ($(strip $(GPU_ARCH)),k20) + GPU_ARCH_N = 35 + endif + ifeq ($(strip $(GPU_ARCH)),k80) + GPU_ARCH_N = 37 + endif + ifeq ($(strip $(GPU_ARCH)),maxwell) + GPU_ARCH_N = 52 + endif + ifeq ($(strip $(GPU_ARCH)),pascal) + GPU_ARCH_N = 60 + endif + ifeq ($(strip $(GPU_ARCH)),volta) + GPU_ARCH_N = 70 + endif + ifeq ($(strip $(GPU_ARCH)),turing) + GPU_ARCH_N = 75 + endif + ifeq ($(strip $(GPU_ARCH)),ampere) + GPU_ARCH_N = 80 + endif + ifeq ($(strip $(GPU_ARCH)),auto) + # detect based on what nvcc supports + ALL_ARCHES = 20 30 32 35 37 50 52 53 60 61 62 70 72 75 80 + GPU_ARCH_N = $(shell for X in $(ALL_ARCHES) ; do \ + $(NVCC) -gencode arch=compute_$$X,code=sm_$$X -cuda -x c++ /dev/null -o /dev/null 2> /dev/null && echo $$X; \ + done) + endif + # finally, convert space-or-comma separated list of architectures (e.g. 35,50) + # into nvcc -gencode arguments + COMMA=, + NVCC_FLAGS += $(foreach X,$(subst $(COMMA), ,$(GPU_ARCH_N)),-gencode arch=compute_$(X)$(COMMA)code=sm_$(X)) +else + REGENT_FLAGS += -fcuda 0 +endif + +####################################################### +# Optional modules +####################################################### +ifeq ($(ELECTRIC_FIELD), 1) + C_FLAGS += -DELECTRIC_FIELD + CXX_FLAGS += -DELECTRIC_FIELD + NVCC_FLAGS += -DELECTRIC_FIELD +endif + diff --git a/README.md b/README.md index 7124c27..9a5b244 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Organization of the repository ./ > [prometeo.sh](prometeo.sh): Script to run a calculation + > [Makefile.in](Makefile.in): Basic definitions of compile time variables > [src/](src/) > > [prometeo.rg](src/prometeo.rg): Main tasks of the solver @@ -11,11 +12,31 @@ Organization of the repository > > [prometeo_init.rg](src/prometeo_init.rg): Module that contains initialization tasks > > [prometeo_grid.rg](src/prometeo_grid.rg): Module that contains the tasks to generate the computational grid > > [prometeo_cfl.rg](src/prometeo_cfl.rg): Module that contains the tasks to compute the CFL number + > > [prometeo_cfl.h](src/prometeo_cfl.h): C header for the tasks to compute the CFL number + > > [prometeo_cfl.hpp](src/prometeo_cfl.hpp): C++ header for the tasks to compute the CFL number + > > [prometeo_cfl.cc](src/prometeo_cfl.cc): C++ implementations of the tasks to compute the CFL number + > > [prometeo_cfl.cu](src/prometeo_cfl.cu): CUDA implementations of the tasks to compute the CFL number > > [prometeo_chem.rg](src/prometeo_chem.rg): Module that contains the tasks to advance chemistry + > > [prometeo_chem.h](src/prometeo_chem.h): C header for the tasks that advance chemistry + > > [prometeo_chem.hpp](src/prometeo_chem.hpp): C++ header for the tasks that advance chemistry + > > [prometeo_chem.cc](src/prometeo_chem.cc): C++ implementations of the tasks that advance chemistry + > > [prometeo_chem.cu](src/prometeo_chem.cu): CUDA implementations of the tasks that advance chemistry > > [prometeo_bc.rg](src/prometeo_bc.rg): Module that contains the tasks that handle boundary conditions + > > [prometeo_bc_types.h](src/prometeo_bc_types.h): C header for the data types used in boundary condition tasks + > > [prometeo_bc.h](src/prometeo_bc.h): C header for the tasks that handle boundary conditions + > > [prometeo_bc.hpp](src/prometeo_bc.hpp): C++ header for the tasks that handle boundary conditions + > > [prometeo_bc.cc](src/prometeo_bc.cc): C++ implementations of the tasks that handle boundary conditions + > > [prometeo_bc.cu](src/prometeo_bc.cu): CUDA implementations of the tasks that handle boundary conditions > > [prometeo_profiles.rg](src/prometeo_profiles.rg): Module that contains the tasks that handle external profiles provided to the solver > > [prometeo_rk.rg](src/prometeo_rk.rg): Module that contains the tasks for Runge-Kutta algorithm > > [prometeo_stat.rg](src/prometeo_stat.rg): Module that contains the tasks that extract integral quantities from the solution + > > [prometeo_redop.inl](src/prometeo_redop.inl): Inlined file containing the reduction operations used in the solver + > > [prometeo_mixture.rg](src/prometeo_mixture.rg): Module that contains the tasks that initialize the mixure data structure + > > [prometeo_mixture.h](src/prometeo_mixture.h): C header for the tasks that initialize the mixure data structure + > > [prometeo_mixture.hpp](src/prometeo_mixture.hpp): C++ header for the tasks that initialize the mixure data structure + > > [prometeo_mixture_wrappers.hpp](src/prometeo_mixture_wrappers.hpp): C++ header containing the declarations of the C wrappers of the methods contained in the mixture data structure + > > [prometeo_mixture.cc](src/prometeo_mixture.cc): C++ implementations of the tasks that initialize the mixure data structure + > > [prometeo_mixture.cu](src/prometeo_mixture.cu): CUDA kernels of the tasks that initialize the mixure data structure > > [prometeo_sensor.rg](src/prometeo_sensor.rg): Module that contains the tasks that update the shock sensors > > [prometeo_sensor.h](src/prometeo_sensor.h): C headers for the tasks that update the shock sensors > > [prometeo_sensor.hpp](src/prometeo_sensor.hpp): C++ headers for the tasks that update the shock sensors @@ -37,47 +58,69 @@ Organization of the repository > > [prometeo_variables.cu](src/prometeo_variables.cu): CUDA kernels of the tasks that compute auxiliary variables from the unknowns and the other way around > > [prometeo_IO.rg](src/prometeo_IO.rg): Module that contains the tasks that perform I/O operations > > [prometeo_probe.rg](src/prometeo_probe.rg): Module that contains the tasks to perform the time probes of the solution - > > [prometeo_average.rg](src/prometeo_average.rg): Module that contains the tasks that perform 2D averages of the solution + > > [prometeo_average_types.h](src/prometeo_average_types.h): C header that contains the data types for the tasks that perform space and time averages of the solution + > > [prometeo_average.rg](src/prometeo_average.rg): Module that contains the tasks that perform space and time averages of the solution + > > [prometeo_average.h](src/prometeo_average.h): C header for the tasks that perform space and time averages of the solution + > > [prometeo_average.hpp](src/prometeo_average.hpp): C++ header for the tasks that perform space and time averages of the solution + > > [prometeo_average.inl](src/prometeo_average.inl): C++ implementations of the inlined functions that perform space and time averages of the solution + > > [prometeo_average.cc](src/prometeo_average.cc): C++ implementations of tasks that perform space and time averages of the solution + > > [prometeo_average.cu](src/prometeo_average.cu): CUDA implementations of tasks that perform space and time averages of the solution > > [prometeo_metric.rg](src/prometeo_metric.rg): Module that contains the tasks that compute the metric of the solver > > [prometeo_metric.h](src/prometeo_metric.h): C header for the tasks that operate on the right-hand side of the equations - > > [prometeo_metric_coeffs.h](src/prometeo_metric_coeffs.h): C header containing constant coefficients for the tasks that compute the metric of the solver > > [prometeo_metric.hpp](src/prometeo_metric.hpp): C++ header for the tasks that compute the metric of the solver > > [prometeo_metric.inl](src/prometeo_metric.inl): C++ implementations of the inlined functions that compute and apply the metric of the solver > > [prometeo_metric.cc](src/prometeo_metric.cc): C++ implementations of the tasks that compute and apply the metric of the solver > > [prometeo_metric.cu](src/prometeo_metric.cu): CUDA kernels of the tasks that compute and apply the metric of the solver + > > [prometeo_metric_coeffs.h](src/prometeo_metric_coeffs.h): C header that declares the constant coefficients for the tasks that compute the metric of the solver + > > [prometeo_metric_coeffs.cc](src/prometeo_metric_coeffs.cc): C++ sources that define the constant coefficients for the tasks that compute the metric of the solver + > > [prometeo_metric_coeffs.cu](src/prometeo_metric_coeffs.cu): CUDA sources that define the constant coefficients for the tasks that compute the metric of the solver + > > [prometeo_metric_coeffs_macros.h](src/prometeo_metric_coeffs_macros.h): C header that contains helper macros for definition of the constant coefficients for the tasks that compute the metric of the solver + > > [prometeo_electricField.rg](src/src/prometeo_electricField.rg): Module that contains the tasks to update the electric field and ion wind + > > [prometeo_electricField.h](src/prometeo_electricField.h): C header for the tasks to update the electric field and ion wind + > > [prometeo_electricField.hpp](src/prometeo_electricField.hpp): C++ header for the tasks to update the electric field and ion wind + > > [prometeo_electricField.inl](src/prometeo_electricField.inl): C++ implementations of the inlined function that update the electric field and ion wind + > > [prometeo_electricField.cc](src/prometeo_electricField.cc): C++ implementations of the tasks to update the electric field and ion wind + > > [prometeo_electricField.cu](src/prometeo_electricField.cu): CUDA implementations of the tasks to update the electric field and ion wind > > [prometeo_mapper.h](src/prometeo_mapper.h) [prometeo_mapper.cc](src/prometeo_mapper.cc): Source files for the mapper of the solver > > [desugar.py](src/desugar.py): Script that substitutes some macros used for metaprogramming > > [Makefile](src/Makefile): Builds the solver > > [json.h](src/json.h) [json.c](src/json.c): Source files to interpret `*.json` files - > > [Reaction.rg](src/Reaction.rg): Tasks and data structures related to chemical reactions - > > [Reaction.h](src/Reaction.h): C header for the data structures related to chemical reactions - > > [Species.rg](src/Species.rg): Tasks and data structures related to chemical species - > > [Species.h](src/Species.h): C header for the data structures related to chemical species - > > [Species.hpp](src/Species.hpp): C++ implementations of the tasks related to chemical species - > > [MultiComponent.rg](src/MultiComponent.rg): Tasks related to a multicomponent mixtures - > > [MultiComponent.hpp](src/MultiComponent.hpp): C++ implementations of the tasks related to a multicomponent mixtures - > > [ConstPropMix.rg](src/ConstPropMix.rg): Tasks and data structures describing a calorically perfect gas - > > [ConstPropMix.h](src/ConstPropMix.h): C header for the data structures describing a calorically perfect gas - > > [ConstPropMix.hpp](src/ConstPropMix.hpp): C++ headers for the tasks describing a calorically perfect gas - > > [IsentropicMix.rg](src/IsentropicMix.rg): Tasks and data structures describing isoentropic calorically perfect gas - > > [IsentropicMix.h](src/IsentropicMix.h): C header for the data structures describing an isoentropic calorically perfect gas - > > [IsentropicMix.hpp](src/IsentropicMix.hpp): C++ headers for the tasks describing an isoentropic calorically perfect gas - > > [AirMix.rg](src/AirMix.rg): Tasks and data structures describing a non-equilibrium dissociating air - > > [AirMix.h](src/AirMix.h): C header for the data structures describing a non-equilibrium dissociating air - > > [AirMix.hpp](src/AirMix.hpp): C++ headers for the tasks of a non-equilibrium dissociating air - > > [CH41StMix.rg](src/CH41StMix.rg): Tasks and data structures describing single step combustion mechanism for CH4 - > > [CH41StMix.h](src/CH41StMix.h): C header for the data structures describing single step combustion mechanism for CH4 - > > [CH41StMix.hpp](src/CH41StMix.hpp): C++ headers for the tasks and data structures describing single step combustion mechanism for CH4 > > [config_schema.lua](src/config_schema.lua): Lua file describing the fields of the input file > > [process_schema.rg](src/process_schema.rg): Interpreter for [config_schema.lua](src/config_schema.lua) > > [util.rg ](src/util.rg): Various Regent tasks and Lua functions deployed throughout the solver - > > [math_utils.rg](src/math_utils.rg): Basic mathematical operations deployed in the solver - > > [math_utils.hpp](src/math_utils.hpp): C++ implementations of basic mathematical operations deployed in the solver - > > [cuda_utils.hpp](src/cuda_utils.hpp): Utilities for CUDA kernels > > [hdf_helper.rg](src/hdf_helper.rg): Scripts to read and write HDF5 files + > > [Utils](src/Utils) + > > > [constants.h](src/Utils/constants.h): Definition of main physical and math constants used in the sover + > > > [my_array.hpp](src/Utils/my_array.hpp): Definition of array and matrix data types + > > > [task_helper.hpp](src/Utils/task_helper.hpp): Utilities for task registration + > > > [PointDomain_helper.hpp](src/Utils/PointDomain_helper.hpp): Utilities for point and domains + > > > [cuda_utils.hpp](src/Utils/cuda_utils.hpp): Utilities for CUDA kernels + > > > [math_utils.h](src/Utils/math_utils.h): Definition of data types for basic mathematical operations deployed in the solver + > > > [math_utils.rg](src/Utils/math_utils.rg): Regent implementation of basic mathematical operations deployed in the solver + > > > [math_utils.hpp](src/Utils/math_utils.hpp): C++ implementations of basic mathematical operations deployed in the solver + > > [Poisson](src/Poisson) + > > > [Poisson.rg](src/Poisson/Poisson.rg): Module that contains the the tasks of the Poisson solver + > > > [Poisson.h](src/Poisson/Poisson.h): C header for the tasks of the Poisson solver + > > > [Poisson.hpp](src/Poisson/Poisson.hpp): C++ header for the tasks of the Poisson solver + > > > [Poisson.cc](src/Poisson/Poisson.cc): C++ implementations of the tasks of the Poisson solver + > > > [Poisson.cu](src/Poisson/Poisson.cu): CUDA implementations of the tasks of the Poisson solver + > > [Mixtures](src/Mixtures) + > > > [Reaction.hpp](src/Mixtures/Reaction.hpp): C++ declarations of the data structures related to chemical reactions + > > > [Reaction.inl](src/Mixtures/Reaction.inl): C++ implementations of the functions related to chemical reactions + > > > [Species.hpp](src/Mixtures/Species.hpp): C++ declarations of the data structures related to chemical species + > > > [Species.inl](src/Mixtures/Species.inl): C++ implementations of the functions related to chemical species + > > > [MultiComponent.hpp](src/Mixtures/MultiComponent.hpp): C++ declarations for multicomponent mixtures + > > > [MultiComponent.inl](src/Mixtures/MultiComponent.inl): C++ implementations of the functions related to a multicomponent mixture + > > > [ConstPropMix.hpp](src/Mixtures/ConstPropMix.hpp): C++ declarations for the data structure describing a calorically perfect gas + > > > [ConstPropMix.inl](src/Mixtures/ConstPropMix.inl): C++ implementations of the data structure describing a calorically perfect gas + > > > [IsentropicMix.hpp](src/Mixtures/IsentropicMix.hpp): C++ declarations for the data structure describing an isoentropic calorically perfect gas + > > > [IsentropicMix.inl](src/Mixtures/IsentropicMix.inl): C++ implementations of the data structure describing an isoentropic calorically perfect gas + > > > [AirMix.hpp](src/Mixtures/AirMix.hpp): C++ headers for the tasks of a non-equilibrium dissociating air + > > > [CH41StMix.hpp](src/Mixtures/CH41StMix.hpp): C++ headers for the tasks and data structures describing single step combustion mechanism for CH4 + > > > [CH4_30SpMix.hpp](src/Mixtures/CH4_30SpMix.hpp): C++ headers for the tasks and data structures describing Lu and Law (2008) combustion mechanism for CH4 > [jobscripts/](jobscripts/) - > > [blacklist](jobscripts/blacklist): Folder containing potential blacklists of nodes that should not be used + > > [blacklist](jobscripts/blacklist): Folder containing potential blacklists of nodes that should not be used > > [run.sh](jobscripts/run.sh): Script called by [prometeo.sh](prometeo.sh) to generate the execution command (modify this script using the provided templates to add a new machine) > > [jobscript_shared.sh](jobscripts/jobscript_shared.sh): Script called by [run.sh](src/run.sh) > > [yellowstone.slurm](jobscripts/yellowstone.slurm): Submission script for Yellowstone (@ Stanford) (use as a template script for slurm system) @@ -86,6 +129,7 @@ Organization of the repository > > [lassen.lsf](jobscripts/lassen.lsf): Submission script for Lassen (@ LLNL) (use as a template script for IBM Spectrum LSF system) > > [galileo.slurm](jobscripts/galileo.slurm): Submission script for Galileo (@ Cineca) (use as a template script for slurm system) > > [m100.slurm](jobscripts/m100.slurm): Submission script for Marconi100 (@ Cineca) (use as a template script for slurm system) + > > [kraken.slurm](jobscripts/kraken.slurm): Submission script for Kraken (@ CERFACS) > [scripts/](scripts/) > > [viz_fluid.py](scripts/viz_fluid.py): Script to produce Xdmf files for visualization @@ -109,6 +153,8 @@ Organization of the repository > > [TaylorGreen2D/](testcases/TaylorGreen2D/): Contains the setup and postporcessing files needed to run the 2D Taylor-Green vortex > > [Coleman/](testcases/Coleman/): Contains the setup and postporcessing files needed to run Coleman's channel flow > > [Sciacovelli/](testcases/Sciacovelli/): Contains the setup and postporcessing files needed to run Sciacovelli's channel flow + > > [Speelman/](testcases/Speelman/): Contains the setup and postporcessing files needed to run the burner stabilized flame in Speelman et al. (2015) with an applied difference of potential of 250 V + > > [Speelman_DV250/](testcases/Speelman_DV250/): Contains the setup and postporcessing files needed to run the burner stabilized flame in Speelman et al. (2015) with an applied difference of potential of 250 V > > [Franko/](testcases/Franko/): Contains the setup and postporcessing files needed to run Franko's boundary layer > > [MultispeciesTBL/](testcases/MultispeciesTBL/): Contains the setup and postporcessing files needed to run Multispecies hypersonic boundary layer > > [scalingTest/WeakScaling](testcases/scalingTest/WeakScaling): Contains the setup and postporcessing files needed to run the weak scaling test @@ -131,11 +177,16 @@ Organization of the repository > > [VortexAdvection2D/](solverTests/VortexAdvection2D/): Contains the solver test for the bi-periodic 2D inviscid testcase > > [3DPeriodic/](solverTests/3DPeriodic/): Contains the solver test for the tri-periodic 3D testcase > > [3DPeriodic_Air/](solverTests/3DPeriodic_Air): Contains the solver test for the tri-periodic 3D testcase with AirMix + > > [3DPeriodic_SkewSymmetric/](solverTests/3DPeriodic_SkewSymmetric): Contains the solver test for the tri-periodic 3D testcase with the skew symmetric scheme + > > [3DPeriodic_TENOA/](solverTests/3DPeriodic_TENOA): Contains the solver test for the tri-periodic 3D testcase with the TENO-A scheme + > > [3DPeriodic_TENOLAD/](solverTests/3DPeriodic_TENOLAD): Contains the solver test for the tri-periodic 3D testcase with the TENO-LAD scheme > > [ChannelFlow/](solverTests/ChannelFlow): Contains the solver test for the bi-periodic ChannelFlow testcase > > [BoundaryLayer/](solverTests/BoundaryLayer): Contains the solver test for a compressible boundary layer + > > [RecycleBoundary/](solverTests/RecycleBoundary): Contains the solver test for a compressible boundary layer with recycle/rescaling BC > > [M2_Re4736/](solverTests/M2_Re4736): Contains the solver test for a compressible boundary layer at Mach=2 and Re=4736 with recycle-rescaling boundary condition > > [PlanarJet/](solverTests/PlanarJet): Contains the solver test for a compressible jet of methane in air > > [ShockTube/](solverTests/ShockTube): Contains the solver test for the Shu-Osher's shock tube + > > [Speelman_DV250/](solverTests/Speelman_DV250): Contains the solver test for the burner stabilized flame in Speelman et al. (2015) with a voltage of 250 V (requires `ELECTRIC_FIELD=1`) Setup (generic) @@ -147,7 +198,7 @@ See below for instructions targeting specific systems. * Legion (latest version) * GCC 4.9+ (we need a working `std::regex` library) -* CUDA 8.0+ +* CUDA 9.0+ * Python 3.X The following are automatically installed during Legion installation: @@ -157,6 +208,11 @@ The following are automatically installed during Legion installation: * Terra (custom version) * HDF5 (any recent version) +### Optional modules include + +An ion wind solver for charged species activated by the environment variable `ELECTRIC_FIELD` +This module requires FFTW (>=3.3.6) libraries built with the --enable-threads option. + ### Add to shell startup Normally you'd need to edit file `~/.bashrc`. Replace the `???` depending on your system. @@ -171,10 +227,14 @@ export LEGION_DIR=??? export HDF_ROOT="$LEGION_DIR"/language/hdf/install export HTR_DIR=??? [export SCRATCH=???] +# Optional modules +ELECTRIC_FIELD=??? # CUDA config (if using CUDA code generation) export CUDA_HOME=??? export CUDA="$CUDA_HOME" export GPU_ARCH=??? +# FFTW config (if using electric field solver) +export FFTW_HOME=??? # Legion setup export USE_CUDA=? export USE_OPENMP=? @@ -186,7 +246,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -249,7 +309,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -275,22 +335,17 @@ Setup (Sapling @ Stanford) ``` # Module loads module load mpi/openmpi/1.8.2 -module load cuda/7.0 # Build config export CONDUIT=ibv -export CC=gcc-4.9 -export CXX=g++-4.9 +export CC=gcc-5 +export CXX=g++-5 # Path setup export LEGION_DIR=??? export HDF_ROOT="$LEGION_DIR"/language/hdf/install export HTR_DIR=??? export SCRATCH=/scratch/oldhome/`whoami` -# CUDA config -export CUDA_HOME=/usr/local/cuda-7.0 -export CUDA="$CUDA_HOME" -export GPU_ARCH=fermi # Legion setup -export USE_CUDA=1 +export USE_CUDA=0 export USE_OPENMP=1 export USE_GASNET=1 export USE_HDF=1 @@ -300,7 +355,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -346,7 +401,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -373,7 +428,7 @@ Setup (Yellowstone @ Stanford w/ GPUs) ``` # Module loads module load gnu7/7.3.0 -module load cuda/9.2 +module load cuda/10.2 module load openmpi3/3.0.0 module load pmix/2.2.2 # Build config @@ -385,7 +440,7 @@ export LEGION_DIR=??? export HDF_ROOT="$LEGION_DIR"/language/hdf/install export HTR_DIR=??? # CUDA config -export CUDA_HOME=/usr/local/cuda-9.2 +export CUDA_HOME=/usr/local/cuda-10.2 export CUDA="$CUDA_HOME" export GPU_ARCH=kepler # Legion setup @@ -399,7 +454,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -447,7 +502,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -473,7 +528,7 @@ Setup (Quartz @ LLNL) ``` # Module loads -module load gcc/4.9.3 +module load gcc/6.1.0 module load openmpi/2.0.0 module load python module load paraview/5.4 @@ -497,7 +552,7 @@ export GASNET_VERSION="GASNet-1.32.0" ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -523,7 +578,7 @@ Setup (Lassen @ LLNL) ``` # Module loads module load gcc/7.3.1 -module load cuda/9.2.148 +module load cuda/10.2.89 module load python # Build config export CC=gcc @@ -535,7 +590,7 @@ export HDF_ROOT="$LEGION_DIR"/language/hdf/install export HTR_DIR=??? export SCRATCH=??? # CUDA config -export CUDA_HOME=/usr/tce/packages/cuda/cuda-9.2.148 +export CUDA_HOME=/usr/tce/packages/cuda/cuda-10.2.89 export CUDA="$CUDA_HOME" export GPU_ARCH=volta @@ -546,13 +601,13 @@ export USE_CUDA=1 export USE_OPENMP=1 export USE_GASNET=1 export USE_HDF=1 -export MAX_DIM=3 +export MAX_DIM=3 ``` ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -608,7 +663,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -666,7 +721,7 @@ export MAX_DIM=3 ### Download software ``` -git clone -b control_replication https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" ``` @@ -684,3 +739,60 @@ cd "$HTR_DIR"/src make -j ``` +Setup (Kraken @ CERFACS) +============================ + +### Add to shell startup + +``` +# Module loads +module purge +module load compiler/gcc +module load mpi/openmpi/3.1.5_gcc54 +module load nvidia/cuda/10.1 +module load python/anaconda3.7 +# Build config +export CONDUIT=psm +export CC=gcc +export CXX=g++ +# Path setup +export SCRATCH=/scratch/cfd/direnzo +export LEGION_DIR="$SCRATCH"/legion +export HDF_ROOT="$LEGION_DIR"/language/hdf/install +export HTR_DIR="$SCRATCH"/htr +# CUDA config +export CUDA_HOME="/softs/nvidia/cuda-10.1" +export CUDA="$CUDA_HOME" +export GPU_ARCH=volta + +export ACCOUNT=[ACCOUNT TO BE CHARGED] + +# Legion setup +export USE_CUDA=1 +export USE_OPENMP=1 +export USE_GASNET=1 +export USE_HDF=1 +export MAX_DIM=3 +``` + +### Download software + +``` +git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" +git clone https://github.com/stanfordhpccenter/HTR-solver.git "$HTR_DIR" +``` + +### Install Legion + +``` +cd "$LEGION_DIR"/language +CXXFLAGS='-std=c++11' scripts/setup_env.py --llvm-version 60 --terra-url 'https://github.com/StanfordLegion/terra.git' --terra-branch 'luajit2.1' +``` + +### Compile Prometeo + +``` +cd "$HTR_DIR"/src +make -j +``` + diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 3ecfdd1..415531a 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -3,7 +3,7 @@ # Only use spaces to indent your .yml configuration. # ----- # You can specify a custom docker image from Docker Hub as your build environment. -image: mariodr/legion-docker:ubuntu16.04-dcr +image: mariodr/legion-docker:HTR-1.3 pipelines: default: diff --git a/dockerfiles/HTR-1.3.docker b/dockerfiles/HTR-1.3.docker new file mode 100644 index 0000000..2b00f5a --- /dev/null +++ b/dockerfiles/HTR-1.3.docker @@ -0,0 +1,26 @@ +# Build Image for Bitbucket +# Use command: docker build -t mariodr/legion-docker:ubuntu20.04-dcr -f dockerfile.bitbucket . + +#FROM stanfordlegion/gitlab-ci:ubuntu16.04 +FROM registry.gitlab.com/stanfordlegion/legion/gitlab-ci-20.04 + +MAINTAINER Mario Di Renzo + +ENV CC=gcc \ + CXX=c++ \ + LEGION_DIR="/usr/local/legion" \ + HDF_HEADER="hdf5/serial/hdf5.h" \ + HDF_LIBNAME="hdf5_serial" \ + TERRA_DIR="/usr/local/terra9" \ + LLVM_CONFIG="llvm-config-9" \ + MAX_DIM=3 \ + USE_CUDA=0 \ + USE_OPENMP=1 \ + USE_GASNET=0 \ + USE_HDF=1 \ + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LEGION_DIR/bindings/regent/" + +RUN git clone -b HTR-1.3 https://gitlab.com/mario.direnzo/legion.git "$LEGION_DIR" && \ + cd $LEGION_DIR/language && \ + ./install.py --rdir "auto" --with-terra $TERRA_DIR + diff --git a/dockerfiles/dockerfile.bitbucket b/dockerfiles/dockerfile.bitbucket index ad3de15..92d7544 100644 --- a/dockerfiles/dockerfile.bitbucket +++ b/dockerfiles/dockerfile.bitbucket @@ -1,7 +1,8 @@ # Build Image for Bitbucket -# Use command: docker build -t mariodr/legion-docker:ubuntu16.04-dcr -f dockerfile.bitbucket . +# Use command: docker build -t mariodr/legion-docker:ubuntu20.04-dcr -f dockerfile.bitbucket . -FROM stanfordlegion/gitlab-ci:ubuntu16.04 +#FROM stanfordlegion/gitlab-ci:ubuntu16.04 +FROM registry.gitlab.com/stanfordlegion/legion/gitlab-ci-20.04 MAINTAINER Mario Di Renzo @@ -10,8 +11,8 @@ ENV CC=gcc \ LEGION_DIR="/usr/local/legion" \ HDF_HEADER="hdf5/serial/hdf5.h" \ HDF_LIBNAME="hdf5_serial" \ - TERRA_DIR="/usr/local/terra35" \ - LLVM_CONFIG="llvm-config-3.5" \ + TERRA_DIR="/usr/local/terra9" \ + LLVM_CONFIG="llvm-config-9" \ MAX_DIM=3 \ USE_CUDA=0 \ USE_OPENMP=1 \ diff --git a/jobscripts/jobscript_shared.sh b/jobscripts/jobscript_shared.sh index d0da7ac..4d20a38 100644 --- a/jobscripts/jobscript_shared.sh +++ b/jobscripts/jobscript_shared.sh @@ -72,6 +72,15 @@ if [[ "$USE_CUDA" == 1 ]]; then fi fi +# Define default number of threads dedicated to the runtime +IO_THREADS="${IO_THREADS:-1}" +UTIL_THREADS="${UTIL_THREADS:-2}" +# if we are running with openMP we need to reserve 1 core for serial tasks +BGWORK_THREADS="${BGWORK_THREADS:-$(( RESERVED_CORES - IO_THREADS - UTIL_THREADS - USE_OPENMP))}" +if (( BGWORK_THREADS < 0 )); then + quit "You did not reserve enough cores for the runtime" +fi + # Add debugging flags DEBUG_OPTS= if [[ "$DEBUG" == 1 ]]; then @@ -98,14 +107,14 @@ fi # Add GASNET options GASNET_OPTS= if [[ "$LOCAL_RUN" == 0 ]]; then - GASNET_OPTS="-ll:rsize 0 -ll:ib_rsize 1024 -ll:gsize 0" + GASNET_OPTS="-ll:rsize 512 -ll:ib_rsize 512 -ll:gsize 0" fi # Synthesize final command COMMAND="$EXECUTABLE $ARGS \ $DEBUG_OPTS $PROFILER_OPTS \ $CPU_OPTS \ $GPU_OPTS \ - -ll:util 4 -ll:io 1 -ll:bgwork 5 \ + -ll:util $UTIL_THREADS -ll:io $IO_THREADS -ll:bgwork $BGWORK_THREADS \ -ll:cpu_bgwork 100 -ll:util_bgwork 100 \ -ll:csize $RAM_PER_RANK \ $GASNET_OPTS \ diff --git a/jobscripts/kraken.slurm b/jobscripts/kraken.slurm new file mode 100644 index 0000000..0b103be --- /dev/null +++ b/jobscripts/kraken.slurm @@ -0,0 +1,58 @@ +#!/bin/bash -eu +#SBATCH --job-name=prometeo + +if [[ "$QUEUE" == "debug" ]]; then + USE_CUDA=0 + CORES_PER_NODE=34 + NUMA_PER_RANK=2 + RAM_PER_NODE=80000 + # Resources: + # 96GB RAM per node + # 2 NUMA domains per node + # 18 cores per NUMA domain +elif [[ "$QUEUE" == "prodshared" ]]; then + USE_CUDA=0 + CORES_PER_NODE=34 + NUMA_PER_RANK=2 + RAM_PER_NODE=80000 + # Resources: + # 96GB RAM per node + # 2 NUMA domains per node + # 18 cores per NUMA domain +elif [[ "$QUEUE" == "gpu" ]]; then + USE_CUDA=1 + CORES_PER_NODE=34 + NUMA_PER_RANK=2 + RAM_PER_NODE=150000 + GPUS_PER_NODE=1 + FB_PER_GPU=12500 + # Resources: + # 192GB RAM per node + # 2 NUMA domains per node + # 18 cores per NUMA domain + # 1 nVidia Volta V100 GPU +elif [[ "$QUEUE" == "biggpu" ]]; then + USE_CUDA=1 + CORES_PER_NODE=34 + NUMA_PER_RANK=2 + RAM_PER_NODE=150000 + GPUS_PER_NODE=4 + FB_PER_GPU=29500 + # Resources: + # 192GB RAM per node + # 2 NUMA domains per node + # 18 cores per NUMA domain + # 4 nVidia Volta V100 GPU +else + echo "Unrecognized queue $QUEUE" >&2 + exit 1 +fi + +cd $SLURM_SUBMIT_DIR +source "$HTR_DIR"/jobscripts/jobscript_shared.sh + +srun -n "$NUM_RANKS" \ + --ntasks-per-node="$RANKS_PER_NODE" --cpus-per-task=35 \ + --export=ALL --mpi=pmi2 \ + $COMMAND + diff --git a/jobscripts/run.sh b/jobscripts/run.sh index fa90cbe..dc89d96 100644 --- a/jobscripts/run.sh +++ b/jobscripts/run.sh @@ -180,6 +180,7 @@ function run_m100 { sbatch --export=ALL \ -N "$NUM_NODES" -t "$WALLTIME" -p "$QUEUE" --gres=gpu:4 $DEPS $SPECIALQ \ --ntasks-per-node="$RANKS_PER_NODE" --cpus-per-task="$CORES_PER_RANK" \ + --account="$ACCOUNT" \ "$HTR_DIR"/jobscripts/m100.slurm # Resources: # 256GB RAM per node @@ -188,21 +189,43 @@ function run_m100 { # 4 nVidia Volta V100 } +function run_kraken { + export QUEUE="${QUEUE:-gpu}" + DEPS= + if [[ ! -z "$AFTER" ]]; then + DEPS="-d afterok:$AFTER" + fi + sbatch --export=ALL \ + -N "$NUM_NODES" -t "$WALLTIME" -p "$QUEUE" $DEPS \ + --ntasks-per-node="$RANKS_PER_NODE" --cpus-per-task=35 \ + "$HTR_DIR"/jobscripts/kraken.slurm +} + function run_local { - if (( NUM_NODES > 1 )); then - quit "Too many nodes requested" - fi - # Overrides for local, non-GPU run - LOCAL_RUN=1 - USE_CUDA=0 - RESERVED_CORES=2 - NUMA_PER_RANK=1 - # Synthesize final command - CORES_PER_NODE="$(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')" - RAM_PER_NODE="$(free -m | head -2 | tail -1 | awk '{print $2}')" - RAM_PER_NODE=$(( RAM_PER_NODE / 2 )) - source "$HTR_DIR"/jobscripts/jobscript_shared.sh - $COMMAND + if (( NUM_NODES > 1 )); then + quit "Too many nodes requested" + fi + # Overrides for local, non-GPU run + LOCAL_RUN=1 + USE_CUDA=0 + RESERVED_CORES=2 + # Synthesize final command + CORES_PER_NODE="$(lscpu | awk -F ":" '/Core/ { c=$2; }; /Socket/ { print c*$2 }')" + RAM_PER_NODE="$(free -m | head -2 | tail -1 | awk '{print $2}')" + RAM_PER_NODE=$(( RAM_PER_NODE / 2 )) + NUMA_PER_RANK="$(lscpu | awk -F ":" '/NUMA node\(s\)/ { gsub(/ /,""); print $2 }')" + # Do not use more than one util or bgwork + UTIL_THREADS=1 + BGWORK_THREADS=1 + # If the machine uses hyperthreading we do not need to reserve any core + THREADS_PER_NODE="$(grep --count ^processor /proc/cpuinfo)" + if (( CORES_PER_NODE != THREADS_PER_NODE )); then + RESERVED_CORES=1 + fi + # Generate command + source "$HTR_DIR"/jobscripts/jobscript_shared.sh + # Run + $COMMAND } ############################################################################### @@ -210,20 +233,22 @@ function run_local { ############################################################################### if [[ "$(uname -n)" == *"lassen"* ]]; then - run_lassen + run_lassen elif [[ "$(uname -n)" == *"yellowstone"* ]]; then - run_yellowstone + run_yellowstone elif [[ "$(uname -n)" == *"armstrong"* ]]; then - run_armstrong + run_armstrong elif [[ "$(uname -n)" == *"sapling"* ]]; then - run_sapling + run_sapling elif [[ "$(uname -n)" == *"quartz"* ]]; then - run_quartz + run_quartz elif [[ "$(uname -n)" == *"r033c01s"* ]]; then - run_galileo + run_galileo elif [[ "$(hostname -d)" == *"m100"* ]]; then - run_m100 + run_m100 +elif [[ "$(uname -n)" == *"kraken"* ]]; then + run_kraken else - echo 'Hostname not recognized; assuming local machine run w/o GPUs' - run_local + echo 'Hostname not recognized; assuming local machine run w/o GPUs' + run_local fi diff --git a/prometeo.sh b/prometeo.sh index 7763dc7..29ade54 100755 --- a/prometeo.sh +++ b/prometeo.sh @@ -29,7 +29,7 @@ export DEBUG="${DEBUG:-0}" export RANKS_PER_NODE="${RANKS_PER_NODE:-1}" # How many cores per rank to reserve for the runtime -export RESERVED_CORES="${RESERVED_CORES:-4}" +export RESERVED_CORES="${RESERVED_CORES:-6}" ############################################################################### # Helper functions @@ -53,10 +53,14 @@ def numRanks(sample): zRanks = int(tiles[2]) / int(tilesPerRank[2]) return int(xRanks * yRanks * zRanks) def mixture(sample): - assert sample['Flow']['mixture']['type'] == 'ConstPropMix' or \ - sample['Flow']['mixture']['type'] == 'IsentropicMix' or \ - sample['Flow']['mixture']['type'] == 'AirMix' or \ - sample['Flow']['mixture']['type'] == 'CH41StMix' + assert sample['Flow']['mixture']['type'] == 'ConstPropMix' or \ + sample['Flow']['mixture']['type'] == 'IsentropicMix' or \ + sample['Flow']['mixture']['type'] == 'AirMix' or \ + sample['Flow']['mixture']['type'] == 'CH41StMix' or \ + sample['Flow']['mixture']['type'] == 'CH4_30SpMix' or \ + sample['Flow']['mixture']['type'] == 'CH4_43SpIonsMix' or \ + sample['Flow']['mixture']['type'] == 'FFCM-1Mix' or \ + sample['Flow']['mixture']['type'] == 'BoivinMix' return sample['Flow']['mixture']['type'] f = json.load(open('$1')) if '$2' == 'single': diff --git a/scripts/makeAvg1DXdmfFile.py b/scripts/makeAvg1DXdmfFile.py index dfd4267..770c166 100755 --- a/scripts/makeAvg1DXdmfFile.py +++ b/scripts/makeAvg1DXdmfFile.py @@ -49,7 +49,7 @@ parser = argparse.ArgumentParser() parser.add_argument('--avgdir', nargs='?', const='.', default='.', help='directory with all the simulation output') -parser.add_argument('--nplane', nargs=1, default=0, +parser.add_argument('--nplane', default=0, type=int, help='index of the average plane to be processed') args = parser.parse_args() diff --git a/scripts/modules/Averages.py b/scripts/modules/Averages.py index f9b8efe..231ae70 100755 --- a/scripts/modules/Averages.py +++ b/scripts/modules/Averages.py @@ -87,6 +87,10 @@ def __init__(self, filename, symmetric = False): self.vYi_favg = f["vYi_favg"][:][0,:] self.wYi_favg = f["wYi_favg"][:][0,:] + if "electricPotential_avg" in f: + self.electricPotential_avg = f["electricPotential_avg"][:][0,:] + self.chargeDensity_avg = f["chargeDensity_avg" ][:][0,:] + self.SpeciesNames = f.attrs.get("SpeciesNames") if symmetric : self.avgYSymmetric() @@ -120,7 +124,7 @@ def __init__(self, filename, symmetric = False): self.velocity_rey[:,2] -= self.velocity_avg[:,1]*self.velocity_avg[:,2] self.rho_avg /= weight - self.rho_rms /= weight + self.rho_rms /= weight self.mu_avg /= weight self.lam_avg /= weight self.SoS_avg /= weight @@ -212,6 +216,10 @@ def __init__(self, filename, symmetric = False): self.vYi_favg[:,isp] /= weight self.wYi_favg[:,isp] /= weight + if hasattr(self, "electricPotential_avg"): + self.electricPotential_avg /= weight + self.chargeDensity_avg /= weight + def avgYSymmetric(self): self.pressure_avg = 0.5*(self.pressure_avg + self.pressure_avg[::-1]) self.pressure_rms = 0.5*(self.pressure_rms + self.pressure_rms[::-1]) @@ -316,6 +324,10 @@ def avgYSymmetric(self): self.vYi_favg[:,:] = 0.5*(self.vYi_favg[:,:] - self.vYi_favg[::-1,:]) self.wYi_favg[:,:] = 0.5*(self.wYi_favg[:,:] + self.wYi_favg[::-1,:]) + if hasattr(self, "electricPotential_avg"): + self.electricPotential_avg = 0.5*(self.electricPotential_avg + self.electricPotential_avg[::-1]) + self.chargeDensity_avg = 0.5*(self.chargeDensity_avg + self.chargeDensity_avg [::-1]) + class avg1D: def parseTiles(self, dirname, plane): # read tiles and join them @@ -367,6 +379,7 @@ def __init__(self, dirname, plane): with h5py.File(self.tiles[0], "r") as fin: self.SpeciesNames = fin.attrs.get("SpeciesNames") self.nSpec = len(self.SpeciesNames) + hasElectric = ("electricPotential_avg" in fin) # define data plane weight = np.ndarray(self.shape) @@ -444,6 +457,10 @@ def __init__(self, dirname, plane): self.vYi_favg = np.ndarray(self.shape, dtype=np.dtype("("+str(self.nSpec)+",)f8")) self.wYi_favg = np.ndarray(self.shape, dtype=np.dtype("("+str(self.nSpec)+",)f8")) + if hasElectric: + self.electricPotential_avg = np.ndarray(self.shape) + self.chargeDensity_avg = np.ndarray(self.shape) + for i, t in enumerate(self.tiles): f = h5py.File(t, "r") ind = (slice(self.lo_bound[i][1], self.hi_bound[i][1]+1), @@ -526,6 +543,10 @@ def __init__(self, dirname, plane): self.vYi_favg[ind] = f["vYi_favg"][:][0,:,:] self.wYi_favg[ind] = f["wYi_favg"][:][0,:,:] + if hasElectric: + self.electricPotential_avg[ind] = f["electricPotential_avg"][:][0,:,:] + self.chargeDensity_avg[ind] = f["chargeDensity_avg" ][:][0,:,:] + # Complete average process for i in range(3): self.centerCoordinates[:,:,i] /= weight[:,:] @@ -647,3 +668,6 @@ def __init__(self, dirname, plane): self.vYi_favg[:,:,isp] /= weight self.wYi_favg[:,:,isp] /= weight + if hasElectric: + self.electricPotential_avg /= weight + self.chargeDensity_avg /= weight diff --git a/scripts/modules/MulticomponentMix.py b/scripts/modules/MulticomponentMix.py new file mode 100755 index 0000000..7f20de3 --- /dev/null +++ b/scripts/modules/MulticomponentMix.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 + +import numpy as np + +# Constants +RGAS = 8.3144598 # [J/(mol K)] +eps_0 = 8.8541878128e-12 # [F/m] or [C/(V m)] +eCrg = 1.60217662e-19 # [C] +Na = 6.02214086e23 # [1/mol] + +MolarMass = { "N2" : 0.0140067*2, # [J/(mol K)] + "O2" : 0.0159994*2, + "CH4" : 0.0120107*1+0.00100784*4} + +class Mix: + def __init__(self, configMix): + # Store reference quantities... + # ... form the input file + self.LRef = configMix["LRef"] + self.TRef = configMix["TRef"] + self.PRef = configMix["PRef"] + self.XiRef = configMix["XiRef"]["Species"] + # ... and the derived once + self.MixWRef = self.GetMolarWeightFromXiref(self.XiRef) + self.rhoRef = self.GetRhoRef(self.PRef, self.TRef, self.MixWRef) + self.eRef = self.PRef/self.rhoRef + self.uRef = np.sqrt(self.eRef) + self.tRef = self.LRef/self.uRef + self.CpRef = RGAS/self.MixWRef + self.muRef = self.LRef*np.sqrt(self.PRef*self.rhoRef) + self.lamRef = (self.LRef*np.sqrt(self.PRef*self.rhoRef)*RGAS)/self.MixWRef + self.DiRef = self.LRef/np.sqrt(self.rhoRef/self.PRef) + self.KiRef = np.sqrt(self.rhoRef*self.PRef)*Na*eCrg*self.LRef/self.MixWRef + self.rhoqRef = Na*eCrg*self.rhoRef/self.MixWRef + self.delPhi = self.PRef*self.MixWRef/(self.rhoRef*Na*eCrg) + self.wiRef = np.sqrt(self.rhoRef*self.PRef)/self.LRef + self.CrgRef = Na*eCrg*self.rhoRef/self.MixWRef + self.Eps0 = eps_0*self.PRef*(self.MixWRef/(self.rhoRef*Na*eCrg*self.LRef))**2 + + def GetMolarWeightFromXiref(self, XiRef): + MixW = 0.0 + for s in XiRef: + MixW += MolarMass[s["Name"]]*s["MolarFrac"] + return MixW + + def GetRhoRef(self, P, T, MixW): + return (P * MixW /(RGAS* T)) + + def FindSpecies(self, name, speciesNames): + return (speciesNames.tolist()).index(name.encode("utf-8")) + diff --git a/solverTests/3DPeriodic/base.json b/solverTests/3DPeriodic/base.json index 3f88285..a5b3ea3 100644 --- a/solverTests/3DPeriodic/base.json +++ b/solverTests/3DPeriodic/base.json @@ -32,8 +32,10 @@ "cfl" : -0.9, "fixedDeltaTime" : 5.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0 + } }, "BC" : { @@ -88,5 +90,7 @@ "ZAverages" : [], "volumeProbes" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/solverTests/3DPeriodic_Air/base.json b/solverTests/3DPeriodic_Air/base.json index 0c6b020..8347d37 100644 --- a/solverTests/3DPeriodic_Air/base.json +++ b/solverTests/3DPeriodic_Air/base.json @@ -32,8 +32,10 @@ "cfl" : 0.5, "fixedDeltaTime" : 5.0e-4, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0 + } }, "BC" : { @@ -46,12 +48,21 @@ }, "Flow" : { - "mixture": { "type" : "AirMix" }, + "mixture": { + "type" : "AirMix", + "LRef" : 1.0, + "TRef" : 500.0, + "PRef" : 1.0e5, + "XiRef" : { + "Species" : [{"Name" : "N2", "MolarFrac" : 0.79 }, + {"Name" : "O2", "MolarFrac" : 0.21 }] + } + }, "initCase" : { "type" : "TaylorGreen3DVortex", - "pressure" : 1e5, - "temperature" : 500.0, - "velocity" : 1.0, + "pressure" : 1.0, + "temperature" : 1.0, + "velocity" : 0.002634364032587426, "molarFracs" : { "Species" : [{"Name" : "N2", "MolarFrac" : 0.79 }, {"Name" : "O2", "MolarFrac" : 0.21 }] @@ -80,5 +91,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/solverTests/3DPeriodic_Air/cpu_ref.hdf b/solverTests/3DPeriodic_Air/cpu_ref.hdf index 4c8f01e..bdb0538 100644 --- a/solverTests/3DPeriodic_Air/cpu_ref.hdf +++ b/solverTests/3DPeriodic_Air/cpu_ref.hdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2bcff56929498662e90b5d0a2a404307a80683a33126c2de6331fc90f08c206 +oid sha256:ad5671fdbb99da67ff06463667823d839565a1204d92a6307b0c22ef3a362a3f size 5509680 diff --git a/solverTests/3DPeriodic_SkewSymmetric/__init__.py b/solverTests/3DPeriodic_SkewSymmetric/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/solverTests/3DPeriodic_SkewSymmetric/base.json b/solverTests/3DPeriodic_SkewSymmetric/base.json new file mode 100644 index 0000000..801192d --- /dev/null +++ b/solverTests/3DPeriodic_SkewSymmetric/base.json @@ -0,0 +1,93 @@ +{ + "Mapping" : { + "tiles" : [1,1,1], + "tilesPerRank" : [1,1,1], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 10000 + }, + + "Grid" : { + "xNum" : 32, + "yNum" : 32, + "zNum" : 32, + "origin" : [0.0, 0.0, 0.0], + "xWidth" : 6.28318530718, + "yWidth" : 6.28318530718, + "zWidth" : 6.28318530718, + "xType" : "Uniform", + "yType" : "Uniform", + "zType" : "Uniform", + "xStretching" : 1.0, + "yStretching" : 1.0, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 20, + "maxTime" : 30.0, + "cfl" : -0.9, + "fixedDeltaTime" : 5.0e-3, + "implicitChemistry" : false, + "EulerScheme" : { "type" : "SkewSymmetric" } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { "type" : "Periodic" }, + "yBCRight" : { "type" : "Periodic" }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture": { + "type" : "ConstPropMix", + "gasConstant" : 1.0, + "gamma" : 1.4, + "prandtl" : 0.71, + "viscosityModel" : { + "type" : "Constant", + "Visc" : 0.0 + } + }, + "initCase" : { + "type" : "TaylorGreen3DVortex", + "pressure" : 100.0, + "temperature" : 100.0, + "velocity" : 1.0, + "molarFracs" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + }, + "bodyForce" : [0.0, 0.0, 0.0], + "turbForcing" : { "type" : "OFF" } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 100, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [], + "volumeProbes" : [] + }, + + "Efield" : { "type" : "Off" } +} diff --git a/solverTests/3DPeriodic_SkewSymmetric/cpu_ref.hdf b/solverTests/3DPeriodic_SkewSymmetric/cpu_ref.hdf new file mode 100644 index 0000000..5133116 --- /dev/null +++ b/solverTests/3DPeriodic_SkewSymmetric/cpu_ref.hdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a23523401a146e021743108df718bb7271aa120fb2d7f71009eaabf1107e0e0b +size 4461024 diff --git a/solverTests/3DPeriodic_SkewSymmetric/test.py b/solverTests/3DPeriodic_SkewSymmetric/test.py new file mode 100644 index 0000000..5d06233 --- /dev/null +++ b/solverTests/3DPeriodic_SkewSymmetric/test.py @@ -0,0 +1,15 @@ +import os +import sys +import unittest +import subprocess +sys.path.insert(1, os.path.expandvars("$HTR_DIR/solverTests/")) +import testAll + +class unitTest(unittest.TestCase, testAll.Test3DTiledBase): + testName = "3DPeriodic_SkewSymmetric" + npart = 2 + def execute(self, name): + return subprocess.check_output([testAll.executable, "-i", name+".json", "-o", name]) + +if __name__ == "__main__": + unittest.main() diff --git a/solverTests/3DPeriodic_TENOA/base.json b/solverTests/3DPeriodic_TENOA/base.json index 54b6f6a..d03a5dc 100644 --- a/solverTests/3DPeriodic_TENOA/base.json +++ b/solverTests/3DPeriodic_TENOA/base.json @@ -32,8 +32,7 @@ "cfl" : -0.9, "fixedDeltaTime" : 5.0e-3, "implicitChemistry" : false, - "hybridScheme" : false, - "vorticityScale" : 1.0 + "EulerScheme" : { "type" : "TENOA" } }, "BC" : { @@ -88,5 +87,7 @@ "ZAverages" : [], "volumeProbes" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/solverTests/3DPeriodic_TENOLAD/__init__.py b/solverTests/3DPeriodic_TENOLAD/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/solverTests/3DPeriodic_TENOLAD/base.json b/solverTests/3DPeriodic_TENOLAD/base.json new file mode 100644 index 0000000..7eadd39 --- /dev/null +++ b/solverTests/3DPeriodic_TENOLAD/base.json @@ -0,0 +1,93 @@ +{ + "Mapping" : { + "tiles" : [1,1,1], + "tilesPerRank" : [1,1,1], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 10000 + }, + + "Grid" : { + "xNum" : 32, + "yNum" : 32, + "zNum" : 32, + "origin" : [0.0, 0.0, 0.0], + "xWidth" : 6.28318530718, + "yWidth" : 6.28318530718, + "zWidth" : 6.28318530718, + "xType" : "Uniform", + "yType" : "Uniform", + "zType" : "Uniform", + "xStretching" : 1.0, + "yStretching" : 1.0, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 20, + "maxTime" : 30.0, + "cfl" : -0.9, + "fixedDeltaTime" : 5.0e-3, + "implicitChemistry" : false, + "EulerScheme" : { "type" : "TENOLAD" } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { "type" : "Periodic" }, + "yBCRight" : { "type" : "Periodic" }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture": { + "type" : "ConstPropMix", + "gasConstant" : 1.0, + "gamma" : 1.4, + "prandtl" : 0.71, + "viscosityModel" : { + "type" : "Constant", + "Visc" : 0.0 + } + }, + "initCase" : { + "type" : "TaylorGreen3DVortex", + "pressure" : 100.0, + "temperature" : 100.0, + "velocity" : 1.0, + "molarFracs" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + }, + "bodyForce" : [0.0, 0.0, 0.0], + "turbForcing" : { "type" : "OFF" } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 100, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [], + "volumeProbes" : [] + }, + + "Efield" : { "type" : "Off" } +} diff --git a/solverTests/3DPeriodic_TENOLAD/cpu_ref.hdf b/solverTests/3DPeriodic_TENOLAD/cpu_ref.hdf new file mode 100644 index 0000000..b5e976e --- /dev/null +++ b/solverTests/3DPeriodic_TENOLAD/cpu_ref.hdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9105f1f7583a616892322f8f8a6614f62314e9ab80d13da43f8b366fae1921a3 +size 4461016 diff --git a/solverTests/3DPeriodic_TENOLAD/test.py b/solverTests/3DPeriodic_TENOLAD/test.py new file mode 100644 index 0000000..7dc6b62 --- /dev/null +++ b/solverTests/3DPeriodic_TENOLAD/test.py @@ -0,0 +1,15 @@ +import os +import sys +import unittest +import subprocess +sys.path.insert(1, os.path.expandvars("$HTR_DIR/solverTests/")) +import testAll + +class unitTest(unittest.TestCase, testAll.Test3DTiledBase): + testName = "3DPeriodic_TENOLAD" + npart = 2 + def execute(self, name): + return subprocess.check_output([testAll.executable, "-i", name+".json", "-o", name]) + +if __name__ == "__main__": + unittest.main() diff --git a/solverTests/BoundaryLayer/MakeInput.py b/solverTests/BoundaryLayer/MakeInput.py index 6ecac25..17ef057 100755 --- a/solverTests/BoundaryLayer/MakeInput.py +++ b/solverTests/BoundaryLayer/MakeInput.py @@ -50,7 +50,7 @@ UInf = 2083.67 Rex0 = 100000 -config["Integrator"]["vorticityScale"] = UInf/0.0528088569936 +config["Integrator"]["EulerScheme"]["vorticityScale"] = UInf/0.0528088569936 aInf = np.sqrt(gamma*R*TInf) MaInf = UInf/aInf @@ -197,6 +197,8 @@ fout.create_dataset("MolarFracs_profile", shape=shape, dtype = np.dtype("(1,)f8")) fout.create_dataset("velocity_profile", shape=shape, dtype = np.dtype("(3,)f8")) fout.create_dataset("temperature_profile", shape=shape, dtype = np.dtype("f8")) + if (os.path.expandvars("$ELECTRIC_FIELD") == "1"): + fout.create_dataset("electricPotential", shape=shape, dtype = np.dtype("f8")) fout["centerCoordinates"][:] = centerCoordinates fout["cellWidth"][:] = cellWidth diff --git a/solverTests/BoundaryLayer/base.json b/solverTests/BoundaryLayer/base.json index 531cd1d..8339cf9 100644 --- a/solverTests/BoundaryLayer/base.json +++ b/solverTests/BoundaryLayer/base.json @@ -32,8 +32,10 @@ "cfl" : 0.5, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 0.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 0.0 + } }, "BC" : { @@ -112,5 +114,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/solverTests/ChannelFlow/base.json b/solverTests/ChannelFlow/base.json index 3790cbb..717f2cf 100644 --- a/solverTests/ChannelFlow/base.json +++ b/solverTests/ChannelFlow/base.json @@ -32,8 +32,10 @@ "cfl" : 0.5, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 5803767.1 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 5803767.1 + } }, "BC" : { @@ -104,6 +106,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/solverTests/PlanarJet/MakeInput.py b/solverTests/PlanarJet/MakeInput.py index f62d0b3..1847a52 100755 --- a/solverTests/PlanarJet/MakeInput.py +++ b/solverTests/PlanarJet/MakeInput.py @@ -65,12 +65,17 @@ # Inlet displacement thickness h = mu_Ox*ReIn/((U_F-U_Ox)*rho_Ox) -config["Integrator"]["vorticityScale"] = (U_F-U_Ox)/h # Rescale quantities -config["Grid"]["xWidth"] *= h -config["Grid"]["yWidth"] *= h -config["Grid"]["zWidth"] *= h +U_F *= np.sqrt(rho_Ox/PInf) +U_Ox *= np.sqrt(rho_Ox/PInf) +config["Flow"]["mixture"]["LRef"] = h +config["Flow"]["mixture"]["PRef"] = PInf +config["Flow"]["mixture"]["TRef"] = TInf +config["Integrator"]["EulerScheme"]["vorticityScale"] = (U_F-U_Ox)/1.0 +#config["Grid"]["xWidth"] *= h +#config["Grid"]["yWidth"] *= h +#config["Grid"]["zWidth"] *= h config["Grid"]["origin"][1] = -0.5*config["Grid"]["yWidth"] ############################################################################## @@ -81,18 +86,18 @@ config["BC"]["xBCLeft"]["VelocityProfile"]["FileDir"] = restartDir assert config["BC"]["xBCLeft"]["TemperatureProfile"]["type"] == "File" config["BC"]["xBCLeft"]["TemperatureProfile"]["FileDir"] = restartDir -config["BC"]["xBCLeft"]["P"] = PInf +config["BC"]["xBCLeft"]["P"] = 1.0 assert config["BC"]["xBCLeft"]["MixtureProfile"]["type"] == "File" config["BC"]["xBCLeft"]["MixtureProfile"]["FileDir"] = restartDir assert config["BC"]["xBCRight"]["type"] == "NSCBC_Outflow" -config["BC"]["xBCRight"]["P"] = PInf +config["BC"]["xBCRight"]["P"] = 1.0 assert config["BC"]["yBCLeft"]["type"] == "NSCBC_Outflow" -config['BC']["yBCLeft"]["P"] = PInf +config['BC']["yBCLeft"]["P"] = 1.0 assert config["BC"]["yBCRight"]["type"] == "NSCBC_Outflow" -config["BC"]["yBCRight"]["P"] = PInf +config["BC"]["yBCRight"]["P"] = 1.0 ############################################################################## # Generate Grid # @@ -166,8 +171,9 @@ if not os.path.exists(restartDir): os.makedirs(restartDir) -def profile(y, U1, U2, theta): - return 0.5*(U1+U2) + 0.5*(U1-U2)*np.tanh(0.5*(y-0.5*h)/theta) +def profile(y, U1, U2, ell, theta): + theta *= ell + return 0.5*(U1+U2) + 0.5*(U1-U2)*np.tanh(0.5*(y-0.5*ell)/theta) def writeTile(xt, yt, zt): lo_bound = [(xt )*NxTile +halo[0], (yt )*NyTile +halo[1], (zt )*NzTile +halo[2]] @@ -196,17 +202,17 @@ def writeTile(xt, yt, zt): velocity = np.ndarray(shape, dtype=np.dtype('(3,)f8')) dudtBoundary = np.ndarray(shape, dtype=np.dtype('(3,)f8')) dTdtBoundary = np.ndarray(shape) - pressure[:] = PInf + pressure[:] = 1.0 for (k,kc) in enumerate(centerCoordinates): for (j,jc) in enumerate(kc): for (i,ic) in enumerate(jc): y = abs(yGrid[j+lo_bound[1]]) - u = profile(y, U_F, U_Ox, 0.05*h) - X_F = profile(y, 1.0, 1e-60, 0.05*h) + u = profile(y, U_F, U_Ox, 1.0, 0.05) + X_F = profile(y, 1.0, 1e-60, 1.0, 0.05) X_Ox = 1.0-X_F centerCoordinates[k,j,i] = [xGrid[i+lo_bound[0]], yGrid[j+lo_bound[1]], zGrid[k+lo_bound[2]]] cellWidth [k,j,i] = [ dx[i+lo_bound[0]], dy[j+lo_bound[1]], dz[k+lo_bound[2]]] - temperature [k,j,i] = TInf + temperature [k,j,i] = 1.0 rho [k,j,i] = 1.0 MolarFracs [k,j,i] = [X_F, X_Ox, 1e-60, 1e-60] velocity [k,j,i] = [ u, 0.0, 0.0] @@ -234,6 +240,8 @@ def writeTile(xt, yt, zt): fout.create_dataset("MolarFracs_profile", shape=shape, dtype = np.dtype("(4,)f8")) fout.create_dataset("velocity_profile", shape=shape, dtype = np.dtype("(3,)f8")) fout.create_dataset("temperature_profile", shape=shape, dtype = np.dtype("f8")) + if (os.path.expandvars("$ELECTRIC_FIELD") == "1"): + fout.create_dataset("electricPotential", shape=shape, dtype = np.dtype("f8")) fout["centerCoordinates"][:] = centerCoordinates fout["cellWidth"][:] = cellWidth diff --git a/solverTests/PlanarJet/base.json b/solverTests/PlanarJet/base.json index 3e69cd4..41036f6 100644 --- a/solverTests/PlanarJet/base.json +++ b/solverTests/PlanarJet/base.json @@ -42,8 +42,10 @@ "cfl" : 0.8, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0 + } }, "BC" : { @@ -80,7 +82,15 @@ }, "Flow" : { - "mixture": { "type" : "CH41StMix" }, + "mixture": { + "type" : "CH41StMix", + "LRef" : 1.0, + "TRef" : 1.0, + "PRef" : 1.0, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 1.0 }] + } + }, "initCase" : { "type" : "Restart", "restartDir" : "" @@ -109,6 +119,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/solverTests/PlanarJet/cpu_ref.hdf b/solverTests/PlanarJet/cpu_ref.hdf index 420e92e..9d68c96 100644 --- a/solverTests/PlanarJet/cpu_ref.hdf +++ b/solverTests/PlanarJet/cpu_ref.hdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3fdb66c34be734db50036ae7654ae9587dabcf72002d6221b78328832797a13a +oid sha256:707854c45b6adc87753a29fcc41920c9325ce4aee4f4626fe24e29944f873c65 size 6533272 diff --git a/solverTests/RecycleBoundary/MakeInput.py b/solverTests/RecycleBoundary/MakeInput.py index defb381..af82b68 100755 --- a/solverTests/RecycleBoundary/MakeInput.py +++ b/solverTests/RecycleBoundary/MakeInput.py @@ -67,7 +67,7 @@ r = Pr**(1.0/3.0) Taw = TInf*(1.0 + r*0.5*(gamma - 1.0)*MaInf**2) -config["Integrator"]["vorticityScale"] = UInf/delta99In +config["Integrator"]["EulerScheme"]["vorticityScale"] = UInf/delta99In ############################################################################## # Compute similarity solution # @@ -346,6 +346,8 @@ def writeTile(xt, yt, zt): fout.create_dataset("MolarFracs_profile", shape=shape, dtype = np.dtype("(1,)f8")) fout.create_dataset("velocity_profile", shape=shape, dtype = np.dtype("(3,)f8")) fout.create_dataset("temperature_profile", shape=shape, dtype = np.dtype("f8")) + if (os.path.expandvars("$ELECTRIC_FIELD") == "1"): + fout.create_dataset("electricPotential", shape=shape, dtype = np.dtype("f8")) fout["centerCoordinates"][:] = centerCoordinates fout["cellWidth"][:] = cellWidth diff --git a/solverTests/RecycleBoundary/base.json b/solverTests/RecycleBoundary/base.json index e426a68..244556c 100644 --- a/solverTests/RecycleBoundary/base.json +++ b/solverTests/RecycleBoundary/base.json @@ -42,8 +42,10 @@ "cfl" : 0.8, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 0.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 0.0 + } }, "BC" : { @@ -119,6 +121,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/solverTests/ShockTube/base.json b/solverTests/ShockTube/base.json index c0a9b05..ebbb10d 100644 --- a/solverTests/ShockTube/base.json +++ b/solverTests/ShockTube/base.json @@ -32,8 +32,10 @@ "cfl" : -0.4, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1e-6 + } }, "BC" : { @@ -99,5 +101,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/solverTests/Speelman_DV250/__init__.py b/solverTests/Speelman_DV250/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/solverTests/Speelman_DV250/base.json b/solverTests/Speelman_DV250/base.json new file mode 100644 index 0000000..ec20776 --- /dev/null +++ b/solverTests/Speelman_DV250/base.json @@ -0,0 +1,142 @@ +{ + "Mapping" : { + "tiles" : [1,1,1], + "tilesPerRank" : [1,1,1], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 720 + }, + + "Grid" : { + "xNum" : 4, + "yNum" : 100, + "zNum" : 4, + "origin" : [0.0, 0.0, 0.0], + "xWidth" : 1.0, + "yWidth" : 10.0, + "zWidth" : 1.0, + "xType" : "Uniform", + "yType" : "SinhMinus", + "zType" : "Uniform", + "xStretching" : 1.0, + "yStretching" : 1.0, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 10, + "maxTime" : 10000.0, + "cfl" : 0.5, + "fixedDeltaTime" : 1.0e-7, + "implicitChemistry" : false, + "EulerScheme" : { + "type" : "TENOA" + } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { + "type" : "NSCBC_Inflow", + "VelocityProfile" : { + "type" : "Constant", + "velocity" : [0.0, 1.33371e-03, 0.0] + }, + "TemperatureProfile" : { + "type" : "Constant", + "temperature" : 1.0 + }, + "MixtureProfile" : { + "type" : "Constant", + "Mixture" : { + "Species" : [{"Name" : "N2", "MolarFrac" : 7.08249e-01 }, + {"Name" : "H2", "MolarFrac" : 6.79719e-03 }, + {"Name" : "O2", "MolarFrac" : 1.85422e-01 }, + {"Name" : "H2O", "MolarFrac" : 7.17151e-03 }, + {"Name" : "H2O2", "MolarFrac" : 4.96793e-06 }, + {"Name" : "HO2", "MolarFrac" : 1.27489e-05 }, + {"Name" : "CO", "MolarFrac" : 1.13144e-03 }, + {"Name" : "CO2", "MolarFrac" : 2.63158e-04 }, + {"Name" : "CH4", "MolarFrac" : 9.08305e-02 }, + {"Name" : "CH3O2", "MolarFrac" : 6.75100e-06 }, + {"Name" : "CH3OH", "MolarFrac" : 2.33956e-05 }, + {"Name" : "CH2O", "MolarFrac" : 3.09441e-05 }, + {"Name" : "C2H6", "MolarFrac" : 2.43035e-05 }, + {"Name" : "C2H4", "MolarFrac" : 2.63498e-05 }, + {"Name" : "C2H2", "MolarFrac" : 4.85256e-06 }] + } + }, + "P" : 1.0 + }, + "yBCRight" : { + "type" : "NSCBC_Outflow", + "P" : 1.0 + }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture" : { + "type" : "CH4_43SpIonsMix", + "LRef" : 1.0e-3, + "PRef" : 1.01325e5, + "TRef" : 350.0, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 0.22 }, + {"Name" : "N2", "MolarFrac" : 0.78 }] + } + }, + "initCase" : { + "type" : "Uniform", + "pressure" : 1.0, + "temperature" : 6.29250e+00, + "velocity" : [0.0, 8.31793e-03, 0.0], + "molarFracs" : { + "Species" : [{"Name" : "N2", "MolarFrac" : 7.08245e-01 }, + {"Name" : "H2", "MolarFrac" : 4.33273e-03 }, + {"Name" : "H", "MolarFrac" : 6.22826e-04 }, + {"Name" : "O2", "MolarFrac" : 6.60205e-03 }, + {"Name" : "O", "MolarFrac" : 3.66767e-04 }, + {"Name" : "H2O", "MolarFrac" : 1.81896e-01 }, + {"Name" : "OH", "MolarFrac" : 4.06836e-03 }, + {"Name" : "CO", "MolarFrac" : 1.05208e-02 }, + {"Name" : "CO2", "MolarFrac" : 8.33446e-02 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 0.22 }, + {"Name" : "N2", "MolarFrac" : 0.78 }] + }, + "bodyForce" : [0.0, 0.0, 0.0], + "turbForcing" : { "type" : "OFF" } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 50000, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [] + }, + + "Efield" : { + "type" : "Ybc", + "Phi_bottom" : 0.0, + "Phi_top" : 8288.944390108263, + "Robin_bc" : false + } +} diff --git a/solverTests/Speelman_DV250/cpu_ref.hdf b/solverTests/Speelman_DV250/cpu_ref.hdf new file mode 100644 index 0000000..3625fab --- /dev/null +++ b/solverTests/Speelman_DV250/cpu_ref.hdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a91920c54452ecca4214a621bd1cd9e327eddb97b19071a52c960adacc20ac26 +size 789080 diff --git a/solverTests/Speelman_DV250/test.py b/solverTests/Speelman_DV250/test.py new file mode 100644 index 0000000..0f8bfe3 --- /dev/null +++ b/solverTests/Speelman_DV250/test.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import os +import sys +import unittest +import subprocess +sys.path.insert(1, os.path.expandvars("$HTR_DIR/solverTests/")) +import testAll + +class unitTest(unittest.TestCase, testAll.Test3DTiledBase): + testName = "Speelman_DV250" + npart = 1 + def execute(self, name): + MyOut = subprocess.check_output([testAll.executable, "-i", name+".json", "-o", name]) + return MyOut + +if __name__ == "__main__": + unittest.main() diff --git a/solverTests/VortexAdvection2D/base.json b/solverTests/VortexAdvection2D/base.json index 95cc9e7..a637f4f 100644 --- a/solverTests/VortexAdvection2D/base.json +++ b/solverTests/VortexAdvection2D/base.json @@ -32,8 +32,10 @@ "cfl" : -1.0, "fixedDeltaTime" : 1.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0 + } }, "BC" : { @@ -82,5 +84,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/solverTests/testAll.py b/solverTests/testAll.py index 76549d3..6469e5c 100644 --- a/solverTests/testAll.py +++ b/solverTests/testAll.py @@ -25,6 +25,7 @@ def checkSolutionFile(path, refFile, tol=1e-10): tile = h5py.File(tl, "r") for fld in tile: f = tile[fld][:] + if (fld == "electricPotential" and not(fld in refFile)): continue ref = refFile[fld][:] if (len(f.shape) == 3): for (k,j,i), value in np.ndenumerate(f): @@ -129,5 +130,10 @@ def runTiledTest(self, ref): if __name__ == "__main__": suite = unittest.TestLoader().discover(os.path.expandvars("$HTR_DIR/solverTests/"), pattern = "test.py") + # Remove tests that are not appropriate for our configuration + for group in suite: + for test in group: + if (os.path.expandvars("$ELECTRIC_FIELD") != "1"): + if (test._tests[0].testName == "Speelman_DV250"): suite._tests.remove(group) result = 0 if unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful() else 1 sys.exit(result) diff --git a/src/AirMix.rg b/src/AirMix.rg deleted file mode 100644 index 5310c97..0000000 --- a/src/AirMix.rg +++ /dev/null @@ -1,269 +0,0 @@ --- Copyright (c) "2019, by Stanford University --- Developer: Mario Di Renzo --- Affiliation: Center for Turbulence Research, Stanford University --- URL: https://ctr.stanford.edu --- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). --- HTR solver: An open-source exascale-oriented task-based --- multi-GPU high-order code for hypersonic aerothermodynamics. --- Computer Physics Communications 255, 107262" --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- * Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- * Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in the --- documentation and/or other materials provided with the distribution. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND --- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY --- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES --- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; --- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND --- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import "regent" - -return function(SCHEMA) local Exports = {} - --- Utility functions -local C = regentlib.c -local fabs = regentlib.fabs(double) -local pow = regentlib.pow(double) -local sqrt = regentlib.sqrt(double) -local format = require("std/format") - --- Constants -local ATom = 1e-10 -- Angstrom to meter -local DToCm = 3.33564e-30 -- Debye to Coulomb meter - -Exports.nSpec = 5 -Exports.nReac = 5 - -local SPECIES = require 'Species' -local REACTION = (require 'Reaction')(Exports.nSpec, 2, 5) - -struct Exports.Mixture { - species : SPECIES.Species[5] - reactions : REACTION.Reaction[5] - -- Max an min acceptable temeperatures - TMax : double - TMin : double -} - -local MultiComponent = (require 'MultiComponent')(SPECIES, REACTION, Exports.Mixture, Exports.nSpec, Exports.nReac) - -__demand(__inline) -task Exports.InitMixture(config : SCHEMA.Config) - regentlib.assert(config.Flow.mixture.type == SCHEMA.MixtureModel_AirMix, - "This executable is expecting AirMix in the input file"); - var Mix : Exports.Mixture --------------------------------------- --- Set Species --------------------------------------- - -- N2 - var iN2 = 0 - format.snprint([&int8](Mix.species[iN2].Name), 10, "N2") - Mix.species[iN2].W = 2*14.0067e-3 - Mix.species[iN2].Geom = SPECIES.SpeciesGeom_Linear - Mix.species[iN2].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iN2].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iN2].cpCoeff.TMin = 0200.0000 - Mix.species[iN2].cpCoeff.TMax = 20000.0007 - Mix.species[iN2].cpCoeff.cpH = array( 8.310139160e+08,-6.420733540e+05, 2.020264635e+02,-3.065092046e-02, 2.486903333e-06,-9.705954110e-11, 1.437538881e-15, 4.938707040e+06,-1.672099740e+03 ) - Mix.species[iN2].cpCoeff.cpM = array( 5.877124060e+05,-2.239249073e+03, 6.066949220e+00,-6.139685500e-04, 1.491806679e-07,-1.923105485e-11, 1.061954386e-15, 1.283210415e+04,-1.586640027e+01 ) - Mix.species[iN2].cpCoeff.cpL = array( 2.210371497e+04,-3.818461820e+02, 6.082738360e+00,-8.530914410e-03, 1.384646189e-05,-9.625793620e-09, 2.519705809e-12, 7.108460860e+02,-1.076003744e+01 ) - Mix.species[iN2].DiffCoeff.sigma = 3.621*ATom - Mix.species[iN2].DiffCoeff.kbOveps = 1.0/97.530 - Mix.species[iN2].DiffCoeff.mu = 0.000*DToCm - Mix.species[iN2].DiffCoeff.alpha = 1.760*ATom - Mix.species[iN2].DiffCoeff.Z298 = 4.000 - -- O2 - var iO2 = 1 - format.snprint([&int8](Mix.species[iO2].Name), 10, "O2") - Mix.species[iO2].W = 2*15.9994e-3 - Mix.species[iO2].Geom = SPECIES.SpeciesGeom_Linear - Mix.species[iO2].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iO2].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iO2].cpCoeff.TMin = 0200.0000 - Mix.species[iO2].cpCoeff.TMax = 20000.0007 - Mix.species[iO2].cpCoeff.cpH = array( 4.975294300e+08,-2.866106874e+05, 6.690352250e+01,-6.169959020e-03, 3.016396027e-07,-7.421416600e-12, 7.278175770e-17, 2.293554027e+06,-5.530621610e+02 ) - Mix.species[iO2].cpCoeff.cpM = array(-1.037939022e+06, 2.344830282e+03, 1.819732036e+00, 1.267847582e-03,-2.188067988e-07, 2.053719572e-11,-8.193467050e-16,-1.689010929e+04, 1.738716506e+01 ) - Mix.species[iO2].cpCoeff.cpL = array(-3.425563420e+04, 4.847000970e+02, 1.119010961e+00, 4.293889240e-03,-6.836300520e-07,-2.023372700e-09, 1.039040018e-12,-3.391454870e+03, 1.849699470e+01 ) - Mix.species[iO2].DiffCoeff.sigma = 3.458*ATom - Mix.species[iO2].DiffCoeff.kbOveps = 1.0/107.40 - Mix.species[iO2].DiffCoeff.mu = 0.000*DToCm - Mix.species[iO2].DiffCoeff.alpha = 1.600*ATom - Mix.species[iO2].DiffCoeff.Z298 = 3.800 - -- NO - var iNO = 2 - format.snprint([&int8](Mix.species[iNO].Name), 10, "NO") - Mix.species[iNO].W = 14.0067e-3+15.9994e-3 - Mix.species[iNO].Geom = SPECIES.SpeciesGeom_Linear - Mix.species[iNO].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iNO].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iNO].cpCoeff.TMin = 0200.0000 - Mix.species[iNO].cpCoeff.TMax = 20000.0007 - Mix.species[iNO].cpCoeff.cpH = array(-9.575303540e+08, 5.912434480e+05,-1.384566826e+02, 1.694339403e-02,-1.007351096e-06, 2.912584076e-11,-3.295109350e-16,-4.677501240e+06, 1.242081216e+03 ) - Mix.species[iNO].cpCoeff.cpM = array( 2.239018716e+05,-1.289651623e+03, 5.433936030e+00,-3.656034900e-04, 9.880966450e-08,-1.416076856e-11, 9.380184620e-16, 1.750317656e+04,-8.501669090e+00 ) - Mix.species[iNO].cpCoeff.cpL = array(-1.143916503e+04, 1.536467592e+02, 3.431468730e+00,-2.668592368e-03, 8.481399120e-06,-7.685111050e-09, 2.386797655e-12, 9.098214410e+03, 6.728725490e+00 ) - Mix.species[iNO].DiffCoeff.sigma = 3.621*ATom - Mix.species[iNO].DiffCoeff.kbOveps = 1.0/97.530 - Mix.species[iNO].DiffCoeff.mu = 0.000*DToCm - Mix.species[iNO].DiffCoeff.alpha = 1.760*ATom - Mix.species[iNO].DiffCoeff.Z298 = 4.000 - -- N - var iN = 3 - format.snprint([&int8](Mix.species[iN].Name), 10, "N") - Mix.species[iN].W = 14.0067e-3 - Mix.species[iN].Geom = SPECIES.SpeciesGeom_Atom - Mix.species[iN].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iN].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iN].cpCoeff.TMin = 0200.0000 - Mix.species[iN].cpCoeff.TMax = 20000.0007 - Mix.species[iN].cpCoeff.cpH = array( 5.475181050e+08,-3.107574980e+05, 6.916782740e+01,-6.847988130e-03, 3.827572400e-07,-1.098367709e-11, 1.277986024e-16, 2.550585618e+06,-5.848769753e+02 ) - Mix.species[iN].cpCoeff.cpM = array( 8.876501380e+04,-1.071231500e+02, 2.362188287e+00, 2.916720081e-04,-1.729515100e-07, 4.012657880e-11,-2.677227571e-15, 5.697351330e+04, 4.865231506e+00 ) - Mix.species[iN].cpCoeff.cpL = array( 0.000000000e+00, 0.000000000e+00, 2.500000000e+00, 0.000000000e+00, 0.000000000e+00, 0.000000000e+00, 0.000000000e+00, 5.610463780e+04, 4.193905036e+00 ) - Mix.species[iN].DiffCoeff.sigma = 3.298*ATom - Mix.species[iN].DiffCoeff.kbOveps = 1.0/71.400 - Mix.species[iN].DiffCoeff.mu = 0.000*DToCm - Mix.species[iN].DiffCoeff.alpha = 0.000*ATom - Mix.species[iN].DiffCoeff.Z298 = 0.000 - -- O - var iO = 4 - format.snprint([&int8](Mix.species[iO].Name), 10, "O") - Mix.species[iO].W = 15.9994e-3 - Mix.species[iO].Geom = SPECIES.SpeciesGeom_Atom - Mix.species[iO].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iO].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iO].cpCoeff.TMin = 0200.0000 - Mix.species[iO].cpCoeff.TMax = 20000.0007 - Mix.species[iO].cpCoeff.cpH = array( 1.779004264e+08,-1.082328257e+05, 2.810778365e+01,-2.975232262e-03, 1.854997534e-07,-5.796231540e-12, 7.191720164e-17, 8.890942630e+05,-2.181728151e+02 ) - Mix.species[iO].cpCoeff.cpM = array( 2.619020262e+05,-7.298722030e+02, 3.317177270e+00,-4.281334360e-04, 1.036104594e-07,-9.438304330e-12, 2.725038297e-16, 3.392428060e+04,-6.679585350e-01 ) - Mix.species[iO].cpCoeff.cpL = array(-7.953611300e+03, 1.607177787e+02, 1.966226438e+00, 1.013670310e-03,-1.110415423e-06, 6.517507500e-10,-1.584779251e-13, 2.840362437e+04, 8.404241820e+00 ) - Mix.species[iO].DiffCoeff.sigma = 2.750*ATom - Mix.species[iO].DiffCoeff.kbOveps = 1.0/80.000 - Mix.species[iO].DiffCoeff.mu = 0.000*DToCm - Mix.species[iO].DiffCoeff.alpha = 0.000*ATom - Mix.species[iO].DiffCoeff.Z298 = 0.000 - - var i = 0 - -- Oxygen dissociation (O2 + X -> 2O + X) - Mix.reactions[i].A = 2.0e15 - Mix.reactions[i].n =-1.5 - Mix.reactions[i].EovR = 59500 - Mix.reactions[i].has_backward = true - -- Educts - Mix.reactions[i].Neducts = 0 - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iO2, 1.0, 1.0) - -- Products - Mix.reactions[i].Npducts = 0 - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iO, 2.0, 2.0) - -- Colliders - Mix.reactions[i].Nthirdb = 0 - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iO2, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iNO, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iN2, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iO, 5.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iN, 5.0) - - i += 1 - -- NO dissociation (NO + X -> N + O + X) - Mix.reactions[i].A = 5e9 - Mix.reactions[i].n = 0.0 - Mix.reactions[i].EovR = 75500 - Mix.reactions[i].has_backward = true - -- Educts - Mix.reactions[i].Neducts = 0 - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iNO, 1.0, 1.0) - -- Products - Mix.reactions[i].Npducts = 0 - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iO, 1.0, 1.0) - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iN, 1.0, 1.0) - -- Colliders - Mix.reactions[i].Nthirdb = 0 - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iO2, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iNO, 22.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iN2, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iO, 22.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iN, 22.0) - - i += 1 - -- N2 dissociation (N2 + X -> 2N + X) - Mix.reactions[i].A = 7e15 - Mix.reactions[i].n =-1.6 - Mix.reactions[i].EovR = 113200 - Mix.reactions[i].has_backward = true - -- Educts - Mix.reactions[i].Neducts = 0 - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iN2, 1.0, 1.0) - -- Products - Mix.reactions[i].Npducts = 0 - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iN, 2.0, 2.0) - -- Colliders - Mix.reactions[i].Nthirdb = 0 - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iO2, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iNO, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iN2, 1.0) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iO, 30.0/7) - Mix.reactions[i] = REACTION.AddThirdb(Mix.reactions[i], iN, 30.0/7) - - i += 1 - -- Zeldovich 1 (N2 + O -> NO + N) - Mix.reactions[i].A = 6.4e11 - Mix.reactions[i].n =-1.0 - Mix.reactions[i].EovR = 38400 - Mix.reactions[i].has_backward = true - -- Educts - Mix.reactions[i].Neducts = 0 - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iN2, 1.0, 1.0) - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iO, 1.0, 1.0) - -- Products - Mix.reactions[i].Npducts = 0 - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iNO, 1.0, 1.0) - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iN, 1.0, 1.0) - -- Colliders - Mix.reactions[i].Nthirdb = 0 - - i += 1 - -- Zeldovich 2 (NO + O -> O2 + N) - Mix.reactions[i].A = 8.4e6 - Mix.reactions[i].n = 0.0 - Mix.reactions[i].EovR = 19400 - Mix.reactions[i].has_backward = true - -- Educts - Mix.reactions[i].Neducts = 0 - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iNO, 1.0, 1.0) - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iO, 1.0, 1.0) - -- Products - Mix.reactions[i].Npducts = 0 - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iO2, 1.0, 1.0) - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iN, 1.0, 1.0) - -- Colliders - Mix.reactions[i].Nthirdb = 0 - - regentlib.assert(i+1 == Exports.nReac, "Something wrong with number of reactions in InitMixture") - - -- Set maximum and minimum temperature - Mix.TMax = math.huge - Mix.TMin = 0.0 - for i = 0, Exports.nSpec do - Mix.TMax min= Mix.species[i].cpCoeff.TMax - Mix.TMin max= Mix.species[i].cpCoeff.TMin - end - - return Mix -end - --- Copy all elements form MultiComponent -for k, t in pairs(MultiComponent) do - local v = k - Exports[v] = t -end - -return Exports end diff --git a/src/CH41StMix.rg b/src/CH41StMix.rg deleted file mode 100644 index ce21944..0000000 --- a/src/CH41StMix.rg +++ /dev/null @@ -1,177 +0,0 @@ --- Copyright (c) "2019, by Stanford University --- Contributors: Mario Di Renzo --- Affiliation: Center for Turbulence Research, Stanford University --- URL: https://ctr.stanford.edu --- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). --- HTR solver: An open-source exascale-oriented task-based --- multi-GPU high-order code for hypersonic aerothermodynamics. --- Computer Physics Communications 255, 107262" --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- * Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- * Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in the --- documentation and/or other materials provided with the distribution. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND --- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY --- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES --- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; --- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND --- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import "regent" - -return function(SCHEMA) local Exports = {} - --- Utility functions -local C = regentlib.c -local fabs = regentlib.fabs(double) -local pow = regentlib.pow(double) -local sqrt = regentlib.sqrt(double) -local format = require("std/format") - --- Constants -local ATom = 1e-10 -- Angstrom to meter -local DToCm = 3.33564e-30 -- Debye to Coulomb meter -local RGAS = 8.3144598 -- [J/(mol K)] - -Exports.nSpec = 4 -Exports.nReac = 1 - -local SPECIES = require 'Species' -local REACTION = (require 'Reaction')(Exports.nSpec, 2, 0) - -struct Exports.Mixture { - species : SPECIES.Species[Exports.nSpec] - reactions : REACTION.Reaction[1] - -- Max an min acceptable temeperatures - TMax : double - TMin : double -} - -local MultiComponent = (require 'MultiComponent')(SPECIES, REACTION, Exports.Mixture, Exports.nSpec, Exports.nReac) - -__demand(__inline) -task Exports.InitMixture(config : SCHEMA.Config) - regentlib.assert(config.Flow.mixture.type == SCHEMA.MixtureModel_CH41StMix, - "This executable is expecting CH41StMix in the input file"); - - var Mix : Exports.Mixture - --------------------------------------- --- Set Species --------------------------------------- - -- N2 - var iCH4 = 0 - format.snprint([&int8](Mix.species[iCH4].Name), 10, "CH4") - Mix.species[iCH4].W = 12.0107e-3 + 4.0*1.00784e-3 - Mix.species[iCH4].Geom = SPECIES.SpeciesGeom_NonLinear - Mix.species[iCH4].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iCH4].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iCH4].cpCoeff.TMin = 0200.0000 - Mix.species[iCH4].cpCoeff.TMax = 6000.0007 - Mix.species[iCH4].cpCoeff.cpH = array( 3.730042760e+06,-1.383501485e+04, 2.049107091e+01,-1.961974759e-03, 4.727313040e-07,-3.728814690e-11, 1.623737207e-15, 7.532066910e+04,-1.219124889e+02) - Mix.species[iCH4].cpCoeff.cpM = array( 3.730042760e+06,-1.383501485e+04, 2.049107091e+01,-1.961974759e-03, 4.727313040e-07,-3.728814690e-11, 1.623737207e-15, 7.532066910e+04,-1.219124889e+02) - Mix.species[iCH4].cpCoeff.cpL = array(-1.766850998e+05, 2.786181020e+03,-1.202577850e+01, 3.917619290e-02,-3.619054430e-05, 2.026853043e-08,-4.976705490e-12,-2.331314360e+04, 8.904322750e+01 ) - Mix.species[iCH4].DiffCoeff.sigma = 3.746*ATom - Mix.species[iCH4].DiffCoeff.kbOveps = 1.0/141.4 - Mix.species[iCH4].DiffCoeff.mu = 0.000*DToCm - Mix.species[iCH4].DiffCoeff.alpha = 2.600*ATom - Mix.species[iCH4].DiffCoeff.Z298 = 13.000 - -- O2 - var iO2 = 1 - format.snprint([&int8](Mix.species[iO2].Name), 10, "O2") - Mix.species[iO2].W = 2*15.9994e-3 - Mix.species[iO2].Geom = SPECIES.SpeciesGeom_Linear - Mix.species[iO2].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iO2].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iO2].cpCoeff.TMin = 0200.0000 - Mix.species[iO2].cpCoeff.TMax = 20000.0007 - Mix.species[iO2].cpCoeff.cpH = array( 4.975294300e+08,-2.866106874e+05, 6.690352250e+01,-6.169959020e-03, 3.016396027e-07,-7.421416600e-12, 7.278175770e-17, 2.293554027e+06,-5.530621610e+02 ) - Mix.species[iO2].cpCoeff.cpM = array(-1.037939022e+06, 2.344830282e+03, 1.819732036e+00, 1.267847582e-03,-2.188067988e-07, 2.053719572e-11,-8.193467050e-16,-1.689010929e+04, 1.738716506e+01 ) - Mix.species[iO2].cpCoeff.cpL = array(-3.425563420e+04, 4.847000970e+02, 1.119010961e+00, 4.293889240e-03,-6.836300520e-07,-2.023372700e-09, 1.039040018e-12,-3.391454870e+03, 1.849699470e+01 ) - Mix.species[iO2].DiffCoeff.sigma = 3.458*ATom - Mix.species[iO2].DiffCoeff.kbOveps = 1.0/107.40 - Mix.species[iO2].DiffCoeff.mu = 0.000*DToCm - Mix.species[iO2].DiffCoeff.alpha = 1.600*ATom - Mix.species[iO2].DiffCoeff.Z298 = 3.800 - -- NO - var iCO2 = 2 - format.snprint([&int8](Mix.species[iCO2].Name), 10, "CO2") - Mix.species[iCO2].W = 12.0107e-3+2.0*15.9994e-3 - Mix.species[iCO2].Geom = SPECIES.SpeciesGeom_Linear - Mix.species[iCO2].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iCO2].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iCO2].cpCoeff.TMin = 0200.0000 - Mix.species[iCO2].cpCoeff.TMax = 20000.0007 - Mix.species[iCO2].cpCoeff.cpH = array(-1.544423287e+09, 1.016847056e+06,-2.561405230e+02, 3.369401080e-02,-2.181184337e-06, 6.991420840e-11,-8.842351500e-16,-8.043214510e+06, 2.254177493e+03 ) - Mix.species[iCO2].cpCoeff.cpM = array( 1.176962419e+05,-1.788791477e+03, 8.291523190e+00,-9.223156780e-05, 4.863676880e-09,-1.891053312e-12, 6.330036590e-16,-3.908350590e+04,-2.652669281e+01 ) - Mix.species[iCO2].cpCoeff.cpL = array( 4.943650540e+04,-6.264116010e+02, 5.301725240e+00, 2.503813816e-03,-2.127308728e-07,-7.689988780e-10, 2.849677801e-13,-4.528198460e+04,-7.048279440e+00 ) - Mix.species[iCO2].DiffCoeff.sigma = 3.763*ATom - Mix.species[iCO2].DiffCoeff.kbOveps = 1.0/244.0 - Mix.species[iCO2].DiffCoeff.mu = 0.000*DToCm - Mix.species[iCO2].DiffCoeff.alpha = 2.650*ATom - Mix.species[iCO2].DiffCoeff.Z298 = 2.100 - -- N - var iH2O = 3 - format.snprint([&int8](Mix.species[iH2O].Name), 10, "H2O") - Mix.species[iH2O].W = 2.0*1.00784e-3 + 15.9994e-3 - Mix.species[iH2O].Geom = SPECIES.SpeciesGeom_NonLinear - Mix.species[iH2O].cpCoeff.TSwitch1 = 1000.0007 - Mix.species[iH2O].cpCoeff.TSwitch2 = 6000.0007 - Mix.species[iH2O].cpCoeff.TMin = 0200.0000 - Mix.species[iH2O].cpCoeff.TMax = 6000.0007 - Mix.species[iH2O].cpCoeff.cpH = array( 1.034972096e+06,-2.412698562e+03, 4.646110780e+00, 2.291998307e-03,-6.836830480e-07, 9.426468930e-11,-4.822380530e-15,-1.384286509e+04,-7.978148510e+00 ) - Mix.species[iH2O].cpCoeff.cpM = array( 1.034972096e+06,-2.412698562e+03, 4.646110780e+00, 2.291998307e-03,-6.836830480e-07, 9.426468930e-11,-4.822380530e-15,-1.384286509e+04,-7.978148510e+00 ) - Mix.species[iH2O].cpCoeff.cpL = array(-3.947960830e+04, 5.755731020e+02, 9.317826530e-01, 7.222712860e-03,-7.342557370e-06, 4.955043490e-09,-1.336933246e-12,-3.303974310e+04, 1.724205775e+01 ) - Mix.species[iH2O].DiffCoeff.sigma = 2.605*ATom - Mix.species[iH2O].DiffCoeff.kbOveps = 1.0/572.4 - Mix.species[iH2O].DiffCoeff.mu = 1.844*DToCm - Mix.species[iH2O].DiffCoeff.alpha = 0.000*ATom - Mix.species[iH2O].DiffCoeff.Z298 = 4.000 - - var i = 0 - -- Oxygen dissociation (CH4 + 2 O2 -> 2 H2O + CO2) - Mix.reactions[i].A = 1.1e7 - Mix.reactions[i].n = 0.0 - Mix.reactions[i].EovR = 20000*4.184/RGAS - Mix.reactions[i].has_backward = false - -- Educts - Mix.reactions[i].Neducts = 0 - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iCH4, 1.0, 1.0) - Mix.reactions[i] = REACTION.AddEduct(Mix.reactions[i], iO2, 2.0, 0.5) - -- Products - Mix.reactions[i].Npducts = 0 - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iH2O, 2.0, 2.0) - Mix.reactions[i] = REACTION.AddPduct(Mix.reactions[i], iCO2, 1.0, 1.0) - -- Colliders - Mix.reactions[i].Nthirdb = 0 - - regentlib.assert(i+1 == Exports.nReac, "Something wrong with number of reactions in InitMixture") - - -- Set maximum and minimum temperature - Mix.TMax = math.huge - Mix.TMin = 0.0 - for i = 0, Exports.nSpec do - Mix.TMax min= Mix.species[i].cpCoeff.TMax - Mix.TMin max= Mix.species[i].cpCoeff.TMin - end - - return Mix -end - --- Copy all elements form MultiComponent -for k, t in pairs(MultiComponent) do - local v = k - Exports[v] = t -end - -return Exports end diff --git a/src/ConstPropMix.hpp b/src/ConstPropMix.hpp deleted file mode 100644 index 272bcbc..0000000 --- a/src/ConstPropMix.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) "2019, by Stanford University -// Developer: Mario Di Renzo -// Affiliation: Center for Turbulence Research, Stanford University -// URL: https://ctr.stanford.edu -// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). -// HTR solver: An open-source exascale-oriented task-based -// multi-GPU high-order code for hypersonic aerothermodynamics. -// Computer Physics Communications 255, 107262" -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef ConstPropMix_HPP -#define ConstPropMix_HPP - -#include "config_schema.h" -#include "ConstPropMix.h" - -#ifndef __CUDA_HD__ -#ifdef __CUDACC__ -#define __CUDA_HD__ __host__ __device__ -#else -#define __CUDA_HD__ -#endif -#endif - -__CUDA_HD__ -inline double GetMolarWeightFromYi(const double *Yi, const Mix &mix) { return RGAS/mix.R; } - -__CUDA_HD__ -inline double GetMolarWeightFromXi(const double *Xi, const Mix &mix) { return RGAS/mix.R; } - -__CUDA_HD__ -inline void GetMolarFractions(double *Xi, const double MixW, const double *Yi, const Mix &mix) { Xi[0] = Yi[0]; } - -__CUDA_HD__ -inline void GetMassFractions(double *Yi, const double MixW, const double *Xi, const Mix &mix) { Yi[0] = Xi[0]; } - -__CUDA_HD__ -inline double GetRho(const double P, const double T, const double MixW, const Mix &mix) { return P/(mix.R * T); }; - -__CUDA_HD__ -inline double GetHeatCapacity(const double T, const double *Yi, const Mix &mix) { return mix.gamma/(mix.gamma-1)*mix.R; }; - -__CUDA_HD__ -inline double GetSpeciesEnthalpy(const int i, const double T, const Mix &mix) { return RGAS/mix.R; }; - -__CUDA_HD__ -inline double GetSpeciesMolarWeight(const int i, const Mix &mix) { return RGAS/mix.R; }; - -__CUDA_HD__ -inline double GetSpecificInternalEnergy(const int i, const double T, const Mix &mix) { return T*mix.R/(mix.gamma-1.0); }; - -__CUDA_HD__ -inline double GetViscosity(const double T, const double *Xi, const Mix &mix) { - return ((mix.viscosityModel == ViscosityModel_Constant) ? mix.constantVisc : - ((mix.viscosityModel == ViscosityModel_PowerLaw) ? (mix.powerlawViscRef*pow((T/mix.powerlawTempRef), 0.7)) : - /*(Mix.viscosityModel == ViscosityModel_Sutherland) ? */ (mix.sutherlandViscRef*pow((T/mix.sutherlandTempRef), 1.5))* - ((mix.sutherlandTempRef+mix.sutherlandSRef)/(T+mix.sutherlandSRef)))); -}; - -__CUDA_HD__ -inline double GetHeatConductivity(const double T, const double *Xi, const Mix &mix) { - const double cp = mix.gamma/(mix.gamma-1)*mix.R; - return cp/mix.Prandtl*GetViscosity(T, Xi, mix); -}; - -__CUDA_HD__ -inline double GetGamma(const double T, const double MixW, const double *Yi, const Mix &mix) { return mix.gamma; }; - -__CUDA_HD__ -inline double GetSpeedOfSound(const double T, const double gamma, const double MixW, const Mix &mix) { return sqrt(mix.gamma*mix.R*T); }; - -__CUDA_HD__ -inline void GetDiffusivity(double *Di, const double P, const double T, const double MixW, const double *Xi, const Mix &mix) { Di[0] = 0.0; } - -__CUDA_HD__ -inline double Getdpde(const double rho, const double gamma, const Mix &mix) { return rho*(mix.gamma - 1); }; - -__CUDA_HD__ -inline void Getdpdrhoi(double *dpdrhoi, const double gamma, const double T, const double *Yi, const Mix &mix) { dpdrhoi[0] = mix.R*T; }; - -#endif // ConstPropMix_HPP diff --git a/src/ConstPropMix.rg b/src/ConstPropMix.rg deleted file mode 100644 index df2fd0c..0000000 --- a/src/ConstPropMix.rg +++ /dev/null @@ -1,271 +0,0 @@ --- Copyright (c) "2019, by Stanford University --- Developer: Mario Di Renzo --- Affiliation: Center for Turbulence Research, Stanford University --- URL: https://ctr.stanford.edu --- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). --- HTR solver: An open-source exascale-oriented task-based --- multi-GPU high-order code for hypersonic aerothermodynamics. --- Computer Physics Communications 255, 107262" --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- * Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- * Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in the --- documentation and/or other materials provided with the distribution. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND --- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY --- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES --- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; --- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND --- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import "regent" - -return function(SCHEMA) local Exports = {} - --- Utility functions -local C = regentlib.c -local fabs = regentlib.fabs(double) -local pow = regentlib.pow(double) -local sqrt = regentlib.sqrt(double) - --- Constants -local RGAS = 8.3144598 -- [J/(mol K)] - -Exports.nSpec = 1 - -struct Exports.Mixture { - -- Mixture properties - R : double - gamma : double - - -- Viscosisity model - viscosityModel : int - -- Viscosity parameters - -- Constant model - constantVisc : double - -- Power law model - powerlawTempRef : double - powerlawViscRef : double - -- Sutherland model - sutherlandSRef : double - sutherlandTempRef : double - sutherlandViscRef : double - - -- Prandtl number - Prandtl : double -} - -__demand(__inline) -task Exports.InitMixture(config : SCHEMA.Config) - regentlib.assert(config.Flow.mixture.type == SCHEMA.MixtureModel_ConstPropMix, - "This executable is expecting ConstPropMix in the input file"); - - var Mix : Exports.Mixture - - Mix.R = config.Flow.mixture.u.ConstPropMix.gasConstant - Mix.gamma = config.Flow.mixture.u.ConstPropMix.gamma - - Mix.viscosityModel = config.Flow.mixture.u.ConstPropMix.viscosityModel.type - if (Mix.viscosityModel == SCHEMA.ViscosityModel_Constant) then - Mix.constantVisc = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Constant.Visc - elseif (Mix.viscosityModel == SCHEMA.ViscosityModel_PowerLaw) then - Mix.powerlawTempRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.PowerLaw.TempRef - Mix.powerlawViscRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.PowerLaw.ViscRef - elseif (Mix.viscosityModel == SCHEMA.ViscosityModel_Sutherland) then - Mix.sutherlandSRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Sutherland.SRef - Mix.sutherlandTempRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Sutherland.TempRef - Mix.sutherlandViscRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Sutherland.ViscRef - end - - Mix.Prandtl = config.Flow.mixture.u.ConstPropMix.prandtl - - return Mix -end - -__demand(__inline) -task Exports.GetSpeciesNames(Mix : Exports.Mixture) - var Names : regentlib.string[Exports.nSpec] - Names[0] = "MIX" - return Names -end - -__demand(__inline) -task Exports.FindSpecies(name : &int8, Mix : Exports.Mixture) - return 0 -end - -__demand(__inline) -task Exports.ClipYi(Yi : double[Exports.nSpec]) - for i = 0, Exports.nSpec do - Yi[i] max= 1.0e-60 - Yi[i] min= 1.0 - end - return Yi -end - -__demand(__inline) -task Exports.GetMolarWeightFromYi(Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return RGAS/Mix.R -end - -__demand(__inline) -task Exports.GetMolarWeightFromXi(Xi : double[Exports.nSpec], Mix : Exports.Mixture) - return RGAS/Mix.R -end - -__demand(__inline) -task Exports.GetMolarFractions(MixW : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return Yi -end - -__demand(__inline) -task Exports.GetMassFractions(MixW : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - return Xi -end - -__demand(__inline) -task Exports.GetRhoFromRhoYi( rhoYi : double[Exports.nSpec] ) - var rho = rhoYi[0] - return rho -end - -__demand(__inline) -task Exports.GetYi(rho : double, rhoYi : double[Exports.nSpec]) - for i = 0, Exports.nSpec do - rhoYi[i] /= rho - end - return rhoYi -end - -__demand(__inline) -task Exports.GetRhoYiFromYi(rho : double, Yi : double[Exports.nSpec]) - for i = 0, Exports.nSpec do - Yi[i] *= rho - end - return Yi -end - -__demand(__inline) -task Exports.GetRho(P : double, T : double, MixW : double, Mix : Exports.Mixture) - return P/(Mix.R * T) -end - -__demand(__inline) -task Exports.GetHeatCapacity(T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return Mix.gamma/(Mix.gamma-1)*Mix.R -end - -__demand(__inline) -task Exports.GetEnthalpy( T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture ) - return Mix.gamma/(Mix.gamma-1)*Mix.R*T -end - -__demand(__inline) -task Exports.GetSpeciesEnthalpy(i : int, T : double, Mix : Exports.Mixture) - return T*Mix.R*Mix.gamma/(Mix.gamma-1.0) -end - -__demand(__inline) -task Exports.GetSpeciesMolarWeight(i : int, Mix : Exports.Mixture) - return RGAS/Mix.R -end - -__demand(__inline) -task Exports.GetInternalEnergy(T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return T*Mix.R/(Mix.gamma-1.0) -end - -__demand(__inline) -task Exports.GetSpecificInternalEnergy(i : int, T : double, Mix : Exports.Mixture) - return T*Mix.R/(Mix.gamma-1.0) -end - -__demand(__inline) -task Exports.GetTFromInternalEnergy(e0 : double, T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return e0*(Mix.gamma-1.0)/Mix.R -end - -__demand(__inline) -task Exports.isValidInternalEnergy(e : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return (e > 0) -end - -__demand(__inline) -task Exports.GetTFromRhoAndP(rho: double, MixW : double, P : double) - return P*MixW/(rho*RGAS) -end - -__demand(__inline) -task Exports.GetPFromRhoAndT(rho: double, MixW : double, T : double) - return rho*RGAS*T/MixW -end - -__demand(__inline) -task Exports.GetViscosity(T : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - var viscosity = 0.0 - if (Mix.viscosityModel == SCHEMA.ViscosityModel_Constant) then - viscosity = Mix.constantVisc - else - if (Mix.viscosityModel == SCHEMA.ViscosityModel_PowerLaw) then - viscosity = (Mix.powerlawViscRef*pow((T/Mix.powerlawTempRef), double(0.7))) - else - viscosity = ((Mix.sutherlandViscRef*pow((T/Mix.sutherlandTempRef), (3.0/2.0)))*((Mix.sutherlandTempRef+Mix.sutherlandSRef)/(T+Mix.sutherlandSRef))) - end - end - return viscosity -end - -__demand(__inline) -task Exports.GetHeatConductivity(T : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - var cp = Mix.gamma/(Mix.gamma-1)*Mix.R - return cp/Mix.Prandtl*Exports.GetViscosity(T, Xi, Mix) -end - -__demand(__inline) -task Exports.GetGamma(T : double, MixW : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return Mix.gamma -end - -__demand(__inline) -task Exports.GetSpeedOfSound(T: double, gamma : double, MixW : double, Mix : Exports.Mixture) - return sqrt(Mix.gamma*Mix.R*T) -end - -__demand(__inline) -task Exports.GetDiffusivity(P: double, T : double, MixW : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - var Di : double[Exports.nSpec] - for i = 0, Exports.nSpec do - Di[i] = 0.0 - end - return Di -end - -__demand(__inline) -task Exports.GetProductionRates(rho : double, P : double, T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - var w : double[Exports.nSpec] - for i = 0, Exports.nSpec do - w[i] = 0.0 - end - return w -end - -__demand(__inline) -task Exports.Getdpde(rho : double, gamma : double, Mix : Exports.Mixture) - return rho*(Mix.gamma - 1) -end - -__demand(__inline) -task Exports.Getdpdrhoi(gamma : double, T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return array( Mix.R*T ) -end - -return Exports end diff --git a/src/IsentropicMix.hpp b/src/IsentropicMix.hpp deleted file mode 100644 index 3c85e35..0000000 --- a/src/IsentropicMix.hpp +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) "2019, by Stanford University -// Developer: Mario Di Renzo -// Affiliation: Center for Turbulence Research, Stanford University -// URL: https://ctr.stanford.edu -// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). -// HTR solver: An open-source exascale-oriented task-based -// multi-GPU high-order code for hypersonic aerothermodynamics. -// Computer Physics Communications 255, 107262" -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef IsentropicMix_HPP -#define IsentropicMix_HPP - -#include "IsentropicMix.h" - -#ifndef __CUDA_HD__ -#ifdef __CUDACC__ -#define __CUDA_HD__ __host__ __device__ -#else -#define __CUDA_HD__ -#endif -#endif - -__CUDA_HD__ -inline double GetMolarWeightFromYi(const double *Yi, const Mix &mix) { return RGAS/mix.R; } - -__CUDA_HD__ -inline double GetMolarWeightFromXi(const double *Xi, const Mix &mix) { return RGAS/mix.R; } - -__CUDA_HD__ -inline void GetMolarFractions(double *Xi, const double MixW, const double *Yi, const Mix &mix) { Xi[0] = Yi[0]; } - -__CUDA_HD__ -inline void GetMassFractions(double *Yi, const double MixW, const double *Xi, const Mix &mix) { Yi[0] = Xi[0]; } - -__CUDA_HD__ -inline double GetRho(const double P, const double T, const double MixW, const Mix &mix) { return pow(T, 1.0/(mix.gamma-1)); }; - -__CUDA_HD__ -inline double GetHeatCapacity(const double T, const double *Yi, const Mix &mix) { return mix.gamma/(mix.gamma-1)*mix.R; }; - -__CUDA_HD__ -inline double GetSpeciesEnthalpy(const int i, const double T, const Mix &mix) { return T*mix.R*mix.gamma/(mix.gamma-1.0); }; - -__CUDA_HD__ -inline double GetSpeciesMolarWeight(const int i, const Mix &mix) { return RGAS/mix.R; }; - -__CUDA_HD__ -inline double GetSpecificInternalEnergy(const int i, const double T, const Mix &mix) { return T*mix.R/(mix.gamma-1.0); }; - -__CUDA_HD__ -inline double GetViscosity(const double T, const double *Xi, const Mix &mix) { return 0.0; }; - -__CUDA_HD__ -inline double GetHeatConductivity(const double T, const double *Xi, const Mix &mix) { return 0.0; }; - -__CUDA_HD__ -inline double GetGamma(const double T, const double MixW, const double *Yi, const Mix &mix) { return mix.gamma; }; - -__CUDA_HD__ -inline double GetSpeedOfSound(const double T, const double gamma, const double MixW, const Mix &mix) { return sqrt(mix.gamma*mix.R*T); }; - -__CUDA_HD__ -inline void GetDiffusivity(double *Di, const double P, const double T, const double MixW, const double *Xi, const Mix &mix) { Di[0] = 0.0; } - -__CUDA_HD__ -inline double Getdpde(const double rho, const double gamma, const Mix &mix) { return rho*(mix.gamma - 1); }; - -__CUDA_HD__ -inline void Getdpdrhoi(double *dpdrhoi, const double gamma, const double T, const double *Yi, const Mix &mix) { dpdrhoi[0] = mix.R*T; }; - -#endif // IsentropicMix_HPP diff --git a/src/IsentropicMix.rg b/src/IsentropicMix.rg deleted file mode 100644 index 5d4c5f1..0000000 --- a/src/IsentropicMix.rg +++ /dev/null @@ -1,234 +0,0 @@ --- Copyright (c) "2019, by Stanford University --- Developer: Mario Di Renzo --- Affiliation: Center for Turbulence Research, Stanford University --- URL: https://ctr.stanford.edu --- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). --- HTR solver: An open-source exascale-oriented task-based --- multi-GPU high-order code for hypersonic aerothermodynamics. --- Computer Physics Communications 255, 107262" --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- * Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- * Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in the --- documentation and/or other materials provided with the distribution. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND --- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY --- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES --- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; --- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND --- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import "regent" - -return function(SCHEMA) local Exports = {} - --- Utility functions -local C = regentlib.c -local fabs = regentlib.fabs(double) -local pow = regentlib.pow(double) -local sqrt = regentlib.sqrt(double) - --- Constants -local RGAS = 8.3144598 -- [J/(mol K)] - -Exports.nSpec = 1 - -struct Exports.Mixture { - -- Mixture properties - R : double - gamma : double -} - -__demand(__inline) -task Exports.InitMixture(config : SCHEMA.Config) - regentlib.assert(config.Flow.mixture.type == SCHEMA.MixtureModel_IsentropicMix, - "This executable is expecting IsentropicMix in the input file"); - var Mix : Exports.Mixture - Mix.R = config.Flow.mixture.u.IsentropicMix.gasConstant - Mix.gamma = config.Flow.mixture.u.IsentropicMix.gamma - return Mix -end - -__demand(__inline) -task Exports.GetSpeciesNames(Mix : Exports.Mixture) - var Names : regentlib.string[Exports.nSpec] - Names[0] = "MIX" - return Names -end - -__demand(__inline) -task Exports.FindSpecies(name : &int8, Mix : Exports.Mixture) - return 0 -end - -__demand(__inline) -task Exports.CheckMixture(Yi : double[Exports.nSpec], Mix : Exports.Mixture) - var tmp = 0.0 - for i = 0, Exports.nSpec do - tmp += Yi[i] - end - tmp -= 1.0 --- TODO: the assert is not yet supported by the cuda compiler --- at the moment we return something in place of the assertion --- regentlib.assert(fabs(tmp)<1e-3, "Sum of Yi exceeded unit value"); - var err = 0 - if (fabs(tmp)>1e-3) then err = 1 end - return err -end - -__demand(__inline) -task Exports.ClipYi(Yi : double[Exports.nSpec]) - for i = 0, Exports.nSpec do - Yi[i] max= 1.0e-60 - Yi[i] min= 1.0 - end - return Yi -end - -__demand(__inline) -task Exports.GetMolarWeightFromYi(Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return RGAS/Mix.R -end - -__demand(__inline) -task Exports.GetMolarWeightFromXi(Xi : double[Exports.nSpec], Mix : Exports.Mixture) - return RGAS/Mix.R -end - -__demand(__inline) -task Exports.GetMolarFractions(MixW : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return Yi -end - -__demand(__inline) -task Exports.GetMassFractions(MixW : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - return Xi -end - -__demand(__inline) -task Exports.GetRhoFromRhoYi( rhoYi : double[Exports.nSpec] ) - var rho = rhoYi[0] - return rho -end - -__demand(__inline) -task Exports.GetYi(rho : double, rhoYi : double[Exports.nSpec]) - for i = 0, Exports.nSpec do - rhoYi[i] /= rho - end - return rhoYi -end - -__demand(__inline) -task Exports.GetRhoYiFromYi(rho : double, Yi : double[Exports.nSpec]) - for i = 0, Exports.nSpec do - Yi[i] *= rho - end - return Yi -end - -__demand(__inline) -task Exports.GetRho(P : double, T : double, MixW : double, Mix : Exports.Mixture) - return pow(T, 1.0/(Mix.gamma-1)) -end - -__demand(__inline) -task Exports.GetHeatCapacity(T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return Mix.gamma/(Mix.gamma-1)*Mix.R -end - -__demand(__inline) -task Exports.GetEnthalpy( T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture ) - return Mix.gamma/(Mix.gamma-1)*Mix.R*T -end - -__demand(__inline) -task Exports.GetSpeciesEnthalpy(i : int, T : double, Mix : Exports.Mixture) - return T*Mix.R*Mix.gamma/(Mix.gamma-1.0) -end - -__demand(__inline) -task Exports.GetSpeciesMolarWeight(i : int, Mix : Exports.Mixture) - return RGAS/Mix.R -end - -__demand(__inline) -task Exports.GetInternalEnergy(T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return T*Mix.R/(Mix.gamma-1.0) -end - -__demand(__inline) -task Exports.GetSpecificInternalEnergy(i : int, T : double, Mix : Exports.Mixture) - return T*Mix.R/(Mix.gamma-1.0) -end - -__demand(__inline) -task Exports.GetTFromInternalEnergy(e0 : double, T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return e0*(Mix.gamma-1.0)/Mix.R -end - -__demand(__inline) -task Exports.isValidInternalEnergy(e : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return (e > 0) -end - -__demand(__inline) -task Exports.GetTFromRhoAndP(rho: double, MixW : double, P : double) - return P*MixW/(rho*RGAS) -end - -__demand(__inline) -task Exports.GetPFromRhoAndT(rho: double, MixW : double, T : double) - return rho*RGAS*T/MixW -end - -__demand(__inline) -task Exports.GetViscosity(T : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - return 0.0 -end - -__demand(__inline) -task Exports.GetHeatConductivity(T : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - return 0.0 -end - -__demand(__inline) -task Exports.GetGamma(T : double, MixW : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return Mix.gamma -end - -__demand(__inline) -task Exports.GetSpeedOfSound(T: double, gamma : double, MixW : double, Mix : Exports.Mixture) - return sqrt(Mix.gamma*Mix.R*T) -end - -__demand(__inline) -task Exports.GetDiffusivity(P: double, T : double, MixW : double, Xi : double[Exports.nSpec], Mix : Exports.Mixture) - return array(0.0) -end - -__demand(__inline) -task Exports.GetProductionRates(rho : double, P : double, T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return array(0.0) -end - -__demand(__inline) -task Exports.Getdpde(rho : double, gamma : double, Mix : Exports.Mixture) - return rho*(Mix.gamma - 1) -end - -__demand(__inline) -task Exports.Getdpdrhoi(gamma : double, T : double, Yi : double[Exports.nSpec], Mix : Exports.Mixture) - return array( Mix.R*T ) -end - -return Exports end diff --git a/src/Makefile b/src/Makefile index 58c4315..8965fb9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,194 +1,277 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif +####################################################### +# Include standard variables +####################################################### +include $(HTR_DIR)/Makefile.in -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif +###################################################### +# Get git commit version and date +###################################################### +SOLVER_VERSION := ""$(shell git --no-pager describe --tags --always --dirty)" committed on "$(firstword $(shell git --no-pager show --date=short --format="%ad" --name-only))"" -# CUDA options -USE_CUDA ?= 1 +LEGION_VERSION := ""$(shell cd $(LEGION_DIR); git --no-pager describe --tags --always --dirty)" committed on "$(firstword $(shell cd $(LEGION_DIR); git --no-pager show --date=short --format="%ad" --name-only))"" -# OpenMP options -USE_OPENMP ?= 1 +###################################################### +# Mixtures +###################################################### +ConstPropMixH= config_schema.o Utils/constants.h Mixtures/ConstPropMix.hpp +ConstPropMixHPP= Utils/my_array.hpp $(ConstPropMixH:.hpp=.inl) $(ConstPropMixH) -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 +IsentropicMixH= config_schema.o Utils/constants.h Mixtures/IsentropicMix.hpp +IsentropicMixHPP= Utils/my_array.hpp $(IsentropicMixH:.hpp=.inl) $(IsentropicMixH) -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent +AirMixH= Utils/constants.h Mixtures/Species.hpp Mixtures/Reaction.hpp Mixtures/MultiComponent.hpp config_schema.o Mixtures/AirMix.hpp +AirMixHPP= Utils/my_array.hpp Mixtures/Species.inl Mixtures/Reaction.inl Mixtures/MultiComponent.inl $(AirMixH) -# Regent options -export INCLUDE_PATH := . -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif +CH41StMixH= Utils/constants.h Mixtures/Species.hpp Mixtures/Reaction.hpp Mixtures/MultiComponent.hpp config_schema.o Mixtures/CH41StMix.hpp +CH41StMixHPP= Utils/my_array.hpp Mixtures/Species.inl Mixtures/Reaction.inl Mixtures/MultiComponent.inl $(CH41StMixH) -# Link flags -ifdef CRAYPE_VERSION - LINK_FLAGS += -Bdynamic - LINK_FLAGS += $(CRAY_UGNI_POST_LINK_OPTS) -lugni - LINK_FLAGS += $(CRAY_UDREG_POST_LINK_OPTS) -ludreg -endif -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - -# Get git commit version and date -SOLVER_VERSION := ""$(shell git --no-pager describe --tags --always --dirty)" committed on "$(firstword $(shell git --no-pager show --date=short --format="%ad" --name-only))"" +CH4_30SpMixH= Utils/constants.h Mixtures/Species.hpp Mixtures/Reaction.hpp Mixtures/MultiComponent.hpp config_schema.o Mixtures/CH4_30SpMix.hpp +CH4_30SpMixHPP= Utils/my_array.hpp Mixtures/Species.inl Mixtures/Reaction.inl Mixtures/MultiComponent.inl $(CH4_30SpMixH) -LEGION_VERSION := ""$(shell cd $(LEGION_DIR); git --no-pager describe --tags --always --dirty)" committed on "$(firstword $(shell cd $(LEGION_DIR); git --no-pager show --date=short --format="%ad" --name-only))"" +CH4_43SpIonsMixH= Utils/constants.h Mixtures/Species.hpp Mixtures/Reaction.hpp Mixtures/MultiComponent.hpp config_schema.o Mixtures/CH4_43SpIonsMix.hpp +CH4_43SpIonsMixHPP= Utils/my_array.hpp Mixtures/Species.inl Mixtures/Reaction.inl Mixtures/MultiComponent.inl $(CH4_43SpIonsMixH) + +FFCM1MixH= Utils/constants.h Mixtures/Species.hpp Mixtures/Reaction.hpp Mixtures/MultiComponent.hpp config_schema.o Mixtures/FFCM1Mix.hpp +FFCM1MixHPP= Utils/my_array.hpp Mixtures/Species.inl Mixtures/Reaction.inl Mixtures/MultiComponent.inl $(FFCM1MixH) +BoivinMixH= Utils/constants.h Mixtures/Species.hpp Mixtures/Reaction.hpp Mixtures/MultiComponent.hpp config_schema.o Mixtures/BoivinMix.hpp +BoivinMixHPP= Utils/my_array.hpp Mixtures/Species.inl Mixtures/Reaction.inl Mixtures/MultiComponent.inl $(BoivinMixH) + +###################################################### +# Rules +###################################################### .PHONY: default all clean force + .PRECIOUS: solver_version~ legion_version~ version.rg prometeo_main_%.o \ - prometeo_metric_%_gpu.o prometeo_metric_%_cpu.o prometeo_rhs_%_gpu.o prometeo_rhs_%_cpu.o \ - prometeo_sensor_%_gpu.o prometeo_sensor_%_cpu.o prometeo_variables_%_gpu.o prometeo_variables_%_cpu.o -.SUFFIXES: .rg .cc .cu .h .o + prometeo_%_gpu.a prometeo_%_gpu.o prometeo_%_cpu.a \ + prometeo_mixture_%_gpu.o prometeo_mixture_%_cpu.o \ + prometeo_metric_%_gpu.o prometeo_metric_%_cpu.o \ + prometeo_rhs_%_gpu.o prometeo_rhs_%_cpu.o \ + prometeo_sensor_%_gpu.o prometeo_sensor_%_cpu.o \ + prometeo_variables_%_gpu.o prometeo_variables_%_cpu.o \ + prometeo_chem_%_gpu.o prometeo_chem_%_cpu.o\ + prometeo_bc_%_gpu.o prometeo_bc_%_cpu.o \ + prometeo_average_%_gpu.o prometeo_average_%_cpu.o \ + prometeo_cfl_%_gpu.o prometeo_cfl_%_cpu.o \ + Poisson/Poisson_%_cpu.o Poisson/Poisson_%_gpu.o \ + prometeo_electricField_%_cpu.o prometeo_electricField_%_gpu.o + +.SUFFIXES: .rg .cc .cu .h .o .a default: prometeo_ConstPropMix.exec prometeo_IsentropicMix.exec prometeo_AirMix.exec \ - prometeo_CH41StMix.exec + prometeo_CH41StMix.exec prometeo_CH4_30SpMix.exec prometeo_FFCM1Mix.exec \ + $(if $(filter $(strip $(ELECTRIC_FIELD)), 1), prometeo_CH4_43SpIonsMix.exec) -Headers= prometeo_registrar.h prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h -Common= hdf_helper.rg util-desugared.rg math_utils.rg prometeo_const.rg prometeo_macro.rg \ - prometeo_grid.rg prometeo_metric.rg prometeo_IO.rg prometeo_cfl.rg prometeo_chem.rg \ - prometeo_init.rg prometeo_variables.rg prometeo_average.rg prometeo_rk.rg \ - prometeo_sensor.rg prometeo_rhs.rg prometeo_stat.rg prometeo_bc.rg \ - prometeo_profiles.rg prometeo_partitioner.rg prometeo_probe.rg +###################################################### +# Objects +###################################################### +Headers= prometeo_registrar.h prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_bc_types.h \ + prometeo_average_types.h prometeo_mixture_wrappers.hpp Utils/math_utils.h -ConstPropMixH= ConstPropMix.h -ConstPropMixHPP= $(ConstPropMixH:.h=.hpp) -ConstPropMixRG= $(ConstPropMixH:.h=.rg) +Utils = Utils/task_helper.hpp Utils/my_array.hpp Utils/PointDomain_helper.hpp -IsentropicMixH= IsentropicMix.h -IsentropicMixHPP= $(IsentropicMixH:.h=.hpp) -IsentropicMixRG= $(IsentropicMixH:.h=.rg) +MathUtils = Utils/math_utils.h Utils/math_utils.hpp -AirMixH= Species.h Reaction.h AirMix.h -AirMixHPP= Species.hpp MultiComponent.hpp AirMix.hpp -AirMixRG= $(AirMixH:.h=.rg) MultiComponent.rg +Common= hdf_helper.rg util-desugared.rg Utils/math_utils.rg prometeo_const.rg prometeo_macro.rg \ + prometeo_grid.rg prometeo_metric.rg prometeo_IO.rg prometeo_cfl.rg prometeo_chem.rg \ + prometeo_init.rg prometeo_variables.rg prometeo_average.rg prometeo_rk.rg \ + prometeo_sensor.rg prometeo_rhs.rg prometeo_stat.rg prometeo_bc.rg prometeo_mixture.rg \ + prometeo_profiles.rg prometeo_partitioner.rg prometeo_probe.rg -CH41StMixH= Species.h Reaction.h CH41StMix.h -CH41StMixHPP= Species.hpp MultiComponent.hpp CH41StMix.hpp -CH41StMixRG= $(CH41StMixH:.h=.rg) MultiComponent.rg +ifeq ($(ELECTRIC_FIELD), 1) +Headers+= Poisson/Poisson.h prometeo_electricField.h +Common+= Poisson/Poisson.rg prometeo_electricField.rg +endif +###################################################### +# Recipes +###################################################### clean: - $(RM) *.exec *.o *-desugared.rg config_schema.h version.rg solver_version~ legion_version~ + $(RM) *.exec *.o *.a *-desugared.rg config_schema.h version.rg solver_version~ legion_version~ + $(RM) Mixtures/*.o Poisson/*.o %-desugared.rg: %.rg ./desugar.py $< > $@ getRecipe = $(if $(DEPENDENCY_GRAPH),@echo Target $@ depends on prerequisites "$^",$(1)) -prometeo_%.exec: prometeo_main_%.o prometeo_mapper.o prometeo_registrar.o config_schema.o json.o \ - prometeo_metric_%_cpu.o $(if $(filter $(strip $(USE_CUDA)), 1), prometeo_metric_%_gpu.o) \ - prometeo_sensor_%_cpu.o $(if $(filter $(strip $(USE_CUDA)), 1), prometeo_sensor_%_gpu.o) \ - prometeo_variables_%_cpu.o $(if $(filter $(strip $(USE_CUDA)), 1), prometeo_variables_%_gpu.o) \ - prometeo_rhs_%_cpu.o $(if $(filter $(strip $(USE_CUDA)), 1), prometeo_rhs_%_gpu.o) +prometeo_%.exec: prometeo_main_%.o prometeo_%_cpu.a $(if $(filter $(strip $(USE_CUDA)), 1), prometeo_%_gpu.a) $(call getRecipe) $(CXX) -o $@ $^ $(LINK_FLAGS) +prometeo_%_cpu.a: prometeo_mapper.o prometeo_registrar.o config_schema.o json.o \ + prometeo_metric_coeffs_cpu.o prometeo_mixture_%_cpu.o prometeo_metric_%_cpu.o prometeo_sensor_%_cpu.o \ + prometeo_variables_%_cpu.o prometeo_rhs_%_cpu.o prometeo_chem_%_cpu.o prometeo_bc_%_cpu.o \ + prometeo_average_%_cpu.o prometeo_cfl_%_cpu.o \ + $(if $(filter $(strip $(ELECTRIC_FIELD)), 1), prometeo_electricField_%_cpu.o Poisson/Poisson_%_cpu.o) + $(call getRecipe) + $(AR) rcs $@ $^ + +prometeo_%_gpu.a: prometeo_metric_coeffs_gpu.o prometeo_mixture_%_gpu.o prometeo_metric_%_gpu.o prometeo_sensor_%_gpu.o \ + prometeo_variables_%_gpu.o prometeo_rhs_%_gpu.o prometeo_chem_%_gpu.o prometeo_bc_%_gpu.o \ + prometeo_average_%_gpu.o prometeo_cfl_%_gpu.o \ + $(if $(filter $(strip $(ELECTRIC_FIELD)), 1), prometeo_electricField_%_gpu.o Poisson/Poisson_%_gpu.o) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -dlink $^ -o $(@:.a=.o) + $(NVCC) -lib -o $@ $^ $(@:.a=.o) + .SECONDEXPANSION: -prometeo_main_%.o: version.rg prometeo_types.h prometeo-desugared.rg prometeo_mapper.h config_schema.o \ - config_schema.o $$($$*RG) $(Headers) $(Common) +prometeo_main_%.o: version.rg prometeo_types.h prometeo-desugared.rg prometeo_mapper.h $$($$*H) $(Headers) $(Common) $(call getRecipe) EOS="$*" $(REGENT) prometeo-desugared.rg $(REGENT_FLAGS) .SECONDEXPANSION: -prometeo_metric_%_cpu.o: prometeo_metric.cc prometeo_metric.h prometeo_metric.hpp prometeo_metric.inl task_helper.h \ - prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h config_schema.o +prometeo_mixture_%_cpu.o: prometeo_mixture.cc prometeo_mixture.h prometeo_mixture.hpp prometeo_mixture_wrappers.hpp $(Utils) \ + prometeo_const.h prometeo_types.h $$($$*HPP) $(call getRecipe) - $(CXX) $(CXXFLAGS) -DEOS="$*" -c -o $@ $< + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< .SECONDEXPANSION: -prometeo_metric_%_gpu.o: prometeo_metric.cu prometeo_metric.h prometeo_metric.hpp prometeo_metric.inl task_helper.h cuda_utils.hpp \ - prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h config_schema.o +prometeo_mixture_%_gpu.o: prometeo_mixture.cu prometeo_mixture.h prometeo_mixture.hpp prometeo_mixture_wrappers.hpp $(Utils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h $$($$*HPP) $(call getRecipe) - $(NVCC) $(NVCCFLAGS) -DEOS="$*" -c -o $@ $< + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< .SECONDEXPANSION: -prometeo_variables_%_cpu.o: prometeo_variables.cc prometeo_variables.h prometeo_variables.hpp prometeo_metric.inl task_helper.h \ - prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h config_schema.o +prometeo_metric_%_cpu.o: prometeo_metric.cc prometeo_metric.h prometeo_metric.hpp prometeo_metric.inl $(Utils) \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h $$($$*HPP) $(call getRecipe) - $(CXX) $(CXXFLAGS) -DEOS="$*" -c -o $@ $< + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< .SECONDEXPANSION: -prometeo_variables_%_gpu.o: prometeo_variables.cu prometeo_variables.h prometeo_variables.hpp prometeo_metric.inl task_helper.h cuda_utils.hpp \ - prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h config_schema.o +prometeo_metric_%_gpu.o: prometeo_metric.cu prometeo_metric.h prometeo_metric.hpp prometeo_metric.inl $(Utils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h $$($$*HPP) $(call getRecipe) - $(NVCC) $(NVCCFLAGS) -DEOS="$*" -c -o $@ $< + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< + +.SECONDEXPANSION: +prometeo_variables_%_cpu.o: prometeo_variables.cc prometeo_variables.h prometeo_variables.hpp prometeo_metric.inl $(Utils) \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h $$($$*HPP) + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< + +.SECONDEXPANSION: +prometeo_variables_%_gpu.o: prometeo_variables.cu prometeo_variables.h prometeo_variables.hpp prometeo_metric.inl $(Utils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h $$($$*HPP) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< .SECONDEXPANSION: prometeo_sensor_%_cpu.o: prometeo_sensor.cc prometeo_sensor.h prometeo_sensor.hpp prometeo_sensor.inl prometeo_metric.inl \ - task_helper.h prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h config_schema.o + $(Utils) prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h $$($$*HPP) $(call getRecipe) - $(CXX) $(CXXFLAGS) -DEOS="$*" -c -o $@ $< + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< .SECONDEXPANSION: prometeo_sensor_%_gpu.o: prometeo_sensor.cu prometeo_sensor.h prometeo_sensor.hpp prometeo_sensor.inl prometeo_metric.inl \ - task_helper.h cuda_utils.hpp prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h config_schema.o + $(Utils) Utils/cuda_utils.hpp prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h $$($$*HPP) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< + +.SECONDEXPANSION: +prometeo_rhs_%_cpu.o: prometeo_rhs.cc prometeo_rhs.h prometeo_rhs.hpp prometeo_rhs.inl $(Utils) $(MathUtils) \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl $$($$*HPP) + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< + +.SECONDEXPANSION: +prometeo_rhs_%_gpu.o: prometeo_rhs.cu prometeo_rhs.h prometeo_rhs.hpp prometeo_rhs.inl $(Utils) $(MathUtils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl $$($$*HPP) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< + +.SECONDEXPANSION: +prometeo_chem_%_cpu.o: prometeo_chem.cc prometeo_chem.h prometeo_chem.hpp $(Utils) $(MathUtils) \ + prometeo_const.h prometeo_types.h $$($$*HPP) + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< + +.SECONDEXPANSION: +prometeo_chem_%_gpu.o: prometeo_chem.cu prometeo_chem.h prometeo_chem.hpp $(Utils) $(MathUtils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h $$($$*HPP) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< + +.SECONDEXPANSION: +prometeo_bc_%_cpu.o: prometeo_bc.cc prometeo_bc.h prometeo_bc.hpp prometeo_bc_types.h prometeo_variables.hpp prometeo_redop.inl \ + $(Utils) $(MathUtils) prometeo_const.h prometeo_types.h $$($$*HPP) + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< + +.SECONDEXPANSION: +prometeo_bc_%_gpu.o: prometeo_bc.cu prometeo_bc.h prometeo_bc.hpp prometeo_bc_types.h prometeo_variables.hpp prometeo_redop.inl \ + $(Utils) $(MathUtils) Utils/cuda_utils.hpp prometeo_const.h prometeo_types.h $$($$*HPP) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< + +.SECONDEXPANSION: +prometeo_average_%_cpu.o: prometeo_average.cc prometeo_average.h prometeo_average.hpp prometeo_average.inl prometeo_average_types.h \ + prometeo_redop.inl $(Utils) prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl $$($$*HPP) + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< + +.SECONDEXPANSION: +prometeo_average_%_gpu.o: prometeo_average.cu prometeo_average.h prometeo_average.hpp prometeo_average.inl prometeo_average_types.h \ + prometeo_redop.inl $(Utils) Utils/cuda_utils.hpp prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl $$($$*HPP) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< + +.SECONDEXPANSION: +prometeo_cfl_%_cpu.o: prometeo_cfl.cc prometeo_cfl.h prometeo_cfl.hpp $(Utils) prometeo_const.h prometeo_types.h $$($$*HPP) + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< + +.SECONDEXPANSION: +prometeo_cfl_%_gpu.o: prometeo_cfl.cu prometeo_cfl.h prometeo_cfl.hpp $(Utils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h $$($$*HPP) + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< + +prometeo_metric_coeffs_cpu.o: prometeo_metric_coeffs.cc prometeo_metric_coeffs.h + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -c -o $@ $< + +prometeo_metric_coeffs_gpu.o: prometeo_metric_coeffs.cu prometeo_metric_coeffs.h + $(call getRecipe) + $(NVCC) $(NVCC_FLAGS) -dc -o $@ $< + +.SECONDEXPANSION: +Poisson/Poisson_%_cpu.o: Poisson/Poisson.cc Poisson/Poisson.h Poisson/Poisson.hpp $(Utils) \ + prometeo_const.h prometeo_types.h $$($$*HPP) + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< + +.SECONDEXPANSION: +Poisson/Poisson_%_gpu.o: Poisson/Poisson.cu Poisson/Poisson.h Poisson/Poisson.hpp $(Utils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h $$($$*HPP) $(call getRecipe) - $(NVCC) $(NVCCFLAGS) -DEOS="$*" -c -o $@ $< + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< .SECONDEXPANSION: -prometeo_rhs_%_cpu.o: prometeo_rhs.cc prometeo_rhs.h prometeo_rhs.hpp prometeo_rhs.inl task_helper.h math_utils.hpp \ - prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl config_schema.o \ - $$($$*H) $$($$*HPP) +prometeo_electricField_%_cpu.o: prometeo_electricField.cc prometeo_electricField.h prometeo_electricField.hpp prometeo_electricField.inl \ + Poisson/Poisson.h Poisson/Poisson.hpp $(Utils) \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl $$($$*HPP) $(call getRecipe) - $(CXX) $(CXXFLAGS) -DEOS="$*" -c -o $@ $< + $(CXX) $(CXX_FLAGS) -DEOS="$*" -c -o $@ $< .SECONDEXPANSION: -prometeo_rhs_%_gpu.o: prometeo_rhs.cu prometeo_rhs.h prometeo_rhs.hpp prometeo_rhs.inl task_helper.h math_utils.hpp cuda_utils.hpp \ - prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl config_schema.o \ - $$($$*H) $$($$*HPP) +prometeo_electricField_%_gpu.o: prometeo_electricField.cu prometeo_electricField.h prometeo_electricField.hpp prometeo_electricField.inl \ + Poisson/Poisson.h Poisson/Poisson.hpp $(Utils) Utils/cuda_utils.hpp \ + prometeo_const.h prometeo_types.h prometeo_metric_coeffs.h prometeo_metric.inl $$($$*HPP) $(call getRecipe) - $(NVCC) $(NVCCFLAGS) -DEOS="$*" -c -o $@ $< + $(NVCC) $(NVCC_FLAGS) -DEOS="$*" -dc -o $@ $< -prometeo_registrar.o: prometeo_registrar.cc prometeo_registrar.h prometeo_mapper.h prometeo_metric.h prometeo_rhs.h +prometeo_registrar.o: prometeo_registrar.cc prometeo_registrar.h \ + prometeo_mapper.h prometeo_variables.h prometeo_mixture.h \ + prometeo_metric.h prometeo_sensor.h prometeo_chem.h \ + prometeo_bc.h prometeo_rhs.h prometeo_cfl.h prometeo_average.h \ + $(if $(filter $(strip $(ELECTRIC_FIELD)), 1), prometeo_electricField.h Poisson/Poisson.h) $(call getRecipe) - $(CXX) $(CXXFLAGS) -c -o $@ $< + $(CXX) $(CXX_FLAGS) -c -o $@ $< prometeo_mapper.o: prometeo_mapper.cc prometeo_mapper.h config_schema.o $(call getRecipe) - $(CXX) $(CXXFLAGS) -c -o $@ $< + $(CXX) $(CXX_FLAGS) -c -o $@ $< config_schema.o: process_schema.rg config_schema.lua json.h util-desugared.rg $(call getRecipe) @@ -196,7 +279,7 @@ config_schema.o: process_schema.rg config_schema.lua json.h util-desugared.rg json.o: json.c json.h $(call getRecipe) - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(C_FLAGS) -c -o $@ $< # recompile version.h dependants when GIT_VERSION changes, uses temporary file version~ solver_version~: force diff --git a/src/Mixtures/AirMix.hpp b/src/Mixtures/AirMix.hpp new file mode 100644 index 0000000..b6c6040 --- /dev/null +++ b/src/Mixtures/AirMix.hpp @@ -0,0 +1,357 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef AirMix_HPP +#define AirMix_HPP + +#include "config_schema.h" + +// Number of species +#define nSpec 5 +// Number of charged species +#define nIons 0 +// Number of standard reactions +#define nReac 2 +// Number of third bodies reactions +#define nTBReac 3 +// Number of falloff reactions +#define nFOReac 0 +// Maximum number of reactants in a reaction +#define MAX_NUM_REACTANTS 2 +// Maximum number of products in a reaction +#define MAX_NUM_PRODUCTS 2 +// Maximum number of colliders in a reaction +#define MAX_NUM_TB 5 +// Number of Nasa polynomials +#define N_NASA_POLY 3 +// Use mass action kinetics +#undef FWD_ORDERS + +#include "MultiComponent.hpp" + +#ifdef __cplusplus +// We cannot expose these methods to Regent + +//--------------------------------- +// Define Species +//--------------------------------- + +// CH4 +#define iN2 0 +#define N2 { \ + /* Name = */ (char*)("N2"), \ + /* W = */ 2*14.0067e-3, \ + /* inx = */ iN2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 20000.0007, \ + /* cpH = */ { 8.310139160e+08,-6.420733540e+05, 2.020264635e+02,-3.065092046e-02, 2.486903333e-06,-9.705954110e-11, 1.437538881e-15, 4.938707040e+06,-1.672099740e+03 }, \ + /* cpM = */ { 5.877124060e+05,-2.239249073e+03, 6.066949220e+00,-6.139685500e-04, 1.491806679e-07,-1.923105485e-11, 1.061954386e-15, 1.283210415e+04,-1.586640027e+01 }, \ + /* cpL = */ { 2.210371497e+04,-3.818461820e+02, 6.082738360e+00,-8.530914410e-03, 1.384646189e-05,-9.625793620e-09, 2.519705809e-12, 7.108460860e+02,-1.076003744e+01 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.621*ATom, \ + /* kbOveps = */ 1.0/97.530, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 1.760*ATom*ATom*ATom, \ + /* Z298 = */ 4.000 \ + } \ + } + +// O2 +#define iO2 1 +#define O2 { \ + /* Name = */ (char*)("O2"), \ + /* W = */ 2*15.9994e-3, \ + /* inx = */ iO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 20000.0007, \ + /* cpH = */ { 4.975294300e+08,-2.866106874e+05, 6.690352250e+01,-6.169959020e-03, 3.016396027e-07,-7.421416600e-12, 7.278175770e-17, 2.293554027e+06,-5.530621610e+02 }, \ + /* cpM = */ {-1.037939022e+06, 2.344830282e+03, 1.819732036e+00, 1.267847582e-03,-2.188067988e-07, 2.053719572e-11,-8.193467050e-16,-1.689010929e+04, 1.738716506e+01 }, \ + /* cpL = */ {-3.425563420e+04, 4.847000970e+02, 1.119010961e+00, 4.293889240e-03,-6.836300520e-07,-2.023372700e-09, 1.039040018e-12,-3.391454870e+03, 1.849699470e+01 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.40, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 1.600*ATom*ATom*ATom, \ + /* Z298 = */ 3.8000 \ + } \ + } + +// NO +#define iNO 2 +#define NO { \ + /* Name = */ (char*)("NO"), \ + /* W = */ 14.0067e-3+15.9994e-3, \ + /* inx = */ iNO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 20000.0007, \ + /* cpH = */ {-9.575303540e+08, 5.912434480e+05,-1.384566826e+02, 1.694339403e-02,-1.007351096e-06, 2.912584076e-11,-3.295109350e-16,-4.677501240e+06, 1.242081216e+03 }, \ + /* cpM = */ { 2.239018716e+05,-1.289651623e+03, 5.433936030e+00,-3.656034900e-04, 9.880966450e-08,-1.416076856e-11, 9.380184620e-16, 1.750317656e+04,-8.501669090e+00 }, \ + /* cpL = */ {-1.143916503e+04, 1.536467592e+02, 3.431468730e+00,-2.668592368e-03, 8.481399120e-06,-7.685111050e-09, 2.386797655e-12, 9.098214410e+03, 6.728725490e+00 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.621*ATom, \ + /* kbOveps = */ 1.0/97.530, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 1.760*ATom*ATom*ATom, \ + /* Z298 = */ 4.000 \ + } \ + } + +// N +#define iN 3 +#define N { \ + /* Name = */ (char*)("N"), \ + /* W = */ 14.0067e-3, \ + /* inx = */ iN, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 20000.0007, \ + /* cpH = */ { 5.475181050e+08,-3.107574980e+05, 6.916782740e+01,-6.847988130e-03, 3.827572400e-07,-1.098367709e-11, 1.277986024e-16, 2.550585618e+06,-5.848769753e+02 }, \ + /* cpM = */ { 8.876501380e+04,-1.071231500e+02, 2.362188287e+00, 2.916720081e-04,-1.729515100e-07, 4.012657880e-11,-2.677227571e-15, 5.697351330e+04, 4.865231506e+00 }, \ + /* cpL = */ { 0.000000000e+00, 0.000000000e+00, 2.500000000e+00, 0.000000000e+00, 0.000000000e+00, 0.000000000e+00, 0.000000000e+00, 5.610463780e+04, 4.193905036e+00 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 3.298*ATom, \ + /* kbOveps = */ 1.0/71.400, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 0.000*ATom*ATom*ATom, \ + /* Z298 = */ 0.000 \ + } \ + } + +// O +#define iO 4 +#define O { \ + /* Name = */ (char*)("O"), \ + /* W = */ 15.9994e-3, \ + /* inx = */ iO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 20000.0007, \ + /* cpH = */ { 1.779004264e+08,-1.082328257e+05, 2.810778365e+01,-2.975232262e-03, 1.854997534e-07,-5.796231540e-12, 7.191720164e-17, 8.890942630e+05,-2.181728151e+02 }, \ + /* cpM = */ { 2.619020262e+05,-7.298722030e+02, 3.317177270e+00,-4.281334360e-04, 1.036104594e-07,-9.438304330e-12, 2.725038297e-16, 3.392428060e+04,-6.679585350e-01 }, \ + /* cpL = */ {-7.953611300e+03, 1.607177787e+02, 1.966226438e+00, 1.013670310e-03,-1.110415423e-06, 6.517507500e-10,-1.584779251e-13, 2.840362437e+04, 8.404241820e+00 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.750*ATom, \ + /* kbOveps = */ 1.0/80.000, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 0.000*ATom*ATom*ATom, \ + /* Z298 = */ 0.000 \ + } \ + } + +//--------------------------------- +// Define Reactions +//--------------------------------- + +// Oxygen dissociation (O2 + M -> 2O + M) +#define R1 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.0e15, \ + /* n = */ -1.5, \ + /* EovR = */ 59500, \ + }, \ + /* has_backward = */ true, \ + /* . Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iO2, /* nu = */ 1.0}, \ + { /* ind = */ 0, /* nu = */ 0.0}, \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO, /* nu = */ 2.0}, \ + { /* ind = */ 0, /* nu = */ 0.0}, \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iO2, /* eff = */ 1.0}, \ + { /* ind = */ iNO, /* eff = */ 1.0}, \ + { /* ind = */ iN2, /* eff = */ 1.0}, \ + { /* ind = */ iO, /* eff = */ 5.0}, \ + { /* ind = */ iN, /* eff = */ 5.0}, \ + } \ + } + +// NO dissociation (NO + M -> N + O + M) +#define R2 { \ + /* ArrCoeff = */ { \ + /* A = */ 5e9, \ + /* n = */ 0.0, \ + /* EovR = */ 75500, \ + }, \ + /* has_backward = */ true, \ + /* . Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iNO, /* nu = */ 1.0}, \ + { /* ind = */ 0, /* nu = */ 0.0}, \ + }, \ + /* pducts = */ { \ + { /* ind = */ iN, /* nu = */ 1.0}, \ + { /* ind = */ iO, /* nu = */ 1.0}, \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iO2, /* eff = */ 1.0}, \ + { /* ind = */ iNO, /* eff = */ 22.0}, \ + { /* ind = */ iN2, /* eff = */ 1.0}, \ + { /* ind = */ iO, /* eff = */ 22.0}, \ + { /* ind = */ iN, /* eff = */ 22.0}, \ + } \ + } + +// N2 dissociation (N2 + M -> 2N + M) +#define R3 { \ + /* ArrCoeff = */ { \ + /* A = */ 7e15, \ + /* n = */ -1.6, \ + /* EovR = */ 113200, \ + }, \ + /* has_backward = */ true, \ + /* . Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iN2, /* nu = */ 1.0}, \ + { /* ind = */ 0, /* nu = */ 0.0}, \ + }, \ + /* pducts = */ { \ + { /* ind = */ iN, /* nu = */ 2.0}, \ + { /* ind = */ 0, /* nu = */ 0.0}, \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iO2, /* eff = */ 1.0}, \ + { /* ind = */ iNO, /* eff = */ 1.0}, \ + { /* ind = */ iN2, /* eff = */ 1.0}, \ + { /* ind = */ iO, /* eff = */ 30.0/7}, \ + { /* ind = */ iN, /* eff = */ 30.0/7}, \ + } \ + } + +// Zeldovich 1 (N2 + O -> NO + N) +#define R4 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.4e11, \ + /* n = */ -1.0, \ + /* EovR = */ 38400, \ + }, \ + /* has_backward = */ true, \ + /* . Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iN2, /* nu = */ 1.0}, \ + { /* ind = */ iO, /* nu = */ 1.0}, \ + }, \ + /* pducts = */ { \ + { /* ind = */ iNO, /* nu = */ 1.0}, \ + { /* ind = */ iN, /* nu = */ 1.0}, \ + } \ + } + +// Zeldovich 2 (NO + O -> O2 + N) +#define R5 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.4e6, \ + /* n = */ 0.0, \ + /* EovR = */ 19400, \ + }, \ + /* has_backward = */ true, \ + /* . Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iNO, /* nu = */ 1.0}, \ + { /* ind = */ iO, /* nu = */ 1.0}, \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2, /* nu = */ 1.0}, \ + { /* ind = */ iN, /* nu = */ 1.0}, \ + } \ + } + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : + species({N2, O2, NO, N, O}), + reactions({R4, R5}), + ThirdbodyReactions({R1, R2, R3}) +{ + // This executable is expecting AirMix in the input file + assert(config.Flow.mixture.type == MixtureModel_AirMix); + + // Store reference quantities + StoreReferenceQuantities(config.Flow.mixture.u.AirMix.PRef, + config.Flow.mixture.u.AirMix.TRef, + config.Flow.mixture.u.AirMix.LRef, + config.Flow.mixture.u.AirMix.XiRef); +}; +#endif + +//--------------------------------- +// Cleanup +//--------------------------------- +#undef iN2 +#undef N2 +#undef iO2 +#undef O2 +#undef iNO +#undef NO +#undef iN +#undef N +#undef iO +#undef O + +#undef R1 +#undef R2 +#undef R3 +#undef R4 +#undef R5 + +#endif //__cplusplus + +#endif // AirMix_HPP diff --git a/src/Mixtures/BoivinMix.hpp b/src/Mixtures/BoivinMix.hpp new file mode 100644 index 0000000..f5616d0 --- /dev/null +++ b/src/Mixtures/BoivinMix.hpp @@ -0,0 +1,643 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Call Scientifique +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __BOIVINMIX_HPP__ +#define __BOIVINMIX_HPP__ + +// Number of species +#define nSpec 9 +// Number of charged species +#define nIons 0 +// Number of standard reactions +#define nReac 8 +// Number of thirdbody reactions +#define nTBReac 2 +// Number of falloff reactions +#define nFOReac 2 +// Maximum number of reactants in a reaction +#define MAX_NUM_REACTANTS 2 +// Maximum number of products in a reaction +#define MAX_NUM_PRODUCTS 2 +// Maximum number of colliders in a reaction +#define MAX_NUM_TB 3 +// Number of Nasa polynomials +#define N_NASA_POLY 3 +// Switch to mass action kinetics +#undef FWD_ORDERS + +#include "MultiComponent.hpp" + +#ifdef __cplusplus +// We cannot expose these methods to Regent + +//--------------------------------- +// Define Species +//--------------------------------- + +// H2 +#define iH2 0 +#define H2 { \ + /* Name = */ (char*)("H2"), \ + /* W = */ 0.001008*2.0, \ + /* inx = */ iH2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 20000.0, \ + /* cpH = */ { 4.966884120E+08,-3.147547150E+05, 7.984121880E+01,-8.414789210E-03, 4.753248350E-07,-1.371873490E-11, 1.605461760E-16, 2.488433520E+06,-6.695728110E+02}, \ + /* cpM = */ { 5.608128010E+05,-8.371504740E+02, 2.975364530E+00, 1.252249120E-03,-3.740716190E-07, 5.936625200E-11,-3.606994100E-15, 5.339824410E+03,-2.202774770E+00}, \ + /* cpL = */ { 4.078323210E+04,-8.009186040E+02, 8.214702010E+00,-1.269714460E-02, 1.753605080E-05,-1.202860270E-08, 3.368093490E-12, 2.682484660E+03,-3.043788840E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.92e-10, \ + /* kbOveps = */ 0.026315789473684213, \ + /* mu = */ 0.0, \ + /* alpha = */ 7.900000000000001e-31, \ + /* Z298 = */ 280.0, \ + }, \ +} + +// H +#define iH 1 +#define H { \ + /* Name = */ (char*)("H"), \ + /* W = */ 0.001008*1.0, \ + /* inx = */ iH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 20000.0, \ + /* cpH = */ { 2.173757690E+08,-1.312035400E+05, 3.399174200E+01,-3.813999680E-03, 2.432854840E-07,-7.694275540E-12, 9.644105630E-17, 1.067638090E+06,-2.742301050E+02}, \ + /* cpM = */ { 6.078774250E+01,-1.819354420E-01, 2.500211820E+00,-1.226512860E-07, 3.732876330E-11,-5.687744560E-15, 3.410210200E-19, 2.547486400E+04,-4.481917770E-01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 2.547370800E+04,-4.466828530E-01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.05e-10, \ + /* kbOveps = */ 0.006896551724137932, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// O2 +#define iO2 2 +#define O2 { \ + /* Name = */ (char*)("O2"), \ + /* W = */ 0.015999*2.0, \ + /* inx = */ iO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 20000.0, \ + /* cpH = */ { 4.975294300E+08,-2.866106870E+05, 6.690352250E+01,-6.169959020E-03, 3.016396030E-07,-7.421416600E-12, 7.278175770E-17, 2.293554030E+06,-5.530621610E+02}, \ + /* cpM = */ {-1.037939020E+06, 2.344830280E+03, 1.819732040E+00, 1.267847580E-03,-2.188067990E-07, 2.053719570E-11,-8.193467050E-16,-1.689010930E+04, 1.738716510E+01}, \ + /* cpL = */ {-3.425563420E+04, 4.847000970E+02, 1.119010960E+00, 4.293889240E-03,-6.836300520E-07,-2.023372700E-09, 1.039040020E-12,-3.391454870E+03, 1.849699470E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.4580000000000004e-10, \ + /* kbOveps = */ 0.009310986964618248, \ + /* mu = */ 0.0, \ + /* alpha = */ 1.6e-30, \ + /* Z298 = */ 3.8, \ + }, \ +} + +// OH +#define iOH 3 +#define OH { \ + /* Name = */ (char*)("OH"), \ + /* W = */ 0.001008*1.0+0.015999*1.0, \ + /* inx = */ iOH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 20000.0, \ + /* cpH = */ { 2.847234190E+08,-1.859532610E+05, 5.008240900E+01,-5.142374980E-03, 2.875536590E-07,-8.228817960E-12, 9.567229020E-17, 1.468393910E+06,-4.023555580E+02}, \ + /* cpM = */ { 1.017393380E+06,-2.509957280E+03, 5.116547860E+00, 1.305299930E-04,-8.284322260E-08, 2.006475940E-11,-1.556993660E-15, 2.019640210E+04,-1.101282340E+01}, \ + /* cpL = */ {-1.998858990E+03, 9.300136160E+01, 3.050854230E+00, 1.529529290E-03,-3.157891000E-06, 3.315446180E-09,-1.138762680E-12, 2.991214230E+03, 4.674110790E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.7500000000000003e-10, \ + /* kbOveps = */ 0.0125, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// O +#define iO 4 +#define O { \ + /* Name = */ (char*)("O"), \ + /* W = */ 0.015999*1.0, \ + /* inx = */ iO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 20000.0, \ + /* cpH = */ { 1.779004260E+08,-1.082328260E+05, 2.810778360E+01,-2.975232260E-03, 1.854997530E-07,-5.796231540E-12, 7.191720160E-17, 8.890942630E+05,-2.181728150E+02}, \ + /* cpM = */ { 2.619020260E+05,-7.298722030E+02, 3.317177270E+00,-4.281334360E-04, 1.036104590E-07,-9.438304330E-12, 2.725038300E-16, 3.392428060E+04,-6.679585350E-01}, \ + /* cpL = */ {-7.953611300E+03, 1.607177790E+02, 1.966226440E+00, 1.013670310E-03,-1.110415420E-06, 6.517507500E-10,-1.584779250E-13, 2.840362440E+04, 8.404241820E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.7500000000000003e-10, \ + /* kbOveps = */ 0.0125, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// H2O +#define iH2O 5 +#define H2O { \ + /* Name = */ (char*)("H2O"), \ + /* W = */ 0.001008*2.0+0.015999*1.0, \ + /* inx = */ iH2O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpH = */ { 1.034972100E+06,-2.412698560E+03, 4.646110780E+00, 2.291998310E-03,-6.836830480E-07, 9.426468930E-11,-4.822380530E-15,-1.384286510E+04,-7.978148510E+00}, \ + /* cpM = */ { 1.034972100E+06,-2.412698560E+03, 4.646110780E+00, 2.291998310E-03,-6.836830480E-07, 9.426468930E-11,-4.822380530E-15,-1.384286510E+04,-7.978148510E+00}, \ + /* cpL = */ {-3.947960830E+04, 5.755731020E+02, 9.317826530E-01, 7.222712860E-03,-7.342557370E-06, 4.955043490E-09,-1.336933250E-12,-3.303974310E+04, 1.724205780E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.6050000000000003e-10, \ + /* kbOveps = */ 0.0017470300489168416, \ + /* mu = */ 6.150921915453923e-30, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 4.0, \ + }, \ +} + +// HO2 +#define iHO2 6 +#define HO2 { \ + /* Name = */ (char*)("HO2"), \ + /* W = */ 0.001008*1.0+0.015999*2.0, \ + /* inx = */ iHO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpH = */ {-1.810669720E+06, 4.963192030E+03,-1.039498990E+00, 4.560148530E-03,-1.061859450E-06, 1.144567880E-10,-4.763064160E-15,-3.200817190E+04, 4.066850920E+01}, \ + /* cpM = */ {-1.810669720E+06, 4.963192030E+03,-1.039498990E+00, 4.560148530E-03,-1.061859450E-06, 1.144567880E-10,-4.763064160E-15,-3.200817190E+04, 4.066850920E+01}, \ + /* cpL = */ {-7.598882540E+04, 1.329383920E+03,-4.677388240E+00, 2.508308200E-02,-3.006551590E-05, 1.895600060E-08,-4.828567390E-12,-5.873350960E+03, 5.193602140E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.4580000000000004e-10, \ + /* kbOveps = */ 0.009310986964618248, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// H2O2 +#define iH2O2 7 +#define H2O2 { \ + /* Name = */ (char*)("H2O2"), \ + /* W = */ 0.001008*2.0+0.015999*2.0, \ + /* inx = */ iH2O2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpH = */ { 1.489428030E+06,-5.170821780E+03, 1.128204970E+01,-8.042397790E-05,-1.818383770E-08, 6.947265590E-12,-4.827831900E-16, 1.418251040E+04,-4.650855660E+01}, \ + /* cpM = */ { 1.489428030E+06,-5.170821780E+03, 1.128204970E+01,-8.042397790E-05,-1.818383770E-08, 6.947265590E-12,-4.827831900E-16, 1.418251040E+04,-4.650855660E+01}, \ + /* cpL = */ {-9.279533580E+04, 1.564748390E+03,-5.976460140E+00, 3.270744520E-02,-3.932193260E-05, 2.509255240E-08,-6.465045290E-12,-2.494004730E+04, 5.877174180E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.4580000000000004e-10, \ + /* kbOveps = */ 0.009310986964618248, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 3.8, \ + }, \ +} + +// N2 +#define iN2 8 +#define N2 { \ + /* Name = */ (char*)("N2"), \ + /* W = */ 0.014007*2.0, \ + /* inx = */ iN2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 20000.0, \ + /* cpH = */ { 8.310139160E+08,-6.420733540E+05, 2.020264640E+02,-3.065092050E-02, 2.486903330E-06,-9.705954110E-11, 1.437538880E-15, 4.938707040E+06,-1.672099740E+03}, \ + /* cpM = */ { 5.877124060E+05,-2.239249070E+03, 6.066949220E+00,-6.139685500E-04, 1.491806680E-07,-1.923105490E-11, 1.061954390E-15, 1.283210410E+04,-1.586640030E+01}, \ + /* cpL = */ { 2.210371500E+04,-3.818461820E+02, 6.082738360E+00,-8.530914410E-03, 1.384646190E-05,-9.625793620E-09, 2.519705810E-12, 7.108460860E+02,-1.076003740E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.621e-10, \ + /* kbOveps = */ 0.010253255408592227, \ + /* mu = */ 0.0, \ + /* alpha = */ 1.76e-30, \ + /* Z298 = */ 4.0, \ + }, \ +} + + +//--------------------------------- +// Define Reactions +//--------------------------------- + +// R 0: H + O2 <=> O + OH +#define R0 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.520000000e+10, \ + /* n = */ -7.000000000e-01, \ + /* EovR = */ 8.589856793e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 } \ + } \ +} + +// R 1: H2 + O <=> H + OH +#define R1 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.060000000e-02, \ + /* n = */ 2.670000000e+00, \ + /* EovR = */ 3.165567894e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 } \ + } \ +} + +// R 2: H2 + OH <=> H + H2O +#define R2 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.170000000e+03, \ + /* n = */ 1.300000000e+00, \ + /* EovR = */ 1.829343906e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 } \ + } \ +} + +// R 3: H + O2 (+M) => HO2 (+M) +#define R3 { \ + /* ArrCoeffL = */ { \ + /* A = */ 5.750000000e+07, \ + /* n = */ -1.400000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 4.650000000e+06, \ + /* n = */ 4.400000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 3, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 16.0 }, \ + { /* ind = */ iO2 , /* eff = */ 1.0 } \ + }, \ + /* Ftype = */ F_Troe2, \ + /* FOData = */ { .Troe2 = { \ + /* alpha = */ 0.5, \ + /* T1 = */ 1.0000000000000002e+30, \ + /* T3 = */ 1e-30 \ + }}, \ +} + +// R 4: H + HO2 => 2 OH +#define R4 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.080000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.484497624e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 5: H + HO2 <=> H2 + O2 +#define R5 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.660000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.141496761e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + } \ +} + +// R 6: HO2 + OH => H2O + O2 +#define R6 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.890000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.501655267e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + } \ +} + +// R 7: H + OH + M <=> H2O + M +#define R7 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+10, \ + /* n = */ -2.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 8: 2 H + M <=> H2 + M +#define R8 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.300000000e+06, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 9: 2 HO2 => H2O2 + O2 +#define R9 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.020000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.975780139e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + } \ +} + +// R 10: H2 + HO2 => H + H2O2 +#define R10 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.624390000e+05, \ + /* n = */ 6.069610000e-01, \ + /* EovR = */ 1.204355310e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 } \ + } \ +} + +// R 11: H2O2 (+M) => 2 OH (+M) +#define R11 { \ + /* ArrCoeffL = */ { \ + /* A = */ 8.153420000e+17, \ + /* n = */ -1.918360000e+00, \ + /* EovR = */ 2.497025647e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.623280000e+19, \ + /* n = */ -1.388360000e+00, \ + /* EovR = */ 2.582673612e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.735, \ + /* T1 = */ 1756.0, \ + /* T2 = */ 5182.0, \ + /* T3 = */ 94.0 \ + }}, \ +} + + +//--------------------------------- +// Initialization function +//--------------------------------- + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : +species({H2, H, O2, OH, O, H2O, HO2, H2O2, + N2 }), +reactions({R0, R1, R2, R4, R5, R6, R9, R10 + }), +ThirdbodyReactions({R7, R8 }), +FalloffReactions({R3, R11 }) +{ +// This executable is expecting BoivinMix in the input file +assert(config.Flow.mixture.type == MixtureModel_BoivinMix); + +// Store reference quantities +StoreReferenceQuantities(config.Flow.mixture.u.BoivinMix.PRef, + config.Flow.mixture.u.BoivinMix.TRef, + config.Flow.mixture.u.BoivinMix.LRef, + config.Flow.mixture.u.BoivinMix.XiRef); +}; +#endif + +//--------------------------------- +// Cleanup +//--------------------------------- + +#undef iH2 +#undef H2 +#undef iH +#undef H +#undef iO2 +#undef O2 +#undef iOH +#undef OH +#undef iO +#undef O +#undef iH2O +#undef H2O +#undef iHO2 +#undef HO2 +#undef iH2O2 +#undef H2O2 +#undef iN2 +#undef N2 + +#undef R0 +#undef R1 +#undef R2 +#undef R3 +#undef R4 +#undef R5 +#undef R6 +#undef R7 +#undef R8 +#undef R9 +#undef R10 +#undef R11 + +#endif + +#endif // __BOIVINMIX_HPP__ diff --git a/src/Mixtures/CH41StMix.hpp b/src/Mixtures/CH41StMix.hpp new file mode 100644 index 0000000..7f321ea --- /dev/null +++ b/src/Mixtures/CH41StMix.hpp @@ -0,0 +1,218 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CH41StMix_HPP +#define CH41StMix_HPP + +// Number of species +#define nSpec 4 +// Number of charged species +#define nIons 0 +// Number of standard reactions +#define nReac 1 +// Number of third body reactions +#define nTBReac 0 +// Number of falloff reactions +#define nFOReac 0 +// Maximum number of reactants in a reaction +#define MAX_NUM_REACTANTS 2 +// Maximum number of products in a reaction +#define MAX_NUM_PRODUCTS 2 +// Maximum number of colliders in a reaction +#define MAX_NUM_TB 0 +// Number of Nasa polynomials +#define N_NASA_POLY 3 +// Use specified orders kinetics +#define FWD_ORDERS + +#include "MultiComponent.hpp" + +#ifdef __cplusplus +// We cannot expose these methods to Regent + +//--------------------------------- +// Define Species +//--------------------------------- + +// CH4 +#define iCH4 0 +#define CH4 { \ + /* Name = */ (char*)("CH4"), \ + /* W = */ 12.0107e-3 + 4.0*1.00784e-3, \ + /* inx = */ iCH4, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 6000.0007, \ + /* cpH = */ { 3.730042760e+06,-1.383501485e+04, 2.049107091e+01,-1.961974759e-03, 4.727313040e-07,-3.728814690e-11, 1.623737207e-15, 7.532066910e+04,-1.219124889e+02}, \ + /* cpM = */ { 3.730042760e+06,-1.383501485e+04, 2.049107091e+01,-1.961974759e-03, 4.727313040e-07,-3.728814690e-11, 1.623737207e-15, 7.532066910e+04,-1.219124889e+02}, \ + /* cpL = */ {-1.766850998e+05, 2.786181020e+03,-1.202577850e+01, 3.917619290e-02,-3.619054430e-05, 2.026853043e-08,-4.976705490e-12,-2.331314360e+04, 8.904322750e+01} \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.746*ATom, \ + /* kbOveps = */ 1.0/141.4, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 2.600*ATom*ATom*ATom, \ + /* Z298 = */ 13.000 \ + } \ + } + +// O2 +#define iO2 1 +#define O2 { \ + /* Name = */ (char*)("O2"), \ + /* W = */ 2*15.9994e-3, \ + /* inx = */ iO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 20000.0007, \ + /* cpH = */ { 4.975294300e+08,-2.866106874e+05, 6.690352250e+01,-6.169959020e-03, 3.016396027e-07,-7.421416600e-12, 7.278175770e-17, 2.293554027e+06,-5.530621610e+02 }, \ + /* cpM = */ {-1.037939022e+06, 2.344830282e+03, 1.819732036e+00, 1.267847582e-03,-2.188067988e-07, 2.053719572e-11,-8.193467050e-16,-1.689010929e+04, 1.738716506e+01 }, \ + /* cpL = */ {-3.425563420e+04, 4.847000970e+02, 1.119010961e+00, 4.293889240e-03,-6.836300520e-07,-2.023372700e-09, 1.039040018e-12,-3.391454870e+03, 1.849699470e+01 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.40, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 1.600*ATom*ATom*ATom, \ + /* Z298 = */ 3.8000 \ + } \ + } + +// CO2 +#define iCO2 2 +#define CO2 { \ + /* Name = */ (char*)("CO2"), \ + /* W = */ 12.0107e-3+2*15.9994e-3, \ + /* inx = */ iCO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 20000.0007, \ + /* cpH = */ {-1.544423287e+09, 1.016847056e+06,-2.561405230e+02, 3.369401080e-02,-2.181184337e-06, 6.991420840e-11,-8.842351500e-16,-8.043214510e+06, 2.254177493e+03 }, \ + /* cpM = */ { 1.176962419e+05,-1.788791477e+03, 8.291523190e+00,-9.223156780e-05, 4.863676880e-09,-1.891053312e-12, 6.330036590e-16,-3.908350590e+04,-2.652669281e+01 }, \ + /* cpL = */ { 4.943650540e+04,-6.264116010e+02, 5.301725240e+00, 2.503813816e-03,-2.127308728e-07,-7.689988780e-10, 2.849677801e-13,-4.528198460e+04,-7.048279440e+00 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.763*ATom, \ + /* kbOveps = */ 1.0/244.0, \ + /* mu = */ 0.000*DToCm, \ + /* alpha = */ 2.650*ATom*ATom*ATom, \ + /* Z298 = */ 2.100 \ + } \ + } + +// H2O +#define iH2O 3 +#define H2O { \ + /* Name = */ (char*)("H2O"), \ + /* W = */ 2*1.00784e-3 + 15.9994e-3, \ + /* inx = */ iH2O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0007, \ + /* TSwitch2 = */ 6000.0007, \ + /* TMin = */ 0200.0000, \ + /* TMax = */ 6000.0007, \ + /* cpH = */ { 1.034972096e+06,-2.412698562e+03, 4.646110780e+00, 2.291998307e-03,-6.836830480e-07, 9.426468930e-11,-4.822380530e-15,-1.384286509e+04,-7.978148510e+00 }, \ + /* cpM = */ { 1.034972096e+06,-2.412698562e+03, 4.646110780e+00, 2.291998307e-03,-6.836830480e-07, 9.426468930e-11,-4.822380530e-15,-1.384286509e+04,-7.978148510e+00 }, \ + /* cpL = */ {-3.947960830e+04, 5.755731020e+02, 9.317826530e-01, 7.222712860e-03,-7.342557370e-06, 4.955043490e-09,-1.336933246e-12,-3.303974310e+04, 1.724205775e+01 } \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.605*ATom, \ + /* kbOveps = */ 1.0/572.4, \ + /* mu = */ 1.844*DToCm, \ + /* alpha = */ 0.000*ATom*ATom*ATom, \ + /* Z298 = */ 4.000 \ + } \ + } + +//--------------------------------- +// Define Reactions +//--------------------------------- +// Methane oxidation (CH4 + 2 O2 -> 2 H2O + CO2) +#define R1 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.1e7, \ + /* n = */ 0.0, \ + /* EovR = */ 20000*calToJ/RGAS, \ + }, \ + /* has_backward = */ false, \ + /* . Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0, /* ord = */ 1.0}, \ + { /* ind = */ iO2, /* nu = */ 2.0, /* ord = */ 0.5}, \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 2.0}, \ + { /* ind = */ iCO2, /* nu = */ 1.0}, \ + }, \ + } + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : + species({CH4, O2, CO2, H2O}), + reactions({R1}) +{ + // This executable is expecting CH41StMix in the input file + assert(config.Flow.mixture.type == MixtureModel_CH41StMix); + + // Store reference quantities + StoreReferenceQuantities(config.Flow.mixture.u.CH41StMix.PRef, + config.Flow.mixture.u.CH41StMix.TRef, + config.Flow.mixture.u.CH41StMix.LRef, + config.Flow.mixture.u.CH41StMix.XiRef); +}; +#endif + +//--------------------------------- +// Cleanup +//--------------------------------- +#undef iCH4 +#undef CH4 +#undef iO2 +#undef O2 +#undef iCO2 +#undef CO2 +#undef iH2O +#undef H2O + +#undef R1 + +#endif //__cplusplus + +#endif // CH41StMix_HPP diff --git a/src/Mixtures/CH4_30SpMix.hpp b/src/Mixtures/CH4_30SpMix.hpp new file mode 100644 index 0000000..981fea1 --- /dev/null +++ b/src/Mixtures/CH4_30SpMix.hpp @@ -0,0 +1,5675 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef __CH4_30SPMIX_HPP__ +#define __CH4_30SPMIX_HPP__ + +// Number of species +#define nSpec 30 +// Number of charged species +#define nIons 0 +// Number of standard reactions +#define nReac 156 +// Number of thirdbody reactions +#define nTBReac 6 +// Number of falloff reactions +#define nFOReac 22 +// Maximum number of reactants in a reaction +#define MAX_NUM_REACTANTS 3 +// Maximum number of products in a reaction +#define MAX_NUM_PRODUCTS 3 +// Number of Nasa polynomials +#define N_NASA_POLY 2 +// Maximum number of colliders in a reaction +#define MAX_NUM_TB 7 + +#include "MultiComponent.hpp" + +#ifdef __cplusplus +// We cannot expose these methods to Regent + +//--------------------------------- +// Define Species +//--------------------------------- + +// H2 +#define iH2 0 +#define H2 { \ + /* Name = */ (char*)("H2"), \ + /* W = */ 0.00100784*2, \ + /* inx = */ iH2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.337279200E+00, -4.940247310E-05, 4.994567780E-07, -1.795663940E-10, 2.002553760E-14, -9.501589220E+02, -3.205023310E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.344331120E+00, 7.980520750E-03, -1.947815100E-05, 2.015720940E-08, -7.376117610E-12, -9.179351730E+02, 6.830102380E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.92*ATom, \ + /* kbOveps = */ 1.0/38.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.79*ATom*ATom*ATom, \ + /* Z298 = */ 280.0 \ + } \ + } + +// H +#define iH 1 +#define H { \ + /* Name = */ (char*)("H"), \ + /* W = */ 0.00100784*1, \ + /* inx = */ iH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.500000010E+00, -2.308429730E-11, 1.615619480E-14, -4.735152350E-18, 4.981973570E-22, 2.547365990E+04, -4.466829140E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 7.053328190E-13, -1.995919640E-15, 2.300816320E-18, -9.277323320E-22, 2.547365990E+04, -4.466828530E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.05*ATom, \ + /* kbOveps = */ 1.0/145.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// O +#define iO 2 +#define O { \ + /* Name = */ (char*)("O"), \ + /* W = */ 0.0159994*1, \ + /* inx = */ iO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.569420780E+00, -8.597411370E-05, 4.194845890E-08, -1.001777990E-11, 1.228336910E-15, 2.921757910E+04, 4.784338640E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.168267100E+00, -3.279318840E-03, 6.643063960E-06, -6.128066240E-09, 2.112659710E-12, 2.912225920E+04, 2.051933460E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.75*ATom, \ + /* kbOveps = */ 1.0/80.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// O2 +#define iO2 3 +#define O2 { \ + /* Name = */ (char*)("O2"), \ + /* W = */ 0.0159994*2, \ + /* inx = */ iO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.282537840E+00, 1.483087540E-03, -7.579666690E-07, 2.094705550E-10, -2.167177940E-14, -1.088457720E+03, 5.453231290E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.782456360E+00, -2.996734160E-03, 9.847302010E-06, -9.681295090E-09, 3.243728370E-12, -1.063943560E+03, 3.657675730E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 1.6*ATom*ATom*ATom, \ + /* Z298 = */ 3.8 \ + } \ + } + +// OH +#define iOH 4 +#define OH { \ + /* Name = */ (char*)("OH"), \ + /* W = */ 0.00100784*1+0.0159994*1, \ + /* inx = */ iOH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.092887670E+00, 5.484297160E-04, 1.265052280E-07, -8.794615560E-11, 1.174123760E-14, 3.858657000E+03, 4.476696100E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.992015430E+00, -2.401317520E-03, 4.617938410E-06, -3.881133330E-09, 1.364114700E-12, 3.615080560E+03, -1.039254580E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.75*ATom, \ + /* kbOveps = */ 1.0/80.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// H2O +#define iH2O 5 +#define H2O { \ + /* Name = */ (char*)("H2O"), \ + /* W = */ 0.00100784*2+0.0159994*1, \ + /* inx = */ iH2O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.033992490E+00, 2.176918040E-03, -1.640725180E-07, -9.704198700E-11, 1.682009920E-14, -3.000429710E+04, 4.966770100E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.198640560E+00, -2.036434100E-03, 6.520402110E-06, -5.487970620E-09, 1.771978170E-12, -3.029372670E+04, -8.490322080E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.605*ATom, \ + /* kbOveps = */ 1.0/572.4, \ + /* mu = */ 1.844*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 4.0 \ + } \ + } + +// HO2 +#define iHO2 6 +#define HO2 { \ + /* Name = */ (char*)("HO2"), \ + /* W = */ 0.00100784*1+0.0159994*2, \ + /* inx = */ iHO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.017210900E+00, 2.239820130E-03, -6.336581500E-07, 1.142463700E-10, -1.079085350E-14, 1.118567130E+02, 3.785102150E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.301798010E+00, -4.749120510E-03, 2.115828910E-05, -2.427638940E-08, 9.292251240E-12, 2.948080400E+02, 3.716662450E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// H2O2 +#define iH2O2 7 +#define H2O2 { \ + /* Name = */ (char*)("H2O2"), \ + /* W = */ 0.00100784*2+0.0159994*2, \ + /* inx = */ iH2O2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.165002850E+00, 4.908316940E-03, -1.901392250E-06, 3.711859860E-10, -2.879083050E-14, -1.786178770E+04, 2.916156620E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.276112690E+00, -5.428224170E-04, 1.673357010E-05, -2.157708130E-08, 8.624543630E-12, -1.770258210E+04, 3.435050740E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 3.8 \ + } \ + } + +// C +#define iC 8 +#define C { \ + /* Name = */ (char*)("C"), \ + /* W = */ 0.0120107*1, \ + /* inx = */ iC, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.492668880E+00, 4.798892840E-05, -7.243350200E-08, 3.742910290E-11, -4.872778930E-15, 8.545129530E+04, 4.801503730E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.554239550E+00, -3.215377240E-04, 7.337922450E-07, -7.322348890E-10, 2.665214460E-13, 8.544388320E+04, 4.531308480E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 3.298*ATom, \ + /* kbOveps = */ 1.0/71.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH +#define iCH 9 +#define CH { \ + /* Name = */ (char*)("CH"), \ + /* W = */ 0.0120107*1+0.00100784*1, \ + /* inx = */ iCH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.878464730E+00, 9.709136810E-04, 1.444456550E-07, -1.306878490E-10, 1.760793830E-14, 7.101243640E+04, 5.484979990E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.489816650E+00, 3.238355410E-04, -1.688990650E-06, 3.162173270E-09, -1.406090670E-12, 7.079729340E+04, 2.084011080E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.75*ATom, \ + /* kbOveps = */ 1.0/80.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH2 +#define iCH2 10 +#define CH2 { \ + /* Name = */ (char*)("CH2"), \ + /* W = */ 0.0120107*1+0.00100784*2, \ + /* inx = */ iCH2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.874101130E+00, 3.656392920E-03, -1.408945970E-06, 2.601795490E-10, -1.877275670E-14, 4.626360400E+04, 6.171193240E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.762678670E+00, 9.688721430E-04, 2.794898410E-06, -3.850911530E-09, 1.687417190E-12, 4.600404010E+04, 1.562531850E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8*ATom, \ + /* kbOveps = */ 1.0/144.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH2(S) +#define iCH2_S 11 +#define CH2_S { \ + /* Name = */ (char*)("CH2(S)"), \ + /* W = */ 0.0120107*1+0.00100784*2, \ + /* inx = */ iCH2_S, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.292038420E+00, 4.655886370E-03, -2.011919470E-06, 4.179060000E-10, -3.397163650E-14, 5.092599970E+04, 8.626501690E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.198604110E+00, -2.366614190E-03, 8.232962200E-06, -6.688159810E-09, 1.943147370E-12, 5.049681630E+04, -7.691189670E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8*ATom, \ + /* kbOveps = */ 1.0/144.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH3 +#define iCH3 12 +#define CH3 { \ + /* Name = */ (char*)("CH3"), \ + /* W = */ 0.0120107*1+0.00100784*3, \ + /* inx = */ iCH3, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.285717720E+00, 7.239900370E-03, -2.987143480E-06, 5.956846440E-10, -4.671543940E-14, 1.677558430E+04, 8.480071790E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.673590400E+00, 2.010951750E-03, 5.730218560E-06, -6.871174250E-09, 2.543857340E-12, 1.644499880E+04, 1.604564330E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8*ATom, \ + /* kbOveps = */ 1.0/144.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH4 +#define iCH4 13 +#define CH4 { \ + /* Name = */ (char*)("CH4"), \ + /* W = */ 0.0120107*1+0.00100784*4, \ + /* inx = */ iCH4, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.746*ATom, \ + /* kbOveps = */ 1.0/141.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 2.6*ATom*ATom*ATom, \ + /* Z298 = */ 13.0 \ + } \ + } + +// CO +#define iCO 14 +#define CO { \ + /* Name = */ (char*)("CO"), \ + /* W = */ 0.0120107*1+0.0159994*1, \ + /* inx = */ iCO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.715185610E+00, 2.062527430E-03, -9.988257710E-07, 2.300530080E-10, -2.036477160E-14, -1.415187240E+04, 7.818687720E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.579533470E+00, -6.103536800E-04, 1.016814330E-06, 9.070058840E-10, -9.044244990E-13, -1.434408600E+04, 3.508409280E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.65*ATom, \ + /* kbOveps = */ 1.0/98.1, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 1.95*ATom*ATom*ATom, \ + /* Z298 = */ 1.8 \ + } \ + } + +// CO2 +#define iCO2 15 +#define CO2 { \ + /* Name = */ (char*)("CO2"), \ + /* W = */ 0.0120107*1+0.0159994*2, \ + /* inx = */ iCO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.857460290E+00, 4.414370260E-03, -2.214814040E-06, 5.234901880E-10, -4.720841640E-14, -4.875916600E+04, 2.271638060E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.356773520E+00, 8.984596770E-03, -7.123562690E-06, 2.459190220E-09, -1.436995480E-13, -4.837196970E+04, 9.901052220E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.763*ATom, \ + /* kbOveps = */ 1.0/244.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 2.65*ATom*ATom*ATom, \ + /* Z298 = */ 2.1 \ + } \ + } + +// HCO +#define iHCO 16 +#define HCO { \ + /* Name = */ (char*)("HCO"), \ + /* W = */ 0.0120107*1+0.00100784*1+0.0159994*1, \ + /* inx = */ iHCO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.772174380E+00, 4.956955260E-03, -2.484456130E-06, 5.891617780E-10, -5.335087110E-14, 4.011918150E+03, 9.798344920E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.221185840E+00, -3.243925320E-03, 1.377994460E-05, -1.331440930E-08, 4.337688650E-12, 3.839564960E+03, 3.394372430E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.59*ATom, \ + /* kbOveps = */ 1.0/498.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH2O +#define iCH2O 17 +#define CH2O { \ + /* Name = */ (char*)("CH2O"), \ + /* W = */ 0.0120107*1+0.00100784*2+0.0159994*1, \ + /* inx = */ iCH2O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 1.760690080E+00, 9.200000820E-03, -4.422588130E-06, 1.006412120E-09, -8.838556400E-14, -1.399583230E+04, 1.365632300E+01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.793723150E+00, -9.908333690E-03, 3.732200080E-05, -3.792852610E-08, 1.317726520E-11, -1.430895670E+04, 6.028129000E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.59*ATom, \ + /* kbOveps = */ 1.0/498.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH2OH +#define iCH2OH 18 +#define CH2OH { \ + /* Name = */ (char*)("CH2OH"), \ + /* W = */ 0.0120107*1+0.00100784*3+0.0159994*1, \ + /* inx = */ iCH2OH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.692665690E+00, 8.645767970E-03, -3.751011200E-06, 7.872346360E-10, -6.485542010E-14, -3.242506270E+03, 5.810432150E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.863889180E+00, 5.596723040E-03, 5.932717910E-06, -1.045320120E-08, 4.369672780E-12, -3.193913670E+03, 5.473022430E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.69*ATom, \ + /* kbOveps = */ 1.0/417.0, \ + /* mu = */ 1.7*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH3O +#define iCH3O 19 +#define CH3O { \ + /* Name = */ (char*)("CH3O"), \ + /* W = */ 0.0120107*1+0.00100784*3+0.0159994*1, \ + /* inx = */ iCH3O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3000.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.770799000E+00, 7.871497000E-03, -2.656384000E-06, 3.944431000E-10, -2.112616000E-14, 1.278325200E+02, 2.929575000E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.106204000E+00, 7.216595000E-03, 5.338472000E-06, -7.377636000E-09, 2.075610000E-12, 9.786011000E+02, 1.315217700E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.69*ATom, \ + /* kbOveps = */ 1.0/417.0, \ + /* mu = */ 1.7*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH3OH +#define iCH3OH 20 +#define CH3OH { \ + /* Name = */ (char*)("CH3OH"), \ + /* W = */ 0.0120107*1+0.00100784*4+0.0159994*1, \ + /* inx = */ iCH3OH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 1.789707910E+00, 1.409382920E-02, -6.365008350E-06, 1.381710850E-09, -1.170602200E-13, -2.537487470E+04, 1.450236230E+01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 5.715395820E+00, -1.523091290E-02, 6.524411550E-05, -7.108068890E-08, 2.613526980E-11, -2.564276560E+04, -1.504098230E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.626*ATom, \ + /* kbOveps = */ 1.0/481.8, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// C2H2 +#define iC2H2 21 +#define C2H2 { \ + /* Name = */ (char*)("C2H2"), \ + /* W = */ 0.0120107*2+0.00100784*2, \ + /* inx = */ iC2H2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.147569640E+00, 5.961666640E-03, -2.372948520E-06, 4.674121710E-10, -3.612352130E-14, 2.593599920E+04, -1.230281210E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 8.086810940E-01, 2.336156290E-02, -3.551718150E-05, 2.801524370E-08, -8.500729740E-12, 2.642898070E+04, 1.393970510E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 4.1*ATom, \ + /* kbOveps = */ 1.0/209.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.5 \ + } \ + } + +// C2H3 +#define iC2H3 22 +#define C2H3 { \ + /* Name = */ (char*)("C2H3"), \ + /* W = */ 0.0120107*2+0.00100784*3, \ + /* inx = */ iC2H3, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.016724000E+00, 1.033022920E-02, -4.680823490E-06, 1.017632880E-09, -8.626070410E-14, 3.461287390E+04, 7.787323780E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.212466450E+00, 1.514791620E-03, 2.592094120E-05, -3.576578470E-08, 1.471508730E-11, 3.485984680E+04, 8.510540250E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.1*ATom, \ + /* kbOveps = */ 1.0/209.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// C2H4 +#define iC2H4 23 +#define C2H4 { \ + /* Name = */ (char*)("C2H4"), \ + /* W = */ 0.0120107*2+0.00100784*4, \ + /* inx = */ iC2H4, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.036111160E+00, 1.464541510E-02, -6.710779150E-06, 1.472229230E-09, -1.257060610E-13, 4.939886140E+03, 1.030536930E+01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.959201480E+00, -7.570522470E-03, 5.709902920E-05, -6.915887530E-08, 2.698843730E-11, 5.089775930E+03, 4.097330960E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.971*ATom, \ + /* kbOveps = */ 1.0/280.8, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.5 \ + } \ + } + +// C2H5 +#define iC2H5 24 +#define C2H5 { \ + /* Name = */ (char*)("C2H5"), \ + /* W = */ 0.0120107*2+0.00100784*5, \ + /* inx = */ iC2H5, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 1.954656420E+00, 1.739727220E-02, -7.982066680E-06, 1.752176890E-09, -1.496415760E-13, 1.285752000E+04, 1.346243430E+01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.306465680E+00, -4.186588920E-03, 4.971428070E-05, -5.991266060E-08, 2.305090040E-11, 1.284162650E+04, 4.707209240E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.302*ATom, \ + /* kbOveps = */ 1.0/252.3, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.5 \ + } \ + } + +// C2H6 +#define iC2H6 25 +#define C2H6 { \ + /* Name = */ (char*)("C2H6"), \ + /* W = */ 0.0120107*2+0.00100784*6, \ + /* inx = */ iC2H6, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 1.071881500E+00, 2.168526770E-02, -1.002560670E-05, 2.214120010E-09, -1.900028900E-13, -1.142639320E+04, 1.511561070E+01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.291424920E+00, -5.501542700E-03, 5.994382880E-05, -7.084662850E-08, 2.686857710E-11, -1.152220550E+04, 2.666823160E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.302*ATom, \ + /* kbOveps = */ 1.0/252.3, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.5 \ + } \ + } + +// HCCO +#define iHCCO 26 +#define HCCO { \ + /* Name = */ (char*)("HCCO"), \ + /* W = */ 0.0120107*2+0.00100784*1+0.0159994*1, \ + /* inx = */ iHCCO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 4000.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 4000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.628205800E+00, 4.085340100E-03, -1.593454700E-06, 2.862605200E-10, -1.940783200E-14, 1.932721500E+04, -3.930259500E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.251721400E+00, 1.765502100E-02, -2.372910100E-05, 1.727575900E-08, -5.066481100E-12, 2.005944900E+04, 1.249041700E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.5*ATom, \ + /* kbOveps = */ 1.0/150.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// CH2CO +#define iCH2CO 27 +#define CH2CO { \ + /* Name = */ (char*)("CH2CO"), \ + /* W = */ 0.0120107*2+0.00100784*2+0.0159994*1, \ + /* inx = */ iCH2CO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 3500.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.511297320E+00, 9.003597450E-03, -4.169396350E-06, 9.233458820E-10, -7.948382010E-14, -7.551053110E+03, 6.322472050E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.135836300E+00, 1.811887210E-02, -1.739474740E-05, 9.343975680E-09, -2.014576150E-12, -7.042918040E+03, 1.221564800E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97*ATom, \ + /* kbOveps = */ 1.0/436.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH2CHO +#define iCH2CHO 28 +#define CH2CHO { \ + /* Name = */ (char*)("CH2CHO"), \ + /* W = */ 0.0120107*2+0.00100784*3+0.0159994*1, \ + /* inx = */ iCH2CHO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 5000.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 5000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.975670000E+00, 8.130591000E-03, -2.743624000E-06, 4.070304000E-10, -2.176017000E-14, 4.903218000E+02, -5.045251000E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.409062000E+00, 1.073857400E-02, 1.891492000E-06, -7.158583000E-09, 2.867385000E-12, 1.521476600E+03, 9.558290000E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97*ATom, \ + /* kbOveps = */ 1.0/436.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// N2 +#define iN2 29 +#define N2 { \ + /* Name = */ (char*)("N2"), \ + /* W = */ 0.0140067*2, \ + /* inx = */ iN2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 5000.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 5000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.926640000E+00, 1.487976800E-03, -5.684760000E-07, 1.009703800E-10, -6.753351000E-15, -9.227977000E+02, 5.980528000E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.298677000E+00, 1.408240400E-03, -3.963222000E-06, 5.641515000E-09, -2.444854000E-12, -1.020899900E+03, 3.950372000E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.621*ATom, \ + /* kbOveps = */ 1.0/97.53, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 1.76*ATom*ATom*ATom, \ + /* Z298 = */ 4.0 \ + } \ + } + + +//--------------------------------- +// Define Reactions +//--------------------------------- + +// R 1: 2 O <=> O2 +#define R1 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+05, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.75 }, \ + { /* ind = */ iCO2, /* eff = */ 3.6 }, \ + { /* ind = */ iH2 , /* eff = */ 2.4 }, \ + { /* ind = */ iH2O, /* eff = */ 15.4 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 2: O + H <=> OH +#define R2 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+05, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 3: O + H2 <=> H + OH +#define R3 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.870000000e-02, \ + /* n = */ 2.700000000e+00, \ + /* EovR = */ 3.150155347e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 4: O + HO2 <=> OH + O2 +#define R4 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 5: O + H2O2 <=> OH + HO2 +#define R5 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.630000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.012878816e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 6: O + CH <=> H + CO +#define R6 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.700000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 7: O + CH2 <=> H + HCO +#define R7 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 8: O + CH2(S) <=> H2 + CO +#define R8 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 9: O + CH2(S) <=> H + HCO +#define R9 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 10: O + CH3 <=> H + CH2O +#define R10 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.060000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 11: O + CH4 <=> OH + CH3 +#define R11 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.020000000e+03, \ + /* n = */ 1.500000000e+00, \ + /* EovR = */ 4.327689455e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 12: O + CO (+ M) <=> CO2 (+ M) +#define R12 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.020000000e+02, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.509659112e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.800000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.200178994e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 3.5 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ iO2 , /* eff = */ 6.0 } \ + }, \ + /* Ftype = */ F_Lindemann, \ + /* FOData = */ { .Lindemann = { \ + /* dummy = */ 0, \ + } } \ + } + +// R 13: O + HCO <=> OH + CO +#define R13 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 14: O + HCO <=> H + CO2 +#define R14 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 15: O + CH2O <=> OH + HCO +#define R15 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.900000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.781397752e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 16: O + CH2OH <=> OH + CH2O +#define R16 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 17: O + CH3O <=> OH + CH2O +#define R17 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 18: O + CH3OH <=> OH + CH2OH +#define R18 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.880000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 1.559981083e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 19: O + CH3OH <=> OH + CH3O +#define R19 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.300000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 2.516098520e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 20: O + C2H2 <=> H + HCCO +#define R20 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.350000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.561174377e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 21: O + C2H2 <=> CO + CH2 +#define R21 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.940000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.561174377e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 22: O + C2H3 <=> H + CH2CO +#define R22 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 23: O + C2H4 <=> CH3 + HCO +#define R23 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.250000000e+01, \ + /* n = */ 1.830000000e+00, \ + /* EovR = */ 1.107083349e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 24: O + C2H5 <=> CH3 + CH2O +#define R24 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.240000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 25: O + C2H6 <=> OH + C2H5 +#define R25 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.980000000e+01, \ + /* n = */ 1.920000000e+00, \ + /* EovR = */ 2.863320116e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 26: O + HCCO <=> H + 2 CO +#define R26 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 27: O + CH2CO <=> OH + HCCO +#define R27 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.025757633e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 28: O + CH2CO <=> CH2 + CO2 +#define R28 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.750000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.793466005e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 29: O2 + CO <=> O + CO2 +#define R29 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.500000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.405390185e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 30: O2 + CH2O <=> HO2 + HCO +#define R30 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.012878816e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 31: H + O2 <=> HO2 +#define R31 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.800000000e+06, \ + /* n = */ -8.600000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 1.5 }, \ + { /* ind = */ iCO , /* eff = */ 0.75 }, \ + { /* ind = */ iCO2, /* eff = */ 1.5 }, \ + { /* ind = */ iH2O, /* eff = */ 0.0 }, \ + { /* ind = */ iN2 , /* eff = */ 0.0 }, \ + { /* ind = */ iO2 , /* eff = */ 0.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 32: H + 2 O2 <=> HO2 + O2 +#define R32 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.080000000e+07, \ + /* n = */ -1.240000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 33: H + O2 + H2O <=> HO2 + H2O +#define R33 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.126000000e+07, \ + /* n = */ -7.600000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 3, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 34: H + O2 + N2 <=> HO2 + N2 +#define R34 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.600000000e+07, \ + /* n = */ -1.240000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 3, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iN2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iN2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 35: H + O2 <=> O + OH +#define R35 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.650000000e+10, \ + /* n = */ -6.707000000e-01, \ + /* EovR = */ 8.575366977e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 36: 2 H <=> H2 +#define R36 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+06, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO2, /* eff = */ 0.0 }, \ + { /* ind = */ iH2 , /* eff = */ 0.0 }, \ + { /* ind = */ iH2O, /* eff = */ 0.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 37: 2 H + H2 <=> 2 H2 +#define R37 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.000000000e+04, \ + /* n = */ -6.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 38: 2 H + H2O <=> H2 + H2O +#define R38 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+07, \ + /* n = */ -1.250000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 39: 2 H + CO2 <=> H2 + CO2 +#define R39 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.500000000e+08, \ + /* n = */ -2.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 40: H + OH <=> H2O +#define R40 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.200000000e+10, \ + /* n = */ -2.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 4, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 0.73 }, \ + { /* ind = */ iH2O, /* eff = */ 3.65 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 41: H + HO2 <=> O + H2O +#define R41 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.970000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.376604214e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 42: H + HO2 <=> O2 + H2 +#define R42 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.480000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.374386439e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 43: H + HO2 <=> 2 OH +#define R43 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.195445121e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 44: H + H2O2 <=> HO2 + H2 +#define R44 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.210000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.616742461e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 45: H + H2O2 <=> OH + H2O +#define R45 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.811590935e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 46: H + CH <=> C + H2 +#define R46 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.650000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 47: H + CH2 (+ M) <=> CH3 (+ M) +#define R47 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.040000000e+14, \ + /* n = */ -2.760000000e+00, \ + /* EovR = */ 8.051515265e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 6.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.620000000e-01, \ +/* T1 = */ 5.836000000e+03, \ +/* T2 = */ 8.552000000e+03, \ +/* T3 = */ 9.100000000e+01 \ + }} \ + } + +// R 48: H + CH2(S) <=> CH + H2 +#define R48 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 49: H + CH3 (+ M) <=> CH4 (+ M) +#define R49 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.620000000e+21, \ + /* n = */ -4.760000000e+00, \ + /* EovR = */ 1.227856078e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.390000000e+10, \ + /* n = */ -5.340000000e-01, \ + /* EovR = */ 2.697257614e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 3.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.830000000e-01, \ +/* T1 = */ 2.941000000e+03, \ +/* T2 = */ 6.964000000e+03, \ +/* T3 = */ 7.400000000e+01 \ + }} \ + } + +// R 50: H + CH4 <=> CH3 + H2 +#define R50 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.600000000e+02, \ + /* n = */ 1.620000000e+00, \ + /* EovR = */ 5.454901592e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 51: H + HCO (+ M) <=> CH2O (+ M) +#define R51 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.470000000e+12, \ + /* n = */ -2.570000000e+00, \ + /* EovR = */ 2.138683742e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.090000000e+06, \ + /* n = */ 4.800000000e-01, \ + /* EovR = */ -1.308371231e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.824000000e-01, \ +/* T1 = */ 2.755000000e+03, \ +/* T2 = */ 6.570000000e+03, \ +/* T3 = */ 2.710000000e+02 \ + }} \ + } + +// R 52: H + HCO <=> H2 + CO +#define R52 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.340000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 53: H + CH2O (+ M) <=> CH2OH (+ M) +#define R53 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.270000000e+20, \ + /* n = */ -4.820000000e+00, \ + /* EovR = */ 3.286024668e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.400000000e+05, \ + /* n = */ 4.540000000e-01, \ + /* EovR = */ 1.811590935e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.187000000e-01, \ +/* T1 = */ 1.291000000e+03, \ +/* T2 = */ 4.160000000e+03, \ +/* T3 = */ 1.030000000e+02 \ + }} \ + } + +// R 54: H + CH2O (+ M) <=> CH3O (+ M) +#define R54 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.200000000e+18, \ + /* n = */ -4.800000000e+00, \ + /* EovR = */ 2.797901555e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.400000000e+05, \ + /* n = */ 4.540000000e-01, \ + /* EovR = */ 1.308371231e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.580000000e-01, \ +/* T1 = */ 1.555000000e+03, \ +/* T2 = */ 4.200000000e+03, \ +/* T3 = */ 9.400000000e+01 \ + }} \ + } + +// R 55: H + CH2O <=> HCO + H2 +#define R55 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.740000000e+01, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 1.379828429e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 56: H + CH2OH (+ M) <=> CH3OH (+ M) +#define R56 { \ + /* ArrCoeffL = */ { \ + /* A = */ 4.360000000e+19, \ + /* n = */ -4.650000000e+00, \ + /* EovR = */ 2.556356097e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.055000000e+06, \ + /* n = */ 5.000000000e-01, \ + /* EovR = */ 4.327689455e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 6.000000000e-01, \ +/* T1 = */ 9.000000000e+04, \ +/* T2 = */ 1.000000000e+04, \ +/* T3 = */ 1.000000000e+02 \ + }} \ + } + +// R 57: H + CH2OH <=> H2 + CH2O +#define R57 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 58: H + CH2OH <=> OH + CH3 +#define R58 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.650000000e+05, \ + /* n = */ 6.500000000e-01, \ + /* EovR = */ -1.429143960e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 59: H + CH2OH <=> CH2(S) + H2O +#define R59 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.280000000e+07, \ + /* n = */ -9.000000000e-02, \ + /* EovR = */ 3.069640195e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 60: H + CH3O (+ M) <=> CH3OH (+ M) +#define R60 { \ + /* ArrCoeffL = */ { \ + /* A = */ 4.660000000e+29, \ + /* n = */ -7.440000000e+00, \ + /* EovR = */ 7.085333433e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.430000000e+06, \ + /* n = */ 5.150000000e-01, \ + /* EovR = */ 2.516098520e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.000000000e-01, \ +/* T1 = */ 9.000000000e+04, \ +/* T2 = */ 1.000000000e+04, \ +/* T3 = */ 1.000000000e+02 \ + }} \ + } + +// R 61: H + CH3O <=> H + CH2OH +#define R61 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.150000000e+01, \ + /* n = */ 1.630000000e+00, \ + /* EovR = */ 9.681947106e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 62: H + CH3O <=> H2 + CH2O +#define R62 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 63: H + CH3O <=> OH + CH3 +#define R63 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+06, \ + /* n = */ 5.000000000e-01, \ + /* EovR = */ -5.535416745e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 64: H + CH3O <=> CH2(S) + H2O +#define R64 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.620000000e+08, \ + /* n = */ -2.300000000e-01, \ + /* EovR = */ 5.384450833e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 65: H + CH3OH <=> CH2OH + H2 +#define R65 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.700000000e+01, \ + /* n = */ 2.100000000e+00, \ + /* EovR = */ 2.450679959e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 66: H + CH3OH <=> CH3O + H2 +#define R66 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.200000000e+00, \ + /* n = */ 2.100000000e+00, \ + /* EovR = */ 2.450679959e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 67: H + C2H2 (+ M) <=> C2H3 (+ M) +#define R67 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.800000000e+28, \ + /* n = */ -7.270000000e+00, \ + /* EovR = */ 3.633246263e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.600000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.207727290e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.507000000e-01, \ +/* T1 = */ 1.302000000e+03, \ +/* T2 = */ 4.167000000e+03, \ +/* T3 = */ 9.850000000e+01 \ + }} \ + } + +// R 68: H + C2H3 (+ M) <=> C2H4 (+ M) +#define R68 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.400000000e+18, \ + /* n = */ -3.860000000e+00, \ + /* EovR = */ 1.670689417e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 6.080000000e+06, \ + /* n = */ 2.700000000e-01, \ + /* EovR = */ 1.409015171e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.820000000e-01, \ +/* T1 = */ 2.663000000e+03, \ +/* T2 = */ 6.095000000e+03, \ +/* T3 = */ 2.075000000e+02 \ + }} \ + } + +// R 69: H + C2H3 <=> H2 + C2H2 +#define R69 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 70: H + C2H4 (+ M) <=> C2H5 (+ M) +#define R70 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.000000000e+29, \ + /* n = */ -7.620000000e+00, \ + /* EovR = */ 3.507441337e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.400000000e+05, \ + /* n = */ 4.540000000e-01, \ + /* EovR = */ 9.158598614e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 9.753000000e-01, \ +/* T1 = */ 9.840000000e+02, \ +/* T2 = */ 4.374000000e+03, \ +/* T3 = */ 2.100000000e+02 \ + }} \ + } + +// R 71: H + C2H4 <=> C2H3 + H2 +#define R71 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.325000000e+00, \ + /* n = */ 2.530000000e+00, \ + /* EovR = */ 6.159409178e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 72: H + C2H5 (+ M) <=> C2H6 (+ M) +#define R72 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.990000000e+29, \ + /* n = */ -7.080000000e+00, \ + /* EovR = */ 3.364023722e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.210000000e+11, \ + /* n = */ -9.900000000e-01, \ + /* EovR = */ 7.950871324e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 8.422000000e-01, \ +/* T1 = */ 2.219000000e+03, \ +/* T2 = */ 6.882000000e+03, \ +/* T3 = */ 1.250000000e+02 \ + }} \ + } + +// R 73: H + C2H5 <=> H2 + C2H4 +#define R73 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 74: H + C2H6 <=> C2H5 + H2 +#define R74 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.150000000e+02, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 3.789244372e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 75: H + HCCO <=> CH2(S) + CO +#define R75 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 76: H + CH2CO <=> HCCO + H2 +#define R76 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.025757633e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 77: H + CH2CO <=> CH3 + CO +#define R77 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.130000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.725037146e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 78: H2 + CO (+ M) <=> CH2O (+ M) +#define R78 { \ + /* ArrCoeffL = */ { \ + /* A = */ 5.070000000e+15, \ + /* n = */ -3.420000000e+00, \ + /* EovR = */ 4.244658204e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 4.300000000e+01, \ + /* n = */ 1.500000000e+00, \ + /* EovR = */ 4.005628844e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 9.320000000e-01, \ +/* T1 = */ 1.540000000e+03, \ +/* T2 = */ 1.030000000e+04, \ +/* T3 = */ 1.970000000e+02 \ + }} \ + } + +// R 79: OH + H2 <=> H + H2O +#define R79 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.160000000e+02, \ + /* n = */ 1.510000000e+00, \ + /* EovR = */ 1.726043585e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 80: 2 OH (+ M) <=> H2O2 (+ M) +#define R80 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.300000000e+06, \ + /* n = */ -9.000000000e-01, \ + /* EovR = */ -8.554734969e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 7.400000000e+07, \ + /* n = */ -3.700000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.346000000e-01, \ +/* T1 = */ 1.756000000e+03, \ +/* T2 = */ 5.182000000e+03, \ +/* T3 = */ 9.400000000e+01 \ + }} \ + } + +// R 81: 2 OH <=> O + H2O +#define R81 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.570000000e-02, \ + /* n = */ 2.400000000e+00, \ + /* EovR = */ -1.061793576e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 82: OH + HO2 <=> O2 + H2O +#define R82 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.450000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.516098520e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 83: OH + H2O2 <=> HO2 + H2O +#define R83 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.148748136e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 84: OH + H2O2 <=> HO2 + H2O +#define R84 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.700000000e+12, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.479969150e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 85: OH + C <=> H + CO +#define R85 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 86: OH + CH <=> H + HCO +#define R86 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 87: OH + CH2 <=> H + CH2O +#define R87 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 88: OH + CH2 <=> CH + H2O +#define R88 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.130000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.509659112e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 89: OH + CH2(S) <=> H + CH2O +#define R89 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 90: OH + CH3 (+ M) <=> CH3OH (+ M) +#define R90 { \ + /* ArrCoeffL = */ { \ + /* A = */ 4.000000000e+24, \ + /* n = */ -5.920000000e+00, \ + /* EovR = */ 1.580109871e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.790000000e+12, \ + /* n = */ -1.430000000e+00, \ + /* EovR = */ 6.692822064e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 4.120000000e-01, \ +/* T1 = */ 5.900000000e+03, \ +/* T2 = */ 6.394000000e+03, \ +/* T3 = */ 1.950000000e+02 \ + }} \ + } + +// R 91: OH + CH3 <=> CH2 + H2O +#define R91 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.600000000e+01, \ + /* n = */ 1.600000000e+00, \ + /* EovR = */ 2.727450796e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 92: OH + CH3 <=> CH2(S) + H2O +#define R92 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.440000000e+11, \ + /* n = */ -1.340000000e+00, \ + /* EovR = */ 7.130623207e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 93: OH + CH4 <=> CH3 + H2O +#define R93 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+02, \ + /* n = */ 1.600000000e+00, \ + /* EovR = */ 1.570045477e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 94: OH + CO <=> H + CO2 +#define R94 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.760000000e+01, \ + /* n = */ 1.228000000e+00, \ + /* EovR = */ 3.522537928e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 95: OH + HCO <=> H2O + CO +#define R95 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 96: OH + CH2O <=> HCO + H2O +#define R96 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.430000000e+03, \ + /* n = */ 1.180000000e+00, \ + /* EovR = */ -2.249392077e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 97: OH + CH2OH <=> H2O + CH2O +#define R97 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 98: OH + CH3O <=> H2O + CH2O +#define R98 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 99: OH + CH3OH <=> CH2OH + H2O +#define R99 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.440000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ -4.227045514e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 100: OH + CH3OH <=> CH3O + H2O +#define R100 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.300000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.548295561e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 101: OH + C2H2 <=> H + CH2CO +#define R101 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.180000000e-10, \ + /* n = */ 4.500000000e+00, \ + /* EovR = */ -5.032197041e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 102: OH + C2H2 <=> CH3 + CO +#define R102 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.830000000e-10, \ + /* n = */ 4.000000000e+00, \ + /* EovR = */ -1.006439408e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 103: OH + C2H3 <=> H2O + C2H2 +#define R103 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 104: OH + C2H4 <=> C2H3 + H2O +#define R104 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.600000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.258049260e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 105: OH + C2H6 <=> C2H5 + H2O +#define R105 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.540000000e+00, \ + /* n = */ 2.120000000e+00, \ + /* EovR = */ 4.378011425e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 106: OH + CH2CO <=> HCCO + H2O +#define R106 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.500000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.006439408e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 107: 2 HO2 <=> O2 + H2O2 +#define R107 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.300000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -8.202481176e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 108: 2 HO2 <=> O2 + H2O2 +#define R108 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.200000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.038636449e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 109: HO2 + CH2 <=> OH + CH2O +#define R109 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 110: HO2 + CH3 <=> O2 + CH4 +#define R110 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 111: HO2 + CH3 <=> OH + CH3O +#define R111 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.780000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 112: HO2 + CO <=> OH + CO2 +#define R112 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.187598502e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 113: HO2 + CH2O <=> HCO + H2O2 +#define R113 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.600000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.038636449e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 114: C + O2 <=> O + CO +#define R114 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.800000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.898545495e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 115: C + CH3 <=> H + C2H2 +#define R115 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 116: CH + O2 <=> O + HCO +#define R116 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.710000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 117: CH + H2 <=> H + CH2 +#define R117 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.565013280e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 118: CH + H2O <=> H + CH2O +#define R118 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.710000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -3.799308766e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 119: CH + CH2 <=> H + C2H2 +#define R119 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 120: CH + CH3 <=> H + C2H3 +#define R120 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 121: CH + CH4 <=> H + C2H4 +#define R121 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 122: CH + CO (+ M) <=> HCCO (+ M) +#define R122 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.690000000e+16, \ + /* n = */ -3.740000000e+00, \ + /* EovR = */ 9.742333471e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.757000000e-01, \ +/* T1 = */ 1.652000000e+03, \ +/* T2 = */ 5.069000000e+03, \ +/* T3 = */ 2.370000000e+02 \ + }} \ + } + +// R 123: CH + CO2 <=> HCO + CO +#define R123 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.900000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.946845567e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 124: CH + CH2O <=> H + CH2CO +#define R124 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.460000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.591581476e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 125: CH + HCCO <=> CO + C2H2 +#define R125 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 126: CH2 + O2 -> OH + H + CO +#define R126 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548295561e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 127: CH2 + H2 <=> H + CH3 +#define R127 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.638278460e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 128: 2 CH2 <=> H2 + C2H2 +#define R128 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.010456145e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 129: CH2 + CH3 <=> H + C2H4 +#define R129 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 130: CH2 + CH4 <=> 2 CH3 +#define R130 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.460000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.161626953e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 131: CH2 + CO (+ M) <=> CH2CO (+ M) +#define R131 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.690000000e+21, \ + /* n = */ -5.110000000e+00, \ + /* EovR = */ 3.570343800e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 8.100000000e+05, \ + /* n = */ 5.000000000e-01, \ + /* EovR = */ 2.269520865e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.907000000e-01, \ +/* T1 = */ 1.226000000e+03, \ +/* T2 = */ 5.185000000e+03, \ +/* T3 = */ 2.750000000e+02 \ + }} \ + } + +// R 132: CH2 + HCCO <=> C2H3 + CO +#define R132 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 133: CH2(S) + N2 <=> CH2 + N2 +#define R133 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.019318224e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iN2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iN2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 134: CH2(S) + O2 <=> H + OH + CO +#define R134 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.800000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 135: CH2(S) + O2 <=> CO + H2O +#define R135 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 136: CH2(S) + H2 <=> CH3 + H +#define R136 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 137: CH2(S) + H2O (+ M) <=> CH3OH (+ M) +#define R137 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.880000000e+26, \ + /* n = */ -6.360000000e+00, \ + /* EovR = */ 2.536227308e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 4.820000000e+11, \ + /* n = */ -1.160000000e+00, \ + /* EovR = */ 5.761865612e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 6.027000000e-01, \ +/* T1 = */ 3.922000000e+03, \ +/* T2 = */ 1.018000000e+04, \ +/* T3 = */ 2.080000000e+02 \ + }} \ + } + +// R 138: CH2(S) + H2O <=> CH2 + H2O +#define R138 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 139: CH2(S) + CH3 <=> H + C2H4 +#define R139 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.868352313e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 140: CH2(S) + CH4 <=> 2 CH3 +#define R140 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.868352313e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 141: CH2(S) + CO <=> CH2 + CO +#define R141 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 142: CH2(S) + CO2 <=> CH2 + CO2 +#define R142 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 143: CH2(S) + CO2 <=> CO + CH2O +#define R143 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 144: CH2(S) + C2H6 <=> CH3 + C2H5 +#define R144 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.767708372e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 145: CH3 + O2 <=> O + CH3O +#define R145 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.560000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.533813658e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 146: CH3 + O2 <=> OH + CH2O +#define R146 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.310000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.022290829e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 147: CH3 + H2O2 <=> HO2 + CH4 +#define R147 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.450000000e-02, \ + /* n = */ 2.470000000e+00, \ + /* EovR = */ 2.606678067e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 148: 2 CH3 (+ M) <=> C2H6 (+ M) +#define R148 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.400000000e+29, \ + /* n = */ -7.030000000e+00, \ + /* EovR = */ 1.389892823e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 6.770000000e+10, \ + /* n = */ -1.180000000e+00, \ + /* EovR = */ 3.291056865e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 6.190000000e-01, \ +/* T1 = */ 1.180000000e+03, \ +/* T2 = */ 9.999000000e+03, \ +/* T3 = */ 7.320000000e+01 \ + }} \ + } + +// R 149: 2 CH3 <=> H + C2H5 +#define R149 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.840000000e+06, \ + /* n = */ 1.000000000e-01, \ + /* EovR = */ 5.334128863e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 150: CH3 + HCO <=> CH4 + CO +#define R150 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.648000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 151: CH3 + CH2O <=> HCO + CH4 +#define R151 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.320000000e-03, \ + /* n = */ 2.810000000e+00, \ + /* EovR = */ 2.948867466e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 152: CH3 + CH3OH <=> CH2OH + CH4 +#define R152 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+01, \ + /* n = */ 1.500000000e+00, \ + /* EovR = */ 5.002003858e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 153: CH3 + CH3OH <=> CH3O + CH4 +#define R153 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+01, \ + /* n = */ 1.500000000e+00, \ + /* EovR = */ 5.002003858e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 154: CH3 + C2H4 <=> C2H3 + CH4 +#define R154 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.270000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.629621277e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 155: CH3 + C2H6 <=> C2H5 + CH4 +#define R155 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.140000000e+00, \ + /* n = */ 1.740000000e+00, \ + /* EovR = */ 5.258645907e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 156: HCO + H2O <=> H + CO + H2O +#define R156 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+12, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 8.554734969e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 157: HCO <=> H + CO +#define R157 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.870000000e+11, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 8.554734969e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 0.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 158: HCO + O2 <=> HO2 + CO +#define R158 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.345000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.012878816e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 159: CH2OH + O2 <=> HO2 + CH2O +#define R159 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.800000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.528977337e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 160: CH3O + O2 <=> HO2 + CH2O +#define R160 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.280000000e-19, \ + /* n = */ 7.600000000e+00, \ + /* EovR = */ -1.776365555e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 161: C2H3 + O2 <=> HCO + CH2O +#define R161 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.580000000e+10, \ + /* n = */ -1.390000000e+00, \ + /* EovR = */ 5.107679996e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 162: C2H4 (+ M) <=> H2 + C2H2 (+ M) +#define R162 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.580000000e+45, \ + /* n = */ -9.300000000e+00, \ + /* EovR = */ 4.921488706e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 8.000000000e+12, \ + /* n = */ 4.400000000e-01, \ + /* EovR = */ 4.366437372e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.345000000e-01, \ +/* T1 = */ 1.035000000e+03, \ +/* T2 = */ 5.417000000e+03, \ +/* T3 = */ 1.800000000e+02 \ + }} \ + } + +// R 163: C2H5 + O2 <=> HO2 + C2H4 +#define R163 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.400000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.949976353e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 164: HCCO + O2 <=> OH + 2 CO +#define R164 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.200000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.297496273e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 165: 2 HCCO <=> 2 CO + C2H2 +#define R165 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 2 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 166: O + CH3 -> H + H2 + CO +#define R166 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.370000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 167: O + C2H4 <=> H + CH2CHO +#define R167 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.700000000e+00, \ + /* n = */ 1.830000000e+00, \ + /* EovR = */ 1.107083349e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 168: OH + HO2 <=> O2 + H2O +#define R168 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 8.720797471e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 169: OH + CH3 -> H2 + CH2O +#define R169 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.000000000e+03, \ + /* n = */ 5.000000000e-01, \ + /* EovR = */ -8.831505806e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 170: CH + H2 (+ M) <=> CH3 (+ M) +#define R170 { \ + /* ArrCoeffL = */ { \ + /* A = */ 4.820000000e+13, \ + /* n = */ -2.800000000e+00, \ + /* EovR = */ 2.968996254e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.970000000e+06, \ + /* n = */ 4.300000000e-01, \ + /* EovR = */ -1.861912905e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.780000000e-01, \ +/* T1 = */ 2.535000000e+03, \ +/* T2 = */ 9.365000000e+03, \ +/* T3 = */ 1.220000000e+02 \ + }} \ + } + +// R 171: CH2 + O2 -> 2 H + CO2 +#define R171 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.800000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548295561e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 172: CH2 + O2 <=> O + CH2O +#define R172 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548295561e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 173: CH2 + CH2 -> 2 H + C2H2 +#define R173 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.529881328e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 174: CH2(S) + H2O -> H2 + CH2O +#define R174 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.820000000e+04, \ + /* n = */ 2.500000000e-01, \ + /* EovR = */ -4.705104233e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 175: C2H3 + O2 <=> O + CH2CHO +#define R175 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.030000000e+05, \ + /* n = */ 2.900000000e-01, \ + /* EovR = */ 5.535416745e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 176: C2H3 + O2 <=> HO2 + C2H2 +#define R176 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.337000000e+00, \ + /* n = */ 1.610000000e+00, \ + /* EovR = */ -1.932363664e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 177: H + CH2CO (+ M) <=> CH2CHO (+ M) +#define R177 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.012000000e+30, \ + /* n = */ -7.630000000e+00, \ + /* EovR = */ 1.939408739e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 4.865000000e+05, \ + /* n = */ 4.220000000e-01, \ + /* EovR = */ -8.831505806e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 4.650000000e-01, \ +/* T1 = */ 1.773000000e+03, \ +/* T2 = */ 5.333000000e+03, \ +/* T3 = */ 2.010000000e+02 \ + }} \ + } + +// R 178: O + CH2CHO -> H + CH2 + CO2 +#define R178 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 179: O2 + CH2CHO -> OH + CO + CH2O +#define R179 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.810000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 180: O2 + CH2CHO -> OH + 2 HCO +#define R180 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.350000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 181: H + CH2CHO <=> CH3 + HCO +#define R181 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 182: H + CH2CHO <=> CH2CO + H2 +#define R182 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.100000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 183: OH + CH2CHO <=> H2O + CH2CO +#define R183 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 184: OH + CH2CHO <=> HCO + CH2OH +#define R184 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.010000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + + +//--------------------------------- +// Initialization function +//--------------------------------- + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : +species({H2, H, O, O2, OH, H2O, HO2, H2O2, + C, CH, CH2, CH2_S, CH3, CH4, CO, CO2, + HCO, CH2O, CH2OH, CH3O, CH3OH, C2H2, C2H3, C2H4, + C2H5, C2H6, HCCO, CH2CO, CH2CHO, N2 }), +reactions({R3, R4, R5, R6, R7, R8, R9, R10, + R11, R13, R14, R15, R16, R17, R18, R19, + R20, R21, R22, R23, R24, R25, R26, R27, + R28, R29, R30, R32, R33, R34, R35, R37, + R38, R39, R41, R42, R43, R44, R45, R46, + R48, R50, R52, R55, R57, R58, R59, R61, + R62, R63, R64, R65, R66, R69, R71, R73, + R74, R75, R76, R77, R79, R81, R82, R83, + R84, R85, R86, R87, R88, R89, R91, R92, + R93, R94, R95, R96, R97, R98, R99, R100, + R101, R102, R103, R104, R105, R106, R107, R108, + R109, R110, R111, R112, R113, R114, R115, R116, + R117, R118, R119, R120, R121, R123, R124, R125, + R126, R127, R128, R129, R130, R132, R133, R134, + R135, R136, R138, R139, R140, R141, R142, R143, + R144, R145, R146, R147, R149, R150, R151, R152, + R153, R154, R155, R156, R158, R159, R160, R161, + R163, R164, R165, R166, R167, R168, R169, R171, + R172, R173, R174, R175, R176, R178, R179, R180, + R181, R182, R183, R184 }), +ThirdbodyReactions({R1, R2, R31, R36, R40, R157 }), +FalloffReactions({R12, R47, R49, R51, R53, R54, R56, R60, + R67, R68, R70, R72, R78, R80, R90, R122, + R131, R137, R148, R162, R170, R177 }) +{ +// This executable is expecting CH4_30SpMix in the input file +assert(config.Flow.mixture.type == MixtureModel_CH4_30SpMix); + +// Store reference quantities +StoreReferenceQuantities(config.Flow.mixture.u.CH4_30SpMix.PRef, + config.Flow.mixture.u.CH4_30SpMix.TRef, + config.Flow.mixture.u.CH4_30SpMix.LRef, + config.Flow.mixture.u.CH4_30SpMix.XiRef); +}; +#endif + +//--------------------------------- +// Cleanup +//--------------------------------- + +#undef iH2 +#undef H2 +#undef iH +#undef H +#undef iO +#undef O +#undef iO2 +#undef O2 +#undef iOH +#undef OH +#undef iH2O +#undef H2O +#undef iHO2 +#undef HO2 +#undef iH2O2 +#undef H2O2 +#undef iC +#undef C +#undef iCH +#undef CH +#undef iCH2 +#undef CH2 +#undef iCH2_S +#undef CH2_S +#undef iCH3 +#undef CH3 +#undef iCH4 +#undef CH4 +#undef iCO +#undef CO +#undef iCO2 +#undef CO2 +#undef iHCO +#undef HCO +#undef iCH2O +#undef CH2O +#undef iCH2OH +#undef CH2OH +#undef iCH3O +#undef CH3O +#undef iCH3OH +#undef CH3OH +#undef iC2H2 +#undef C2H2 +#undef iC2H3 +#undef C2H3 +#undef iC2H4 +#undef C2H4 +#undef iC2H5 +#undef C2H5 +#undef iC2H6 +#undef C2H6 +#undef iHCCO +#undef HCCO +#undef iCH2CO +#undef CH2CO +#undef iCH2CHO +#undef CH2CHO +#undef iN2 +#undef N2 + +#undef R1 +#undef R2 +#undef R3 +#undef R4 +#undef R5 +#undef R6 +#undef R7 +#undef R8 +#undef R9 +#undef R10 +#undef R11 +#undef R12 +#undef R13 +#undef R14 +#undef R15 +#undef R16 +#undef R17 +#undef R18 +#undef R19 +#undef R20 +#undef R21 +#undef R22 +#undef R23 +#undef R24 +#undef R25 +#undef R26 +#undef R27 +#undef R28 +#undef R29 +#undef R30 +#undef R31 +#undef R32 +#undef R33 +#undef R34 +#undef R35 +#undef R36 +#undef R37 +#undef R38 +#undef R39 +#undef R40 +#undef R41 +#undef R42 +#undef R43 +#undef R44 +#undef R45 +#undef R46 +#undef R47 +#undef R48 +#undef R49 +#undef R50 +#undef R51 +#undef R52 +#undef R53 +#undef R54 +#undef R55 +#undef R56 +#undef R57 +#undef R58 +#undef R59 +#undef R60 +#undef R61 +#undef R62 +#undef R63 +#undef R64 +#undef R65 +#undef R66 +#undef R67 +#undef R68 +#undef R69 +#undef R70 +#undef R71 +#undef R72 +#undef R73 +#undef R74 +#undef R75 +#undef R76 +#undef R77 +#undef R78 +#undef R79 +#undef R80 +#undef R81 +#undef R82 +#undef R83 +#undef R84 +#undef R85 +#undef R86 +#undef R87 +#undef R88 +#undef R89 +#undef R90 +#undef R91 +#undef R92 +#undef R93 +#undef R94 +#undef R95 +#undef R96 +#undef R97 +#undef R98 +#undef R99 +#undef R100 +#undef R101 +#undef R102 +#undef R103 +#undef R104 +#undef R105 +#undef R106 +#undef R107 +#undef R108 +#undef R109 +#undef R110 +#undef R111 +#undef R112 +#undef R113 +#undef R114 +#undef R115 +#undef R116 +#undef R117 +#undef R118 +#undef R119 +#undef R120 +#undef R121 +#undef R122 +#undef R123 +#undef R124 +#undef R125 +#undef R126 +#undef R127 +#undef R128 +#undef R129 +#undef R130 +#undef R131 +#undef R132 +#undef R133 +#undef R134 +#undef R135 +#undef R136 +#undef R137 +#undef R138 +#undef R139 +#undef R140 +#undef R141 +#undef R142 +#undef R143 +#undef R144 +#undef R145 +#undef R146 +#undef R147 +#undef R148 +#undef R149 +#undef R150 +#undef R151 +#undef R152 +#undef R153 +#undef R154 +#undef R155 +#undef R156 +#undef R157 +#undef R158 +#undef R159 +#undef R160 +#undef R161 +#undef R162 +#undef R163 +#undef R164 +#undef R165 +#undef R166 +#undef R167 +#undef R168 +#undef R169 +#undef R170 +#undef R171 +#undef R172 +#undef R173 +#undef R174 +#undef R175 +#undef R176 +#undef R177 +#undef R178 +#undef R179 +#undef R180 +#undef R181 +#undef R182 +#undef R183 +#undef R184 + +#endif + +#endif // __CH4_30SPMIX_HPP__ diff --git a/src/Mixtures/CH4_43SpIonsMix.hpp b/src/Mixtures/CH4_43SpIonsMix.hpp new file mode 100644 index 0000000..aff49cd --- /dev/null +++ b/src/Mixtures/CH4_43SpIonsMix.hpp @@ -0,0 +1,14118 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Call Scientifique +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __CH4_43SPIONSMIX_HPP__ +#define __CH4_43SPIONSMIX_HPP__ + +// Number of species +#define nSpec 43 +// Number of charged species +#define nIons 7 +// Number of standard reactions +#define nReac 427 +// Number of thirdbody reactions +#define nTBReac 10 +// Number of falloff reactions +#define nFOReac 27 +// Maximum number of reactants in a reaction +#define MAX_NUM_REACTANTS 3 +// Maximum number of products in a reaction +#define MAX_NUM_PRODUCTS 6 +// Maximum number of colliders in a reaction +#define MAX_NUM_TB 7 +// Number of Nasa polynomials +#define N_NASA_POLY 2 +// Switch to mass action kinetics +#undef FWD_ORDERS +// Specify electron mobility +#define eMob 0.8 // [m^2 / (V s)] + +#include "MultiComponent.hpp" + +#ifdef __cplusplus +// We cannot expose these methods to Regent + +//--------------------------------- +// Define Species +//--------------------------------- + +// N2 +#define iN2 0 +#define N2 { \ + /* Name = */ (char*)("N2"), \ + /* W = */ 0.014007*2.0, \ + /* inx = */ iN2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1050.0, \ + /* TSwitch2 = */ 1050.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.811660730E+00, 1.670673530E-03,-6.799974280E-07, 1.328813790E-10,-1.027674420E-14,-8.698115790E+02, 6.648380500E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.731006820E+00,-1.831597300E-03, 4.323246620E-06,-3.043781510E-09, 7.460715620E-13,-1.062874260E+03, 2.168211980E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.621e-10, \ + /* kbOveps = */ 0.010253255408592227, \ + /* mu = */ 0.0, \ + /* alpha = */ 1.76e-30, \ + /* Z298 = */ 4.0, \ + }, \ +} + +// H2 +#define iH2 1 +#define H2 { \ + /* Name = */ (char*)("H2"), \ + /* W = */ 0.001008*2.0, \ + /* inx = */ iH2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 700.0, \ + /* TSwitch2 = */ 700.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.781998810E+00,-1.018732590E-03, 1.242262330E-06,-4.190118980E-10, 4.755437930E-14,-1.102830230E+03,-5.605259100E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.642044380E+00, 5.495292740E-03,-1.271636340E-05, 1.287491730E-08,-4.700277490E-12,-9.432366140E+02,-5.122311020E-01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.92e-10, \ + /* kbOveps = */ 0.026315789473684213, \ + /* mu = */ 0.0, \ + /* alpha = */ 7.900000000000001e-31, \ + /* Z298 = */ 280.0, \ + }, \ +} + +// H +#define iH 2 +#define H { \ + /* Name = */ (char*)("H"), \ + /* W = */ 0.001008*1.0, \ + /* inx = */ iH, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 860.0, \ + /* TSwitch2 = */ 860.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.500314930E+00,-7.734068280E-07, 6.393453460E-10,-2.125517910E-13, 2.444791910E-17, 2.547364740E+04,-4.483572280E-01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.499505440E+00, 2.991640460E-06,-5.927597590E-09, 4.878101650E-12,-1.455393200E-15, 2.547378660E+04,-4.445740180E-01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.05e-10, \ + /* kbOveps = */ 0.006896551724137932, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// O2 +#define iO2 3 +#define O2 { \ + /* Name = */ (char*)("O2"), \ + /* W = */ 0.015999*2.0, \ + /* inx = */ iO2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 700.0, \ + /* TSwitch2 = */ 700.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.820124080E+00, 2.482113570E-03,-1.512020940E-06, 4.485562010E-10,-4.873056680E-14,-9.313501480E+02, 7.949145520E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.744039210E+00,-2.797401470E-03, 9.801225580E-06,-1.032596430E-08, 3.799312470E-12,-1.060698270E+03, 3.821326460E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.4580000000000004e-10, \ + /* kbOveps = */ 0.009310986964618248, \ + /* mu = */ 0.0, \ + /* alpha = */ 1.6e-30, \ + /* Z298 = */ 3.8, \ + }, \ +} + +// O +#define iO 4 +#define O { \ + /* Name = */ (char*)("O"), \ + /* W = */ 0.015999*1.0, \ + /* inx = */ iO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 720.0, \ + /* TSwitch2 = */ 720.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.625491430E+00,-2.089596440E-04, 1.339185460E-07,-3.858758960E-11, 4.389186890E-15, 2.920615190E+04, 4.483585190E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.147992010E+00,-3.111740650E-03, 6.181378970E-06,-5.638087980E-09, 1.948660160E-12, 2.913091180E+04, 2.134465490E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.7500000000000003e-10, \ + /* kbOveps = */ 0.0125, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// H2O +#define iH2O 5 +#define H2O { \ + /* Name = */ (char*)("H2O"), \ + /* W = */ 0.001008*2.0+0.015999*1.0, \ + /* inx = */ iH2O, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1420.0, \ + /* TSwitch2 = */ 1420.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.667770750E+00, 3.057688490E-03,-9.004424110E-07, 1.433615520E-10,-1.008578170E-14,-2.988756450E+04, 6.911911310E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.060611720E+00,-8.658071890E-04, 3.244095280E-06,-1.802430790E-09, 3.324832930E-13,-3.028313140E+04,-2.961504810E-01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.6050000000000003e-10, \ + /* kbOveps = */ 0.0017470300489168416, \ + /* mu = */ 6.150921915453923e-30, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 4.0, \ + }, \ +} + +// OH +#define iOH 6 +#define OH { \ + /* Name = */ (char*)("OH"), \ + /* W = */ 0.001008*1.0+0.015999*1.0, \ + /* inx = */ iOH, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1700.0, \ + /* TSwitch2 = */ 1700.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.498673690E+00, 1.666352790E-03,-6.282515160E-07, 1.283468060E-10,-1.057358940E-14, 3.881107160E+03, 7.782188620E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.913546310E+00,-1.662759260E-03, 2.309200290E-06,-1.023595080E-09, 1.588296290E-13, 3.400050470E+03, 2.054747190E-01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.7500000000000003e-10, \ + /* kbOveps = */ 0.0125, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// H2O2 +#define iH2O2 7 +#define H2O2 { \ + /* Name = */ (char*)("H2O2"), \ + /* W = */ 0.001008*2.0+0.015999*2.0, \ + /* inx = */ iH2O2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.768696390E+00, 3.892378480E-03,-1.213823490E-06, 1.926152850E-10,-1.225819900E-14,-1.809002200E+04,-5.118117770E-01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.347742240E+00, 7.050054370E-03,-3.845220060E-06, 1.167206610E-09,-1.476181050E-13,-1.757847850E+04, 7.178688510E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.4580000000000004e-10, \ + /* kbOveps = */ 0.009310986964618248, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 3.8, \ + }, \ +} + +// HO2 +#define iHO2 8 +#define HO2 { \ + /* Name = */ (char*)("HO2"), \ + /* W = */ 0.001008*1.0+0.015999*2.0, \ + /* inx = */ iHO2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 700.0, \ + /* TSwitch2 = */ 700.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.023918890E+00, 4.463909070E-03,-2.231464920E-06, 6.127107990E-10,-6.642662370E-14, 3.993416090E+02, 9.106999730E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.619942990E+00, 1.058057050E-03, 5.066789410E-06,-6.338007620E-09, 2.415972810E-12, 3.158982340E+02, 6.444114820E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.4580000000000004e-10, \ + /* kbOveps = */ 0.009310986964618248, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// CO +#define iCO 9 +#define CO { \ + /* Name = */ (char*)("CO"), \ + /* W = */ 0.012010999999999999*1.0+0.015999*1.0, \ + /* inx = */ iCO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 960.0, \ + /* TSwitch2 = */ 960.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.792553810E+00, 1.874868860E-03,-8.597119260E-07, 1.912000700E-10,-1.678552860E-14,-1.417233350E+04, 7.414435600E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.757238910E+00,-2.144652410E-03, 5.420790050E-06,-4.170259630E-09, 1.119011270E-12,-1.435755300E+04, 2.799767990E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.65e-10, \ + /* kbOveps = */ 0.010193679918450561, \ + /* mu = */ 0.0, \ + /* alpha = */ 1.95e-30, \ + /* Z298 = */ 1.8, \ + }, \ +} + +// CO2 +#define iCO2 10 +#define CO2 { \ + /* Name = */ (char*)("CO2"), \ + /* W = */ 0.012010999999999999*1.0+0.015999*2.0, \ + /* inx = */ iCO2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1450.0, \ + /* TSwitch2 = */ 1450.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.708764680E+00, 2.629147040E-03,-9.306064620E-07, 1.438929200E-10,-7.625814140E-15,-4.905626390E+04,-2.349764520E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.316843470E+00, 9.227550360E-03,-7.756540930E-06, 3.282253600E-09,-5.487224820E-13,-4.836260670E+04, 1.007862340E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.763e-10, \ + /* kbOveps = */ 0.004098360655737705, \ + /* mu = */ 0.0, \ + /* alpha = */ 2.6500000000000002e-30, \ + /* Z298 = */ 2.1, \ + }, \ +} + +// CH4 +#define iCH4 11 +#define CH4 { \ + /* Name = */ (char*)("CH4"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*4.0, \ + /* inx = */ iCH4, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 700.0, \ + /* TSwitch2 = */ 700.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.053464050E-01, 1.236978450E-02,-4.998079220E-06, 1.043927650E-09,-8.628974160E-14,-9.589825010E+03, 1.617527750E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 5.239673350E+00,-1.468351230E-02, 5.297327110E-05,-5.416688220E-08, 1.963185660E-11,-1.025263080E+04,-4.976497480E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.7460000000000003e-10, \ + /* kbOveps = */ 0.007072135785007073, \ + /* mu = */ 0.0, \ + /* alpha = */ 2.6000000000000002e-30, \ + /* Z298 = */ 13.0, \ + }, \ +} + +// CH3 +#define iCH3 12 +#define CH3 { \ + /* Name = */ (char*)("CH3"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*3.0, \ + /* inx = */ iCH3, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1060.0, \ + /* TSwitch2 = */ 1060.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.788051040E+00, 6.152334770E-03,-2.211793490E-06, 3.744026480E-10,-2.481513490E-14, 1.658628290E+04, 5.778998180E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.478293100E+00, 3.547647730E-03, 1.474084400E-06,-1.943759550E-09, 5.219212320E-13, 1.643995160E+04, 2.408759560E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8e-10, \ + /* kbOveps = */ 0.006944444444444444, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// CH2 +#define iCH2 13 +#define CH2 { \ + /* Name = */ (char*)("CH2"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*2.0, \ + /* inx = */ iCH2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.812729720E+00, 3.554313880E-03,-1.287685230E-06, 2.212737440E-10,-1.487381470E-14, 4.620734920E+04, 6.642846520E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.764894600E+00, 1.438391910E-03, 4.755830770E-07,-4.317885910E-10, 7.582928740E-14, 4.586456990E+04, 1.489531530E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8e-10, \ + /* kbOveps = */ 0.006944444444444444, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// CH2(S) +#define iCH2_S 14 +#define CH2_S { \ + /* Name = */ (char*)("CH2(S)"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*2.0, \ + /* inx = */ iCH2_S, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 970.0, \ + /* TSwitch2 = */ 970.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.759342990E+00, 3.654683070E-03,-1.355899140E-06, 2.749804110E-10,-2.367954720E-14, 5.064290790E+04, 6.116463830E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.181854340E+00,-2.211343140E-03, 7.715275410E-06,-5.959503810E-09, 1.583146280E-12, 5.036694070E+04,-7.030026020E-01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8e-10, \ + /* kbOveps = */ 0.006944444444444444, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// C +#define iC 15 +#define C { \ + /* Name = */ (char*)("C"), \ + /* W = */ 0.012010999999999999*1.0, \ + /* inx = */ iC, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 700.0, \ + /* TSwitch2 = */ 700.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.494725310E+00, 3.928394760E-05,-6.700149800E-08, 3.718186940E-11,-5.073068850E-15, 8.545044220E+04, 4.793142540E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.544951920E+00,-2.477252810E-04, 5.480182770E-07,-5.485512500E-10, 2.041173310E-13, 8.544341050E+04, 4.568742730E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 3.2980000000000004e-10, \ + /* kbOveps = */ 0.014005602240896357, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// CH +#define iCH 16 +#define CH { \ + /* Name = */ (char*)("CH"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*1.0, \ + /* inx = */ iCH, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1590.0, \ + /* TSwitch2 = */ 1590.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.279901280E+00, 2.169852380E-03,-7.076378850E-07, 1.239734940E-10,-9.563485150E-15, 7.110594120E+04, 8.773260610E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.772643320E+00,-1.585473500E-03, 2.835122380E-06,-1.361460580E-09, 2.239953320E-13, 7.063124920E+04, 8.794079040E-01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.7500000000000003e-10, \ + /* kbOveps = */ 0.0125, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// CH3O2 +#define iCH3O2 17 +#define CH3O2 { \ + /* Name = */ (char*)("CH3O2"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*3.0+0.015999*2.0, \ + /* inx = */ iCH3O2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.641418170E+00, 8.743282810E-03,-3.219614060E-06, 5.436952180E-10,-3.450150080E-14,-1.190101480E+03,-3.419146830E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 1.442896320E+00, 1.807333140E-02,-1.099465450E-05, 3.423339840E-09,-4.344521420E-13, 3.213663900E+02, 1.930412930E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.626e-10, \ + /* kbOveps = */ 0.0020755500207555, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// CH3OH +#define iCH3OH 18 +#define CH3OH { \ + /* Name = */ (char*)("CH3OH"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*4.0+0.015999*1.0, \ + /* inx = */ iCH3OH, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.717015300E+00, 1.215383530E-02,-5.021070310E-06, 1.010680700E-09,-8.184608230E-14,-2.576934090E+04, 9.474205400E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 8.473304790E-01, 1.630869040E-02,-8.483449610E-06, 2.293043410E-09,-2.599520130E-13,-2.509625440E+04, 1.959332970E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.626e-10, \ + /* kbOveps = */ 0.0020755500207555, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// CH3O +#define iCH3O 19 +#define CH3O { \ + /* Name = */ (char*)("CH3O"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*3.0+0.015999*1.0, \ + /* inx = */ iCH3O, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1740.0, \ + /* TSwitch2 = */ 1740.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.722380620E+00, 5.902276370E-03,-1.803407200E-06, 2.133350090E-10,-5.618164090E-15,-7.862522250E+01,-7.491736770E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 8.896609850E-01, 1.701197670E-02,-1.138073510E-05, 3.882809280E-09,-5.328414790E-13, 1.603161210E+03, 1.850011340E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.69e-10, \ + /* kbOveps = */ 0.002398081534772182, \ + /* mu = */ 5.670589618368584e-30, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// CH2OH +#define iCH2OH 20 +#define CH2OH { \ + /* Name = */ (char*)("CH2OH"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*3.0+0.015999*1.0, \ + /* inx = */ iCH2OH, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1360.0, \ + /* TSwitch2 = */ 1360.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.045349500E+00, 6.027270590E-03,-2.113868210E-06, 3.360859050E-10,-2.009874820E-14,-4.035841430E+03,-1.575240730E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.348215790E+00, 1.396001680E-02,-1.086322060E-05, 4.624984160E-09,-8.084991620E-13,-3.302221060E+03, 1.226619770E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.69e-10, \ + /* kbOveps = */ 0.002398081534772182, \ + /* mu = */ 5.670589618368584e-30, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// CH2O +#define iCH2O 21 +#define CH2O { \ + /* Name = */ (char*)("CH2O"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*2.0+0.015999*1.0, \ + /* inx = */ iCH2O, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 700.0, \ + /* TSwitch2 = */ 700.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 1.333356520E+00, 1.009051830E-02,-5.129525620E-06, 1.254252070E-09,-1.196391090E-13,-1.390801700E+04, 1.599161440E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.326212960E+00,-7.011518530E-03, 3.151769610E-05,-3.364786380E-08, 1.234540230E-11,-1.432701690E+04, 2.620289020E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.59e-10, \ + /* kbOveps = */ 0.002008032128514056, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// HCO +#define iHCO 22 +#define HCO { \ + /* Name = */ (char*)("HCO"), \ + /* W = */ 0.012010999999999999*1.0+0.001008*1.0+0.015999*1.0, \ + /* inx = */ iHCO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 770.0, \ + /* TSwitch2 = */ 770.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.600493180E+00, 5.292782580E-03,-2.691842110E-06, 7.213577980E-10,-7.435214090E-14, 4.057253300E+03, 1.074509330E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.034839790E+00,-2.158368640E-03, 1.182338750E-05,-1.184594060E-08, 4.005939540E-12, 3.836363920E+03, 4.200087700E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.59e-10, \ + /* kbOveps = */ 0.002008032128514056, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// C2H6 +#define iC2H6 23 +#define C2H6 { \ + /* Name = */ (char*)("C2H6"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*6.0, \ + /* inx = */ iC2H6, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.079591410E+00, 1.574452610E-02,-5.961973930E-06, 1.068671820E-09,-7.610123400E-14,-1.259480530E+04,-1.430894120E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00,-2.417787240E-01, 2.534757090E-02,-1.396451120E-05, 4.032574520E-09,-4.877543870E-13,-1.103911210E+04, 2.195726250E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.35e-10, \ + /* kbOveps = */ 0.00404040404040404, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.5, \ + }, \ +} + +// C2H5 +#define iC2H5 24 +#define C2H5 { \ + /* Name = */ (char*)("C2H5"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*5.0, \ + /* inx = */ iC2H5, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.197913600E+00, 1.110428000E-02,-3.712816860E-06, 5.476655710E-10,-2.894126040E-14, 1.171762150E+04,-4.913825130E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 6.754218010E-01, 2.115426170E-02,-1.208780170E-05, 3.649511800E-09,-4.597532370E-13, 1.334571860E+04, 1.956284390E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.35e-10, \ + /* kbOveps = */ 0.00404040404040404, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.5, \ + }, \ +} + +// C2H4 +#define iC2H4 25 +#define C2H4 { \ + /* Name = */ (char*)("C2H4"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*4.0, \ + /* inx = */ iC2H4, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1650.0, \ + /* TSwitch2 = */ 1650.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.604027180E+00, 9.505953500E-03,-3.151292610E-06, 4.530520740E-10,-2.239491590E-14, 3.972291020E+03,-3.774209050E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00,-6.029324500E-02, 2.081339700E-02,-1.343078670E-05, 4.606383010E-09,-6.516874810E-13, 5.511516760E+03, 2.106421720E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.496e-10, \ + /* kbOveps = */ 0.0041946308724832215, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.5, \ + }, \ +} + +// C2H3 +#define iC2H3 26 +#define C2H3 { \ + /* Name = */ (char*)("C2H3"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*3.0, \ + /* inx = */ iC2H3, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1450.0, \ + /* TSwitch2 = */ 1450.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.187283760E+00, 7.475815880E-03,-2.589842270E-06, 4.052657950E-10,-2.350227210E-14, 3.384037850E+04, 1.519587510E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 1.234212140E+00, 1.562222040E-02,-1.101715720E-05, 4.279893370E-09,-6.915415090E-13, 3.469676920E+04, 1.686370480E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.7210000000000004e-10, \ + /* kbOveps = */ 0.0037693177534866185, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// C2H2 +#define iC2H2 27 +#define C2H2 { \ + /* Name = */ (char*)("C2H2"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*2.0, \ + /* inx = */ iC2H2, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 790.0, \ + /* TSwitch2 = */ 790.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.372674540E+00, 5.472128300E-03,-2.031815420E-06, 3.750191160E-10,-2.770490620E-14, 2.586265970E+04,-2.438359210E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 7.705369070E-01, 2.371079980E-02,-3.666220440E-05, 2.959897610E-08,-9.275792550E-12, 2.643179750E+04, 1.409076830E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.7210000000000004e-10, \ + /* kbOveps = */ 0.0037693177534866185, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.5, \ + }, \ +} + +// C2H +#define iC2H 28 +#define C2H { \ + /* Name = */ (char*)("C2H"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*1.0, \ + /* inx = */ iC2H, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1710.0, \ + /* TSwitch2 = */ 1710.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.417882570E+00, 4.213289890E-03,-1.589369460E-06, 2.687391910E-10,-1.733463590E-14, 6.728744910E+04, 5.325123670E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.608735990E+00, 1.427667850E-03, 8.541586430E-07,-6.839033440E-10, 1.219405890E-13, 6.688017720E+04,-1.058940680E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.7210000000000004e-10, \ + /* kbOveps = */ 0.0037693177534866185, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.5, \ + }, \ +} + +// CH3CHO +#define iCH3CHO 29 +#define CH3CHO { \ + /* Name = */ (char*)("CH3CHO"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*4.0+0.015999*1.0, \ + /* inx = */ iCH3CHO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 6.221953710E+00, 1.065892700E-02,-3.751903290E-06, 6.007316280E-10,-3.666038240E-14,-2.306213550E+04,-8.314085770E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 9.759166370E-01, 2.231678710E-02,-1.346678680E-05, 4.198836620E-09,-5.363971870E-13,-2.117356210E+04, 2.007856130E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97e-10, \ + /* kbOveps = */ 0.0022935779816513763, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// CH3CO +#define iCH3CO 30 +#define CH3CO { \ + /* Name = */ (char*)("CH3CO"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*3.0+0.015999*1.0, \ + /* inx = */ iCH3CO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 6.076890160E+00, 8.129793390E-03,-2.818549990E-06, 4.386983070E-10,-2.551718370E-14,-4.068010470E+03,-6.154924530E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 1.473880640E+00, 1.835870340E-02,-1.134264170E-05, 3.595769310E-09,-4.639992670E-13,-2.410927050E+03, 1.875752320E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97e-10, \ + /* kbOveps = */ 0.0022935779816513763, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// CH2CHO +#define iCH2CHO 31 +#define CH2CHO { \ + /* Name = */ (char*)("CH2CHO"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*3.0+0.015999*1.0, \ + /* inx = */ iCH2CHO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1340.0, \ + /* TSwitch2 = */ 1340.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 6.477037920E+00, 7.913586040E-03,-2.836058910E-06, 4.621126550E-10,-2.832312970E-14,-1.161708120E+03,-8.371572860E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 7.378682810E-01, 2.504543570E-02,-2.201350260E-05, 1.000312940E-08,-1.808363570E-12, 3.763893390E+02, 2.099628370E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97e-10, \ + /* kbOveps = */ 0.0022935779816513763, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// CH2CO +#define iCH2CO 32 +#define CH2CO { \ + /* Name = */ (char*)("CH2CO"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*2.0+0.015999*1.0, \ + /* inx = */ iCH2CO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1360.0, \ + /* TSwitch2 = */ 1360.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.695236280E+00, 6.468416580E-03,-2.335884140E-06, 3.834081100E-10,-2.368978500E-14,-8.059443050E+03,-4.611544030E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.495039780E+00, 1.588075920E-02,-1.271714440E-05, 5.472261190E-09,-9.591407180E-13,-7.188989600E+03, 1.181156570E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97e-10, \ + /* kbOveps = */ 0.0022935779816513763, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// HCCO +#define iHCCO 33 +#define HCCO { \ + /* Name = */ (char*)("HCCO"), \ + /* W = */ 0.012010999999999999*2.0+0.001008*1.0+0.015999*1.0, \ + /* inx = */ iHCCO, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1220.0, \ + /* TSwitch2 = */ 1220.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.814205130E+00, 3.891167790E-03,-1.411686080E-06, 2.356685330E-10,-1.494249710E-14, 1.940267820E+04,-4.940896470E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.330286610E+00, 1.203516290E-02,-1.142479490E-05, 5.707312670E-09,-1.136181050E-12, 2.000875430E+04, 7.536503870E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.5e-10, \ + /* kbOveps = */ 0.006666666666666667, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// C3H6 +#define iC3H6 34 +#define C3H6 { \ + /* Name = */ (char*)("C3H6"), \ + /* W = */ 0.012010999999999999*3.0+0.001008*6.0, \ + /* inx = */ iC3H6, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1800.0, \ + /* TSwitch2 = */ 1800.0, \ + /* TMin = */ 298.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 6.317552010E+00, 1.658200170E-02,-6.599723020E-06, 1.295129160E-09,-1.037843750E-13,-3.794560710E+02,-1.056161870E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00,-8.559871880E-02, 3.081122550E-02,-1.845740960E-05, 5.686864910E-09,-7.137476740E-13, 1.925678190E+03, 2.409356870E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.1399999999999997e-10, \ + /* kbOveps = */ 0.0032488628979857053, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// C3H5-A +#define iC3H5MA 35 +#define C3H5MA { \ + /* Name = */ (char*)("C3H5-A"), \ + /* W = */ 0.012010999999999999*3.0+0.001008*5.0, \ + /* inx = */ iC3H5MA, \ + /* isElectron = */ false, \ + /* nCrg = */ 0, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1600.0, \ + /* TSwitch2 = */ 1600.0, \ + /* TMin = */ 298.0, \ + /* TMax = */ 3500.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 8.538777920E+00, 1.046118850E-02,-3.153797080E-06, 3.853068840E-10,-1.264136890E-14, 1.717663630E+04,-2.281817580E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00,-3.578880960E-01, 3.270285360E-02,-2.400535800E-05, 9.073457290E-09,-1.370164870E-12, 2.002356950E+04, 2.428456030E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.22e-10, \ + /* kbOveps = */ 0.0031645569620253164, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + +// CHO+ +#define iCHOP 36 +#define CHOP { \ + /* Name = */ (char*)("CHO+"), \ + /* W = */ 0.012010999999999999*1.0+5.485799088728284e-07*-1.0+0.001008*1.0+0.015999*1.0, \ + /* inx = */ iCHOP, \ + /* isElectron = */ false, \ + /* nCrg = */ 1, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 3654.18, \ + /* TSwitch2 = */ 3654.18, \ + /* TMin = */ 298.15, \ + /* TMax = */ 20000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 6.915726500E+00, 1.663110700E-04,-1.847634300E-08, 9.085642900E-13,-1.645444100E-17, 9.612933300E+04,-1.808951000E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.876276800E+00, 4.948602000E-03,-2.308530600E-06, 5.112175200E-10,-4.352063100E-14, 9.913002200E+04, 6.502026600E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.7500000000000003e-10, \ + /* kbOveps = */ 0.0125, \ + /* mu = */ 0.0, \ + /* alpha = */ 1.341e-30, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// C2H3O+ +#define iC2H3OP 37 +#define C2H3OP { \ + /* Name = */ (char*)("C2H3O+"), \ + /* W = */ 0.012010999999999999*2.0+5.485799088728284e-07*-1.0+0.001008*3.0+0.015999*1.0, \ + /* inx = */ iC2H3OP, \ + /* isElectron = */ false, \ + /* nCrg = */ 1, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 1000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.313716500E+00, 9.173779300E-03,-3.322038600E-06, 5.394745600E-10,-3.245236800E-14, 7.690186500E+04,-1.675755800E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.035870500E+00, 8.772948700E-04, 3.071001000E-05,-3.924756500E-08, 1.529686900E-11, 7.786483200E+04, 7.861768200E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97e-10, \ + /* kbOveps = */ 0.0022935779816513763, \ + /* mu = */ 0.0, \ + /* alpha = */ 3.0360000000000002e-30, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// CH5O+ +#define iCH5OP 38 +#define CH5OP { \ + /* Name = */ (char*)("CH5O+"), \ + /* W = */ 0.012010999999999999*1.0+5.485799088728284e-07*-1.0+0.001008*5.0+0.015999*1.0, \ + /* inx = */ iCH5OP, \ + /* isElectron = */ false, \ + /* nCrg = */ 1, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 1000.0, \ + /* TMin = */ 300.0, \ + /* TMax = */ 5000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.029061000E+00, 9.376593000E-03,-3.050254000E-06, 4.358793000E-10,-2.224723000E-14, 6.853103700E+04, 2.378195000E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.660115000E+00, 7.341508000E-03, 7.170050000E-06,-8.793194000E-09, 2.390570000E-12, 6.933546700E+04, 1.123263100E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97e-10, \ + /* kbOveps = */ 0.0022935779816513763, \ + /* mu = */ 0.0, \ + /* alpha = */ 2.1260000000000002e-30, \ + /* Z298 = */ 2.0, \ + }, \ +} + +// H3O+ +#define iH3OP 39 +#define H3OP { \ + /* Name = */ (char*)("H3O+"), \ + /* W = */ 5.485799088728284e-07*-1.0+0.001008*3.0+0.015999*1.0, \ + /* inx = */ iH3OP, \ + /* isElectron = */ false, \ + /* nCrg = */ 1, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 5430.9, \ + /* TSwitch2 = */ 5430.9, \ + /* TMin = */ 298.15, \ + /* TMax = */ 20000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 8.950880300E+00, 2.528166800E-04,-2.459439700E-08, 1.087831800E-12,-1.809083700E-17, 6.448074900E+04,-3.387331900E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.688523200E+00, 5.445365400E-03,-1.705556600E-06, 2.483329300E-10,-1.376944000E-14, 7.089026800E+04, 6.360821700E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.15e-10, \ + /* kbOveps = */ 0.009416195856873822, \ + /* mu = */ 0.0, \ + /* alpha = */ 9.640000000000001e-31, \ + /* Z298 = */ 10.0, \ + }, \ +} + +// OH- +#define iOHM 40 +#define OHM { \ + /* Name = */ (char*)("OH-"), \ + /* W = */ 5.485799088728284e-07*1.0+0.001008*1.0+0.015999*1.0, \ + /* inx = */ iOHM, \ + /* isElectron = */ false, \ + /* nCrg = */ -1, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 1000.0, \ + /* TMin = */ 298.15, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.834057010E+00, 1.070580230E-03,-2.624593980E-07, 3.083764350E-11,-1.313838620E-15,-1.801869740E+04, 4.494647620E+00}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.432799560E+00, 6.196563100E-04,-1.899309920E-06, 2.373659460E-09,-8.551037550E-13,-1.826130860E+04, 1.060536700E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.7500000000000003e-10, \ + /* kbOveps = */ 0.0125, \ + /* mu = */ 0.0, \ + /* alpha = */ 6.4e-30, \ + /* Z298 = */ 0.0, \ + }, \ +} + +// O2- +#define iO2M 41 +#define O2M { \ + /* Name = */ (char*)("O2-"), \ + /* W = */ 5.485799088728284e-07*1.0+0.015999*2.0, \ + /* inx = */ iO2M, \ + /* isElectron = */ false, \ + /* nCrg = */ -1, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 2008.71, \ + /* TSwitch2 = */ 2008.71, \ + /* TMin = */ 298.15, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.259286700E+00, 2.246807200E-04,-5.139795500E-08, 7.354597800E-12,-3.855865200E-16,-7.242625200E+03, 4.759969700E-01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.102171800E+00, 2.798087500E-03,-2.265112600E-06, 8.691651700E-10,-1.272188400E-13,-6.807479300E+03, 6.760902000E+00}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.3300000000000004e-10, \ + /* kbOveps = */ 0.007326007326007326, \ + /* mu = */ 0.0, \ + /* alpha = */ 1.581e-30, \ + /* Z298 = */ 3.8, \ + }, \ +} + +// E +#define iE 42 +#define E { \ + /* Name = */ (char*)("E"), \ + /* W = */ 5.485799088728284e-07*1.0, \ + /* inx = */ iE, \ + /* isElectron = */ true, \ + /* nCrg = */ -1, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 27300.0, \ + /* TSwitch2 = */ 27300.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 30100.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00,-7.453750000E+02,-1.173397500E+01}, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.500000000E+00,-8.150260800E-18, 1.302986700E-21,-7.264833300E-26, 1.306624700E-30,-7.453750000E+02,-1.173397500E+01}, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 4.2500000000000003e-08, \ + /* kbOveps = */ 0.001176470588235294, \ + /* mu = */ 0.0, \ + /* alpha = */ 0.0, \ + /* Z298 = */ 1.0, \ + }, \ +} + + +//--------------------------------- +// Define Reactions +//--------------------------------- + +// R 0: H2 + M <=> 2 H + M +#define R0 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.577000000e+13, \ + /* n = */ -1.400000000e+00, \ + /* EovR = */ 5.253611930e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.9 }, \ + { /* ind = */ iCO2, /* eff = */ 3.8 }, \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 1: H2 + O <=> H + OH +#define R1 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.080000000e-02, \ + /* n = */ 2.670000000e+00, \ + /* EovR = */ 3.166257305e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 2: H2 + OH <=> H + H2O +#define R2 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.380000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.517504539e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 3: 2 O + M <=> O2 + M +#define R3 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.165000000e+03, \ + /* n = */ -5.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.9 }, \ + { /* ind = */ iCO2, /* eff = */ 3.8 }, \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 4: H + O2 <=> O + OH +#define R4 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.140000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.692213789e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 5: H + OH + M <=> H2O + M +#define R5 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.500000000e+10, \ + /* n = */ -2.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 3, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 0.73 }, \ + { /* ind = */ iH2O, /* eff = */ 3.65 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 6: H2O + O <=> 2 OH +#define R6 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.700000000e+01, \ + /* n = */ 1.704000000e+00, \ + /* EovR = */ 7.541650505e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 7: H + O + M <=> OH + M +#define R7 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.714000000e+06, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 8: H2O2 (+M) <=> 2 OH (+M) +#define R8 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.490000000e+18, \ + /* n = */ -2.300000000e+00, \ + /* EovR = */ 2.453144904e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.000000000e+12, \ + /* n = */ 9.000000000e-01, \ + /* EovR = */ 2.453144904e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCO , /* eff = */ 2.8 }, \ + { /* ind = */ iCO2, /* eff = */ 1.6 }, \ + { /* ind = */ iH2 , /* eff = */ 3.7 }, \ + { /* ind = */ iH2O, /* eff = */ 7.65 }, \ + { /* ind = */ iH2O2, /* eff = */ 7.7 }, \ + { /* ind = */ iN2 , /* eff = */ 1.5 }, \ + { /* ind = */ iO2 , /* eff = */ 1.2 } \ + }, \ + /* Ftype = */ F_Troe2, \ + /* FOData = */ { .Troe2 = { \ + /* alpha = */ 0.43, \ + /* T1 = */ 1.0000000000000002e+30, \ + /* T3 = */ 1e-30 \ + }}, \ +} + +// R 9: H + H2O2 <=> H2O + OH +#define R9 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.410000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.997781548e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 10: H + H2O2 <=> H2 + HO2 +#define R10 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.150000000e+04, \ + /* n = */ 1.000000000e+00, \ + /* EovR = */ 3.019317201e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 11: H2O2 + O <=> HO2 + OH +#define R11 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.550000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.997781548e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 12: H2O2 + OH <=> H2O + HO2 +#define R12 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.740000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.600238117e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 13: H2O2 + OH <=> H2O + HO2 +#define R13 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.590000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.657902789e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 14: H + HO2 <=> 2 OH +#define R14 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.079000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.484497624e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 15: H + HO2 <=> H2 + O2 +#define R15 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.140200000e+04, \ + /* n = */ 1.083000000e+00, \ + /* EovR = */ 2.786729133e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 16: HO2 + O <=> O2 + OH +#define R16 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.250000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 17: HO2 + OH <=> H2O + O2 +#define R17 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -5.499988213e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 18: HO2 + OH <=> H2O + O2 +#define R18 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.500000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.499988213e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 19: 2 HO2 <=> H2O2 + O2 +#define R19 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.555986483e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 20: 2 HO2 <=> H2O2 + O2 +#define R20 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.900000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -7.089960651e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 21: H + O2 (+M) <=> HO2 (+M) +#define R21 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.740000000e+07, \ + /* n = */ -1.230000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 4.650000000e+06, \ + /* n = */ 4.400000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.9 }, \ + { /* ind = */ iCO2, /* eff = */ 3.8 }, \ + { /* ind = */ iH2 , /* eff = */ 1.3 }, \ + { /* ind = */ iH2O, /* eff = */ 10.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.67, \ + /* T1 = */ 1.0000000000000002e+30, \ + /* T2 = */ 1e+30, \ + /* T3 = */ 1e-30 \ + }}, \ +} + +// R 22: CO + O (+M) <=> CO2 (+M) +#define R22 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.170000000e+12, \ + /* n = */ -2.790000000e+00, \ + /* EovR = */ 2.108993065e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.362000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.199675368e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 4, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCO , /* eff = */ 1.75 }, \ + { /* ind = */ iCO2, /* eff = */ 3.6 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Lindemann, \ + /* FOData = */ { .Lindemann = { \ + /* dummy = */ 0, \ + }}, \ +} + +// R 23: CO + OH <=> CO2 + H +#define R23 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.015000000e-02, \ + /* n = */ 2.053000000e+00, \ + /* EovR = */ -1.789951881e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 24: CO + OH <=> CO2 + H +#define R24 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.757000000e+06, \ + /* n = */ -6.640000000e-01, \ + /* EovR = */ 1.669682412e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 25: CO + HO2 <=> CO2 + OH +#define R25 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.570000000e-01, \ + /* n = */ 2.180000000e+00, \ + /* EovR = */ 9.027758431e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 26: CO + O2 <=> CO2 + O +#define R26 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.119000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.400357175e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 27: CH3 + H (+M) <=> CH4 (+M) +#define R27 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.480000000e+21, \ + /* n = */ -4.760000000e+00, \ + /* EovR = */ 1.227855662e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.270000000e+10, \ + /* n = */ -6.300000000e-01, \ + /* EovR = */ 1.927330813e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.783, \ + /* T1 = */ 2941.0, \ + /* T2 = */ 6964.0, \ + /* T3 = */ 74.0 \ + }}, \ +} + +// R 28: CH4 + H <=> CH3 + H2 +#define R28 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.140000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 4.824365668e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 29: CH4 + O <=> CH3 + OH +#define R29 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.020000000e+03, \ + /* n = */ 1.500000000e+00, \ + /* EovR = */ 4.327687988e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 30: CH4 + OH <=> CH3 + H2O +#define R30 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.830000000e-02, \ + /* n = */ 2.600000000e+00, \ + /* EovR = */ 1.102050778e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 31: CH4 + HO2 <=> CH3 + H2O2 +#define R31 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.130000000e-05, \ + /* n = */ 3.740000000e+00, \ + /* EovR = */ 1.057264240e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 32: CH3 + HO2 <=> CH4 + O2 +#define R32 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.160000000e-01, \ + /* n = */ 2.230000000e+00, \ + /* EovR = */ -1.520729430e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 33: CH2 + CH4 <=> 2 CH3 +#define R33 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.460000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.161625542e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 34: CH2(S) + N2 <=> CH2 + N2 +#define R34 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.019317201e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iN2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iN2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 35: CH2(S) + H2O <=> CH2 + H2O +#define R35 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 36: CH2(S) + CO <=> CH2 + CO +#define R36 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 37: CH2(S) + CO2 <=> CH2 + CO2 +#define R37 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 38: CH2(S) + O2 => CO + H + OH +#define R38 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.800000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 39: CH2(S) + O2 <=> CO + H2O +#define R39 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 40: CH2(S) + O <=> CO + H2 +#define R40 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 41: CH2(S) + O <=> H + HCO +#define R41 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 42: CH2(S) + H2 <=> CH3 + H +#define R42 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 43: CH2(S) + H <=> CH + H2 +#define R43 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 44: CH2(S) + OH <=> CH2O + H +#define R44 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 45: CH2(S) + CO2 <=> CH2O + CO +#define R45 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 46: CH2 + H (+M) <=> CH3 (+M) +#define R46 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.200000000e+15, \ + /* n = */ -3.140000000e+00, \ + /* EovR = */ 6.189600262e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.500000000e+10, \ + /* n = */ -8.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.68, \ + /* T1 = */ 1995.0, \ + /* T2 = */ 5590.0, \ + /* T3 = */ 78.0 \ + }}, \ +} + +// R 47: CH2 + O2 <=> HCO + OH +#define R47 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.060000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548293002e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 48: CH2 + O2 => CO2 + 2 H +#define R48 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.640000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548293002e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 49: CH2 + O => CO + 2 H +#define R49 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 50: CH2 + H <=> CH + H2 +#define R50 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 51: CH2 + OH <=> CH + H2O +#define R51 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.130000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.509658600e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 52: CH + O2 <=> HCO + O +#define R52 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.300000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 53: CH + O <=> CO + H +#define R53 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.700000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 54: CH + H <=> C + H2 +#define R54 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.100000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 55: CH + OH <=> H + HCO +#define R55 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 56: CH + H2O <=> CH2O + H +#define R56 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.774000000e+10, \ + /* n = */ -1.220000000e+00, \ + /* EovR = */ 1.197662490e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 57: CH + CO2 <=> CO + HCO +#define R57 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.700000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.447053804e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 58: C + OH <=> CO + H +#define R58 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 59: C + O2 <=> CO + O +#define R59 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 60: CH3 + O2 (+M) <=> CH3O2 (+M) +#define R60 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.850000000e+12, \ + /* n = */ -3.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 7.812000000e+03, \ + /* n = */ 9.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.6, \ + /* T1 = */ 70.0, \ + /* T2 = */ 1700.0, \ + /* T3 = */ 1000.0 \ + }}, \ +} + +// R 61: CH3 + O2 <=> CH3O + O +#define R61 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.546000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.425117719e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 62: CH3 + O2 <=> CH2O + OH +#define R62 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.641000000e-06, \ + /* n = */ 3.283000000e+00, \ + /* EovR = */ 4.078594319e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 63: CH3 + O <=> CH2O + H +#define R63 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.540000000e+07, \ + /* n = */ 5.000000000e-02, \ + /* EovR = */ -6.843785656e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 64: CH3 + OH <=> CH2(S) + H2O +#define R64 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.282000000e+11, \ + /* n = */ -1.518000000e+00, \ + /* EovR = */ 8.917050134e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 65: CH3 + OH <=> CH2O + H2 +#define R65 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.650000000e+01, \ + /* n = */ 9.730000000e-01, \ + /* EovR = */ -1.011471262e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 66: CH3 + OH <=> CH2OH + H +#define R66 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.686000000e+04, \ + /* n = */ 8.330000000e-01, \ + /* EovR = */ 1.794480856e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 67: CH3 + OH <=> CH3O + H +#define R67 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.230000000e+03, \ + /* n = */ 1.011000000e+00, \ + /* EovR = */ 6.013473425e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 68: CH3 + OH <=> CH2 + H2O +#define R68 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.293000000e-02, \ + /* n = */ 2.568000000e+00, \ + /* EovR = */ 2.011771051e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 69: CH3 + HO2 <=> CH3O + OH +#define R69 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+06, \ + /* n = */ 2.690000000e-01, \ + /* EovR = */ -3.459634293e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 70: CH3O2 + O <=> CH3O + O2 +#define R70 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.600000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 71: CH3O2 + H <=> CH3O + OH +#define R71 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.600000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 72: CH3O2 + OH <=> CH3OH + O2 +#define R72 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 73: CH3 + CH3O2 <=> 2 CH3O +#define R73 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.080000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -7.100427618e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 74: 2 CH3O2 => CH2O + CH3OH + O2 +#define R74 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.110000000e+08, \ + /* n = */ -1.610000000e+00, \ + /* EovR = */ -5.288837297e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 75: 2 CH3O2 => 2 CH3O + O2 +#define R75 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.400000000e+10, \ + /* n = */ -1.610000000e+00, \ + /* EovR = */ 9.359883323e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 2.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 76: CH3OH (+M) <=> CH3 + OH (+M) +#define R76 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.500000000e+37, \ + /* n = */ -6.995000000e+00, \ + /* EovR = */ 4.931158917e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.084000000e+18, \ + /* n = */ -6.150000000e-01, \ + /* EovR = */ 4.656823756e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ -0.4748, \ + /* T1 = */ 1116.0, \ + /* T2 = */ 9023.0, \ + /* T3 = */ 35580.0 \ + }}, \ +} + +// R 77: CH3OH (+M) <=> CH2(S) + H2O (+M) +#define R77 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.430000000e+41, \ + /* n = */ -8.227000000e+00, \ + /* EovR = */ 5.002862668e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 3.121000000e+18, \ + /* n = */ -1.017000000e+00, \ + /* EovR = */ 4.615126986e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 2.545, \ + /* T1 = */ 47320.0, \ + /* T2 = */ 47110.0, \ + /* T3 = */ 3290.0 \ + }}, \ +} + +// R 78: CH3OH (+M) <=> CH2OH + H (+M) +#define R78 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.390000000e+36, \ + /* n = */ -7.244000000e+00, \ + /* EovR = */ 5.295394248e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 7.896000000e-03, \ + /* n = */ 5.038000000e+00, \ + /* EovR = */ 4.250564562e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ -73.91, \ + /* T1 = */ 41500.0, \ + /* T2 = */ 5220.0, \ + /* T3 = */ 37050.0 \ + }}, \ +} + +// R 79: CH3OH + H <=> CH3O + H2 +#define R79 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.990000000e-01, \ + /* n = */ 2.560000000e+00, \ + /* EovR = */ 5.183161195e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 80: CH3OH + H <=> CH2OH + H2 +#define R80 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.070000000e-01, \ + /* n = */ 2.550000000e+00, \ + /* EovR = */ 2.737514262e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 81: CH3OH + O <=> CH3O + OH +#define R81 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.880000000e-02, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 1.549916163e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 82: CH3OH + O <=> CH2OH + OH +#define R82 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.880000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 1.549916163e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 83: CH3OH + OH <=> CH3O + H2O +#define R83 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e-04, \ + /* n = */ 3.030000000e+00, \ + /* EovR = */ -3.839565041e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 84: CH3OH + OH <=> CH2OH + H2O +#define R84 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.080000000e-02, \ + /* n = */ 2.650000000e+00, \ + /* EovR = */ -4.059471977e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 85: CH3OH + O2 <=> CH3O + HO2 +#define R85 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.580000000e-02, \ + /* n = */ 2.270000000e+00, \ + /* EovR = */ 2.151993174e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 86: CH3OH + O2 <=> CH2OH + HO2 +#define R86 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.580000000e-01, \ + /* n = */ 2.270000000e+00, \ + /* EovR = */ 2.151993174e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 87: CH3OH + HO2 <=> CH3O + H2O2 +#define R87 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.220000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.009996829e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 88: CH3OH + HO2 <=> CH2OH + H2O2 +#define R88 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.260000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 9.451569922e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 89: CH3 + CH3OH <=> CH2OH + CH4 +#define R89 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.130000000e-07, \ + /* n = */ 3.953000000e+00, \ + /* EovR = */ 3.550264131e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 90: CH3 + CH3OH <=> CH3O + CH4 +#define R90 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.220000000e-03, \ + /* n = */ 2.425000000e+00, \ + /* EovR = */ 4.317371988e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 91: CH3OH + HCO <=> CH2O + CH2OH +#define R91 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.800000000e-03, \ + /* n = */ 2.900000000e+00, \ + /* EovR = */ 6.597208084e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 92: CH3O + CH3OH <=> CH2OH + CH3OH +#define R92 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.050116379e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 93: CH2OH + O2 <=> CH2O + HO2 +#define R93 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.510000000e+09, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 94: CH2OH + O2 <=> CH2O + HO2 +#define R94 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.410000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.524652400e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 95: CH2OH + H <=> CH2O + H2 +#define R95 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 96: CH2OH + HO2 <=> CH2O + H2O2 +#define R96 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 97: CH2OH + HCO <=> 2 CH2O +#define R97 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.800000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 98: CH2OH + HCO <=> CH3OH + CO +#define R98 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 99: CH2OH + CH3O <=> CH2O + CH3OH +#define R99 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 100: CH2OH + OH <=> CH2O + H2O +#define R100 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 101: CH2OH + O <=> CH2O + OH +#define R101 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 102: 2 CH2OH <=> CH2O + CH3OH +#define R102 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 103: CH3O + O2 <=> CH2O + HO2 +#define R103 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.380000000e-25, \ + /* n = */ 9.500000000e+00, \ + /* EovR = */ -2.768210654e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 104: CH3O + H <=> CH2O + H2 +#define R104 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 105: CH3O + HO2 <=> CH2O + H2O2 +#define R105 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.010000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 106: CH3 + CH3O <=> CH2O + CH4 +#define R106 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 107: 2 CH3O <=> CH2O + CH3OH +#define R107 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.030000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 108: H + HCO (+M) <=> CH2O (+M) +#define R108 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.350000000e+12, \ + /* n = */ -2.570000000e+00, \ + /* EovR = */ 7.170878352e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.090000000e+06, \ + /* n = */ 4.800000000e-01, \ + /* EovR = */ -1.308370787e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.7824, \ + /* T1 = */ 2755.0, \ + /* T2 = */ 6570.0, \ + /* T3 = */ 271.0 \ + }}, \ +} + +// R 109: CO + H2 (+M) <=> CH2O (+M) +#define R109 { \ + /* ArrCoeffL = */ { \ + /* A = */ 5.070000000e+15, \ + /* n = */ -3.420000000e+00, \ + /* EovR = */ 4.244556121e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 4.300000000e+01, \ + /* n = */ 1.500000000e+00, \ + /* EovR = */ 4.005627487e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.932, \ + /* T1 = */ 1540.0, \ + /* T2 = */ 10300.0, \ + /* T3 = */ 197.00000000000003 \ + }}, \ +} + +// R 110: CH2O + O2 <=> HCO + HO2 +#define R110 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.070000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.688198748e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 111: CH2O + O <=> HCO + OH +#define R111 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.260000000e+03, \ + /* n = */ 1.150000000e+00, \ + /* EovR = */ 1.137276146e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 112: CH2O + H <=> H2 + HCO +#define R112 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.740000000e+01, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 1.378821522e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 113: CH2O + OH <=> H2O + HCO +#define R113 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.820000000e+01, \ + /* n = */ 1.630000000e+00, \ + /* EovR = */ -5.308966078e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 114: CH2O + HO2 <=> H2O2 + HCO +#define R114 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.880000000e-02, \ + /* n = */ 2.700000000e+00, \ + /* EovR = */ 5.797089026e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 115: CH2O + CH3 <=> CH4 + HCO +#define R115 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.830000000e-05, \ + /* n = */ 3.360000000e+00, \ + /* EovR = */ 2.169882628e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 116: CH2O + CH3O <=> CH3OH + HCO +#define R116 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.620000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.154385610e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 117: HCO + M <=> CO + H + M +#define R117 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.700000000e+05, \ + /* n = */ 6.600000000e-01, \ + /* EovR = */ 7.482874463e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 118: HCO + O2 <=> CO + HO2 +#define R118 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.580000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.063200087e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 119: HCO + O <=> CO + OH +#define R119 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.020000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 120: H + HCO <=> CO + H2 +#define R120 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.340000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 121: HCO + OH <=> CO + H2O +#define R121 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.011000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 122: CH3 + HCO <=> CH4 + CO +#define R122 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.650000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 123: 2 HCO <=> CH2O + CO +#define R123 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.800000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 124: HCO + O <=> CO2 + H +#define R124 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 125: HCO + HO2 => CO2 + H + OH +#define R125 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 126: 2 HCO => 2 CO + H2 +#define R126 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 2.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 127: CH2O + H (+M) <=> CH2OH (+M) +#define R127 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.270000000e+20, \ + /* n = */ -4.820000000e+00, \ + /* EovR = */ 3.286023554e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.400000000e+05, \ + /* n = */ 4.540000000e-01, \ + /* EovR = */ 1.811590321e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.7187, \ + /* T1 = */ 1291.0, \ + /* T2 = */ 4160.0, \ + /* T3 = */ 103.00000000000001 \ + }}, \ +} + +// R 128: CH3O (+M) <=> CH2O + H (+M) +#define R128 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.870000000e+19, \ + /* n = */ -3.000000000e+00, \ + /* EovR = */ 1.223175720e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 6.800000000e+13, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.316925519e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.9, \ + /* T1 = */ 1300.0, \ + /* T2 = */ 1e+99, \ + /* T3 = */ 2500.0 \ + }}, \ +} + +// R 129: 2 CH3 (+M) <=> C2H6 (+M) +#define R129 { \ + /* ArrCoeffL = */ { \ + /* A = */ 8.050000000e+19, \ + /* n = */ -3.750000000e+00, \ + /* EovR = */ 4.939602941e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.277000000e+09, \ + /* n = */ -6.900000000e-01, \ + /* EovR = */ 8.801309641e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCO , /* eff = */ 2.0 }, \ + { /* ind = */ iCO2, /* eff = */ 3.0 }, \ + { /* ind = */ iH2O, /* eff = */ 5.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.0, \ + /* T1 = */ 1.0000000000000002e+30, \ + /* T2 = */ 1e+30, \ + /* T3 = */ 570.0 \ + }}, \ +} + +// R 130: C2H5 + H (+M) <=> C2H6 (+M) +#define R130 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.990000000e+29, \ + /* n = */ -7.080000000e+00, \ + /* EovR = */ 3.364022581e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.210000000e+11, \ + /* n = */ -9.900000000e-01, \ + /* EovR = */ 7.950868629e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 6, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.842, \ + /* T1 = */ 2219.0, \ + /* T2 = */ 6882.0, \ + /* T3 = */ 125.0 \ + }}, \ +} + +// R 131: C2H6 + O2 <=> C2H5 + HO2 +#define R131 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.030000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.610199720e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 132: C2H6 + O <=> C2H5 + OH +#define R132 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.550000000e+00, \ + /* n = */ 2.400000000e+00, \ + /* EovR = */ 2.933769880e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 133: C2H6 + H <=> C2H5 + H2 +#define R133 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.150000000e+02, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 3.789243087e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 134: C2H6 + OH <=> C2H5 + H2O +#define R134 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.480000000e+01, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 4.780585568e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 135: C2H6 + HO2 <=> C2H5 + H2O2 +#define R135 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.460000000e-05, \ + /* n = */ 3.610000000e+00, \ + /* EovR = */ 8.514474507e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 136: C2H6 + CH <=> C2H5 + CH2 +#define R136 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.100000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -1.308370787e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 137: C2H6 + CH2(S) <=> C2H5 + CH3 +#define R137 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 138: C2H6 + CH3 <=> C2H5 + CH4 +#define R138 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.550000000e-10, \ + /* n = */ 4.720000000e+00, \ + /* EovR = */ 1.625902313e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 139: C2H6 + CH3O <=> C2H5 + CH3OH +#define R139 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.410000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.567826493e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 140: C2H4 + H (+M) <=> C2H5 (+M) +#define R140 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.420000000e+27, \ + /* n = */ -6.642000000e+00, \ + /* EovR = */ 2.903073489e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 9.569000000e+02, \ + /* n = */ 1.463000000e+00, \ + /* EovR = */ 6.818624679e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ -0.569, \ + /* T1 = */ -9147.0, \ + /* T2 = */ 152.4, \ + /* T3 = */ 299.0 \ + }}, \ +} + +// R 141: C2H5 + H <=> C2H4 + H2 +#define R141 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 142: 2 C2H4 <=> C2H3 + C2H5 +#define R142 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.820000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.599529323e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 143: C2H5 + CH3 <=> C2H4 + CH4 +#define R143 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.180000000e-02, \ + /* n = */ 2.450000000e+00, \ + /* EovR = */ -1.469904257e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 144: C2H5 + O <=> CH3CHO + H +#define R144 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.100000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 145: 2 CH3 <=> C2H5 + H +#define R145 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.100000000e+08, \ + /* n = */ -3.620000000e-01, \ + /* EovR = */ 6.729303212e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 146: C2H5 + O2 <=> C2H4 + HO2 +#define R146 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.843000000e+01, \ + /* n = */ 1.130000000e+00, \ + /* EovR = */ -3.626199958e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 147: C2H5 + O2 <=> CH3CHO + OH +#define R147 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.803000000e-08, \ + /* n = */ 3.570000000e+00, \ + /* EovR = */ 1.330009227e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 148: C2H3 + H (+M) <=> C2H4 (+M) +#define R148 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.400000000e+18, \ + /* n = */ -3.860000000e+00, \ + /* EovR = */ 1.670688851e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 6.080000000e+06, \ + /* n = */ 2.700000000e-01, \ + /* EovR = */ 1.409014694e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.782, \ + /* T1 = */ 2663.0, \ + /* T2 = */ 6095.0, \ + /* T3 = */ 207.49999999999997 \ + }}, \ +} + +// R 149: C2H4 + M <=> C2H2 + H2 + M +#define R149 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.610000000e+10, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.412985842e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 150: C2H4 + O2 <=> C2H3 + HO2 +#define R150 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.220000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.899706950e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 151: C2H4 + H <=> C2H3 + H2 +#define R151 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.070000000e+01, \ + /* n = */ 1.930000000e+00, \ + /* EovR = */ 6.516692959e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 152: C2H4 + OH <=> C2H3 + H2O +#define R152 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.230000000e-02, \ + /* n = */ 2.745000000e+00, \ + /* EovR = */ 1.114882876e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 153: C2H4 + CH3O <=> C2H3 + CH3OH +#define R153 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.396731851e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 154: C2H4 + CH3 <=> C2H3 + CH4 +#define R154 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.760000000e-04, \ + /* n = */ 2.947000000e+00, \ + /* EovR = */ 7.622769493e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 155: C2H4 + CH3 <=> C2H3 + CH4 +#define R155 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.130000000e-11, \ + /* n = */ 4.417000000e+00, \ + /* EovR = */ 4.446347154e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 156: C2H4 + O <=> CH3 + HCO +#define R156 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.453000000e+00, \ + /* n = */ 1.880000000e+00, \ + /* EovR = */ 9.208917463e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 157: C2H4 + O <=> CH2CHO + H +#define R157 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.098000000e+00, \ + /* n = */ 1.880000000e+00, \ + /* EovR = */ 9.208917463e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 158: CH + CH4 <=> C2H4 + H +#define R158 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 159: CH2(S) + CH3 <=> C2H4 + H +#define R159 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 160: C2H4 + OH <=> CH2O + CH3 +#define R160 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.780000000e-01, \ + /* n = */ 1.680000000e+00, \ + /* EovR = */ 1.036883849e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 161: C2H4 + OH <=> CH3CHO + H +#define R161 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.380000000e-08, \ + /* n = */ 3.910000000e+00, \ + /* EovR = */ 8.668962904e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 162: C2H2 + H (+M) <=> C2H3 (+M) +#define R162 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.350000000e+19, \ + /* n = */ -4.664000000e+00, \ + /* EovR = */ 1.902169837e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.710000000e+04, \ + /* n = */ 1.266000000e+00, \ + /* EovR = */ 1.363221716e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe2, \ + /* FOData = */ { .Troe2 = { \ + /* alpha = */ 0.788, \ + /* T1 = */ 1e-30, \ + /* T3 = */ -10200.0 \ + }}, \ +} + +// R 163: C2H3 + O2 <=> CH2CHO + O +#define R163 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.100000000e+14, \ + /* n = */ -2.650000000e+00, \ + /* EovR = */ 3.265391553e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 164: C2H3 + O2 <=> CH2CHO + O +#define R164 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.020000000e+04, \ + /* n = */ 5.800000000e-01, \ + /* EovR = */ 1.932363009e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 165: C2H3 + O2 <=> C2H2 + HO2 +#define R165 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.150000000e+01, \ + /* n = */ 1.190000000e+00, \ + /* EovR = */ 1.694340169e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 166: C2H3 + O2 <=> C2H2 + HO2 +#define R166 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.600000000e-05, \ + /* n = */ 2.760000000e+00, \ + /* EovR = */ -2.479865861e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 167: C2H3 + O2 <=> CH2CO + OH +#define R167 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.060000000e-03, \ + /* n = */ 2.390000000e+00, \ + /* EovR = */ 3.109896717e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 168: C2H3 + O2 <=> CH2CO + OH +#define R168 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.260000000e-07, \ + /* n = */ 3.010000000e+00, \ + /* EovR = */ 8.942211110e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 169: C2H3 + O2 <=> CH2O + HCO +#define R169 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.730000000e+29, \ + /* n = */ -7.320000000e+00, \ + /* EovR = */ 5.948054886e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 170: C2H3 + O2 <=> CH2O + HCO +#define R170 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.080000000e+09, \ + /* n = */ -1.310000000e+00, \ + /* EovR = */ 3.249288528e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 171: C2H3 + O2 => CH2O + CO + H +#define R171 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.360000000e+29, \ + /* n = */ -7.320000000e+00, \ + /* EovR = */ 5.948054886e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 172: C2H3 + O2 => CH2O + CO + H +#define R172 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.420000000e+10, \ + /* n = */ -1.310000000e+00, \ + /* EovR = */ 3.249288528e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 173: C2H3 + O2 <=> CH3O + CO +#define R173 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.030000000e+05, \ + /* n = */ -3.300000000e-01, \ + /* EovR = */ -3.763075672e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 174: C2H3 + O2 <=> CH3O + CO +#define R174 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.770000000e+15, \ + /* n = */ -3.540000000e+00, \ + /* EovR = */ 2.401363614e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 175: C2H3 + O2 <=> CH3 + CO2 +#define R175 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.250000000e+25, \ + /* n = */ -6.700000000e+00, \ + /* EovR = */ 5.253611930e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 176: C2H3 + O2 <=> CH3 + CO2 +#define R176 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.320000000e+07, \ + /* n = */ -1.140000000e+00, \ + /* EovR = */ 2.247881656e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 177: C2H3 + H <=> C2H2 + H2 +#define R177 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.635300000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 178: C2H3 + OH <=> C2H2 + H2O +#define R178 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.011000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 179: C2H3 + CH3 <=> C2H2 + CH4 +#define R179 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.920000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 180: 2 C2H3 <=> C2H2 + C2H4 +#define R180 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.600000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 181: C2H + H (+M) <=> C2H2 (+M) +#define R181 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.750000000e+21, \ + /* n = */ -4.800000000e+00, \ + /* EovR = */ 9.561171136e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.000000000e+11, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.646, \ + /* T1 = */ 1315.0, \ + /* T2 = */ 5566.0, \ + /* T3 = */ 132.0 \ + }}, \ +} + +// R 182: C2H2 + O <=> CH2 + CO +#define R182 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.395000000e+02, \ + /* n = */ 1.280000000e+00, \ + /* EovR = */ 1.243958687e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 183: C2H2 + O <=> H + HCCO +#define R183 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.958000000e+03, \ + /* n = */ 1.280000000e+00, \ + /* EovR = */ 1.243958687e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 184: C2H2 + HO2 <=> CH2CO + OH +#define R184 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.030000000e+03, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.000092072e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 185: C2H2 + HCO <=> C2H3 + CO +#define R185 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.019317201e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 186: C2H2 + OH <=> C2H + H2O +#define R186 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.632000000e+00, \ + /* n = */ 2.140000000e+00, \ + /* EovR = */ 8.584925241e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 187: C2H2 + OH <=> CH2CO + H +#define R187 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.528000000e+00, \ + /* n = */ 1.550000000e+00, \ + /* EovR = */ 1.059780338e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 188: C2H2 + OH <=> CH3 + CO +#define R188 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.277000000e+03, \ + /* n = */ 7.300000000e-01, \ + /* EovR = */ 1.297803177e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 189: C2H + O2 <=> CO + HCO +#define R189 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548293002e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 190: C2H + O <=> CH + CO +#define R190 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 191: C2H + H2 <=> C2H2 + H +#define R191 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.900000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 2.818029388e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 192: C2H + OH <=> H + HCCO +#define R192 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 193: CH3CHO (+M) <=> CH3 + HCO (+M) +#define R193 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.030000000e+53, \ + /* n = */ -1.130000000e+01, \ + /* EovR = */ 4.826504351e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.450000000e+22, \ + /* n = */ -1.740000000e+00, \ + /* EovR = */ 4.345552282e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.00249, \ + /* T1 = */ 6.089, \ + /* T2 = */ 3780.0, \ + /* T3 = */ 718.1 \ + }}, \ +} + +// R 194: CH3CHO (+M) <=> CH4 + CO (+M) +#define R194 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.140000000e+52, \ + /* n = */ -1.130000000e+01, \ + /* EovR = */ 4.826504351e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.720000000e+21, \ + /* n = */ -1.740000000e+00, \ + /* EovR = */ 4.345552282e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.00249, \ + /* T1 = */ 6.089, \ + /* T2 = */ 3780.0, \ + /* T3 = */ 718.1 \ + }}, \ +} + +// R 195: CH3CHO + O2 <=> CH3CO + HO2 +#define R195 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.010000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.970104474e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 196: CH3CHO + O <=> CH3CO + OH +#define R196 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.940000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 9.400140886e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 197: CH3CHO + OH <=> CH3CO + H2O +#define R197 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.370000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -3.114928912e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 198: CH3CHO + HO2 <=> CH3CO + H2O2 +#define R198 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.998376839e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 199: CH3CHO + H <=> CH2CHO + H2 +#define R199 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.720000000e-03, \ + /* n = */ 3.100000000e+00, \ + /* EovR = */ 2.621773770e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 200: CH3CHO + OH <=> CH2CHO + H2O +#define R200 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.720000000e-01, \ + /* n = */ 2.400000000e+00, \ + /* EovR = */ 4.101239198e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 201: CH3CO <=> CH3 + CO +#define R201 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.450000000e+18, \ + /* n = */ -2.520000000e+00, \ + /* EovR = */ 8.271167862e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 202: CH3CO + O2 <=> CH2CO + HO2 +#define R202 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.600000000e+04, \ + /* n = */ 5.440000000e-01, \ + /* EovR = */ 1.872479884e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 203: CH3CO (+M) <=> CH2CO + H (+M) +#define R203 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.520000000e+45, \ + /* n = */ -1.027000000e+01, \ + /* EovR = */ 2.787332996e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 9.413000000e+07, \ + /* n = */ 1.917000000e+00, \ + /* EovR = */ 2.263843780e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.6009, \ + /* T1 = */ 667.7, \ + /* T2 = */ 5000000000.0, \ + /* T3 = */ 8103000000.0 \ + }}, \ +} + +// R 204: CH3CO + H <=> CH2CO + H2 +#define R204 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 205: CH3CO + O <=> CH2CO + OH +#define R205 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 206: CH3 + CH3CO <=> CH2CO + CH4 +#define R206 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 207: CH2CHO (+M) <=> CH2CO + H (+M) +#define R207 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.000000000e+23, \ + /* n = */ -3.800000000e+00, \ + /* EovR = */ 2.185175470e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.430000000e+15, \ + /* n = */ -1.500000000e-01, \ + /* EovR = */ 2.294681073e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.985, \ + /* T1 = */ 9800000000.0, \ + /* T2 = */ 5000000000.0, \ + /* T3 = */ 392.99999999999994 \ + }}, \ +} + +// R 208: CH2CHO (+M) <=> CH3 + CO (+M) +#define R208 { \ + /* ArrCoeffL = */ { \ + /* A = */ 9.520000000e+27, \ + /* n = */ -5.070000000e+00, \ + /* EovR = */ 2.078296673e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.930000000e+12, \ + /* n = */ 2.900000000e-01, \ + /* EovR = */ 2.027974720e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 7.13e-17, \ + /* T1 = */ 4990000000.0, \ + /* T2 = */ 1790000000.0, \ + /* T3 = */ 1150.0 \ + }}, \ +} + +// R 209: CH2CO (+M) <=> CH2 + CO (+M) +#define R209 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.000000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.868351341e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 3.000000000e+13, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.572858688e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Lindemann, \ + /* FOData = */ { .Lindemann = { \ + /* dummy = */ 0, \ + }}, \ +} + +// R 210: C2H3 + O <=> CH2CO + H +#define R210 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 211: CH2CO + H <=> CH3 + CO +#define R211 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.770000000e+02, \ + /* n = */ 1.450000000e+00, \ + /* EovR = */ 1.398950303e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 212: CH3 + HCO <=> CH2CO + H2 +#define R212 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.900000000e+02, \ + /* n = */ 7.500000000e-01, \ + /* EovR = */ 4.237108472e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 213: CH + CH2O <=> CH2CO + H +#define R213 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.460000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.591580598e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 214: CH2CO + O <=> CH2 + CO2 +#define R214 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.750000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.793463702e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 215: CH2CO + OH <=> CH2OH + CO +#define R215 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -5.082517288e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 216: CH2(S) + CH2CO <=> C2H4 + CO +#define R216 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.646934746e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 217: CH2CO + CH3 <=> C2H5 + CO +#define R217 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.769000000e-02, \ + /* n = */ 2.312000000e+00, \ + /* EovR = */ 4.764482543e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 218: HCCO + OH => 2 CO + H2 +#define R218 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 2.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 219: HCCO + O => 2 CO + H +#define R219 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 2.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 220: CH + CO + M <=> HCCO + M +#define R220 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.570000000e+10, \ + /* n = */ -1.900000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 221: H + HCCO <=> CH2(S) + CO +#define R221 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 222: HCCO + O2 => 2 CO + OH +#define R222 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.910000000e+05, \ + /* n = */ -2.000000000e-02, \ + /* EovR = */ 5.132839242e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 2.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 223: HCCO + O2 => CO + CO2 + H +#define R223 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.780000000e+06, \ + /* n = */ -1.420000000e-01, \ + /* EovR = */ 5.787024635e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 224: CH + HCCO <=> C2H2 + CO +#define R224 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 225: C2H3 + CH3 (+M) <=> C3H6 (+M) +#define R225 { \ + /* ArrCoeffL = */ { \ + /* A = */ 4.270000000e+46, \ + /* n = */ -1.194000000e+01, \ + /* EovR = */ 4.916354198e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.175, \ + /* T1 = */ 60000.0, \ + /* T2 = */ 10140.0, \ + /* T3 = */ 1341.0 \ + }}, \ +} + +// R 226: C2H4 + CH2(S) <=> C3H6 +#define R226 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.130000000e+52, \ + /* n = */ -1.350000000e+01, \ + /* EovR = */ 1.026567848e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 227: C2H4 + CH2(S) <=> C3H6 +#define R227 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.300000000e+34, \ + /* n = */ -8.770000000e+00, \ + /* EovR = */ 2.950778701e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 228: C2H4 + CH2(S) <=> C3H5-A + H +#define R228 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.440000000e+29, \ + /* n = */ -6.550000000e+00, \ + /* EovR = */ 6.994751516e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 229: C2H4 + CH2(S) <=> C3H5-A + H +#define R229 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.890000000e+08, \ + /* n = */ -4.200000000e-01, \ + /* EovR = */ 6.227844947e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 230: C2H4 + CH2(S) <=> C2H3 + CH3 +#define R230 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.160000000e+18, \ + /* n = */ -3.190000000e+00, \ + /* EovR = */ 4.911422647e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 231: C2H4 + CH2(S) <=> C2H3 + CH3 +#define R231 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.920000000e+03, \ + /* n = */ 1.020000000e+00, \ + /* EovR = */ 3.018159796e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 232: C2H3 + CH3 <=> C3H5-A + H +#define R232 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.300000000e+23, \ + /* n = */ -4.570000000e+00, \ + /* EovR = */ 7.246361282e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 233: C2H3 + CH3 <=> C3H5-A + H +#define R233 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.480000000e+04, \ + /* n = */ 6.000000000e-01, \ + /* EovR = */ 7.153768888e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 234: C3H6 <=> C2H3 + CH3 +#define R234 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.800000000e+75, \ + /* n = */ -1.720000000e+01, \ + /* EovR = */ 6.743141749e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 235: C3H6 <=> C2H3 + CH3 +#define R235 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.700000000e+54, \ + /* n = */ -1.180000000e+01, \ + /* EovR = */ 5.728651169e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 236: C3H6 <=> C3H5-A + H +#define R236 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+71, \ + /* n = */ -1.590000000e+01, \ + /* EovR = */ 6.283199095e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 237: C3H6 <=> C3H5-A + H +#define R237 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.280000000e+42, \ + /* n = */ -8.510000000e+00, \ + /* EovR = */ 4.931752716e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 238: C3H6 + H <=> C3H5-A + H2 +#define R238 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.644000000e-01, \ + /* n = */ 2.455000000e+00, \ + /* EovR = */ 2.194641029e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 239: C3H6 + O2 <=> C3H5-A + HO2 +#define R239 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+14, \ + /* n = */ -1.670000000e+00, \ + /* EovR = */ 2.324476701e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 240: C3H6 + O <=> C3H5-A + OH +#define R240 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.240000000e+05, \ + /* n = */ 7.000000000e-01, \ + /* EovR = */ 2.960943735e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 241: C3H6 + OH <=> C3H5-A + H2O +#define R241 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.460000000e+00, \ + /* n = */ 2.072000000e+00, \ + /* EovR = */ 5.287830858e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 242: C3H6 + HO2 <=> C3H5-A + H2O2 +#define R242 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.070000000e-08, \ + /* n = */ 4.403000000e+00, \ + /* EovR = */ 6.817215664e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 243: C3H6 + CH3 <=> C3H5-A + CH4 +#define R243 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.210000000e-06, \ + /* n = */ 3.500000000e+00, \ + /* EovR = */ 2.855770853e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 244: C3H6 + CH3O <=> C3H5-A + CH3OH +#define R244 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.400000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.308370787e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 245: C2H5 + C3H6 <=> C2H6 + C3H5-A +#define R245 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.931551428e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 246: C3H6 + O <=> C2H5 + HCO +#define R246 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.450000000e+00, \ + /* n = */ 1.880000000e+00, \ + /* EovR = */ 9.208917463e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 247: C3H6 + O => CH2CO + CH3 + H +#define R247 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.050000000e+00, \ + /* n = */ 1.880000000e+00, \ + /* EovR = */ 9.208917463e+01, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 248: C3H6 + H <=> C2H4 + CH3 +#define R248 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.670000000e+06, \ + /* n = */ 4.700000000e-01, \ + /* EovR = */ 2.733035608e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 249: C3H6 + H <=> C2H4 + CH3 +#define R249 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e-16, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 250: C2H5 + C3H5-A <=> C2H4 + C3H6 +#define R250 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 251: C3H5-A + HCO <=> C3H6 + CO +#define R251 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 252: C3H5-A + O2 <=> CH2O + CH3CO +#define R252 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.190000000e+09, \ + /* n = */ -1.010000000e+00, \ + /* EovR = */ 1.012880277e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 253: C2H3 + CH2O <=> C2H4 + HCO +#define R253 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.420000000e+04, \ + /* n = */ 2.090000000e-01, \ + /* EovR = */ 1.979766289e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 254: C3H6 + OH <=> CH3 + CH3CHO +#define R254 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.160000000e-10, \ + /* n = */ 4.050000000e+00, \ + /* EovR = */ -5.756831463e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 255: C2H2 + CH3 <=> C3H5-A +#define R255 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.680000000e+47, \ + /* n = */ -1.282000000e+01, \ + /* EovR = */ 1.798003393e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 256: CH3CHO <=> CH2CO + H2 +#define R256 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+13, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.050917245e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 257: C2H2 + O => CH2CO +#define R257 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548293002e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 258: CH2CO + O => 2 HCO +#define R258 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.157404927e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 259: CH2CO + O => CH2O + CO +#define R259 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.516097667e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 260: CH2CO + OH => CH3 + CO2 +#define R260 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 261: CH2CO + O2 => CH2O + CO2 +#define R261 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.861912274e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 262: CH2CO + O2 => CO + HCO + OH +#define R262 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.012878134e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 263: CH3CO + OH => CH2CO + H2O +#define R263 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 264: CH2CHO + OH => CH2CO + H2O +#define R264 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 265: CH2CO + HO2 => CH2O + CO + OH +#define R265 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.516097667e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 266: CH2CHO + O2 => CH2CO + HO2 +#define R266 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.509658600e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 267: 2 CH2CO <=> CH3CO + HCCO +#define R267 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.044478178e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 268: 2 CH2CO => C2H4 + 2 CO +#define R268 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.500000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.012878134e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 269: CH2CO => H + HCCO +#define R269 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+14, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.152968023e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 270: CH2 + CH2CO <=> C2H4 + CO +#define R270 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e-03, \ + /* n = */ 2.800000000e+00, \ + /* EovR = */ 3.124993303e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 271: CH2 + CH2CO <=> CH3 + HCCO +#define R271 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.600000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.535414868e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 272: HCCO + OH <=> CO + H + HCO +#define R272 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 273: HCCO + O2 <=> CO2 + HCO +#define R273 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -4.297494816e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 274: CH2 + HCCO <=> C2H3 + CO +#define R274 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 275: 2 HCCO => C2H2 + 2 CO +#define R275 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 276: C2H2 + O2 <=> HCCO + OH +#define R276 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+01, \ + /* n = */ 1.500000000e+00, \ + /* EovR = */ 1.509658600e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 277: C2H + O2 <=> HCCO + O +#define R277 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.300000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 278: O + OH + M <=> HO2 + M +#define R278 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 279: C2H + O2 <=> CH + CO2 +#define R279 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.500000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.258048834e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 280: CH + OH <=> C + H2O +#define R280 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.509658600e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 281: C2H5 + O2 => CH2O + CH3O +#define R281 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.207726880e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 282: C2H5 + O2 => CH2O + CH3 + O +#define R282 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.358692740e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 283: C2H5 + O => 0.3 C2H4 + 0.35 CH2O + 0.35 CH3 + 0.35 CH3CHO + 0.35 H + 0.3 OH +#define R283 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 6, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 0.3 }, \ + { /* ind = */ iCH2O, /* nu = */ 0.35 }, \ + { /* ind = */ iCH3, /* nu = */ 0.35 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 0.35 }, \ + { /* ind = */ iH , /* nu = */ 0.35 }, \ + { /* ind = */ iOH , /* nu = */ 0.3 } \ + } \ +} + +// R 284: C2H5 + HO2 => CH2O + CH3 + OH +#define R284 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 285: C2H4 + O => CH3CHO +#define R285 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+03, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.516097667e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 286: CH3O2 <=> CH2O + OH +#define R286 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+13, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.365131807e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 287: CH3O2 + OH => CH3O + HO2 +#define R287 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 288: CH3O2 + HO2 => CH2O + H2O + O2 +#define R288 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 289: C3H5-A + CH3O2 => C2H3 + CH2O + CH3O +#define R289 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.500000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 290: CH2O + CH3O2 => CH2O + CO + H2 + OH +#define R290 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.535414868e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 4, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 291: CH3O2 + CO => CH3O + CO2 +#define R291 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.207726880e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 292: CH2O + CH3 <=> CH3CHO + H +#define R292 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.824468455e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 293: CH2 + HCO <=> CH3 + CO +#define R293 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 294: CH2 + O <=> CO + H2 +#define R294 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 295: CH2 + OH <=> CH2O + H +#define R295 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 296: CH2 + CO2 <=> CH2O + CO +#define R296 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.100000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.032195335e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 297: CH2(S) + O <=> CO + 2 H +#define R297 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 298: CH + CH3 <=> C2H3 + H +#define R298 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 299: C + CH3 <=> C2H2 + H +#define R299 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 300: CH2(S) + CH4 <=> 2 CH3 +#define R300 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.300000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 301: 2 C2H2 <=> C2H + C2H3 +#define R301 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.700000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.629619708e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 302: C2H2 + C2H6 <=> C2H3 + C2H5 +#define R302 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.019317201e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 303: 2 CH3 => C2H4 + H2 +#define R303 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.610302507e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 304: 2 CH2 => C2H2 + 2 H +#define R304 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 305: CH + CH2 <=> C2H2 + H +#define R305 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 306: C + CH2 <=> C2H + H +#define R306 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1.0 }, \ + { /* ind = */ iCH2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 307: C2H2 + C3H6 <=> C2H3 + C3H5-A +#define R307 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.355067417e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 308: C2H6 <=> C2H4 + H2 +#define R308 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+13, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.950273338e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 309: CH3CO + H <=> CH3CHO +#define R309 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.300000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 310: CH3CHO + O2 <=> CH2CHO + HO2 +#define R310 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.465775714e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 311: CH3CHO + H <=> CH3CO + H2 +#define R311 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.811590321e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 312: CH3OH + H => CH3 + H2O +#define R312 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.500000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.667063528e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 313: CH2O + O => CO2 + 2 H +#define R313 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.516097667e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 314: CH3CHO + O => CH3 + CO2 + H +#define R314 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.509658600e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 315: CH2O + OH => CO2 + H + H2 +#define R315 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 316: CH3CHO + OH => CH3 + CO2 + H2 +#define R316 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 317: C2H2 + HO2 => CH2O + HCO +#define R317 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.548293002e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 318: CH2O + HCO <=> CH3 + CO2 +#define R318 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.025756268e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 319: CH3CHO + HCO => C2H5 + CO2 +#define R319 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.025756268e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 320: C2H3 + CH2O => C2H2 + 0.5 CH2OH + 0.5 CH3O +#define R320 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.019317201e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 0.5 }, \ + { /* ind = */ iCH3O, /* nu = */ 0.5 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 321: CH3O + CO <=> CH3 + CO2 +#define R321 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.270926968e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 322: C2H2 + O2 => CH2O + CO +#define R322 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.308370787e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 323: C2H4 + O2 => 2 CH2O +#define R323 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.415453761e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 324: C2H2 + O2 => 2 HCO +#define R324 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.358692740e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 325: C2H4 + O2 => CH3O + HCO +#define R325 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.163843994e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 326: CH2CHO + O2 => CH2O + CO + OH +#define R326 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 327: CH3 + O + M => CH3O + M +#define R327 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + +// R 328: C2H3 + O => CH2CHO +#define R328 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 329: C3H5-A + O => C2H3 + CH2O +#define R329 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.250000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 330: CH2CHO + O => CH2O + HCO +#define R330 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 331: C2H + OH => 0.7 C2H2 + 0.3 CH2CO + 0.7 O +#define R331 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.541853935e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 0.7 }, \ + { /* ind = */ iCH2CO, /* nu = */ 0.3 }, \ + { /* ind = */ iO , /* nu = */ 0.7 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 332: C2H3 + OH => CH3CHO +#define R332 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 333: C2H3 + HO2 => CH2CHO + OH +#define R333 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 334: HCO + HO2 <=> CO + H2O2 +#define R334 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 335: CH3O + OH => CH2O + H2O +#define R335 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 336: CH3O + HCO <=> 2 CH2O +#define R336 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 337: CH3O + HCO => CH3OH + CO +#define R337 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 338: CH2OH + CH3 => CH2O + CH4 +#define R338 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.500000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 339: CH2CHO + H => CH3CHO +#define R339 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 340: CH2CHO + OH => CH2OH + HCO +#define R340 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 341: CH2CHO <=> CH3CO +#define R341 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+11, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.610302507e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 342: C2H2 + OH => CH2CHO +#define R342 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 343: C3H5-A + H (+M) <=> C3H6 (+M) +#define R343 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.330000000e+48, \ + /* n = */ -1.200000000e+01, \ + /* EovR = */ 3.003113532e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 5, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Troe3, \ + /* FOData = */ { .Troe3 = { \ + /* alpha = */ 0.02, \ + /* T1 = */ 10970.0, \ + /* T2 = */ 6860.0, \ + /* T3 = */ 1097.0 \ + }}, \ +} + +// R 344: H2 + HCCO => CH2CO + H +#define R344 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.992000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.877749339e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 345: CH3CO + CH4 => CH3 + CH3CHO +#define R345 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.450000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.091836428e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 346: CH2CHO + CH4 => CH3 + CH3CHO +#define R346 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.610000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.477017734e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 347: CH4 + HCCO => CH2CO + CH3 +#define R347 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.996000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.170575675e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 348: C2H2 + CH3 => C2H + CH4 +#define R348 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.634312603e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 349: C2H2 + C2H3 => C2H + C2H4 +#define R349 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.356000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.947785290e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 350: C2H2 + C2H5 => C2H + C2H6 +#define R350 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.675398335e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 351: C2H2 + C3H5-A => C2H + C3H6 +#define R351 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.078000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.028223441e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 352: C2H2 + O => C2H + OH +#define R352 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.700000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.054706488e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 353: C2H2 + O2 => C2H + HO2 +#define R353 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.400000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.759364558e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 354: C2H2 + HO2 => C2H + H2O2 +#define R354 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.212269443e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 355: C2H2 + CH3O => C2H + CH3OH +#define R355 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.560000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.399383818e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 356: C2H2 + CH2OH => C2H + CH3OH +#define R356 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.660000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 8.764187136e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 357: C2H2 + HCO => C2H + CH2O +#define R357 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.520000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.992078023e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 358: C2H2 + CH3CO => C2H + CH3CHO +#define R358 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.700000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.097558034e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 359: C2H2 + CH2CHO => C2H + CH3CHO +#define R359 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.600000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.526152089e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 360: C2H2 + HCCO => C2H + CH2CO +#define R360 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.560000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.757948611e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 361: C2H3 + C2H6 => C2H4 + C2H5 +#define R361 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.102000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.870796988e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 362: C2H6 + CH2OH => C2H5 + CH3OH +#define R362 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.547000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.458822712e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 363: C2H6 + HCO => C2H5 + CH2O +#define R363 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.134000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.753586443e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 364: C2H6 + CH3CO => C2H5 + CH3CHO +#define R364 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.215000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 8.659547666e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 365: C2H6 + CH2CHO => C2H5 + CH3CHO +#define R365 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.070000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.326025967e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 366: C2H6 + HCCO => C2H5 + CH2CO +#define R366 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.852000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.586495937e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 367: C2H4 + C2H5 => C2H3 + C2H6 +#define R367 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.443655676e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 368: C2H4 + C3H5-A => C2H3 + C3H6 +#define R368 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.312000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.028223441e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 369: C2H4 + O => C2H3 + OH +#define R369 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.880000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.054706488e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 370: C2H4 + HO2 => C2H3 + H2O2 +#define R370 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.400000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.252410762e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 371: C2H4 + CH2OH => C2H3 + CH3OH +#define R371 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.264000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 8.532449509e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 372: C2H4 + CH3CO => C2H3 + CH3CHO +#define R372 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.111628053e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 373: C2H4 + CH2CHO => C2H3 + CH3CHO +#define R373 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.840000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.666852271e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 374: C2H4 + HCCO => C2H3 + CH2CO +#define R374 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.424000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.170319033e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 375: C2H3 + C3H6 => C2H4 + C3H5-A +#define R375 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.034000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.230721870e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 376: C3H6 + CH2OH => C3H5-A + CH3OH +#define R376 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.490000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.238595859e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 377: C3H6 + HCO => C3H5-A + CH2O +#define R377 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.780000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.125394482e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 378: C3H6 + CH3CO => C3H5-A + CH3CHO +#define R378 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.050000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.980867689e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 379: C3H6 + CH2CHO => C3H5-A + CH3CHO +#define R379 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.900000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.722818855e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 380: C3H6 + HCCO => C3H5-A + CH2CO +#define R380 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.284000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.884907264e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 381: H2O + HCCO => CH2CO + OH +#define R381 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.280000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.520643232e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 382: C2H3 + H2O2 => C2H4 + HO2 +#define R382 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.424000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.216778403e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 383: CH2CHO + H2O2 => CH3CHO + HO2 +#define R383 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.840000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.113514865e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 384: H2O2 + HCCO => CH2CO + HO2 +#define R384 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.424000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.693115298e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 385: C2H5 + CH2O => C2H6 + HCO +#define R385 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.671069155e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 386: C3H5-A + CH2O => C3H6 + HCO +#define R386 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.312000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.521531042e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 387: CH2O + CH3CO => CH3CHO + HCO +#define R387 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.048985628e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 388: CH2CHO + CH2O => CH3CHO + HCO +#define R388 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.840000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.836759965e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 389: CH2O + HCCO => CH2CO + HCO +#define R389 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.424000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.094238668e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 390: CH3CO + CH3OH => CH3CHO + CH3O +#define R390 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.350000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 8.817402602e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 391: CH2CHO + CH3OH => CH3CHO + CH3O +#define R391 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.300000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.483880902e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 392: CH3OH + HCCO => CH2CO + CH3O +#define R392 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.280000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.927222994e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 393: C2H3 + CH3OH => C2H4 + CH2OH +#define R393 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.034000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.198322453e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 394: C2H5 + CH3OH => C2H6 + CH2OH +#define R394 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.697554345e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 395: C3H5-A + CH3OH => C3H6 + CH2OH +#define R395 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.617000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.955981340e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 396: CH3CO + CH3OH => CH2OH + CH3CHO +#define R396 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.050000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 8.581125934e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 397: CH2CHO + CH3OH => CH2OH + CH3CHO +#define R397 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.900000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.247604235e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 398: CH3OH + HCCO => CH2CO + CH2OH +#define R398 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.284000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.914016371e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 399: CH3 + CH3CHO => CH3CO + CH4 +#define R399 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.800000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.112022446e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 400: C2H3 + CH3CHO => C2H4 + CH3CO +#define R400 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.068000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.605431342e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 401: C2H5 + CH3CHO => C2H6 + CH3CO +#define R401 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.721557171e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 402: C3H5-A + CH3CHO => C3H6 + CH3CO +#define R402 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.234000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.521531042e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 403: CH3CHO + CH3O => CH3CO + CH3OH +#define R403 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.568000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.626705321e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 404: CH2OH + CH3CHO => CH3CO + CH3OH +#define R404 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.698000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.404403806e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 405: CH3CHO + HCO => CH2O + CH3CO +#define R405 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.560000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.193512421e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 406: CH2CHO + CH3CHO => CH3CHO + CH3CO +#define R406 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.380000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.806108863e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 407: CH3CHO + HCCO => CH2CO + CH3CO +#define R407 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.568000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.222272814e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 408: CH3 + CH3CHO => CH2CHO + CH4 +#define R408 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.000000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.905059063e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 409: C2H3 + CH3CHO => C2H4 + CH2CHO +#define R409 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.034000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.306096981e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 410: C2H5 + CH3CHO => C2H6 + CH2CHO +#define R410 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.740056267e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 411: C3H5-A + CH3CHO => C3H6 + CH2CHO +#define R411 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.617000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.955981340e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 412: CH3CHO + O => CH2CHO + OH +#define R412 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.050000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.360955085e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 413: CH3CHO + HO2 => CH2CHO + H2O2 +#define R413 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.543472905e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 414: CH3CHO + CH3O => CH2CHO + CH3OH +#define R414 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.284000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.863321289e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 415: CH2OH + CH3CHO => CH2CHO + CH3OH +#define R415 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.490000000e-02, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.630491024e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 416: CH3CHO + HCO => CH2CHO + CH2O +#define R416 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.780000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 7.649359614e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 417: CH3CHO + CH3CO => CH2CHO + CH3CHO +#define R417 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.050000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 8.555320836e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 418: CH3CHO + HCCO => CH2CHO + CH2CO +#define R418 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.284000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.021795930e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 419: CH2CO + H => H2 + HCCO +#define R419 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.758383522e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 420: CH2CO + CH3 => CH4 + HCCO +#define R420 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.220897628e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 421: C2H3 + CH2CO => C2H4 + HCCO +#define R421 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.424000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.516133639e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 422: C2H5 + CH2CO => C2H6 + HCCO +#define R422 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 6.505164199e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 423: C3H5-A + CH2CO => C3H6 + HCCO +#define R423 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.312000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.028223441e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC3H5MA, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC3H6, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 424: CH2CO + O => HCCO + OH +#define R424 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.880000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.054706488e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 425: CH2CO + O2 => HCCO + HO2 +#define R425 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.360000000e+01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 2.759364558e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 426: CH2CO + OH => H2O + HCCO +#define R426 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+04, \ + /* n = */ 1.000000000e+00, \ + /* EovR = */ 1.161355200e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 427: CH2CO + HO2 => H2O2 + HCCO +#define R427 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.400000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.241755592e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 428: CH2CO + CH3O => CH3OH + HCCO +#define R428 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.424000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.229154714e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 429: CH2CO + CH2OH => CH3OH + HCCO +#define R429 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.264000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 8.593958032e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 430: CH2CO + HCO => CH2O + HCCO +#define R430 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.008000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.009542925e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 431: CH2CO + CH3CO => CH3CHO + HCCO +#define R431 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.107893660e+04, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 432: CH2CHO + CH2CO => CH3CHO + HCCO +#define R432 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.840000000e-01, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 9.629503317e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1.0 }, \ + { /* ind = */ iHCCO, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 433: CH + O <=> CHO+ + E +#define R433 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.510000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 8.563387445e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 434: CHO+ + E <=> CO + H +#define R434 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.400000000e+12, \ + /* n = */ -6.800000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 435: CHO+ + H2O <=> CO + H3O+ +#define R435 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.510000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 436: E + H3O+ <=> H + H2O +#define R436 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.290000000e+12, \ + /* n = */ -5.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 437: E + H3O+ <=> 2 H + OH +#define R437 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.950000000e+15, \ + /* n = */ -1.370000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 438: E + H3O+ <=> H2 + OH +#define R438 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.250000000e+13, \ + /* n = */ -5.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 439: E + H3O+ <=> H + H2 + O +#define R439 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+11, \ + /* n = */ -3.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 440: C + H3O+ <=> CHO+ + H2 +#define R440 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.020000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 441: CH2CO + CHO+ <=> C2H3O+ + CO +#define R441 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.260000000e+09, \ + /* n = */ -5.000000000e-02, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3OP, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 442: CH3 + CHO+ <=> C2H3O+ + H +#define R442 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.760000000e+08, \ + /* n = */ -1.000000000e-02, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3OP, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 443: C2H3O+ + E <=> CH2CO + H +#define R443 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.290000000e+12, \ + /* n = */ -5.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3OP, /* nu = */ 1.0 }, \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 444: CH2CO + H3O+ <=> C2H3O+ + H2O +#define R444 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3OP, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 445: C2H3O+ + E <=> CH3 + CO +#define R445 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+11, \ + /* n = */ -5.000000000e-02, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3OP, /* nu = */ 1.0 }, \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 446: C2H3O+ + O <=> CH2O + CHO+ +#define R446 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3OP, /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 447: CH3OH + CHO+ <=> CH5O+ + CO +#define R447 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.710000000e+08, \ + /* n = */ -6.000000000e-02, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iCHOP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH5OP, /* nu = */ 1.0 }, \ + { /* ind = */ iCO , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 448: CH3OH + H3O+ <=> CH5O+ + H2O +#define R448 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.510000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH3OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH5OP, /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 449: CH5O+ + E <=> CH3OH + H +#define R449 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+11, \ + /* n = */ -5.000000000e-02, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH5OP, /* nu = */ 1.0 }, \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 450: CH2CO + CH5O+ <=> C2H3O+ + CH3OH +#define R450 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.490000000e+09, \ + /* n = */ -8.000000000e-02, \ + /* EovR = */ -4.209431398e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1.0 }, \ + { /* ind = */ iCH5OP, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3OP, /* nu = */ 1.0 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 451: H2 + O2- <=> E + H2O2 +#define R451 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.020000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 452: H + O2- <=> E + HO2 +#define R452 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.230000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 453: O2- + OH <=> O2 + OH- +#define R453 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.020000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ iOHM, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 454: H + O2- <=> O + OH- +#define R454 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ iOHM, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 455: O + OH- <=> E + HO2 +#define R455 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ iOHM, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iHO2, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 456: H + OH- <=> E + H2O +#define R456 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1.0 }, \ + { /* ind = */ iOHM, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 457: CH + OH- <=> CH2O + E +#define R457 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1.0 }, \ + { /* ind = */ iOHM, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 458: CH3 + OH- <=> CH3OH + E +#define R458 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.020000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1.0 }, \ + { /* ind = */ iOHM, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1.0 }, \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 459: E + O + O2 <=> O + O2- +#define R459 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.630000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 3, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1.0 }, \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 460: E + 2 O2 <=> O2 + O2- +#define R460 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.520000000e+09, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 6.001597444e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 2.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 461: E + H2O + O2 <=> H2O + O2- +#define R461 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.080000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 3, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1.0 }, \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 462: E + N2 + O2 <=> N2 + O2- +#define R462 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.590000000e+09, \ + /* n = */ -2.000000000e+00, \ + /* EovR = */ 6.975629173e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 3, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iN2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO2 , /* nu = */ 1.0 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iN2 , /* nu = */ 1.0 }, \ + { /* ind = */ iO2M, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ +} + +// R 463: E + OH + M <=> OH- + M +#define R463 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.090000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 0, \ + /* educts = */ { \ + { /* ind = */ iE , /* nu = */ 1.0 }, \ + { /* ind = */ iOH , /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOHM, /* nu = */ 1.0 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ +} + + +//--------------------------------- +// Initialization function +//--------------------------------- + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : +species({N2, H2, H, O2, O, H2O, OH, H2O2, + HO2, CO, CO2, CH4, CH3, CH2, CH2_S, C, + CH, CH3O2, CH3OH, CH3O, CH2OH, CH2O, HCO, C2H6, + C2H5, C2H4, C2H3, C2H2, C2H, CH3CHO, CH3CO, CH2CHO, + CH2CO, HCCO, C3H6, C3H5MA, CHOP, C2H3OP, CH5OP, H3OP, + OHM, O2M, E }), +ions{iCHOP, iC2H3OP, iCH5OP, iH3OP, iOHM, iO2M, iE }, +reactions({R1, R2, R4, R6, R9, R10, R11, R12, + R13, R14, R15, R16, R17, R18, R19, R20, + R23, R24, R25, R26, R28, R29, R30, R31, + R32, R33, R34, R35, R36, R37, R38, R39, + R40, R41, R42, R43, R44, R45, R47, R48, + R49, R50, R51, R52, R53, R54, R55, R56, + R57, R58, R59, R61, R62, R63, R64, R65, + R66, R67, R68, R69, R70, R71, R72, R73, + R74, R75, R79, R80, R81, R82, R83, R84, + R85, R86, R87, R88, R89, R90, R91, R92, + R93, R94, R95, R96, R97, R98, R99, R100, + R101, R102, R103, R104, R105, R106, R107, R110, + R111, R112, R113, R114, R115, R116, R118, R119, + R120, R121, R122, R123, R124, R125, R126, R131, + R132, R133, R134, R135, R136, R137, R138, R139, + R141, R142, R143, R144, R145, R146, R147, R150, + R151, R152, R153, R154, R155, R156, R157, R158, + R159, R160, R161, R163, R164, R165, R166, R167, + R168, R169, R170, R171, R172, R173, R174, R175, + R176, R177, R178, R179, R180, R182, R183, R184, + R185, R186, R187, R188, R189, R190, R191, R192, + R195, R196, R197, R198, R199, R200, R201, R202, + R204, R205, R206, R210, R211, R212, R213, R214, + R215, R216, R217, R218, R219, R221, R222, R223, + R224, R226, R227, R228, R229, R230, R231, R232, + R233, R234, R235, R236, R237, R238, R239, R240, + R241, R242, R243, R244, R245, R246, R247, R248, + R249, R250, R251, R252, R253, R254, R255, R256, + R257, R258, R259, R260, R261, R262, R263, R264, + R265, R266, R267, R268, R269, R270, R271, R272, + R273, R274, R275, R276, R277, R279, R280, R281, + R282, R283, R284, R285, R286, R287, R288, R289, + R290, R291, R292, R293, R294, R295, R296, R297, + R298, R299, R300, R301, R302, R303, R304, R305, + R306, R307, R308, R309, R310, R311, R312, R313, + R314, R315, R316, R317, R318, R319, R320, R321, + R322, R323, R324, R325, R326, R328, R329, R330, + R331, R332, R333, R334, R335, R336, R337, R338, + R339, R340, R341, R342, R344, R345, R346, R347, + R348, R349, R350, R351, R352, R353, R354, R355, + R356, R357, R358, R359, R360, R361, R362, R363, + R364, R365, R366, R367, R368, R369, R370, R371, + R372, R373, R374, R375, R376, R377, R378, R379, + R380, R381, R382, R383, R384, R385, R386, R387, + R388, R389, R390, R391, R392, R393, R394, R395, + R396, R397, R398, R399, R400, R401, R402, R403, + R404, R405, R406, R407, R408, R409, R410, R411, + R412, R413, R414, R415, R416, R417, R418, R419, + R420, R421, R422, R423, R424, R425, R426, R427, + R428, R429, R430, R431, R432, R433, R434, R435, + R436, R437, R438, R439, R440, R441, R442, R443, + R444, R445, R446, R447, R448, R449, R450, R451, + R452, R453, R454, R455, R456, R457, R458, R459, + R460, R461, R462 }), +ThirdbodyReactions({R0, R3, R5, R7, R117, R149, R220, R278, + R327, R463 }), +FalloffReactions({R8, R21, R22, R27, R46, R60, R76, R77, + R78, R108, R109, R127, R128, R129, R130, R140, + R148, R162, R181, R193, R194, R203, R207, R208, + R209, R225, R343 }) +{ +// This executable is expecting CH4_43SpIonsMix in the input file +assert(config.Flow.mixture.type == MixtureModel_CH4_43SpIonsMix); + +// Store reference quantities +StoreReferenceQuantities(config.Flow.mixture.u.CH4_43SpIonsMix.PRef, + config.Flow.mixture.u.CH4_43SpIonsMix.TRef, + config.Flow.mixture.u.CH4_43SpIonsMix.LRef, + config.Flow.mixture.u.CH4_43SpIonsMix.XiRef); +}; +#endif + +//--------------------------------- +// Cleanup +//--------------------------------- + +#undef iN2 +#undef N2 +#undef iH2 +#undef H2 +#undef iH +#undef H +#undef iO2 +#undef O2 +#undef iO +#undef O +#undef iH2O +#undef H2O +#undef iOH +#undef OH +#undef iH2O2 +#undef H2O2 +#undef iHO2 +#undef HO2 +#undef iCO +#undef CO +#undef iCO2 +#undef CO2 +#undef iCH4 +#undef CH4 +#undef iCH3 +#undef CH3 +#undef iCH2 +#undef CH2 +#undef iCH2_S +#undef CH2_S +#undef iC +#undef C +#undef iCH +#undef CH +#undef iCH3O2 +#undef CH3O2 +#undef iCH3OH +#undef CH3OH +#undef iCH3O +#undef CH3O +#undef iCH2OH +#undef CH2OH +#undef iCH2O +#undef CH2O +#undef iHCO +#undef HCO +#undef iC2H6 +#undef C2H6 +#undef iC2H5 +#undef C2H5 +#undef iC2H4 +#undef C2H4 +#undef iC2H3 +#undef C2H3 +#undef iC2H2 +#undef C2H2 +#undef iC2H +#undef C2H +#undef iCH3CHO +#undef CH3CHO +#undef iCH3CO +#undef CH3CO +#undef iCH2CHO +#undef CH2CHO +#undef iCH2CO +#undef CH2CO +#undef iHCCO +#undef HCCO +#undef iC3H6 +#undef C3H6 +#undef iC3H5MA +#undef C3H5MA +#undef iCHOP +#undef CHOP +#undef iC2H3OP +#undef C2H3OP +#undef iCH5OP +#undef CH5OP +#undef iH3OP +#undef H3OP +#undef iOHM +#undef OHM +#undef iO2M +#undef O2M +#undef iE +#undef E + +#undef R0 +#undef R1 +#undef R2 +#undef R3 +#undef R4 +#undef R5 +#undef R6 +#undef R7 +#undef R8 +#undef R9 +#undef R10 +#undef R11 +#undef R12 +#undef R13 +#undef R14 +#undef R15 +#undef R16 +#undef R17 +#undef R18 +#undef R19 +#undef R20 +#undef R21 +#undef R22 +#undef R23 +#undef R24 +#undef R25 +#undef R26 +#undef R27 +#undef R28 +#undef R29 +#undef R30 +#undef R31 +#undef R32 +#undef R33 +#undef R34 +#undef R35 +#undef R36 +#undef R37 +#undef R38 +#undef R39 +#undef R40 +#undef R41 +#undef R42 +#undef R43 +#undef R44 +#undef R45 +#undef R46 +#undef R47 +#undef R48 +#undef R49 +#undef R50 +#undef R51 +#undef R52 +#undef R53 +#undef R54 +#undef R55 +#undef R56 +#undef R57 +#undef R58 +#undef R59 +#undef R60 +#undef R61 +#undef R62 +#undef R63 +#undef R64 +#undef R65 +#undef R66 +#undef R67 +#undef R68 +#undef R69 +#undef R70 +#undef R71 +#undef R72 +#undef R73 +#undef R74 +#undef R75 +#undef R76 +#undef R77 +#undef R78 +#undef R79 +#undef R80 +#undef R81 +#undef R82 +#undef R83 +#undef R84 +#undef R85 +#undef R86 +#undef R87 +#undef R88 +#undef R89 +#undef R90 +#undef R91 +#undef R92 +#undef R93 +#undef R94 +#undef R95 +#undef R96 +#undef R97 +#undef R98 +#undef R99 +#undef R100 +#undef R101 +#undef R102 +#undef R103 +#undef R104 +#undef R105 +#undef R106 +#undef R107 +#undef R108 +#undef R109 +#undef R110 +#undef R111 +#undef R112 +#undef R113 +#undef R114 +#undef R115 +#undef R116 +#undef R117 +#undef R118 +#undef R119 +#undef R120 +#undef R121 +#undef R122 +#undef R123 +#undef R124 +#undef R125 +#undef R126 +#undef R127 +#undef R128 +#undef R129 +#undef R130 +#undef R131 +#undef R132 +#undef R133 +#undef R134 +#undef R135 +#undef R136 +#undef R137 +#undef R138 +#undef R139 +#undef R140 +#undef R141 +#undef R142 +#undef R143 +#undef R144 +#undef R145 +#undef R146 +#undef R147 +#undef R148 +#undef R149 +#undef R150 +#undef R151 +#undef R152 +#undef R153 +#undef R154 +#undef R155 +#undef R156 +#undef R157 +#undef R158 +#undef R159 +#undef R160 +#undef R161 +#undef R162 +#undef R163 +#undef R164 +#undef R165 +#undef R166 +#undef R167 +#undef R168 +#undef R169 +#undef R170 +#undef R171 +#undef R172 +#undef R173 +#undef R174 +#undef R175 +#undef R176 +#undef R177 +#undef R178 +#undef R179 +#undef R180 +#undef R181 +#undef R182 +#undef R183 +#undef R184 +#undef R185 +#undef R186 +#undef R187 +#undef R188 +#undef R189 +#undef R190 +#undef R191 +#undef R192 +#undef R193 +#undef R194 +#undef R195 +#undef R196 +#undef R197 +#undef R198 +#undef R199 +#undef R200 +#undef R201 +#undef R202 +#undef R203 +#undef R204 +#undef R205 +#undef R206 +#undef R207 +#undef R208 +#undef R209 +#undef R210 +#undef R211 +#undef R212 +#undef R213 +#undef R214 +#undef R215 +#undef R216 +#undef R217 +#undef R218 +#undef R219 +#undef R220 +#undef R221 +#undef R222 +#undef R223 +#undef R224 +#undef R225 +#undef R226 +#undef R227 +#undef R228 +#undef R229 +#undef R230 +#undef R231 +#undef R232 +#undef R233 +#undef R234 +#undef R235 +#undef R236 +#undef R237 +#undef R238 +#undef R239 +#undef R240 +#undef R241 +#undef R242 +#undef R243 +#undef R244 +#undef R245 +#undef R246 +#undef R247 +#undef R248 +#undef R249 +#undef R250 +#undef R251 +#undef R252 +#undef R253 +#undef R254 +#undef R255 +#undef R256 +#undef R257 +#undef R258 +#undef R259 +#undef R260 +#undef R261 +#undef R262 +#undef R263 +#undef R264 +#undef R265 +#undef R266 +#undef R267 +#undef R268 +#undef R269 +#undef R270 +#undef R271 +#undef R272 +#undef R273 +#undef R274 +#undef R275 +#undef R276 +#undef R277 +#undef R278 +#undef R279 +#undef R280 +#undef R281 +#undef R282 +#undef R283 +#undef R284 +#undef R285 +#undef R286 +#undef R287 +#undef R288 +#undef R289 +#undef R290 +#undef R291 +#undef R292 +#undef R293 +#undef R294 +#undef R295 +#undef R296 +#undef R297 +#undef R298 +#undef R299 +#undef R300 +#undef R301 +#undef R302 +#undef R303 +#undef R304 +#undef R305 +#undef R306 +#undef R307 +#undef R308 +#undef R309 +#undef R310 +#undef R311 +#undef R312 +#undef R313 +#undef R314 +#undef R315 +#undef R316 +#undef R317 +#undef R318 +#undef R319 +#undef R320 +#undef R321 +#undef R322 +#undef R323 +#undef R324 +#undef R325 +#undef R326 +#undef R327 +#undef R328 +#undef R329 +#undef R330 +#undef R331 +#undef R332 +#undef R333 +#undef R334 +#undef R335 +#undef R336 +#undef R337 +#undef R338 +#undef R339 +#undef R340 +#undef R341 +#undef R342 +#undef R343 +#undef R344 +#undef R345 +#undef R346 +#undef R347 +#undef R348 +#undef R349 +#undef R350 +#undef R351 +#undef R352 +#undef R353 +#undef R354 +#undef R355 +#undef R356 +#undef R357 +#undef R358 +#undef R359 +#undef R360 +#undef R361 +#undef R362 +#undef R363 +#undef R364 +#undef R365 +#undef R366 +#undef R367 +#undef R368 +#undef R369 +#undef R370 +#undef R371 +#undef R372 +#undef R373 +#undef R374 +#undef R375 +#undef R376 +#undef R377 +#undef R378 +#undef R379 +#undef R380 +#undef R381 +#undef R382 +#undef R383 +#undef R384 +#undef R385 +#undef R386 +#undef R387 +#undef R388 +#undef R389 +#undef R390 +#undef R391 +#undef R392 +#undef R393 +#undef R394 +#undef R395 +#undef R396 +#undef R397 +#undef R398 +#undef R399 +#undef R400 +#undef R401 +#undef R402 +#undef R403 +#undef R404 +#undef R405 +#undef R406 +#undef R407 +#undef R408 +#undef R409 +#undef R410 +#undef R411 +#undef R412 +#undef R413 +#undef R414 +#undef R415 +#undef R416 +#undef R417 +#undef R418 +#undef R419 +#undef R420 +#undef R421 +#undef R422 +#undef R423 +#undef R424 +#undef R425 +#undef R426 +#undef R427 +#undef R428 +#undef R429 +#undef R430 +#undef R431 +#undef R432 +#undef R433 +#undef R434 +#undef R435 +#undef R436 +#undef R437 +#undef R438 +#undef R439 +#undef R440 +#undef R441 +#undef R442 +#undef R443 +#undef R444 +#undef R445 +#undef R446 +#undef R447 +#undef R448 +#undef R449 +#undef R450 +#undef R451 +#undef R452 +#undef R453 +#undef R454 +#undef R455 +#undef R456 +#undef R457 +#undef R458 +#undef R459 +#undef R460 +#undef R461 +#undef R462 +#undef R463 + +#endif + +#endif // __CH4_43SPIONSMIX_HPP__ diff --git a/src/Mixtures/ConstPropMix.hpp b/src/Mixtures/ConstPropMix.hpp new file mode 100644 index 0000000..c23e6b7 --- /dev/null +++ b/src/Mixtures/ConstPropMix.hpp @@ -0,0 +1,217 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef ConstPropMix_HPP +#define ConstPropMix_HPP + +#include "config_schema.h" +#include "constants.h" + +// Number of species +#define nSpec 1 +// Number of charged species +#define nIons 0 + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +#ifndef __CONST__ +#ifdef __CUDACC__ +#define __CONST__ +#else +#define __CONST__ const +#endif +#endif + +#ifdef __cplusplus + // We cannot expose these structs to Regent + #include "my_array.hpp" + + // Define type for the array that will contain the species + typedef MyArray VecNSp; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct Mix { + // Mixture properties + __CONST__ double R; + __CONST__ double gamma; + + // Viscosisity model + __CONST__ int viscosityModel; + // Viscosity parameters + // Constant model + double constantVisc; + // Power law model + double powerlawTempRef; + double powerlawViscRef; + // Sutherland model + double sutherlandSRef; + double sutherlandTempRef; + double sutherlandViscRef; + + // Prandtl number + __CONST__ double Prandtl; + +#ifdef __cplusplus + // We cannot expose these methods to Regent + +#ifndef __CUDACC__ + inline Mix(const Config &config); +#endif + + inline char* GetSpeciesName(const int i) const; + + inline int FindSpecies(const char *Name) const; + + __CUDA_HD__ + inline bool CheckMixture(const VecNSp &Yi) const; + + __CUDA_HD__ + inline void ClipYi(VecNSp &Yi) const {}; + + __CUDA_HD__ + inline double GetMolarWeightFromYi(const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetMolarWeightFromXi(const VecNSp &Xi) const; + + __CUDA_HD__ + inline void GetMolarFractions(VecNSp &Xi, const double MixW, const VecNSp &Yi) const; + + __CUDA_HD__ + inline void GetMassFractions(VecNSp &Yi, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetRhoFromRhoYi(const VecNSp &rhoYi) const; + + __CUDA_HD__ + inline void GetRhoYiFromYi(VecNSp &rhoYi, const double rho, const VecNSp &Yi) const; + + __CUDA_HD__ + inline void GetYi(VecNSp &Yi, const double rho, const VecNSp &rhoYi) const; + + __CUDA_HD__ + inline double GetRho(const double P, const double T, const double MixW) const; + + __CUDA_HD__ + inline double GetHeatCapacity(const double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetEnthalpy(const double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetSpeciesEnthalpy(const int i, const double T) const; + + __CUDA_HD__ + inline double GetSpeciesMolarWeight(const int i) const; + + __CUDA_HD__ + inline double GetInternalEnergy(const double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetSpecificInternalEnergy(const int i, const double T) const; + + __CUDA_HD__ + inline double GetTFromInternalEnergy(const double e0, double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double isValidInternalEnergy(const double e, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetTFromRhoAndP(const double rho, const double MixW, const double P) const; + + __CUDA_HD__ + inline double GetPFromRhoAndT(const double rho, const double MixW, const double T) const; + + __CUDA_HD__ + inline double GetViscosity(const double T, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetHeatConductivity(const double T, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetGamma(const double T, const double MixW, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetSpeedOfSound(const double T, const double gamma, const double MixW) const; + + __CUDA_HD__ + inline void GetDiffusivity(VecNSp &Di, const double P, const double T, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetPartialElectricChargeDensity(const uint8_t i, const double rhon, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetElectricChargeDensity(const double rhon, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline int8_t GetSpeciesChargeNumber(const int i) const; + + __CUDA_HD__ + inline double GetDielectricPermittivity() const; + + __CUDA_HD__ + inline void GetProductionRates(VecNSp &w, const double rhon, const double Pn, const double Tn, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double Getdpde(const double rho, const double gamma) const; + + __CUDA_HD__ + inline void Getdpdrhoi(VecNSp &dpdrhoi, const double gamma, const double T, const VecNSp &Yi) const; + +#endif // __cplusplus +}; + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +// We cannot expose these methods to Regent +#include "ConstPropMix.inl" +#endif + +#endif // ConstPropMix_HPP diff --git a/src/Mixtures/ConstPropMix.inl b/src/Mixtures/ConstPropMix.inl new file mode 100644 index 0000000..c166f45 --- /dev/null +++ b/src/Mixtures/ConstPropMix.inl @@ -0,0 +1,168 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : + R(config.Flow.mixture.u.ConstPropMix.gasConstant), + gamma(config.Flow.mixture.u.ConstPropMix.gamma), + viscosityModel(config.Flow.mixture.u.ConstPropMix.viscosityModel.type), + Prandtl(config.Flow.mixture.u.ConstPropMix.prandtl) +{ + // This executable is expecting ConstPropMix in the input file + assert(config.Flow.mixture.type == MixtureModel_ConstPropMix); + + // Init mixture model data + if (viscosityModel == ViscosityModel_Constant) + constantVisc = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Constant.Visc; + else if (viscosityModel == ViscosityModel_PowerLaw) { + powerlawTempRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.PowerLaw.TempRef; + powerlawViscRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.PowerLaw.ViscRef; + } else if (viscosityModel == ViscosityModel_Sutherland) { + sutherlandSRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Sutherland.SRef; + sutherlandTempRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Sutherland.TempRef; + sutherlandViscRef = config.Flow.mixture.u.ConstPropMix.viscosityModel.u.Sutherland.ViscRef; + } +}; +#endif + +inline char* Mix::GetSpeciesName(const int i) const { + return (char*)"MIX"; +}; + +inline int Mix::FindSpecies(const char *Name) const { + return 0; +}; + +__CUDA_HD__ +inline bool Mix::CheckMixture(const VecNSp &Yi) const { +#ifdef CHECK_MIX + return (fabs(Yi[0] - 1.0) < 1e-3); +#else + return true; +#endif +}; + +__CUDA_HD__ +inline double Mix::GetMolarWeightFromYi(const VecNSp &Yi) const { return RGAS/R; }; + +__CUDA_HD__ +inline double Mix::GetMolarWeightFromXi(const VecNSp &Xi) const { return RGAS/R; }; + +__CUDA_HD__ +inline void Mix::GetMolarFractions(VecNSp &Xi, const double MixW, const VecNSp &Yi) const { Xi[0] = Yi[0]; }; + +__CUDA_HD__ +inline void Mix::GetMassFractions(VecNSp &Yi, const double MixW, const VecNSp &Xi) const { Yi[0] = Xi[0]; }; + +__CUDA_HD__ +inline double Mix::GetRhoFromRhoYi(const VecNSp &rhoYi) const { return rhoYi[0]; }; + +__CUDA_HD__ +inline void Mix::GetRhoYiFromYi(VecNSp &rhoYi, const double rho, const VecNSp &Yi) const { rhoYi[0] = rho*Yi[0]; }; + +__CUDA_HD__ +inline void Mix::GetYi(VecNSp &Yi, const double rho, const VecNSp &rhoYi) const { Yi[0] = rhoYi[0]/rho; }; + +__CUDA_HD__ +inline double Mix::GetRho(const double P, const double T, const double MixW) const { return P/(R * T); }; + +__CUDA_HD__ +inline double Mix::GetHeatCapacity(const double T, const VecNSp &Yi) const { return gamma/(gamma-1)*R; }; + +__CUDA_HD__ +inline double Mix::GetEnthalpy(const double T, const VecNSp &Yi) const { return gamma/(gamma-1)*R*T; }; + +__CUDA_HD__ +inline double Mix::GetSpeciesEnthalpy(const int i, const double T) const { return gamma/(gamma-1)*R*T; }; + +__CUDA_HD__ +inline double Mix::GetSpeciesMolarWeight(const int i) const { return RGAS/R; }; + +__CUDA_HD__ +inline double Mix::GetInternalEnergy(const double T, const VecNSp &Yi) const { return T*R/(gamma-1.0); }; + +__CUDA_HD__ +inline double Mix::GetSpecificInternalEnergy(const int i, const double T) const { return T*R/(gamma-1.0); }; + +__CUDA_HD__ +inline double Mix::GetTFromInternalEnergy(const double e0, double T, const VecNSp &Yi) const { return e0*(gamma-1.0)/R; }; + +__CUDA_HD__ +inline double Mix::isValidInternalEnergy(const double e, const VecNSp &Yi) const { return (e > 0); }; + +__CUDA_HD__ +inline double Mix::GetTFromRhoAndP(const double rho, const double MixW, const double P) const { return P*MixW/(rho*RGAS); }; + +__CUDA_HD__ +inline double Mix::GetPFromRhoAndT(const double rho, const double MixW, const double T) const { return rho*RGAS*T/MixW; }; + +__CUDA_HD__ +inline double Mix::GetViscosity(const double T, const VecNSp &Xi) const { + return ((viscosityModel == ViscosityModel_Constant) ? constantVisc : + ((viscosityModel == ViscosityModel_PowerLaw) ? (powerlawViscRef*pow((T/powerlawTempRef), 0.7)) : + /*(viscosityModel == ViscosityModel_Sutherland) ? */ (sutherlandViscRef*pow((T/sutherlandTempRef), 1.5))* + ((sutherlandTempRef+sutherlandSRef)/(T+sutherlandSRef)))); +}; + +__CUDA_HD__ +inline double Mix::GetHeatConductivity(const double T, const VecNSp &Xi) const { + const double cp = gamma/(gamma-1)*R; + return cp/Prandtl*GetViscosity(T, Xi); +}; + +__CUDA_HD__ +inline double Mix::GetGamma(const double T, const double MixW, const VecNSp &Yi) const { return gamma; }; + +__CUDA_HD__ +inline double Mix::GetSpeedOfSound(const double T, const double gamma, const double MixW) const { return sqrt(gamma*R*T); }; + +__CUDA_HD__ +inline void Mix::GetDiffusivity(VecNSp &Di, const double P, const double T, const double MixW, const VecNSp &Xi) const { Di[0] = 0.0; }; + +__CUDA_HD__ +inline double Mix::GetPartialElectricChargeDensity(const uint8_t i, const double rhon, const double MixW, const VecNSp &Xi) const { return 0.0; }; + +__CUDA_HD__ +inline double Mix::GetElectricChargeDensity(const double rhon, const double MixW, const VecNSp &Xi) const { return 0.0; }; + +__CUDA_HD__ +inline int8_t Mix::GetSpeciesChargeNumber(const int i) const { return 0; }; + +__CUDA_HD__ +inline double Mix::GetDielectricPermittivity() const { return eps_0; }; + +__CUDA_HD__ +inline void Mix::GetProductionRates(VecNSp &w, const double rhon, const double Pn, const double Tn, const VecNSp &Yi) const { w[0] = 0.0; }; + +__CUDA_HD__ +inline double Mix::Getdpde(const double rho, const double gamma) const { return rho*(gamma - 1); }; + +__CUDA_HD__ +inline void Mix::Getdpdrhoi(VecNSp &dpdrhoi, const double gamma, const double T, const VecNSp &Yi) const { dpdrhoi[0] = R*T; }; + diff --git a/src/Mixtures/FFCM1Mix.hpp b/src/Mixtures/FFCM1Mix.hpp new file mode 100644 index 0000000..35715a5 --- /dev/null +++ b/src/Mixtures/FFCM1Mix.hpp @@ -0,0 +1,7248 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef __FFCM1MIX_HPP__ +#define __FFCM1MIX_HPP__ + +// Number of species +#define nSpec 33 +// Number of charged species +#define nIons 0 +// Number of standard reactions +#define nReac 224 +// Number of thirdbody reactions +#define nTBReac 5 +// Number of falloff reactions +#define nFOReac 30 +// Maximum number of reactants in a reaction +#define MAX_NUM_REACTANTS 2 +// Maximum number of products in a reaction +#define MAX_NUM_PRODUCTS 3 +// Maximum number of colliders in a reaction +#define MAX_NUM_TB 10 +// Number of Nasa polynomials +#define N_NASA_POLY 2 +// Switch to mass action kinetics +#undef FWD_ORDERS + +#include "MultiComponent.hpp" + +#ifdef __cplusplus +// We cannot expose these methods to Regent + +//--------------------------------- +// Define Species +//--------------------------------- + +// H2 +#define iH2 0 +#define H2 { \ + /* Name = */ (char*)("H2"), \ + /* W = */ 0.00100784*2, \ + /* inx = */ iH2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.932865750E+00, 8.266080260E-04, -1.464023640E-07, 1.541004140E-11, -6.888048000E-16, -8.130655810E+02, -1.024328650E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.344331120E+00, 7.980520750E-03, -1.947815100E-05, 2.015720940E-08, -7.376117610E-12, -9.179351730E+02, 6.830102380E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.92*ATom, \ + /* kbOveps = */ 1.0/38.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.79*ATom*ATom*ATom, \ + /* Z298 = */ 280.0 \ + } \ + } + +// H +#define iH 1 +#define H { \ + /* Name = */ (char*)("H"), \ + /* W = */ 0.00100784*1, \ + /* inx = */ iH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 2.547366000E+04, -4.466828500E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, 2.547366000E+04, -4.466828500E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.05*ATom, \ + /* kbOveps = */ 1.0/145.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// O +#define iO 2 +#define O { \ + /* Name = */ (char*)("O"), \ + /* W = */ 0.0159994*1, \ + /* inx = */ iO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.543636970E+00, -2.731624860E-05, -4.190295200E-09, 4.954818450E-12, -4.795536940E-16, 2.922601200E+04, 4.922294570E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.168267100E+00, -3.279318840E-03, 6.643063960E-06, -6.128066240E-09, 2.112659710E-12, 2.912225920E+04, 2.051933460E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 2.75*ATom, \ + /* kbOveps = */ 1.0/80.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// O2 +#define iO2 3 +#define O2 { \ + /* Name = */ (char*)("O2"), \ + /* W = */ 0.0159994*2, \ + /* inx = */ iO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.660960650E+00, 6.563658110E-04, -1.411496270E-07, 2.057979350E-11, -1.299134360E-15, -1.215977180E+03, 3.415362790E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.782456360E+00, -2.996734160E-03, 9.847302010E-06, -9.681295090E-09, 3.243728370E-12, -1.063943560E+03, 3.657675730E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 1.6*ATom*ATom*ATom, \ + /* Z298 = */ 3.8 \ + } \ + } + +// OH +#define iOH 4 +#define OH { \ + /* Name = */ (char*)("OH"), \ + /* W = */ 0.00100784*1+0.0159994*1, \ + /* inx = */ iOH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.838530330E+00, 1.107412890E-03, -2.940002090E-07, 4.206987290E-11, -2.422898900E-15, 3.697808080E+03, 5.844946520E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.991984240E+00, -2.401066550E-03, 4.616640330E-06, -3.879163060E-09, 1.363195020E-12, 3.368898360E+03, -1.039984770E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.75*ATom, \ + /* kbOveps = */ 1.0/80.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// H2O +#define iH2O 5 +#define H2O { \ + /* Name = */ (char*)("H2O"), \ + /* W = */ 0.00100784*2+0.0159994*1, \ + /* inx = */ iH2O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.677038900E+00, 2.973181600E-03, -7.737688900E-07, 9.443351400E-11, -4.268999100E-15, -2.988589400E+04, 6.882550000E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.198635200E+00, -2.036401700E-03, 6.520341600E-06, -5.487926900E-09, 1.771968000E-12, -3.029372600E+04, -8.490090100E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.605*ATom, \ + /* kbOveps = */ 1.0/572.4, \ + /* mu = */ 1.844*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 4.0 \ + } \ + } + +// HO2 +#define iHO2 6 +#define HO2 { \ + /* Name = */ (char*)("HO2"), \ + /* W = */ 0.00100784*1+0.0159994*2, \ + /* inx = */ iHO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 5000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 5000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.172287410E+00, 1.881176270E-03, -3.462772860E-07, 1.946575490E-11, 1.762569050E-16, 3.102068390E+01, 2.957676720E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.301798070E+00, -4.749120970E-03, 2.115829050E-05, -2.427639140E-08, 9.292252250E-12, 2.640184850E+02, 3.716662200E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// H2O2 +#define iH2O2 7 +#define H2O2 { \ + /* Name = */ (char*)("H2O2"), \ + /* W = */ 0.00100784*2+0.0159994*2, \ + /* inx = */ iH2O2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.579773050E+00, 4.053260030E-03, -1.298447300E-06, 1.982114000E-10, -1.139687920E-14, -1.800717750E+04, 6.649706940E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.315151490E+00, -8.473906220E-04, 1.764043230E-05, -2.267629440E-08, 9.089501580E-12, -1.770674370E+04, 3.273733190E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.458*ATom, \ + /* kbOveps = */ 1.0/107.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 3.8 \ + } \ + } + +// CO +#define iCO 8 +#define CO { \ + /* Name = */ (char*)("CO"), \ + /* W = */ 0.0120107*1+0.0159994*1, \ + /* inx = */ iCO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.048485900E+00, 1.351728100E-03, -4.857940500E-07, 7.885364400E-11, -4.698074600E-15, -1.426611700E+04, 6.017097700E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.579533500E+00, -6.103536900E-04, 1.016814300E-06, 9.070058600E-10, -9.044244900E-13, -1.434408600E+04, 3.508409300E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.65*ATom, \ + /* kbOveps = */ 1.0/98.1, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 1.95*ATom*ATom*ATom, \ + /* Z298 = */ 1.8 \ + } \ + } + +// CO2 +#define iCO2 9 +#define CO2 { \ + /* Name = */ (char*)("CO2"), \ + /* W = */ 0.0120107*1+0.0159994*2, \ + /* inx = */ iCO2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.636511100E+00, 2.741456900E-03, -9.958975900E-07, 1.603866600E-10, -9.161985700E-15, -4.902490400E+04, -1.934895500E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.356813000E+00, 8.984129900E-03, -7.122063200E-06, 2.457300800E-09, -1.428854800E-13, -4.837197100E+04, 9.900903500E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.763*ATom, \ + /* kbOveps = */ 1.0/244.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 2.65*ATom*ATom*ATom, \ + /* Z298 = */ 2.1 \ + } \ + } + +// C +#define iC 10 +#define C { \ + /* Name = */ (char*)("C"), \ + /* W = */ 0.0120107*1, \ + /* inx = */ iC, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.605583000E+00, -1.959343400E-04, 1.067372200E-07, -1.642394000E-11, 8.187058000E-16, 8.541174200E+04, 4.192386800E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.554239500E+00, -3.215377200E-04, 7.337922300E-07, -7.322348700E-10, 2.665214400E-13, 8.544268100E+04, 4.531308500E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Atom, \ + /* sigma = */ 3.298*ATom, \ + /* kbOveps = */ 1.0/71.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH +#define iCH 11 +#define CH { \ + /* Name = */ (char*)("CH"), \ + /* W = */ 0.0120107*1+0.00100784*1, \ + /* inx = */ iCH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.520936900E+00, 1.765363900E-03, -4.614766000E-07, 5.928967500E-11, -3.347450100E-15, 7.094676900E+04, 7.405182900E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.489758300E+00, 3.243216000E-04, -1.689975100E-06, 3.162842000E-09, -1.406180300E-12, 7.061264600E+04, 2.084284100E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 2.75*ATom, \ + /* kbOveps = */ 1.0/80.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH2 +#define iCH2 12 +#define CH2 { \ + /* Name = */ (char*)("CH2"), \ + /* W = */ 0.0120107*1+0.00100784*2, \ + /* inx = */ iCH2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.146318860E+00, 3.036712590E-03, -9.964744390E-07, 1.504835800E-10, -8.573355150E-15, 4.604126050E+04, 4.723417110E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.717578460E+00, 1.273912600E-03, 2.173472510E-06, -3.488585000E-09, 1.652088660E-12, 4.587238660E+04, 1.752979450E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8*ATom, \ + /* kbOveps = */ 1.0/144.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH2(S) +#define iCH2_S 13 +#define CH2_S { \ + /* Name = */ (char*)("CH2(S)"), \ + /* W = */ 0.0120107*1+0.00100784*2, \ + /* inx = */ iCH2_S, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.135016860E+00, 2.895939260E-03, -8.166680900E-07, 1.135726970E-10, -6.362628350E-15, 5.050405040E+04, 4.060306210E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.193313250E+00, -2.331051840E-03, 8.156764510E-06, -6.629859810E-09, 1.932331990E-12, 5.036622460E+04, -7.467343100E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8*ATom, \ + /* kbOveps = */ 1.0/144.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH3 +#define iCH3 14 +#define CH3 { \ + /* Name = */ (char*)("CH3"), \ + /* W = */ 0.0120107*1+0.00100784*3, \ + /* inx = */ iCH3, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 2.978120600E+00, 5.797852000E-03, -1.975580000E-06, 3.072979000E-10, -1.791741600E-14, 1.650951300E+04, 4.722479900E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.657179700E+00, 2.126597900E-03, 5.458388300E-06, -6.618100300E-09, 2.465707400E-12, 1.642271600E+04, 1.673535400E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 3.8*ATom, \ + /* kbOveps = */ 1.0/144.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH4 +#define iCH4 15 +#define CH4 { \ + /* Name = */ (char*)("CH4"), \ + /* W = */ 0.0120107*1+0.00100784*4, \ + /* inx = */ iCH4, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 1.653262260E+00, 1.002630990E-02, -3.316612380E-06, 5.364831380E-10, -3.146967580E-14, -1.000959360E+04, 9.905062830E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 5.149114680E+00, -1.366220090E-02, 4.914539210E-05, -4.842467670E-08, 1.666034410E-11, -1.024659830E+04, -4.638488420E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.746*ATom, \ + /* kbOveps = */ 1.0/141.4, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 2.6*ATom*ATom*ATom, \ + /* Z298 = */ 13.0 \ + } \ + } + +// HCO +#define iHCO 16 +#define HCO { \ + /* Name = */ (char*)("HCO"), \ + /* W = */ 0.0120107*1+0.00100784*1+0.0159994*1, \ + /* inx = */ iHCO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.920015420E+00, 2.522793240E-03, -6.710041640E-07, 1.056159480E-10, -7.437982610E-15, 3.653429280E+03, 3.580770560E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.237546100E+00, -3.320752570E-03, 1.400302640E-05, -1.342399950E-08, 4.374162080E-12, 3.872411850E+03, 3.308348690E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.59*ATom, \ + /* kbOveps = */ 1.0/498.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 0.0 \ + } \ + } + +// CH2O +#define iCH2O 17 +#define CH2O { \ + /* Name = */ (char*)("CH2O"), \ + /* W = */ 0.0120107*1+0.00100784*2+0.0159994*1, \ + /* inx = */ iCH2O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.169526650E+00, 6.193205600E-03, -2.250563660E-06, 3.659756600E-10, -2.201494580E-14, -1.454868310E+04, 6.042078980E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.793723120E+00, -9.908333220E-03, 3.732199900E-05, -3.792852370E-08, 1.317726410E-11, -1.437919530E+04, 6.027980580E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.59*ATom, \ + /* kbOveps = */ 1.0/498.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH2OH +#define iCH2OH 18 +#define CH2OH { \ + /* Name = */ (char*)("CH2OH"), \ + /* W = */ 0.0120107*1+0.00100784*3+0.0159994*1, \ + /* inx = */ iCH2OH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.093143700E+00, 5.947612600E-03, -2.064974600E-06, 3.230081730E-10, -1.881259020E-14, -4.034096400E+03, -1.846914930E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.478343670E+00, -1.350703100E-03, 2.784849800E-05, -3.648690600E-08, 1.479074500E-11, -3.500728900E+03, 3.309135000E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.69*ATom, \ + /* kbOveps = */ 1.0/417.0, \ + /* mu = */ 1.7*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH3O +#define iCH3O 19 +#define CH3O { \ + /* Name = */ (char*)("CH3O"), \ + /* W = */ 0.0120107*1+0.00100784*3+0.0159994*1, \ + /* inx = */ iCH3O, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.757792380E+00, 7.441424740E-03, -2.697051760E-06, 4.380905040E-10, -2.635370980E-14, 3.781119400E+02, -1.966800280E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.711805020E+00, -2.804633060E-03, 3.765509710E-05, -4.730720890E-08, 1.865884200E-11, 1.295697600E+03, 6.572408640E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.69*ATom, \ + /* kbOveps = */ 1.0/417.0, \ + /* mu = */ 1.7*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH3OH +#define iCH3OH 20 +#define CH3OH { \ + /* Name = */ (char*)("CH3OH"), \ + /* W = */ 0.0120107*1+0.00100784*4+0.0159994*1, \ + /* inx = */ iCH3OH, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.527267950E+00, 1.031787830E-02, -3.628929440E-06, 5.774480160E-10, -3.421826320E-14, -2.600288340E+04, 5.167586930E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 5.658510510E+00, -1.629834190E-02, 6.919381560E-05, -7.583729260E-08, 2.804275500E-11, -2.561197360E+04, -8.973305080E-01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.626*ATom, \ + /* kbOveps = */ 1.0/481.8, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// C2H +#define iC2H 21 +#define C2H { \ + /* Name = */ (char*)("C2H"), \ + /* W = */ 0.0120107*2+0.00100784*1, \ + /* inx = */ iC2H, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.662702480E+00, 3.824922520E-03, -1.366325000E-06, 2.134550400E-10, -1.232168480E-14, 6.716837900E+04, 3.922057920E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.898676760E+00, 1.329884890E-02, -2.807333270E-05, 2.894847550E-08, -1.075023510E-11, 6.706160500E+04, 6.185476320E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 4.1*ATom, \ + /* kbOveps = */ 1.0/209.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.5 \ + } \ + } + +// C2H2 +#define iC2H2 22 +#define C2H2 { \ + /* Name = */ (char*)("C2H2"), \ + /* W = */ 0.0120107*2+0.00100784*2, \ + /* inx = */ iC2H2, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.658784890E+00, 4.883966670E-03, -1.608288880E-06, 2.469745440E-10, -1.386059590E-14, 2.575940420E+04, -3.998381940E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 8.086796820E-01, 2.336157620E-02, -3.551722340E-05, 2.801529580E-08, -8.500751650E-12, 2.642898080E+04, 1.393967610E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_Linear, \ + /* sigma = */ 4.1*ATom, \ + /* kbOveps = */ 1.0/209.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.5 \ + } \ + } + +// C2H3 +#define iC2H3 23 +#define C2H3 { \ + /* Name = */ (char*)("C2H3"), \ + /* W = */ 0.0120107*2+0.00100784*3, \ + /* inx = */ iC2H3, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.150267630E+00, 7.540213410E-03, -2.629978470E-06, 4.159740480E-10, -2.454075090E-14, 3.385663800E+04, 1.728122350E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.363776420E+00, 2.657657220E-04, 2.796207040E-05, -3.729869420E-08, 1.515901760E-11, 3.447495890E+04, 7.915100920E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.1*ATom, \ + /* kbOveps = */ 1.0/209.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// C2H4 +#define iC2H4 24 +#define C2H4 { \ + /* Name = */ (char*)("C2H4"), \ + /* W = */ 0.0120107*2+0.00100784*4, \ + /* inx = */ iC2H4, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 3.991827240E+00, 1.048339080E-02, -3.717213420E-06, 5.946283660E-10, -3.536303860E-14, 4.268658510E+03, -2.690817620E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.959200630E+00, -7.570513730E-03, 5.709899930E-05, -6.915883520E-08, 2.698841900E-11, 5.089775980E+03, 4.097302130E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.971*ATom, \ + /* kbOveps = */ 1.0/280.8, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.5 \ + } \ + } + +// C2H5 +#define iC2H5 25 +#define C2H5 { \ + /* Name = */ (char*)("C2H5"), \ + /* W = */ 0.0120107*2+0.00100784*5, \ + /* inx = */ iC2H5, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.321956330E+00, 1.239305420E-02, -4.396809600E-06, 7.035199170E-10, -4.184352390E-14, 1.217594750E+04, 1.711038090E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.241859050E+00, -3.569052350E-03, 4.826672020E-05, -5.854010090E-08, 2.258045140E-11, 1.296903440E+04, 4.447037820E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.302*ATom, \ + /* kbOveps = */ 1.0/252.3, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.5 \ + } \ + } + +// C2H6 +#define iC2H6 26 +#define C2H6 { \ + /* Name = */ (char*)("C2H6"), \ + /* W = */ 0.0120107*2+0.00100784*6, \ + /* inx = */ iC2H6, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.046664110E+00, 1.535388020E-02, -5.470394850E-06, 8.778265440E-10, -5.231675310E-14, -1.244734990E+04, -9.686983130E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.291425720E+00, -5.501549010E-03, 5.994384580E-05, -7.084664690E-08, 2.686858360E-11, -1.152220560E+04, 2.666789940E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.302*ATom, \ + /* kbOveps = */ 1.0/252.3, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.5 \ + } \ + } + +// HCCO +#define iHCCO 27 +#define HCCO { \ + /* Name = */ (char*)("HCCO"), \ + /* W = */ 0.0120107*2+0.00100784*1+0.0159994*1, \ + /* inx = */ iHCCO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.914793330E+00, 3.714087300E-03, -1.301370100E-06, 2.064733450E-10, -1.214767590E-14, 1.935963010E+04, -5.505672690E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 1.876079690E+00, 2.212054180E-02, -3.588693250E-05, 3.054025410E-08, -1.012810690E-11, 2.016338400E+04, 1.369682900E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 2.5*ATom, \ + /* kbOveps = */ 1.0/150.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 1.0 \ + } \ + } + +// CH2CO +#define iCH2CO 28 +#define CH2CO { \ + /* Name = */ (char*)("CH2CO"), \ + /* W = */ 0.0120107*2+0.00100784*2+0.0159994*1, \ + /* inx = */ iCH2CO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.758714490E+00, 6.351240530E-03, -2.259553610E-06, 3.623215120E-10, -2.158555150E-14, -8.085334640E+03, -4.964904440E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.132411360E+00, 1.813194550E-02, -1.740933150E-05, 9.353360400E-09, -2.017248440E-12, -7.148085200E+03, 1.338079690E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97*ATom, \ + /* kbOveps = */ 1.0/436.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH2CHO +#define iCH2CHO 29 +#define CH2CHO { \ + /* Name = */ (char*)("CH2CHO"), \ + /* W = */ 0.0120107*2+0.00100784*3+0.0159994*1, \ + /* inx = */ iCH2CHO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.916365350E+00, 8.846504260E-03, -3.149548950E-06, 5.054131890E-10, -3.013046210E-14, -1.047798920E+03, -6.106499810E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 2.668739560E+00, 9.623295380E-03, 1.606174380E-05, -2.876818200E-08, 1.250300660E-11, 2.194384290E+02, 1.256944760E+01 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97*ATom, \ + /* kbOveps = */ 1.0/436.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH3CHO +#define iCH3CHO 30 +#define CH3CHO { \ + /* Name = */ (char*)("CH3CHO"), \ + /* W = */ 0.0120107*2+0.00100784*4+0.0159994*1, \ + /* inx = */ iCH3CHO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.404110800E+00, 1.172305900E-02, -4.226313700E-06, 6.837245100E-10, -4.098486300E-14, -2.259312200E+04, -3.480791700E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.729459500E+00, -3.193285800E-03, 4.753492100E-05, -5.745861100E-08, 2.193111200E-11, -2.157287800E+04, 4.103015900E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97*ATom, \ + /* kbOveps = */ 1.0/436.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// CH3CO +#define iCH3CO 31 +#define CH3CO { \ + /* Name = */ (char*)("CH3CO"), \ + /* W = */ 0.0120107*2+0.00100784*3+0.0159994*1, \ + /* inx = */ iCH3CO, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 5.313716500E+00, 9.173779300E-03, -3.322038600E-06, 5.394745600E-10, -3.245236800E-14, -3.645041400E+03, -1.675755800E+00 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 4.035870500E+00, 8.772948700E-04, 3.071001000E-05, -3.924756500E-08, 1.529686900E-11, -2.682073800E+03, 7.861768200E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 3.97*ATom, \ + /* kbOveps = */ 1.0/436.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.0 \ + } \ + } + +// H2CC +#define iH2CC 32 +#define H2CC { \ + /* Name = */ (char*)("H2CC"), \ + /* W = */ 0.0120107*2+0.00100784*2, \ + /* inx = */ iH2CC, \ + /* cpCoeff = */ { \ + /* TSwitch1 = */ 1000.0, \ + /* TSwitch2 = */ 6000.0, \ + /* TMin = */ 200.0, \ + /* TMax = */ 6000.0, \ + /* cpM = */ { 0.000000000E+00, 0.000000000E+00, 4.278073050E+00, 4.756226260E-03, -1.630073780E-06, 2.546226800E-10, -1.488600860E-14, 4.801404780E+04, 6.399786000E-01 }, \ + /* cpL = */ { 0.000000000E+00, 0.000000000E+00, 3.281549410E+00, 6.976426500E-03, -2.385279140E-06, -1.210776310E-09, 9.820417340E-13, 4.831917060E+04, 5.920356860E+00 }, \ + }, \ + /* DiffCoeff = */ { \ + /* Geom = */ SpeciesGeom_NonLinear, \ + /* sigma = */ 4.1*ATom, \ + /* kbOveps = */ 1.0/209.0, \ + /* mu = */ 0.0*DToCm, \ + /* alpha = */ 0.0*ATom*ATom*ATom, \ + /* Z298 = */ 2.5 \ + } \ + } + + +//--------------------------------- +// Define Reactions +//--------------------------------- + +// R 1: H + O2 <=> O + OH +#define R1 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.841000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 7.704293669e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + } \ + } + +// R 2: O + H2 <=> H + OH +#define R2 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.848000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.000596647e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + } \ + } + +// R 3: O + H2 <=> H + OH +#define R3 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.687000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 9.651753924e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + } \ + } + +// R 4: OH + H2 <=> H + H2O +#define R4 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.256000000e+02, \ + /* n = */ 1.510000000e+00, \ + /* EovR = */ 1.729566123e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 5: 2 OH <=> O + H2O +#define R5 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.161000000e-02, \ + /* n = */ 2.420000000e+00, \ + /* EovR = */ -9.702075894e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iOH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 6: H2 <=> 2 H +#define R6 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.580000000e+13, \ + /* n = */ -1.400000000e+00, \ + /* EovR = */ 5.253110491e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 8, \ + /* educts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.95 }, \ + { /* ind = */ iCO2, /* eff = */ 3.83 }, \ + { /* ind = */ iH2 , /* eff = */ 2.55 }, \ + { /* ind = */ iH2O, /* eff = */ 12.02 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 7: 2 O <=> O2 +#define R7 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.160000000e+03, \ + /* n = */ -5.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 8, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.9 }, \ + { /* ind = */ iCO2, /* eff = */ 3.8 }, \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 8: O + H <=> OH +#define R8 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.710000000e+06, \ + /* n = */ -1.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 8, \ + /* educts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 2.52 }, \ + { /* ind = */ iCO2, /* eff = */ 5.01 }, \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 15.8 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 9: H2O <=> H + OH +#define R9 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.060000000e+21, \ + /* n = */ -3.322000000e+00, \ + /* EovR = */ 6.078894025e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 9, \ + /* educts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 2.4 }, \ + { /* ind = */ iCO2, /* eff = */ 4.67 }, \ + { /* ind = */ iH2 , /* eff = */ 3.77 }, \ + { /* ind = */ iH2O, /* eff = */ 0.0 }, \ + { /* ind = */ iO2 , /* eff = */ 1.5 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 10: 2 H2O <=> H + OH + H2O +#define R10 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.528000000e+19, \ + /* n = */ -2.440000000e+00, \ + /* EovR = */ 6.048700843e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iH2O, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 11: H + O2 (+ M) <=> HO2 (+ M) +#define R11 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.370000000e+08, \ + /* n = */ -1.720000000e+00, \ + /* EovR = */ 2.641903446e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 4.565000000e+06, \ + /* n = */ 4.400000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 9, \ + /* educts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.9 }, \ + { /* ind = */ iCO2, /* eff = */ 3.45 }, \ + { /* ind = */ iH2 , /* eff = */ 1.87 }, \ + { /* ind = */ iH2O, /* eff = */ 15.81 }, \ + { /* ind = */ iO2 , /* eff = */ 0.75 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.000000000e-01, \ +/* T1 = */ 9.000000000e+04, \ +/* T2 = */ 9.000000000e+04, \ +/* T3 = */ 3.000000000e+01 \ + }} \ + } + +// R 12: HO2 + H <=> H2 + O2 +#define R12 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.945000000e+00, \ + /* n = */ 2.087000000e+00, \ + /* EovR = */ -7.321846694e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + } \ + } + +// R 13: HO2 + H <=> 2 OH +#define R13 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.888000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.509659112e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 14: HO2 + H <=> O + H2O +#define R14 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.632000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 15: HO2 + O <=> OH + O2 +#define R15 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.609000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.239327683e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + } \ + } + +// R 16: HO2 + OH <=> H2O + O2 +#define R16 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.347000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -5.500191365e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + } \ + } + +// R 17: HO2 + OH <=> H2O + O2 +#define R17 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.534000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.500191365e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + } \ + } + +// R 18: 2 HO2 <=> H2O2 + O2 +#define R18 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.958000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -7.090365630e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + } \ + } + +// R 19: 2 HO2 <=> H2O2 + O2 +#define R19 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.111000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.555545533e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHO2, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + } \ + } + +// R 20: H2O2 (+ M) <=> 2 OH (+ M) +#define R20 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.490000000e+18, \ + /* n = */ -2.300000000e+00, \ + /* EovR = */ 2.453196057e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.187000000e+12, \ + /* n = */ 9.000000000e-01, \ + /* EovR = */ 2.453196057e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 10, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.33 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 2.8 }, \ + { /* ind = */ iCO2, /* eff = */ 1.6 }, \ + { /* ind = */ iH2 , /* eff = */ 3.27 }, \ + { /* ind = */ iH2O, /* eff = */ 6.63 }, \ + { /* ind = */ iH2O2, /* eff = */ 6.61 }, \ + { /* ind = */ iO2 , /* eff = */ 1.2 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.800000000e-01, \ +/* T1 = */ 9.000000000e+04, \ +/* T2 = */ 9.000000000e+04, \ +/* T3 = */ 3.000000000e+01 \ + }} \ + } + +// R 21: H2O2 + H <=> OH + H2O +#define R21 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.045000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.997782225e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 22: H2O2 + H <=> HO2 + H2 +#define R22 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.856000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.000596647e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 23: H2O2 + O <=> OH + HO2 +#define R23 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.513000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 1.997782225e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + } \ + } + +// R 24: H2O2 + OH <=> H2O + HO2 +#define R24 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.565000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.600238659e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + } \ + } + +// R 25: H2O2 + OH <=> H2O + HO2 +#define R25 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.340000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.658407249e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2O2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + } \ + } + +// R 26: CO + O (+ M) <=> CO2 (+ M) +#define R26 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.400000000e+09, \ + /* n = */ -2.100000000e+00, \ + /* EovR = */ 2.767708372e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.880000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.222823881e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 8, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.9 }, \ + { /* ind = */ iCO2, /* eff = */ 3.8 }, \ + { /* ind = */ iH2 , /* eff = */ 2.5 }, \ + { /* ind = */ iH2O, /* eff = */ 12.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Lindemann, \ + /* FOData = */ { .Lindemann = { \ + /* dummy = */ 0, \ + } } \ + } + +// R 27: CO + O2 <=> O + CO2 +#define R27 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.533000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.400357988e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 28: CO + OH <=> H + CO2 +#define R28 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.187000000e-02, \ + /* n = */ 2.053000000e+00, \ + /* EovR = */ -1.791462146e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 29: CO + OH <=> H + CO2 +#define R29 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.017000000e+06, \ + /* n = */ -6.640000000e-01, \ + /* EovR = */ 1.670689417e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 30: CO + HO2 <=> OH + CO2 +#define R30 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.570000000e-01, \ + /* n = */ 2.180000000e+00, \ + /* EovR = */ 9.029774370e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 31: HCO <=> H + CO +#define R31 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.800000000e+11, \ + /* n = */ -1.200000000e+00, \ + /* EovR = */ 8.924098232e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 9, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 3.29 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.6 }, \ + { /* ind = */ iCO , /* eff = */ 2.04 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 1.31 }, \ + { /* ind = */ iH2O, /* eff = */ 15.31 }, \ + { /* ind = */ iO2 , /* eff = */ 1.32 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + } \ + } + +// R 32: HCO + H <=> H2 + CO +#define R32 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.482000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 33: HCO + O <=> OH + CO +#define R33 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.010000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 34: HCO + O <=> H + CO2 +#define R34 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.001000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 35: HCO + OH <=> H2O + CO +#define R35 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.199000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 36: HCO + O2 <=> HO2 + CO +#define R36 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.562000000e+04, \ + /* n = */ 5.210000000e-01, \ + /* EovR = */ -2.621774658e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 37: C + OH <=> H + CO +#define R37 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 38: C + O2 <=> O + CO +#define R38 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.620000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.200477318e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 39: CH + H <=> C + H2 +#define R39 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.089000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 40: CH + O <=> H + CO +#define R40 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.700000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 41: CH + OH <=> H + HCO +#define R41 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 42: CH + H2 <=> H + CH2 +#define R42 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.612000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.670689417e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + } \ + } + +// R 43: CH + H2 (+ M) <=> CH3 (+ M) +#define R43 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.430000000e+10, \ + /* n = */ -1.600000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.130000000e+07, \ + /* n = */ 1.500000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.140000000e-01, \ +/* T1 = */ 2.285000000e+04, \ +/* T2 = */ 1.035000000e+04, \ +/* T3 = */ 1.520000000e+02 \ + }} \ + } + +// R 44: CH + H2O <=> H + CH2O +#define R44 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.430000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -4.448462184e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 45: CH + O2 <=> O + HCO +#define R45 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.840000000e+02, \ + /* n = */ 1.430000000e+00, \ + /* EovR = */ 6.038636449e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 46: CH + O2 <=> CO2 + H +#define R46 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.781000000e+02, \ + /* n = */ 1.430000000e+00, \ + /* EovR = */ 6.038636449e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + } \ + } + +// R 47: CH + O2 <=> CO + OH +#define R47 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.840000000e+02, \ + /* n = */ 1.430000000e+00, \ + /* EovR = */ 6.038636449e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + } \ + } + +// R 48: CH + O2 -> O + H + CO +#define R48 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.789000000e+02, \ + /* n = */ 1.430000000e+00, \ + /* EovR = */ 6.038636449e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 49: CH + CO (+ M) <=> HCCO (+ M) +#define R49 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.260000000e+12, \ + /* n = */ -2.500000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.020000000e+09, \ + /* n = */ -4.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 4.000000000e-01, \ +/* T1 = */ 9.000000000e+04, \ +/* T2 = */ 9.000000000e+04, \ +/* T3 = */ 3.000000000e+01 \ + }} \ + } + +// R 50: CH + CO2 <=> HCO + CO +#define R50 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.380000000e+01, \ + /* n = */ 1.510000000e+00, \ + /* EovR = */ -3.598020884e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 51: CH2 + H (+ M) <=> CH3 (+ M) +#define R51 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.390000000e+22, \ + /* n = */ -5.040000000e+00, \ + /* EovR = */ 3.723825810e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.130000000e+07, \ + /* n = */ 3.200000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 4.050000000e-01, \ +/* T1 = */ 2.811000000e+03, \ +/* T2 = */ 9.908000000e+03, \ +/* T3 = */ 2.580000000e+02 \ + }} \ + } + +// R 52: CH2 + O -> 2 H + CO +#define R52 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 53: CH2 + OH <=> H + CH2O +#define R53 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.899000000e+07, \ + /* n = */ 1.200000000e-01, \ + /* EovR = */ -8.152159206e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 54: CH2 + OH <=> CH + H2O +#define R54 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.630000000e-01, \ + /* n = */ 2.020000000e+00, \ + /* EovR = */ 3.409816715e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 55: CH2 + HO2 <=> OH + CH2O +#define R55 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 56: CH2 + H2 <=> H + CH3 +#define R56 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.265000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 3.638278460e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + } \ + } + +// R 57: CH2 + O2 -> OH + H + CO +#define R57 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.643000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.032197041e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 58: CH2 + O2 -> 2 H + CO2 +#define R58 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.844000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.032197041e+02, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 59: CH2 + O2 <=> O + CH2O +#define R59 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.032197041e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 60: CH2 + O2 <=> H2 + CO2 +#define R60 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.836000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.032197041e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 61: CH2 + O2 <=> H2O + CO +#define R61 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.200000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.032197041e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 62: CH2 + C <=> H + C2H +#define R62 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iC , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H, /* nu = */ 1 } \ + } \ + } + +// R 63: CH2 + CH <=> H + C2H2 +#define R63 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 64: 2 CH2 -> 2 H + C2H2 +#define R64 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.529881328e+03, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 65: 2 CH2 <=> H2 + H2CC +#define R65 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e+09, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.010456145e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iH2CC, /* nu = */ 1 } \ + } \ + } + +// R 66: CH2(S) + H <=> CH + H2 +#define R66 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 67: CH2(S) + O -> 2 H + CO +#define R67 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 2 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 68: CH2(S) + OH <=> H + CH2O +#define R68 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 69: CH2(S) + H2 <=> CH3 + H +#define R69 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.291000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + } \ + } + +// R 70: CH2(S) + O2 <=> CH2 + O2 +#define R70 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.130000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + } \ + } + +// R 71: CH2(S) + H2O (+ M) <=> CH3OH (+ M) +#define R71 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.680000000e+29, \ + /* n = */ -7.192000000e+00, \ + /* EovR = */ 2.907100230e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.940000000e+06, \ + /* n = */ 5.300000000e-02, \ + /* EovR = */ -9.546077786e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 9.920000000e-01, \ +/* T1 = */ 4.731000000e+04, \ +/* T2 = */ 4.711000000e+04, \ +/* T3 = */ 9.430000000e+02 \ + }} \ + } + +// R 72: CH2(S) + H2O <=> CH2 + H2O +#define R72 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.510000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.168876925e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 73: CH2(S) + H2O <=> H2 + CH2O +#define R73 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.670000000e+15, \ + /* n = */ -3.134000000e+00, \ + /* EovR = */ 1.660625023e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 74: CH2(S) + H2O2 <=> OH + CH3O +#define R74 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.290000000e+08, \ + /* n = */ -1.380000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 75: CH2(S) + CO <=> CH2 + CO +#define R75 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 76: CH2(S) + CO2 <=> CH2 + CO2 +#define R76 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.330000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 77: CH2(S) + CO2 <=> CO + CH2O +#define R77 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.620000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 78: HCO + H (+ M) <=> CH2O (+ M) +#define R78 { \ + /* ArrCoeffL = */ { \ + /* A = */ 4.190000000e+22, \ + /* n = */ -5.533000000e+00, \ + /* EovR = */ 3.083730346e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.913000000e+08, \ + /* n = */ -3.300000000e-02, \ + /* EovR = */ -7.145719798e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.84 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.820000000e-01, \ +/* T1 = */ 2.755000000e+03, \ +/* T2 = */ 6.570000000e+03, \ +/* T3 = */ 2.710000000e+02 \ + }} \ + } + +// R 79: CH2O (+ M) <=> H2 + CO (+ M) +#define R79 { \ + /* ArrCoeffL = */ { \ + /* A = */ 4.400000000e+32, \ + /* n = */ -6.100000000e+00, \ + /* EovR = */ 4.730265218e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 3.700000000e+13, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.621974142e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 9.320000000e-01, \ +/* T1 = */ 1.540000000e+03, \ +/* T2 = */ 1.030000000e+04, \ +/* T3 = */ 1.970000000e+02 \ + }} \ + } + +// R 80: CH2O + H <=> HCO + H2 +#define R80 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.149000000e+01, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 1.379828429e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 81: CH2O + O <=> OH + HCO +#define R81 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.244000000e+05, \ + /* n = */ 5.700000000e-01, \ + /* EovR = */ 1.389892823e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 82: CH2O + OH <=> HCO + H2O +#define R82 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.338000000e+01, \ + /* n = */ 1.630000000e+00, \ + /* EovR = */ -5.308967878e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 83: CH2O + O2 <=> HO2 + HCO +#define R83 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.297000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 1.834739041e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 84: CH2O + HO2 <=> HCO + H2O2 +#define R84 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.111000000e-02, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 5.137873178e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 } \ + } \ + } + +// R 85: CH2O + CH <=> H + CH2CO +#define R85 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.640000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.601645870e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 } \ + } \ + } + +// R 86: CH2O + CH2 <=> CH3 + HCO +#define R86 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.400000000e-08, \ + /* n = */ 4.210000000e+00, \ + /* EovR = */ 5.636060686e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 87: CH2O + CH2(S) <=> CH3 + HCO +#define R87 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.330000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.767708372e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 88: CH2O + C2H <=> C2H2 + HCO +#define R88 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.400000000e-03, \ + /* n = */ 2.810000000e+00, \ + /* EovR = */ 2.949873905e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iC2H, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 89: CH2O + C2H3 <=> C2H4 + HCO +#define R89 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.400000000e-03, \ + /* n = */ 2.810000000e+00, \ + /* EovR = */ 2.949873905e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 90: CH3 + H (+ M) <=> CH4 (+ M) +#define R90 { \ + /* ArrCoeffL = */ { \ + /* A = */ 7.930000000e+12, \ + /* n = */ -2.170000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.801000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 8, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 0.89 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 3.42 }, \ + { /* ind = */ iO2 , /* eff = */ 0.59 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 1.240000000e-01, \ +/* T1 = */ 3.310000000e+01, \ +/* T2 = */ 9.000000000e+04, \ +/* T3 = */ 1.801000000e+03 \ + }} \ + } + +// R 91: CH3 + O <=> H + CH2O +#define R91 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.722000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 92: CH3 + O -> H + H2 + CO +#define R92 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.384000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 93: CH3 + OH (+ M) <=> CH3OH (+ M) +#define R93 { \ + /* ArrCoeffL = */ { \ + /* A = */ 7.240000000e+24, \ + /* n = */ -6.000000000e+00, \ + /* EovR = */ 1.623386765e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 6.210000000e+07, \ + /* n = */ -1.800000000e-02, \ + /* EovR = */ -1.660625023e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 1.855000000e-01, \ +/* T1 = */ 1.675000000e+03, \ +/* T2 = */ 4.530000000e+03, \ +/* T3 = */ 1.560000000e+02 \ + }} \ + } + +// R 94: CH3 + OH <=> CH2 + H2O +#define R94 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.464000000e-02, \ + /* n = */ 2.570000000e+00, \ + /* EovR = */ 2.011872377e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 95: CH3 + OH <=> CH2(S) + H2O +#define R95 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.810000000e+09, \ + /* n = */ -9.100000000e-01, \ + /* EovR = */ 2.747579584e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 96: CH3 + OH <=> H2 + CH2O +#define R96 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.735000000e+03, \ + /* n = */ 7.340000000e-01, \ + /* EovR = */ -1.095509296e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 97: CH3 + HO2 <=> O2 + CH4 +#define R97 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.269000000e-01, \ + /* n = */ 2.228000000e+00, \ + /* EovR = */ -1.520729946e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO2 , /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 98: CH3 + HO2 <=> OH + CH3O +#define R98 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.821000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.968996254e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 99: CH3 + O2 <=> O + CH3O +#define R99 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.104000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.423960797e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iO , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 100: CH3 + O2 <=> OH + CH2O +#define R100 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.977000000e-05, \ + /* n = */ 2.860000000e+00, \ + /* EovR = */ 4.915450069e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 101: CH3 + C <=> H + C2H2 +#define R101 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iC , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 102: CH3 + CH <=> H + C2H3 +#define R102 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.062000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 } \ + } \ + } + +// R 103: CH3 + CH2 <=> H + C2H4 +#define R103 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.824000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 104: CH3 + CH2(S) <=> H + C2H4 +#define R104 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.501001929e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 105: 2 CH3 (+ M) <=> C2H6 (+ M) +#define R105 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.770000000e+38, \ + /* n = */ -9.670000000e+00, \ + /* EovR = */ 3.130026559e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.844000000e+10, \ + /* n = */ -9.700000000e-01, \ + /* EovR = */ 3.119962165e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 8, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 1.99 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ iO2 , /* eff = */ 1.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.325000000e-01, \ +/* T1 = */ 1.038000000e+03, \ +/* T2 = */ 4.970000000e+03, \ +/* T3 = */ 1.510000000e+02 \ + }} \ + } + +// R 106: 2 CH3 <=> H + C2H5 +#define R106 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.621000000e+06, \ + /* n = */ 1.000000000e-01, \ + /* EovR = */ 5.334128863e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 } \ + } \ + } + +// R 107: CH3 + HCO <=> CH4 + CO +#define R107 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.300000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 108: CH3 + CH2O <=> HCO + CH4 +#define R108 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.213000000e-05, \ + /* n = */ 3.360000000e+00, \ + /* EovR = */ 2.168876925e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 109: CH3O (+ M) <=> H + CH2O (+ M) +#define R109 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.020000000e+10, \ + /* n = */ -5.470000000e-01, \ + /* EovR = */ 9.070031946e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.130000000e+10, \ + /* n = */ 1.210000000e+00, \ + /* EovR = */ 1.211501438e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 3.410000000e-01, \ +/* T1 = */ 1.000000000e+03, \ +/* T2 = */ 2.339000000e+03, \ +/* T3 = */ 2.800000000e+01 \ + }} \ + } + +// R 110: CH3O + H (+ M) <=> CH3OH (+ M) +#define R110 { \ + /* ArrCoeffL = */ { \ + /* A = */ 6.700000000e+28, \ + /* n = */ -7.380000000e+00, \ + /* EovR = */ 4.618047224e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.440000000e+05, \ + /* n = */ 7.600000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 6.840000000e-01, \ +/* T1 = */ 4.149000000e+04, \ +/* T2 = */ 3.980000000e+03, \ +/* T3 = */ 3.705000000e+04 \ + }} \ + } + +// R 111: CH3O + H <=> H + CH2OH +#define R111 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.290000000e+01, \ + /* n = */ 1.820000000e+00, \ + /* EovR = */ -3.537634520e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 112: CH3O + H <=> H2 + CH2O +#define R112 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.790000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.999189436e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 113: CH3O + H <=> OH + CH3 +#define R113 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.880000000e+08, \ + /* n = */ -2.640000000e-01, \ + /* EovR = */ -1.308371231e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + } \ + } + +// R 114: CH3O + H <=> CH2(S) + H2O +#define R114 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.970000000e+05, \ + /* n = */ 4.140000000e-01, \ + /* EovR = */ 1.222823881e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 115: CH3O + O <=> OH + CH2O +#define R115 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.780000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 116: CH3O + OH <=> H2O + CH2O +#define R116 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.810000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 117: CH3O + O2 <=> HO2 + CH2O +#define R117 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.320000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.309880890e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 118: CH3O + CH3 <=> CH4 + CH2O +#define R118 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 119: CH3O + CO <=> CH3 + CO2 +#define R119 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.535416745e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 120: CH2OH (+ M) <=> H + CH2O (+ M) +#define R120 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.010000000e+07, \ + /* n = */ 1.840000000e-01, \ + /* EovR = */ 8.670475501e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 7.370000000e+10, \ + /* n = */ 8.110000000e-01, \ + /* EovR = */ 1.991743589e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 5.97 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 1.000000000e-03, \ +/* T1 = */ 6.000000000e+02, \ +/* T2 = */ 2.780000000e+03, \ +/* T3 = */ 5.000000000e+01 \ + }} \ + } + +// R 121: CH2OH + H (+ M) <=> CH3OH (+ M) +#define R121 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.340000000e+29, \ + /* n = */ -7.380000000e+00, \ + /* EovR = */ 4.618047224e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 6.670000000e+04, \ + /* n = */ 9.600000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 6.840000000e-01, \ +/* T1 = */ 4.149000000e+04, \ +/* T2 = */ 3.980000000e+03, \ +/* T3 = */ 3.705000000e+04 \ + }} \ + } + +// R 122: CH2OH + H <=> H2 + CH2O +#define R122 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.440000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 123: CH2OH + H <=> OH + CH3 +#define R123 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.006000000e+07, \ + /* n = */ 1.980000000e-01, \ + /* EovR = */ -1.212759487e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + } \ + } + +// R 124: CH2OH + H <=> CH2(S) + H2O +#define R124 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.280000000e+05, \ + /* n = */ 5.160000000e-01, \ + /* EovR = */ 1.081922364e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 125: CH2OH + O <=> OH + CH2O +#define R125 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.030000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 126: CH2OH + OH <=> H2O + CH2O +#define R126 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.410000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 127: CH2OH + O2 <=> HO2 + CH2O +#define R127 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.298000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.880028814e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 128: CH2OH + CH3 <=> CH4 + CH2O +#define R128 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 129: CH4 + H <=> CH3 + H2 +#define R129 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.781000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 4.824870523e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 130: CH4 + O <=> OH + CH3 +#define R130 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.786000000e+02, \ + /* n = */ 1.560000000e+00, \ + /* EovR = */ 4.269819189e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + } \ + } + +// R 131: CH4 + OH <=> CH3 + H2O +#define R131 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.839000000e-01, \ + /* n = */ 2.182000000e+00, \ + /* EovR = */ 1.230875396e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 132: CH4 + HO2 <=> CH3 + H2O2 +#define R132 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.778000000e-02, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 1.056761379e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 } \ + } \ + } + +// R 133: CH4 + CH <=> H + C2H4 +#define R133 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -1.997782225e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 134: CH4 + CH2 <=> 2 CH3 +#define R134 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.483000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 4.161626953e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 135: CH4 + CH2(S) <=> 2 CH3 +#define R135 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.867000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.501001929e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 136: CH4 + C2H <=> CH3 + C2H2 +#define R136 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.300000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.019318224e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iC2H, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 137: CH3OH + H <=> CH2OH + H2 +#define R137 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.550000000e+00, \ + /* n = */ 2.351000000e+00, \ + /* EovR = */ 2.975034890e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 138: CH3OH + H <=> CH3O + H2 +#define R138 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.490000000e+00, \ + /* n = */ 2.147000000e+00, \ + /* EovR = */ 5.602848185e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 139: CH3OH + O <=> OH + CH2OH +#define R139 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.470000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 2.670083750e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 140: CH3OH + O <=> OH + CH3O +#define R140 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.200000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.549106125e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 141: CH3OH + OH <=> CH2OH + H2O +#define R141 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.420000000e-01, \ + /* n = */ 2.370000000e+00, \ + /* EovR = */ -4.857076584e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 142: CH3OH + OH <=> CH3O + H2O +#define R142 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.600000000e-02, \ + /* n = */ 2.700000000e+00, \ + /* EovR = */ 2.682161023e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 143: CH3OH + O2 <=> CH2OH + HO2 +#define R143 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.580000000e-01, \ + /* n = */ 2.270000000e+00, \ + /* EovR = */ 2.151767455e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + } \ + } + +// R 144: CH3OH + HO2 <=> CH2OH + H2O2 +#define R144 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.280000000e-11, \ + /* n = */ 5.060000000e+00, \ + /* EovR = */ 5.139382838e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 } \ + } \ + } + +// R 145: CH3OH + HO2 <=> CH3O + H2O2 +#define R145 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.340000000e-08, \ + /* n = */ 4.120000000e+00, \ + /* EovR = */ 8.168765456e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 } \ + } \ + } + +// R 146: CH3OH + CH <=> CH3 + CH2O +#define R146 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.040000000e+12, \ + /* n = */ -1.930000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 147: CH3OH + CH2 <=> CH3 + CH2OH +#define R147 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.200000000e-05, \ + /* n = */ 3.200000000e+00, \ + /* EovR = */ 3.610601377e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 148: CH3OH + CH2 <=> CH3 + CH3O +#define R148 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.450000000e-05, \ + /* n = */ 3.100000000e+00, \ + /* EovR = */ 3.492344746e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 149: CH3OH + CH2(S) <=> CH3 + CH3O +#define R149 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.767708372e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 150: CH3OH + CH2(S) <=> CH3 + CH2OH +#define R150 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -2.767708372e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 151: CH3OH + CH3 <=> CH2OH + CH4 +#define R151 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.650000000e-04, \ + /* n = */ 3.030000000e+00, \ + /* EovR = */ 4.388075819e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 152: CH3OH + CH3 <=> CH3O + CH4 +#define R152 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.150000000e-02, \ + /* n = */ 2.270000000e+00, \ + /* EovR = */ 4.383043622e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3O, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 153: CH3OH + C2H <=> C2H2 + CH2OH +#define R153 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iC2H, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 154: CH3OH + C2H <=> C2H2 + CH3O +#define R154 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iC2H, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 155: CH3OH + C2H3 <=> C2H4 + CH2OH +#define R155 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.200000000e-05, \ + /* n = */ 3.200000000e+00, \ + /* EovR = */ 3.610601377e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 156: CH3OH + C2H3 <=> C2H4 + CH3O +#define R156 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.450000000e-05, \ + /* n = */ 3.100000000e+00, \ + /* EovR = */ 3.492344746e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3OH, /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iCH3O, /* nu = */ 1 } \ + } \ + } + +// R 157: C2H + H (+ M) <=> C2H2 (+ M) +#define R157 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.750000000e+21, \ + /* n = */ -4.800000000e+00, \ + /* EovR = */ 9.561174377e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.250000000e+07, \ + /* n = */ 3.200000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 6.460000000e-01, \ +/* T1 = */ 1.315000000e+03, \ +/* T2 = */ 5.566000000e+03, \ +/* T3 = */ 1.320000000e+02 \ + }} \ + } + +// R 158: C2H + O <=> CH + CO +#define R158 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.400000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 159: C2H + OH <=> H + HCCO +#define R159 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 } \ + } \ + } + +// R 160: C2H + H2 <=> H + C2H2 +#define R160 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.110000000e+00, \ + /* n = */ 2.320000000e+00, \ + /* EovR = */ 4.438397790e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 161: C2H + O2 <=> HCO + CO +#define R161 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.630000000e+08, \ + /* n = */ -3.500000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 162: HCCO + H <=> CH2(S) + CO +#define R162 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.320000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2_S, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 163: HCCO + O <=> H + 2 CO +#define R163 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.730000000e+08, \ + /* n = */ -1.120000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 2 } \ + } \ + } + +// R 164: HCCO + O <=> CH + CO2 +#define R164 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.950000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.600835306e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH , /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 165: HCCO + O2 <=> OH + 2 CO +#define R165 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.567000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.297496273e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 2 } \ + } \ + } + +// R 166: HCCO + CH <=> CO + C2H2 +#define R166 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 167: HCCO + CH2 <=> C2H3 + CO +#define R167 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 168: 2 HCCO <=> 2 CO + C2H2 +#define R168 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 2 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 169: C2H2 (+ M) <=> H2CC (+ M) +#define R169 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.450000000e+09, \ + /* n = */ -6.400000000e-01, \ + /* EovR = */ 2.501001929e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 8.000000000e+14, \ + /* n = */ -5.200000000e-01, \ + /* EovR = */ 2.553839998e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2CC, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Lindemann, \ + /* FOData = */ { .Lindemann = { \ + /* dummy = */ 0, \ + } } \ + } + +// R 170: C2H2 + H (+ M) <=> C2H3 (+ M) +#define R170 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.630000000e+15, \ + /* n = */ -3.380000000e+00, \ + /* EovR = */ 4.262270893e+02, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.540000000e+02, \ + /* n = */ 1.640000000e+00, \ + /* EovR = */ 1.054748500e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 2.150000000e-01, \ +/* T1 = */ 1.043000000e+03, \ +/* T2 = */ 2.341000000e+03, \ +/* T3 = */ 1.070000000e+01 \ + }} \ + } + +// R 171: C2H2 + O <=> H + HCCO +#define R171 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.679000000e+02, \ + /* n = */ 1.400000000e+00, \ + /* EovR = */ 1.110102667e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 } \ + } \ + } + +// R 172: C2H2 + O <=> CO + CH2 +#define R172 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.304000000e+02, \ + /* n = */ 1.400000000e+00, \ + /* EovR = */ 1.110102667e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 } \ + } \ + } + +// R 173: C2H2 + OH <=> H + CH2CO +#define R173 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.670000000e-07, \ + /* n = */ 3.566000000e+00, \ + /* EovR = */ -1.192630699e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 } \ + } \ + } + +// R 174: C2H2 + OH <=> C2H + H2O +#define R174 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.630000000e+00, \ + /* n = */ 2.140000000e+00, \ + /* EovR = */ 8.584928151e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 175: C2H2 + OH <=> CH3 + CO +#define R175 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.140000000e-01, \ + /* n = */ 1.620000000e+00, \ + /* EovR = */ -3.678536037e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 176: H2CC + H <=> C2H2 + H +#define R176 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2CC, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + } \ + } + +// R 177: H2CC + OH <=> CH2CO + H +#define R177 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iH2CC, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + } \ + } + +// R 178: H2CC + O2 <=> 2 HCO +#define R178 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.124000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iH2CC, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 179: CH2 + CO (+ M) <=> CH2CO (+ M) +#define R179 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.690000000e+21, \ + /* n = */ -5.110000000e+00, \ + /* EovR = */ 3.570343800e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 8.100000000e+05, \ + /* n = */ 5.000000000e-01, \ + /* EovR = */ 2.269520865e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 5.910000000e-01, \ +/* T1 = */ 1.226000000e+03, \ +/* T2 = */ 5.185000000e+03, \ +/* T3 = */ 2.750000000e+02 \ + }} \ + } + +// R 180: CH2CO + H <=> HCCO + H2 +#define R180 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.200000000e+01, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 5.963153493e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 181: CH2CO + H <=> CH3 + CO +#define R181 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.676000000e+02, \ + /* n = */ 1.450000000e+00, \ + /* EovR = */ 1.398950777e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 182: CH2CO + O <=> OH + HCCO +#define R182 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 5.183162952e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iHCCO, /* nu = */ 1 } \ + } \ + } + +// R 183: CH2CO + O <=> CH2 + CO2 +#define R183 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.080000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.798498202e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 184: CH2CO + O <=> 2 HCO +#define R184 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.610000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.798498202e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 2 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + } \ + } + +// R 185: CH2CO + O <=> CO + CH2O +#define R185 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.610000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 6.798498202e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 186: CH2CO + OH <=> HCCO + H2O +#define R186 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.120000000e-02, \ + /* n = */ 2.740000000e+00, \ + /* EovR = */ 1.117147743e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCCO, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 187: CH2CO + OH <=> CH3 + CO2 +#define R187 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.800000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -5.097615602e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 188: CH2CO + OH <=> CH2OH + CO +#define R188 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.010000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -5.097615602e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2OH, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 189: CH2CO + CH <=> C2H3 + CO +#define R189 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.450000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + } \ + } + +// R 190: C2H3 + H (+ M) <=> C2H4 (+ M) +#define R190 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.400000000e+18, \ + /* n = */ -3.860000000e+00, \ + /* EovR = */ 1.670689417e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 3.880000000e+07, \ + /* n = */ 2.000000000e-01, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.820000000e-01, \ +/* T1 = */ 2.663000000e+03, \ +/* T2 = */ 6.095000000e+03, \ +/* T3 = */ 2.075000000e+02 \ + }} \ + } + +// R 191: C2H3 + H <=> H2 + C2H2 +#define R191 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.210000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 192: C2H3 + H <=> H2CC + H2 +#define R192 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.893000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2CC, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 193: C2H3 + O <=> H + CH2CO +#define R193 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.010000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 } \ + } \ + } + +// R 194: C2H3 + OH <=> H2O + C2H2 +#define R194 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.100000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 195: C2H3 + OH <=> CH3 + HCO +#define R195 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 196: C2H3 + OH <=> CH3CO + H +#define R196 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + } \ + } + +// R 197: C2H3 + O2 <=> HCO + CH2O +#define R197 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.936000000e+09, \ + /* n = */ -9.590000000e-01, \ + /* EovR = */ 2.918674284e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 198: C2H3 + O2 <=> CH2CHO + O +#define R198 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.849000000e+03, \ + /* n = */ 9.230000000e-01, \ + /* EovR = */ 1.137276531e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + } \ + } + +// R 199: C2H3 + O2 <=> C2H2 + HO2 +#define R199 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.400000000e-05, \ + /* n = */ 2.950000000e+00, \ + /* EovR = */ 9.359886496e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H2, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + } \ + } + +// R 200: C2H3 + CH3 <=> CH4 + C2H2 +#define R200 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.000000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -3.849630736e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iC2H2, /* nu = */ 1 } \ + } \ + } + +// R 201: CH2CHO (+ M) <=> CH2CO + H (+ M) +#define R201 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.440000000e+23, \ + /* n = */ -3.790000000e+00, \ + /* EovR = */ 2.192880504e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.430000000e+15, \ + /* n = */ -1.500000000e-01, \ + /* EovR = */ 2.294983782e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 10, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H2, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H4, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 7.960000000e-01, \ +/* T1 = */ 5.000000000e+04, \ +/* T2 = */ 3.420400000e+04, \ +/* T3 = */ 1.000000000e+02 \ + }} \ + } + +// R 202: CH2CHO (+ M) <=> CH3 + CO (+ M) +#define R202 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.340000000e+21, \ + /* n = */ -3.180000000e+00, \ + /* EovR = */ 1.683018300e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.930000000e+12, \ + /* n = */ 2.900000000e-01, \ + /* EovR = */ 2.029283779e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 10, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H2, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H4, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 2.110000000e-01, \ +/* T1 = */ 2.032000000e+03, \ +/* T2 = */ 1.117020000e+05, \ +/* T3 = */ 1.990000000e+02 \ + }} \ + } + +// R 203: CH2CHO + H <=> CH3 + HCO +#define R203 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 204: CH2CHO + H <=> CH2CO + H2 +#define R204 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.100000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 205: CH2CHO + H <=> CH3CO + H +#define R205 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + } \ + } + +// R 206: CH2CHO + O -> H + CH2 + CO2 +#define R206 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.580000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 207: CH2CHO + OH <=> H2O + CH2CO +#define R207 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 } \ + } \ + } + +// R 208: CH2CHO + OH <=> HCO + CH2OH +#define R208 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.010000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHCO, /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 209: CH2CHO + O2 -> OH + CO + CH2O +#define R209 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.300000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ false, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 210: CH3CO (+ M) <=> CH3 + CO (+ M) +#define R210 { \ + /* ArrCoeffL = */ { \ + /* A = */ 5.650000000e+12, \ + /* n = */ -9.700000000e-01, \ + /* EovR = */ 7.339459384e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.070000000e+12, \ + /* n = */ 6.300000000e-01, \ + /* EovR = */ 8.501896900e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 10, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H2, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H4, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 3.600000000e-01, \ +/* T1 = */ 5.000000000e+04, \ +/* T2 = */ 1.693500000e+04, \ +/* T3 = */ 1.220000000e+02 \ + }} \ + } + +// R 211: CH3CO + H (+ M) <=> CH3CHO (+ M) +#define R211 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.850000000e+32, \ + /* n = */ -8.569000000e+00, \ + /* EovR = */ 2.767708372e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 9.600000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 10, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H2, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H4, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 1.000000000e+00, \ +/* T1 = */ 2.900000000e+03, \ +/* T2 = */ 5.132000000e+03, \ +/* T3 = */ 2.900000000e+03 \ + }} \ + } + +// R 212: CH3CO + H <=> CH3 + HCO +#define R212 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.600000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 213: CH3CO + O <=> CH2CO + OH +#define R213 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.270000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + } \ + } + +// R 214: CH3CO + O <=> CH3 + CO2 +#define R214 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.580000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 } \ + } \ + } + +// R 215: CH3CO + OH <=> CH2CO + H2O +#define R215 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CO, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 216: CH3CO + OH <=> CH3 + CO + OH +#define R216 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + } \ + } + +// R 217: CH3CO + HO2 <=> CH3 + CO2 + OH +#define R217 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.000000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 3, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCO2, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + } \ + } + +// R 218: CH3CO + O2 <=> HO2 + CH2CO +#define R218 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.300000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 } \ + } \ + } + +// R 219: CH3CO + CH3 <=> CH4 + CH2CO +#define R219 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.080000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCH2CO, /* nu = */ 1 } \ + } \ + } + +// R 220: CH3CHO (+ M) <=> CH4 + CO (+ M) +#define R220 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.290000000e+52, \ + /* n = */ -1.130000000e+01, \ + /* EovR = */ 4.826984045e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.440000000e+21, \ + /* n = */ -1.740000000e+00, \ + /* EovR = */ 4.346006652e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 10, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iCO , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H2, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H4, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 } \ + }, \ +/* Ftype = */ F_SRI, \ +/* FOData = */ { .SRI = { \ +/* A = */ 1.380000000e-01, \ +/* B = */ -6.700000000e+02, \ +/* C = */ 1.000000000e-03, \ +/* D = */ 1.000000000e+00, \ +/* E = */ 0.000000000e+00 \ + }} \ + } + +// R 221: CH3CHO (+ M) <=> CH3 + HCO (+ M) +#define R221 { \ + /* ArrCoeffL = */ { \ + /* A = */ 9.150000000e+52, \ + /* n = */ -1.130000000e+01, \ + /* EovR = */ 4.826984045e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 2.180000000e+22, \ + /* n = */ -1.740000000e+00, \ + /* EovR = */ 4.346006652e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 10, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H2, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H4, /* eff = */ 3.0 }, \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2 , /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 } \ + }, \ +/* Ftype = */ F_SRI, \ +/* FOData = */ { .SRI = { \ +/* A = */ 1.380000000e-01, \ +/* B = */ -6.700000000e+02, \ +/* C = */ 1.000000000e-03, \ +/* D = */ 1.000000000e+00, \ +/* E = */ 0.000000000e+00 \ + }} \ + } + +// R 222: CH3CHO + H <=> CH2CHO + H2 +#define R222 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.050000000e+03, \ + /* n = */ 1.160000000e+00, \ + /* EovR = */ 1.210243388e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2CHO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 223: CH3CHO + H <=> CH3CO + H2 +#define R223 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.050000000e+03, \ + /* n = */ 1.160000000e+00, \ + /* EovR = */ 1.210243388e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 224: CH3CHO + O <=> OH + CH2CHO +#define R224 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.920000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 9.098212249e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 } \ + } \ + } + +// R 225: CH3CHO + O <=> OH + CH3CO +#define R225 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.920000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 9.098212249e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1 } \ + } \ + } + +// R 226: CH3CHO + OH <=> CH3CO + H2O +#define R226 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.690000000e+02, \ + /* n = */ 1.350000000e+00, \ + /* EovR = */ -7.920678142e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 227: CH3CHO + O2 <=> HO2 + CH3CO +#define R227 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.200000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 1.890093208e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iCH3CO, /* nu = */ 1 } \ + } \ + } + +// R 228: CH3CHO + HO2 <=> CH3CO + H2O2 +#define R228 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.100000000e-02, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 5.132840981e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 } \ + } \ + } + +// R 229: CH3CHO + CH3 <=> CH3CO + CH4 +#define R229 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.720000000e+00, \ + /* n = */ 1.770000000e+00, \ + /* EovR = */ 2.979060648e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iCH3CHO, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3CO, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 230: C2H4 (+ M) <=> H2 + H2CC (+ M) +#define R230 { \ + /* ArrCoeffL = */ { \ + /* A = */ 3.710000000e+10, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.412634745e+04, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 3.985000000e+15, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.381030744e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 1, \ + /* Npducts = */ 2, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iH2CC, /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.01 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ + /* Ftype = */ F_Lindemann, \ + /* FOData = */ { .Lindemann = { \ + /* dummy = */ 0, \ + } } \ + } + +// R 231: C2H4 + H (+ M) <=> C2H5 (+ M) +#define R231 { \ + /* ArrCoeffL = */ { \ + /* A = */ 2.900000000e+27, \ + /* n = */ -6.642000000e+00, \ + /* EovR = */ 2.903074473e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 1.232000000e+03, \ + /* n = */ 1.463000000e+00, \ + /* EovR = */ 6.818626990e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 4.92 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 1.569000000e+00, \ +/* T1 = */ 2.990000000e+02, \ +/* T2 = */ 1.524000000e+02, \ +/* T3 = */ -9.147000000e+03 \ + }} \ + } + +// R 232: C2H4 + H <=> C2H3 + H2 +#define R232 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.201000000e-04, \ + /* n = */ 3.620000000e+00, \ + /* EovR = */ 5.671286065e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 233: C2H4 + O <=> CH3 + HCO +#define R233 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.355000000e+00, \ + /* n = */ 1.880000000e+00, \ + /* EovR = */ 9.208920584e+01, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 234: C2H4 + O <=> H + CH2CHO +#define R234 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.700000000e+03, \ + /* n = */ 9.070000000e-01, \ + /* EovR = */ 4.222013317e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH2CHO, /* nu = */ 1 } \ + } \ + } + +// R 235: C2H4 + O <=> CH2 + CH2O +#define R235 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.400000000e-02, \ + /* n = */ 2.620000000e+00, \ + /* EovR = */ 2.309778442e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 236: C2H4 + OH <=> C2H3 + H2O +#define R236 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.144000000e-02, \ + /* n = */ 2.745000000e+00, \ + /* EovR = */ 1.115134864e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 237: C2H4 + OH <=> CH2O + CH3 +#define R237 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.780000000e-01, \ + /* n = */ 1.680000000e+00, \ + /* EovR = */ 1.036632590e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH2O, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + } \ + } + +// R 238: C2H4 + OH <=> H + CH3CHO +#define R238 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.380000000e-08, \ + /* n = */ 3.910000000e+00, \ + /* EovR = */ 8.670475501e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1 } \ + } \ + } + +// R 239: C2H4 + OH <=> H + CH3CHO +#define R239 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.190000000e-01, \ + /* n = */ 2.190000000e+00, \ + /* EovR = */ 2.644922765e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1 } \ + } \ + } + +// R 240: C2H4 + CH3 <=> C2H3 + CH4 +#define R240 { \ + /* ArrCoeff = */ { \ + /* A = */ 6.020000000e+01, \ + /* n = */ 1.560000000e+00, \ + /* EovR = */ 8.368543679e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H3, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 241: C2H4 + O2 <=> HO2 + C2H3 +#define R241 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.100000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 3.019821444e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H4, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iC2H3, /* nu = */ 1 } \ + } \ + } + +// R 242: C2H5 + H (+ M) <=> C2H6 (+ M) +#define R242 { \ + /* ArrCoeffL = */ { \ + /* A = */ 1.990000000e+29, \ + /* n = */ -7.080000000e+00, \ + /* EovR = */ 3.364023722e+03, \ + }, \ + /* ArrCoeffH = */ { \ + /* A = */ 5.210000000e+11, \ + /* n = */ -9.900000000e-01, \ + /* EovR = */ 7.950871324e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 1, \ + /* Nthirdb = */ 7, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ 0 , /* nu = */ 1 } \ + }, \ + /* thirdb = */ { \ + { /* ind = */ iC2H6, /* eff = */ 3.0 }, \ + { /* ind = */ iCH2O, /* eff = */ 2.5 }, \ + { /* ind = */ iCH3OH, /* eff = */ 3.0 }, \ + { /* ind = */ iCH4, /* eff = */ 2.0 }, \ + { /* ind = */ iCO , /* eff = */ 1.5 }, \ + { /* ind = */ iCO2, /* eff = */ 2.0 }, \ + { /* ind = */ iH2O, /* eff = */ 6.0 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 }, \ + { /* ind = */ 0 , /* eff = */ 1 } \ + }, \ +/* Ftype = */ F_Troe3, \ +/* FOData = */ { .Troe3 = { \ +/* alpha = */ 8.420000000e-01, \ +/* T1 = */ 2.219000000e+03, \ +/* T2 = */ 6.882000000e+03, \ +/* T3 = */ 1.250000000e+02 \ + }} \ + } + +// R 243: C2H5 + H <=> H2 + C2H4 +#define R243 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.810000000e+06, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH2 , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 244: C2H5 + O <=> CH3 + CH2O +#define R244 { \ + /* ArrCoeff = */ { \ + /* A = */ 4.420000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + } \ + } + +// R 245: C2H5 + O <=> H + CH3CHO +#define R245 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.890000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iH , /* nu = */ 1 }, \ + { /* ind = */ iCH3CHO, /* nu = */ 1 } \ + } \ + } + +// R 246: C2H5 + O <=> OH + C2H4 +#define R246 { \ + /* ArrCoeff = */ { \ + /* A = */ 2.940000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 247: C2H5 + O2 <=> HO2 + C2H4 +#define R247 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.355000000e+01, \ + /* n = */ 1.090000000e+00, \ + /* EovR = */ -9.938589155e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iHO2, /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 248: C2H5 + CH3 <=> CH4 + C2H4 +#define R248 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.000000000e+05, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 0.000000000e+00, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH4, /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 249: C2H5 + CH2O <=> C2H6 + HCO +#define R249 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.500000000e-03, \ + /* n = */ 2.810000000e+00, \ + /* EovR = */ 2.948867466e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iCH2O, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iHCO, /* nu = */ 1 } \ + } \ + } + +// R 250: C2H5 + CH3OH <=> C2H6 + CH2OH +#define R250 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.200000000e-05, \ + /* n = */ 3.200000000e+00, \ + /* EovR = */ 3.610601377e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iCH3OH, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iCH2OH, /* nu = */ 1 } \ + } \ + } + +// R 251: C2H6 + H <=> C2H5 + H2 +#define R251 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.133000000e+02, \ + /* n = */ 1.900000000e+00, \ + /* EovR = */ 3.789244372e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iH2 , /* nu = */ 1 } \ + } \ + } + +// R 252: C2H6 + O <=> OH + C2H5 +#define R252 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.763000000e-01, \ + /* n = */ 2.800000000e+00, \ + /* EovR = */ 2.920183943e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iO , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iOH , /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 } \ + } \ + } + +// R 253: C2H6 + OH <=> C2H5 + H2O +#define R253 { \ + /* ArrCoeff = */ { \ + /* A = */ 9.463000000e+00, \ + /* n = */ 2.000000000e+00, \ + /* EovR = */ 5.002003858e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iOH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iH2O, /* nu = */ 1 } \ + } \ + } + +// R 254: C2H6 + CH <=> CH3 + C2H4 +#define R254 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.077000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -1.318435625e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iCH , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iC2H4, /* nu = */ 1 } \ + } \ + } + +// R 255: C2H6 + CH2(S) <=> CH3 + C2H5 +#define R255 { \ + /* ArrCoeff = */ { \ + /* A = */ 3.300000000e+07, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ -3.321250047e+02, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iCH2_S, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iCH3, /* nu = */ 1 }, \ + { /* ind = */ iC2H5, /* nu = */ 1 } \ + } \ + } + +// R 256: C2H6 + CH3 <=> C2H5 + CH4 +#define R256 { \ + /* ArrCoeff = */ { \ + /* A = */ 5.600000000e+04, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 4.740329612e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 257: C2H6 + CH3 <=> C2H5 + CH4 +#define R257 { \ + /* ArrCoeff = */ { \ + /* A = */ 8.299000000e+08, \ + /* n = */ 0.000000000e+00, \ + /* EovR = */ 1.120167061e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iCH3, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iCH4, /* nu = */ 1 } \ + } \ + } + +// R 258: C2H6 + O2 <=> C2H5 + HO2 +#define R258 { \ + /* ArrCoeff = */ { \ + /* A = */ 7.290000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 2.473828065e+04, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iO2 , /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + } \ + } + +// R 259: C2H6 + HO2 <=> C2H5 + H2O2 +#define R259 { \ + /* ArrCoeff = */ { \ + /* A = */ 1.100000000e-01, \ + /* n = */ 2.500000000e+00, \ + /* EovR = */ 8.479252013e+03, \ + }, \ + /* has_backward = */ true, \ + /* Neducts = */ 2, \ + /* Npducts = */ 2, \ + /* educts = */ { \ + { /* ind = */ iC2H6, /* nu = */ 1 }, \ + { /* ind = */ iHO2, /* nu = */ 1 } \ + }, \ + /* pducts = */ { \ + { /* ind = */ iC2H5, /* nu = */ 1 }, \ + { /* ind = */ iH2O2, /* nu = */ 1 } \ + } \ + } + + +//--------------------------------- +// Initialization function +//--------------------------------- + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : +species({H2, H, O, O2, OH, H2O, HO2, H2O2, + CO, CO2, C, CH, CH2, CH2_S, CH3, CH4, + HCO, CH2O, CH2OH, CH3O, CH3OH, C2H, C2H2, C2H3, + C2H4, C2H5, C2H6, HCCO, CH2CO, CH2CHO, CH3CHO, CH3CO, + H2CC }), +reactions({R1, R2, R3, R4, R5, R10, R12, R13, + R14, R15, R16, R17, R18, R19, R21, R22, + R23, R24, R25, R27, R28, R29, R30, R32, + R33, R34, R35, R36, R37, R38, R39, R40, + R41, R42, R44, R45, R46, R47, R48, R50, + R52, R53, R54, R55, R56, R57, R58, R59, + R60, R61, R62, R63, R64, R65, R66, R67, + R68, R69, R70, R72, R73, R74, R75, R76, + R77, R80, R81, R82, R83, R84, R85, R86, + R87, R88, R89, R91, R92, R94, R95, R96, + R97, R98, R99, R100, R101, R102, R103, R104, + R106, R107, R108, R111, R112, R113, R114, R115, + R116, R117, R118, R119, R122, R123, R124, R125, + R126, R127, R128, R129, R130, R131, R132, R133, + R134, R135, R136, R137, R138, R139, R140, R141, + R142, R143, R144, R145, R146, R147, R148, R149, + R150, R151, R152, R153, R154, R155, R156, R158, + R159, R160, R161, R162, R163, R164, R165, R166, + R167, R168, R171, R172, R173, R174, R175, R176, + R177, R178, R180, R181, R182, R183, R184, R185, + R186, R187, R188, R189, R191, R192, R193, R194, + R195, R196, R197, R198, R199, R200, R203, R204, + R205, R206, R207, R208, R209, R212, R213, R214, + R215, R216, R217, R218, R219, R222, R223, R224, + R225, R226, R227, R228, R229, R232, R233, R234, + R235, R236, R237, R238, R239, R240, R241, R243, + R244, R245, R246, R247, R248, R249, R250, R251, + R252, R253, R254, R255, R256, R257, R258, R259 + }), +ThirdbodyReactions({R6, R7, R8, R9, R31 }), +FalloffReactions({R11, R20, R26, R43, R49, R51, R71, R78, + R79, R90, R93, R105, R109, R110, R120, R121, + R157, R169, R170, R179, R190, R201, R202, R210, + R211, R220, R221, R230, R231, R242 }) +{ +// This executable is expecting FFCM-1Mix in the input file +assert(config.Flow.mixture.type == MixtureModel_FFCM1Mix); + +// Store reference quantities +StoreReferenceQuantities(config.Flow.mixture.u.FFCM1Mix.PRef, + config.Flow.mixture.u.FFCM1Mix.TRef, + config.Flow.mixture.u.FFCM1Mix.LRef, + config.Flow.mixture.u.FFCM1Mix.XiRef); +}; +#endif + +//--------------------------------- +// Cleanup +//--------------------------------- + +#undef iH2 +#undef H2 +#undef iH +#undef H +#undef iO +#undef O +#undef iO2 +#undef O2 +#undef iOH +#undef OH +#undef iH2O +#undef H2O +#undef iHO2 +#undef HO2 +#undef iH2O2 +#undef H2O2 +#undef iCO +#undef CO +#undef iCO2 +#undef CO2 +#undef iC +#undef C +#undef iCH +#undef CH +#undef iCH2 +#undef CH2 +#undef iCH2_S +#undef CH2_S +#undef iCH3 +#undef CH3 +#undef iCH4 +#undef CH4 +#undef iHCO +#undef HCO +#undef iCH2O +#undef CH2O +#undef iCH2OH +#undef CH2OH +#undef iCH3O +#undef CH3O +#undef iCH3OH +#undef CH3OH +#undef iC2H +#undef C2H +#undef iC2H2 +#undef C2H2 +#undef iC2H3 +#undef C2H3 +#undef iC2H4 +#undef C2H4 +#undef iC2H5 +#undef C2H5 +#undef iC2H6 +#undef C2H6 +#undef iHCCO +#undef HCCO +#undef iCH2CO +#undef CH2CO +#undef iCH2CHO +#undef CH2CHO +#undef iCH3CHO +#undef CH3CHO +#undef iCH3CO +#undef CH3CO +#undef iH2CC +#undef H2CC + +#undef R1 +#undef R2 +#undef R3 +#undef R4 +#undef R5 +#undef R6 +#undef R7 +#undef R8 +#undef R9 +#undef R10 +#undef R11 +#undef R12 +#undef R13 +#undef R14 +#undef R15 +#undef R16 +#undef R17 +#undef R18 +#undef R19 +#undef R20 +#undef R21 +#undef R22 +#undef R23 +#undef R24 +#undef R25 +#undef R26 +#undef R27 +#undef R28 +#undef R29 +#undef R30 +#undef R31 +#undef R32 +#undef R33 +#undef R34 +#undef R35 +#undef R36 +#undef R37 +#undef R38 +#undef R39 +#undef R40 +#undef R41 +#undef R42 +#undef R43 +#undef R44 +#undef R45 +#undef R46 +#undef R47 +#undef R48 +#undef R49 +#undef R50 +#undef R51 +#undef R52 +#undef R53 +#undef R54 +#undef R55 +#undef R56 +#undef R57 +#undef R58 +#undef R59 +#undef R60 +#undef R61 +#undef R62 +#undef R63 +#undef R64 +#undef R65 +#undef R66 +#undef R67 +#undef R68 +#undef R69 +#undef R70 +#undef R71 +#undef R72 +#undef R73 +#undef R74 +#undef R75 +#undef R76 +#undef R77 +#undef R78 +#undef R79 +#undef R80 +#undef R81 +#undef R82 +#undef R83 +#undef R84 +#undef R85 +#undef R86 +#undef R87 +#undef R88 +#undef R89 +#undef R90 +#undef R91 +#undef R92 +#undef R93 +#undef R94 +#undef R95 +#undef R96 +#undef R97 +#undef R98 +#undef R99 +#undef R100 +#undef R101 +#undef R102 +#undef R103 +#undef R104 +#undef R105 +#undef R106 +#undef R107 +#undef R108 +#undef R109 +#undef R110 +#undef R111 +#undef R112 +#undef R113 +#undef R114 +#undef R115 +#undef R116 +#undef R117 +#undef R118 +#undef R119 +#undef R120 +#undef R121 +#undef R122 +#undef R123 +#undef R124 +#undef R125 +#undef R126 +#undef R127 +#undef R128 +#undef R129 +#undef R130 +#undef R131 +#undef R132 +#undef R133 +#undef R134 +#undef R135 +#undef R136 +#undef R137 +#undef R138 +#undef R139 +#undef R140 +#undef R141 +#undef R142 +#undef R143 +#undef R144 +#undef R145 +#undef R146 +#undef R147 +#undef R148 +#undef R149 +#undef R150 +#undef R151 +#undef R152 +#undef R153 +#undef R154 +#undef R155 +#undef R156 +#undef R157 +#undef R158 +#undef R159 +#undef R160 +#undef R161 +#undef R162 +#undef R163 +#undef R164 +#undef R165 +#undef R166 +#undef R167 +#undef R168 +#undef R169 +#undef R170 +#undef R171 +#undef R172 +#undef R173 +#undef R174 +#undef R175 +#undef R176 +#undef R177 +#undef R178 +#undef R179 +#undef R180 +#undef R181 +#undef R182 +#undef R183 +#undef R184 +#undef R185 +#undef R186 +#undef R187 +#undef R188 +#undef R189 +#undef R190 +#undef R191 +#undef R192 +#undef R193 +#undef R194 +#undef R195 +#undef R196 +#undef R197 +#undef R198 +#undef R199 +#undef R200 +#undef R201 +#undef R202 +#undef R203 +#undef R204 +#undef R205 +#undef R206 +#undef R207 +#undef R208 +#undef R209 +#undef R210 +#undef R211 +#undef R212 +#undef R213 +#undef R214 +#undef R215 +#undef R216 +#undef R217 +#undef R218 +#undef R219 +#undef R220 +#undef R221 +#undef R222 +#undef R223 +#undef R224 +#undef R225 +#undef R226 +#undef R227 +#undef R228 +#undef R229 +#undef R230 +#undef R231 +#undef R232 +#undef R233 +#undef R234 +#undef R235 +#undef R236 +#undef R237 +#undef R238 +#undef R239 +#undef R240 +#undef R241 +#undef R242 +#undef R243 +#undef R244 +#undef R245 +#undef R246 +#undef R247 +#undef R248 +#undef R249 +#undef R250 +#undef R251 +#undef R252 +#undef R253 +#undef R254 +#undef R255 +#undef R256 +#undef R257 +#undef R258 +#undef R259 + +#endif + +#endif // __FFCM1MIX_HPP__ diff --git a/src/Mixtures/IsentropicMix.hpp b/src/Mixtures/IsentropicMix.hpp new file mode 100644 index 0000000..30bba5e --- /dev/null +++ b/src/Mixtures/IsentropicMix.hpp @@ -0,0 +1,202 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef IsentropicMix_HPP +#define IsentropicMix_HPP + +#include "config_schema.h" +#include "constants.h" + +// Number of species +#define nSpec 1 +// Number of charged species +#define nIons 0 + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +#ifndef __CONST__ +#ifdef __CUDACC__ +#define __CONST__ +#else +#define __CONST__ const +#endif +#endif + +#ifdef __cplusplus + // We cannot expose these structs to Regent + #include "my_array.hpp" + + // Define type for the array that will contain the species + typedef MyArray VecNSp; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct Mix { + // Mixture properties + __CONST__ double R; + __CONST__ double gamma; + +#ifdef __cplusplus + // We cannot expose these methods to Regent + +#ifndef __CUDACC__ + inline Mix(const Config &config); +#endif + + inline char* GetSpeciesName(const int i) const; + + inline int FindSpecies(const char *Name) const; + + __CUDA_HD__ + inline bool CheckMixture(const VecNSp &Yi) const; + + __CUDA_HD__ + inline void ClipYi(VecNSp &Yi) const {}; + + __CUDA_HD__ + inline double GetMolarWeightFromYi(const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetMolarWeightFromXi(const VecNSp &Xi) const; + + __CUDA_HD__ + inline void GetMolarFractions(VecNSp &Xi, const double MixW, const VecNSp &Yi) const; + + __CUDA_HD__ + inline void GetMassFractions(VecNSp &Yi, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetRhoFromRhoYi(const VecNSp &rhoYi) const; + + __CUDA_HD__ + inline void GetRhoYiFromYi(VecNSp &rhoYi, const double rho, const VecNSp &Yi) const; + + __CUDA_HD__ + inline void GetYi(VecNSp &Yi, const double rho, const VecNSp &rhoYi) const; + + __CUDA_HD__ + inline double GetRho(const double P, const double T, const double MixW) const; + + __CUDA_HD__ + inline double GetHeatCapacity(const double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetEnthalpy(const double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetSpeciesEnthalpy(const int i, const double T) const; + + __CUDA_HD__ + inline double GetSpeciesMolarWeight(const int i) const; + + __CUDA_HD__ + inline double GetInternalEnergy(const double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetSpecificInternalEnergy(const int i, const double T) const; + + __CUDA_HD__ + inline double GetTFromInternalEnergy(const double e0, double T, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double isValidInternalEnergy(const double e, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetTFromRhoAndP(const double rho, const double MixW, const double P) const; + + __CUDA_HD__ + inline double GetPFromRhoAndT(const double rho, const double MixW, const double T) const; + + __CUDA_HD__ + inline double GetViscosity(const double T, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetHeatConductivity(const double T, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetGamma(const double T, const double MixW, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetSpeedOfSound(const double T, const double gamma, const double MixW) const; + + __CUDA_HD__ + inline void GetDiffusivity(VecNSp &Di, const double P, const double T, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetPartialElectricChargeDensity(const uint8_t i, const double rhon, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline double GetElectricChargeDensity(const double rhon, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline int8_t GetSpeciesChargeNumber(const int i) const; + + __CUDA_HD__ + inline double GetDielectricPermittivity() const; + + __CUDA_HD__ + inline void GetProductionRates(VecNSp &w, const double rhon, const double Pn, const double Tn, const VecNSp &Yi) const; + + __CUDA_HD__ + inline double Getdpde(const double rho, const double gamma) const; + + __CUDA_HD__ + inline void Getdpdrhoi(VecNSp &dpdrhoi, const double gamma, const double T, const VecNSp &Yi) const; + +#endif // __cplusplus + +}; + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +// We cannot expose these methods to Regent +#include "IsentropicMix.inl" +#endif + +#endif // IsentropicMix_HPP diff --git a/src/Mixtures/IsentropicMix.inl b/src/Mixtures/IsentropicMix.inl new file mode 100644 index 0000000..ff9e6f3 --- /dev/null +++ b/src/Mixtures/IsentropicMix.inl @@ -0,0 +1,146 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __CUDACC__ +inline Mix::Mix(const Config &config) : + R(config.Flow.mixture.u.IsentropicMix.gasConstant), + gamma(config.Flow.mixture.u.IsentropicMix.gamma) +{ + // This executable is expecting IsentropicMix in the input file + assert(config.Flow.mixture.type == MixtureModel_IsentropicMix); +}; +#endif + +inline char* Mix::GetSpeciesName(const int i) const { + return (char*)"MIX"; +}; + +inline int Mix::FindSpecies(const char *Name) const { + return 0; +}; + +__CUDA_HD__ +inline bool Mix::CheckMixture(const VecNSp &Yi) const { +#ifdef CHECK_MIX + return (fabs(Yi[0] - 1.0) < 1e-3); +#else + return true; +#endif +}; + +__CUDA_HD__ +inline double Mix::GetMolarWeightFromYi(const VecNSp &Yi) const { return RGAS/R; } + +__CUDA_HD__ +inline double Mix::GetMolarWeightFromXi(const VecNSp &Xi) const { return RGAS/R; } + +__CUDA_HD__ +inline void Mix::GetMolarFractions(VecNSp &Xi, const double MixW, const VecNSp &Yi) const { Xi[0] = Yi[0]; } + +__CUDA_HD__ +inline void Mix::GetMassFractions(VecNSp &Yi, const double MixW, const VecNSp &Xi) const { Yi[0] = Xi[0]; } + +__CUDA_HD__ +inline double Mix::GetRhoFromRhoYi(const VecNSp &rhoYi) const { return rhoYi[0]; } + +__CUDA_HD__ +inline void Mix::GetRhoYiFromYi(VecNSp &rhoYi, const double rho, const VecNSp &Yi) const { rhoYi[0] = rho*Yi[0]; } + +__CUDA_HD__ +inline void Mix::GetYi(VecNSp &Yi, const double rho, const VecNSp &rhoYi) const { Yi[0] = rhoYi[0]/rho; }; + +__CUDA_HD__ +inline double Mix::GetRho(const double P, const double T, const double MixW) const { return pow(T, 1.0/(gamma-1)); }; + +__CUDA_HD__ +inline double Mix::GetHeatCapacity(const double T, const VecNSp &Yi) const { return gamma/(gamma-1)*R; }; + +__CUDA_HD__ +inline double Mix::GetEnthalpy(const double T, const VecNSp &Yi) const { return gamma/(gamma-1)*R*T; }; + +__CUDA_HD__ +inline double Mix::GetSpeciesEnthalpy(const int i, const double T) const { return T*R*gamma/(gamma-1.0); }; + +__CUDA_HD__ +inline double Mix::GetSpeciesMolarWeight(const int i) const { return RGAS/R; }; + +__CUDA_HD__ +inline double Mix::GetInternalEnergy(const double T, const VecNSp &Yi) const { return T*R/(gamma-1.0); }; + +__CUDA_HD__ +inline double Mix::GetSpecificInternalEnergy(const int i, const double T) const { return T*R/(gamma-1.0); }; + +__CUDA_HD__ +inline double Mix::GetTFromInternalEnergy(const double e0, double T, const VecNSp &Yi) const { return e0*(gamma-1.0)/R; }; + +__CUDA_HD__ +inline double Mix::isValidInternalEnergy(const double e, const VecNSp &Yi) const { return (e > 0); }; + +__CUDA_HD__ +inline double Mix::GetTFromRhoAndP(const double rho, const double MixW, const double P) const { return P*MixW/(rho*RGAS); }; + +__CUDA_HD__ +inline double Mix::GetPFromRhoAndT(const double rho, const double MixW, const double T) const { return rho*RGAS*T/MixW; }; + +__CUDA_HD__ +inline double Mix::GetViscosity(const double T, const VecNSp &Xi) const { return 0.0; }; + +__CUDA_HD__ +inline double Mix::GetHeatConductivity(const double T, const VecNSp &Xi) const { return 0.0; }; + +__CUDA_HD__ +inline double Mix::GetGamma(const double T, const double MixW, const VecNSp &Yi) const { return gamma; }; + +__CUDA_HD__ +inline double Mix::GetSpeedOfSound(const double T, const double gamma, const double MixW) const { return sqrt(gamma*R*T); }; + +__CUDA_HD__ +inline void Mix::GetDiffusivity(VecNSp &Di, const double P, const double T, const double MixW, const VecNSp &Xi) const { Di[0] = 0.0; }; + +__CUDA_HD__ +inline double Mix::GetPartialElectricChargeDensity(const uint8_t i, const double rhon, const double MixW, const VecNSp &Xi) const { return 0.0; }; + +__CUDA_HD__ +inline double Mix::GetElectricChargeDensity(const double rhon, const double MixW, const VecNSp &Xi) const { return 0.0; }; + +__CUDA_HD__ +inline int8_t Mix::GetSpeciesChargeNumber(const int i) const { return 0; }; + +__CUDA_HD__ +inline double Mix::GetDielectricPermittivity() const { return eps_0; }; + +__CUDA_HD__ +inline void Mix::GetProductionRates(VecNSp &w, const double rhon, const double Pn, const double Tn, const VecNSp &Yi) const { w[0] = 0.0; }; + +__CUDA_HD__ +inline double Mix::Getdpde(const double rho, const double gamma) const { return rho*(gamma - 1); }; + +__CUDA_HD__ +inline void Mix::Getdpdrhoi(VecNSp &dpdrhoi, const double gamma, const double T, const VecNSp &Yi) const { dpdrhoi[0] = R*T; }; + diff --git a/src/Mixtures/MultiComponent.hpp b/src/Mixtures/MultiComponent.hpp new file mode 100644 index 0000000..40a96e9 --- /dev/null +++ b/src/Mixtures/MultiComponent.hpp @@ -0,0 +1,299 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef MultiComponent_HPP +#define MultiComponent_HPP + +#ifndef nSpec + #error "nSpec is undefined" +#endif + +//#ifndef nReac +// #error "nReac is undefined" +//#endif + +//#ifndef nTBReac +// #error "nTBReac is undefined" +//#endif + +//#ifndef nFOReac +// #error "nFOReac is undefined" +//#endif + +#ifndef MAX_NUM_REACTANTS + #error "MAX_NUM_REACTANTS is undefined" +#endif + +#ifndef MAX_NUM_TB + #error "MAX_NUM_TB is undefined" +#endif + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +#ifndef __CONST__ +#ifdef __CUDACC__ +#define __CONST__ +#else +#define __CONST__ const +#endif +#endif + +#undef CHECK_MIX + +#include +#include "config_schema.h" +#include "constants.h" +#include "Species.hpp" +#include "Reaction.hpp" + +#ifdef __cplusplus + // We cannot expose these structs to Regent + #include "my_array.hpp" + + #ifndef __CUDACC__ + using std::max; + using std::min; + #endif + + // Define type for the array that will contain the species + typedef MyArray VecNSp; +#if (nIons > 0) + typedef MyArray VecNIo; +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct Mix { + __CONST__ struct Spec species[nSpec]; +#if (nIons > 0) + __CONST__ uint8_t ions[nIons]; // Stores a list of the indices of the ions +#endif +#if (nReac > 0) + __CONST__ struct Reaction reactions[nReac]; +#endif +#if (nTBReac > 0) + __CONST__ struct ThirdbodyReaction ThirdbodyReactions[nTBReac]; +#endif +#if (nFOReac > 0) + __CONST__ struct FalloffReaction FalloffReactions[nFOReac]; +#endif + // Normalization quantities + double PRef; // Reference pressure + double TRef; // Reference temperature + double XiRef[nSpec]; // Reference molar fractions + double MixWRef; // Reference mean molecular weight + double iMixWRef; // Inverse of the reference mean molecular weight + double rhoRef; // Reference density + double ieRef; // Inverse of the reference energy scale + double iuRef; // Inverse of the reference velocity scale + double iCpRef; // Inverse of the reference heat capacity scale + double imuRef; // Inverse of the reference viscosity scale + double ilamRef; // Inverse of the reference heat conductivity scale + double iDiRef; // Inverse of the reference species diffusivity scale + double iwiRef; // Inverse of the reference chemical production rate scale + double iKiRef; // Inverse of the reference species electric mobility scale + double Eps0; // Normalized dielectric permittivity of the vacuum + // Max an min acceptable temperatures + double TMax; + double TMin; + +#ifdef __cplusplus + // We cannot expose these methods to Regent + +#ifndef __CUDACC__ + inline Mix(const Config &config); +#endif + + inline char* GetSpeciesName(const int i) const; + + inline int FindSpecies(const char *Name) const; + + __CUDA_HD__ + inline bool CheckMixture(const VecNSp &Yi) const; + + __CUDA_HD__ + inline void ClipYi(VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetMolarWeightFromYi(const VecNSp &Yi) const; + + __CUDA_HD__ + inline double GetMolarWeightFromXi(const VecNSp &Xi) const; + + __CUDA_HD__ + inline void GetMolarFractions(VecNSp &Xi, const double MixW, const VecNSp &Yi) const; + + __CUDA_HD__ + inline void GetMassFractions(VecNSp &Yi, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline void GetYi(VecNSp &Yi, const double rho, const VecNSp &rhoYi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetRhoFromRhoYi(const VecNSp &rhoYi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline void GetRhoYiFromYi(VecNSp &rhoYi, const double rho, const VecNSp &Yi) const; + + // Returns rho in physical units + __CUDA_HD__ + inline double GetRhoRef(const double P, const double T, const double MixW) const; + + // Returns rho in computational units + __CUDA_HD__ + inline double GetRho(const double P, const double T, const double MixW) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetHeatCapacity(const double T, const VecNSp &Yi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetEnthalpy(const double T, const VecNSp &Yi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetSpeciesEnthalpy(const int i, const double T) const; + + __CUDA_HD__ + inline double GetSpeciesMolarWeight(const int i) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetInternalEnergy(const double T, const VecNSp &Yi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetSpecificInternalEnergy(const int i, const double T) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetTFromInternalEnergy(const double e0, double T, const VecNSp &Yi) const; + + // The input are in computational units + __CUDA_HD__ + inline double isValidInternalEnergy(const double e, const VecNSp &Yi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetTFromRhoAndP(const double rho, const double MixW, const double P) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetPFromRhoAndT(const double rho, const double MixW, const double T) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetViscosity(const double T, const VecNSp &Xi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetHeatConductivity(const double T, const VecNSp &Xi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetGamma(const double T, const double MixW, const VecNSp &Yi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetSpeedOfSound(const double T, const double gamma, const double MixW) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline void GetDiffusivity(VecNSp &Di, const double P, const double T, const double MixW, const VecNSp &Xi) const; + +#if (nIons > 0) + // The input and the outputs are in computational units + __CUDA_HD__ + inline void GetElectricMobility(VecNIo &Ki, const double Pn, const double Tn, const VecNSp &Xi) const; +#endif + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetPartialElectricChargeDensity(const uint8_t i, const double rhon, const double MixW, const VecNSp &Xi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double GetElectricChargeDensity(const double rhon, const double MixW, const VecNSp &Xi) const; + + __CUDA_HD__ + inline int8_t GetSpeciesChargeNumber(const int i) const; + + // The output is in computational units + __CUDA_HD__ + inline double GetDielectricPermittivity() const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline void GetProductionRates(VecNSp &w, const double rhon, const double Pn, const double Tn, const VecNSp &Yi) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline double Getdpde(const double rho, const double gamma) const; + + // The input and the outputs are in computational units + __CUDA_HD__ + inline void Getdpdrhoi(VecNSp &dpdrhoi, const double gamma, const double T, const VecNSp &Yi) const; + +private: + + inline void StoreReferenceQuantities(const double PRef, const double TRef, const double LRef, const Mixture &XiRef); + +#endif // __cplusplus +}; + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +// We cannot expose these methods to Regent +#include "MultiComponent.inl" +#endif + +#endif // MultiComponent_HPP diff --git a/src/Mixtures/MultiComponent.inl b/src/Mixtures/MultiComponent.inl new file mode 100644 index 0000000..14ed02f --- /dev/null +++ b/src/Mixtures/MultiComponent.inl @@ -0,0 +1,476 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +inline char* Mix::GetSpeciesName(const int i) const { + return (char *)species[i].Name; +}; + +inline int Mix::FindSpecies(const char *Name) const { + int iSpec = -1; + for (int i=0; i < nSpec; i++) + if (strcmp(species[i].Name, Name) == 0) { + iSpec = i; + break; + } + // Species not found + assert(iSpec != -1); + return iSpec; +}; + +__CUDA_HD__ +inline bool Mix::CheckMixture(const VecNSp &Yi) const { +#ifdef CHECK_MIX + double tmp = 0.0; + __UNROLL__ + for (int i = 0; i GetInternalEnergy(TMin, Yi)) and + (e < GetInternalEnergy(TMax, Yi))); +}; + +// The inputs and the output are in computational units +__CUDA_HD__ +inline double Mix::GetTFromRhoAndP(const double rho, const double MixW, const double P) const { + return P*MixW*iMixWRef/rho; +}; + +// The inputs and the output are in computational units +__CUDA_HD__ +inline double Mix::GetPFromRhoAndT(const double rho, const double MixW, const double T) const { + return rho*T/(MixW*iMixWRef); +}; + +// The input and the outputs are in computational units +__CUDA_HD__ +inline double Mix::GetViscosity(const double Tn, const VecNSp &Xi) const { + // Use unscaled primitive variables + const double T = Tn*TRef; + + VecNSp muk; + __UNROLL__ + for (int i = 0; i invDi; + __UNROLL__ + for (int i = 0; i 0) +// The input and the outputs are in computational units +__CUDA_HD__ +inline void Mix::GetElectricMobility(VecNIo &Ki, const double Pn, const double Tn, const VecNSp &Xi) const { + // Use unscaled primitive variables + const double T = Tn*TRef; + const double P = Pn*PRef; + __UNROLL__ + for (int i = 0; i 0) + return rhon*MixWRef/MixW*species[i].nCrg*Xi[i]; +#else + return 0; +#endif +}; + +// The input and the outputs are in computational units +__CUDA_HD__ +inline double Mix::GetElectricChargeDensity(const double rhon, const double MixW, const VecNSp &Xi) const { + double rho_q = 0.0; +#if (nIons > 0) + __UNROLL__ + for (int i = 0; i 0) + return species[i].nCrg; +#else + return 0; +#endif +}; + +// The output is in computational units +__CUDA_HD__ +inline double Mix::GetDielectricPermittivity() const { + return Eps0; +}; + +// The inputs and the output are in computational units +__CUDA_HD__ +inline void Mix::GetProductionRates(VecNSp &w, const double rhon, const double Pn, const double Tn, const VecNSp &Yi) const { + // Use unscaled primitive variables + const double T = Tn*TRef; + const double P = Pn*PRef; + const double rho = rhon*rhoRef; + + VecNSp G; + VecNSp C; + __UNROLL__ + for (int i = 0; i 0) +#if (nReac < 50) + __UNROLL__ +#endif + for (int i = 0; i 0) +#if (nTBReac < 50) + __UNROLL__ +#endif + for (int i = 0; i 0) +#if (nFOReac < 50) + __UNROLL__ +#endif + for (int i = 0; iPRef = PRef; + this->TRef = TRef; + for (int i = 0; i < nSpec; i++) + this->XiRef[i] = 1.0e-60; + double check = 0.0; + for (unsigned int i = 0; i < XiRef.Species.length; i++) { + Species s = XiRef.Species.values[i]; + this->XiRef[FindSpecies((char*)(s.Name))] = s.MolarFrac; + check += s.MolarFrac; + } + // check that the specified mixture is correctly specified + assert(fabs(check - 1.0) < 1e-3); + // ... and the derived once + MixWRef = GetMolarWeightFromXi(this->XiRef); + iMixWRef = 1.0/MixWRef; + rhoRef = GetRhoRef(PRef, TRef, MixWRef); + ieRef = rhoRef/PRef; + iuRef = sqrt(ieRef); + iCpRef = MixWRef/RGAS; + imuRef = 1.0/(LRef*sqrt(PRef*rhoRef)); + ilamRef = MixWRef/(LRef*sqrt(PRef*rhoRef)*RGAS); + iDiRef = sqrt(rhoRef/PRef)/(LRef); + iwiRef = LRef/sqrt(rhoRef*PRef); + iKiRef = sqrt(PRef/rhoRef)*MixWRef/(Na*LRef*eCrg); + Eps0 = MixWRef/(rhoRef*Na*eCrg*LRef); + Eps0 = eps_0*PRef*Eps0*Eps0; + + // Set maximum and minimum temperature + TMax = 1e20; + TMin = 0.0; + for (int i = 0; i < nSpec; i++) { + TMax = min(TMax, species[i].cpCoeff.TMax/TRef); + TMin = max(TMin, species[i].cpCoeff.TMin/TRef); + } +}; + diff --git a/src/Mixtures/Reaction.hpp b/src/Mixtures/Reaction.hpp new file mode 100644 index 0000000..74c9cbc --- /dev/null +++ b/src/Mixtures/Reaction.hpp @@ -0,0 +1,252 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef Reaction_HPP +#define Reaction_HPP + +#include + +#ifndef nSpec + #error "nSpec is undefined" +#endif + +#ifndef MAX_NUM_REACTANTS + #error "MAX_NUM_REACTANTS is undefined" +#endif + +#ifndef MAX_NUM_PRODUCTS + #error "MAX_NUM_PRODUCTS is undefined" +#endif + +#ifndef MAX_NUM_TB + #error "MAX_NUM_TB is undefined" +#endif + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +#ifndef __CONST__ +#ifdef __CUDACC__ +#define __CONST__ +#else +#define __CONST__ const +#endif +#endif + +#include "constants.h" + +#ifdef __cplusplus + // We cannot expose these structs to Regent + #include "my_array.hpp" + + #ifndef __CUDACC__ + using std::max; + using std::min; + #endif + + // Define type for the array that will contain the species + typedef MyArray VecNSp; +#endif + +// F types +#define F_Lindemann 0 +#define F_Troe2 1 +#define F_Troe3 2 +#define F_SRI 3 + +#ifdef __cplusplus +extern "C" { +#endif + +// Generic reactant +struct Reactant { + __CONST__ uint8_t ind; // Index in the species vector + __CONST__ float nu; // Stoichiometric coefficient +#ifdef FWD_ORDERS + __CONST__ float ord; // Order of the reactant +#endif +}; + +// Generic product +struct Product { + __CONST__ uint8_t ind; // Index in the species vector + __CONST__ float nu; // Stoichiometric coefficient +}; + +// Generic collider +struct ThirdBd { + __CONST__ uint8_t ind; // Index in the species vector + __CONST__ float eff; // Efficiency as a third body +}; + +// Arrhenius coefficients +struct ArrheniusCoeff { + __CONST__ double A; // Pre-exponential factor [m^{3*(o-1)}/(mol^(o-1) s)] where o is the order fo the reaction + __CONST__ float n; // Temperature exponent + __CONST__ float EovR; // Activation energy [K] + +#ifdef __cplusplus + // We cannot expose these methods to Regent + + __CUDA_HD__ + inline double CompRateCoeff(const double T) const; +#endif +}; + +// Standard reaction +struct Reaction { + __CONST__ struct ArrheniusCoeff ArrCoeff; // Arrhenius coefficients + + __CONST__ bool has_backward; // Self-explenatory + + __CONST__ uint8_t Neducts; // number of reactants + __CONST__ uint8_t Npducts; // number of products + + __CONST__ struct Reactant educts[MAX_NUM_REACTANTS]; // List of reactants and stoichiometric coefficients + __CONST__ struct Product pducts[MAX_NUM_PRODUCTS]; // List of products and stoichiometric coefficients + +#ifdef __cplusplus + // We cannot expose these methods to Regent +private: + __CUDA_HD__ + inline double GetReactionRate(const double P, const double T, const VecNSp &C, const VecNSp &G) const; + +public: + __CUDA_HD__ + inline void AddProductionRates(VecNSp &w, const double P, const double T, const VecNSp &C, const VecNSp &G) const; +#endif +}; + +// Thirdbody reaction +struct ThirdbodyReaction { + __CONST__ struct ArrheniusCoeff ArrCoeff; // Arrhenius coefficients + + __CONST__ bool has_backward; // Self-explenatory + + __CONST__ uint8_t Neducts; // number of reactants + __CONST__ uint8_t Npducts; // number of products + __CONST__ uint8_t Nthirdb; // number of third bodies + + __CONST__ struct Reactant educts[MAX_NUM_REACTANTS]; // List of reactants and stoichiometric coefficients + __CONST__ struct Product pducts[MAX_NUM_PRODUCTS]; // List of products and stoichiometric coefficients + __CONST__ struct ThirdBd thirdb[MAX_NUM_TB]; // List of third bodies and efficiencies + +#ifdef __cplusplus + // We cannot expose these methods to Regent +private: + __CUDA_HD__ + inline double GetReactionRate(const double P, const double T, const VecNSp &C, const VecNSp &G) const; + +public: + __CUDA_HD__ + inline void AddProductionRates(VecNSp &w, const double P, const double T, const VecNSp &C, const VecNSp &G) const; +#endif +}; + +// Fall-off data structure +union FalloffData { + struct { + int __dummy; + } Lindemann; + struct { + float alpha; // Troe alpha coefficient + double T1; // Troe temperature 1 + double T3; // Troe temperature 3 + } Troe2; + struct { + float alpha; // Troe alpha coefficient + double T1; // Troe temperature 1 + double T2; // Troe temperature 2 + double T3; // Troe temperature 3 + } Troe3; + struct { + float A; + float B; + float C; + float D; + float E; + } SRI; +}; + +// Fall-off reaction structure +struct FalloffReaction { + __CONST__ struct ArrheniusCoeff ArrCoeffL; // Arrhenius coefficients for low pressure + __CONST__ struct ArrheniusCoeff ArrCoeffH; // Arrhenius coefficients for high pressure + + __CONST__ bool has_backward; // Self-explenatory + + __CONST__ uint8_t Neducts; // number of reactants + __CONST__ uint8_t Npducts; // number of products + __CONST__ uint8_t Nthirdb; // number of third bodies + + __CONST__ struct Reactant educts[MAX_NUM_REACTANTS]; // List of reactants and stoichiometric coefficients + __CONST__ struct Product pducts[MAX_NUM_PRODUCTS]; // List of products and stoichiometric coefficients + __CONST__ struct ThirdBd thirdb[MAX_NUM_TB]; // List of third bodies and efficiencies + + __CONST__ uint8_t Ftype; // type of Fall-off coefficient + __CONST__ union FalloffData FOdata; // Fall-off coefficient data + +#ifdef __cplusplus + // We cannot expose these methods to Regent +private: + __CUDA_HD__ + inline double computeF(const double Pr, const double T) const; + + __CUDA_HD__ + inline double GetReactionRate(const double P, const double T, const VecNSp &C, const VecNSp &G) const; + +public: + __CUDA_HD__ + inline void AddProductionRates(VecNSp &w, const double P, const double T, const VecNSp &C, const VecNSp &G) const; +#endif +}; + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +// We cannot expose these methods to Regent +#include "Reaction.inl" +#endif + +#endif // Reaction_HPP diff --git a/src/Mixtures/Reaction.inl b/src/Mixtures/Reaction.inl new file mode 100644 index 0000000..5e66a80 --- /dev/null +++ b/src/Mixtures/Reaction.inl @@ -0,0 +1,338 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//--------------------------------- +// Arrhenius coefficients +//--------------------------------- +__CUDA_HD__ +inline double ArrheniusCoeff::CompRateCoeff(const double T) const { + double Kf = A; + if ( n != 0.0 ) + Kf *= pow(T, n); + if ( EovR > 1e-5 ) + Kf *= exp(-EovR/T); + return Kf; +}; + +//--------------------------------- +// Basic utilities +//--------------------------------- +//-- Symbols that are going to be exported +//function Exports.Common(Reaction) local Exports = {} +// __demand(__inline) +// task Exports.AddEduct(r : Reaction, index : int, nu : double, ord : double) +// regentlib.assert(r.Neducts < MAX_NUM_REACTANTS, "Increase MAX_NUM_REACTANTS") +// r.educts[r.Neducts].ind = index +// r.educts[r.Neducts].nu = nu +// r.educts[r.Neducts].ord = ord +// r.Neducts += 1 +// return r +// end +// +// __demand(__inline) +// task Exports.AddPduct(r : Reaction, index : int, nu : double, ord : double) +// regentlib.assert(r.Npducts < MAX_NUM_REACTANTS, "Increase MAX_NUM_REACTANTS") +// r.pducts[r.Npducts].ind = index +// r.pducts[r.Npducts].nu = nu +// r.pducts[r.Npducts].ord = ord +// r.Npducts += 1 +// return r +// end +// +// __demand(__inline) +// task Exports.AddThirdb(r : Reaction, index : int, eff : double) +// regentlib.assert(r.Nthirdb < MAX_NUM_TB, "Increase MAX_NUM_TB") +// r.thirdb[r.Nthirdb].ind = index +// r.thirdb[r.Nthirdb].eff = eff +// r.Nthirdb += 1 +// return r +// end +// return Exports +//end + +// TODO: In order to avoid duplication of sources we should have a +// base reaction struct and derive each type of reaction from it +// Unfortunately we cannot do this kind of C++ stuff until we are based on Regent +template +__CUDA_HD__ +inline double CompBackwardRateCoeff(const Reac &r, const double Kf, const double P, const double T, const VecNSp &G) { + double sumNu = 0.0; + double sumNuG = 0.0; + __UNROLL__ + for (int i = 0; i < r.Neducts; i++) { + sumNu -= r.educts[i].nu; + sumNuG -= r.educts[i].nu*G[r.educts[i].ind]; + } + __UNROLL__ + for (int i = 0; i < r.Npducts; i++) { + sumNu += r.pducts[i].nu; + sumNuG += r.pducts[i].nu*G[r.pducts[i].ind]; + } + const double lnKc = - sumNuG - sumNu * ( log(T) + log(RGAS/P) ); + return Kf * exp(-lnKc); +} + +//--------------------------------- +// Standard reactions +//--------------------------------- +__CUDA_HD__ +inline double Reaction::GetReactionRate(const double P, const double T, const VecNSp &C, const VecNSp &G) const { + // Forward reaction rate + const double Kf = ArrCoeff.CompRateCoeff(T); + double a = 1.0; + __UNROLL__ + for (int i = 0; i < Neducts; i++) { + const int ind = educts[i].ind; +#ifdef FWD_ORDERS + if (educts[i].ord == 1) +#else + if (educts[i].nu == 1) +#endif + a *= C[ind]; + else +#ifdef FWD_ORDERS + a *= pow(C[ind], educts[i].ord); +#else + a *= pow(C[ind], educts[i].nu); +#endif + } + // Backward reaction rate + double Kb = 0.0; + double b = 1.0; + if (has_backward) { + Kb = CompBackwardRateCoeff(*this, Kf, P, T, G); + __UNROLL__ + for (int i = 0; i < Npducts; i++) { + const int ind = pducts[i].ind; + if (pducts[i].nu == 1) + b *= C[ind]; + else + b *= pow(C[ind], pducts[i].nu); + } + } + // Compute reaction rate + return (Kf*a - Kb*b); +} + +__CUDA_HD__ +inline void Reaction::AddProductionRates(VecNSp &w, const double P, const double T, const VecNSp &C, const VecNSp &G) const { + const double R = GetReactionRate(P, T, C, G); + __UNROLL__ + for (int i = 0; i < Neducts; i++) { + const int ind = educts[i].ind; + w[ind] -= educts[i].nu*R; + } + __UNROLL__ + for (int i = 0; i < Npducts; i++) { + const int ind = pducts[i].ind; + w[ind] += pducts[i].nu*R; + } +} + +//--------------------------------- +// Thirdbody reactions +//--------------------------------- +__CUDA_HD__ +inline double ThirdbodyReaction::GetReactionRate(const double P, const double T, const VecNSp &C, const VecNSp &G) const { + // Forward reaction rate + const double Kf = ArrCoeff.CompRateCoeff(T); + double a = 1.0; + __UNROLL__ + for (int i = 0; i < Neducts; i++) { + const int ind = educts[i].ind; +#ifdef FWD_ORDERS + if (educts[i].ord == 1) +#else + if (educts[i].nu == 1) +#endif + a *= C[ind]; + else +#ifdef FWD_ORDERS + a *= pow(C[ind], educts[i].ord); +#else + a *= pow(C[ind], educts[i].nu); +#endif + } + // Backward reaction rate + double Kb = 0.0; + double b = 1.0; + if (has_backward) { + Kb = CompBackwardRateCoeff(*this, Kf, P, T, G); + __UNROLL__ + for (int i = 0; i < Npducts; i++) { + const int ind = pducts[i].ind; + if (pducts[i].nu == 1) + b *= C[ind]; + else + b *= pow(C[ind], pducts[i].nu); + } + } + // Third body efficiency + double c = 1.0; + if (Nthirdb > 0) { + c = P/(RGAS*T); + __UNROLL__ + for (int i = 0; i < Nthirdb; i++) { + const int ind = thirdb[i].ind; + c += C[ind]*(thirdb[i].eff - 1.0); + } + } + // Compute reaction rate + return c*(Kf*a - Kb*b); +} + +__CUDA_HD__ +inline void ThirdbodyReaction::AddProductionRates(VecNSp &w, const double P, const double T, const VecNSp &C, const VecNSp &G) const { + const double R = GetReactionRate(P, T, C, G); + __UNROLL__ + for (int i = 0; i < Neducts; i++) { + const int ind = educts[i].ind; + w[ind] -= educts[i].nu*R; + } + __UNROLL__ + for (int i = 0; i < Npducts; i++) { + const int ind = pducts[i].ind; + w[ind] += pducts[i].nu*R; + } +} + +//--------------------------------- +// Fall-off reactions +//--------------------------------- + +__CUDA_HD__ +inline double FalloffReaction::computeF(const double Pr, const double T) const { + if (Ftype == F_Lindemann) + return 1.0; + + else if (Ftype == F_Troe2) { + const double Fc = (1 - FOdata.Troe2.alpha)*exp(-T/FOdata.Troe2.T3) + + FOdata.Troe2.alpha *exp(-T/FOdata.Troe2.T1); + const double d = 0.14; + const double n = 0.75 - 1.27*log10(Fc); + const double c = -0.4 - 0.67*log10(Fc); + const double a = log10(Pr) + c; + const double f = a/(n - d*a); + return pow(Fc, 1.0/(1 + f*f)); + + } + else if (Ftype == F_Troe3) { + const double Fc = (1 - FOdata.Troe3.alpha)*exp(-T/FOdata.Troe3.T3) + + FOdata.Troe3.alpha* exp(-T/FOdata.Troe3.T1) + + exp(- FOdata.Troe3.T2/T); + const double d = 0.14; + const double n = 0.75 - 1.27*log10(Fc); + const double c = -0.4 - 0.67*log10(Fc); + const double a = log10(Pr) + c; + const double f = a/(n - d*a); + return pow(Fc, 1.0/(1 + f*f)); + + } + else if (Ftype == F_SRI) { + const double logPr = log10(Pr); + const double X = 1.0/(1 + logPr*logPr); + const double w = FOdata.SRI.A*exp(-FOdata.SRI.B/T) + + exp(-T/FOdata.SRI.C); + return FOdata.SRI.D*pow(w, X)*pow(T, FOdata.SRI.E); + + } + else + assert(false); + return 0.0; +} + +__CUDA_HD__ +inline double FalloffReaction::GetReactionRate(const double P, const double T, const VecNSp &C, const VecNSp &G) const { + // Forward rate coefficient + const double KfH = ArrCoeffH.CompRateCoeff(T); + const double KfL = ArrCoeffL.CompRateCoeff(T); + // Reduced pressure + double Pr = P/(RGAS * T); + if (Nthirdb > 0) { + __UNROLL__ + for (int i = 0; i < Nthirdb; i++) { + const int ind = thirdb[i].ind; + Pr += C[ind]*(thirdb[i].eff - 1.0); + } + } + Pr *= (KfL/max(KfH, 1e-60)); + // Use Lindemann formula + double F = computeF(Pr, T); + const double Kf = KfH*(Pr/(1 + Pr))*F; + // Forward reaction rate + double a = 1.0; + __UNROLL__ + for (int i = 0; i < Neducts; i++) { + const int ind = educts[i].ind; +#ifdef FWD_ORDERS + if (educts[i].ord == 1) +#else + if (educts[i].nu == 1) +#endif + a *= C[ind]; + else +#ifdef FWD_ORDERS + a *= pow(C[ind], educts[i].ord); +#else + a *= pow(C[ind], educts[i].nu); +#endif + } + // Backward reaction rate + double Kb = 0.0; + double b = 1.0; + if (has_backward) { + Kb = CompBackwardRateCoeff(*this, Kf, P, T, G); + __UNROLL__ + for (int i = 0; i < Npducts; i++) { + const int ind = pducts[i].ind; + if (pducts[i].nu == 1) + b *= C[ind]; + else + b *= pow(C[ind], pducts[i].nu); + } + } + // Compute reaction rate + return Kf*a - Kb*b; +} + +__CUDA_HD__ +inline void FalloffReaction::AddProductionRates(VecNSp &w, const double P, const double T, const VecNSp &C, const VecNSp &G) const { + const double R = GetReactionRate(P, T, C, G); + __UNROLL__ + for (int i = 0; i < Neducts; i++) { + const int ind = educts[i].ind; + w[ind] -= educts[i].nu*R; + } + __UNROLL__ + for (int i = 0; i < Npducts; i++) { + const int ind = pducts[i].ind; + w[ind] += pducts[i].nu*R; + } +} + diff --git a/src/Mixtures/Species.hpp b/src/Mixtures/Species.hpp new file mode 100644 index 0000000..ff27220 --- /dev/null +++ b/src/Mixtures/Species.hpp @@ -0,0 +1,197 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef Species_HPP +#define Species_HPP + +#include +#include + +#include "constants.h" + +// We only consider constant electron mobilty for now +#ifndef eMob +#define eMob 0.4 // [m^2 / (V s)] +#endif + +#ifndef N_NASA_POLY + #error "N_NASA_POLY is undefined" +#endif + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +#ifndef __CONST__ +#ifdef __CUDACC__ +#define __CONST__ +#else +#define __CONST__ const +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// Species geometries +//enum SpeciesGeom { +// Atom, +// Linear, +// NonLinear +//}; +#define SpeciesGeom_Atom 0 +#define SpeciesGeom_Linear 1 +#define SpeciesGeom_NonLinear 3 + +// NASA polynomials data structure +struct cpCoefficients { + __CONST__ float TSwitch1; // Switch temperature between Low and Mid temperature polynomials + __CONST__ float TSwitch2; // Switch temperature between Mid and High temperature polynomials + __CONST__ float TMin; // Minimum temperature + __CONST__ float TMax; // Maximum temperature +#if (N_NASA_POLY == 3) + __CONST__ double cpH[9]; // High temperature polynomials +#endif + __CONST__ double cpM[9]; // Mid temperature polynomials + __CONST__ double cpL[9]; // Low temperature polynomials +}; + +// Coefficinets for diffusivity +struct DiffCoefficients { + __CONST__ uint8_t Geom; // = 0 (Atom), = 1 (Linear), = 2 (Non Linear) + __CONST__ double sigma; // Lennard-Jones collision diameter [m] + __CONST__ double kbOveps; // Boltzmann constant divided by Lennard-Jones potential well depth [1/K] + __CONST__ double mu; // Dipole moment [C*m] + __CONST__ double alpha; // Polarizabilty [m^3] + __CONST__ double Z298; // Rotational relaxation collision number +}; + +// Species structure +struct Spec { + __CONST__ char* Name; // Name of the species + __CONST__ double W; // Molar weight [kg/mol] + __CONST__ uint8_t inx; // Index in the species vector +#if (nIons > 0) + __CONST__ bool isElectron; // Flag that determines if the species is a free electron + __CONST__ int8_t nCrg; // Number of elementary charges +#endif + __CONST__ struct cpCoefficients cpCoeff; + __CONST__ struct DiffCoefficients DiffCoeff; + +#ifdef __cplusplus + // We cannot expose these methods to Regent + +private: + __CUDA_HD__ + inline double omega_mu(const double T) const; + + __CUDA_HD__ + inline double omega_D(const double T) const; + + __CUDA_HD__ + inline double omega_D_N64(const double T, const double gamma) const; + +public: + __CUDA_HD__ + inline double GetCp(const double T) const; + + __CUDA_HD__ + inline double GetFreeEnthalpy(const double T) const; + + __CUDA_HD__ + inline double GetEnthalpy(const double T) const; + + __CUDA_HD__ + inline double GetMu(const double T) const; + +private: + __CUDA_HD__ + inline void GetDifCollParam_Stock(double &sigmaij, double &omega11, + const Spec & i, const Spec & n, const double T) const; + +#if (nIons > 0) + __CUDA_HD__ + inline void GetDifCollParam_N64(double &sigmaij, double &omega11, + const Spec & i, const Spec & n, const double T) const; +#endif + +public: + __CUDA_HD__ + inline double GetDif(const Spec & s2, const double P, const double T) const; + + __CUDA_HD__ + inline double GetMob(const Spec & s2, const double P, const double T) const; + +private: + __CUDA_HD__ + inline double GetSelfDiffusion(const double T) const; + + __CUDA_HD__ + inline double GetFZrot(const double T) const; + + __CUDA_HD__ + inline double GetLamAtom(const double T) const; + + __CUDA_HD__ + inline double GetLamLinear(const double T) const; + + __CUDA_HD__ + inline double GetLamNonLinear(const double T) const; + +public: + __CUDA_HD__ + inline double GetLam(const double T) const; + +#endif +}; + +#ifdef __cplusplus +} +#endif + + +#ifdef __cplusplus +// We cannot expose these methods to Regent +#include "Species.inl" +#endif + +#endif // Species_HPP diff --git a/src/Mixtures/Species.inl b/src/Mixtures/Species.inl new file mode 100644 index 0000000..02aa64d --- /dev/null +++ b/src/Mixtures/Species.inl @@ -0,0 +1,357 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// omega_mu() returns the collision integral for mu given dimensionless temperature t/(eps/k). +// TODO: These come from FlameMaster. +// At a certain point, verify these implementations. +__CUDA_HD__ +inline double Spec::omega_mu(const double T) const { + const double m1 = 3.3530622607; + const double m2 = 2.53272006; + const double m3 = 2.9024238575; + const double m4 = 0.11186138893; + const double m5 = 0.8662326188; // = -0.1337673812 + 1.0 + const double m6 = 1.3913958626; + const double m7 = 3.158490576; + const double m8 = 0.18973411754; + const double m9 = 0.00018682962894; + + const double num = m1 + T*(m2 + T*(m3 + T*m4)); + const double den = m5 + T*(m6 + T*(m7 + T*(m8 + T*m9))); + return num / den; +}; + +// omega_D() returns the Stossintegral for a given dimensionless temperature t/(eps/k) +__CUDA_HD__ +inline double Spec::omega_D(const double T) const { + const double m1 = 6.8728271691; + const double m2 = 9.4122316321; + const double m3 = 7.7442359037; + const double m4 = 0.23424661229; + const double m5 = 1.45337701568; // = 1.0 + 0.45337701568 + const double m6 = 5.2269794238; + const double m7 = 9.7108519575; + const double m8 = 0.46539437353; + const double m9 = 0.00041908394781; + + const double num = m1 + T * (m2 + T * (m3 + T * m4)); + const double den = m5 + T * (m6 + T * (m7 + T * (m8 + T * m9))); + return num / den; +}; + +// Returns the (n,6,4) integral +__CUDA_HD__ +inline double Spec::omega_D_N64(const double T, const double gamma) const { + const double logtstar = log(T); + if (T <= 0.04) + // for interval 0.01 to 0.04, SSE = 0.006; R^2 = 1; RMSE = 0.020 + return 2.97 - 12.0 * gamma + - 0.887 * logtstar + + 3.86 * gamma * gamma + - 6.45 * gamma * logtstar + - 0.275 * logtstar * logtstar + + 1.20 * gamma * gamma * logtstar + - 1.24 * gamma * logtstar * logtstar + - 0.164 * logtstar*logtstar*logtstar; + else //if (T <= 1000) + // for interval 0.04 to 1000, SSE = 0.282; R^2 = 1; RMSE = 0.033 + return 1.22 - 0.0343 * gamma + + (-0.769 + 0.232 * gamma) * logtstar + + (0.306 - 0.165 * gamma) * logtstar * logtstar + + (-0.0465 + 0.0388 * gamma) * pow(logtstar, 3) + + (0.000614 - 0.00285 * gamma) * pow(logtstar, 4) + + 0.000238 * pow(logtstar, 5); +}; + +__CUDA_HD__ +inline double Spec::GetCp(const double T) const { + //assert(T < cpCoeff.TMax, "Exceeded maximum temeperature") + //assert(T > cpCoeff.TMin, "Exceeded minimum temeperature") + + const double rOvW = RGAS/W; + const double Tinv = 1.0/T; +#if (N_NASA_POLY == 3) + const double * cpC = ( T > cpCoeff.TSwitch2 ) ? cpCoeff.cpH : +#else + const double * cpC = +#endif + ( T > cpCoeff.TSwitch1 ) ? cpCoeff.cpM : + cpCoeff.cpL; + return rOvW*( cpC[0]*Tinv*Tinv + cpC[1]*Tinv + cpC[2] + T* + ( cpC[3] + T* + ( cpC[4] + T* + ( cpC[5] + T*cpC[6])))); +}; + +__CUDA_HD__ +inline double Spec::GetFreeEnthalpy(const double T) const { + // This is (H/(RT) - S/R) + //assert(T < cpCoeff.TMax, "Exceeded maximum temeperature") + //assert(T > cpCoeff.TMin, "Exceeded minimum temeperature") + + const double Tinv = 1.0/T; + const double logT = log(T); +#if (N_NASA_POLY == 3) + const double * cpC = ( T > cpCoeff.TSwitch2 ) ? cpCoeff.cpH : +#else + const double * cpC = +#endif + ( T > cpCoeff.TSwitch1 ) ? cpCoeff.cpM : + cpCoeff.cpL; + double G = -0.5*cpC[0]*Tinv*Tinv + cpC[1]*Tinv*(1.0 + logT) + cpC[2]*(1.0 - logT) + cpC[7]*Tinv - cpC[8]; + return G - 0.5*T*( cpC[3] + T* + ( cpC[4]/3 + T* + ( cpC[5]/6 + 0.1*T*cpC[6] ))); +}; + +__CUDA_HD__ +inline double Spec::GetEnthalpy(const double T) const { + //assert(T < cpCoeff.TMax, "Exceeded maximum temeperature") + //assert(T > cpCoeff.TMin, "Exceeded minimum temeperature") + + const double rOvW = RGAS/W; + const double Tinv = 1.0/T; +#if (N_NASA_POLY == 3) + const double * cpC = ( T > cpCoeff.TSwitch2 ) ? cpCoeff.cpH : +#else + const double * cpC = +#endif + ( T > cpCoeff.TSwitch1 ) ? cpCoeff.cpM : + cpCoeff.cpL; + const double E = -cpC[0]*Tinv + cpC[1]*log(T) + cpC[7] + T* + ( cpC[2] + T* + ( cpC[3]*0.50 + T* + ( cpC[4]/3 + T* + ( cpC[5]*0.25 + cpC[6]/5*T)))); + return E*rOvW; +}; + +__CUDA_HD__ +inline double Spec::GetMu(const double T) const { + const double num = 5 * sqrt(PI * W/Na * kb * T); + const double den = 16 * PI * pow(DiffCoeff.sigma,2) * omega_mu( T * DiffCoeff.kbOveps ); + return num/den; +}; + +// Return kinetic thory parametes for Stockmayer thory +__CUDA_HD__ +inline void Spec::GetDifCollParam_Stock(double &sigmaij, double &omega11, + const Spec & s1, const Spec & s2, const double T) const { + double xi = 1.0; + if ((s1.DiffCoeff.mu*s2.DiffCoeff.mu == 0.0) and + (s1.DiffCoeff.mu+s2.DiffCoeff.mu != 0.0)) { + // If I have a polar to non-polar molecule interaction + double mup; + double alp; + double epr; + if (s1.DiffCoeff.mu != 0.0) { + // s1 is the polar molecule and s2 is non-polar + mup = s1.DiffCoeff.mu/sqrt(4*PI*eps_0*kb*pow(s1.DiffCoeff.sigma, 3)/s1.DiffCoeff.kbOveps); + alp = s2.DiffCoeff.alpha/pow(s2.DiffCoeff.sigma,3); + epr = sqrt(s2.DiffCoeff.kbOveps/s1.DiffCoeff.kbOveps); + } else { + // s1 is the non-polar molecule and s2 is polar + mup = s2.DiffCoeff.mu/sqrt(4*PI*eps_0*kb*pow(s2.DiffCoeff.sigma, 3)/s2.DiffCoeff.kbOveps); + alp = s1.DiffCoeff.alpha/pow(s1.DiffCoeff.sigma,3); + epr = sqrt(s1.DiffCoeff.kbOveps/s2.DiffCoeff.kbOveps); + } + xi = 1 + 0.25*mup*alp*epr; + } + // Binary cross-section + sigmaij = 0.5*(DiffCoeff.sigma + s2.DiffCoeff.sigma)*pow(xi, -1./6); + // Collision integral + const double kboEpsij = sqrt(DiffCoeff.kbOveps * s2.DiffCoeff.kbOveps)/(xi*xi); + omega11 = omega_D(T * kboEpsij); +}; + +#if (nIons > 0) +// Return kinetic thory parametes for (n,6,4) thory +__CUDA_HD__ +inline void Spec::GetDifCollParam_N64(double &sigmaij, double &omega11, + const Spec & i, const Spec & n, const double T) const { + // Coefficients + constexpr double K1 = 1.767; + constexpr double K2 = 1.44; + constexpr double kappa = 0.095; + // Ratio or polarizzabilities + const double r_alpha = i.DiffCoeff.alpha/n.DiffCoeff.alpha; + // Ratio of dispersion to induction forces + const double xi = 1e15*i.DiffCoeff.alpha / (i.nCrg*i.nCrg * (1 + pow(2*r_alpha, 2.0/3)) * sqrt(n.DiffCoeff.alpha)); + // Binary cross-section + sigmaij = K1 * (pow(i.DiffCoeff.alpha, 1.0/3) + pow(n.DiffCoeff.alpha, 1./3)) / + pow(1e60*i.DiffCoeff.alpha*n.DiffCoeff.alpha*(1 + 1.0/xi), kappa); + // Well-depth + const double epsilon = K2 * eCrg*eCrg * i.nCrg*i.nCrg * n.DiffCoeff.alpha * (1 + xi) / (8 * PI * eps_0 * pow(sigmaij, 4)); + // Dispersion coefficients + const double C6n = exp(1.8846*log(n.DiffCoeff.alpha*1e30)-0.4737)*1e-50; + const double C6i = (i.nCrg > 0) ? exp(1.8853*log(i.DiffCoeff.alpha*1e30)+0.2682)*1e-50: + exp(3.2246*log(i.DiffCoeff.alpha*1e30)-3.2397)*1e-50; + // Binary dispersion coefficient + const double C6 = 2*C6i*C6n/(1.0/r_alpha * C6i + r_alpha * C6n); + const double gamma = (2*C6/(i.nCrg*i.nCrg) + 2*C6) / (n.DiffCoeff.alpha * sigmaij*sigmaij);//Dimensionless + // Collision integral + omega11 = omega_D_N64(T * kb / epsilon, gamma); +}; +#endif + +__CUDA_HD__ +inline double Spec::GetDif(const Spec & s2, const double P, const double T) const{ + double sigmaij; + double omega11; +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + // Electrons get the diffusivity based on the Einstein relations + if (isElectron or s2.isElectron) return eMob*kb*T/eCrg; + + const bool ion1 = ( nCrg != 0); + const bool ion2 = (s2.nCrg != 0); + if ((ion1 != ion2) && + (DiffCoeff.alpha != 0.0 && s2.DiffCoeff.alpha != 0.0)) + // Apply N-6,4 for charged-neutral interactions + if (ion1) + // this is the ion and s2 is neutral + GetDifCollParam_N64(sigmaij, omega11, *this, s2, T); + else + // this is neutral and and s2 is the ion + GetDifCollParam_N64(sigmaij, omega11, s2, *this, T); + else + // Apply Stockmayer for charged-neutral interactions +#endif + GetDifCollParam_Stock(sigmaij, omega11, *this, s2, T); + const double invWij = (W + s2.W)/(W*s2.W); + const double num = 3*sqrt(2*PI*pow(kb,3)*pow(T,3)*Na*invWij); + const double den = 16*PI*P*sigmaij*sigmaij*omega11; + return num/den; +}; + +__CUDA_HD__ +inline double Spec::GetMob(const Spec & s2, const double P, const double T) const{ +#if (nIons > 0) + // Electrons have a constant mobility for now + if (isElectron or s2.isElectron) return eMob; + + // If we call this function on a species that is neutral the result is trivial + if (nCrg == 0) return 0; + + double sigmaij; + double omega11; + if ((s2.nCrg == 0) && + (DiffCoeff.alpha != 0.0 && s2.DiffCoeff.alpha != 0.0)) + // Apply N-6,4 for charged-neutral interactions + GetDifCollParam_N64(sigmaij, omega11, *this, s2, T); + else + // Apply Stockmayer for charged-neutral interactions + GetDifCollParam_Stock(sigmaij, omega11, *this, s2, T); + const double invWij = (W + s2.W)/(W*s2.W); + const double num = 3*sqrt(2*PI*kb*T*Na*invWij)*eCrg*abs(int(nCrg)); + const double den = 16*PI*P*sigmaij*sigmaij*omega11; + return num/den; +#else + return 0; +#endif +}; + +__CUDA_HD__ +inline double Spec::GetSelfDiffusion(const double T) const { + // Already multiplied by partial density + const double num = 3*sqrt( PI*kb*T*W/Na ); + const double den = 8*PI*pow(DiffCoeff.sigma,2)*omega_D(T * DiffCoeff.kbOveps); + return num/den; +}; + +__CUDA_HD__ +inline double Spec::GetFZrot(const double T) const { + const double tmp = 1.0/(DiffCoeff.kbOveps*T); + return 1 + 0.5*pow(PI,1.5)*sqrt(tmp) + + (2 + 0.25*PI*PI)*tmp + + pow(PI,1.5)*pow(tmp,1.5); +}; + +__CUDA_HD__ +inline double Spec::GetLamAtom(const double T) const { + const double mu = GetMu(T); + return 15.0/4*mu*RGAS/W; +}; + +__CUDA_HD__ +inline double Spec::GetLamLinear(const double T) const { + const double CvTOvR = 1.5; + const double CvROvR = 1.0; + + const double CvT = CvTOvR*RGAS; + const double CvR = CvROvR*RGAS; + const double CvV = GetCp(T)*W - 3.5*RGAS; + + const double Dkk = GetSelfDiffusion(T); + const double mu = GetMu(T); + + const double fV = Dkk/mu; + + const double Zrot = DiffCoeff.Z298*GetFZrot(298)/GetFZrot(T); + + const double A = 2.5 - fV; + const double B = Zrot + 2/PI*(5./3*CvROvR+fV); + + const double fT = 2.5 * (1. - 2*CvR*A/(PI*CvT*B)); + const double fR = fV*(1. + 2*A/(PI*B)); + + return mu/W*(fT*CvT + fR*CvR + fV*CvV); +}; + +__CUDA_HD__ +inline double Spec::GetLamNonLinear(const double T) const { + const double CvTOvR = 1.5; + const double CvROvR = 1.5; + + const double CvT = CvTOvR*RGAS; + const double CvR = CvROvR*RGAS; + const double CvV = GetCp(T)*W - 4.0*RGAS; + + const double Dkk = GetSelfDiffusion(T); + const double mu = GetMu(T); + + const double fV = Dkk/mu; + + const double Zrot = DiffCoeff.Z298*GetFZrot(298.0)/GetFZrot(T); + + const double A = 2.5 - fV; + const double B = Zrot + 2/PI*(5./3*CvROvR+fV); + + const double fT = 2.5 * (1. - 2*CvR*A/(PI*CvT*B)); + const double fR = fV*(1. + 2*A/(PI*B)); + + return mu/W*(fT*CvT + fR*CvR + fV*CvV); +}; + +__CUDA_HD__ +inline double Spec::GetLam(const double T) const { + return ((DiffCoeff.Geom == SpeciesGeom_Atom) ? GetLamAtom(T) : + ((DiffCoeff.Geom == SpeciesGeom_Linear) ? GetLamLinear(T) : + /*(DiffCoeff.Geom == SpeciesGeom_NonLinear) ?*/ GetLamNonLinear(T))); +}; + diff --git a/src/MultiComponent.hpp b/src/MultiComponent.hpp deleted file mode 100644 index ed92439..0000000 --- a/src/MultiComponent.hpp +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) "2019, by Stanford University -// Developer: Mario Di Renzo -// Affiliation: Center for Turbulence Research, Stanford University -// URL: https://ctr.stanford.edu -// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). -// HTR solver: An open-source exascale-oriented task-based -// multi-GPU high-order code for hypersonic aerothermodynamics. -// Computer Physics Communications 255, 107262" -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef MultiComponent_HPP -#define MultiComponent_HPP - -#include "Species.hpp" - -#ifndef __CUDA_HD__ -#ifdef __CUDACC__ -#define __CUDA_HD__ __host__ __device__ -#else -#define __CUDA_HD__ -#endif -#endif - -#ifndef __UNROLL__ -#ifdef __CUDACC__ -#define __UNROLL__ #pragma unroll -#else -#define __UNROLL__ -#endif -#endif - -__CUDA_HD__ -inline double GetMolarWeightFromYi(const double *Yi, const Mix &mix) { - double MixW = 0.0; - __UNROLL__ - for (int i = 0; i -1, "Species not found"); - return iSpec -end - -__demand(__inline) -task Exports.CheckMixture(Yi : double[nSpec], Mix : Mixture) - var tmp = 0.0 - for i = 0, nSpec do - tmp += Yi[i] - end - tmp -= 1.0 --- TODO: the assert is not yet supported by the cuda compiler --- at the moment we return something in place of the assertion --- regentlib.assert(fabs(tmp)<1e-3, "Sum of Yi exceeded unit value"); - var err = 0 --- if (fabs(tmp)>1e-2) then err = 1 end - return err -end - -__demand(__inline) -task Exports.ClipYi(Yi : double[nSpec]) - for i = 0, nSpec do - Yi[i] max= 1.0e-60 - Yi[i] min= 1.0 - end - return Yi -end - -__demand(__inline) -task Exports.GetMolarWeightFromYi(Yi : double[nSpec], Mix : Mixture) - var MixW = 0.0 - for i = 0, nSpec do - MixW += Yi[i] / Mix.species[i].W - end - return 1.0/MixW -end - -__demand(__inline) -task Exports.GetMolarWeightFromXi(Xi : double[nSpec], Mix : Mixture) - var MixW = 0.0 - for i = 0, nSpec do - MixW += Xi[i] * Mix.species[i].W - end - return MixW -end - -__demand(__inline) -task Exports.GetMolarFractions(MixW : double, Yi : double[nSpec], Mix : Mixture) - for i = 0, nSpec do - Yi[i] *= MixW/Mix.species[i].W - end - return Yi -end - -__demand(__inline) -task Exports.GetMassFractions(MixW : double, Xi : double[nSpec], Mix : Mixture) - for i = 0, nSpec do - Xi[i] *= Mix.species[i].W/MixW - end - return Xi -end - -__demand(__inline) -task Exports.GetRhoFromRhoYi(rhoYi : double[nSpec]) - var rho = 0.0 - for i = 0, nSpec do - rho += rhoYi[i] - end - return rho -end - -__demand(__inline) -task Exports.GetYi(rho : double, rhoYi : double[nSpec]) - var rhoInv = 1.0/rho - for i = 0, nSpec do - rhoYi[i] *= rhoInv - end - return rhoYi -end - -__demand(__inline) -task Exports.GetRhoYiFromYi(rho : double, Yi : double[nSpec]) - for i = 0, nSpec do - Yi[i] *= rho - end - return Yi -end - -__demand(__inline) -task Exports.GetRho(P : double, T : double, MixW : double, Mix : Mixture) - return P * MixW / (RGAS * T) -end - -__demand(__inline) -task Exports.GetHeatCapacity(T : double, Yi : double[nSpec], Mix : Mixture) - var cp = 0.0 - for i = 0, nSpec do - cp += Yi[i]*SPECIES.GetCp(Mix.species[i], T) - end - return cp -end - -__demand(__inline) -task Exports.GetEnthalpy(T : double, Yi : double[nSpec], Mix : Mixture) - var Enth = 0.0 - for i = 0, nSpec do - Enth += Yi[i]*SPECIES.GetEnthalpy(Mix.species[i], T) - end - return Enth -end - -__demand(__inline) -task Exports.GetSpeciesEnthalpy(i : int, T : double, Mix : Mixture) - return SPECIES.GetEnthalpy(Mix.species[i], T) -end - -__demand(__inline) -task Exports.GetSpeciesMolarWeight(i : int, Mix : Mixture) - return Mix.species[i].W -end - -__demand(__inline) -task Exports.GetInternalEnergy(T : double, Yi : double[nSpec], Mix : Mixture) - var e = 0.0 - for i = 0, nSpec do - e += Yi[i]*(SPECIES.GetEnthalpy(Mix.species[i], T) - RGAS*T/Mix.species[i].W) - end - return e -end - -__demand(__inline) -task Exports.GetSpecificInternalEnergy(i : int, T : double, Mix : Mixture) - return SPECIES.GetEnthalpy(Mix.species[i], T) - RGAS*T/Mix.species[i].W -end - -__demand(__inline) -task Exports.GetTFromInternalEnergy(e0 : double, T : double, Yi : double[nSpec], Mix : Mixture) - var MAXITS = 1000 - var TOL = 1e-5 - var dfdT = 1.0 - for j = 0, MAXITS do - var f = e0 - Exports.GetInternalEnergy(T, Yi, Mix) - if (fabs(f/dfdT) < TOL) then break end - dfdT = 0.0 - for i = 0, nSpec do - dfdT += Yi[i]*(SPECIES.GetCp(Mix.species[i], T) - RGAS/Mix.species[i].W) - end - T += f/dfdT --- TODO: the assert is not yet supported by the cuda compiler --- regentlib.assert(j~=MAXITS, "GetTFromInternalEnergy did not converge") - end - return T -end - -__demand(__inline) -task Exports.isValidInternalEnergy(e : double, Yi : double[nSpec], Mix : Mixture) - var valid = true - if e < Exports.GetInternalEnergy(Mix.TMin, Yi, Mix) then valid = false - elseif e > Exports.GetInternalEnergy(Mix.TMax, Yi, Mix) then valid = false - end - return valid -end - -__demand(__inline) -task Exports.GetTFromRhoAndP(rho: double, MixW : double, P : double) - return P*MixW/(rho*RGAS) -end - -__demand(__inline) -task Exports.GetPFromRhoAndT(rho: double, MixW : double, T : double) - return rho*RGAS*T/MixW -end - -__demand(__inline) -task Exports.GetViscosity(T : double, Xi : double[nSpec], Mix : Mixture) - var muk : double[nSpec] - for i = 0, nSpec do - muk[i] = SPECIES.GetMu(Mix.species[i], T) - end - - var mu = 0.0 - for i = 0, nSpec do - var den = 0.0; - for j = 0, nSpec do - var Phi = pow(1 + sqrt(muk[i]/muk[j]) * pow(Mix.species[j].W/Mix.species[i].W, 0.25) , 2); - Phi /= sqrt(8*(1 + Mix.species[i].W/Mix.species[j].W)); - den += Xi[j]*Phi; - end - mu += Xi[i]*muk[i]/den; - end - return mu; -end - -__demand(__inline) -task Exports.GetHeatConductivity(T : double, Xi : double[nSpec], Mix : Mixture) - var a = 0.0 - var b = 0.0 - for i = 0, nSpec do - var lami = SPECIES.GetLam(Mix.species[i], T) - a += Xi[i]*lami - b += Xi[i]/lami - end - return 0.5*(a + 1.0/b) -end - -__demand(__inline) -task Exports.GetGamma(T : double, MixW : double, Yi : double[nSpec], Mix : Mixture) - var cp = Exports.GetHeatCapacity(T, Yi, Mix) - return cp/(cp - RGAS/MixW) -end - -__demand(__inline) -task Exports.GetSpeedOfSound(T : double, gamma : double, MixW : double, Mix : Mixture) - return sqrt(gamma * RGAS * T / MixW) -end - -__demand(__inline) -task Exports.GetDiffusivity(P: double, T : double, MixW : double, Xi : double[nSpec], Mix : Mixture) - var invDi : double[nSpec*nSpec] - var Di : double[nSpec] - for i = 0, nSpec do - invDi[i*nSpec+i] = 0.0 - for j = 0, i do - invDi[j*nSpec+i] = 1.0/SPECIES.GetDif(Mix.species[i], Mix.species[j], P, T) - invDi[i*nSpec+j] = invDi[j*nSpec+i] - end - end - - for i = 0, nSpec do - var num = 0.0 - var den = 0.0 - for j = 0, i do - num += Xi[j]*Mix.species[j].W; - den += Xi[j]*invDi[i*nSpec+j]; - end - for j = i+1, nSpec do - num += Xi[j]*Mix.species[j].W - den += Xi[j]*invDi[i*nSpec+j] - end - Di[i] = num/(MixW*den) - end - return Di -end - -__demand(__inline) -task Exports.GetProductionRates(rho : double, P : double, T : double, Yi : double[nSpec], Mix : Mixture) - var G : double[nSpec] - var C : double[nSpec] - var w : double[nSpec] - for i = 0, nSpec do - w[i] = 0.0; - C[i] = Yi[i]*rho/Mix.species[i].W - G[i] = SPECIES.GetFreeEnthalpy(Mix.species[i], T) - end - - for i = 0, nReac do - w = REACTION.AddProductionRates(Mix.reactions[i], P, T, C, G, w) - end - - -- From [mol/(s m^3)] to [kg/(s m^3)] - for i = 0, nSpec do - w[i] *= Mix.species[i].W - end - return w -end - -__demand(__inline) -task Exports.Getdpde(rho : double, gamma : double, Mix : Mixture) - return rho*(gamma - 1) -end - -__demand(__inline) -task Exports.Getdpdrhoi(gamma : double, T : double, Yi : double[nSpec], Mix : Mixture) - var e = 0.0 - var ei : double[nSpec] - for i = 0, nSpec do - ei[i] = (SPECIES.GetEnthalpy(Mix.species[i], T) - RGAS*T/Mix.species[i].W) - e += Yi[i]*ei[i] - end - var dpdrhoi : double[nSpec] - for i = 0, nSpec do - dpdrhoi[i] = RGAS*T/Mix.species[i].W + (gamma - 1)*(e - ei[i]) - end - return dpdrhoi -end - -return Exports end diff --git a/src/Poisson/Poisson.cc b/src/Poisson/Poisson.cc new file mode 100644 index 0000000..bf35cca --- /dev/null +++ b/src/Poisson/Poisson.cc @@ -0,0 +1,405 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "Poisson.hpp" +#include "omp.h" + +// InitFFTplansTask +/*static*/ const char * const initFFTplansTask::TASK_NAME = "initFFTplans"; +/*static*/ const int initFFTplansTask::TASK_ID = TID_initFFTplans; + +void initFFTplansTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessors for FFT plans + const AccessorRW< fftw_plan, 1> acc_fftw_fwd (regions[1], FID_fftw_fwd); + const AccessorRW< fftw_plan, 1> acc_fftw_bwd (regions[1], FID_fftw_bwd); + const AccessorRW acc_id (regions[1], FID_id); + + // Get size of the FFT execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_z = getSize(bounds); + fftw_complex *aux = new fftw_complex[(size_x*size_z)]; + + // Get index of the plans that we are initializing + Point<1> p = Rect<1>(runtime->get_index_space_domain(ctx, args.s.get_index_space())).lo; + // crate plan for direct transform with FFTW + fftw_make_planner_thread_safe(); + acc_fftw_fwd[p] = fftw_plan_dft_2d(size_x, size_z, aux, aux, FFTW_FORWARD, FFTW_MEASURE); + // crate plan for inverse transform with FFTW + acc_fftw_bwd[p] = fftw_plan_dft_2d(size_x, size_z, aux, aux, FFTW_BACKWARD, FFTW_MEASURE); + + delete[] aux; + + // Store the index of executing processor for future checking + acc_id[p] = runtime->get_executing_processor(runtime->get_context()).address_space(); +} + +// destroyFFTplansTask +/*static*/ const char * const destroyFFTplansTask::TASK_NAME = "destroyFFTplans"; +/*static*/ const int destroyFFTplansTask::TASK_ID = TID_destroyFFTplans; + +void destroyFFTplansTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 1); + assert(futures.size() == 0); + + // Accessors for FFT plans + const AccessorRW< fftw_plan, 1> acc_fftw_fwd(regions[0], FID_fftw_fwd); + const AccessorRW< fftw_plan, 1> acc_fftw_bwd(regions[0], FID_fftw_bwd); + const AccessorRW acc_id (regions[0], FID_id); + // Get index of the plans that we are destroying + Point<1> p = Rect<1>(runtime->get_index_space_domain(ctx, args.r.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[p] == runtime->get_executing_processor(runtime->get_context()).address_space()); + // destroy plan for direct transform with FFTW + fftw_destroy_plan(acc_fftw_fwd[p]); + // destroy plan for inverse transform with FFTW + fftw_destroy_plan(acc_fftw_bwd[p]); +} + +// performDirFFTTaskFromField +/*static*/ const char * const performDirFFTFromFieldTask::TASK_NAME = "performDirFFTFromField"; +/*static*/ const int performDirFFTFromFieldTask::TASK_ID = TID_performDirFFTFromField; + +void performDirFFTFromFieldTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Data accessors + const AccessorRO< double, 3> acc_src (regions[0], FID_src); + const AccessorWO< complex, 3> acc_fft (regions[1], FID_fft); + + // Plans accessors + const AccessorRO< fftw_plan, 1> acc_fftw_fwd(regions[2], FID_fftw_fwd); + const AccessorRO acc_id (regions[2], FID_id); + + // Get index of the plans that we are initializing + Point<1> plan = Rect<1>(runtime->get_index_space_domain(ctx, args.p.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[plan] == runtime->get_executing_processor(runtime->get_context()).address_space()); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_z = getSize(bounds); + const double FFTfact = 1.0/(size_x*size_z); + + // Allocate a buffer for the FFTW of size_x*size_z for each thread +#ifdef REALM_USE_OPENMP + fftw_complex *aux = new fftw_complex[(size_x*size_z)*omp_get_max_threads()]; +#else + fftw_complex *aux = new fftw_complex[(size_x*size_z)]; +#endif +#ifdef REALM_USE_OPENMP + #pragma omp parallel for +#endif + for (int j = bounds.lo.y; j <= bounds.hi.y; j++) { +#ifdef REALM_USE_OPENMP + fftw_complex *myaux = &aux[(size_x*size_z)*omp_get_thread_num()]; +#else + fftw_complex *myaux = &aux[0]; +#endif + // pack the plane in aux + for (int k = bounds.lo.z; k <= bounds.hi.z; k++) + for (int i = bounds.lo.x; i <= bounds.hi.x; i++) { + myaux[k*size_x+i][0] = acc_src[Point<3>(i, j, k)]; + myaux[k*size_x+i][1] = 0.0; + } + // FFT transform + fftw_execute_dft(acc_fftw_fwd[plan], myaux, myaux); + // unpack the plane from aux + for (int k = bounds.lo.z; k <= bounds.hi.z; k++) + for (int i = bounds.lo.x; i <= bounds.hi.x; i++) + acc_fft[Point<3>(i, j, k)] = complex(myaux[k*size_x+i][0]*FFTfact, myaux[k*size_x+i][1]*FFTfact); + } + delete[] aux; +} + +// performDirFFTTaskFromMix +/*static*/ const char * const performDirFFTFromMixTask::TASK_NAME = "performDirFFTFromMix"; +/*static*/ const int performDirFFTFromMixTask::TASK_ID = TID_performDirFFTFromMix; + +void performDirFFTFromMixTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Data accessors + const AccessorRO< double, 3> acc_rho (regions[0], FID_rho); + const AccessorRO< VecNSp, 3> acc_MolarFracs (regions[0], FID_MolarFracs); + const AccessorWO< complex, 3> acc_fft (regions[1], FID_fft); + + // Plans accessors + const AccessorRO< fftw_plan, 1> acc_fftw_fwd(regions[2], FID_fftw_fwd); + const AccessorRO acc_id (regions[2], FID_id); + + // Get index of the plans that we are initializing + Point<1> plan = Rect<1>(runtime->get_index_space_domain(ctx, args.p.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[plan] == runtime->get_executing_processor(runtime->get_context()).address_space()); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_z = getSize(bounds); + const double FFTfact = 1.0/(size_x*size_z); + const double SrcFact = -1.0/args.mix.GetDielectricPermittivity(); + + // Allocate a buffer for the FFTW of size_x*size_z for each thread +#ifdef REALM_USE_OPENMP + fftw_complex *aux = new fftw_complex[(size_x*size_z)*omp_get_max_threads()]; +#else + fftw_complex *aux = new fftw_complex[(size_x*size_z)]; +#endif +#ifdef REALM_USE_OPENMP + #pragma omp parallel for +#endif + for (int j = bounds.lo.y; j <= bounds.hi.y; j++) { +#ifdef REALM_USE_OPENMP + fftw_complex *myaux = &aux[(size_x*size_z)*omp_get_thread_num()]; +#else + fftw_complex *myaux = &aux[0]; +#endif + // pack the plane in aux + for (int k = bounds.lo.z; k <= bounds.hi.z; k++) + for (int i = bounds.lo.x; i <= bounds.hi.x; i++) { + const Point<3> p = Point<3>(i, j, k); + const double MixW = args.mix.GetMolarWeightFromXi(acc_MolarFracs[p]); + myaux[k*size_x+i][0] = SrcFact* + args.mix.GetElectricChargeDensity(acc_rho[p], MixW, acc_MolarFracs[p]); + myaux[k*size_x+i][1] = 0.0; + } + // FFT transform + fftw_execute_dft(acc_fftw_fwd[plan], myaux, myaux); + // unpack the plane from aux + for (int k = bounds.lo.z; k <= bounds.hi.z; k++) + for (int i = bounds.lo.x; i <= bounds.hi.x; i++) + acc_fft[Point<3>(i, j, k)] = complex(myaux[k*size_x+i][0]*FFTfact, myaux[k*size_x+i][1]*FFTfact); + } + delete[] aux; +} + +// performInvFFTTask +/*static*/ const char * const performInvFFTTask::TASK_NAME = "performInvFFT"; +/*static*/ const int performInvFFTTask::TASK_ID = TID_performInvFFT; + +void performInvFFTTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Data accessors + const AccessorWO< double, 3> acc_out (regions[0], FID_out); + const AccessorRW, 3> acc_fft (regions[1], FID_fft); + + // Plans accessors + const AccessorRO< fftw_plan, 1> acc_fftw_bwd(regions[2], FID_fftw_bwd); + const AccessorRO acc_id (regions[2], FID_id); + + // Get index of the plans that we are initializing + Point<1> plan = Rect<1>(runtime->get_index_space_domain(ctx, args.p.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[plan] == runtime->get_executing_processor(runtime->get_context()).address_space()); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_z = getSize(bounds); + + // Allocate a buffer for the FFTW of size_x*size_z for each thread +#ifdef REALM_USE_OPENMP + fftw_complex *aux = new fftw_complex[(size_x*size_z)*omp_get_max_threads()]; +#else + fftw_complex *aux = new fftw_complex[(size_x*size_z)]; +#endif +#ifdef REALM_USE_OPENMP + #pragma omp parallel for +#endif + for (int j = bounds.lo.y; j <= bounds.hi.y; j++) { +#ifdef REALM_USE_OPENMP + fftw_complex *myaux = &aux[(size_x*size_z)*omp_get_thread_num()]; +#else + fftw_complex *myaux = &aux[0]; +#endif + // pack the plane in aux + for (int k = bounds.lo.z; k <= bounds.hi.z; k++) + for (int i = bounds.lo.x; i <= bounds.hi.x; i++) { + Point<3> p = Point<3>(i, j, k); + myaux[k*size_x+i][0] = acc_fft[p].real(); + myaux[k*size_x+i][1] = acc_fft[p].imag(); + } + // FFT transform + fftw_execute_dft(acc_fftw_bwd[plan], myaux, myaux); + // unpack the plane from aux + for (int k = bounds.lo.z; k <= bounds.hi.z; k++) + for (int i = bounds.lo.x; i <= bounds.hi.x; i++) + acc_out[Point<3>(i, j, k)] = myaux[k*size_x+i][0]; + } + delete[] aux; +} + +// performInvFFTTask +/*static*/ const char * const solveTridiagonalsTask::TASK_NAME = "solveTridiagonals"; +/*static*/ const int solveTridiagonalsTask::TASK_ID = TID_solveTridiagonals; + +void solveTridiagonalsTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 4); + assert(futures.size() == 0); + + // Data accessors + const AccessorRW, 3> acc_fft (regions[0], FID_fft); + + // Tridiagonal coefficients accessors + const AccessorRO< double, 1> acc_a (regions[1], FID_a); + const AccessorRO< double, 1> acc_b (regions[1], FID_b); + const AccessorRO< double, 1> acc_c (regions[1], FID_c); + + // Squared complex wave numbers accessors + const AccessorRO, 1> acc_k2X (regions[2], FID_k2); + const AccessorRO, 1> acc_k2Z (regions[3], FID_k2); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_y = getSize(bounds); + + // Allocate a buffer for the Thomas algorithm of size_y for each thread +#ifdef REALM_USE_OPENMP + complex *aux = new complex[size_y*omp_get_max_threads()]; +#else + complex *aux = new complex[size_y]; +#endif +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = bounds.lo.z; k <= bounds.hi.z; k++) + for (int i = bounds.lo.x; i <= bounds.hi.x; i++) { +#ifdef REALM_USE_OPENMP + complex *myaux = &aux[size_y*omp_get_thread_num()]; +#else + complex *myaux = &aux[0]; +#endif + solveTridiagonal(acc_fft, acc_a, acc_b, acc_c, myaux, acc_k2X[i], acc_k2Z[k], + i, bounds.lo.y, bounds.hi.y, k, args.Robin_bc); + } + delete[] aux; +} + +void register_poisson_tasks() +{ +#ifdef REALM_USE_CUDA + // Force the runtime to put the FFT plans in the zero copy memory + LayoutConstraintID z_copy_memory = + TaskHelper::register_layout_constraint(MemoryConstraint(Memory::Z_COPY_MEM)); +#endif + + // Yplanes will be allocated with the following directions order YZX + OrderingConstraint orderYZX(true/*contiguous*/); + orderYZX.ordering.push_back(DIM_X); + orderYZX.ordering.push_back(DIM_Z); + orderYZX.ordering.push_back(DIM_Y); + orderYZX.ordering.push_back(DIM_F); + LayoutConstraintID YPlane_Order = + TaskHelper::register_layout_constraint(orderYZX); + + // XZslubs will be allocated with the following directions order ZXY + OrderingConstraint orderZXY(true/*contiguous*/); + orderZXY.ordering.push_back(DIM_Y); + orderZXY.ordering.push_back(DIM_X); + orderZXY.ordering.push_back(DIM_Z); + orderZXY.ordering.push_back(DIM_F); + LayoutConstraintID XZslubs_Order = + TaskHelper::register_layout_constraint(orderYZX); + + std::vector> cpu_constraints; + std::vector> gpu_constraints; + + cpu_constraints.push_back(std::pair(0, YPlane_Order)); + gpu_constraints.push_back(std::pair(0, YPlane_Order)); +#ifdef REALM_USE_CUDA + gpu_constraints.push_back(std::pair(1, z_copy_memory)); +#endif + TaskHelper::register_hybrid_variants(cpu_constraints, gpu_constraints); + cpu_constraints.clear(); + gpu_constraints.clear(); + +#ifdef REALM_USE_CUDA + gpu_constraints.push_back(std::pair(0, z_copy_memory)); +#endif + TaskHelper::register_hybrid_variants(cpu_constraints, gpu_constraints); + gpu_constraints.clear(); + + cpu_constraints.push_back(std::pair(0, YPlane_Order)); + gpu_constraints.push_back(std::pair(0, YPlane_Order)); + cpu_constraints.push_back(std::pair(1, YPlane_Order)); + gpu_constraints.push_back(std::pair(1, YPlane_Order)); +#ifdef REALM_USE_CUDA + gpu_constraints.push_back(std::pair(2, z_copy_memory)); +#endif + TaskHelper::register_hybrid_variants(cpu_constraints, gpu_constraints); + TaskHelper::register_hybrid_variants(cpu_constraints, gpu_constraints); + TaskHelper::register_hybrid_variants(cpu_constraints, gpu_constraints); + cpu_constraints.clear(); + gpu_constraints.clear(); + + cpu_constraints.push_back(std::pair(0, XZslubs_Order)); + gpu_constraints.push_back(std::pair(0, XZslubs_Order)); + TaskHelper::register_hybrid_variants(); + cpu_constraints.clear(); + gpu_constraints.clear(); +} diff --git a/src/Poisson/Poisson.cu b/src/Poisson/Poisson.cu new file mode 100644 index 0000000..14bea39 --- /dev/null +++ b/src/Poisson/Poisson.cu @@ -0,0 +1,436 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "Poisson.hpp" +#include "cuda_utils.hpp" +#include "cufft.h" + +// Declare a constant memory that will hold the Mixture struct (initialized in prometeo_mixture.cu) +extern __device__ __constant__ Mix mix; + +//----------------------------------------------------------------------------- +// KERNEL FOR initFFTplansTask +//----------------------------------------------------------------------------- + +void initFFTplansTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessors for FFT plans + const AccessorRW< fftw_plan, 1> acc_fftw_fwd(regions[1], FID_fftw_fwd); + const AccessorRW< fftw_plan, 1> acc_fftw_bwd(regions[1], FID_fftw_bwd); + const AccessorRW< cufftHandle, 1> acc_cufft (regions[1], FID_cufft); + const AccessorRW acc_id (regions[1], FID_id); + + // Get size of the FFT execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_y = getSize(bounds); + coord_t size_z = getSize(bounds); + + // Get index of the plans that we are initializing + Point<1> p = Rect<1>(runtime->get_index_space_domain(ctx, args.s.get_index_space())).lo; + + // Init FFTW plans + fftw_make_planner_thread_safe(); + fftw_complex *aux = new fftw_complex[(size_x*size_z)]; + // crate plan for direct transform with FFTW + acc_fftw_fwd[p] = fftw_plan_dft_2d(size_x, size_z, aux, aux, FFTW_FORWARD, FFTW_MEASURE); + // crate plan for inverse transform with FFTW + acc_fftw_bwd[p] = fftw_plan_dft_2d(size_x, size_z, aux, aux, FFTW_BACKWARD, FFTW_MEASURE); + delete[] aux; + + // Init cuFFT plans + int dim[2] = {int(size_z), int(size_x)}; + if (cufftPlanMany(acc_cufft.ptr(p), 2, dim, + NULL, 1, 0, + NULL, 1, 0, + CUFFT_Z2Z, int(size_y)) != CUFFT_SUCCESS) { + fprintf(stderr, "CUFFT Error: Unable to create plan\n"); + assert(0); + } + + // Store the index of executing processor for future checking + acc_id[p] = runtime->get_executing_processor(runtime->get_context()).address_space(); +} + +// destroyFFTplansTask +void destroyFFTplansTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 1); + assert(futures.size() == 0); + + // Accessors for FFT plans + const AccessorRW< fftw_plan, 1> acc_fftw_fwd(regions[0], FID_fftw_fwd); + const AccessorRW< fftw_plan, 1> acc_fftw_bwd(regions[0], FID_fftw_bwd); + const AccessorRW< cufftHandle, 1> acc_cufft (regions[0], FID_cufft); + const AccessorRW acc_id (regions[0], FID_id); + // Get index of the plans that we are destroying + Point<1> p = Rect<1>(runtime->get_index_space_domain(ctx, args.r.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[p] == runtime->get_executing_processor(runtime->get_context()).address_space()); + // destroy plan for direct transform with FFTW + fftw_destroy_plan(acc_fftw_fwd[p]); + // destroy plan for inverse transform with FFTW + fftw_destroy_plan(acc_fftw_bwd[p]); + // destroy plan for transform with cuFFT + cufftDestroy(acc_cufft[p]); +} + +//----------------------------------------------------------------------------- +// KERNEL FOR performDirFFTTask +//----------------------------------------------------------------------------- + +__global__ +void updateRHS_kernel(const AccessorWO, 3> fft, + const AccessorRO q, + const double Srcfact, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + fft[p] = complex(Srcfact*q[p], 0.0); + } +} + +__global__ +void updateRHS_kernel(const AccessorWO, 3> fft, + const AccessorRO rho, + const AccessorRO MolarFracs, + const double Srcfact, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + const double MixW = mix.GetMolarWeightFromXi(MolarFracs[p]); + fft[p] = complex(Srcfact*mix.GetElectricChargeDensity(rho[p], MixW, MolarFracs[p]), 0.0); + } +} + +__host__ +void performDirFFTFromFieldTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Data accessors + const AccessorRO< double, 3> acc_src (regions[0], FID_src); + const AccessorWO< complex, 3> acc_fft (regions[1], FID_fft); + + // Plans accessors + const AccessorRO< cufftHandle, 1> acc_cufft(regions[2], FID_cufft); + const AccessorRO acc_id (regions[2], FID_id); + + // Get index of the plans that we are initializing + Point<1> plan = Rect<1>(runtime->get_index_space_domain(ctx, args.p.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[plan] == runtime->get_executing_processor(runtime->get_context()).address_space()); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_y = getSize(bounds); + coord_t size_z = getSize(bounds); + const double FFTfact = 1.0/(size_x*size_z); + + // Force cuFFT to run on the default stream of this task + cudaStream_t default_stream; + cudaStreamCreate(&default_stream); + + // Store data to be transformed in a deferred buffer + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, bounds); + const dim3 num_blocks_3d = dim3((size_x + (TPB_3d.x - 1)) / TPB_3d.x, + (size_y + (TPB_3d.y - 1)) / TPB_3d.y, + (size_z + (TPB_3d.z - 1)) / TPB_3d.z); + updateRHS_kernel<<>>(acc_fft, acc_src, + FFTfact, bounds, + size_x, size_y, size_z); + + // Perform the FFT (on the correct stream) + if (cufftSetStream(acc_cufft[plan], default_stream) != CUFFT_SUCCESS) { + fprintf(stderr, "CUFFT Error: Unable to associate stream to plan\n"); + assert(0); + } + if (cufftExecZ2Z(acc_cufft[plan], + (cufftDoubleComplex*)(acc_fft.ptr(bounds.lo)), + (cufftDoubleComplex*)(acc_fft.ptr(bounds.lo)), CUFFT_FORWARD) != CUFFT_SUCCESS) { + fprintf(stderr, "CUFFT error: ExecZ2Z Forward failed"); + assert(0); + } + + // Cleanup default stream + cudaStreamDestroy(default_stream); +} + +__host__ +void performDirFFTFromMixTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Data accessors + const AccessorRO< double, 3> acc_rho (regions[0], FID_rho); + const AccessorRO< VecNSp, 3> acc_MolarFracs (regions[0], FID_MolarFracs); + const AccessorWO< complex, 3> acc_fft (regions[1], FID_fft); + + // Plans accessors + const AccessorRO< cufftHandle, 1> acc_cufft(regions[2], FID_cufft); + const AccessorRO acc_id (regions[2], FID_id); + + // Get index of the plans that we are initializing + Point<1> plan = Rect<1>(runtime->get_index_space_domain(ctx, args.p.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[plan] == runtime->get_executing_processor(runtime->get_context()).address_space()); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_y = getSize(bounds); + coord_t size_z = getSize(bounds); + const double FFTfact = 1.0/(size_x*size_z); + const double SrcFact = -1.0/args.mix.GetDielectricPermittivity(); + + // Force cuFFT to run on the default stream of this task + cudaStream_t default_stream; + cudaStreamCreate(&default_stream); + + // Update RHS + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, bounds); + const dim3 num_blocks_3d = dim3((size_x + (TPB_3d.x - 1)) / TPB_3d.x, + (size_y + (TPB_3d.y - 1)) / TPB_3d.y, + (size_z + (TPB_3d.z - 1)) / TPB_3d.z); + updateRHS_kernel<<>>(acc_fft, acc_rho, acc_MolarFracs, + FFTfact*SrcFact, bounds, + size_x, size_y, size_z); + + // Perform the FFT (on the correct stream) + if (cufftSetStream(acc_cufft[plan], default_stream) != CUFFT_SUCCESS) { + fprintf(stderr, "CUFFT Error: Unable to associate stream to plan\n"); + assert(0); + } + if (cufftExecZ2Z(acc_cufft[plan], + (cufftDoubleComplex*)(acc_fft.ptr(bounds.lo)), + (cufftDoubleComplex*)(acc_fft.ptr(bounds.lo)), CUFFT_FORWARD) != CUFFT_SUCCESS) { + fprintf(stderr, "CUFFT error: ExecZ2Z Forward failed"); + assert(0); + } + + // Cleanup default stream + cudaStreamDestroy(default_stream); +} + +//----------------------------------------------------------------------------- +// KERNEL FOR performInvFFTTask +//----------------------------------------------------------------------------- +__global__ +void unpackData_kernel(const AccessorRW, 3> fft, + const AccessorWO Phi, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + Phi[p] = fft[p].real(); + } +} + +__host__ +void performInvFFTTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Data accessors + const AccessorWO< double, 3> acc_out (regions[0], FID_out); + const AccessorRW, 3> acc_fft (regions[1], FID_fft); + + // Plans accessors + const AccessorRO< cufftHandle, 1> acc_cufft(regions[2], FID_cufft); + const AccessorRO acc_id (regions[2], FID_id); + + // Get index of the plans that we are initializing + Point<1> plan = Rect<1>(runtime->get_index_space_domain(ctx, args.p.get_index_space())).lo; + // check that we are on the right processor + assert(acc_id[plan] == runtime->get_executing_processor(runtime->get_context()).address_space()); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_y = getSize(bounds); + coord_t size_z = getSize(bounds); + + // Force cuFFT to run on the default stream of this task + cudaStream_t default_stream; + cudaStreamCreate(&default_stream); + + DeferredBuffer fft(Rect<1>(0, size_x*size_y*size_z), Memory::GPU_FB_MEM); + + // Perform the inverse FFT (on the correct stream) + if (cufftSetStream(acc_cufft[plan], default_stream) != CUFFT_SUCCESS) { + fprintf(stderr, "CUFFT Error: Unable to associate stream to plan\n"); + assert(0); + } + if (cufftExecZ2Z(acc_cufft[plan], + (cufftDoubleComplex*)(acc_fft.ptr(bounds.lo)), + (cufftDoubleComplex*)(acc_fft.ptr(bounds.lo)), CUFFT_INVERSE) != CUFFT_SUCCESS) { + fprintf(stderr, "CUFFT error: ExecZ2Z Inverse failed"); + assert(0); + } + + // Retrieve output data + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, bounds); + const dim3 num_blocks_3d = dim3((size_x + (TPB_3d.x - 1)) / TPB_3d.x, + (size_y + (TPB_3d.y - 1)) / TPB_3d.y, + (size_z + (TPB_3d.z - 1)) / TPB_3d.z); + unpackData_kernel<<>>(acc_fft, acc_out, bounds, + size_x, size_y, size_z); + + // Cleanup default stream + cudaStreamDestroy(default_stream); +} + +//----------------------------------------------------------------------------- +// KERNEL FOR solveTridiagonalsTask +//----------------------------------------------------------------------------- + +__global__ +void solveTridiagonal_kernel(const AccessorRW, 3> fft, + const AccessorRO< double, 1> a, + const AccessorRO< double, 1> b, + const AccessorRO< double, 1> c, + const AccessorRO, 1> k2X, + const AccessorRO, 1> k2Z, + DeferredBuffer, 1> aux, + const bool Robin_bc, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + //int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + if ((x < size_x) && (z < size_z)) { + const coord_t i = x + my_bounds.lo.x; + const coord_t k = z + my_bounds.lo.z; + solveTridiagonalsTask::solveTridiagonal(fft, a, b, c, aux.ptr((z*size_x + x)*size_y), + k2X[i], k2Z[k], i, my_bounds.lo.y, my_bounds.hi.y, k, Robin_bc); + } +} + +__host__ +void solveTridiagonalsTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 4); + assert(futures.size() == 0); + + // Data accessors + const AccessorRW, 3> acc_fft (regions[0], FID_fft); + + // Tridiagonal coefficients accessors + const AccessorRO< double, 1> acc_a (regions[1], FID_a); + const AccessorRO< double, 1> acc_b (regions[1], FID_b); + const AccessorRO< double, 1> acc_c (regions[1], FID_c); + + // Squared complex wave numbers accessors + const AccessorRO, 1> acc_k2X (regions[2], FID_k2); + const AccessorRO, 1> acc_k2Z (regions[3], FID_k2); + + // Get execution domain + Rect<3> bounds = runtime->get_index_space_domain(ctx, args.r.get_index_space()); + coord_t size_x = getSize(bounds); + coord_t size_y = getSize(bounds); + coord_t size_z = getSize(bounds); + + // Get kernel launch domain + const Rect<2> bounds2d = Rect<2>(Point<2>(bounds.lo.x, bounds.lo.z), + Point<2>(bounds.hi.x, bounds.hi.z)); + + // use a deferred buffer to store auxiliary data of the Thomas algorithm + DeferredBuffer, 1> aux(Rect<1>(0, size_x*size_y*size_z), Memory::GPU_FB_MEM); + + // Solve tridiagonals with a 2d launch + const int threads_per_block = 256; + const dim3 TPB_2d = splitThreadsPerBlockPlane(threads_per_block, bounds); + const dim3 num_blocks_2d = numBlocksSpan(TPB_2d, bounds); + solveTridiagonal_kernel<<>>(acc_fft, acc_a, acc_b, acc_c, + acc_k2X, acc_k2Z, aux, args.Robin_bc, bounds, + size_x, size_y, size_z); +} diff --git a/src/Poisson/Poisson.h b/src/Poisson/Poisson.h new file mode 100644 index 0000000..62a455b --- /dev/null +++ b/src/Poisson/Poisson.h @@ -0,0 +1,82 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __POISSON_H__ +#define __POISSON_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +//#include "fftw3.h" +//#ifdef USE_CUDA +//#include "cufft.h" +//#endif + +//struct fftPlansType { +// fftw_plan fftw_fwd; // FFTW plan for direct transform +// fftw_plan fftw_bwd; // FFTW plan for inverse transform +//#ifdef USE_CUDA +// cufftHandle cufft_fwd; // cuFFT plan for direct transform +// cufftHandle cufft_bwd; // cuFFT plan for inverse transform +//#endif +// legion_address_space_t id; // processor index +//}; + +enum FieldIDs_FFTplans { + FID_fftw_fwd = 101, + FID_fftw_bwd, + FID_cufft, + FID_id, + FID_FFTplans_last +}; + +enum FieldIDs_CoeffType { + FID_a = 101, + FID_b, + FID_c, + FID_CoeffType_last +}; + +enum FieldIDs_k2Type { + FID_k2 = 101 +}; + +enum FieldIDs_fftType { + FID_fft = 101 +}; + +void register_poisson_tasks(); + +#ifdef __cplusplus +} +#endif + +#endif // __POISSON_H__ + diff --git a/src/Poisson/Poisson.hpp b/src/Poisson/Poisson.hpp new file mode 100644 index 0000000..f1254ff --- /dev/null +++ b/src/Poisson/Poisson.hpp @@ -0,0 +1,322 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __POISSON_HPP__ +#define __POISSON_HPP__ + +#include "legion.h" + +using namespace Legion; + +#include "fftw3.h" + +//----------------------------------------------------------------------------- +// LOAD PROMETEO UTILITIES AND MODULES +//----------------------------------------------------------------------------- + +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" +#include "prometeo_types.h" +#include "Poisson.h" + +//----------------------------------------------------------------------------- +// TASK THAT INITIALIZE THE FFT PLANS +//----------------------------------------------------------------------------- + +class initFFTplansTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion r; + LogicalRegion s; + FieldID r_fields[FID_last - 101]; + FieldID s_fields[FID_FFTplans_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT DESTROYS THE FFT PLANS +//----------------------------------------------------------------------------- + +class destroyFFTplansTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion r; + FieldID r_fields[FID_FFTplans_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT PERFORMS THE DIRECT FFT TRANSFORM USING A FIELD AS SOURCE TERM +//----------------------------------------------------------------------------- + +class performDirFFTFromFieldTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion r; + LogicalRegion s; + LogicalRegion p; + Mix mix; + FieldID r_fields[FID_last - 101]; + FieldID s_fields[1]; + FieldID p_fields[FID_FFTplans_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +private: + // This will need to metch whatever is defined in the rg file + // For now we keep it for testing + static const FieldID FID_src = FID_rho; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT PERFORMS THE DIRECT FFT TRANSFORM COMPUTING THE SOURCE TERM FROM MIX +//----------------------------------------------------------------------------- + +class performDirFFTFromMixTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion r; + LogicalRegion s; + LogicalRegion p; + Mix mix; + FieldID r_fields[FID_last - 101]; + FieldID s_fields[1]; + FieldID p_fields[FID_FFTplans_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT PERFORMS THE INVERSE FFT TRANSFORM +//----------------------------------------------------------------------------- + +class performInvFFTTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion r; + LogicalRegion s; + LogicalRegion p; + FieldID r_fields[FID_last - 101]; + FieldID s_fields[1]; + FieldID p_fields[FID_FFTplans_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +private: + static const FieldID FID_out = FID_electricPotential; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT SOLVES THE TRIDIAGONAL PROBLEM OF THE TRANSFORMED POISSON EQ. +//----------------------------------------------------------------------------- + +class solveTridiagonalsTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion r; + LogicalRegion c; + LogicalRegion k2X; + LogicalRegion k2Z; + bool Robin_bc; + FieldID r_fields[1]; + FieldID c_fields[FID_CoeffType_last - 101]; + FieldID k2X_fields[1]; + FieldID k2Z_fields[1]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + // This function solves the tridiagonal system defined as: + // - acc_fft: constains the rhs in input and the solution in output + // - acc_a: subdiagonal coefficients + // - acc_b: diagonal coefficients + // - acc_c: superdiagonal coefficients + // - aux: auxiliary vector (is going to be overwritten) needs to be thread safe + // - k2X: squared complex wave number in the x direction + // - k2Z: squared complex wave number in the z direction + // - i: x index + // - lo_j: lower y index + // - hi_j: higher y index + // - k: z index + // - Robin_bc : flag to apply Robin BC (Dirichklet only on the mean) + __CUDA_H__ + static inline void solveTridiagonal(const AccessorRW, 3> acc_fft, + const AccessorRO< double, 1> acc_a, + const AccessorRO< double, 1> acc_b, + const AccessorRO< double, 1> acc_c, + complex *aux, + const complex k2X, + const complex k2Z, + const int i, + const int lo_j, + const int hi_j, + const int k, + const bool Robin_bc) { + const bool Neumann = (Robin_bc && ((i != 0) || (k != 0))); + // solve the tridiagonal system with Thomas + const Point<3> p = Point<3>(i, lo_j, k); + complex beta = k2X + k2Z + complex((Neumann) ? 1.0 : acc_b[lo_j], 0.0); + complex cm1 = complex((Neumann) ? -1.0 : acc_c[lo_j], 0.0); + acc_fft[p] /= beta; + // Forward pass + __UNROLL__ + for (int j = lo_j+1; j < hi_j; j++) { + const Point<3> p = Point<3>(i, j, k); + const Point<3> pm1 = Point<3>(i, j-1, k); + aux[j] = cm1/beta; + cm1 = complex(acc_c[j], 0.0); + beta = k2X + k2Z + + complex(acc_b[j], 0.0) + - complex(acc_a[j], 0.0)*aux[j]; + acc_fft[p] = (acc_fft[p] - complex(acc_a[j], 0.0)*acc_fft[pm1])/beta; + } + { + const Point<3> p = Point<3>(i, hi_j, k); + const Point<3> pm1 = Point<3>(i, hi_j-1, k); + const int j = hi_j; + const double a = (Neumann) ? -1.0 : acc_a[j]; + const double b = (Neumann) ? 1.0 : acc_b[j]; + aux[j] = cm1/beta; + beta = k2X + k2Z + + complex(b, 0.0) + - complex(a, 0.0)*aux[j]; + acc_fft[p] = (acc_fft[p] - complex(a, 0.0)*acc_fft[pm1])/beta; + } + // Back substitution + __UNROLL__ + for (int j = hi_j; j > lo_j; j--) { + const Point<3> p = Point<3>(i, j, k); + const Point<3> pm1 = Point<3>(i, j-1, k); + acc_fft[pm1] -= aux[j]*acc_fft[p]; + } + } +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +#endif // __POISSON_HPP__ diff --git a/src/Poisson/Poisson.rg b/src/Poisson/Poisson.rg new file mode 100644 index 0000000..5efd66c --- /dev/null +++ b/src/Poisson/Poisson.rg @@ -0,0 +1,577 @@ +-- Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +-- Developer: Mario Di Renzo +-- Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +-- URL: https://cerfacs.fr +-- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +-- HTR solver: An open-source exascale-oriented task-based +-- multi-GPU high-order code for hypersonic aerothermodynamics. +-- Computer Physics Communications 255, 107262" +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +-- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import "regent" + +-- srcFld: list of fields in Fluid_columns required for the source term +-- outFld: field in Fluid_columns containing the solution +-- mXFld: field in Fluid_columns containing the cell centered metric along X +-- mYFld: field in Fluid_columns containing the cell centered metric along Y +-- mZFld: field in Fluid_columns containing the cell centered metric alond Z +-- mY_sFld: field in Fluid_columns containing the staggered metric along Y + +return function(SCHEMA, MIX, TYPES, Fluid_columns, + srcFlds, TID_DirFFT, + outFld, + mXFld, mYFld, mZFld, mY_sFld, nType) local Exports = {} + +local USE_CUDA = (os.getenv("USE_CUDA") == "1") + +------------------------------------------------------------------------------- +-- CHECK THAT TID_DirFFT IS CORRCTLY SET +------------------------------------------------------------------------------- +if (TID_DirFFT == TYPES.TID_performDirFFTFromField) then + assert(table.getn(srcFlds) == 1, "performDirFFTFromField requires only one srcFlds") +elseif (TID_DirFFT == TYPES.TID_performDirFFTFromMix) then + -- Nothing to do +else + assert(false, "Unsupported TID_DirFFT in Poisson solver") +end + +------------------------------------------------------------------------------- +-- IMPORTS +------------------------------------------------------------------------------- +local C = regentlib.c +local UTIL = require 'util-desugared' +local CONST = require "prometeo_const" +local POISSON_H = terralib.includec("Poisson.h", {"-DUSE_CUDA="..os.getenv("USE_CUDA")}) + +local sin = regentlib.sin(double) +local cos = regentlib.cos(double) +local sqrt = regentlib.sqrt(double) + +local PI = CONST.PI + +-- Node types +local L_S_node = CONST.L_S_node +local R_S_node = CONST.R_S_node +local L_C_node = CONST.L_C_node +local R_C_node = CONST.R_C_node + +------------------------------------------------------------------------------- +-- DATA STRUCTURES +------------------------------------------------------------------------------- + +-- Data for tridiagonal system +local struct CoeffType { + -- Sub-diagonal coefficients + a : double; + -- diagonal coefficients + b : double; + -- super-diagonal coefficients + c : double; +} + +-- FFT plans data +local fftw_plan = terralib.includec("fftw3.h").fftw_plan +local cufftHandle = int +if USE_CUDA then + cufftHandle = terralib.includec("cufft.h").cufftHandle +end +local fspace fftPlansType { + -- FFTW plan for direct transform + fftw_fwd : fftw_plan, + -- FFTW plan for inverse transform + fftw_bwd : fftw_plan, + -- cuFFT plan + cufft : cufftHandle, + -- processor index + id : C.legion_address_space_t, +} + +Exports.DataList = { + -- Data region + fft = regentlib.newsymbol(), + -- FFT plans + plans = regentlib.newsymbol(), + -- Data partitions + Fluid_XZslubs = regentlib.newsymbol("Poisson_Fluid_XZslubs"), + Fluid_Yplanes = regentlib.newsymbol("Poisson_Fluid_Yplanes"), + fft_XZslubs = regentlib.newsymbol("Poisson_fft_XZslubs"), + fft_Yplanes = regentlib.newsymbol("Poisson_fft_Yplanes"), + fft_yNeg = regentlib.newsymbol("Poisson_fft_yNeg"), + fft_yPos = regentlib.newsymbol("Poisson_fft_yPos"), + plans_p = regentlib.newsymbol("Poisson_plans"), + -- Launch index spaces + fft_yNeg_ispace = regentlib.newsymbol(), + fft_yPos_ispace = regentlib.newsymbol(), + -- Auxiliary regions and partitions + Coeffs = regentlib.newsymbol(), + k2X = regentlib.newsymbol(), + k2Z = regentlib.newsymbol(), +} + +------------------------------------------------------------------------------- +-- PARTITIONING UTILS +------------------------------------------------------------------------------- + +-- Partitions a 3D region into XZ slubs +-- TODO: Here we are kind of cheating. We are associating a 2d tiling to a 3d index space +-- so we can use the same functor in the mapper. We could improve this in the future. +local function mkGenerateXZslubs(name) + local generateXZslubs + local p = regentlib.newsymbol(name) + __demand(__inline) + task generateXZslubs(r : region(ispace(int3d), Fluid_columns), + cs : ispace(int3d), + halo : int3d, + offset : int3d) + var my_nty = 1 + -- Number of tiles in the x and z directions + var Ntiles = cs.volume + var a = int(sqrt(Ntiles))+1 + var my_ntx : int + for i=a, 0, -1 do + if ((Ntiles % i) == 0) then + my_ntx = i + break + end + end + var my_ntz = Ntiles/my_ntx + + -- Partition points + var Nx = r.bounds.hi.x - 2*halo.x + 1; var ntx = cs.bounds.hi.x + 1 + var Ny = r.bounds.hi.y - 2*halo.y + 1; var nty = cs.bounds.hi.y + 1 + var Nz = r.bounds.hi.z - 2*halo.z + 1; var ntz = cs.bounds.hi.z + 1 + regentlib.assert(r.bounds.lo == int3d{0,0,0}, "Can only partition root region") + -- regentlib.assert(Nx % ntx == 0, "Uneven partitioning on x") + -- regentlib.assert(Ny % nty == 0, "Uneven partitioning on y") + -- regentlib.assert(Nz % ntz == 0, "Uneven partitioning on z") + var modP = int3d({Nx % my_ntx, Ny % my_nty, Nz % my_ntz}) + regentlib.assert(-my_ntx <= offset.x and offset.x <= my_ntx, "offset.x too large") + regentlib.assert(-my_nty <= offset.y and offset.y <= my_nty, "offset.y too large") + regentlib.assert(-my_ntz <= offset.z and offset.z <= my_ntz, "offset.z too large") + var coloring = regentlib.c.legion_domain_point_coloring_create() + for c_real in cs do + var c = (c_real - offset + {ntx,nty,ntz}) % {ntx,nty,ntz} + -- project the 3d index space into a 2d index space + var ind = ((c.z*nty+c.y)*ntx+c.x) + var c2d = int3d({ind%my_ntx, (ind/my_ntx)%my_nty, ind/(my_ntx*my_nty)}) + -- define the partition + var rect = rect3d{ + lo = int3d{halo.x + (Nx/my_ntx)*(c2d.x ) + min(c2d.x , modP.x), + halo.y + (Ny/my_nty)*(c2d.y ) + min(c2d.y , modP.y), + halo.z + (Nz/my_ntz)*(c2d.z ) + min(c2d.z , modP.z)}, + hi = int3d{halo.x + (Nx/my_ntx)*(c2d.x+1) + min(c2d.x+1, modP.x) - 1, + halo.y + (Ny/my_nty)*(c2d.y+1) + min(c2d.y+1, modP.y) - 1, + halo.z + (Nz/my_ntz)*(c2d.z+1) + min(c2d.z+1, modP.z) - 1}} + if c2d.x == 0 then rect.lo.x -= halo.x end + if c2d.y == 0 then rect.lo.y -= halo.y end + if c2d.z == 0 then rect.lo.z -= halo.z end + if c2d.x == my_ntx-1 then rect.hi.x += halo.x end + if c2d.y == my_nty-1 then rect.hi.y += halo.y end + if c2d.z == my_ntz-1 then rect.hi.z += halo.z end + regentlib.c.legion_domain_point_coloring_color_domain(coloring, c_real, rect) + end + var [p] = partition(disjoint, r, coloring, cs) + regentlib.c.legion_domain_point_coloring_destroy(coloring) + return [p] + end + return generateXZslubs +end + +-- Partitions a 3D region into Y planes +-- TODO: Here we are kind of cheating. We are associating a 2d tiling to a 3d index space +-- so we can use the same functor in the mapper. We could improve this in the future. +local function mkGenerateYplanes(name) + local generateYplanes + local p = regentlib.newsymbol(name) + __demand(__inline) + task generateYplanes(r : region(ispace(int3d), Fluid_columns), + cs : ispace(int3d), + halo : int3d, + offset : int3d) + -- here we are only partitioning along y + var my_ntx = 1 + var my_nty = cs.volume + var my_ntz = 1 + + -- Partition points + var Nx = r.bounds.hi.x - 2*halo.x + 1; var ntx = cs.bounds.hi.x + 1 + var Ny = r.bounds.hi.y - 2*halo.y + 1; var nty = cs.bounds.hi.y + 1 + var Nz = r.bounds.hi.z - 2*halo.z + 1; var ntz = cs.bounds.hi.z + 1 + regentlib.assert(r.bounds.lo == int3d{0,0,0}, "Can only partition root region") + -- regentlib.assert(Nx % ntx == 0, "Uneven partitioning on x") + -- regentlib.assert(Ny % nty == 0, "Uneven partitioning on y") + -- regentlib.assert(Nz % ntz == 0, "Uneven partitioning on z") + var modP = int3d({Nx % my_ntx, Ny % my_nty, Nz % my_ntz}) + regentlib.assert(-my_ntx <= offset.x and offset.x <= my_ntx, "offset.x too large") + regentlib.assert(-my_nty <= offset.y and offset.y <= my_nty, "offset.y too large") + regentlib.assert(-my_ntz <= offset.z and offset.z <= my_ntz, "offset.z too large") + var coloring = regentlib.c.legion_domain_point_coloring_create() + for c_real in cs do + var c = (c_real - offset + {ntx,nty,ntz}) % {ntx,nty,ntz} + -- project the 3d index space into a 2d index space + var ind = ((c.z*nty+c.y)*ntx+c.x) + var c1d = int3d({ind%my_ntx, (ind/my_ntx)%my_nty, ind/(my_ntx*my_nty)}) + -- define the partition + var rect = rect3d{ + lo = int3d{halo.x + (Nx/my_ntx)*(c1d.x ) + min(c1d.x , modP.x), + halo.y + (Ny/my_nty)*(c1d.y ) + min(c1d.y , modP.y), + halo.z + (Nz/my_ntz)*(c1d.z ) + min(c1d.z , modP.z)}, + hi = int3d{halo.x + (Nx/my_ntx)*(c1d.x+1) + min(c1d.x+1, modP.x) - 1, + halo.y + (Ny/my_nty)*(c1d.y+1) + min(c1d.y+1, modP.y) - 1, + halo.z + (Nz/my_ntz)*(c1d.z+1) + min(c1d.z+1, modP.z) - 1}} +-- We do not need to do FFT transform of the ghost data + if c1d.x == 0 then rect.lo.x -= halo.x end + if c1d.y == 0 then rect.lo.y -= halo.y end + if c1d.z == 0 then rect.lo.z -= halo.z end + if c1d.x == my_ntx-1 then rect.hi.x += halo.x end + if c1d.y == my_nty-1 then rect.hi.y += halo.y end + if c1d.z == my_ntz-1 then rect.hi.z += halo.z end + regentlib.c.legion_domain_point_coloring_color_domain(coloring, c_real, rect) + end + var [p] = partition(disjoint, r, coloring, cs) + regentlib.c.legion_domain_point_coloring_destroy(coloring) + return [p] + end + return generateYplanes +end + +------------------------------------------------------------------------------- +-- DECLARE SYMBOLS +------------------------------------------------------------------------------- + +function Exports.DeclSymbols(DATA, Fluid, tiles, Fluid_Zones, Grid, config, MAPPER) return rquote + + -- Unpack the partitions that we are going to need + var {p_All, yNeg, yPos, yNeg_ispace, yPos_ispace} = Fluid_Zones + + if (config.Efield.type == SCHEMA.EFieldStruct_Ybc) then + --------------------------------------------------------------------------- + -- Perform checks on the input + --------------------------------------------------------------------------- + -- BC periodic on X and Z + regentlib.assert(config.BC.xBCLeft.type == SCHEMA.FlowBC_Periodic, + "Boundary conditions in the x direction must be periodic for this Poisson solver") + regentlib.assert(config.BC.zBCLeft.type == SCHEMA.FlowBC_Periodic, + "Boundary conditions in the z direction must be periodic for this Poisson solver") + -- Y BC cannot be periodic for now + regentlib.assert(config.BC.yBCLeft.type ~= SCHEMA.FlowBC_Periodic, + "Boundary conditions in the y direction cannot be periodic for this Poisson solver") + -- Uniform mesh on X and Z + regentlib.assert(config.Grid.xType == SCHEMA.GridType_Uniform, + "Computational mesh has to be uniform in the x direction") + regentlib.assert(config.Grid.zType == SCHEMA.GridType_Uniform, + "Computational mesh has to be uniform in the z direction") + end + + --------------------------------------------------------------------------- + -- Create Regions and Partitions + --------------------------------------------------------------------------- + var sampleId = config.Mapping.sampleId + + -- Define FFT region + var [DATA.fft] = region(Fluid.ispace, complex64); + [UTIL.emitRegionTagAttach(DATA.fft, MAPPER.SAMPLE_ID_TAG, sampleId, int)]; + + -- Define data partitions for Poisson solver + var [DATA.Fluid_XZslubs] = [mkGenerateXZslubs("Poisson_Fluid_XZslubs")] + (Fluid, tiles, int3d{Grid.xBnum, Grid.yBnum, Grid.zBnum}, int3d{0,0,0}) + var [DATA.Fluid_Yplanes] = [mkGenerateYplanes("Poisson_Fluid_Yplanes")] + (Fluid, tiles, int3d{Grid.xBnum, Grid.yBnum, Grid.zBnum}, int3d{0,0,0}); + + var [DATA.fft_XZslubs] = DATA.fft & DATA.Fluid_XZslubs + var [DATA.fft_Yplanes] = DATA.fft & DATA.Fluid_Yplanes; + [UTIL.emitPartitionNameAttach(rexpr DATA.fft_XZslubs end, "Poisson_fft_XZslubs")]; + [UTIL.emitPartitionNameAttach(rexpr DATA.fft_Yplanes end, "Poisson_fft_Yplanes")]; + + var [DATA.fft_yNeg] = DATA.fft & cross_product(yNeg, p_All)[0] + var [DATA.fft_yPos] = DATA.fft & cross_product(yPos, p_All)[0]; + [UTIL.emitPartitionNameAttach(rexpr DATA.fft_yNeg end, "Poisson_fft_yNeg")]; + [UTIL.emitPartitionNameAttach(rexpr DATA.fft_yPos end, "Poisson_fft_yPos")]; + var [DATA.fft_yNeg_ispace] = yNeg_ispace + var [DATA.fft_yPos_ispace] = yPos_ispace + + -- Define plans for FFTs + var [DATA.plans] = region(ispace(int1d, Grid.numTiles), fftPlansType); + [UTIL.emitRegionTagAttach(DATA.plans, MAPPER.SAMPLE_ID_TAG, sampleId, int)]; + var [DATA.plans_p] = [UTIL.mkPartitionByTile(int1d, int3d, fftPlansType, "Poisson_plans")] + (DATA.plans, tiles, 0, int3d{0,0,0}); + + -- Define region for tridiagonal coefficients + var [DATA.Coeffs] = region(ispace(int1d, Fluid.bounds.hi.y+1, Fluid.bounds.lo.y), CoeffType); + [UTIL.emitRegionTagAttach(DATA.Coeffs, MAPPER.SAMPLE_ID_TAG, sampleId, int)]; + + -- Define regions for squared complex wavenumbers + var [DATA.k2X] = region(ispace(int1d, Fluid.bounds.hi.x+1, Fluid.bounds.lo.x), complex64) + var [DATA.k2Z] = region(ispace(int1d, Fluid.bounds.hi.z+1, Fluid.bounds.lo.z), complex64); + [UTIL.emitRegionTagAttach(DATA.k2X, MAPPER.SAMPLE_ID_TAG, sampleId, int)]; + [UTIL.emitRegionTagAttach(DATA.k2Z, MAPPER.SAMPLE_ID_TAG, sampleId, int)]; + +end end + +------------------------------------------------------------------------------- +-- INITIALIZATION FUNCTIONS +------------------------------------------------------------------------------- + +-- Fills the FFT plans +local __demand(__inline) +task fillFFTplans(r : region(ispace(int1d), fftPlansType)) +where + writes(r) +do + fill(r.fftw_fwd, [fftw_plan](0)) + fill(r.fftw_bwd, [fftw_plan](0)) + fill(r.cufft, [cufftHandle](0)) + fill(r.id, [C.legion_address_space_t](0)) +end + +-- Initializes the FFT plans +local extern task initFFTplans(r : region(ispace(int3d), Fluid_columns), + p : region(ispace(int1d), fftPlansType)) +where + reads writes(p) +end +initFFTplans:set_task_id(TYPES.TID_initFFTplans) + +-- Initializes the coefficients for the tridiagonal system +local __demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA +task initCoefficients(r : region(ispace(int3d), Fluid_columns), + s : region(ispace(int1d), CoeffType), + Ng : int) +where + reads(r.[mYFld]), + reads(r.[mY_sFld]), + reads(r.[nType]), + writes(s) +do + __demand(__openmp) + for c in s do + var cr = int3d{0, int(c), 0} + var cr_m1 = cr - int3d{0, 1, 0} + if int(c) >= Ng then + s[c].a = r[cr_m1].[mY_sFld] *r[cr].[mYFld] + s[c].b = -(r[cr ].[mY_sFld] + r[cr_m1].[mY_sFld])*r[cr].[mYFld] + s[c].c = r[cr ].[mY_sFld] *r[cr].[mYFld] + end + end + + -- Add BCs + if (r[int3d{0, s.bounds.lo, 0}].[nType] == L_S_node) then + s[s.bounds.lo].a = 0.0 + s[s.bounds.lo].b = 1.0 + s[s.bounds.lo].c = 0.0 + elseif (r[int3d{0, s.bounds.lo, 0}].[nType] == L_C_node) then + s[s.bounds.lo].a = 0.0 + s[s.bounds.lo].b = 0.5 + s[s.bounds.lo].c = 0.5 + end + + if (r[int3d{0, s.bounds.hi, 0}].[nType] == R_S_node) then + s[s.bounds.hi].a = 0.0 + s[s.bounds.hi].b = 1.0 + s[s.bounds.hi].c = 0.0 + elseif (r[int3d{0, s.bounds.hi, 0}].[nType] == R_C_node) then + s[s.bounds.hi].a = 0.5 + s[s.bounds.hi].b = 0.5 + s[s.bounds.hi].c = 0.0 + end +end + +local __demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP +task PrintCoefficients(c : region(ispace(int1d), CoeffType)) +where + reads(c.{a, b, c}) +do + C.printf("Coefficients:\n") + for i in c do + C.printf("%d %10.4e %10.4e %10.4e\n", i, c[i].a, c[i].b, c[i].c) + end +end + +-- Initializes the squared complex wavenumbers +local function mkInitWaveNumbers(sdir) + local InitWaveNumbers + local m + local mkcr + if sdir == "x" then + m = mXFld + mkcr = function(c, r) return rexpr int3d({ int(c), r.bounds.lo.y, r.bounds.hi.z}) end end + elseif sdir == "z" then + m = mZFld + mkcr = function(c, r) return rexpr int3d({r.bounds.lo.x, r.bounds.lo.y, int(c)}) end end + else assert(false) end + + __demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA + task InitWaveNumbers(k : region(ispace(int1d), complex64), + r : region(ispace(int3d), Fluid_columns)) + where + reads(r.[m]), + reads writes(k) + do + var N = k.ispace.volume + for c in k do + var cr = [mkcr(c, r)]; + var theta = double(c - ((c*2-1)/N)*N)*2.0*PI/N + var a1 = complex64({cos( theta), sin( theta)}) + var a2 = complex64({cos(-theta), sin(-theta)}) + k[c] = (a1 + a2 - 2.0)*r[cr].[m]*r[cr].[m] + end + end + return InitWaveNumbers +end + +function Exports.Init(DATA, tiles, Grid, config) return rquote + if (config.Efield.type == SCHEMA.EFieldStruct_Ybc) then + -- Init fft data + fill([DATA.fft], complex64{0.0, 0.0}) + + -- Init plans for FFTs + fillFFTplans(DATA.plans) + __demand(__index_launch) + for c in tiles do + initFFTplans(DATA.Fluid_Yplanes[c], DATA.plans_p[c]) + end + + -- Init tridiagonal coefficients + fill([DATA.Coeffs].a, 0.0) + fill([DATA.Coeffs].b, 0.0) + fill([DATA.Coeffs].c, 0.0) + initCoefficients(DATA.Fluid_XZslubs[tiles.bounds.lo], DATA.Coeffs, Grid.yBnum) + --PrintCoefficients(DATA.Coeffs) + + -- Init regions for squared complex wavenumbers + fill([DATA.k2X], complex64{0.0, 0.0}) + fill([DATA.k2Z], complex64{0.0, 0.0}); + [mkInitWaveNumbers("x")](DATA.k2X, DATA.Fluid_Yplanes[tiles.bounds.lo]); + [mkInitWaveNumbers("z")](DATA.k2Z, DATA.Fluid_Yplanes[tiles.bounds.lo]); + end +end end + +------------------------------------------------------------------------------- +-- CLEANUP FUNCTIONS +------------------------------------------------------------------------------- + +local extern task destroyFFTplans(p : region(ispace(int1d), fftPlansType)) +where + reads writes(p) +end +destroyFFTplans:set_task_id(TYPES.TID_destroyFFTplans) + +function Exports.Cleanup(DATA, tiles, config) return rquote + if (config.Efield.type == SCHEMA.EFieldStruct_Ybc) then + -- Destroy plans for FFTs + __demand(__index_launch) + for c in tiles do + destroyFFTplans(DATA.plans_p[c]) + end + end +end end + +------------------------------------------------------------------------------- +-- POISSON ROUTINES +------------------------------------------------------------------------------- + +local __demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA +task setFFTBCs(fft : region(ispace(int3d), complex64), + bc : double) +where + writes(fft) +do + __demand(__openmp) + for c in fft do + if ((c.x == 0) and (c.z == 0)) then + -- this is the 0 wave number + fft[c] = complex64{ bc, 0.0} + else + fft[c] = complex64{0.0, 0.0} + end + end +end + +local extern task performDirFFT(r : region(ispace(int3d), Fluid_columns), + s : region(ispace(int3d), complex64), + p : region(ispace(int1d), fftPlansType), + Mix : MIX.Mixture) +where + reads(r.[srcFlds]), + reads(p), + writes(s) +end +performDirFFT:set_task_id(TID_DirFFT) + +local extern task solveTridiagonals(r : region(ispace(int3d), complex64), + c : region(ispace(int1d), CoeffType), + k2X : region(ispace(int1d), complex64), + k2Z : region(ispace(int1d), complex64), + Robin_bc : bool) +where + reads writes(r), + reads(c.{a, b, c}), + reads(k2X, k2Z) +end +solveTridiagonals:set_task_id(TYPES.TID_solveTridiagonals) + +local extern task performInvFFT(r : region(ispace(int3d), Fluid_columns), + s : region(ispace(int3d), complex64), + p : region(ispace(int1d), fftPlansType)) +where + reads(p), + reads writes(s), + writes(r.[outFld]) +end +performInvFFT:set_task_id(TYPES.TID_performInvFFT) + +function Exports.Solve(DATA, tiles, Mix, config) return rquote + if (config.Efield.type == SCHEMA.EFieldStruct_Ybc) then + -- Perform planar FFTs + __demand(__index_launch) + for c in tiles do + performDirFFT(DATA.Fluid_Yplanes[c], DATA.fft_Yplanes[c], DATA.plans_p[c], + Mix) + end + + -- Set electric potential bcs + __demand(__index_launch) + for c in DATA.fft_yNeg_ispace do + setFFTBCs(DATA.fft_yNeg[c], config.Efield.u.Ybc.Phi_bottom) + end + __demand(__index_launch) + for c in DATA.fft_yPos_ispace do + setFFTBCs(DATA.fft_yPos[c], config.Efield.u.Ybc.Phi_top) + end + + -- Solve the tridiagonal + __demand(__index_launch) + for c in tiles do + solveTridiagonals(DATA.fft_XZslubs[c], DATA.Coeffs, DATA.k2X, DATA.k2Z, + config.Efield.u.Ybc.Robin_bc) + end + + -- Perform planar inverse FFTs + __demand(__index_launch) + for c in tiles do + performInvFFT(DATA.Fluid_Yplanes[c], DATA.fft_Yplanes[c], DATA.plans_p[c]) + end + end +end end + +return Exports end + diff --git a/src/Reaction.rg b/src/Reaction.rg deleted file mode 100644 index 5d00dbe..0000000 --- a/src/Reaction.rg +++ /dev/null @@ -1,177 +0,0 @@ --- Copyright (c) "2019, by Stanford University --- Developer: Mario Di Renzo --- Affiliation: Center for Turbulence Research, Stanford University --- URL: https://ctr.stanford.edu --- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). --- HTR solver: An open-source exascale-oriented task-based --- multi-GPU high-order code for hypersonic aerothermodynamics. --- Computer Physics Communications 255, 107262" --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- * Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- * Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in the --- documentation and/or other materials provided with the distribution. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND --- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY --- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES --- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; --- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND --- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import "regent" - -return function(nSpec, MAX_NUM_REACTANTS, MAX_NUM_TB) local Exports = {} - --- Utility functions -local log = regentlib.log(double) -local exp = regentlib.exp(double) -local pow = regentlib.pow(double) -local sqrt = regentlib.sqrt(double) - --- Constants -local RGAS = 8.3144598 -- [J/(mol K)] - -local struct Reactant { - ind : int, -- Index in the species vector - nu : double, -- Stoichiometric coefficient - ord : double, -- Order of the reactant -} - -local struct ThirdBd { - ind : int, -- Index in the species vector - eff : double, -- Efficiency as a third body -} - --- Reaction structure -struct Exports.Reaction { - A : double -- Arrhenius pre-exponential factor [m^{3*(o-1)}/(mol^(o-1) s)] where o is the order fo the reaction - n : double -- Arrhenius temperature exponent - EovR : double -- Arrhenius activation energy [K] - has_backward : bool -- Self-explenatory - - Neducts : int -- number of reactants - Npducts : int -- number of products - Nthirdb : int -- number of third bodies - - educts : Reactant[MAX_NUM_REACTANTS] -- List of reactants and stoichiometric coefficients - pducts : Reactant[MAX_NUM_REACTANTS] -- List of products and stoichiometric coefficients - thirdb : ThirdBd[MAX_NUM_TB] -- List of third bodies and efficiencies - --- vector>> educts -- List of reactants and stoichiometric coefficient --- vector>> pducts -- List of products and stoichiometric coefficient --- vector>> thirdb -- List of third bodies and efficiency -} - -__demand(__inline) -task Exports.AddEduct( r : Exports.Reaction, index : int, nu : double, ord : double ) - regentlib.assert(r.Neducts < MAX_NUM_REACTANTS, "Increase MAX_NUM_REACTANTS") - r.educts[r.Neducts].ind = index - r.educts[r.Neducts].nu = nu - r.educts[r.Neducts].ord = ord - r.Neducts += 1 - return r -end - -__demand(__inline) -task Exports.AddPduct( r : Exports.Reaction, index : int, nu : double, ord : double ) - regentlib.assert(r.Npducts < MAX_NUM_REACTANTS, "Increase MAX_NUM_REACTANTS") - r.pducts[r.Npducts].ind = index - r.pducts[r.Npducts].nu = nu - r.pducts[r.Npducts].ord = ord - r.Npducts += 1 - return r -end - -__demand(__inline) -task Exports.AddThirdb( r : Exports.Reaction, index : int, eff : double ) - regentlib.assert(r.Nthirdb < MAX_NUM_TB, "Increase MAX_NUM_TB") - r.thirdb[r.Nthirdb].ind = index - r.thirdb[r.Nthirdb].eff = eff - r.Nthirdb += 1 - return r -end - -local __demand(__inline) -task CompRateCoeff( r : Exports.Reaction, T : double ) - var Kf = r.A - if ( r.n ~= 0.0 ) then - Kf *= pow( T, r.n ) - end - if ( r.EovR > 1e-5 ) then - Kf *= exp( -r.EovR / T ) - end - return Kf -end - -local __demand(__inline) -task CompBackwardRateCoeff( r : Exports.Reaction, Kf : double, P : double, T : double, G : double[nSpec] ) - var sumNu = 0.0 - var sumNuG = 0.0 - for i = 0, r.Neducts do - sumNu -= r.educts[i].nu - sumNuG -= r.educts[i].nu*G[r.educts[i].ind] - end - for i = 0, r.Npducts do - sumNu += r.pducts[i].nu - sumNuG += r.pducts[i].nu*G[r.pducts[i].ind] - end - var lnKc = - sumNuG - sumNu * ( log(T) + log(RGAS/P) ) - return Kf * exp(-lnKc) -end - -local __demand(__inline) -task GetReactionRate( r : Exports.Reaction, P : double, T : double, C : double[nSpec], G : double[nSpec] ) - -- Forward reaction rate - var Kf = CompRateCoeff(r, T) - var a = 1.0 - for i = 0, r.Neducts do - var ind = r.educts[i].ind - a *= pow(C[ind],r.educts[i].ord) - end - -- Backward reaction rate - var Kb = 0.0 - var b = 1.0 - if ( r.has_backward ) then - Kb = CompBackwardRateCoeff(r, Kf, P, T, G) - for i = 0, r.Npducts do - var ind = r.pducts[i].ind - b *= pow(C[ind],r.pducts[i].ord) - end - end - -- Third body efficiency - var c = 1.0 - if (r.Nthirdb ~= 0) then - c = 0.0 - for i = 0, r.Nthirdb do - var ind = r.thirdb[i].ind - c += C[ind]*r.thirdb[i].eff - end - end - -- Compute reaction rate - return c*(Kf*a - Kb*b) -end - -__demand(__inline) -task Exports.AddProductionRates( r : Exports.Reaction, P : double, T : double, C : double[nSpec], G : double[nSpec], w : double[nSpec] ) - var R = GetReactionRate(r, P, T, C, G) - for i = 0, r.Neducts do - var ind = r.educts[i].ind - w[ind] -= r.educts[i].nu*R - end - for i = 0, r.Npducts do - var ind = r.pducts[i].ind - w[ind] += r.pducts[i].nu*R - end - return w -end - -return Exports end diff --git a/src/Species.hpp b/src/Species.hpp deleted file mode 100644 index 85417ff..0000000 --- a/src/Species.hpp +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) "2019, by Stanford University -// Developer: Mario Di Renzo -// Affiliation: Center for Turbulence Research, Stanford University -// URL: https://ctr.stanford.edu -// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). -// HTR solver: An open-source exascale-oriented task-based -// multi-GPU high-order code for hypersonic aerothermodynamics. -// Computer Physics Communications 255, 107262" -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef Species_HPP -#define Species_HPP - -#include -#include - -#include "Species.h" - -#ifndef __CUDA_HD__ -#ifdef __CUDACC__ -#define __CUDA_HD__ __host__ __device__ -#else -#define __CUDA_HD__ -#endif -#endif - -#define PI 3.1415926535898 - -// omega_mu() returns the collision integral for mu given dimensionless temperature t/(eps/k). -// TODO: These come from FlameMaster. -// At a certain point, verify these implementations. -__CUDA_HD__ -inline double omega_mu(const double T) { - const double m1 = 3.3530622607; - const double m2 = 2.53272006; - const double m3 = 2.9024238575; - const double m4 = 0.11186138893; - const double m5 = 0.8662326188; // = -0.1337673812 + 1.0 - const double m6 = 1.3913958626; - const double m7 = 3.158490576; - const double m8 = 0.18973411754; - const double m9 = 0.00018682962894; - - const double num = m1 + T*(m2 + T*(m3 + T*m4)); - const double den = m5 + T*(m6 + T*(m7 + T*(m8 + T*m9))); - return num / den; -}; - -// omega_D() returns the Stossintegral for a given dimensionless temperature t/(eps/k) -__CUDA_HD__ -inline double omega_D(const double T) { - const double m1 = 6.8728271691; - const double m2 = 9.4122316321; - const double m3 = 7.7442359037; - const double m4 = 0.23424661229; - const double m5 = 1.45337701568; // = 1.0 + 0.45337701568 - const double m6 = 5.2269794238; - const double m7 = 9.7108519575; - const double m8 = 0.46539437353; - const double m9 = 0.00041908394781; - - const double num = m1 + T * (m2 + T * (m3 + T * m4)); - const double den = m5 + T * (m6 + T * (m7 + T * (m8 + T * m9))); - return num / den; -}; - -__CUDA_HD__ -inline double GetCp(const Spec & s, const double T) { - //assert(T < s.cpCoeff.TMax, "Exceeded maximum temeperature") - //assert(T > s.cpCoeff.TMin, "Exceeded minimum temeperature") - - const double rOvW = RGAS/s.W; - const double Tinv = 1.0/T; - const double * cpCoeff = ( T > s.cpCoeff.TSwitch2 ) ? s.cpCoeff.cpH : - ( T > s.cpCoeff.TSwitch1 ) ? s.cpCoeff.cpM : - s.cpCoeff.cpL; - return rOvW*( cpCoeff[0]*Tinv*Tinv + cpCoeff[1]*Tinv + cpCoeff[2] + T* - ( cpCoeff[3] + T* - ( cpCoeff[4] + T* - ( cpCoeff[5] + T*cpCoeff[6])))); -}; - -__CUDA_HD__ -inline double GetEnthalpy(const Spec & s, const double T) { - //assert(T < s.cpCoeff.TMax, "Exceeded maximum temeperature") - //assert(T > s.cpCoeff.TMin, "Exceeded minimum temeperature") - - const double rOvW = RGAS/s.W; - const double Tinv = 1.0/T; - const double * cpCoeff = ( T > s.cpCoeff.TSwitch2 ) ? s.cpCoeff.cpH : - ( T > s.cpCoeff.TSwitch1 ) ? s.cpCoeff.cpM : - s.cpCoeff.cpL; - const double E = -cpCoeff[0]*Tinv + cpCoeff[1]*log(T) + cpCoeff[7] + T* - ( cpCoeff[2] + T* - ( cpCoeff[3]*0.50 + T* - ( cpCoeff[4]/3 + T* - ( cpCoeff[5]*0.25 + cpCoeff[6]/5*T)))); - return E*rOvW; -}; - -__CUDA_HD__ -inline double GetMu(const Spec & s, const double T) { - const double num = 5 * sqrt(PI * s.W/Na * kb * T); - const double den = 16 * PI * pow(s.DiffCoeff.sigma,2) * omega_mu( T * s.DiffCoeff.kbOveps ); - return num/den; -}; - -__CUDA_HD__ -inline double GetDif(const Spec & s1, const Spec & s2, - const double P, const double T) { - double xi = 1.0; - if ((s1.DiffCoeff.mu*s2.DiffCoeff.mu == 0.0) and - (s1.DiffCoeff.mu+s2.DiffCoeff.mu != 0.0)) { - // If I have a polar to non-polar molecule interaction - double mup; - double alp; - double epr; - if (s1.DiffCoeff.mu != 0.0) { - mup = s1.DiffCoeff.mu/sqrt(pow(s1.DiffCoeff.sigma,3)*kb/s1.DiffCoeff.kbOveps); - alp = s1.DiffCoeff.alpha/s1.DiffCoeff.sigma; - epr = sqrt(s2.DiffCoeff.kbOveps/s1.DiffCoeff.kbOveps); - } else { - mup = s2.DiffCoeff.mu/sqrt(pow(s2.DiffCoeff.sigma,3)*kb/s2.DiffCoeff.kbOveps); - alp = s2.DiffCoeff.alpha/s2.DiffCoeff.sigma; - epr = sqrt(s1.DiffCoeff.kbOveps/s2.DiffCoeff.kbOveps); - } - xi = 1 + 0.25*mup*alp*epr; - } - const double invWij = (s1.W + s2.W)/(s1.W*s2.W); - const double kboEpsij = sqrt(s1.DiffCoeff.kbOveps * s2.DiffCoeff.kbOveps)/(xi*xi); - const double sigmaij = 0.5*(s1.DiffCoeff.sigma + s2.DiffCoeff.sigma)*pow(xi,1./6); - const double num = 3*sqrt(2*PI*pow(kb,3)*pow(T,3)*Na*invWij); - const double den = 16*PI*P*sigmaij*sigmaij*omega_D(T * kboEpsij); - return num/den; -}; - -__CUDA_HD__ -inline double GetSelfDiffusion(const Spec & s, const double T) { - // Already multiplied by partial density - const double num = 3*sqrt( PI*kb*T*s.W/Na ); - const double den = 8*PI*pow(s.DiffCoeff.sigma,2)*omega_D(T * s.DiffCoeff.kbOveps); - return num/den; -}; - -__CUDA_HD__ -inline double GetFZrot(const Spec & s, const double T) { - const double tmp = 1.0/(s.DiffCoeff.kbOveps*T); - return 1 + 0.5*pow(PI,1.5)*sqrt(tmp) - + (2 + 0.25*PI*PI)*tmp - + pow(PI,1.5)*pow(tmp,1.5); -}; - -__CUDA_HD__ -inline double GetLamAtom(const Spec & s, const double T) { - const double mu = GetMu(s, T); - return 15.0/4*mu*RGAS/s.W; -}; - -__CUDA_HD__ -inline double GetLamLinear(const Spec & s, const double T) { - const double CvTOvR = 1.5; - const double CvROvR = 1.0; - - const double CvT = CvTOvR*RGAS; - const double CvR = CvROvR*RGAS; - const double CvV = GetCp(s, T)*s.W - 3.5*RGAS; - - const double Dkk = GetSelfDiffusion(s, T); - const double mu = GetMu(s, T); - - const double fV = Dkk/mu; - - const double Zrot = s.DiffCoeff.Z298*GetFZrot(s, 298)/GetFZrot(s, T); - - const double A = 2.5 - fV; - const double B = Zrot + 2/PI*(5./3*CvROvR+fV); - - const double fT = 2.5 * (1. - 2*CvR*A/(PI*CvT*B)); - const double fR = fV*(1. + 2*A/(PI*B)); - - return mu/s.W*(fT*CvT + fR*CvR + fV*CvV); -}; - -__CUDA_HD__ -inline double GetLamNonLinear(const Spec & s, const double T) { - const double CvTOvR = 1.5; - const double CvROvR = 1.5; - - const double CvT = CvTOvR*RGAS; - const double CvR = CvROvR*RGAS; - const double CvV = GetCp(s, T)*s.W - 4.0*RGAS; - - const double Dkk = GetSelfDiffusion(s, T); - const double mu = GetMu(s, T); - - const double fV = Dkk/mu; - - const double Zrot = s.DiffCoeff.Z298*GetFZrot(s, 298.0)/GetFZrot(s, T); - - const double A = 2.5 - fV; - const double B = Zrot + 2/PI*(5./3*CvROvR+fV); - - const double fT = 2.5 * (1. - 2*CvR*A/(PI*CvT*B)); - const double fR = fV*(1. + 2*A/(PI*B)); - - return mu/s.W*(fT*CvT + fR*CvR + fV*CvV); -}; - -__CUDA_HD__ -inline double GetLam(const Spec & s, const double T) { - return ((s.Geom == SpeciesGeom_Atom) ? GetLamAtom(s, T) : - ((s.Geom == SpeciesGeom_Linear) ? GetLamLinear(s, T) : - /*(s.Geom == SpeciesGeom_NonLinear) ?*/ GetLamNonLinear(s, T))); -}; - -#endif // Species_HPP diff --git a/src/Species.rg b/src/Species.rg deleted file mode 100644 index bc2d5cd..0000000 --- a/src/Species.rg +++ /dev/null @@ -1,316 +0,0 @@ --- Copyright (c) "2019, by Stanford University --- Developer: Mario Di Renzo --- Affiliation: Center for Turbulence Research, Stanford University --- URL: https://ctr.stanford.edu --- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). --- HTR solver: An open-source exascale-oriented task-based --- multi-GPU high-order code for hypersonic aerothermodynamics. --- Computer Physics Communications 255, 107262" --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- * Redistributions of source code must retain the above copyright --- notice, this list of conditions and the following disclaimer. --- * Redistributions in binary form must reproduce the above copyright --- notice, this list of conditions and the following disclaimer in the --- documentation and/or other materials provided with the distribution. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND --- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY --- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES --- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; --- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND --- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import "regent" - -local Exports = {} - --- Utility functions -local log = regentlib.log(double) -local pow = regentlib.pow(double) -local sqrt = regentlib.sqrt(double) - --- Constants -local CONST = require "prometeo_const" -local RGAS = CONST.RGAS -- [J/(mol K)] -local Na = CONST.Na -- [1/mol] -local kb = CONST.kb -- [m^2 kg /( s^2 K)] -local PI = CONST.PI - --- Species geometries ---Mixture.SpeciesGeom = Enum( 'Atom', 'Linear', 'NonLinear' ) -local SpeciesGeom_Atom = 0 -local SpeciesGeom_Linear = 1 -local SpeciesGeom_NonLinear = 2 - -Exports.SpeciesGeom_Atom = SpeciesGeom_Atom -Exports.SpeciesGeom_Linear = SpeciesGeom_Linear -Exports.SpeciesGeom_NonLinear = SpeciesGeom_NonLinear - --- NASA polynomials data structure -local struct cpCoefficients -{ - TSwitch1 : double -- Switch temperature between Low and Mid temperature polynomials - TSwitch2 : double -- Switch temperature between Mid and High temperature polynomials - TMin : double -- Minimum temperature - TMax : double -- Maximum temperature - cpH : double[9] -- High temperature polynomials - cpM : double[9] -- Mid temperature polynomials - cpL : double[9] -- Low temperature polynomials -} - --- Coefficinets for diffusivity -local struct DiffCoefficients -{ - sigma : double -- Lennard-Jones collision diameter [m] - kbOveps : double -- Boltzmann constant divided by Lennard-Jones potential well depth [1/K] - mu : double -- Dipole moment [C*m] - alpha : double -- Polarizabilty [m] - Z298 : double -- Rotational relaxation collision number -} - --- Species structure -struct Exports.Species { - Name : int8[10] -- regentlib.string -- Name of the species - W : double -- Molar weight [kg/mol] - inx : int -- Index in the species vector - Geom : int -- = 0 (Atom), = 1 (Linear), = 2 (Non Linear) - cpCoeff : cpCoefficients - DiffCoeff : DiffCoefficients -} - --- omega_mu() returns the collision integral for mu given dimensionless temperature t/(eps/k). --- TODO: These come from FlameMaster. --- At a certain point, verify these implementations. -local __demand(__inline) -task omega_mu( T: double ) - var m1 = 3.3530622607 - var m2 = 2.53272006 - var m3 = 2.9024238575 - var m4 = 0.11186138893 - var m5 = 0.8662326188 -- = -0.1337673812 + 1.0 - var m6 = 1.3913958626 - var m7 = 3.158490576 - var m8 = 0.18973411754 - var m9 = 0.00018682962894 - - var num = m1 + T*(m2 + T*(m3 + T*m4)) - var den = m5 + T*(m6 + T*(m7 + T*(m8 + T*m9))) - return num / den -end - --- omega_D() returns the Stossintegral for a given dimensionless temperature t/(eps/k) -local __demand(__inline) -task omega_D( T : double ) - var m1 = 6.8728271691 - var m2 = 9.4122316321 - var m3 = 7.7442359037 - var m4 = 0.23424661229 - var m5 = 1.45337701568 -- = 1.0 + 0.45337701568 - var m6 = 5.2269794238 - var m7 = 9.7108519575 - var m8 = 0.46539437353 - var m9 = 0.00041908394781 - - return (m1 + T * (m2 + T * (m3 + T * m4))) / (m5 + T * (m6 + T * (m7 + T * (m8 + T * m9)))) -end - -__demand(__inline) -task Exports.GetCp( s : Exports.Species, T : double ) --- TODO: the assert is not yet supported by the cuda compiler --- regentlib.assert(T < s.cpCoeff.TMax, "Exceeded maximum temeperature") --- regentlib.assert(T > s.cpCoeff.TMin, "Exceeded minimum temeperature") - - var rOvW = RGAS/s.W - var Tinv = 1.0/T - var cpCoeff : double[9] - if ( T > s.cpCoeff.TSwitch2 ) then - cpCoeff = s.cpCoeff.cpH - elseif ( T > s.cpCoeff.TSwitch1 ) then - cpCoeff = s.cpCoeff.cpM - else - cpCoeff = s.cpCoeff.cpL - end - var cp = rOvW*( cpCoeff[0]*Tinv*Tinv + cpCoeff[1]*Tinv + cpCoeff[2] + T* - ( cpCoeff[3] + T* - ( cpCoeff[4] + T* - ( cpCoeff[5] + T*cpCoeff[6])))) - return cp -end - -__demand(__inline) -task Exports.GetFreeEnthalpy( s : Exports.Species, T : double ) - -- This is (H/(RT) - S/R) --- TODO: the assert is not yet supported by the cuda compiler --- regentlib.assert(T < s.cpCoeff.TMax, "Exceeded maximum temeperature") --- regentlib.assert(T > s.cpCoeff.TMin, "Exceeded minimum temeperature") - - var Tinv = 1.0/T - var logT = log(T) - var cpCoeff : double[9] - if ( T > s.cpCoeff.TSwitch2 ) then - cpCoeff = s.cpCoeff.cpH - elseif ( T > s.cpCoeff.TSwitch1 ) then - cpCoeff = s.cpCoeff.cpM - else - cpCoeff = s.cpCoeff.cpL - end - - var G = -0.5*cpCoeff[0]*Tinv*Tinv + cpCoeff[1]*Tinv*(1.0 + logT) + cpCoeff[2]*(1.0 - logT) + cpCoeff[7]*Tinv - cpCoeff[8] - G -= 0.5*T*( cpCoeff[3] + T* - ( cpCoeff[4]/3 + T* - ( cpCoeff[5]/6 + 0.1*T*cpCoeff[6] ))) - - return G -end - -__demand(__inline) -task Exports.GetEnthalpy( s : Exports.Species, T : double ) --- TODO: the assert is not yet supported by the cuda compiler - --regentlib.assert(T < s.cpCoeff.TMax, "Exceeded maximum temeperature") - --regentlib.assert(T > s.cpCoeff.TMin, "Exceeded minimum temeperature") - - var rOvW = RGAS/s.W - var Tinv = 1.0/T - var cpCoeff : double[9] - if ( T > s.cpCoeff.TSwitch2 ) then - cpCoeff = s.cpCoeff.cpH - elseif ( T > s.cpCoeff.TSwitch1 ) then - cpCoeff = s.cpCoeff.cpM - else - cpCoeff = s.cpCoeff.cpL - end - - var E = -cpCoeff[0]/T + cpCoeff[1]*log(T) + cpCoeff[7] + T* - ( cpCoeff[2] + T* - ( cpCoeff[3]*0.50 + T* - ( cpCoeff[4]/3 + T* - ( cpCoeff[5]*0.25 + cpCoeff[6]/5*T)))) - return E*rOvW -end - -__demand(__inline) -task Exports.GetMu( s : Exports.Species, T : double ) - var num = 5 * sqrt(PI * s.W/Na * kb * T) - var den = 16 * PI * pow(s.DiffCoeff.sigma,2) * omega_mu( T * s.DiffCoeff.kbOveps ) - return num/den -end - -__demand(__inline) -task Exports.GetDif( s1 : Exports.Species, s2 : Exports.Species, - P : double, T : double ) - var xi = 1.0 - if ( (s1.DiffCoeff.mu*s2.DiffCoeff.mu == 0.0) and - (s1.DiffCoeff.mu+s2.DiffCoeff.mu ~= 0.0) ) then - -- If I have a polar to non-polar molecule interaction - var mup : double - var alp : double - var epr : double - if (s1.DiffCoeff.mu ~= 0.0) then - mup = s1.DiffCoeff.mu/sqrt(pow(s1.DiffCoeff.sigma,3)*kb/s1.DiffCoeff.kbOveps) - alp = s1.DiffCoeff.alpha/s1.DiffCoeff.sigma - epr = sqrt(s2.DiffCoeff.kbOveps/s1.DiffCoeff.kbOveps) - else - mup = s2.DiffCoeff.mu/sqrt(pow(s2.DiffCoeff.sigma,3)*kb/s2.DiffCoeff.kbOveps) - alp = s2.DiffCoeff.alpha/s2.DiffCoeff.sigma - epr = sqrt(s1.DiffCoeff.kbOveps/s2.DiffCoeff.kbOveps) - end - xi = 1 + 0.25*mup*alp*epr - end - var invWij = (s1.W + s2.W)/(s1.W*s2.W) - var kboEpsij = sqrt(s1.DiffCoeff.kbOveps * s2.DiffCoeff.kbOveps)/(xi*xi) - var sigmaij = 0.5*(s1.DiffCoeff.sigma + s2.DiffCoeff.sigma)*pow(xi,1./6) - var num = 3*sqrt(2*PI*pow(kb,3)*pow(T,3)*Na*invWij) - var den = 16*PI*P*sigmaij*sigmaij*omega_D(T * kboEpsij) - return num/den -end - -local __demand(__inline) -task GetSelfDiffusion( s : Exports.Species, T : double ) - -- Already multiplied by partial density - var num = 3*sqrt( PI*kb*T*s.W/Na ) - var den = 8*PI*pow(s.DiffCoeff.sigma,2)*omega_D(T * s.DiffCoeff.kbOveps) - return num/den -end - -local __demand(__inline) -task GetFZrot( s : Exports.Species, T : double ) - var tmp = 1/(s.DiffCoeff.kbOveps*T) - return 1 + 0.5*pow(PI,1.5)*sqrt(tmp) - + (2 + 0.25*PI*PI)*tmp - + pow(PI,1.5)*pow(tmp,1.5) -end - -local __demand(__inline) -task GetLamAtom( s : Exports.Species, T : double ) - var mu = Exports.GetMu(s, T) - return 15.0/4*mu*RGAS/s.W -end - - -local __demand(__inline) -task GetLamLinear( s : Exports.Species, T : double ) - var CvTOvR = 1.5 - var CvROvR = 1.0 - - var CvT = CvTOvR*RGAS - var CvR = CvROvR*RGAS - var CvV = Exports.GetCp(s, T)*s.W - 3.5*RGAS - - var Dkk = GetSelfDiffusion(s, T) - var mu = Exports.GetMu(s,T) - - var fV = Dkk/mu - - var Zrot = s.DiffCoeff.Z298*GetFZrot(s, 298)/GetFZrot(s, T) - - var A = 2.5 - fV - var B = Zrot + 2/PI*(5./3*CvROvR+fV) - - var fT = 2.5 * (1. - 2*CvR*A/(PI*CvT*B)) - var fR = fV*(1. + 2*A/(PI*B)) - - return mu/s.W*(fT*CvT + fR*CvR + fV*CvV) -end - -local __demand(__inline) -task GetLamNonLinear( s : Exports.Species, T : double ) - var CvTOvR = 1.5 - var CvROvR = 1.5 - - var CvT = CvTOvR*RGAS - var CvR = CvROvR*RGAS - var CvV = Exports.GetCp(s, T)*s.W - 4.0*RGAS - - var Dkk = GetSelfDiffusion(s, T) - var mu = Exports.GetMu(s, T) - - var fV = Dkk/mu - - var Zrot = s.DiffCoeff.Z298*GetFZrot(s, 298.0)/GetFZrot(s, T) - - var A = 2.5 - fV - var B = Zrot + 2/PI*(5./3*CvROvR+fV) - - var fT = 2.5 * (1. - 2*CvR*A/(PI*CvT*B)) - var fR = fV*(1. + 2*A/(PI*B)) - - return mu/s.W*(fT*CvT + fR*CvR + fV*CvV) -end - -__demand(__inline) -task Exports.GetLam( s : Exports.Species, T : double ) - var lam : double - if (s.Geom == SpeciesGeom_Atom) then lam = GetLamAtom(s, T) - elseif (s.Geom == SpeciesGeom_Linear) then lam = GetLamLinear(s, T) - elseif (s.Geom == SpeciesGeom_NonLinear) then lam = GetLamNonLinear(s, T) end - return lam -end - -return Exports diff --git a/src/Utils/PointDomain_helper.hpp b/src/Utils/PointDomain_helper.hpp new file mode 100644 index 0000000..50f71a4 --- /dev/null +++ b/src/Utils/PointDomain_helper.hpp @@ -0,0 +1,221 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __POINTDOMAIN_HELPER_HPP__ +#define __POINTDOMAIN_HELPER_HPP__ + +#include "legion.h" + +#include "my_array.hpp" + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __CUDA_H__ +#ifdef __CUDACC__ +#define __CUDA_H__ __device__ +#else +#define __CUDA_H__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +enum direction { + Xdir, + Ydir, + Zdir +}; + +enum side { + Plus, + Minus +}; + +//----------------------------------------------------------------------------- +// Utility that outputs the index of the normal and tangetial components of +// a Vec3 given a direction +//----------------------------------------------------------------------------- +__CUDA_HD__ +constexpr int normalIndex(direction dir) { + return (dir == Xdir) ? 0 : + (dir == Ydir) ? 1 : + /*(dir == Zdir)*/ 2; +}; + +__CUDA_HD__ +constexpr int tangential1Index(direction dir) { + return (dir == Xdir) ? 1 : + (dir == Ydir) ? 0 : + /*(dir == Zdir)*/ 0; +}; + +__CUDA_HD__ +constexpr int tangential2Index(direction dir) { + return (dir == Xdir) ? 2 : + (dir == Ydir) ? 2 : + /*(dir == Zdir)*/ 1; +}; + +//----------------------------------------------------------------------------- +// Utility that computes the first internal point corresponding to a BC point +//----------------------------------------------------------------------------- +template +__CUDA_HD__ +inline Point<3> getPIntBC(const Legion::Point<3> &p); +template<> +__CUDA_HD__ +inline Point<3> getPIntBC(const Legion::Point<3> &p) { return Point<3>(p.x+1, p.y , p.z ); }; +template<> +__CUDA_HD__ +inline Point<3> getPIntBC(const Legion::Point<3> &p) { return Point<3>(p.x-1, p.y , p.z ); }; +template<> +__CUDA_HD__ +inline Point<3> getPIntBC(const Legion::Point<3> &p) { return Point<3>(p.x , p.y+1, p.z ); }; +template<> +__CUDA_HD__ +inline Point<3> getPIntBC(const Legion::Point<3> &p) { return Point<3>(p.x , p.y-1, p.z ); }; +template<> +__CUDA_HD__ +inline Point<3> getPIntBC(const Legion::Point<3> &p) { return Point<3>(p.x , p.y , p.z+1); }; +template<> +__CUDA_HD__ +inline Point<3> getPIntBC(const Legion::Point<3> &p) { return Point<3>(p.x , p.y , p.z-1); }; + + +//----------------------------------------------------------------------------- +// Utility that computes the size of a Rect<3> +//----------------------------------------------------------------------------- +template +__CUDA_HD__ +inline coord_t getSize(const Legion::Rect<3> bounds); +template<> +__CUDA_HD__ +inline coord_t getSize(const Legion::Rect<3> bounds) { return bounds.hi.x - bounds.lo.x + 1; }; +template<> +__CUDA_HD__ +inline coord_t getSize(const Legion::Rect<3> bounds) { return bounds.hi.y - bounds.lo.y + 1; }; +template<> +__CUDA_HD__ +inline coord_t getSize(const Legion::Rect<3> bounds) { return bounds.hi.z - bounds.lo.z + 1; }; + +//----------------------------------------------------------------------------- +// Utility that computes the stencil point warping the point around periodic boundaries +//----------------------------------------------------------------------------- +template +__CUDA_HD__ +static inline Legion::Point<3> warpPeriodic(const Legion::Rect<3> bounds, Legion::Point<3> p, const Legion::coord_t size, const int8_t off); +template<> +__CUDA_HD__ +inline Legion::Point<3> warpPeriodic(const Legion::Rect<3> bounds, Legion::Point<3> p, const Legion::coord_t size, const int8_t off) { + return Legion::Point<3>(((p.x + off - bounds.lo.x) % size + size) % size + bounds.lo.x, p.y, p.z); +}; +template<> +__CUDA_HD__ +inline Legion::Point<3> warpPeriodic(const Legion::Rect<3> bounds, Legion::Point<3> p, const Legion::coord_t size, const int8_t off) { + return Legion::Point<3>((p.x + off - bounds.lo.x) % size + bounds.lo.x, p.y, p.z); +}; +template<> +__CUDA_HD__ +inline Legion::Point<3> warpPeriodic(const Legion::Rect<3> bounds, Legion::Point<3> p, const Legion::coord_t size, const int8_t off) { + return Legion::Point<3>(p.x, ((p.y + off - bounds.lo.y) % size + size) % size + bounds.lo.y, p.z); +}; +template<> +__CUDA_HD__ +inline Legion::Point<3> warpPeriodic(const Legion::Rect<3> bounds, Legion::Point<3> p, const Legion::coord_t size, const int8_t off) { + return Point<3>(p.x, (p.y + off - bounds.lo.y) % size + bounds.lo.y, p.z); +}; +template<> +__CUDA_HD__ +inline Legion::Point<3> warpPeriodic(const Legion::Rect<3> bounds, Legion::Point<3> p, const Legion::coord_t size, const int8_t off) { + return Point<3>(p.x, p.y, ((p.z + off - bounds.lo.z) % size + size) % size + bounds.lo.z); +}; +template<> +__CUDA_HD__ +inline Legion::Point<3> warpPeriodic(const Legion::Rect<3> bounds, Legion::Point<3> p, const Legion::coord_t size, const int8_t off) { + return Legion::Point<3>(p.x, p.y, (p.z + off - bounds.lo.z) % size + bounds.lo.z); +}; + +//----------------------------------------------------------------------------- +// Utility that extracts cross-plane of a 3d domain +//----------------------------------------------------------------------------- +template +__CUDA_HD__ +static inline Legion::Rect<3> crossPlane(const Legion::Rect<3> bounds); +template<> +__CUDA_HD__ +inline Legion::Rect<3> crossPlane(const Legion::Rect<3> bounds) { + return Legion::Rect<3>(Point<3>(bounds.lo.x, bounds.lo.y, bounds.lo.z), Point<3>(bounds.lo.x, bounds.hi.y, bounds.hi.z)); +}; +template<> +__CUDA_HD__ +inline Legion::Rect<3> crossPlane(const Legion::Rect<3> bounds) { + return Legion::Rect<3>(Point<3>(bounds.lo.x, bounds.lo.y, bounds.lo.z), Point<3>(bounds.hi.x, bounds.lo.y, bounds.hi.z)); +}; +template<> +__CUDA_HD__ +inline Legion::Rect<3> crossPlane(const Legion::Rect<3> bounds) { + return Legion::Rect<3>(Point<3>(bounds.lo.x, bounds.lo.y, bounds.lo.z), Point<3>(bounds.hi.x, bounds.hi.y, bounds.lo.z)); +}; + +//----------------------------------------------------------------------------- +// Utility that computes the point along the span of a 3d domain +//----------------------------------------------------------------------------- +template +__CUDA_HD__ +static inline Legion::Point<3> GetPointInSpan(const Legion::Rect<3> b, const coord_t idx , const int x, const int y, const int z); +template<> +__CUDA_HD__ +inline Legion::Point<3> GetPointInSpan(const Legion::Rect<3> b, const coord_t idx, const int x, const int y, const int z) { + return Point<3>(b.lo.x + idx, y + b.lo.y, z + b.lo.z); +}; +template<> +__CUDA_HD__ +inline Legion::Point<3> GetPointInSpan(const Legion::Rect<3> b, const coord_t idx, const int x, const int y, const int z) { + return Point<3>(x + b.lo.x, b.lo.y + idx, z + b.lo.z); +}; +template<> +__CUDA_HD__ +inline Legion::Point<3> GetPointInSpan(const Legion::Rect<3> b, const coord_t idx, const int x, const int y, const int z) { + return Point<3>(x + b.lo.x, y + b.lo.y, b.lo.z + idx); +}; + +#endif // __POINTDOMAIN_HELPER_HPP__ + diff --git a/src/Utils/constants.h b/src/Utils/constants.h new file mode 100644 index 0000000..6e90219 --- /dev/null +++ b/src/Utils/constants.h @@ -0,0 +1,62 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __CONSTANTS_H__ +#define __CONSTANTS_H__ + +//----------------------------------------------------------------------------- +// MATH CONSTANTS +//----------------------------------------------------------------------------- + +#define PI 3.1415926535898 + +//----------------------------------------------------------------------------- +// PHYSICAL CONSTANTS +//----------------------------------------------------------------------------- + +// Universal gas constant +#define RGAS 8.3144598 // [J/(mol K)] +// Avogadro number +#define Na 6.02214086e23 // [1/mol] +// Boltzmann constant +#define kb 1.38064852e-23 // [m^2 kg /( s^2 K)] +// Dielectric permittivity of the vacuum +#define eps_0 8.8541878128e-12 // [F/m] or [C/(V m)] +// Elementary electric charge +#define eCrg 1.60217662e-19 // [C] + +//----------------------------------------------------------------------------- +// UNIT CONVERSION +//----------------------------------------------------------------------------- + +#define ATom 1e-10 // Angstrom to meter +#define DToCm 3.33564e-30 // Debye to Coulomb meter +#define calToJ 4.184 // cal to Joule + +#endif // __CONSTANTS_H__ diff --git a/src/Utils/cuda_utils.hpp b/src/Utils/cuda_utils.hpp new file mode 100644 index 0000000..153e921 --- /dev/null +++ b/src/Utils/cuda_utils.hpp @@ -0,0 +1,278 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __CUDA_UTILS_HPP__ +#define __CUDA_UTILS_HPP__ + +#include "legion.h" + +#include "PointDomain_helper.hpp" + +//----------------------------------------------------------------------------- +// Utility that splits the number of threads per block along each direction for the 3d kernel +//----------------------------------------------------------------------------- +__host__ +inline int findHighestPower2(const int num, const int m = 8) { + assert(num > 0); + // start from 2^0 + int j = 0; + for (int i= 0; i<=m; i++) { if (1< num) break; j = i;} + return j; +} + +template +__host__ +inline dim3 splitThreadsPerBlock(const int TPB, const Legion::Rect<3> bounds) { + assert(TPB%2 == 0); + const coord_t size_x = getSize(bounds); + const coord_t size_y = getSize(bounds); + const coord_t size_z = getSize(bounds); + dim3 r; + r.x = 1 << findHighestPower2(size_x, findHighestPower2(TPB)); + r.y = 1 << findHighestPower2(size_y, findHighestPower2(TPB/r.x)); + r.z = 1 << findHighestPower2(size_z, findHighestPower2(TPB/r.x/r.y)); + return r; +}; + +//----------------------------------------------------------------------------- +// This utility splits the threads per block on a cross plane +//----------------------------------------------------------------------------- +template +__host__ +inline dim3 splitThreadsPerBlockPlane(const int TPB, const Legion::Rect<3> bounds); +template<> +__host__ +inline dim3 splitThreadsPerBlockPlane(const int TPB, const Legion::Rect<3> bounds) { + assert(TPB%2 == 0); + const coord_t size_y = getSize(bounds); + const coord_t size_z = getSize(bounds); + dim3 r; + // Y has priority... + r.y = 1 << findHighestPower2(size_y, findHighestPower2(TPB)); + // ... then Z ... + r.z = 1 << findHighestPower2(size_z, findHighestPower2(TPB/r.y)); + // ... and X gets 1 + r.x = 1; + return r; +}; +template<> +__host__ +inline dim3 splitThreadsPerBlockPlane(const int TPB, const Legion::Rect<3> bounds) { + assert(TPB%2 == 0); + const coord_t size_x = getSize(bounds); + const coord_t size_z = getSize(bounds); + dim3 r; + // X has priority... + r.x = 1 << findHighestPower2(size_x, findHighestPower2(TPB)); + // ... then Z ... + r.z = 1 << findHighestPower2(size_z, findHighestPower2(TPB/r.x)); + // ... and Y gets 1 + r.y = 1; + return r; +}; +template<> +__host__ +inline dim3 splitThreadsPerBlockPlane(const int TPB, const Legion::Rect<3> bounds) { + assert(TPB%2 == 0); + const coord_t size_x = getSize(bounds); + const coord_t size_y = getSize(bounds); + dim3 r; + // X has priority... + r.x = 1 << findHighestPower2(size_x, findHighestPower2(TPB)); + // ... then Y ... + r.y = 1 << findHighestPower2(size_y, findHighestPower2(TPB/r.x)); + // ... and Z gets 1 + r.z = 1; + return r; +}; + +//----------------------------------------------------------------------------- +// This utility splits the threads per block privileging a cross plane and distributes +// the remaining available threads on the normal direction determined by the template variable +//----------------------------------------------------------------------------- +template +__host__ +inline dim3 splitThreadsPerBlockSpan(const int TPB, const Legion::Rect<3> bounds); +template<> +__host__ +inline dim3 splitThreadsPerBlockSpan(const int TPB, const Legion::Rect<3> bounds) { + assert(TPB%2 == 0); + const coord_t size_x = getSize(bounds); + const coord_t size_y = getSize(bounds); + const coord_t size_z = getSize(bounds); + dim3 r; + // Y has priority... + r.y = 1 << findHighestPower2(size_y, findHighestPower2(TPB)); + // ... then Z ... + r.z = 1 << findHighestPower2(size_z, findHighestPower2(TPB/r.y)); + // ... and finally X + r.x = 1 << findHighestPower2(size_x, findHighestPower2(TPB/r.y/r.z)); + return r; +}; +template<> +__host__ +inline dim3 splitThreadsPerBlockSpan(const int TPB, const Legion::Rect<3> bounds) { + assert(TPB%2 == 0); + const coord_t size_x = getSize(bounds); + const coord_t size_y = getSize(bounds); + const coord_t size_z = getSize(bounds); + dim3 r; + // X has priority... + r.x = 1 << findHighestPower2(size_x, findHighestPower2(TPB)); + // ... then Z ... + r.z = 1 << findHighestPower2(size_z, findHighestPower2(TPB/r.x)); + // ... and finally Y + r.y = 1 << findHighestPower2(size_y, findHighestPower2(TPB/r.x/r.z)); + return r; +}; +template<> +__host__ +inline dim3 splitThreadsPerBlockSpan(const int TPB, const Legion::Rect<3> bounds) { + assert(TPB%2 == 0); + const coord_t size_x = getSize(bounds); + const coord_t size_y = getSize(bounds); + const coord_t size_z = getSize(bounds); + dim3 r; + // X has priority... + r.x = 1 << findHighestPower2(size_x, findHighestPower2(TPB)); + // ... then Y ... + r.y = 1 << findHighestPower2(size_y, findHighestPower2(TPB/r.x)); + // ... and finally Z + r.z = 1 << findHighestPower2(size_z, findHighestPower2(TPB/r.x/r.y)); + return r; +}; + +//----------------------------------------------------------------------------- +// This utility determines the number of blocks in a kernel launch with span loop +//----------------------------------------------------------------------------- +template +__host__ +inline dim3 numBlocksSpan(const dim3 TPB, const Legion::Rect<3> bounds); +template<> +__host__ +inline dim3 numBlocksSpan(const dim3 TPB, const Legion::Rect<3> bounds) { + // Needs only one thread along X + return dim3(1, + (getSize(bounds) + (TPB.y - 1)) / TPB.y, + (getSize(bounds) + (TPB.z - 1)) / TPB.z); +}; +template<> +__host__ +inline dim3 numBlocksSpan(const dim3 TPB, const Legion::Rect<3> bounds) { + // Needs only one thread along Y + return dim3((getSize(bounds) + (TPB.x - 1)) / TPB.x, + 1, + (getSize(bounds) + (TPB.z - 1)) / TPB.z); +}; +template<> +__host__ +inline dim3 numBlocksSpan(const dim3 TPB, const Legion::Rect<3> bounds) { + // Needs only one thread along Z + return dim3((getSize(bounds) + (TPB.x - 1)) / TPB.x, + (getSize(bounds) + (TPB.y - 1)) / TPB.y, + 1); +}; + +//----------------------------------------------------------------------------- +// This utility checks that the thread is inside the crossPlane determined by (sx, sy, sz) +//----------------------------------------------------------------------------- +template +__device__ +inline bool isThreadInCrossPlane(const Legion::coord_t sx, const Legion::coord_t sy, const Legion::coord_t sz); +template<> +__device__ +inline bool isThreadInCrossPlane(const Legion::coord_t sx, const Legion::coord_t sy, const Legion::coord_t sz) { + assert(blockIdx.x == 0); + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + return ((y < sy) && (z < sz)); +}; +template<> +__device__ +inline bool isThreadInCrossPlane(const Legion::coord_t sx, const Legion::coord_t sy, const Legion::coord_t sz) { + int x = blockIdx.x * blockDim.x + threadIdx.x; + assert(blockIdx.y == 0); + int z = blockIdx.z * blockDim.z + threadIdx.z; + return ((x < sx) && (z < sz)); +}; +template<> +__device__ +inline bool isThreadInCrossPlane(const Legion::coord_t sx, const Legion::coord_t sy, const Legion::coord_t sz) { + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + assert(blockIdx.z == 0); + return ((x < sx) && (y < sy)); +}; + +//----------------------------------------------------------------------------- +// This utility computes the first index of a thread in a span determined by size +//----------------------------------------------------------------------------- +template +__device__ +inline Legion::coord_t firstIndexInSpan(const Legion::coord_t size); +template<> +__device__ +inline Legion::coord_t firstIndexInSpan(const Legion::coord_t size) { + return threadIdx.x*((size + (blockDim.x-1))/blockDim.x); +}; +template<> +__device__ +inline Legion::coord_t firstIndexInSpan(const Legion::coord_t size) { + return threadIdx.y*((size + (blockDim.y-1))/blockDim.y); +}; +template<> +__device__ +inline Legion::coord_t firstIndexInSpan(const Legion::coord_t size) { + return threadIdx.z*((size + (blockDim.z-1))/blockDim.z); +}; + +//----------------------------------------------------------------------------- +// This utility computes the last index of a thread in a span determined by size +//----------------------------------------------------------------------------- +template +__device__ +inline Legion::coord_t lastIndexInSpan(const Legion::coord_t size); +template<> +__device__ +inline Legion::coord_t lastIndexInSpan(const Legion::coord_t size) { + return min((threadIdx.x+1)*((size + (blockDim.x-1))/blockDim.x), size); +}; +template<> +__device__ +inline Legion::coord_t lastIndexInSpan(const Legion::coord_t size) { + return min((threadIdx.y+1)*((size + (blockDim.y-1))/blockDim.y), size); +}; +template<> +__device__ +inline Legion::coord_t lastIndexInSpan(const Legion::coord_t size) { + return min((threadIdx.z+1)*((size + (blockDim.z-1))/blockDim.z), size); +}; + +#endif // __CUDA_UTILS_HPP__ + diff --git a/src/ConstPropMix.h b/src/Utils/math_utils.h similarity index 72% rename from src/ConstPropMix.h rename to src/Utils/math_utils.h index a955839..9184685 100644 --- a/src/ConstPropMix.h +++ b/src/Utils/math_utils.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,41 +27,35 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef ConstPropMix_H -#define ConstPropMix_H - -#define nSpec 1 - -#define RGAS 8.3144598 // [J/(mol K)] - -#ifdef __cplusplus -extern "C" { -#endif - -struct Mix { - // Mixture properties - double R; - double gamma; - - // Viscosisity model - int viscosityModel; - // Viscosity parameters - // Constant model - double constantVisc; - // Power law model - double powerlawTempRef; - double powerlawViscRef; - // Sutherland model - double sutherlandSRef; - double sutherlandTempRef; - double sutherlandViscRef; +#ifndef __MATH_UTILS_H__ +#define __MATH_UTILS_H__ + +//----------------------------------------------------------------------------- +// Fast interpolation using the integer domain +//----------------------------------------------------------------------------- + +// Fast interpolation reference data +struct FastInterpData { + int nloc; + double xmin; + double xmax; + double small; + double dxloc; + double idxloc; +}; - // Prandtl number - double Prandtl; +// Integer domain region data type +// NOTE: Single precision is sufficient at this stage +struct FastInterpType { + float xloc; + float iloc; }; -#ifdef __cplusplus -} -#endif +enum FI_FieldIDs { + FI_FID_xloc = 101, + FI_FID_iloc, + // keep last for counting + FI_FID_last +}; -#endif // ConstPropMix_H +#endif // __MATH_UTILS_H__ diff --git a/src/Utils/math_utils.hpp b/src/Utils/math_utils.hpp new file mode 100644 index 0000000..4da1525 --- /dev/null +++ b/src/Utils/math_utils.hpp @@ -0,0 +1,453 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __MATH_UTILS_HPP__ +#define __MATH_UTILS_HPP__ + +#include "legion.h" + +#include "math_utils.h" +#include "my_array.hpp" + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +#ifndef __CUDACC__ +using std::max; +using std::min; +#endif + +__CUDA_HD__ +inline double dot(const double *a, const double *b) { + return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; +} + +template +__CUDA_HD__ +inline void MatMul(const double *A, const double *x, double *r) { +// NOTE: This outer unroll increases the compile time a lot the compile time for n O(100) +// __UNROLL__ + for (int i=0; i +struct LUdec { +private: + MyMatrix A; + MyArray ind; + + static constexpr double TINY = 1.0e-20; +public: + // Initialize the matrix + __CUDA_HD__ + inline void init(const MyMatrix &in) { + A = in; + } + + // Provide direct access the matrix + __CUDA_HD__ + inline double& operator()(const int i, const int j) { return A(i, j); } + __CUDA_HD__ + inline double operator()(const int i, const int j) const { return A(i, j); } + + // Computes LU decomposition + __CUDA_HD__ + inline void ludcmp(const MyMatrix &in) { + A = in; + ludcmp(); + } + + __CUDA_HD__ + inline void ludcmp() { + int imax = 0; + MyArray vv; + for (int i=0; i= big) { + big=dum; + imax=i; + } + } + if (j != imax) { + __UNROLL__ + for (int k=0; k &b) { + int ii = 0; + for (int i=0; i-1; i--) { + double sum=b[i]; + for (int j = i+1; j +class Rosenbrock { + +public: + __CUDA_HD__ + virtual ~Rosenbrock() {}; + + // RHS function that computes the rhs for a given x + __CUDA_HD__ + virtual void rhs(MyArray &r, const MyArray &x) = 0; + + // Main body of the solver + __CUDA_HD__ + inline void solve(MyArray &x, const double dtTry, const double DelT) { + bool finish = false; + double time = 0.0; + double dt = dtTry; + + for (int s = 0; s < MAXSTP; s++) { + const double t0 = time; + double dtNext; + + // Update the jacobian matrix + GetJacobian(x); + + // Update RHS + rhs(dx, x); + xsav = x; + dxsav = dx; + + for (int jtry = 0; jtry < MAXITS; jtry++) { + // Advance solution + time = step(x, dt, t0); + + // Check dt size + if (itercheck(dt, dtNext, finish)) break; + + // It took too many iterations to match the dt + assert(jtry < MAXITS-1); + } + + // Check integration time + if (stepcheck(dt, dtNext, DelT, time, finish)) break; + + // It took too many timesteps + assert(s < MAXSTP-1); + } + }; + +private: + + // Computes the jacobian with second order finite difference + __CUDA_HD__ + inline void GetJacobian(MyArray &x) { + static constexpr double EPS = 1.0e-6; + static constexpr double DEL = 1.0e-14; + // Store input solution + MyArray tmp = x; + // Allocate spaces for rhs + MyArray fp; + MyArray fm; + // Compute the Jacobian + __UNROLL__ + for (int j=0; j &x, const double dt, const double t0) { + MyArray g1; + MyArray g2; + MyArray g3; + MyArray g4; + + for (int i=0; i ERRCON) + dtNext = SAFETY*dt*pow(errmax, PGROW); + else + dtNext = GROW*dt; + return true; + } else { + // We need to take another step + dtNext = SAFETY*dt*pow(errmax, PSHRNK); + if (dt > 0.0 ) + dt = max(dtNext, SHRNK*dt); + else + dt = min(dtNext, SHRNK*dt); + // Iterate again + return false; + } + } + + // checks if subiteration is converged + __CUDA_HD__ + inline bool stepcheck(double &dt, const double dtNext, const double DelT, + const double time, bool &finish) { + const double Remainder = DelT-time; + if (finish or (Remainder < 1e-12*DelT)) + // We are done + return true; + else { + // We need to take another step + if (dtNext*1.5 > Remainder) { + // Force the algorithm to integrate till DelT + dt = Remainder; + finish = true; + } else { + // Take another standard step + dt = dtNext; + finish = false; + } + return false; + } + } + + // estimate of the integration error + MyArray err; + + // Auxiliary data + MyArray dx; + MyArray xsav; + MyArray dxsav; + + // Jacobian matrix + MyMatrix Jac; + + // LU decomposition + LUdec LU; + + // Algorithm paramenters + static constexpr int MAXSTP = 100000; + static constexpr int MAXITS = 100; + static constexpr double TOL = 1e-10; + static constexpr double iTOL = 1.0/TOL; + static constexpr double SAFETY = 0.9; + static constexpr double GROW = 1.5; + static constexpr double PGROW =-0.25; + static constexpr double SHRNK = 0.5; + static constexpr double PSHRNK =-1.0/3.0; + static constexpr double ERRCON = 0.1296; + static constexpr double GAM = 1.0/2.0; + static constexpr double A21 = 2.0; + static constexpr double A31 = 48.0/25.0; + static constexpr double A32 = 6.0/25.0; + static constexpr double C21 =-8.0; + static constexpr double C31 = 372.0/25.0; + static constexpr double C32 = 12.0/5.0; + static constexpr double C41 =-112.0/125.0; + static constexpr double C42 =-54.0/125.0; + static constexpr double C43 =-2.0/5.0; + static constexpr double B1 = 19.0/9.0; + static constexpr double B2 = 1.0/2.0; + static constexpr double B3 = 25.0/108.0; + static constexpr double B4 = 125.0/108.0; + static constexpr double E1 = 17.0/54.0; + static constexpr double E2 = 7.0/36.0; + static constexpr double E3 = 0.0; + static constexpr double E4 = 125.0/108.0; + static constexpr double C1X = 1.0/2.0; + static constexpr double C2X =-3.0/2.0; + static constexpr double C3X = 121.0/50.0; + static constexpr double C4X = 29.0/250.0; + static constexpr double A2X = 1.0; + static constexpr double A3X = 3.0/5.0; + +}; + +//----------------------------------------------------------------------------- +// Fast interpolation using the integer domain +//----------------------------------------------------------------------------- + +__CUDA_HD__ +inline Legion::coord_t FastInterpFindIndex(double x, + const Legion::FieldAccessor > &xloc, + const Legion::FieldAccessor > &iloc, + const FastInterpData &d) { + + x = max(d.xmin+d.small, x); + x = min(d.xmax-d.small, x); + const Legion::coord_t k = floor((x-d.xmin)*d.idxloc); + const Legion::coord_t kp1 = k+1; + return floor(iloc[k] + (iloc[kp1]-iloc[k])* + ( x-xloc[k])*d.idxloc); +}; + +#endif // __MATH_UTILS_HPP__ diff --git a/src/math_utils.rg b/src/Utils/math_utils.rg similarity index 97% rename from src/math_utils.rg rename to src/Utils/math_utils.rg index d551f4d..d059b69 100644 --- a/src/math_utils.rg +++ b/src/Utils/math_utils.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -38,6 +38,9 @@ local max = regentlib.fmax local min = regentlib.fmin local pow = regentlib.pow(double) +-- Load data types +local TYPES = terralib.includec("math_utils.h") + -- Row by column multiplication Exports.mkMatMul = terralib.memoize(function(n) local matMul @@ -85,7 +88,7 @@ Exports.mkLUdec = terralib.memoize(function(n) -- TODO : assertion is not supported by CUDA code generator -- emit a bool for now -- regentlib.assert(big ~= 0.0, "Singular matrix in ludcmp") - if (big == 0.0) then + if (big == 0.0) then LU.sing = true end vv[i] = 1.0/big @@ -488,7 +491,7 @@ Exports.mkRosenbrock = terralib.memoize(function(nEq, Fields, Vars, Unkowns, Dat dt = max(dtNext,SHRNK*dt) else dt = min(dtNext,SHRNK*dt) - end + end end -- TODO : assertion is not supported by CUDA code generator -- emit an int for now @@ -498,7 +501,7 @@ Exports.mkRosenbrock = terralib.memoize(function(nEq, Fields, Vars, Unkowns, Dat if ( DelT == time ) then finish = true end if finish then break end if ( fail==1 ) then break end - if ( dtNext*1.5 > DelT-time ) then + if ( dtNext*1.5 > DelT-time ) then -- Force the algorithm to integrate till DelT dt = DelT-time finish = true @@ -522,20 +525,8 @@ Exports.mkFastInterp = terralib.memoize(function(SrcType, xfld) local FastInterpFindIndex, FastInterpGetWeight local eps = 1e-6 - local struct FastInterpData { - nloc : int; - xmin : double; - xmax : double; - small : double; - dxloc : double; - idxloc : double; - } - - -- Single precision is sufficient at this stage - local struct FastInterpType { - xloc : float; - iloc : float; - } + local FastInterpData = TYPES.FastInterpData + local FastInterpType = TYPES.FastInterpType -- Initializes data structure local __demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP diff --git a/src/Utils/my_array.hpp b/src/Utils/my_array.hpp new file mode 100644 index 0000000..3f2f53c --- /dev/null +++ b/src/Utils/my_array.hpp @@ -0,0 +1,358 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __MY_ARRAY_HPP__ +#define __MY_ARRAY_HPP__ + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __CUDA_H__ +#ifdef __CUDACC__ +#define __CUDA_H__ __device__ +#else +#define __CUDA_H__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +template +struct MyArray { +public: + __CUDA_HD__ + inline MyArray() {} + + // BE CAREFULL THIS DOES NOT CHEK THE SANITY OF THE INPUT + __CUDA_HD__ + inline MyArray(const T *in) { + __UNROLL__ + for (int i=0; i= 0); + assert(index < SIZE); +#endif + return v[index]; + } + + __CUDA_HD__ + inline T operator[](const int index) const { +#ifdef BOUNDS_CHECKS + assert(index >= 0); + assert(index < SIZE); +#endif + return v[index]; + } + + __CUDA_HD__ + inline MyArray& operator=(const MyArray &in) { + __UNROLL__ + for (int i=0; i& operator+=(const MyArray &rhs) { + __UNROLL__ + for (int i=0; i& operator-=(const MyArray &rhs) { + __UNROLL__ + for (int i=0; i operator-(MyArray lhs, const MyArray &rhs) { + lhs -= rhs; + return lhs; + } + + __CUDA_HD__ + inline MyArray& operator-() { + __UNROLL__ + for (int i=0; i& operator+=(const T rhs) { + __UNROLL__ + for (int i=0; i& operator*=(const T rhs) { + __UNROLL__ + for (int i=0; i operator+(MyArray lhs, const T rhs) { + lhs += rhs; + return lhs; + } + + __CUDA_HD__ + friend inline MyArray operator*(MyArray lhs, const T rhs) { + lhs *= rhs; + return lhs; + } + + __CUDA_HD__ + friend inline MyArray operator*(const double lhs, MyArray rhs) { + rhs *= lhs; + return rhs; + } + + __CUDA_HD__ + inline MyArray& operator*=(const MyArray &rhs) { + __UNROLL__ + for (int i=0; i operator*(MyArray lhs, const MyArray &rhs) { + lhs *= rhs; + return lhs; + } + + __CUDA_HD__ + inline T mod2() { + T r = 0.0; + __UNROLL__ + for (int i=0; i &rhs) const { + T r = 0.0; + __UNROLL__ + for (int i=0; i +struct MyMatrix { +public: + __CUDA_HD__ + inline void init(const T in) { + for (int i=0; i= 0); + assert(i < SIZE_I); + assert(j >= 0); + assert(j < SIZE_J); +#endif + return v[i + j*SIZE_I]; + } + + __CUDA_HD__ + inline T operator()(const int i, const int j) const { +#ifdef BOUNDS_CHECKS + assert(i >= 0); + assert(i < SIZE_I); + assert(j >= 0); + assert(j < SIZE_J); +#endif + return v[i + j*SIZE_I]; + } + + __CUDA_HD__ + inline void operator=(const MyMatrix &in) { + for (int i=0; i operator*(const MyMatrix &lhs, const MyArray &rhs) { + MyArray r; + // NOTE: This outer unroll increases the compile time a lot the compile time for n O(100) + //__UNROLL__ + for (int i=0; i +struct MySymMatrix { +public: + __CUDA_HD__ + inline T& operator()(const int i, const int j) { +#ifdef BOUNDS_CHECKS + assert(i >= 0); + assert(i < SIZE); + assert(j >= 0); + assert(j < SIZE); +#endif + return (i <= j) ? v[(2*SIZE - i - 1)*i/2 + j] + : v[(2*SIZE - j - 1)*j/2 + i]; + } + + __CUDA_HD__ + inline T operator()(const int i, const int j) const { +#ifdef BOUNDS_CHECKS + assert(i >= 0); + assert(i < SIZE); + assert(j >= 0); + assert(j < SIZE); +#endif + return (i <= j) ? v[(2*SIZE - i - 1)*i/2 + j] + : v[(2*SIZE - j - 1)*j/2 + i]; + } + + __CUDA_HD__ + inline MySymMatrix& operator=(const MySymMatrix &in) { + __UNROLL__ + for (int i=0; i& operator+=(const MySymMatrix &rhs) { + __UNROLL__ + for (int i=0; i& operator*=(const double rhs) { + __UNROLL__ + for (int i=0; i<(SIZE*(SIZE+1)/2); i++) + v[i] *= rhs; + return *this; + } + + __CUDA_HD__ + friend inline MySymMatrix operator*(MySymMatrix in, const double rhs) { + in *= rhs; + return in; + } + + __CUDA_HD__ + friend inline MySymMatrix operator*(const double rhs, MySymMatrix in) { + in *= rhs; + return in; + } + + __CUDA_HD__ + inline MySymMatrix& operator*=(const MySymMatrix &rhs) { + __UNROLL__ + for (int i=0; i operator*(MySymMatrix in, const MySymMatrix &rhs) { + in *= rhs; + return in; + } + +private: + T v[SIZE*(SIZE+1)/2]; +}; + +#endif // __MY_ARRAY_HPP__ + diff --git a/src/Utils/task_helper.hpp b/src/Utils/task_helper.hpp new file mode 100644 index 0000000..c22b883 --- /dev/null +++ b/src/Utils/task_helper.hpp @@ -0,0 +1,253 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __TASK_HELPER_HPP__ +#define __TASK_HELPER_HPP__ + +#include "legion.h" + +#include "my_array.hpp" + +#ifndef __CUDA_HD__ +#ifdef __CUDACC__ +#define __CUDA_HD__ __host__ __device__ +#else +#define __CUDA_HD__ +#endif +#endif + +#ifndef __CUDA_H__ +#ifdef __CUDACC__ +#define __CUDA_H__ __device__ +#else +#define __CUDA_H__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +//----------------------------------------------------------------------------- +// Reduction operations +//----------------------------------------------------------------------------- +namespace Legion { + template + class SumReduction< MyArray > { + public: + typedef MyArray LHS; + typedef MyArray RHS; + + static constexpr double identity = 0.0; +// static const int REDOP_ID; + + template __CUDA_HD__ + static void apply(LHS &lhs, RHS rhs); + template __CUDA_HD__ + static void fold(RHS &rhs1, RHS rhs2); + }; + + template + class SumReduction< MySymMatrix > { + public: + typedef MySymMatrix LHS; + typedef MySymMatrix RHS; + + static constexpr double identity = 0.0; +// static const int REDOP_ID; + + template __CUDA_HD__ + static void apply(LHS &lhs, RHS rhs); + template __CUDA_HD__ + static void fold(RHS &rhs1, RHS rhs2); + }; +}; + +//----------------------------------------------------------------------------- +// Accessors +//----------------------------------------------------------------------------- +template using AccessorRO = Legion::FieldAccessor< READ_ONLY, FT, N, T, Realm::AffineAccessor >; +template using AccessorRW = Legion::FieldAccessor >; +template using AccessorWO = Legion::FieldAccessor >; +template using AccessorSumRD = Legion::ReductionAccessor, EXCLUSIVE, N, T, Realm::AffineAccessor >; + +//----------------------------------------------------------------------------- +// Utility that registers tasks +//----------------------------------------------------------------------------- +namespace TaskHelper { + template + void base_cpu_wrapper(const Legion::Task *task, + const std::vector ®ions, + Legion::Context ctx, Legion::Runtime *runtime) + { + assert(task->arglen == 0); + assert(task->local_arglen == sizeof(typename T::Args)); + const typename T::Args *a = (typename T::Args*)task->local_args; + T::cpu_base_impl(*a, regions, task->futures, ctx, runtime); + } + + template + R return_cpu_wrapper(const Legion::Task *task, + const std::vector ®ions, + Legion::Context ctx, Legion::Runtime *runtime) + { + assert(task->arglen == 0); + assert(task->local_arglen == sizeof(typename T::Args)); + const typename T::Args *a = (typename T::Args*)task->local_args; + return T::cpu_base_impl(*a, regions, task->futures, ctx, runtime); + } + +#ifdef LEGION_USE_CUDA + template + void base_gpu_wrapper(const Legion::Task *task, + const std::vector ®ions, + Legion::Context ctx, Legion::Runtime *runtime) + { + assert(task->arglen == 0); + assert(task->local_arglen == sizeof(typename T::Args)); + const typename T::Args *a = (typename T::Args*)task->local_args; + T::gpu_base_impl(*a, regions, task->futures, ctx, runtime); + } + + template + R return_gpu_wrapper(const Legion::Task *task, + const std::vector ®ions, + Legion::Context ctx, Legion::Runtime *runtime) + { + assert(task->arglen == 0); + assert(task->local_arglen == sizeof(typename T::Args)); + const typename T::Args *a = (typename T::Args*)task->local_args; + return T::gpu_base_impl(*a, regions, task->futures, ctx, runtime); + } +#endif + + template + LayoutConstraintID register_layout_constraint(T c) + { + LayoutConstraintRegistrar registrar; + registrar.add_constraint(c); + return Runtime::preregister_layout(registrar); + } + + template + void register_hybrid_variants(void) + { + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(Legion::ProcessorConstraint(Legion::Processor::LOC_PROC)); + registrar.set_leaf(T::CPU_BASE_LEAF); + Legion::Runtime::preregister_task_variant>(registrar, T::TASK_NAME); + } +#ifdef REALM_USE_OPENMP + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(ProcessorConstraint(Legion::Processor::OMP_PROC)); + registrar.set_leaf(T::CPU_BASE_LEAF); + Legion::Runtime::preregister_task_variant>(registrar, T::TASK_NAME); + } +#endif +#ifdef LEGION_USE_CUDA + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(ProcessorConstraint(Legion::Processor::TOC_PROC)); + registrar.set_leaf(T::GPU_BASE_LEAF); + Legion::Runtime::preregister_task_variant>(registrar, T::TASK_NAME); + } +#endif + } + + template + void register_hybrid_variants(const std::vector> &cpu_layout_const, + const std::vector> &gpu_layout_const) + { + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(Legion::ProcessorConstraint(Legion::Processor::LOC_PROC)); + registrar.set_leaf(T::CPU_BASE_LEAF); + for (unsigned i=0; i>(registrar, T::TASK_NAME); + } +#ifdef REALM_USE_OPENMP + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(ProcessorConstraint(Legion::Processor::OMP_PROC)); + registrar.set_leaf(T::CPU_BASE_LEAF); + for (unsigned i=0; i>(registrar, T::TASK_NAME); + } +#endif +#ifdef LEGION_USE_CUDA + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(ProcessorConstraint(Legion::Processor::TOC_PROC)); + registrar.set_leaf(T::GPU_BASE_LEAF); + for (unsigned i=0; i>(registrar, T::TASK_NAME); + } +#endif + } + + template + void register_hybrid_variants(void) + { + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(Legion::ProcessorConstraint(Legion::Processor::LOC_PROC)); + registrar.set_leaf(T::CPU_BASE_LEAF); + Legion::Runtime::preregister_task_variant>(registrar, T::TASK_NAME); + } +#ifdef REALM_USE_OPENMP + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(ProcessorConstraint(Legion::Processor::OMP_PROC)); + registrar.set_leaf(T::CPU_BASE_LEAF); + Legion::Runtime::preregister_task_variant>(registrar, T::TASK_NAME); + } +#endif +#ifdef LEGION_USE_CUDA + { + Legion::TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); + registrar.add_constraint(ProcessorConstraint(Legion::Processor::TOC_PROC)); + registrar.set_leaf(T::GPU_BASE_LEAF); + Legion::Runtime::preregister_task_variant>(registrar, T::TASK_NAME); + } +#endif + } + +}; + +#endif // __TASK_HELPER_HPP__ + diff --git a/src/config_schema.lua b/src/config_schema.lua index 2329500..04fdd84 100644 --- a/src/config_schema.lua +++ b/src/config_schema.lua @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -48,7 +48,7 @@ Exports.Species = { MolarFrac = double, } Exports.Mixture = { - Species = UpTo(10, Exports.Species), + Species = UpTo(20, Exports.Species), } -- Unions & enumeration constants @@ -166,8 +166,44 @@ Exports.MixtureModel = Union{ gasConstant = double, gamma = double, }, - AirMix = {}, - CH41StMix = {}, + AirMix = { + LRef = double, + PRef = double, + TRef = double, + XiRef = Exports.Mixture, + }, + CH41StMix = { + LRef = double, + PRef = double, + TRef = double, + XiRef = Exports.Mixture, + }, + CH4_30SpMix = { + LRef = double, + PRef = double, + TRef = double, + XiRef = Exports.Mixture, + }, + CH4_43SpIonsMix = { + LRef = double, + PRef = double, + TRef = double, + XiRef = Exports.Mixture, + -- Relative dielectric permittivity +-- esp_r = double, + }, + FFCM1Mix = { + LRef = double, + PRef = double, + TRef = double, + XiRef = Exports.Mixture, + }, + BoivinMix = { + LRef = double, + PRef = double, + TRef = double, + XiRef = Exports.Mixture, + }, } Exports.FlowInitCase = Union{ @@ -228,6 +264,28 @@ Exports.FlowInitCase = Union{ Exports.GridType = Enum('Uniform','Cosine','TanhMinus','TanhPlus','Tanh','SinhMinus','SinhPlus','Sinh') +Exports.EulerSchemes = Union{ + SkewSymmetric = {}, + TENOA = {}, + TENOLAD = {}, + Hybrid = { + vorticityScale = double, + }, +} + +-- Electric field model struct +Exports.EFieldStruct = Union{ + Off = {}, + Ybc = { + -- Mean electric potential at the bottom boundary (in computational units) + Phi_bottom = double, + -- Mean electric potential at the top boundary (in computational units) + Phi_top = double, + -- Activate Robin boundary conditions + Robin_bc = bool + } +} + -- Sections of config struct Exports.MappingStruct = { -- number of tiles in which to split the domain @@ -285,10 +343,8 @@ Exports.IntegratorStruct = { fixedDeltaTime = double, -- implicit or explicit approach for chemistry implicitChemistry = bool, - ---- flag to activate the hybrid scheme - hybridScheme = bool, - -- vorticity scale for the Ducros sensor - vorticityScale = double, + -- Switch for the euler schemes + EulerScheme = Exports.EulerSchemes, } Exports.FlowStruct = { @@ -330,6 +386,7 @@ Exports.Config = { Integrator = Exports.IntegratorStruct, Flow = Exports.FlowStruct, IO = Exports.IOStruct, + Efield = Exports.EFieldStruct, } return Exports diff --git a/src/cuda_utils.hpp b/src/cuda_utils.hpp deleted file mode 100644 index cb061d3..0000000 --- a/src/cuda_utils.hpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) "2019, by Stanford University -// Developer: Mario Di Renzo -// Affiliation: Center for Turbulence Research, Stanford University -// URL: https://ctr.stanford.edu -// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). -// HTR solver: An open-source exascale-oriented task-based -// multi-GPU high-order code for hypersonic aerothermodynamics. -// Computer Physics Communications 255, 107262" -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef __CUDA_UTILS_HPP__ -#define __CUDA_UTILS_HPP__ - -//// Utility that unwarps the tid to the point of the FluxGhosts region -//template -//__device__ -//inline Point<3> unwarpTidFluxGhosts(coord_t tid, const coord_t size, const Rect<3> bounds, const Rect<3> Fluid_bounds); -//template<> -//__device__ -//inline Point<3> unwarpTidFluxGhosts(coord_t tid, const coord_t size_x, const Rect<3> bounds, const Rect<3> Fluid_bounds) { -// const coord_t size_y = getSize(bounds); -// const coord_t size_z = getSize(bounds); -// const coord_t i = tid/(size_y * size_z) + bounds.lo.x; -// tid -= i * size_y * size_z; -// const coord_t k = tid/size_y + bounds.lo.z; -// const coord_t j = tid%size_y + bounds.lo.y; -// return warpPeriodic(Fluid_bounds, Point<3>(i, j ,k), size_x, 0); -//}; -//template<> -//__device__ -//inline Point<3> unwarpTidFluxGhosts(coord_t tid, const coord_t size_y, const Rect<3> bounds, const Rect<3> Fluid_bounds) { -// const coord_t size_x = getSize(bounds); -// const coord_t size_z = getSize(bounds); -// const coord_t j = tid/(size_x * size_z) + bounds.lo.y; -// tid -= j * size_x * size_z; -// const coord_t k = tid/size_x + bounds.lo.z; -// const coord_t i = tid%size_x+ bounds.lo.x; -// return warpPeriodic(Fluid_bounds, Point<3>(i, j ,k), size_y, 0); -//}; -//template<> -//__device__ -//inline Point<3> unwarpTidFluxGhosts(coord_t tid, const coord_t size_z, const Rect<3> bounds, const Rect<3> Fluid_bounds) { -// const coord_t size_x = getSize(bounds); -// const coord_t size_y = getSize(bounds); -// const coord_t k = tid/(size_x * size_y) + bounds.lo.z; -// tid -= k * size_x * size_y; -// const coord_t j = tid/size_x + bounds.lo.y; -// const coord_t i = tid%size_x + bounds.lo.x; -// return warpPeriodic(Fluid_bounds, Point<3>(i, j ,k), size_z, 0); -//}; - -// Utility that splits the numeber of threads per block along each direction for the 3d kernel -__host__ -inline int findHighestPower2(const int num, const int m = 8) { - assert(num > 0); - // start from 2^0 - int j = 0; - for (int i= 0; i<=m; i++) { if (1< num) break; j = i;} - return j; -} -template -__host__ -inline dim3 splitThreadsPerBlock(const int TPB, const Rect<3> bounds) { - assert(TPB%2 == 0); - const coord_t size_x = getSize(bounds); - const coord_t size_y = getSize(bounds); - const coord_t size_z = getSize(bounds); - dim3 r; - r.x = 1 << findHighestPower2(size_x, findHighestPower2(TPB)); - r.y = 1 << findHighestPower2(size_y, findHighestPower2(TPB/r.x)); - r.z = min(TPB/r.x/r.y, 1 << findHighestPower2(size_x*size_y*size_z)); - return r; -}; - -#endif // __CUDA_UTILS_HPP__ - diff --git a/src/hdf_helper.rg b/src/hdf_helper.rg index 30ef893..fd2c0dc 100644 --- a/src/hdf_helper.rg +++ b/src/hdf_helper.rg @@ -351,7 +351,7 @@ local one = -- EXPORTED TASKS ------------------------------------------------------------------------------- -local -- NOT LEAF, MANUALLY PARALLELIZED, NO CUDA, NO OPENMP +local __demand(__inner) -- NOT LEAF, MANUALLY PARALLELIZED, NO CUDA, NO OPENMP task dumpTile(_ : int, dirname : regentlib.string, r : region(ispace(indexType), fSpace), @@ -386,7 +386,7 @@ where reads(r.[flds]), reads writes(s.[flds]), r * s do return __ end -local -- NOT LEAF, MANUALLY PARALLELIZED, NO CUDA, NO OPENMP +local __demand(__inner) -- NOT LEAF, MANUALLY PARALLELIZED, NO CUDA, NO OPENMP task loadTile(_ : int, dirname : regentlib.string, r : region(ispace(indexType), fSpace), diff --git a/src/math_utils.hpp b/src/math_utils.hpp deleted file mode 100644 index 0ed56e2..0000000 --- a/src/math_utils.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) "2019, by Stanford University -// Developer: Mario Di Renzo -// Affiliation: Center for Turbulence Research, Stanford University -// URL: https://ctr.stanford.edu -// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). -// HTR solver: An open-source exascale-oriented task-based -// multi-GPU high-order code for hypersonic aerothermodynamics. -// Computer Physics Communications 255, 107262" -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef __MATH_UTILS_HPP__ -#define __MATH_UTILS_HPP__ - -#ifndef __CUDA_HD__ -#ifdef __CUDACC__ -#define __CUDA_HD__ __host__ __device__ -#else -#define __CUDA_HD__ -#endif -#endif - -#ifndef __UNROLL__ -#ifdef __CUDACC__ -#define __UNROLL__ #pragma unroll -#else -#define __UNROLL__ -#endif -#endif - -__CUDA_HD__ -inline double dot(const double *a, const double *b) { - return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; -} - -template -__CUDA_HD__ -inline void MatMul(const double *A, const double *x, double *r) { - __UNROLL__ - for (int i=0; iPrimitives/Primitives->Conserved and properties routines -local VARS = (require 'prometeo_variables')(SCHEMA, MIX, METRIC, Fluid_columns, DEBUG_OUTPUT) +local VARS = (require 'prometeo_variables')(SCHEMA, MIX, METRIC, TYPES, ELECTRIC_FIELD) -- Fluxes routines -local SENSOR = (require 'prometeo_sensor')(SCHEMA, MIX, Fluid_columns, PART.zones_partitions, PART.ghost_partitions) +local SENSOR = (require 'prometeo_sensor')(SCHEMA, MIX, TYPES, Fluid_columns, + PART.zones_partitions, PART.ghost_partitions) -- BCOND routines -local BCOND = (require 'prometeo_bc')(SCHEMA, MIX, CHEM, Fluid_columns, PART.zones_partitions, DEBUG_OUTPUT) +local BCOND = (require 'prometeo_bc')(SCHEMA, MIX, TYPES, PART.zones_partitions, + ELECTRIC_FIELD) -- RK routines local RK = (require 'prometeo_rk')(nEq, Fluid_columns) -- RHS routines -local RHS = (require 'prometeo_rhs')(SCHEMA, MIX, METRIC, Fluid_columns, - PART.zones_partitions, PART.ghost_partitions, ATOMIC) +local RHS = (require 'prometeo_rhs')(SCHEMA, MIX, METRIC, TYPES, Fluid_columns, + PART.zones_partitions, PART.ghost_partitions, + ATOMIC) -- Volume averages routines local STAT = (require 'prometeo_stat')(MIX, Fluid_columns) @@ -229,12 +257,20 @@ local PROFILES = (require 'prometeo_profiles')(SCHEMA, MIX, Fluid_columns) -- Averages routines local AVG if AVERAGES then - AVG = (require 'prometeo_average')(SCHEMA, MIX, Fluid_columns) + AVG = (require 'prometeo_average')(SCHEMA, MIX, TYPES, PART, + ELECTRIC_FIELD) end -- Probes routines local PROBES = (require 'prometeo_probe')(SCHEMA, MIX, IO, Fluid_columns) +local Efield +if ELECTRIC_FIELD then + EFIELD = (require "prometeo_electricField")(SCHEMA, MIX, TYPES, + PART.zones_partitions, PART.ghost_partitions, + ATOMIC) +end + ------------------------------------------------------------------------------- -- INITIALIZATION ROUTINES ------------------------------------------------------------------------------- @@ -274,15 +310,22 @@ do [emitFill(p_All, tiles, "lam", rexpr 0.0 end)]; [emitFill(p_All, tiles, "Di" , UTIL.mkArrayConstant(nSpec, rexpr 0.0 end))]; [emitFill(p_All, tiles, "SoS", rexpr 0.0 end)]; +@ESCAPE if (ELECTRIC_FIELD and (MIX.nIons > 0)) then @EMIT + [emitFill(p_All, tiles, "Ki", UTIL.mkArrayConstant(MIX.nIons, rexpr 0.0 end))]; +@TIME end @EPACSE [emitFill(p_All, tiles, "pressure", rexpr 0.0 end)]; [emitFill(p_All, tiles, "temperature", rexpr 0.0 end)]; [emitFill(p_All, tiles, "MassFracs", UTIL.mkArrayConstant(nSpec, rexpr 0.0 end))]; [emitFill(p_All, tiles, "MolarFracs", UTIL.mkArrayConstant(nSpec, rexpr 0.0 end))]; [emitFill(p_All, tiles, "velocity", rexpr array(0.0, 0.0, 0.0) end)]; +@ESCAPE if ELECTRIC_FIELD then @EMIT + [emitFill(p_All, tiles, "electricPotential", rexpr 0.0 end)]; + [emitFill(p_All, tiles, "electricField", rexpr array(0.0, 0.0, 0.0) end)]; +@TIME end @EPACSE [emitFill(p_All, tiles, "velocityGradientX", rexpr array(0.0, 0.0, 0.0) end)]; [emitFill(p_All, tiles, "velocityGradientY", rexpr array(0.0, 0.0, 0.0) end)]; [emitFill(p_All, tiles, "velocityGradientZ", rexpr array(0.0, 0.0, 0.0) end)]; - [emitFill(p_All, tiles, "temperatureGradient", rexpr array(0.0, 0.0, 0.0) end)]; +-- [emitFill(p_All, tiles, "temperatureGradient", rexpr array(0.0, 0.0, 0.0) end)]; [emitFill(p_All, tiles, "Conserved", UTIL.mkArrayConstant(nEq, rexpr 0.0 end))]; [emitFill(p_All, tiles, "Conserved_old", UTIL.mkArrayConstant(nEq, rexpr 0.0 end))]; -- [emitFill(p_All, tiles, "Conserved_hat", UTIL.mkArrayConstant(nEq, rexpr 0.0 end))]; @@ -370,7 +413,7 @@ do var SpeciesNames = MIX.GetSpeciesNames(Mix) var dirname = [&int8](C.malloc(256)) C.snprintf(dirname, 256, '%s/debugOut', config.Mapping.outDir) - var _1 = IO.createDir(dirname) + var _1 = IO.createDir(0, dirname) _1 = HDF_DEBUG.dump( _1, tiles_output, dirname, Fluid, Fluid_copy, p_Output, p_Output_copy) _1 = HDF_DEBUG.write.timeStep( _1, tiles_output, dirname, Fluid, p_Output, Integrator_timeStep) _1 = HDF_DEBUG.write.simTime( _1, tiles_output, dirname, Fluid, p_Output, Integrator_simTime) @@ -414,7 +457,7 @@ do var [T] = IO.Console_WriteTiming(0, config.Mapping, "UpdatePrimitivesAndBCsFromConserved", @LINE, C.legion_get_current_time_in_nanos()) @TIME end @EPACSE - -- Update all primitive variables... + -- Update all primitive variables... __demand(__index_launch) for c in tiles do VARS.UpdatePrimitiveFromConserved(p_All[c], p_Interior[c], Mix) @@ -489,6 +532,7 @@ do xNeg_ispace, xPos_ispace, yNeg_ispace, yPos_ispace, zNeg_ispace, zPos_ispace} = Fluid_Zones; + var {p_GradientGhosts} = Fluid_Ghost; @ESCAPE if TIMING then @EMIT var [T] = IO.Console_WriteTiming(0, config.Mapping, "UpdateDerivatives", @LINE, C.legion_get_current_time_in_nanos()) @@ -529,6 +573,17 @@ do RHS.AddBodyForces(p_All[c], p_solved[c], config.Flow.bodyForce) end +@ESCAPE if TIMING then @EMIT + [T] = IO.Console_WriteTiming([T], config.Mapping, "UpdateDerivatives", @LINE, C.legion_get_current_time_in_nanos()) +@TIME end @EPACSE + +@ESCAPE if ELECTRIC_FIELD then @EMIT + __demand(__index_launch) + for c in tiles do + EFIELD.AddIonWindSources(p_GradientGhosts[c], p_All[c], p_solved[c], Fluid.bounds, Mix); + end +@TIME end @EPACSE + @ESCAPE if TIMING then @EMIT [T] = IO.Console_WriteTiming([T], config.Mapping, "UpdateDerivatives", @LINE, C.legion_get_current_time_in_nanos()) @TIME end @EPACSE @@ -561,6 +616,15 @@ do [T] = IO.Console_WriteTiming([T], config.Mapping, "UpdateDerivatives", @LINE, C.legion_get_current_time_in_nanos()) @TIME end @EPACSE +@ESCAPE if (ELECTRIC_FIELD and (MIX.nIons > 0)) then @EMIT + -- Use ion drift fluxes to update conserved variables derivatives + EFIELD.UpdateUsingIonDriftFlux(Fluid, tiles, Fluid_Zones, Fluid_Ghost, Mix, config); + +@ESCAPE if TIMING then @EMIT + [T] = IO.Console_WriteTiming([T], config.Mapping, "UpdateDerivatives", @LINE, C.legion_get_current_time_in_nanos()) +@TIME end @EPACSE +@TIME end @EPACSE + -- Update using NSCBC_Outflow bcs if (config.BC.xBCRight.type == SCHEMA.FlowBC_NSCBC_Outflow) then var MaxMach = 0.0 @@ -629,6 +693,17 @@ do end end +@ESCAPE if TIMING then @EMIT + [T] = IO.Console_WriteTiming([T], config.Mapping, "UpdateDerivatives", @LINE, C.legion_get_current_time_in_nanos()) +@TIME end @EPACSE + + if (config.BC.yBCLeft.type == SCHEMA.FlowBC_NSCBC_Inflow) then + __demand(__index_launch) + for c in yNeg_ispace do + [RHS.mkUpdateUsingFluxNSCBCInflow("yNeg")](p_All[c], p_yNeg[c], Mix) + end + end + @ESCAPE if TIMING then @EMIT [T] = IO.Console_WriteTiming([T], config.Mapping, "UpdateDerivatives", @LINE, C.legion_get_current_time_in_nanos()) @TIME end @EPACSE @@ -706,6 +781,8 @@ local function mkInstance() local INSTANCE = {} NZout = regentlib.newsymbol(), numTilesOut = regentlib.newsymbol(), } + + -- Boundary conditions symbols local BC = BCOND.BCDataList local Integrator_deltaTime = regentlib.newsymbol() @@ -730,13 +807,21 @@ local function mkInstance() local INSTANCE = {} local interior_volume = regentlib.newsymbol(double) + -- Averages symbols local Averages if AVERAGES then Averages = AVG.AvgList end + -- Probes symbols local Probes = PROBES.ProbesList + -- Electric field symbols + local EfieldData + if ELECTRIC_FIELD then + EfieldData = EFIELD.DataList + end + ----------------------------------------------------------------------------- -- Exported symbols ----------------------------------------------------------------------------- @@ -767,12 +852,6 @@ local function mkInstance() local INSTANCE = {} -- Write console header IO.Console_WriteHeader(config.Mapping) - --------------------------------------------------------------------------- - -- Initialize the mixture - --------------------------------------------------------------------------- - - var [Mix] = MIX.InitMixture(config) - --------------------------------------------------------------------------- -- Declare & initialize state variables --------------------------------------------------------------------------- @@ -785,6 +864,9 @@ local function mkInstance() local INSTANCE = {} if config.BC.xBCLeft.type == SCHEMA.FlowBC_Periodic then Grid.xBnum = 0 end if config.BC.yBCLeft.type == SCHEMA.FlowBC_Periodic then Grid.yBnum = 0 end if config.BC.zBCLeft.type == SCHEMA.FlowBC_Periodic then Grid.zBnum = 0 end + if config.BC.xBCLeft.type ~= SCHEMA.FlowBC_Periodic then regentlib.assert(config.Grid.xNum > 4, "HTR needs at least five points along non-periodic boundaries (x dir)") end + if config.BC.yBCLeft.type ~= SCHEMA.FlowBC_Periodic then regentlib.assert(config.Grid.yNum > 4, "HTR needs at least five points along non-periodic boundaries (y dir)") end + if config.BC.zBCLeft.type ~= SCHEMA.FlowBC_Periodic then regentlib.assert(config.Grid.zNum > 4, "HTR needs at least five points along non-periodic boundaries (z dir)") end var [Grid.NX] = config.Mapping.tiles[0] var [Grid.NY] = config.Mapping.tiles[1] @@ -834,17 +916,23 @@ local function mkInstance() local INSTANCE = {} var [tiles] = ispace(int3d, {Grid.NX, Grid.NY, Grid.NZ}) -- Fluid Partitioning - var [Fluid_Zones] = PART.PartitionZones(Fluid, tiles, config, Grid.xBnum, Grid.yBnum, Grid.zBnum) + var [Fluid_Zones] = PART.PartitionZones(Fluid, tiles, config, Grid.xBnum, Grid.yBnum, Grid.zBnum) -- Unpack the partitions that we are going to need - var {p_All} = Fluid_Zones; + var {p_All} = Fluid_Zones; -- Output partitionig var [tiles_output] = ispace(int3d, {Grid.NXout, Grid.NYout, Grid.NZout}) var [Fluid_Output] = PART.PartitionOutput(Fluid, tiles_output, config, Grid.xBnum, Grid.yBnum, Grid.zBnum) var [Fluid_Output_copy] = PART.PartitionOutput(Fluid_copy, tiles_output, config, - Grid.xBnum, Grid.yBnum, Grid.zBnum); + Grid.xBnum, Grid.yBnum, Grid.zBnum) + + --------------------------------------------------------------------------- + -- Initialize the mixture + --------------------------------------------------------------------------- + + var [Mix] = MIX.InitMixture(Fluid, tiles, Fluid_Zones.p_All, config); --------------------------------------------------------------------------- -- Declare BC symbols @@ -852,14 +940,14 @@ local function mkInstance() local INSTANCE = {} [BCOND.DeclSymbols(BC, Fluid, tiles, Fluid_Zones, Grid, config, Mix)]; --------------------------------------------------------------------------- - -- Create one-dimensional averages + -- Declare averages symbols --------------------------------------------------------------------------- @ESCAPE if AVERAGES then @EMIT [AVG.DeclSymbols(Averages, Grid, Fluid, p_All, config, MAPPER)]; @TIME end @EPACSE --------------------------------------------------------------------------- - -- Create probes + -- Declare probes symbols --------------------------------------------------------------------------- [PROBES.DeclSymbols(Probes, Grid, Fluid, p_All, config)]; @@ -870,10 +958,17 @@ local function mkInstance() local INSTANCE = {} var vProbe = config.IO.volumeProbes.values[p] var dirname = [&int8](C.malloc(256)) C.snprintf(dirname, 256, '%s/%s', config.Mapping.outDir, vProbe.outDir) - var _1 = IO.createDir(dirname) + var _1 = IO.createDir(0, dirname) C.free(dirname) end + --------------------------------------------------------------------------- + -- Declare electric field solver symbols + --------------------------------------------------------------------------- +@ESCAPE if ELECTRIC_FIELD then @EMIT + [EFIELD.DeclSymbols(EfieldData, Fluid, tiles, Fluid_Zones, Grid, config, MAPPER)]; +@TIME end @EPACSE + end end -- DeclSymbols ----------------------------------------------------------------------------- @@ -911,10 +1006,10 @@ local function mkInstance() local INSTANCE = {} var [Fluid_Ghost] = PART.PartitionGhost(Fluid, tiles, Fluid_Zones) -- Unpack the ghost partitions that we are going to need - var {p_MetricGhostsX, p_MetricGhostsY, p_MetricGhostsZ, p_MetricGhosts} = Fluid_Ghost + var {p_MetricGhosts} = Fluid_Ghost -- Wait for the ghost partitions to be created - -- TODO: we could aviod this fence by changing the mapper such that + -- TODO: we could aviod this fence by changing the mapper such that -- we ensure that all the recurring tasks are mapped on regions -- collocated with the Ghosts __fence(__execution, __block) @@ -960,6 +1055,8 @@ local function mkInstance() local INSTANCE = {} -- Initialize averages --------------------------------------------------------------------------- @ESCAPE if AVERAGES then @EMIT + -- Initialize averages partitions + [AVG.InitPartitions(Averages, Grid, Fluid, p_All, config)]; -- Initialize averages [AVG.InitRakesAndPlanes(Averages)]; @TIME end @EPACSE @@ -968,7 +1065,7 @@ local function mkInstance() local INSTANCE = {} -- Initialize solution --------------------------------------------------------------------------- if config.Flow.initCase.type == SCHEMA.FlowInitCase_Uniform then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initCase.u.Uniform.molarFracs, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initCase.u.Uniform.molarFracs, Mix) __demand(__index_launch) for c in tiles do INIT.InitializeUniform(p_All[c], @@ -979,7 +1076,7 @@ local function mkInstance() local INSTANCE = {} end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_Random then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initCase.u.Random.molarFracs, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initCase.u.Random.molarFracs, Mix) __demand(__index_launch) for c in tiles do INIT.InitializeRandom(p_All[c], @@ -990,7 +1087,7 @@ local function mkInstance() local INSTANCE = {} end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_TaylorGreen2DVortex then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initCase.u.TaylorGreen2DVortex.molarFracs, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initCase.u.TaylorGreen2DVortex.molarFracs, Mix) __demand(__index_launch) for c in tiles do INIT.InitializeTaylorGreen2D(p_All[c], @@ -1005,7 +1102,7 @@ local function mkInstance() local INSTANCE = {} end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_TaylorGreen3DVortex then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initCase.u.TaylorGreen3DVortex.molarFracs, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initCase.u.TaylorGreen3DVortex.molarFracs, Mix) __demand(__index_launch) for c in tiles do INIT.InitializeTaylorGreen3D(p_All[c], @@ -1020,7 +1117,7 @@ local function mkInstance() local INSTANCE = {} end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_Perturbed then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initCase.u.Perturbed.molarFracs, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initCase.u.Perturbed.molarFracs, Mix) __demand(__index_launch) for c in tiles do INIT.InitializePerturbed(p_All[c], @@ -1031,42 +1128,42 @@ local function mkInstance() local INSTANCE = {} end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_RiemannTestOne then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initMixture, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initMixture, Mix) __demand(__index_launch) for c in tiles do - INIT.InitializeRiemannTestOne(p_All[c], initMolarFracs, Mix) + INIT.InitializeRiemannTestOne(p_All[c], initMolarFracs) end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_RiemannTestTwo then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initMixture, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initMixture, Mix) __demand(__index_launch) for c in tiles do - INIT.InitializeRiemannTestTwo(p_All[c], initMolarFracs, Mix) + INIT.InitializeRiemannTestTwo(p_All[c], initMolarFracs) end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_SodProblem then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initMixture, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initMixture, Mix) __demand(__index_launch) for c in tiles do - INIT.InitializeSodProblem(p_All[c], initMolarFracs, Mix) + INIT.InitializeSodProblem(p_All[c], initMolarFracs) end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_LaxProblem then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initMixture, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initMixture, Mix) __demand(__index_launch) for c in tiles do - INIT.InitializeLaxProblem(p_All[c], initMolarFracs, Mix) + INIT.InitializeLaxProblem(p_All[c], initMolarFracs) end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_ShuOsherProblem then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initMixture, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initMixture, Mix) __demand(__index_launch) for c in tiles do - INIT.InitializeShuOsherProblem(p_All[c], initMolarFracs, Mix) + INIT.InitializeShuOsherProblem(p_All[c], initMolarFracs) end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_VortexAdvection2D then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initMixture, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initMixture, Mix) __demand(__index_launch) for c in tiles do INIT.InitializeVortexAdvection2D(p_All[c], @@ -1085,7 +1182,7 @@ local function mkInstance() local INSTANCE = {} end elseif config.Flow.initCase.type == SCHEMA.FlowInitCase_ChannelFlow then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initCase.u.ChannelFlow.molarFracs, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initCase.u.ChannelFlow.molarFracs, Mix) __demand(__index_launch) for c in tiles do INIT.InitializeChannelFlow(p_All[c], @@ -1125,7 +1222,7 @@ local function mkInstance() local INSTANCE = {} end if config.Flow.resetMixture then - var initMolarFracs = CHEM.ParseConfigMixture(config.Flow.initMixture, Mix) + var initMolarFracs = MIX.ParseConfigMixture(config.Flow.initMixture, Mix) __demand(__index_launch) for c in tiles do CHEM.ResetMixture(p_All[c], p_Interior[c], initMolarFracs) @@ -1138,9 +1235,6 @@ local function mkInstance() local INSTANCE = {} __demand(__index_launch) for c in tiles do METRIC.InitializeMetric(p_MetricGhosts[c], - p_MetricGhostsX[c], - p_MetricGhostsY[c], - p_MetricGhostsZ[c], p_All[c], Fluid_bounds, config.Grid.xWidth, config.Grid.yWidth, config.Grid.zWidth) @@ -1159,6 +1253,13 @@ local function mkInstance() local INSTANCE = {} --------------------------------------------------------------------------- [BCOND.InitBCs(BC, Fluid_Zones, config, Mix)]; + --------------------------------------------------------------------------- + -- Initialize electric field solver + --------------------------------------------------------------------------- +@ESCAPE if ELECTRIC_FIELD then @EMIT + [EFIELD.Init(EfieldData, tiles, Grid, config)]; +@TIME end @EPACSE + --------------------------------------------------------------------------- -- Initialize quantities for time stepping --------------------------------------------------------------------------- @@ -1187,7 +1288,15 @@ local function mkInstance() local INSTANCE = {} BC.RecycleAverageFI, config, Mix, - Integrator_simTime) + Integrator_simTime); + + --------------------------------------------------------------------------- + -- Update the electric field + --------------------------------------------------------------------------- +@ESCAPE if ELECTRIC_FIELD then @EMIT + [EFIELD.UpdateElectricField(EfieldData, Fluid, Fluid_Zones, Fluid_Ghost, + tiles, Fluid_bounds, Mix, config)]; +@TIME end @EPACSE --------------------------------------------------------------------------- -- Initialize data for IO @@ -1261,7 +1370,7 @@ local function mkInstance() local INSTANCE = {} var averageRhoU = 0.0 __demand(__index_launch) for c in tiles do - AveragePressure += STAT.CalculateAveragePressure(p_All[c], p_Interior[c]) + AveragePressure += STAT.CalculateAveragePressure(p_All[c], p_Interior[c]) end __demand(__index_launch) for c in tiles do @@ -1333,21 +1442,8 @@ local function mkInstance() local INSTANCE = {} @ESCAPE if AVERAGES then @EMIT -- Add averages - if ((Integrator_timeStep % config.IO.AveragesSamplingInterval == 0) and - ((config.IO.YZAverages.length ~= 0) or - (config.IO.XZAverages.length ~= 0) or - (config.IO.XYAverages.length ~= 0) or - (config.IO.XAverages.length ~= 0) or - (config.IO.YAverages.length ~= 0) or - (config.IO.ZAverages.length ~= 0) )) then - - -- Update temperature gradient for mean heat flux - __demand(__index_launch) - for c in tiles do - VARS.GetTemperatureGradients(p_GradientGhosts[c], p_All[c], Fluid_bounds) - end - - [AVG.AddAverages(Averages, Integrator_deltaTime, config, Mix)] + if (Integrator_timeStep % config.IO.AveragesSamplingInterval == 0) then + [AVG.AddAverages(Averages, Fluid_bounds, Integrator_deltaTime, config, Mix)] end @ESCAPE if TIMING then @EMIT @@ -1362,7 +1458,7 @@ local function mkInstance() local INSTANCE = {} var SpeciesNames = MIX.GetSpeciesNames(Mix) var dirname = [&int8](C.malloc(256)) C.snprintf(dirname, 256, '%s/fluid_iter%010d', config.Mapping.outDir, Integrator_timeStep) - var _1 = IO.createDir(dirname) + var _1 = IO.createDir(0, dirname) _1 = HDF.dump( _1, tiles_output, dirname, Fluid, Fluid_copy, p_Output, p_Output_copy) _1 = HDF.write.timeStep( _1, tiles_output, dirname, Fluid, p_Output, Integrator_timeStep) _1 = HDF.write.simTime( _1, tiles_output, dirname, Fluid, p_Output, Integrator_simTime) @@ -1371,7 +1467,7 @@ local function mkInstance() local INSTANCE = {} _1 = HDF.write.channelForcing( _1, tiles_output, dirname, Fluid, p_Output, config.Flow.turbForcing.u.CHANNEL.Forcing); @ESCAPE if AVERAGES then @EMIT - [AVG.WriteAverages(Averages, tiles, dirname, IO, SpeciesNames, config)]; + [AVG.WriteAverages(_1, Averages, tiles, dirname, IO, SpeciesNames, config)]; @TIME end @EPACSE C.free(dirname) @@ -1391,7 +1487,7 @@ local function mkInstance() local INSTANCE = {} C.snprintf(dirname, 256, '%s/%s/iter%010d', config.Mapping.outDir, vProbe.outDir, Integrator_timeStep) var p_Vprobe = static_cast(partition(disjoint, Fluid, tiles_output), p_Vprobes[p]) var p_Vprobe_copy = static_cast(partition(disjoint, Fluid_copy, tiles_output), p_Vprobes_copy[p]) - var _1 = IO.createDir(dirname) + var _1 = IO.createDir(0, dirname) _1 = HDF.dump( _1, tiles_output, dirname, Fluid, Fluid_copy, p_Vprobe, p_Vprobe_copy) _1 = HDF.write.timeStep( _1, tiles_output, dirname, Fluid, p_Vprobe, Integrator_timeStep) _1 = HDF.write.simTime( _1, tiles_output, dirname, Fluid, p_Vprobe, Integrator_simTime) @@ -1540,6 +1636,20 @@ local function mkInstance() local INSTANCE = {} Mix, Integrator_simTime); + -- Update the electric field +@ESCAPE if ELECTRIC_FIELD then @EMIT + @ESCAPE if TIMING then @EMIT + [T] = IO.Console_WriteTiming([T], config.Mapping, "workSingle", @LINE, C.legion_get_current_time_in_nanos()) + @TIME end @EPACSE + + [EFIELD.UpdateElectricField(EfieldData, Fluid, Fluid_Zones, Fluid_Ghost, + tiles, Fluid_bounds, Mix, config)]; + + @ESCAPE if TIMING then @EMIT + [T] = IO.Console_WriteTiming([T], config.Mapping, "workSingle", @LINE, C.legion_get_current_time_in_nanos()) + @TIME end @EPACSE +@TIME end @EPACSE + @ESCAPE if DEBUG_OUTPUT then @EMIT CheckDebugOutput(Fluid, Fluid_copy, tiles, tiles_output, @@ -1561,7 +1671,7 @@ local function mkInstance() local INSTANCE = {} Integrator_simTime = Integrator_time_old + Integrator_deltaTime @TIME else @EMIT if config.Integrator.implicitChemistry then - Integrator_simTime = Integrator_time_old + Integrator_simTime = Integrator_time_old + Integrator_deltaTime * 0.5 *(1.0 + [RK_C[STAGE][3]]) else Integrator_simTime = Integrator_time_old + [RK_C[STAGE][3]] * Integrator_deltaTime @@ -1598,6 +1708,11 @@ local function mkInstance() local INSTANCE = {} function INSTANCE.Cleanup(config) return rquote + -- Cleanup electric field solver symbols +@ESCAPE if ELECTRIC_FIELD then @EMIT + [EFIELD.Cleanup(EfieldData, tiles, config)]; +@TIME end @EPACSE + -- Wait for everything above to finish __fence(__execution, __block) diff --git a/src/prometeo_IO.rg b/src/prometeo_IO.rg index 671ea4c..3d172c6 100644 --- a/src/prometeo_IO.rg +++ b/src/prometeo_IO.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -58,13 +58,20 @@ end -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP task Exports.Console_WriteHeader(config_Mapping : SCHEMA.MappingStruct) - [emitConsoleWrite(config_Mapping, 'Iter\t'.. - 'Sim Time\t'.. - 'Wall t\t'.. - 'Delta Time\t'.. - 'Avg Press\t'.. - 'Avg Temp\t'.. - 'Average KE\n')]; + [emitConsoleWrite(config_Mapping, '%10s'.. + '%15s'.. + '%13s'.. + '%15s'.. + '%15s'.. + '%15s'.. + '%15s\n', + 'Iter', + 'Sim Time', + 'Wall t', + 'Delta Time', + 'Avg Press', + 'Avg Temp', + 'Average KE')]; end -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP @@ -77,13 +84,13 @@ task Exports.Console_Write(config_Mapping : SCHEMA.MappingStruct, Flow_averageTemperature : double, Flow_averageKineticEnergy : double) var currTime = C.legion_get_current_time_in_micros() / 1000; - [emitConsoleWrite(config_Mapping, '%d\t'.. - '%e\t'.. - '%llu.%03llu\t'.. - '%e\t'.. - '%e\t'.. - '%e\t'.. - '%e\n', + [emitConsoleWrite(config_Mapping, '%10d'.. + '%15.7e'.. + '%9llu.%03llu'.. + '%15.7e'.. + '%15.7e'.. + '%15.7e'.. + '%15.7e\n', Integrator_timeStep, Integrator_simTime, rexpr (currTime - startTime) / 1000 end, @@ -122,10 +129,14 @@ end -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP task Exports.Probe_WriteHeader(config_Mapping : SCHEMA.MappingStruct, probeId : int) - [emitProbeWrite(config_Mapping, probeId, 'Iter\t'.. - 'Time\t'.. - 'Temperature\t'.. - 'Pressure\n')]; + [emitProbeWrite(config_Mapping, probeId, '%10s'.. + '%15s' .. + '%15s' .. + '%15s\n', + 'Iter', + 'Time', + 'Temperature', + 'Pressure')]; end -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP @@ -135,10 +146,10 @@ task Exports.Probe_Write(config_Mapping : SCHEMA.MappingStruct, Integrator_simTime : double, avgTemperature : double, avgPressure : double) - [emitProbeWrite(config_Mapping, probeId, '%6d\t'.. - '%12.7e\t' .. - '%12.7e\t' .. - '%12.7e\n', + [emitProbeWrite(config_Mapping, probeId, '%10d'.. + '%15.7e' .. + '%15.7e' .. + '%15.7e\n', Integrator_timeStep, Integrator_simTime, avgTemperature, @@ -175,9 +186,9 @@ task Exports.Console_WriteTiming( _ : int, end -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP -task Exports.createDir(dirname : regentlib.string) +task Exports.createDir(_ : int, dirname : regentlib.string) UTIL.createDir(dirname) - return 0 + return _ end return Exports end diff --git a/src/prometeo_average.cc b/src/prometeo_average.cc new file mode 100644 index 0000000..4278220 --- /dev/null +++ b/src/prometeo_average.cc @@ -0,0 +1,552 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_average.hpp" +#include "prometeo_average.inl" + +// Add2DAveragesTask +template +void Add2DAveragesTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 1); + + // Accessors for variables with gradient stencil access + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO acc_MolarFracs (regions[0], FID_MolarFracs); + + // Accessors for cell geometry + const AccessorRO< Vec3, 3> acc_centerCoordinates (regions[1], FID_centerCoordinates); + const AccessorRO< Vec3, 3> acc_cellWidth (regions[1], FID_cellWidth); + + // Accessors for metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi_d (regions[1], FID_dcsi_d); + const AccessorRO acc_deta_d (regions[1], FID_deta_d); + const AccessorRO acc_dzet_d (regions[1], FID_dzet_d); + + // Accessors for primitive variables + const AccessorRO acc_pressure (regions[1], FID_pressure); + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[1], FID_rho); + const AccessorRO acc_mu (regions[1], FID_mu); + const AccessorRO acc_lam (regions[1], FID_lam); + const AccessorRO acc_Di (regions[1], FID_Di); + const AccessorRO acc_SoS (regions[1], FID_SoS); + + // Accessors for gradients + const AccessorRO< Vec3, 3> acc_vGradX (regions[1], FID_velocityGradientX); + const AccessorRO< Vec3, 3> acc_vGradY (regions[1], FID_velocityGradientY); + const AccessorRO< Vec3, 3> acc_vGradZ (regions[1], FID_velocityGradientZ); + +#ifdef ELECTRIC_FIELD + // Accessors for electric variables + const AccessorRO acc_ePot (regions[1], FID_electricPotential); +#if (nIons > 0) + const AccessorRO< Vec3, 3> acc_eField (regions[1], FID_electricField); + const AccessorRO acc_Ki (regions[1], FID_Ki); +#endif +#endif + + // Accessors for averaged quantities + // the order between reduction operators for region requirements is + // - REGENT_REDOP_SUM_VEC3 -> iVec3 + // - REGENT_REDOP_SUM_VECNSP -> iVecNSp + // - REGENT_REDOP_SUM_VEC6 -> iVec6 + // - LEGION_REDOP_SUM_FLOAT64 -> iDouble + const AccessorSumRD acc_avg_weight (regions[iDouble], AVE_FID_weight, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD< Vec3, 2> acc_avg_centerCoordinates (regions[iVec3 ], AVE_FID_centerCoordinates, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_avg (regions[iDouble], AVE_FID_pressure_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_rms (regions[iDouble], AVE_FID_pressure_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_avg (regions[iDouble], AVE_FID_temperature_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_rms (regions[iDouble], AVE_FID_temperature_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_avg (regions[iVecNSp], AVE_FID_MolarFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_rms (regions[iVecNSp], AVE_FID_MolarFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_avg (regions[iVecNSp], AVE_FID_MassFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_rms (regions[iVecNSp], AVE_FID_MassFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 2> acc_velocity_avg (regions[iVec3 ], AVE_FID_velocity_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_rms (regions[iVec3 ], AVE_FID_velocity_rms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_rey (regions[iVec3 ], AVE_FID_velocity_rey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_favg (regions[iDouble], AVE_FID_pressure_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_frms (regions[iDouble], AVE_FID_pressure_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_favg (regions[iDouble], AVE_FID_temperature_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_frms (regions[iDouble], AVE_FID_temperature_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_favg (regions[iVecNSp], AVE_FID_MolarFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_frms (regions[iVecNSp], AVE_FID_MolarFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_favg (regions[iVecNSp], AVE_FID_MassFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_frms (regions[iVecNSp], AVE_FID_MassFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 2> acc_velocity_favg (regions[iVec3 ], AVE_FID_velocity_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_frms (regions[iVec3 ], AVE_FID_velocity_frms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_frey (regions[iVec3 ], AVE_FID_velocity_frey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_rho_avg (regions[iDouble], AVE_FID_rho_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_rho_rms (regions[iDouble], AVE_FID_rho_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_mu_avg (regions[iDouble], AVE_FID_mu_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_avg (regions[iDouble], AVE_FID_lam_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_avg (regions[iVecNSp], AVE_FID_Di_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_avg (regions[iDouble], AVE_FID_SoS_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_avg (regions[iDouble], AVE_FID_cp_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_avg (regions[iDouble], AVE_FID_Ent_avg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD acc_mu_favg (regions[iDouble], AVE_FID_mu_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_favg (regions[iDouble], AVE_FID_lam_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_favg (regions[iVecNSp], AVE_FID_Di_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_favg (regions[iDouble], AVE_FID_SoS_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_favg (regions[iDouble], AVE_FID_cp_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_favg (regions[iDouble], AVE_FID_Ent_favg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 2> acc_q_avg (regions[iVec3 ], AVE_FID_q, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_ProductionRates_avg (regions[iVecNSp], AVE_FID_ProductionRates_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_ProductionRates_rms (regions[iVecNSp], AVE_FID_ProductionRates_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_HeatReleaseRate_avg (regions[iDouble], AVE_FID_HeatReleaseRate_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_HeatReleaseRate_rms (regions[iDouble], AVE_FID_HeatReleaseRate_rms, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 2> acc_rhoUUv (regions[iVec3 ], AVE_FID_rhoUUv, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_Up (regions[iVec3 ], AVE_FID_Up, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_tau (regions[iVec6 ], AVE_FID_tau, REGENT_REDOP_SUM_VEC6); + const AccessorSumRD< Vec3, 2> acc_utau_y (regions[iVec3 ], AVE_FID_utau_y, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_tauGradU (regions[iVec3 ], AVE_FID_tauGradU, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_pGradU (regions[iVec3 ], AVE_FID_pGradU, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_Pr_avg (regions[iDouble], AVE_FID_Pr, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Pr_rms (regions[iDouble], AVE_FID_Pr_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_avg (regions[iDouble], AVE_FID_Ec, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_rms (regions[iDouble], AVE_FID_Ec_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ma_avg (regions[iDouble], AVE_FID_Ma, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Sc_avg (regions[iVecNSp], AVE_FID_Sc, REGENT_REDOP_SUM_VECNSP); + + const AccessorSumRD< Vec3, 2> acc_uT_avg (regions[iVec3 ], AVE_FID_uT_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_uT_favg (regions[iVec3 ], AVE_FID_uT_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_uYi_avg (regions[iVecNSp], AVE_FID_uYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_avg (regions[iVecNSp], AVE_FID_vYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_avg (regions[iVecNSp], AVE_FID_wYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_uYi_favg (regions[iVecNSp], AVE_FID_uYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_favg (regions[iVecNSp], AVE_FID_vYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_favg (regions[iVecNSp], AVE_FID_wYi_favg, REGENT_REDOP_SUM_VECNSP); + +#ifdef ELECTRIC_FIELD + const AccessorSumRD acc_ePot_avg (regions[iDouble], AVE_FID_electricPotential_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Crg_avg (regions[iDouble], AVE_FID_chargeDensity_avg, LEGION_REDOP_SUM_FLOAT64); +#endif + + // Extract execution domains + Rect<3> r_Fluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); + + // Extract average domain + Rect<2> r_Avg = runtime->get_index_space_domain(ctx, args.Averages.get_index_space()); + + // Wait for the integrator deltaTime + const double Integrator_deltaTime = futures[0].get_result(); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_Fluid.lo.z; k <= r_Fluid.hi.z; k++) + for (int j = r_Fluid.lo.y; j <= r_Fluid.hi.y; j++) + for (int i = r_Fluid.lo.x; i <= r_Fluid.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{i, r_Avg.lo.y} : + (dir == Ydir) ? Point<2>{j, r_Avg.lo.y} : + /*(dir == Zdir)*/ Point<2>{k, r_Avg.lo.y}; + + AvgPrimitive(acc_cellWidth, acc_centerCoordinates, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_avg_weight, acc_avg_centerCoordinates, + acc_pressure_avg, acc_pressure_rms, + acc_temperature_avg, acc_temperature_rms, + acc_MolarFracs_avg, acc_MolarFracs_rms, + acc_MassFracs_avg, acc_MassFracs_rms, + acc_velocity_avg, acc_velocity_rms, acc_velocity_rey, + p, pA, Integrator_deltaTime); + + FavreAvgPrimitive(acc_cellWidth, acc_rho, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_pressure_favg, acc_pressure_frms, + acc_temperature_favg, acc_temperature_frms, + acc_MolarFracs_favg, acc_MolarFracs_frms, + acc_MassFracs_favg, acc_MassFracs_frms, + acc_velocity_favg, acc_velocity_frms, acc_velocity_frey, + p, pA, Integrator_deltaTime); + + AvgProperties(acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_rho_avg, acc_rho_rms, + acc_mu_avg, acc_lam_avg, acc_Di_avg, + acc_SoS_avg, acc_cp_avg, acc_Ent_avg, + p, pA, args.mix, Integrator_deltaTime); + + FavreAvgProperties(acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_mu_favg, acc_lam_favg, acc_Di_favg, + acc_SoS_favg, acc_cp_favg, acc_Ent_favg, + p, pA, args.mix, Integrator_deltaTime); + + AvgFluxes_ProdRates(acc_cellWidth, + acc_nType_x, acc_nType_y, acc_nType_z, + acc_dcsi_d, acc_deta_d, acc_dzet_d, + acc_pressure, acc_temperature, acc_MolarFracs, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, acc_eField, +#endif + acc_q_avg, + acc_ProductionRates_avg, acc_ProductionRates_rms, + acc_HeatReleaseRate_avg, acc_HeatReleaseRate_rms, + p, pA, args.Fluid_bounds, args.mix, Integrator_deltaTime); + + AvgKineticEnergyBudget(acc_cellWidth, + acc_pressure, acc_velocity, + acc_rho, acc_mu, + acc_vGradX, acc_vGradY, acc_vGradZ, + acc_rhoUUv, acc_Up, acc_tau, + acc_utau_y, acc_tauGradU, acc_pGradU, + p, pA, args.mix, Integrator_deltaTime); + + AvgDimensionlessNumbers(acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_Pr_avg, acc_Pr_rms, + acc_Ec_avg, acc_Ec_rms, + acc_Ma_avg, acc_Sc_avg, + p, pA, args.mix, Integrator_deltaTime); + + AvgCorrelations(acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, acc_rho, + acc_uT_avg, acc_uT_favg, + acc_uYi_avg, acc_vYi_avg, acc_wYi_avg, + acc_uYi_favg, acc_vYi_favg, acc_wYi_favg, + p, pA, Integrator_deltaTime); + +#ifdef ELECTRIC_FIELD + AvgElectricQuantities(acc_cellWidth, + acc_temperature, acc_MolarFracs, acc_rho, acc_ePot, + acc_ePot_avg, acc_Crg_avg, + p, pA, args.mix, Integrator_deltaTime); +#endif + } +} + +// Specielize Add2DAveragesTask for the X direction +template<> +/*static*/ const char * const Add2DAveragesTask::TASK_NAME = "Add2DAveragesX"; +template<> +/*static*/ const int Add2DAveragesTask::TASK_ID = TID_Add2DAveragesX; + +// Specielize UpdateShockSensorTask for the Y direction +template<> +/*static*/ const char * const Add2DAveragesTask::TASK_NAME = "Add2DAveragesY"; +template<> +/*static*/ const int Add2DAveragesTask::TASK_ID = TID_Add2DAveragesY; + +// Specielize UpdateShockSensorTask for the Z direction +template<> +/*static*/ const char * const Add2DAveragesTask::TASK_NAME = "Add2DAveragesZ"; +template<> +/*static*/ const int Add2DAveragesTask::TASK_ID = TID_Add2DAveragesZ; + +// Add1DAveragesTask +template +void Add1DAveragesTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 1); + + // Accessors for variables with gradient stencil access + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO acc_MolarFracs (regions[0], FID_MolarFracs); + + // Accessors for cell geometry + const AccessorRO< Vec3, 3> acc_centerCoordinates (regions[1], FID_centerCoordinates); + const AccessorRO< Vec3, 3> acc_cellWidth (regions[1], FID_cellWidth); + + // Accessors for metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi_d (regions[1], FID_dcsi_d); + const AccessorRO acc_deta_d (regions[1], FID_deta_d); + const AccessorRO acc_dzet_d (regions[1], FID_dzet_d); + + // Accessors for primitive variables + const AccessorRO acc_pressure (regions[1], FID_pressure); + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[1], FID_rho); + const AccessorRO acc_mu (regions[1], FID_mu); + const AccessorRO acc_lam (regions[1], FID_lam); + const AccessorRO acc_Di (regions[1], FID_Di); + const AccessorRO acc_SoS (regions[1], FID_SoS); + + // Accessors for gradients + const AccessorRO< Vec3, 3> acc_vGradX (regions[1], FID_velocityGradientX); + const AccessorRO< Vec3, 3> acc_vGradY (regions[1], FID_velocityGradientY); + const AccessorRO< Vec3, 3> acc_vGradZ (regions[1], FID_velocityGradientZ); + +#ifdef ELECTRIC_FIELD + // Accessors for electric variables + const AccessorRO acc_ePot (regions[1], FID_electricPotential); +#if (nIons > 0) + const AccessorRO< Vec3, 3> acc_eField (regions[1], FID_electricField); + const AccessorRO acc_Ki (regions[1], FID_Ki); +#endif +#endif + + // Accessors for averaged quantities + // - REGENT_REDOP_SUM_VEC3 -> iVec3 + // - REGENT_REDOP_SUM_VECNSP -> iVecNSp + // - REGENT_REDOP_SUM_VEC6 -> iVec6 + // - LEGION_REDOP_SUM_FLOAT64 -> iDouble + const AccessorSumRD acc_avg_weight (regions[iDouble], AVE_FID_weight, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD< Vec3, 3> acc_avg_centerCoordinates (regions[iVec3 ], AVE_FID_centerCoordinates, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_avg (regions[iDouble], AVE_FID_pressure_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_rms (regions[iDouble], AVE_FID_pressure_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_avg (regions[iDouble], AVE_FID_temperature_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_rms (regions[iDouble], AVE_FID_temperature_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_avg (regions[iVecNSp], AVE_FID_MolarFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_rms (regions[iVecNSp], AVE_FID_MolarFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_avg (regions[iVecNSp], AVE_FID_MassFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_rms (regions[iVecNSp], AVE_FID_MassFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 3> acc_velocity_avg (regions[iVec3 ], AVE_FID_velocity_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_rms (regions[iVec3 ], AVE_FID_velocity_rms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_rey (regions[iVec3 ], AVE_FID_velocity_rey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_favg (regions[iDouble], AVE_FID_pressure_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_frms (regions[iDouble], AVE_FID_pressure_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_favg (regions[iDouble], AVE_FID_temperature_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_frms (regions[iDouble], AVE_FID_temperature_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_favg (regions[iVecNSp], AVE_FID_MolarFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_frms (regions[iVecNSp], AVE_FID_MolarFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_favg (regions[iVecNSp], AVE_FID_MassFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_frms (regions[iVecNSp], AVE_FID_MassFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 3> acc_velocity_favg (regions[iVec3 ], AVE_FID_velocity_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_frms (regions[iVec3 ], AVE_FID_velocity_frms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_frey (regions[iVec3 ], AVE_FID_velocity_frey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_rho_avg (regions[iDouble], AVE_FID_rho_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_rho_rms (regions[iDouble], AVE_FID_rho_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_mu_avg (regions[iDouble], AVE_FID_mu_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_avg (regions[iDouble], AVE_FID_lam_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_avg (regions[iVecNSp], AVE_FID_Di_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_avg (regions[iDouble], AVE_FID_SoS_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_avg (regions[iDouble], AVE_FID_cp_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_avg (regions[iDouble], AVE_FID_Ent_avg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD acc_mu_favg (regions[iDouble], AVE_FID_mu_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_favg (regions[iDouble], AVE_FID_lam_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_favg (regions[iVecNSp], AVE_FID_Di_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_favg (regions[iDouble], AVE_FID_SoS_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_favg (regions[iDouble], AVE_FID_cp_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_favg (regions[iDouble], AVE_FID_Ent_favg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 3> acc_q_avg (regions[iVec3 ], AVE_FID_q, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_ProductionRates_avg (regions[iVecNSp], AVE_FID_ProductionRates_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_ProductionRates_rms (regions[iVecNSp], AVE_FID_ProductionRates_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_HeatReleaseRate_avg (regions[iDouble], AVE_FID_HeatReleaseRate_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_HeatReleaseRate_rms (regions[iDouble], AVE_FID_HeatReleaseRate_rms, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 3> acc_rhoUUv (regions[iVec3 ], AVE_FID_rhoUUv, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_Up (regions[iVec3 ], AVE_FID_Up, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_tau (regions[iVec6 ], AVE_FID_tau, REGENT_REDOP_SUM_VEC6); + const AccessorSumRD< Vec3, 3> acc_utau_y (regions[iVec3 ], AVE_FID_utau_y, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_tauGradU (regions[iVec3 ], AVE_FID_tauGradU, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_pGradU (regions[iVec3 ], AVE_FID_pGradU, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_Pr_avg (regions[iDouble], AVE_FID_Pr, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Pr_rms (regions[iDouble], AVE_FID_Pr_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_avg (regions[iDouble], AVE_FID_Ec, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_rms (regions[iDouble], AVE_FID_Ec_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ma_avg (regions[iDouble], AVE_FID_Ma, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Sc_avg (regions[iVecNSp], AVE_FID_Sc, REGENT_REDOP_SUM_VECNSP); + + const AccessorSumRD< Vec3, 3> acc_uT_avg (regions[iVec3 ], AVE_FID_uT_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_uT_favg (regions[iVec3 ], AVE_FID_uT_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_uYi_avg (regions[iVecNSp], AVE_FID_uYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_avg (regions[iVecNSp], AVE_FID_vYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_avg (regions[iVecNSp], AVE_FID_wYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_uYi_favg (regions[iVecNSp], AVE_FID_uYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_favg (regions[iVecNSp], AVE_FID_vYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_favg (regions[iVecNSp], AVE_FID_wYi_favg, REGENT_REDOP_SUM_VECNSP); + +#ifdef ELECTRIC_FIELD + const AccessorSumRD acc_ePot_avg (regions[iDouble], AVE_FID_electricPotential_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Crg_avg (regions[iDouble], AVE_FID_chargeDensity_avg, LEGION_REDOP_SUM_FLOAT64); +#endif + + // Extract execution domains + Rect<3> r_Fluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); + + // Extract average domain + Rect<3> r_Avg = runtime->get_index_space_domain(ctx, args.Averages.get_index_space()); + + // Wait for the integrator deltaTime + const double Integrator_deltaTime = futures[0].get_result(); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_Fluid.lo.z; k <= r_Fluid.hi.z; k++) + for (int j = r_Fluid.lo.y; j <= r_Fluid.hi.y; j++) + for (int i = r_Fluid.lo.x; i <= r_Fluid.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{j, k, r_Avg.lo.z} : + (dir == Ydir) ? Point<3>{i, k, r_Avg.lo.z} : + /*(dir == Zdir)*/ Point<3>{i, j, r_Avg.lo.z}; + + AvgPrimitive(acc_cellWidth, acc_centerCoordinates, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_avg_weight, acc_avg_centerCoordinates, + acc_pressure_avg, acc_pressure_rms, + acc_temperature_avg, acc_temperature_rms, + acc_MolarFracs_avg, acc_MolarFracs_rms, + acc_MassFracs_avg, acc_MassFracs_rms, + acc_velocity_avg, acc_velocity_rms, acc_velocity_rey, + p, pA, Integrator_deltaTime); + + FavreAvgPrimitive(acc_cellWidth, acc_rho, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_pressure_favg, acc_pressure_frms, + acc_temperature_favg, acc_temperature_frms, + acc_MolarFracs_favg, acc_MolarFracs_frms, + acc_MassFracs_favg, acc_MassFracs_frms, + acc_velocity_favg, acc_velocity_frms, acc_velocity_frey, + p, pA, Integrator_deltaTime); + + AvgProperties(acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_rho_avg, acc_rho_rms, + acc_mu_avg, acc_lam_avg, acc_Di_avg, + acc_SoS_avg, acc_cp_avg, acc_Ent_avg, + p, pA, args.mix, Integrator_deltaTime); + + FavreAvgProperties(acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_mu_favg, acc_lam_favg, acc_Di_favg, + acc_SoS_favg, acc_cp_favg, acc_Ent_favg, + p, pA, args.mix, Integrator_deltaTime); + + AvgFluxes_ProdRates(acc_cellWidth, + acc_nType_x, acc_nType_y, acc_nType_z, + acc_dcsi_d, acc_deta_d, acc_dzet_d, + acc_pressure, acc_temperature, acc_MolarFracs, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, acc_eField, +#endif + acc_q_avg, + acc_ProductionRates_avg, acc_ProductionRates_rms, + acc_HeatReleaseRate_avg, acc_HeatReleaseRate_rms, + p, pA, args.Fluid_bounds, args.mix, Integrator_deltaTime); + + AvgKineticEnergyBudget(acc_cellWidth, + acc_pressure, acc_velocity, + acc_rho, acc_mu, + acc_vGradX, acc_vGradY, acc_vGradZ, + acc_rhoUUv, acc_Up, acc_tau, + acc_utau_y, acc_tauGradU, acc_pGradU, + p, pA, args.mix, Integrator_deltaTime); + + AvgDimensionlessNumbers(acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_Pr_avg, acc_Pr_rms, + acc_Ec_avg, acc_Ec_rms, + acc_Ma_avg, acc_Sc_avg, + p, pA, args.mix, Integrator_deltaTime); + + AvgCorrelations(acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, acc_rho, + acc_uT_avg, acc_uT_favg, + acc_uYi_avg, acc_vYi_avg, acc_wYi_avg, + acc_uYi_favg, acc_vYi_favg, acc_wYi_favg, + p, pA, Integrator_deltaTime); + +#ifdef ELECTRIC_FIELD + AvgElectricQuantities(acc_cellWidth, + acc_temperature, acc_MolarFracs, acc_rho, acc_ePot, + acc_ePot_avg, acc_Crg_avg, + p, pA, args.mix, Integrator_deltaTime); +#endif + } +} + +// Specielize Add1DAveragesTask for the X direction +template<> +/*static*/ const char * const Add1DAveragesTask::TASK_NAME = "Add1DAveragesX"; +template<> +/*static*/ const int Add1DAveragesTask::TASK_ID = TID_Add1DAveragesX; + +// Specielize Add1DAveragesTask for the Y direction +template<> +/*static*/ const char * const Add1DAveragesTask::TASK_NAME = "Add1DAveragesY"; +template<> +/*static*/ const int Add1DAveragesTask::TASK_ID = TID_Add1DAveragesY; + +// Specielize Add1DAveragesTask for the Z direction +template<> +/*static*/ const char * const Add1DAveragesTask::TASK_NAME = "Add1DAveragesZ"; +template<> +/*static*/ const int Add1DAveragesTask::TASK_ID = TID_Add1DAveragesZ; + +void register_average_tasks() { + + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + +}; diff --git a/src/prometeo_average.cu b/src/prometeo_average.cu new file mode 100644 index 0000000..7a15fba --- /dev/null +++ b/src/prometeo_average.cu @@ -0,0 +1,1533 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifdef BOUNDS_CHECKS + // See Legion issue #879 for more info + #warning "CUDA variant of average task are not compatible with BOUNDS_CHECKS. It is going to be disabled for these tasks" + #undef BOUNDS_CHECKS +#endif + +#include "prometeo_average.hpp" +#include "prometeo_average.inl" +#include "cuda_utils.hpp" + +// Declare a constant memory that will hold the Mixture struct (initialized in prometeo_mixture.cu) +extern __device__ __constant__ Mix mix; + +//----------------------------------------------------------------------------- +// KERNEL FOR Add2DAveragesTask +//----------------------------------------------------------------------------- + +template +__global__ +void AvgPrimitive2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO< Vec3, 3> centerCoordinates, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorSumRD avg_weight, + const AccessorSumRD< Vec3, 2> avg_centerCoordinates, + const AccessorSumRD pressure_avg, + const AccessorSumRD pressure_rms, + const AccessorSumRD temperature_avg, + const AccessorSumRD temperature_rms, + const AccessorSumRD MolarFracs_avg, + const AccessorSumRD MolarFracs_rms, + const AccessorSumRD MassFracs_avg, + const AccessorSumRD MassFracs_rms, + const AccessorSumRD< Vec3, 2> velocity_avg, + const AccessorSumRD< Vec3, 2> velocity_rms, + const AccessorSumRD< Vec3, 2> velocity_rey, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::AvgPrimitive(cellWidth, centerCoordinates, + pressure, temperature, MolarFracs, + MassFracs, velocity, + avg_weight, avg_centerCoordinates, + pressure_avg, pressure_rms, + temperature_avg, temperature_rms, + MolarFracs_avg, MolarFracs_rms, + MassFracs_avg, MassFracs_rms, + velocity_avg, velocity_rms, velocity_rey, + p, pA, deltaTime); + } +} + +template +__global__ +void FavreAvgPrimitive2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO rho, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorSumRD pressure_favg, + const AccessorSumRD pressure_frms, + const AccessorSumRD temperature_favg, + const AccessorSumRD temperature_frms, + const AccessorSumRD MolarFracs_favg, + const AccessorSumRD MolarFracs_frms, + const AccessorSumRD MassFracs_favg, + const AccessorSumRD MassFracs_frms, + const AccessorSumRD< Vec3, 2> velocity_favg, + const AccessorSumRD< Vec3, 2> velocity_frms, + const AccessorSumRD< Vec3, 2> velocity_frey, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::FavreAvgPrimitive(cellWidth, rho, + pressure, temperature, MolarFracs, + MassFracs, velocity, + pressure_favg, pressure_frms, + temperature_favg, temperature_frms, + MolarFracs_favg, MolarFracs_frms, + MassFracs_favg, MassFracs_frms, + velocity_favg, velocity_frms, velocity_frey, + p, pA, deltaTime); + } +} + +template +__global__ +void AvgProperties2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO SoS, + const AccessorSumRD rho_avg, + const AccessorSumRD rho_rms, + const AccessorSumRD mu_avg, + const AccessorSumRD lam_avg, + const AccessorSumRD Di_avg, + const AccessorSumRD SoS_avg, + const AccessorSumRD cp_avg, + const AccessorSumRD Ent_avg, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::AvgProperties( + cellWidth, temperature, MassFracs, + rho, mu, lam, Di, SoS, + rho_avg, rho_rms, + mu_avg, lam_avg, Di_avg, + SoS_avg, cp_avg, Ent_avg, + p, pA, mix, deltaTime); + } +} + +template +__global__ +void FavreAvgProperties2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO SoS, + const AccessorSumRD mu_favg, + const AccessorSumRD lam_favg, + const AccessorSumRD Di_favg, + const AccessorSumRD SoS_favg, + const AccessorSumRD cp_favg, + const AccessorSumRD Ent_favg, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::FavreAvgProperties( + cellWidth, temperature, MassFracs, + rho, mu, lam, Di, SoS, + mu_favg, lam_favg, Di_favg, + SoS_favg, cp_favg, Ent_favg, + p, pA, mix, deltaTime); + } +} + +template +__global__ +void AvgFluxes_ProdRates2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO< int, 3> nType_x, + const AccessorRO< int, 3> nType_y, + const AccessorRO< int, 3> nType_z, + const AccessorRO dcsi_d, + const AccessorRO deta_d, + const AccessorRO dzet_d, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO MassFracs, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO Ki, + const AccessorRO< Vec3, 3> eField, +#endif + const AccessorSumRD< Vec3, 2> q_avg, + const AccessorSumRD ProductionRates_avg, + const AccessorSumRD ProductionRates_rms, + const AccessorSumRD HeatReleaseRate_avg, + const AccessorSumRD HeatReleaseRate_rms, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::AvgFluxes_ProdRates(cellWidth, + nType_x, nType_y, nType_z, + dcsi_d, deta_d, dzet_d, + pressure, temperature, MolarFracs, MassFracs, + rho, mu, lam, Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + Ki, eField, +#endif + q_avg, + ProductionRates_avg, ProductionRates_rms, + HeatReleaseRate_avg, HeatReleaseRate_rms, + p, pA, Fluid_bounds, mix, deltaTime); + } +} + +template +__global__ +void AvgKineticEnergyBudget2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO pressure, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO< Vec3, 3> vGradX, + const AccessorRO< Vec3, 3> vGradY, + const AccessorRO< Vec3, 3> vGradZ, + const AccessorSumRD< Vec3, 2> rhoUUv_avg, + const AccessorSumRD< Vec3, 2> Up_avg, + const AccessorSumRD tau_avg, + const AccessorSumRD< Vec3, 2> utau_y_avg, + const AccessorSumRD< Vec3, 2> tauGradU_avg, + const AccessorSumRD< Vec3, 2> pGradU_avg, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::AvgKineticEnergyBudget(cellWidth, + pressure, velocity, + rho, mu, + vGradX, vGradY, vGradZ, + rhoUUv_avg, Up_avg, tau_avg, + utau_y_avg, tauGradU_avg, pGradU_avg, + p, pA, mix, deltaTime); + } +} + +template +__global__ +void AvgDimensionlessNumbers2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO SoS, + const AccessorSumRD Pr_avg, + const AccessorSumRD Pr_rms, + const AccessorSumRD Ec_avg, + const AccessorSumRD Ec_rms, + const AccessorSumRD Ma_avg, + const AccessorSumRD Sc_avg, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::AvgDimensionlessNumbers(cellWidth, + temperature, MassFracs, velocity, + rho, mu, lam, Di, SoS, + Pr_avg, Pr_rms, + Ec_avg, Ec_rms, + Ma_avg, Sc_avg, + p, pA, mix, deltaTime); + } +} + + +template +__global__ +void AvgCorrelations2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorSumRD< Vec3, 2> uT_avg, + const AccessorSumRD< Vec3, 2> uT_favg, + const AccessorSumRD uYi_avg, + const AccessorSumRD vYi_avg, + const AccessorSumRD wYi_avg, + const AccessorSumRD uYi_favg, + const AccessorSumRD vYi_favg, + const AccessorSumRD wYi_favg, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::AvgCorrelations(cellWidth, + temperature, MassFracs, velocity, rho, + uT_avg, uT_favg, + uYi_avg, vYi_avg, wYi_avg, + uYi_favg, vYi_favg, wYi_favg, + p, pA, deltaTime); + } +} + +#ifdef ELECTRIC_FIELD +template +__global__ +void AvgElectricQuantities2D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO rho, + const AccessorRO ePot, + const AccessorSumRD ePot_avg, + const AccessorSumRD Crg_avg, + const double deltaTime, + const coord_t nRake, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<2> pA = (dir == Xdir) ? Point<2>{p.x, nRake} : + (dir == Ydir) ? Point<2>{p.y, nRake} : + /*(dir == Zdir)*/ Point<2>{p.z, nRake}; + Add2DAveragesTask::AvgElectricQuantities(cellWidth, + temperature, MolarFracs, rho, ePot, + ePot_avg, Crg_avg, + p, pA, mix, deltaTime); + } +} +#endif + +template +__host__ +void Add2DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 1); + + // Accessors for variables with gradient stencil access + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO acc_MolarFracs (regions[0], FID_MolarFracs); + + // Accessors for cell geometry + const AccessorRO< Vec3, 3> acc_centerCoordinates (regions[1], FID_centerCoordinates); + const AccessorRO< Vec3, 3> acc_cellWidth (regions[1], FID_cellWidth); + + // Accessors for metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi_d (regions[1], FID_dcsi_d); + const AccessorRO acc_deta_d (regions[1], FID_deta_d); + const AccessorRO acc_dzet_d (regions[1], FID_dzet_d); + + // Accessors for primitive variables + const AccessorRO acc_pressure (regions[1], FID_pressure); + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[1], FID_rho); + const AccessorRO acc_mu (regions[1], FID_mu); + const AccessorRO acc_lam (regions[1], FID_lam); + const AccessorRO acc_Di (regions[1], FID_Di); + const AccessorRO acc_SoS (regions[1], FID_SoS); + + // Accessors for gradients + const AccessorRO< Vec3, 3> acc_vGradX (regions[1], FID_velocityGradientX); + const AccessorRO< Vec3, 3> acc_vGradY (regions[1], FID_velocityGradientY); + const AccessorRO< Vec3, 3> acc_vGradZ (regions[1], FID_velocityGradientZ); + +#ifdef ELECTRIC_FIELD + // Accessors for electric variables + const AccessorRO acc_ePot (regions[1], FID_electricPotential); +#if (nIons > 0) + const AccessorRO< Vec3, 3> acc_eField (regions[1], FID_electricField); + const AccessorRO acc_Ki (regions[1], FID_Ki); +#endif +#endif + + // Accessors for averaged quantities + // - REGENT_REDOP_SUM_VEC3 -> iVec3 + // - REGENT_REDOP_SUM_VECNSP -> iVecNSp + // - REGENT_REDOP_SUM_VEC6 -> iVec6 + // - LEGION_REDOP_SUM_FLOAT64 -> iDouble + const AccessorSumRD acc_avg_weight (regions[iDouble], AVE_FID_weight, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD< Vec3, 2> acc_avg_centerCoordinates (regions[iVec3 ], AVE_FID_centerCoordinates, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_avg (regions[iDouble], AVE_FID_pressure_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_rms (regions[iDouble], AVE_FID_pressure_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_avg (regions[iDouble], AVE_FID_temperature_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_rms (regions[iDouble], AVE_FID_temperature_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_avg (regions[iVecNSp], AVE_FID_MolarFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_rms (regions[iVecNSp], AVE_FID_MolarFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_avg (regions[iVecNSp], AVE_FID_MassFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_rms (regions[iVecNSp], AVE_FID_MassFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 2> acc_velocity_avg (regions[iVec3 ], AVE_FID_velocity_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_rms (regions[iVec3 ], AVE_FID_velocity_rms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_rey (regions[iVec3 ], AVE_FID_velocity_rey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_favg (regions[iDouble], AVE_FID_pressure_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_frms (regions[iDouble], AVE_FID_pressure_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_favg (regions[iDouble], AVE_FID_temperature_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_frms (regions[iDouble], AVE_FID_temperature_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_favg (regions[iVecNSp], AVE_FID_MolarFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_frms (regions[iVecNSp], AVE_FID_MolarFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_favg (regions[iVecNSp], AVE_FID_MassFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_frms (regions[iVecNSp], AVE_FID_MassFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 2> acc_velocity_favg (regions[iVec3 ], AVE_FID_velocity_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_frms (regions[iVec3 ], AVE_FID_velocity_frms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_velocity_frey (regions[iVec3 ], AVE_FID_velocity_frey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_rho_avg (regions[iDouble], AVE_FID_rho_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_rho_rms (regions[iDouble], AVE_FID_rho_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_mu_avg (regions[iDouble], AVE_FID_mu_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_avg (regions[iDouble], AVE_FID_lam_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_avg (regions[iVecNSp], AVE_FID_Di_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_avg (regions[iDouble], AVE_FID_SoS_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_avg (regions[iDouble], AVE_FID_cp_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_avg (regions[iDouble], AVE_FID_Ent_avg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD acc_mu_favg (regions[iDouble], AVE_FID_mu_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_favg (regions[iDouble], AVE_FID_lam_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_favg (regions[iVecNSp], AVE_FID_Di_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_favg (regions[iDouble], AVE_FID_SoS_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_favg (regions[iDouble], AVE_FID_cp_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_favg (regions[iDouble], AVE_FID_Ent_favg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 2> acc_q_avg (regions[iVec3 ], AVE_FID_q, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_ProductionRates_avg (regions[iVecNSp], AVE_FID_ProductionRates_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_ProductionRates_rms (regions[iVecNSp], AVE_FID_ProductionRates_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_HeatReleaseRate_avg (regions[iDouble], AVE_FID_HeatReleaseRate_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_HeatReleaseRate_rms (regions[iDouble], AVE_FID_HeatReleaseRate_rms, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 2> acc_rhoUUv (regions[iVec3 ], AVE_FID_rhoUUv, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_Up (regions[iVec3 ], AVE_FID_Up, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_tau (regions[iVec6 ], AVE_FID_tau, REGENT_REDOP_SUM_VEC6); + const AccessorSumRD< Vec3, 2> acc_utau_y (regions[iVec3 ], AVE_FID_utau_y, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_tauGradU (regions[iVec3 ], AVE_FID_tauGradU, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_pGradU (regions[iVec3 ], AVE_FID_pGradU, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_Pr_avg (regions[iDouble], AVE_FID_Pr, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Pr_rms (regions[iDouble], AVE_FID_Pr_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_avg (regions[iDouble], AVE_FID_Ec, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_rms (regions[iDouble], AVE_FID_Ec_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ma_avg (regions[iDouble], AVE_FID_Ma, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Sc_avg (regions[iVecNSp], AVE_FID_Sc, REGENT_REDOP_SUM_VECNSP); + + const AccessorSumRD< Vec3, 2> acc_uT_avg (regions[iVec3 ], AVE_FID_uT_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 2> acc_uT_favg (regions[iVec3 ], AVE_FID_uT_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_uYi_avg (regions[iVecNSp], AVE_FID_uYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_avg (regions[iVecNSp], AVE_FID_vYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_avg (regions[iVecNSp], AVE_FID_wYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_uYi_favg (regions[iVecNSp], AVE_FID_uYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_favg (regions[iVecNSp], AVE_FID_vYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_favg (regions[iVecNSp], AVE_FID_wYi_favg, REGENT_REDOP_SUM_VECNSP); + +#ifdef ELECTRIC_FIELD + const AccessorSumRD acc_ePot_avg (regions[iDouble], AVE_FID_electricPotential_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Crg_avg (regions[iDouble], AVE_FID_chargeDensity_avg, LEGION_REDOP_SUM_FLOAT64); +#endif + + // Extract execution domains + Rect<3> r_Fluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); + + // Extract average domain + Rect<2> r_Avg = runtime->get_index_space_domain(ctx, args.Averages.get_index_space()); + + // Wait for the integrator deltaTime + const double Integrator_deltaTime = futures[0].get_result(); + + // Set thread grid + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_Fluid); + const dim3 num_blocks_3d = dim3((getSize(r_Fluid) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_Fluid) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_Fluid) + (TPB_3d.z - 1)) / TPB_3d.z); + + // each average kernel is going to use its own stream + cudaStream_t AvgPrimitiveStream; + cudaStream_t FavreAvgPrimitiveStream; + cudaStream_t AvgPropertiesStream; + cudaStream_t FavreAvgPropertiesStream; + cudaStream_t AvgFluxes_ProdRatesStream; + cudaStream_t AvgKineticEnergyBudgetStream; + cudaStream_t AvgDimensionlessNumbersStream; + cudaStream_t AvgCorrelationsStream; +#ifdef ELECTRIC_FIELD + cudaStream_t AvgElectricQuantitiesStream; +#endif + + cudaStreamCreateWithFlags( &AvgPrimitiveStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &FavreAvgPrimitiveStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgPropertiesStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &FavreAvgPropertiesStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgFluxes_ProdRatesStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgKineticEnergyBudgetStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags(&AvgDimensionlessNumbersStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgCorrelationsStream, cudaStreamNonBlocking); +#ifdef ELECTRIC_FIELD + cudaStreamCreateWithFlags( &AvgElectricQuantitiesStream, cudaStreamNonBlocking); +#endif + + // Collect averages of primitive variables + AvgPrimitive2D_kernel<<>>( + acc_cellWidth, acc_centerCoordinates, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_avg_weight, acc_avg_centerCoordinates, + acc_pressure_avg, acc_pressure_rms, + acc_temperature_avg, acc_temperature_rms, + acc_MolarFracs_avg, acc_MolarFracs_rms, + acc_MassFracs_avg, acc_MassFracs_rms, + acc_velocity_avg, acc_velocity_rms, acc_velocity_rey, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect Favre averages of primitive variables + FavreAvgPrimitive2D_kernel<<>>( + acc_cellWidth, acc_rho, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_pressure_favg, acc_pressure_frms, + acc_temperature_favg, acc_temperature_frms, + acc_MolarFracs_favg, acc_MolarFracs_frms, + acc_MassFracs_favg, acc_MassFracs_frms, + acc_velocity_favg, acc_velocity_frms, acc_velocity_frey, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of properties + AvgProperties2D_kernel<<>>( + acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_rho_avg, acc_rho_rms, + acc_mu_avg, acc_lam_avg, acc_Di_avg, + acc_SoS_avg, acc_cp_avg, acc_Ent_avg, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect Favre averages of properties + FavreAvgProperties2D_kernel<<>>( + acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_mu_favg, acc_lam_favg, acc_Di_favg, + acc_SoS_favg, acc_cp_favg, acc_Ent_favg, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of fluxes and production rates + AvgFluxes_ProdRates2D_kernel<<>>( + acc_cellWidth, + acc_nType_x, acc_nType_y, acc_nType_z, + acc_dcsi_d, acc_deta_d, acc_dzet_d, + acc_pressure, acc_temperature, acc_MolarFracs, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, acc_eField, +#endif + acc_q_avg, + acc_ProductionRates_avg, acc_ProductionRates_rms, + acc_HeatReleaseRate_avg, acc_HeatReleaseRate_rms, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, args.Fluid_bounds, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of kinetic energy budget terms + AvgKineticEnergyBudget2D_kernel<<>>( + acc_cellWidth, + acc_pressure, acc_velocity, + acc_rho, acc_mu, + acc_vGradX, acc_vGradY, acc_vGradZ, + acc_rhoUUv, acc_Up, acc_tau, + acc_utau_y, acc_tauGradU, acc_pGradU, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of dimensionless numbers + AvgDimensionlessNumbers2D_kernel<<>>( + acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_Pr_avg, acc_Pr_rms, + acc_Ec_avg, acc_Ec_rms, + acc_Ma_avg, acc_Sc_avg, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of correlations + AvgCorrelations2D_kernel<<>>( + acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, acc_rho, + acc_uT_avg, acc_uT_favg, + acc_uYi_avg, acc_vYi_avg, acc_wYi_avg, + acc_uYi_favg, acc_vYi_favg, acc_wYi_favg, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + +#ifdef ELECTRIC_FIELD + // Collect averages of electric quantities + AvgElectricQuantities2D_kernel<<>>( + acc_cellWidth, + acc_temperature, acc_MolarFracs, acc_rho, acc_ePot, + acc_ePot_avg, acc_Crg_avg, + Integrator_deltaTime, r_Avg.lo.y, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); +#endif + + // Cleanup streams + cudaStreamDestroy( AvgPrimitiveStream); + cudaStreamDestroy( FavreAvgPrimitiveStream); + cudaStreamDestroy( AvgPropertiesStream); + cudaStreamDestroy( FavreAvgPropertiesStream); + cudaStreamDestroy( AvgFluxes_ProdRatesStream); + cudaStreamDestroy( AvgKineticEnergyBudgetStream); + cudaStreamDestroy(AvgDimensionlessNumbersStream); + cudaStreamDestroy( AvgCorrelationsStream); +#ifdef ELECTRIC_FIELD + cudaStreamDestroy( AvgElectricQuantitiesStream); +#endif +} + +template void Add2DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void Add2DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void Add2DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +//----------------------------------------------------------------------------- +// KERNEL FOR Add1DAveragesTask +//----------------------------------------------------------------------------- + +template +__global__ +void AvgPrimitive1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO< Vec3, 3> centerCoordinates, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorSumRD avg_weight, + const AccessorSumRD< Vec3, 3> avg_centerCoordinates, + const AccessorSumRD pressure_avg, + const AccessorSumRD pressure_rms, + const AccessorSumRD temperature_avg, + const AccessorSumRD temperature_rms, + const AccessorSumRD MolarFracs_avg, + const AccessorSumRD MolarFracs_rms, + const AccessorSumRD MassFracs_avg, + const AccessorSumRD MassFracs_rms, + const AccessorSumRD< Vec3, 3> velocity_avg, + const AccessorSumRD< Vec3, 3> velocity_rms, + const AccessorSumRD< Vec3, 3> velocity_rey, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::AvgPrimitive(cellWidth, centerCoordinates, + pressure, temperature, MolarFracs, + MassFracs, velocity, + avg_weight, avg_centerCoordinates, + pressure_avg, pressure_rms, + temperature_avg, temperature_rms, + MolarFracs_avg, MolarFracs_rms, + MassFracs_avg, MassFracs_rms, + velocity_avg, velocity_rms, velocity_rey, + p, pA, deltaTime); + } +} + +template +__global__ +void FavreAvgPrimitive1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO rho, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorSumRD pressure_favg, + const AccessorSumRD pressure_frms, + const AccessorSumRD temperature_favg, + const AccessorSumRD temperature_frms, + const AccessorSumRD MolarFracs_favg, + const AccessorSumRD MolarFracs_frms, + const AccessorSumRD MassFracs_favg, + const AccessorSumRD MassFracs_frms, + const AccessorSumRD< Vec3, 3> velocity_favg, + const AccessorSumRD< Vec3, 3> velocity_frms, + const AccessorSumRD< Vec3, 3> velocity_frey, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::FavreAvgPrimitive(cellWidth, rho, + pressure, temperature, MolarFracs, + MassFracs, velocity, + pressure_favg, pressure_frms, + temperature_favg, temperature_frms, + MolarFracs_favg, MolarFracs_frms, + MassFracs_favg, MassFracs_frms, + velocity_favg, velocity_frms, velocity_frey, + p, pA, deltaTime); + } +} + +template +__global__ +void AvgProperties1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO SoS, + const AccessorSumRD rho_avg, + const AccessorSumRD rho_rms, + const AccessorSumRD mu_avg, + const AccessorSumRD lam_avg, + const AccessorSumRD Di_avg, + const AccessorSumRD SoS_avg, + const AccessorSumRD cp_avg, + const AccessorSumRD Ent_avg, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::AvgProperties( + cellWidth, temperature, MassFracs, + rho, mu, lam, Di, SoS, + rho_avg, rho_rms, + mu_avg, lam_avg, Di_avg, + SoS_avg, cp_avg, Ent_avg, + p, pA, mix, deltaTime); + } +} + +template +__global__ +void FavreAvgProperties1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO SoS, + const AccessorSumRD mu_favg, + const AccessorSumRD lam_favg, + const AccessorSumRD Di_favg, + const AccessorSumRD SoS_favg, + const AccessorSumRD cp_favg, + const AccessorSumRD Ent_favg, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::FavreAvgProperties( + cellWidth, temperature, MassFracs, + rho, mu, lam, Di, SoS, + mu_favg, lam_favg, Di_favg, + SoS_favg, cp_favg, Ent_favg, + p, pA, mix, deltaTime); + } +} + +template +__global__ +void AvgFluxes_ProdRates1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO< int, 3> nType_x, + const AccessorRO< int, 3> nType_y, + const AccessorRO< int, 3> nType_z, + const AccessorRO dcsi_d, + const AccessorRO deta_d, + const AccessorRO dzet_d, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO MassFracs, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO Ki, + const AccessorRO< Vec3, 3> eField, +#endif + const AccessorSumRD< Vec3, 3> q_avg, + const AccessorSumRD ProductionRates_avg, + const AccessorSumRD ProductionRates_rms, + const AccessorSumRD HeatReleaseRate_avg, + const AccessorSumRD HeatReleaseRate_rms, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::AvgFluxes_ProdRates(cellWidth, + nType_x, nType_y, nType_z, + dcsi_d, deta_d, dzet_d, + pressure, temperature, MolarFracs, MassFracs, + rho, mu, lam, Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + Ki, eField, +#endif + q_avg, + ProductionRates_avg, ProductionRates_rms, + HeatReleaseRate_avg, HeatReleaseRate_rms, + p, pA, Fluid_bounds, mix, deltaTime); + } +} + +template +__global__ +void AvgKineticEnergyBudget1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO pressure, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO< Vec3, 3> vGradX, + const AccessorRO< Vec3, 3> vGradY, + const AccessorRO< Vec3, 3> vGradZ, + const AccessorSumRD< Vec3, 3> rhoUUv_avg, + const AccessorSumRD< Vec3, 3> Up_avg, + const AccessorSumRD tau_avg, + const AccessorSumRD< Vec3, 3> utau_y_avg, + const AccessorSumRD< Vec3, 3> tauGradU_avg, + const AccessorSumRD< Vec3, 3> pGradU_avg, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::AvgKineticEnergyBudget(cellWidth, + pressure, velocity, + rho, mu, + vGradX, vGradY, vGradZ, + rhoUUv_avg, Up_avg, tau_avg, + utau_y_avg, tauGradU_avg, pGradU_avg, + p, pA, mix, deltaTime); + } +} + +template +__global__ +void AvgDimensionlessNumbers1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO SoS, + const AccessorSumRD Pr_avg, + const AccessorSumRD Pr_rms, + const AccessorSumRD Ec_avg, + const AccessorSumRD Ec_rms, + const AccessorSumRD Ma_avg, + const AccessorSumRD Sc_avg, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::AvgDimensionlessNumbers(cellWidth, + temperature, MassFracs, velocity, + rho, mu, lam, Di, SoS, + Pr_avg, Pr_rms, + Ec_avg, Ec_rms, + Ma_avg, Sc_avg, + p, pA, mix, deltaTime); + } +} + + +template +__global__ +void AvgCorrelations1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorSumRD< Vec3, 3> uT_avg, + const AccessorSumRD< Vec3, 3> uT_favg, + const AccessorSumRD uYi_avg, + const AccessorSumRD vYi_avg, + const AccessorSumRD wYi_avg, + const AccessorSumRD uYi_favg, + const AccessorSumRD vYi_favg, + const AccessorSumRD wYi_favg, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::AvgCorrelations(cellWidth, + temperature, MassFracs, velocity, rho, + uT_avg, uT_favg, + uYi_avg, vYi_avg, wYi_avg, + uYi_favg, vYi_favg, wYi_favg, + p, pA, deltaTime); + } +} + +#ifdef ELECTRIC_FIELD +template +__global__ +void AvgElectricQuantities1D_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MolarFracs, + const AccessorRO rho, + const AccessorRO ePot, + const AccessorSumRD ePot_avg, + const AccessorSumRD Crg_avg, + const double deltaTime, + const coord_t nPlane, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // TODO: implement some sort of static_if + const Point<3> pA = (dir == Xdir) ? Point<3>{p.y, p.z, nPlane} : + (dir == Ydir) ? Point<3>{p.x, p.z, nPlane} : + /*(dir == Zdir)*/ Point<3>{p.x, p.y, nPlane}; + Add1DAveragesTask::AvgElectricQuantities(cellWidth, + temperature, MolarFracs, rho, ePot, + ePot_avg, Crg_avg, + p, pA, mix, deltaTime); + } +} +#endif + +template +__host__ +void Add1DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 1); + + // Accessors for variables with gradient stencil access + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO acc_MolarFracs (regions[0], FID_MolarFracs); + + // Accessors for cell geometry + const AccessorRO< Vec3, 3> acc_centerCoordinates (regions[1], FID_centerCoordinates); + const AccessorRO< Vec3, 3> acc_cellWidth (regions[1], FID_cellWidth); + + // Accessors for metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi_d (regions[1], FID_dcsi_d); + const AccessorRO acc_deta_d (regions[1], FID_deta_d); + const AccessorRO acc_dzet_d (regions[1], FID_dzet_d); + + // Accessors for primitive variables + const AccessorRO acc_pressure (regions[1], FID_pressure); + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[1], FID_rho); + const AccessorRO acc_mu (regions[1], FID_mu); + const AccessorRO acc_lam (regions[1], FID_lam); + const AccessorRO acc_Di (regions[1], FID_Di); + const AccessorRO acc_SoS (regions[1], FID_SoS); + + // Accessors for gradients + const AccessorRO< Vec3, 3> acc_vGradX (regions[1], FID_velocityGradientX); + const AccessorRO< Vec3, 3> acc_vGradY (regions[1], FID_velocityGradientY); + const AccessorRO< Vec3, 3> acc_vGradZ (regions[1], FID_velocityGradientZ); + +#ifdef ELECTRIC_FIELD + // Accessors for electric variables + const AccessorRO acc_ePot (regions[1], FID_electricPotential); +#if (nIons > 0) + const AccessorRO< Vec3, 3> acc_eField (regions[1], FID_electricField); + const AccessorRO acc_Ki (regions[1], FID_Ki); +#endif +#endif + + // Accessors for averaged quantities + // - REGENT_REDOP_SUM_VEC3 -> iVec3 + // - REGENT_REDOP_SUM_VECNSP -> iVecNSp + // - REGENT_REDOP_SUM_VEC6 -> iVec6 + // - LEGION_REDOP_SUM_FLOAT64 -> iDouble + const AccessorSumRD acc_avg_weight (regions[iDouble], AVE_FID_weight, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD< Vec3, 3> acc_avg_centerCoordinates (regions[iVec3 ], AVE_FID_centerCoordinates, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_avg (regions[iDouble], AVE_FID_pressure_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_rms (regions[iDouble], AVE_FID_pressure_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_avg (regions[iDouble], AVE_FID_temperature_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_rms (regions[iDouble], AVE_FID_temperature_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_avg (regions[iVecNSp], AVE_FID_MolarFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_rms (regions[iVecNSp], AVE_FID_MolarFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_avg (regions[iVecNSp], AVE_FID_MassFracs_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_rms (regions[iVecNSp], AVE_FID_MassFracs_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 3> acc_velocity_avg (regions[iVec3 ], AVE_FID_velocity_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_rms (regions[iVec3 ], AVE_FID_velocity_rms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_rey (regions[iVec3 ], AVE_FID_velocity_rey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_pressure_favg (regions[iDouble], AVE_FID_pressure_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_pressure_frms (regions[iDouble], AVE_FID_pressure_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_favg (regions[iDouble], AVE_FID_temperature_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_temperature_frms (regions[iDouble], AVE_FID_temperature_frms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_MolarFracs_favg (regions[iVecNSp], AVE_FID_MolarFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MolarFracs_frms (regions[iVecNSp], AVE_FID_MolarFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_favg (regions[iVecNSp], AVE_FID_MassFracs_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_MassFracs_frms (regions[iVecNSp], AVE_FID_MassFracs_frms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 3> acc_velocity_favg (regions[iVec3 ], AVE_FID_velocity_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_frms (regions[iVec3 ], AVE_FID_velocity_frms, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_velocity_frey (regions[iVec3 ], AVE_FID_velocity_frey, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_rho_avg (regions[iDouble], AVE_FID_rho_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_rho_rms (regions[iDouble], AVE_FID_rho_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_mu_avg (regions[iDouble], AVE_FID_mu_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_avg (regions[iDouble], AVE_FID_lam_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_avg (regions[iVecNSp], AVE_FID_Di_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_avg (regions[iDouble], AVE_FID_SoS_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_avg (regions[iDouble], AVE_FID_cp_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_avg (regions[iDouble], AVE_FID_Ent_avg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD acc_mu_favg (regions[iDouble], AVE_FID_mu_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_lam_favg (regions[iDouble], AVE_FID_lam_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Di_favg (regions[iVecNSp], AVE_FID_Di_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_SoS_favg (regions[iDouble], AVE_FID_SoS_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_cp_favg (regions[iDouble], AVE_FID_cp_favg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ent_favg (regions[iDouble], AVE_FID_Ent_favg, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 3> acc_q_avg (regions[iVec3 ], AVE_FID_q, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_ProductionRates_avg (regions[iVecNSp], AVE_FID_ProductionRates_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_ProductionRates_rms (regions[iVecNSp], AVE_FID_ProductionRates_rms, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_HeatReleaseRate_avg (regions[iDouble], AVE_FID_HeatReleaseRate_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_HeatReleaseRate_rms (regions[iDouble], AVE_FID_HeatReleaseRate_rms, LEGION_REDOP_SUM_FLOAT64); + + const AccessorSumRD< Vec3, 3> acc_rhoUUv (regions[iVec3 ], AVE_FID_rhoUUv, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_Up (regions[iVec3 ], AVE_FID_Up, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_tau (regions[iVec6 ], AVE_FID_tau, REGENT_REDOP_SUM_VEC6); + const AccessorSumRD< Vec3, 3> acc_utau_y (regions[iVec3 ], AVE_FID_utau_y, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_tauGradU (regions[iVec3 ], AVE_FID_tauGradU, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_pGradU (regions[iVec3 ], AVE_FID_pGradU, REGENT_REDOP_SUM_VEC3); + + const AccessorSumRD acc_Pr_avg (regions[iDouble], AVE_FID_Pr, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Pr_rms (regions[iDouble], AVE_FID_Pr_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_avg (regions[iDouble], AVE_FID_Ec, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ec_rms (regions[iDouble], AVE_FID_Ec_rms, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Ma_avg (regions[iDouble], AVE_FID_Ma, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Sc_avg (regions[iVecNSp], AVE_FID_Sc, REGENT_REDOP_SUM_VECNSP); + + const AccessorSumRD< Vec3, 3> acc_uT_avg (regions[iVec3 ], AVE_FID_uT_avg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD< Vec3, 3> acc_uT_favg (regions[iVec3 ], AVE_FID_uT_favg, REGENT_REDOP_SUM_VEC3); + const AccessorSumRD acc_uYi_avg (regions[iVecNSp], AVE_FID_uYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_avg (regions[iVecNSp], AVE_FID_vYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_avg (regions[iVecNSp], AVE_FID_wYi_avg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_uYi_favg (regions[iVecNSp], AVE_FID_uYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_vYi_favg (regions[iVecNSp], AVE_FID_vYi_favg, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD acc_wYi_favg (regions[iVecNSp], AVE_FID_wYi_favg, REGENT_REDOP_SUM_VECNSP); + +#ifdef ELECTRIC_FIELD + const AccessorSumRD acc_ePot_avg (regions[iDouble], AVE_FID_electricPotential_avg, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_Crg_avg (regions[iDouble], AVE_FID_chargeDensity_avg, LEGION_REDOP_SUM_FLOAT64); +#endif + + // Extract execution domains + Rect<3> r_Fluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); + + // Extract average domain + Rect<3> r_Avg = runtime->get_index_space_domain(ctx, args.Averages.get_index_space()); + + // Wait for the integrator deltaTime + const double Integrator_deltaTime = futures[0].get_result(); + + // Set thread grid + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_Fluid); + const dim3 num_blocks_3d = dim3((getSize(r_Fluid) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_Fluid) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_Fluid) + (TPB_3d.z - 1)) / TPB_3d.z); + + // each average kernel is going to use its own stream + cudaStream_t AvgPrimitiveStream; + cudaStream_t FavreAvgPrimitiveStream; + cudaStream_t AvgPropertiesStream; + cudaStream_t FavreAvgPropertiesStream; + cudaStream_t AvgFluxes_ProdRatesStream; + cudaStream_t AvgKineticEnergyBudgetStream; + cudaStream_t AvgDimensionlessNumbersStream; + cudaStream_t AvgCorrelationsStream; +#ifdef ELECTRIC_FIELD + cudaStream_t AvgElectricQuantitiesStream; +#endif + + cudaStreamCreateWithFlags( &AvgPrimitiveStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &FavreAvgPrimitiveStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgPropertiesStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &FavreAvgPropertiesStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgFluxes_ProdRatesStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgKineticEnergyBudgetStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags(&AvgDimensionlessNumbersStream, cudaStreamNonBlocking); + cudaStreamCreateWithFlags( &AvgCorrelationsStream, cudaStreamNonBlocking); +#ifdef ELECTRIC_FIELD + cudaStreamCreateWithFlags( &AvgElectricQuantitiesStream, cudaStreamNonBlocking); +#endif + + // Collect averages of primitive variables + AvgPrimitive1D_kernel<<>>( + acc_cellWidth, acc_centerCoordinates, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_avg_weight, acc_avg_centerCoordinates, + acc_pressure_avg, acc_pressure_rms, + acc_temperature_avg, acc_temperature_rms, + acc_MolarFracs_avg, acc_MolarFracs_rms, + acc_MassFracs_avg, acc_MassFracs_rms, + acc_velocity_avg, acc_velocity_rms, acc_velocity_rey, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect Favre averages of primitive variables + FavreAvgPrimitive1D_kernel<<>>( + acc_cellWidth, acc_rho, + acc_pressure, acc_temperature, acc_MolarFracs, + acc_MassFracs, acc_velocity, + acc_pressure_favg, acc_pressure_frms, + acc_temperature_favg, acc_temperature_frms, + acc_MolarFracs_favg, acc_MolarFracs_frms, + acc_MassFracs_favg, acc_MassFracs_frms, + acc_velocity_favg, acc_velocity_frms, acc_velocity_frey, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of properties + AvgProperties1D_kernel<<>>( + acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_rho_avg, acc_rho_rms, + acc_mu_avg, acc_lam_avg, acc_Di_avg, + acc_SoS_avg, acc_cp_avg, acc_Ent_avg, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect Favre averages of properties + FavreAvgProperties1D_kernel<<>>( + acc_cellWidth, acc_temperature, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_mu_favg, acc_lam_favg, acc_Di_favg, + acc_SoS_favg, acc_cp_favg, acc_Ent_favg, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of fluxes and production rates + AvgFluxes_ProdRates1D_kernel<<>>( + acc_cellWidth, + acc_nType_x, acc_nType_y, acc_nType_z, + acc_dcsi_d, acc_deta_d, acc_dzet_d, + acc_pressure, acc_temperature, acc_MolarFracs, acc_MassFracs, + acc_rho, acc_mu, acc_lam, acc_Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, acc_eField, +#endif + acc_q_avg, + acc_ProductionRates_avg, acc_ProductionRates_rms, + acc_HeatReleaseRate_avg, acc_HeatReleaseRate_rms, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, args.Fluid_bounds, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of kinetic energy budget terms + AvgKineticEnergyBudget1D_kernel<<>>( + acc_cellWidth, + acc_pressure, acc_velocity, + acc_rho, acc_mu, + acc_vGradX, acc_vGradY, acc_vGradZ, + acc_rhoUUv, acc_Up, acc_tau, + acc_utau_y, acc_tauGradU, acc_pGradU, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of dimensionless numbers + AvgDimensionlessNumbers1D_kernel<<>>( + acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, + acc_Pr_avg, acc_Pr_rms, + acc_Ec_avg, acc_Ec_rms, + acc_Ma_avg, acc_Sc_avg, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + + // Collect averages of correlations + AvgCorrelations1D_kernel<<>>( + acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, acc_rho, + acc_uT_avg, acc_uT_favg, + acc_uYi_avg, acc_vYi_avg, acc_wYi_avg, + acc_uYi_favg, acc_vYi_favg, acc_wYi_favg, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); + +#ifdef ELECTRIC_FIELD + // Collect averages of electric quantities + AvgElectricQuantities1D_kernel<<>>( + acc_cellWidth, + acc_temperature, acc_MolarFracs, acc_rho, acc_ePot, + acc_ePot_avg, acc_Crg_avg, + Integrator_deltaTime, r_Avg.lo.z, r_Fluid, + getSize(r_Fluid), getSize(r_Fluid), getSize(r_Fluid)); +#endif + + // Cleanup streams + cudaStreamDestroy( AvgPrimitiveStream); + cudaStreamDestroy( FavreAvgPrimitiveStream); + cudaStreamDestroy( AvgPropertiesStream); + cudaStreamDestroy( FavreAvgPropertiesStream); + cudaStreamDestroy( AvgFluxes_ProdRatesStream); + cudaStreamDestroy( AvgKineticEnergyBudgetStream); + cudaStreamDestroy(AvgDimensionlessNumbersStream); + cudaStreamDestroy( AvgCorrelationsStream); +#ifdef ELECTRIC_FIELD + cudaStreamDestroy( AvgElectricQuantitiesStream); +#endif +} + +template void Add1DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void Add1DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void Add1DAveragesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + + diff --git a/src/AirMix.h b/src/prometeo_average.h similarity index 79% rename from src/AirMix.h rename to src/prometeo_average.h index f683ed0..c896aca 100644 --- a/src/AirMix.h +++ b/src/prometeo_average.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,36 +27,19 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef AirMix_H -#define AirMix_H +#ifndef __PROMETEO_AVERAGE_H__ +#define __PROMETEO_AVERAGE_H__ -#define nSpec 5 -#define nReac 5 - -#define MAX_NUM_REACTANTS 2 -#define MAX_NUM_TB 5 - -#define RGAS 8.3144598 // [J/(mol K)] -#define Na 6.02214086e23 // [1/mol] -#define kb 1.38064852e-23 // [m^2 kg /( s^2 K)] - -#include "Species.h" -#include "Reaction.h" +#include "legion.h" #ifdef __cplusplus extern "C" { #endif -struct Mix { - struct Spec species[nSpec]; - struct Reaction reactions[nReac]; - // Max an min acceptable temeperatures - double TMax; - double TMin; -}; +void register_average_tasks(); #ifdef __cplusplus } #endif -#endif // AirMix_H +#endif // __PROMETEO_AVERAGE_H__ diff --git a/src/prometeo_average.hpp b/src/prometeo_average.hpp new file mode 100644 index 0000000..73c126e --- /dev/null +++ b/src/prometeo_average.hpp @@ -0,0 +1,354 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_AVERAGE_HPP__ +#define __PROMETEO_AVERAGE_HPP__ + +#include "legion.h" + +using namespace Legion; + +//----------------------------------------------------------------------------- +// LOAD PROMETEO UTILITIES AND MODULES +//----------------------------------------------------------------------------- + +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" +#include "prometeo_types.h" +#include "prometeo_redop.inl" +#include "prometeo_average.h" +#include "prometeo_average_types.h" + +typedef MySymMatrix TauMat; + +//----------------------------------------------------------------------------- +// UTILITY FUNCTIONS THAT COLLECT SPATIAL AVERAGES +//----------------------------------------------------------------------------- + +template +class AverageUtils { +public: + // Averages the primitive variables + __CUDA_H__ + static inline void AvgPrimitive( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const AccessorRO &pressure, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorSumRD &avg_weight, + const AccessorSumRD< Vec3, N> &avg_centerCoordinates, + const AccessorSumRD &pressure_avg, + const AccessorSumRD &pressure_rms, + const AccessorSumRD &temperature_avg, + const AccessorSumRD &temperature_rms, + const AccessorSumRD &MolarFracs_avg, + const AccessorSumRD &MolarFracs_rms, + const AccessorSumRD &MassFracs_avg, + const AccessorSumRD &MassFracs_rms, + const AccessorSumRD< Vec3, N> &velocity_avg, + const AccessorSumRD< Vec3, N> &velocity_rms, + const AccessorSumRD< Vec3, N> &velocity_rey, + const Point<3> &p, + const Point &pA, + const double deltaTime); + + // Favre averages the primitive variables + __CUDA_H__ + static inline void FavreAvgPrimitive( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &rho, + const AccessorRO &pressure, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorSumRD &pressure_favg, + const AccessorSumRD &pressure_frms, + const AccessorSumRD &temperature_favg, + const AccessorSumRD &temperature_frms, + const AccessorSumRD &MolarFracs_favg, + const AccessorSumRD &MolarFracs_frms, + const AccessorSumRD &MassFracs_favg, + const AccessorSumRD &MassFracs_frms, + const AccessorSumRD< Vec3, N> &velocity_favg, + const AccessorSumRD< Vec3, N> &velocity_frms, + const AccessorSumRD< Vec3, N> &velocity_frey, + const Point<3> &p, + const Point &pA, + const double deltaTime); + + // Averages the properties + __CUDA_H__ + static inline void AvgProperties( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &SoS, + const AccessorSumRD &rho_avg, + const AccessorSumRD &rho_rms, + const AccessorSumRD &mu_avg, + const AccessorSumRD &lam_avg, + const AccessorSumRD &Di_avg, + const AccessorSumRD &SoS_avg, + const AccessorSumRD &cp_avg, + const AccessorSumRD &Ent_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime); + + // Favre averages the properties + __CUDA_H__ + static inline void FavreAvgProperties( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &SoS, + const AccessorSumRD &mu_favg, + const AccessorSumRD &lam_favg, + const AccessorSumRD &Di_favg, + const AccessorSumRD &SoS_favg, + const AccessorSumRD &cp_favg, + const AccessorSumRD &Ent_favg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime); + + // Averages the kinetic energy budget terms + __CUDA_H__ + static inline void AvgKineticEnergyBudget( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &pressure, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO< Vec3, 3> &vGradX, + const AccessorRO< Vec3, 3> &vGradY, + const AccessorRO< Vec3, 3> &vGradZ, + const AccessorSumRD< Vec3, N> &rhoUUv_avg, + const AccessorSumRD< Vec3, N> &Up_avg, + const AccessorSumRD &tau_avg, + const AccessorSumRD< Vec3, N> &utau_y_avg, + const AccessorSumRD< Vec3, N> &tauGradU_avg, + const AccessorSumRD< Vec3, N> &pGradU_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime); + + // Averages the fluxes and production rates + __CUDA_H__ + static inline void AvgFluxes_ProdRates( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO< int, 3> &nType_x, + const AccessorRO< int, 3> &nType_y, + const AccessorRO< int, 3> &nType_z, + const AccessorRO &dcsi_d, + const AccessorRO &deta_d, + const AccessorRO &dzet_d, + const AccessorRO &pressure, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO &Ki, + const AccessorRO< Vec3, 3> &eField, +#endif + const AccessorSumRD< Vec3, N> &q_avg, + const AccessorSumRD &ProductionRates_avg, + const AccessorSumRD &ProductionRates_rms, + const AccessorSumRD &HeatReleaseRate_avg, + const AccessorSumRD &HeatReleaseRate_rms, + const Point<3> &p, + const Point &pA, + const Rect<3> &Fluid_bounds, + const Mix &mix, + const double deltaTime); + + // Averages dimensionless numbers + __CUDA_H__ + static inline void AvgDimensionlessNumbers( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &SoS, + const AccessorSumRD &Pr_avg, + const AccessorSumRD &Pr_rms, + const AccessorSumRD &Ec_avg, + const AccessorSumRD &Ec_rms, + const AccessorSumRD &Ma_avg, + const AccessorSumRD &Sc_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime); + + // Averages correlations + __CUDA_H__ + static inline void AvgCorrelations( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorSumRD< Vec3, N> &uT_avg, + const AccessorSumRD< Vec3, N> &uT_favg, + const AccessorSumRD &uYi_avg, + const AccessorSumRD &vYi_avg, + const AccessorSumRD &wYi_avg, + const AccessorSumRD &uYi_favg, + const AccessorSumRD &vYi_favg, + const AccessorSumRD &wYi_favg, + const Point<3> &p, + const Point &pA, + const double deltaTime); + +#ifdef ELECTRIC_FIELD + // Averages electric quantities + __CUDA_H__ + static inline void AvgElectricQuantities( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &rho, + const AccessorRO &ePot, + const AccessorSumRD &ePot_avg, + const AccessorSumRD &Crg_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime); +#endif + +}; + +//----------------------------------------------------------------------------- +// TASK THAT COLLECTES TEMPORAL AND 2D SPATIAL AVERAGES +//----------------------------------------------------------------------------- + +template +class Add2DAveragesTask : public AverageUtils<2> { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Ghost; + LogicalRegion Fluid; + LogicalRegion Averages; + Mix mix; + Rect<3> Fluid_bounds; + double Integrator_deltaTime; + FieldID Ghost_fields [FID_last - 101]; + FieldID Fluid_fields [FID_last - 101]; + FieldID Averages_fields [AVE_FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT COLLECTES TEMPORAL AND 1D SPATIAL AVERAGES +//----------------------------------------------------------------------------- + +template +class Add1DAveragesTask : public AverageUtils<3> { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Ghost; + LogicalRegion Fluid; + LogicalRegion Averages; + Mix mix; + Rect<3> Fluid_bounds; + double Integrator_deltaTime; + FieldID Ghost_fields [FID_last - 101]; + FieldID Fluid_fields [FID_last - 101]; + FieldID Averages_fields [AVE_FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +// Physical regions indices +#define iDouble 2 +#define iVec3 3 +#define iVecNSp 4 +#define iVec6 5 + +#endif // __PROMETEO_AVERAGE_HPP__ diff --git a/src/prometeo_average.inl b/src/prometeo_average.inl new file mode 100644 index 0000000..1d8c56c --- /dev/null +++ b/src/prometeo_average.inl @@ -0,0 +1,467 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_metric.inl" + +//----------------------------------------------------------------------------- +// INLINE FUNCTIONS FOR AverageUtils +//----------------------------------------------------------------------------- + +template +__CUDA_H__ +inline void AverageUtils::AvgPrimitive( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const AccessorRO &pressure, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorSumRD &avg_weight, + const AccessorSumRD< Vec3, N> &avg_centerCoordinates, + const AccessorSumRD &pressure_avg, + const AccessorSumRD &pressure_rms, + const AccessorSumRD &temperature_avg, + const AccessorSumRD &temperature_rms, + const AccessorSumRD &MolarFracs_avg, + const AccessorSumRD &MolarFracs_rms, + const AccessorSumRD &MassFracs_avg, + const AccessorSumRD &MassFracs_rms, + const AccessorSumRD< Vec3, N> &velocity_avg, + const AccessorSumRD< Vec3, N> &velocity_rms, + const AccessorSumRD< Vec3, N> &velocity_rey, + const Point<3> &p, + const Point &pA, + const double deltaTime) { + + const double weight = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + + // Average weight + avg_weight[pA] <<= weight; + + // Grid point + avg_centerCoordinates[pA] <<= centerCoordinates[p]*weight; + + // Primitive variables + pressure_avg[pA] <<= weight*pressure[p]; + pressure_rms[pA] <<= weight*pressure[p]*pressure[p]; + temperature_avg[pA] <<= weight*temperature[p]; + temperature_rms[pA] <<= weight*temperature[p]*temperature[p]; + MolarFracs_avg[pA] <<= weight*MolarFracs[p]; + MolarFracs_rms[pA] <<= weight*MolarFracs[p]*MolarFracs[p]; + MassFracs_avg[pA] <<= weight*MassFracs[p]; + MassFracs_rms[pA] <<= weight*MassFracs[p]*MassFracs[p]; + velocity_avg[pA] <<= weight*velocity[p]; + velocity_rms[pA] <<= weight*velocity[p]*velocity[p]; + Vec3 rey; + rey[0] = velocity[p][0]*velocity[p][1]*weight; + rey[1] = velocity[p][0]*velocity[p][2]*weight; + rey[2] = velocity[p][1]*velocity[p][2]*weight; + velocity_rey[pA] <<= rey; +}; + +template +__CUDA_H__ +inline void AverageUtils::FavreAvgPrimitive( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &rho, + const AccessorRO &pressure, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorSumRD &pressure_favg, + const AccessorSumRD &pressure_frms, + const AccessorSumRD &temperature_favg, + const AccessorSumRD &temperature_frms, + const AccessorSumRD &MolarFracs_favg, + const AccessorSumRD &MolarFracs_frms, + const AccessorSumRD &MassFracs_favg, + const AccessorSumRD &MassFracs_frms, + const AccessorSumRD< Vec3, N> &velocity_favg, + const AccessorSumRD< Vec3, N> &velocity_frms, + const AccessorSumRD< Vec3, N> &velocity_frey, + const Point<3> &p, + const Point &pA, + const double deltaTime) { + + const double weight = rho[p]*cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + + pressure_favg[pA] <<= weight*pressure[p]; + pressure_frms[pA] <<= weight*pressure[p]*pressure[p]; + temperature_favg[pA] <<= weight*temperature[p]; + temperature_frms[pA] <<= weight*temperature[p]*temperature[p]; + MolarFracs_favg[pA] <<= weight*MolarFracs[p]; + MolarFracs_frms[pA] <<= weight*MolarFracs[p]*MolarFracs[p]; + MassFracs_favg[pA] <<= weight*MassFracs[p]; + MassFracs_frms[pA] <<= weight*MassFracs[p]*MassFracs[p]; + velocity_favg[pA] <<= weight*velocity[p]; + velocity_frms[pA] <<= weight*velocity[p]*velocity[p]; + Vec3 rey; + rey[0] = velocity[p][0]*velocity[p][1]*weight; + rey[1] = velocity[p][0]*velocity[p][2]*weight; + rey[2] = velocity[p][1]*velocity[p][2]*weight; + velocity_frey[pA] <<= rey; +}; + +template +__CUDA_H__ +inline void AverageUtils::AvgProperties( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &SoS, + const AccessorSumRD &rho_avg, + const AccessorSumRD &rho_rms, + const AccessorSumRD &mu_avg, + const AccessorSumRD &lam_avg, + const AccessorSumRD &Di_avg, + const AccessorSumRD &SoS_avg, + const AccessorSumRD &cp_avg, + const AccessorSumRD &Ent_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime) { + + const double weight = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + + const double cp = mix.GetHeatCapacity(temperature[p], MassFracs[p]); + double Ent = 0.0; + __UNROLL__ + for (int i=0; i < nSpec; i++) + Ent += MassFracs[p][i]*mix.GetSpeciesEnthalpy(i, temperature[p]); + + rho_avg[pA] <<= weight*rho[p]; + rho_rms[pA] <<= weight*rho[p]*rho[p]; + mu_avg[pA] <<= weight*mu[p]; + lam_avg[pA] <<= weight*lam[p]; + Di_avg[pA] <<= weight*Di[p]; + SoS_avg[pA] <<= weight*SoS[p]; + cp_avg[pA] <<= weight*cp; + Ent_avg[pA] <<= weight*Ent; + +}; + +template +__CUDA_H__ +inline void AverageUtils::FavreAvgProperties( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &SoS, + const AccessorSumRD &mu_favg, + const AccessorSumRD &lam_favg, + const AccessorSumRD &Di_favg, + const AccessorSumRD &SoS_favg, + const AccessorSumRD &cp_favg, + const AccessorSumRD &Ent_favg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime) { + + const double weight = rho[p]*cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + + const double cp = mix.GetHeatCapacity(temperature[p], MassFracs[p]); + double Ent = 0.0; + __UNROLL__ + for (int i=0; i < nSpec; i++) + Ent += MassFracs[p][i]*mix.GetSpeciesEnthalpy(i, temperature[p]); + + mu_favg[pA] <<= weight*mu[p]; + lam_favg[pA] <<= weight*lam[p]; + Di_favg[pA] <<= weight*Di[p]; + SoS_favg[pA] <<= weight*SoS[p]; + cp_favg[pA] <<= weight*cp; + Ent_favg[pA] <<= weight*Ent; + +}; + +template +__CUDA_H__ +inline void AverageUtils::AvgKineticEnergyBudget( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &pressure, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO< Vec3, 3> &vGradX, + const AccessorRO< Vec3, 3> &vGradY, + const AccessorRO< Vec3, 3> &vGradZ, + const AccessorSumRD< Vec3, N> &rhoUUv_avg, + const AccessorSumRD< Vec3, N> &Up_avg, + const AccessorSumRD &tau_avg, + const AccessorSumRD< Vec3, N> &utau_y_avg, + const AccessorSumRD< Vec3, N> &tauGradU_avg, + const AccessorSumRD< Vec3, N> &pGradU_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime) { + + const double weight = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + + TauMat tau; + tau(0, 0) = mu[p]*(4.0*vGradX[p][0] - 2.0*vGradY[p][1] - 2.0*vGradZ[p][2])/3.0; + tau(0, 1) = mu[p]*(vGradX[p][1] + vGradY[p][0]); + tau(0, 2) = mu[p]*(vGradZ[p][0] + vGradX[p][2]); + tau(1, 1) = mu[p]*(4.0*vGradY[p][1] - 2.0*vGradX[p][0] - 2.0*vGradZ[p][2])/3.0; + tau(1, 2) = mu[p]*(vGradY[p][2] + vGradZ[p][1]); + tau(2, 2) = mu[p]*(4.0*vGradZ[p][2] - 2.0*vGradX[p][0] - 2.0-vGradY[p][1])/3.0; + + // Kinetic energy budgets (y is the inhomogeneous direction) + rhoUUv_avg[pA] <<= velocity[p]*velocity[p]*(rho[p]*velocity[p][1]*weight); + Up_avg[pA] <<= velocity[p]*(pressure[p]*weight); + tau_avg[pA] <<= tau*weight; + { + Vec3 utau_y; + utau_y[0] = velocity[p][0]*tau(0, 1)*weight; + utau_y[1] = velocity[p][1]*tau(1, 1)*weight; + utau_y[2] = velocity[p][2]*tau(2, 1)*weight; + utau_y_avg[pA] <<= utau_y*weight; + } + { + Vec3 tauGradU; + __UNROLL__ + for (int i=0; i<3; i++) + tauGradU[i] = tau(i, 0)*vGradX[p][i] + tau(i, 1)*vGradY[p][i] + tau(i, 2)*vGradZ[p][i]; + tauGradU_avg[pA] <<= tauGradU*weight; + } + { + Vec3 pGradU; + pGradU[0] = vGradX[p][0]*pressure[p]; + pGradU[1] = vGradY[p][1]*pressure[p]; + pGradU[2] = vGradZ[p][2]*pressure[p]; + pGradU_avg[pA] <<= pGradU*weight; + } +}; + +template +__CUDA_H__ +inline void AverageUtils::AvgFluxes_ProdRates( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO< int, 3> &nType_x, + const AccessorRO< int, 3> &nType_y, + const AccessorRO< int, 3> &nType_z, + const AccessorRO &dcsi_d, + const AccessorRO &deta_d, + const AccessorRO &dzet_d, + const AccessorRO &pressure, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO &Ki, + const AccessorRO< Vec3, 3> &eField, +#endif + const AccessorSumRD< Vec3, N> &q_avg, + const AccessorSumRD &ProductionRates_avg, + const AccessorSumRD &ProductionRates_rms, + const AccessorSumRD &HeatReleaseRate_avg, + const AccessorSumRD &HeatReleaseRate_rms, + const Point<3> &p, + const Point &pA, + const Rect<3> &Fluid_bounds, + const Mix &mix, + const double deltaTime) { + + const double weight = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + + // Fourier heat fluxes + q_avg[pA] <<= (-lam[p]*weight)*getGrad(temperature, p, + nType_x[p], nType_y[p], nType_z[p], + dcsi_d[p], deta_d[p], dzet_d[p], + Fluid_bounds); + // Species diffusion flux + const coord_t size_x = getSize(Fluid_bounds); + const coord_t size_y = getSize(Fluid_bounds); + const coord_t size_z = getSize(Fluid_bounds); + const Point<3> pM1_x = warpPeriodic(Fluid_bounds, p, size_x, offM1(nType_x[p])); + const Point<3> pM1_y = warpPeriodic(Fluid_bounds, p, size_y, offM1(nType_y[p])); + const Point<3> pM1_z = warpPeriodic(Fluid_bounds, p, size_z, offM1(nType_z[p])); + const Point<3> pP1_x = warpPeriodic(Fluid_bounds, p, size_x, offP1(nType_x[p])); + const Point<3> pP1_y = warpPeriodic(Fluid_bounds, p, size_y, offP1(nType_y[p])); + const Point<3> pP1_z = warpPeriodic(Fluid_bounds, p, size_z, offP1(nType_z[p])); + const double iMixW = 1.0/mix.GetMolarWeightFromXi(MolarFracs[p]); + Vec3 Ji; + Vec3 JiCorr; JiCorr.init(0); + __UNROLL__ + for (int i=0; i 0)) + // add species drift + __UNROLL__ + for (int i=0; i +__CUDA_H__ +inline void AverageUtils::AvgDimensionlessNumbers( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &SoS, + const AccessorSumRD &Pr_avg, + const AccessorSumRD &Pr_rms, + const AccessorSumRD &Ec_avg, + const AccessorSumRD &Ec_rms, + const AccessorSumRD &Ma_avg, + const AccessorSumRD &Sc_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime) { + + const double weight = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + const double cp = mix.GetHeatCapacity(temperature[p], MassFracs[p]); + + const double u2 = velocity[p].dot(velocity[p]); + const double Pr = cp*mu[p]/lam[p]; + const double Ec = u2/(cp*temperature[p]); + const double nu = mu[p]/rho[p]; + VecNSp Sc; + __UNROLL__ + for (int i=0; i < nSpec; i++) + Sc[i] = nu/Di[p][i]; + + Pr_avg[pA] <<= weight*Pr; + Pr_rms[pA] <<= weight*Pr*Pr; + Ec_avg[pA] <<= weight*Ec; + Ec_rms[pA] <<= weight*Ec*Ec; + Ma_avg[pA] <<= weight*sqrt(u2)/SoS[p]; + Sc_avg[pA] <<= weight*Sc; +}; + +template +__CUDA_H__ +inline void AverageUtils::AvgCorrelations( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorSumRD< Vec3, N> &uT_avg, + const AccessorSumRD< Vec3, N> &uT_favg, + const AccessorSumRD &uYi_avg, + const AccessorSumRD &vYi_avg, + const AccessorSumRD &wYi_avg, + const AccessorSumRD &uYi_favg, + const AccessorSumRD &vYi_favg, + const AccessorSumRD &wYi_favg, + const Point<3> &p, + const Point &pA, + const double deltaTime) { + const double weight = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + const double rweight = rho[p]*cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + + uT_avg[pA] <<= velocity[p]*weight; + uT_favg[pA] <<= velocity[p]*rweight; + + uYi_avg[pA] <<= MassFracs[p]*(velocity[p][0]*weight); + vYi_avg[pA] <<= MassFracs[p]*(velocity[p][1]*weight); + wYi_avg[pA] <<= MassFracs[p]*(velocity[p][2]*weight); + uYi_favg[pA] <<= MassFracs[p]*(velocity[p][0]*rweight); + vYi_favg[pA] <<= MassFracs[p]*(velocity[p][1]*rweight); + wYi_favg[pA] <<= MassFracs[p]*(velocity[p][2]*rweight); +}; + +#ifdef ELECTRIC_FIELD +template +__CUDA_H__ +inline void AverageUtils::AvgElectricQuantities( + const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO &rho, + const AccessorRO &ePot, + const AccessorSumRD &ePot_avg, + const AccessorSumRD &Crg_avg, + const Point<3> &p, + const Point &pA, + const Mix &mix, + const double deltaTime) { + const double weight = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]*deltaTime; + const double MixW = mix.GetMolarWeightFromXi(MolarFracs[p]); + + ePot_avg[pA] <<= ePot[p]*weight; + Crg_avg[pA] <<= mix.GetElectricChargeDensity(rho[p], MixW, MolarFracs[p])*weight; +}; +#endif + diff --git a/src/prometeo_average.rg b/src/prometeo_average.rg index ce3f11e..955793f 100644 --- a/src/prometeo_average.rg +++ b/src/prometeo_average.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -29,7 +29,8 @@ import "regent" -return function(SCHEMA, MIX, Fluid_columns) local Exports = {} +return function(SCHEMA, MIX, TYPES, PART, + ELECTRIC_FIELD) local Exports = {} ------------------------------------------------------------------------------- -- IMPORTS @@ -41,6 +42,12 @@ local CONST = require "prometeo_const" local MACRO = require "prometeo_macro" local format = require "std/format" +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local AVE_TYPES = terralib.includec("prometeo_average_types.h", types_inc_flags) + -- Variable indices local nSpec = MIX.nSpec -- Number of species composing the mixture local irU = CONST.GetirU(MIX) -- Index of the momentum in Conserved vector @@ -54,82 +61,9 @@ local Properties = CONST.Properties -- DATA STRUCTURES ------------------------------------------------------------------------------- -local struct Averages_columns { - weight : double; - -- Grid point - centerCoordinates : double[3]; - -- Primitive variables - pressure_avg : double; - pressure_rms : double; - temperature_avg : double; - temperature_rms : double; - MolarFracs_avg : double[nSpec]; - MolarFracs_rms : double[nSpec]; - MassFracs_avg : double[nSpec]; - MassFracs_rms : double[nSpec]; - velocity_avg : double[3]; - velocity_rms : double[3]; - velocity_rey : double[3]; - -- Properties - rho_avg : double; - rho_rms : double; - mu_avg : double; - lam_avg : double; - Di_avg : double[nSpec]; - SoS_avg : double; - cp_avg : double; - Ent_avg : double; - -- Chemical production rates - ProductionRates_avg : double[nSpec]; - ProductionRates_rms : double[nSpec]; - HeatReleaseRate_avg : double; - HeatReleaseRate_rms : double; - -- Favre averaged primitives - pressure_favg : double; - pressure_frms : double; - temperature_favg : double; - temperature_frms : double; - MolarFracs_favg : double[nSpec]; - MolarFracs_frms : double[nSpec]; - MassFracs_favg : double[nSpec]; - MassFracs_frms : double[nSpec]; - velocity_favg : double[3]; - velocity_frms : double[3]; - velocity_frey : double[3]; - -- Favre averaged properties - mu_favg : double; - lam_favg : double; - Di_favg : double[nSpec]; - SoS_favg : double; - cp_favg : double; - Ent_favg : double; - -- Kinetic energy budgets (y is the inhomogeneous direction) - rhoUUv : double[3]; - Up : double[3]; - tau : double[6]; - utau_y : double[3]; - tauGradU : double[3]; - pGradU : double[3]; - -- Fluxes - q : double[3]; - -- Dimensionless numbers - Pr : double; - Pr_rms : double; - Ec : double; - Ec_rms : double; - Ma : double; - Sc : double[nSpec]; - -- Correlations - uT_avg : double[3]; - uT_favg : double[3]; - uYi_avg : double[nSpec]; - vYi_avg : double[nSpec]; - wYi_avg : double[nSpec]; - uYi_favg : double[nSpec]; - vYi_favg : double[nSpec]; - wYi_favg : double[nSpec]; +local Fluid_columns = TYPES.Fluid_columns -} +local Averages_columns = AVE_TYPES.Averages_columns local AveragesVars = terralib.newlist({ 'weight', @@ -207,6 +141,18 @@ local AveragesVars = terralib.newlist({ 'wYi_favg' }) +-- Add electric varaibles to the lists +local additionalVars = terralib.newlist({}) +if ELECTRIC_FIELD then + AveragesVars:insert("electricPotential_avg") + AveragesVars:insert("chargeDensity_avg") + additionalVars:insert("electricPotential") + additionalVars:insert("electricField") + if (MIX.nIons > 0) then + additionalVars:insert("Ki") + end +end + local HDF_RAKES = (require 'hdf_helper')(int2d, int2d, Averages_columns, AveragesVars, {}, @@ -243,6 +189,10 @@ Exports.AvgList = { p_Fluid_YZAvg = regentlib.newsymbol("p_Fluid_YZAvg"), p_Fluid_XZAvg = regentlib.newsymbol("p_Fluid_XZAvg"), p_Fluid_XYAvg = regentlib.newsymbol("p_Fluid_XYAvg"), + -- considered partitions of the Fluid domain that provide support to gradient stencil + p_Gradient_YZAvg = regentlib.newsymbol("p_Gradient_YZAvg"), + p_Gradient_XZAvg = regentlib.newsymbol("p_Gradient_XZAvg"), + p_Gradient_XYAvg = regentlib.newsymbol("p_Gradient_XYAvg"), -- tiles of Fluid where the average kernels will be launched YZAvg_tiles = regentlib.newsymbol(), XZAvg_tiles = regentlib.newsymbol(), @@ -273,6 +223,10 @@ Exports.AvgList = { p_Fluid_XAvg = regentlib.newsymbol("p_Fluid_XAvg"), p_Fluid_YAvg = regentlib.newsymbol("p_Fluid_YAvg"), p_Fluid_ZAvg = regentlib.newsymbol("p_Fluid_ZAvg"), + -- considered partitions of the Fluid domain that provide support to gradient stencil + p_Gradient_XAvg = regentlib.newsymbol("p_Gradient_YZAvg"), + p_Gradient_YAvg = regentlib.newsymbol("p_Gradient_XZAvg"), + p_Gradient_ZAvg = regentlib.newsymbol("p_Gradient_XYAvg"), -- tiles of Fluid where the average kernels will be launched XAvg_tiles = regentlib.newsymbol(), YAvg_tiles = regentlib.newsymbol(), @@ -303,7 +257,13 @@ local function mkInitializeAverages(nd) fill(Averages.MassFracs_rms, [UTIL.mkArrayConstant(nSpec, rexpr 0.0 end)]) fill(Averages.velocity_avg, array(0.0, 0.0, 0.0)) fill(Averages.velocity_rms, array(0.0, 0.0, 0.0)) - fill(Averages.velocity_rey, array(0.0, 0.0, 0.0)) + fill(Averages.velocity_rey, array(0.0, 0.0, 0.0)); +[(function() local __quotes = terralib.newlist() +if ELECTRIC_FIELD then __quotes:insert(rquote + -- Electric quantities + fill(Averages.electricPotential_avg, 0.0) + fill(Averages.chargeDensity_avg, 0.0) +end) end return __quotes end)()]; -- Properties fill(Averages.rho_avg, 0.0) fill(Averages.rho_rms, 0.0) @@ -366,236 +326,63 @@ local function mkInitializeAverages(nd) return InitializeAverages end -local function emitAddAvg1(r, c, avg, c_avg, Integrator_deltaTime) return rquote - - var weight = r[c].cellWidth[0]*r[c].cellWidth[1]*r[c].cellWidth[2]*Integrator_deltaTime - var rhoWeight = weight*r[c].rho - - avg[c_avg].weight += weight - - -- Grid point - avg[c_avg].centerCoordinates += [UTIL.mkArrayConstant(3, weight)]*r[c].centerCoordinates - - -- Primitive variables - avg[c_avg].pressure_avg += weight*r[c].pressure - avg[c_avg].pressure_rms += weight*r[c].pressure*r[c].pressure - avg[c_avg].temperature_avg += weight*r[c].temperature - avg[c_avg].temperature_rms += weight*r[c].temperature*r[c].temperature - avg[c_avg].MolarFracs_avg += [UTIL.mkArrayConstant(nSpec, weight)]*r[c].MolarFracs - avg[c_avg].MolarFracs_rms += [UTIL.mkArrayConstant(nSpec, weight)]*r[c].MolarFracs*r[c].MolarFracs - avg[c_avg].velocity_avg += [UTIL.mkArrayConstant(3, weight)]*r[c].velocity - avg[c_avg].velocity_rms += [UTIL.mkArrayConstant(3, weight)]*r[c].velocity*r[c].velocity - avg[c_avg].velocity_rey += array(r[c].velocity[0]*r[c].velocity[1]*weight, - r[c].velocity[0]*r[c].velocity[2]*weight, - r[c].velocity[1]*r[c].velocity[2]*weight) - - -- Favre averaged primitives - avg[c_avg].pressure_favg += rhoWeight*r[c].pressure - avg[c_avg].pressure_frms += rhoWeight*r[c].pressure*r[c].pressure - avg[c_avg].temperature_favg += rhoWeight*r[c].temperature - avg[c_avg].temperature_frms += rhoWeight*r[c].temperature*r[c].temperature - avg[c_avg].MolarFracs_favg += [UTIL.mkArrayConstant(nSpec, rhoWeight)]*r[c].MolarFracs - avg[c_avg].MolarFracs_frms += [UTIL.mkArrayConstant(nSpec, rhoWeight)]*r[c].MolarFracs*r[c].MolarFracs - avg[c_avg].velocity_favg += [UTIL.mkArrayConstant(3, rhoWeight)]*r[c].velocity - avg[c_avg].velocity_frms += [UTIL.mkArrayConstant(3, rhoWeight)]*r[c].velocity*r[c].velocity - avg[c_avg].velocity_frey += array(r[c].velocity[0]*r[c].velocity[1]*rhoWeight, - r[c].velocity[0]*r[c].velocity[2]*rhoWeight, - r[c].velocity[1]*r[c].velocity[2]*rhoWeight) - - -- Kinetic energy budgets (y is the inhomogeneous direction) - var tau_xx = r[c].mu*(4.0*r[c].velocityGradientX[0] - 2.0*r[c].velocityGradientY[1] - 2.0*r[c].velocityGradientZ[2])/3.0 - var tau_yy = r[c].mu*(4.0*r[c].velocityGradientY[1] - 2.0*r[c].velocityGradientX[0] - 2.0*r[c].velocityGradientZ[2])/3.0 - var tau_zz = r[c].mu*(4.0*r[c].velocityGradientZ[2] - 2.0*r[c].velocityGradientX[0] - 2.0-r[c].velocityGradientY[1])/3.0 - var tau_xy = r[c].mu*(r[c].velocityGradientX[1] + r[c].velocityGradientY[0]) - var tau_yz = r[c].mu*(r[c].velocityGradientY[2] + r[c].velocityGradientZ[1]) - var tau_xz = r[c].mu*(r[c].velocityGradientZ[0] + r[c].velocityGradientX[2]) - - avg[c_avg].rhoUUv += array(r[c].rho*r[c].velocity[0]*r[c].velocity[0]*r[c].velocity[1]*weight, - r[c].rho*r[c].velocity[1]*r[c].velocity[1]*r[c].velocity[1]*weight, - r[c].rho*r[c].velocity[2]*r[c].velocity[2]*r[c].velocity[1]*weight) - avg[c_avg].Up += array(r[c].velocity[0]*r[c].pressure*weight, - r[c].velocity[1]*r[c].pressure*weight, - r[c].velocity[2]*r[c].pressure*weight) - avg[c_avg].tau += [UTIL.mkArrayConstant(6, weight)]*array(tau_xx, tau_yy, tau_zz, tau_xy, tau_yz, tau_xz) - avg[c_avg].utau_y += array(r[c].velocity[0]*tau_xy*weight, - r[c].velocity[1]*tau_yy*weight, - r[c].velocity[2]*tau_yz*weight) - avg[c_avg].tauGradU += array((tau_xx*r[c].velocityGradientX[0] + tau_xy*r[c].velocityGradientY[0] + tau_xz*r[c].velocityGradientZ[0])*weight, - (tau_xy*r[c].velocityGradientX[1] + tau_yy*r[c].velocityGradientY[1] + tau_yz*r[c].velocityGradientZ[1])*weight, - (tau_xz*r[c].velocityGradientX[2] + tau_yz*r[c].velocityGradientY[2] + tau_zz*r[c].velocityGradientZ[2])*weight) - avg[c_avg].pGradU += array(r[c].pressure*r[c].velocityGradientX[0]*weight, - r[c].pressure*r[c].velocityGradientY[1]*weight, - r[c].pressure*r[c].velocityGradientZ[2]*weight) - - -- Fluxes - avg[c_avg].q += array( -r[c].lam*r[c].temperatureGradient[0]*weight, - -r[c].lam*r[c].temperatureGradient[1]*weight, - -r[c].lam*r[c].temperatureGradient[2]*weight) -end end - -local function emitAddAvg2(r, c, avg, c_avg, Integrator_deltaTime, mix) return rquote - - var weight = r[c].cellWidth[0]*r[c].cellWidth[1]*r[c].cellWidth[2]*Integrator_deltaTime - var rhoWeight = weight*r[c].rho - - -- Properties - var cp = MIX.GetHeatCapacity(r[c].temperature, r[c].MassFracs, mix) - var hi : double[nSpec] - var Ent = 0.0 - for i=0, nSpec do - hi[i] = MIX.GetSpeciesEnthalpy(i, r[c].temperature, mix) - Ent += r[c].MassFracs[i]*hi[i] - end - avg[c_avg].rho_avg += weight*r[c].rho - avg[c_avg].rho_rms += weight*r[c].rho*r[c].rho - avg[c_avg].mu_avg += weight*r[c].mu - avg[c_avg].lam_avg += weight*r[c].lam - avg[c_avg].Di_avg += [UTIL.mkArrayConstant(nSpec, weight)]*r[c].Di - avg[c_avg].SoS_avg += weight*r[c].SoS - avg[c_avg].cp_avg += weight*cp - avg[c_avg].Ent_avg += weight*Ent - - -- Mass fractions - avg[c_avg].MassFracs_avg += [UTIL.mkArrayConstant(nSpec, weight)]*r[c].MassFracs - avg[c_avg].MassFracs_rms += [UTIL.mkArrayConstant(nSpec, weight)]*r[c].MassFracs*r[c].MassFracs - - -- Favre averaged properties - avg[c_avg].mu_favg += rhoWeight*r[c].mu - avg[c_avg].lam_favg += rhoWeight*r[c].lam - avg[c_avg].Di_favg += [UTIL.mkArrayConstant(nSpec, rhoWeight)]*r[c].Di - avg[c_avg].SoS_favg += rhoWeight*r[c].SoS - avg[c_avg].cp_favg += rhoWeight*cp - avg[c_avg].Ent_favg += rhoWeight*Ent - - -- Favre averaged mass fractions - avg[c_avg].MassFracs_favg += [UTIL.mkArrayConstant(nSpec, rhoWeight)]*r[c].MassFracs - avg[c_avg].MassFracs_frms += [UTIL.mkArrayConstant(nSpec, rhoWeight)]*r[c].MassFracs*r[c].MassFracs - - -- Chemical production rates - var w = MIX.GetProductionRates(r[c].rho, r[c].pressure, r[c].temperature, r[c].MassFracs, mix) - var HR = 0.0 - for i=0, nSpec do - HR -= w[i]*hi[i] - end - avg[c_avg].ProductionRates_avg += [UTIL.mkArrayConstant(nSpec, weight)]*w - avg[c_avg].ProductionRates_rms += [UTIL.mkArrayConstant(nSpec, weight)]*w*w - avg[c_avg].HeatReleaseRate_avg += weight*HR - avg[c_avg].HeatReleaseRate_rms += weight*HR*HR - - -- Dimensionless numbers - var u2 = MACRO.dot(r[c].velocity, r[c].velocity) - var Pr = cp*r[c].mu/r[c].lam - var Ec = u2/(cp*r[c].temperature) - var nu = r[c].mu/r[c].rho - var Sc : double[nSpec] - for i=0, nSpec do - Sc[i] = nu/r[c].Di[i] - end - avg[c_avg].Pr += weight*Pr - avg[c_avg].Pr_rms += weight*Pr*Pr - avg[c_avg].Ec += weight*Ec - avg[c_avg].Ec_rms += weight*Ec*Ec - avg[c_avg].Ma += weight*sqrt(u2)/r[c].SoS - avg[c_avg].Sc += [UTIL.mkArrayConstant(nSpec, weight)]*Sc - - -- Correlations - var weightU = weight*r[c].velocity[0] - var weightV = weight*r[c].velocity[1] - var weightW = weight*r[c].velocity[2] - var weightRhoU = weight*r[c].velocity[0]*r[c].rho - var weightRhoV = weight*r[c].velocity[1]*r[c].rho - var weightRhoW = weight*r[c].velocity[2]*r[c].rho - - avg[c_avg].uT_avg += array( weightU*r[c].temperature, - weightV*r[c].temperature, - weightW*r[c].temperature) - avg[c_avg].uT_favg += array(weightRhoU*r[c].temperature, - weightRhoV*r[c].temperature, - weightRhoW*r[c].temperature) - - avg[c_avg].uYi_avg += [UTIL.mkArrayConstant(nSpec, weightU)]*r[c].MassFracs - avg[c_avg].vYi_avg += [UTIL.mkArrayConstant(nSpec, weightV)]*r[c].MassFracs - avg[c_avg].wYi_avg += [UTIL.mkArrayConstant(nSpec, weightW)]*r[c].MassFracs - avg[c_avg].uYi_favg += [UTIL.mkArrayConstant(nSpec, weightRhoU)]*r[c].MassFracs - avg[c_avg].vYi_favg += [UTIL.mkArrayConstant(nSpec, weightRhoV)]*r[c].MassFracs - avg[c_avg].wYi_favg += [UTIL.mkArrayConstant(nSpec, weightRhoW)]*r[c].MassFracs - -end end - local function mkAddAverages(dir) - local AddAverages - __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED - task AddAverages(Fluid : region(ispace(int3d), Fluid_columns), - Averages : region(ispace(int2d), Averages_columns), - mix : MIX.Mixture, - Integrator_deltaTime : double) + local Add2DAverages + extern task Add2DAverages(Ghost : region(ispace(int3d), Fluid_columns), + Fluid : region(ispace(int3d), Fluid_columns), + Averages : region(ispace(int2d), Averages_columns), + mix : MIX.Mixture, + Fluid_bounds : rect3d, + Integrator_deltaTime : double) where + reads(Ghost.{temperature, MolarFracs}), reads(Fluid.centerCoordinates), reads(Fluid.cellWidth), - reads(Fluid.[Primitives]), - reads(Fluid.MassFracs), + reads(Fluid.{nType_x, nType_y, nType_z}), + reads(Fluid.{dcsi_d, deta_d, dzet_d}), + reads(Fluid.{pressure, MassFracs, velocity}), reads(Fluid.[Properties]), reads(Fluid.{velocityGradientX, velocityGradientY, velocityGradientZ}), - reads(Fluid.temperatureGradient), + reads(Fluid.[additionalVars]), reduces+(Averages.[AveragesVars]) - do - __demand(__openmp) - for c in Fluid do - var c_avg = int2d{c.[dir], Averages.bounds.lo.y}; - [emitAddAvg1(Fluid, c, Averages, c_avg, Integrator_deltaTime)] - end - - __demand(__openmp) - for c in Fluid do - var c_avg = int2d{c.[dir], Averages.bounds.lo.y}; - [emitAddAvg2(Fluid, c, Averages, c_avg, Integrator_deltaTime, mix)] - end end - return AddAverages -end - -local function mkAdd1DAverages(dir) - local Add1DAverages - local t1 - local t2 if dir == "x" then - t1 = "y" - t2 = "z" + Add2DAverages:set_task_id(TYPES.TID_Add2DAveragesX) elseif dir == "y" then - t1 = "x" - t2 = "z" + Add2DAverages:set_task_id(TYPES.TID_Add2DAveragesY) elseif dir == "z" then - t1 = "x" - t2 = "y" + Add2DAverages:set_task_id(TYPES.TID_Add2DAveragesZ) else assert(false) end + return Add2DAverages +end - __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED - task Add1DAverages(Fluid : region(ispace(int3d), Fluid_columns), - Averages : region(ispace(int3d), Averages_columns), - mix : MIX.Mixture, - Integrator_deltaTime : double) +local function mkAdd1DAverages(dir) + local Add1DAverages + extern task Add1DAverages(Ghost : region(ispace(int3d), Fluid_columns), + Fluid : region(ispace(int3d), Fluid_columns), + Averages : region(ispace(int3d), Averages_columns), + mix : MIX.Mixture, + Fluid_bounds : rect3d, + Integrator_deltaTime : double) where + reads(Ghost.{temperature, MolarFracs}), reads(Fluid.centerCoordinates), reads(Fluid.cellWidth), - reads(Fluid.[Primitives]), - reads(Fluid.MassFracs), + reads(Fluid.{nType_x, nType_y, nType_z}), + reads(Fluid.{dcsi_d, deta_d, dzet_d}), + reads(Fluid.{pressure, MassFracs, velocity}), reads(Fluid.[Properties]), reads(Fluid.{velocityGradientX, velocityGradientY, velocityGradientZ}), - reads(Fluid.temperatureGradient), + reads(Fluid.[additionalVars]), reduces+(Averages.[AveragesVars]) - do - __demand(__openmp) - for c in Fluid do - var c_avg = int3d{c.[t1], c.[t2], Averages.bounds.lo.z}; - [emitAddAvg1(Fluid, c, Averages, c_avg, Integrator_deltaTime)] - end - - __demand(__openmp) - for c in Fluid do - var c_avg = int3d{c.[t1], c.[t2], Averages.bounds.lo.z}; - [emitAddAvg2(Fluid, c, Averages, c_avg, Integrator_deltaTime, mix)] - end end + if dir == "x" then + Add1DAverages:set_task_id(TYPES.TID_Add1DAveragesX) + elseif dir == "y" then + Add1DAverages:set_task_id(TYPES.TID_Add1DAveragesY) + elseif dir == "z" then + Add1DAverages:set_task_id(TYPES.TID_Add1DAveragesZ) + else assert(false) end return Add1DAverages end @@ -615,28 +402,7 @@ end ------------------------------------------------------------------------------- -- EXPORTED ROUTINES ------------------------------------------------------------------------------- -function Exports.DeclSymbols(s, Grid, Fluid, p_All, config, MAPPER) - - local function ColorFluid(inp, color) return rquote - for p=0, [inp].length do - -- Clip rectangles from the input - var vol = [inp].values[p] - vol.fromCell[0] max= 0 - vol.fromCell[1] max= 0 - vol.fromCell[2] max= 0 - vol.uptoCell[0] min= config.Grid.xNum + 2*Grid.xBnum - vol.uptoCell[1] min= config.Grid.yNum + 2*Grid.yBnum - vol.uptoCell[2] min= config.Grid.zNum + 2*Grid.zBnum - -- add to the coloring - var rect = rect3d{ - lo = int3d{vol.fromCell[0], vol.fromCell[1], vol.fromCell[2]}, - hi = int3d{vol.uptoCell[0], vol.uptoCell[1], vol.uptoCell[2]}} - regentlib.c.legion_domain_point_coloring_color_domain(color, int1d(p), rect) - end - -- Add one point to avoid errors - if [inp].length == 0 then regentlib.c.legion_domain_point_coloring_color_domain(color, int1d(0), rect3d{lo = int3d{0,0,0}, hi = int3d{0,0,0}}) end - end end - +function Exports.DeclSymbols(s, Grid, Fluid, Fluid_Zones, config, MAPPER) return rquote var sampleId = config.Mapping.sampleId @@ -694,54 +460,6 @@ function Exports.DeclSymbols(s, Grid, Fluid, p_All, config, MAPPER) var [s.p_Zrakes] = [UTIL.mkPartitionByTile(int2d, int2d, Averages_columns)] (s.XYAverages, is_ZrakesTiles, int2d{Grid.zBnum,0}, int2d{0,0}) - -- Partition the Fluid region based on the specified regions - -- One color for each type of rakes - var p_YZAvg_coloring = regentlib.c.legion_domain_point_coloring_create() - var p_XZAvg_coloring = regentlib.c.legion_domain_point_coloring_create() - var p_XYAvg_coloring = regentlib.c.legion_domain_point_coloring_create(); - - -- Color X rakes - [ColorFluid(rexpr config.IO.YZAverages end, p_YZAvg_coloring)]; - -- Color Y rakes - [ColorFluid(rexpr config.IO.XZAverages end, p_XZAvg_coloring)]; - -- Color Z rakes - [ColorFluid(rexpr config.IO.XYAverages end, p_XYAvg_coloring)]; - - -- Make partions of Fluid - var Fluid_YZAvg = partition(aliased, Fluid, p_YZAvg_coloring, ispace(int1d, max(config.IO.YZAverages.length, 1))) - var Fluid_XZAvg = partition(aliased, Fluid, p_XZAvg_coloring, ispace(int1d, max(config.IO.XZAverages.length, 1))) - var Fluid_XYAvg = partition(aliased, Fluid, p_XYAvg_coloring, ispace(int1d, max(config.IO.XYAverages.length, 1))) - - -- Split over tiles - var [s.p_Fluid_YZAvg] = cross_product(Fluid_YZAvg, p_All) - var [s.p_Fluid_XZAvg] = cross_product(Fluid_XZAvg, p_All) - var [s.p_Fluid_XYAvg] = cross_product(Fluid_XYAvg, p_All) - - -- Attach names for mapping - for r=0, config.IO.YZAverages.length do - [UTIL.emitPartitionNameAttach(rexpr s.p_Fluid_YZAvg[r] end, "p_Fluid_YZAvg")]; - end - for r=0, config.IO.XZAverages.length do - [UTIL.emitPartitionNameAttach(rexpr s.p_Fluid_XZAvg[r] end, "p_Fluid_XZAvg")]; - end - for r=0, config.IO.XYAverages.length do - [UTIL.emitPartitionNameAttach(rexpr s.p_Fluid_XYAvg[r] end, "p_Fluid_XYAvg")]; - end - - -- Destroy colors - regentlib.c.legion_domain_point_coloring_destroy(p_YZAvg_coloring) - regentlib.c.legion_domain_point_coloring_destroy(p_XZAvg_coloring) - regentlib.c.legion_domain_point_coloring_destroy(p_XYAvg_coloring) - - -- Extract relevant index spaces - var aux = region(p_All.colors, bool) - var [s.YZAvg_tiles] = [UTIL.mkExtractRelevantIspace("cross_product", int3d, int3d, Fluid_columns)] - (Fluid, Fluid_YZAvg, p_All, s.p_Fluid_YZAvg, aux) - var [s.XZAvg_tiles] = [UTIL.mkExtractRelevantIspace("cross_product", int3d, int3d, Fluid_columns)] - (Fluid, Fluid_XZAvg, p_All, s.p_Fluid_XZAvg, aux) - var [s.XYAvg_tiles] = [UTIL.mkExtractRelevantIspace("cross_product", int3d, int3d, Fluid_columns)] - (Fluid, Fluid_XYAvg, p_All, s.p_Fluid_XYAvg, aux) - ------------------------------------------------------------------------- -- 1D Averages ------------------------------------------------------------------------- @@ -803,9 +521,93 @@ function Exports.DeclSymbols(s, Grid, Fluid, p_All, config, MAPPER) (s.YAverages_copy, s.is_IO_XZplanes, int3d{Grid.xBnum,Grid.zBnum,0}, int3d{0,0,0}) var [s.IO_XYplanes_copy] = [UTIL.mkPartitionByTile(int3d, int3d, Averages_columns, "IO_XYplanes_copy")] (s.ZAverages_copy, s.is_IO_XYplanes, int3d{Grid.xBnum,Grid.yBnum,0}, int3d{0,0,0}) + end +end + +function Exports.InitPartitions(s, Grid, Fluid, p_All, config) + + local function ColorFluid(inp, color) return rquote + for p=0, [inp].length do + -- Clip rectangles from the input + var vol = [inp].values[p] + vol.fromCell[0] max= 0 + vol.fromCell[1] max= 0 + vol.fromCell[2] max= 0 + vol.uptoCell[0] min= config.Grid.xNum + 2*Grid.xBnum + vol.uptoCell[1] min= config.Grid.yNum + 2*Grid.yBnum + vol.uptoCell[2] min= config.Grid.zNum + 2*Grid.zBnum + -- add to the coloring + var rect = rect3d{ + lo = int3d{vol.fromCell[0], vol.fromCell[1], vol.fromCell[2]}, + hi = int3d{vol.uptoCell[0], vol.uptoCell[1], vol.uptoCell[2]}} + regentlib.c.legion_domain_point_coloring_color_domain(color, int1d(p), rect) + end + -- Add one point to avoid errors + if [inp].length == 0 then regentlib.c.legion_domain_point_coloring_color_domain(color, int1d(0), rect3d{lo = int3d{0,0,0}, hi = int3d{0,0,0}}) end + end end + return rquote + ------------------------------------------------------------------------- + -- 2D Averages + ------------------------------------------------------------------------- -- Partition the Fluid region based on the specified regions -- One color for each type of rakes + var p_YZAvg_coloring = regentlib.c.legion_domain_point_coloring_create() + var p_XZAvg_coloring = regentlib.c.legion_domain_point_coloring_create() + var p_XYAvg_coloring = regentlib.c.legion_domain_point_coloring_create(); + + -- Color X rakes + [ColorFluid(rexpr config.IO.YZAverages end, p_YZAvg_coloring)]; + -- Color Y rakes + [ColorFluid(rexpr config.IO.XZAverages end, p_XZAvg_coloring)]; + -- Color Z rakes + [ColorFluid(rexpr config.IO.XYAverages end, p_XYAvg_coloring)]; + + -- Make partions of Fluid + var Fluid_YZAvg = partition(aliased, Fluid, p_YZAvg_coloring, ispace(int1d, max(config.IO.YZAverages.length, 1))) + var Fluid_XZAvg = partition(aliased, Fluid, p_XZAvg_coloring, ispace(int1d, max(config.IO.XZAverages.length, 1))) + var Fluid_XYAvg = partition(aliased, Fluid, p_XYAvg_coloring, ispace(int1d, max(config.IO.XYAverages.length, 1))) + + -- Split over tiles + var [s.p_Fluid_YZAvg] = cross_product(Fluid_YZAvg, p_All) + var [s.p_Fluid_XZAvg] = cross_product(Fluid_XZAvg, p_All) + var [s.p_Fluid_XYAvg] = cross_product(Fluid_XYAvg, p_All) + + -- Attach names for mapping + for r=0, config.IO.YZAverages.length do + [UTIL.emitPartitionNameAttach(rexpr s.p_Fluid_YZAvg[r] end, "p_Fluid_YZAvg")]; + end + for r=0, config.IO.XZAverages.length do + [UTIL.emitPartitionNameAttach(rexpr s.p_Fluid_XZAvg[r] end, "p_Fluid_XZAvg")]; + end + for r=0, config.IO.XYAverages.length do + [UTIL.emitPartitionNameAttach(rexpr s.p_Fluid_XYAvg[r] end, "p_Fluid_XYAvg")]; + end + + -- Destroy colors + regentlib.c.legion_domain_point_coloring_destroy(p_YZAvg_coloring) + regentlib.c.legion_domain_point_coloring_destroy(p_XZAvg_coloring) + regentlib.c.legion_domain_point_coloring_destroy(p_XYAvg_coloring) + + -- Extract relevant index spaces + var aux = region(p_All.colors, bool) + var [s.YZAvg_tiles] = [UTIL.mkExtractRelevantIspace("cross_product", int3d, int3d, Fluid_columns)] + (Fluid, Fluid_YZAvg, p_All, s.p_Fluid_YZAvg, aux) + var [s.XZAvg_tiles] = [UTIL.mkExtractRelevantIspace("cross_product", int3d, int3d, Fluid_columns)] + (Fluid, Fluid_XZAvg, p_All, s.p_Fluid_XZAvg, aux) + var [s.XYAvg_tiles] = [UTIL.mkExtractRelevantIspace("cross_product", int3d, int3d, Fluid_columns)] + (Fluid, Fluid_XYAvg, p_All, s.p_Fluid_XYAvg, aux) + + -- Determine partitions for gradient operations + var [s.p_Gradient_YZAvg] = PART.PartitionAverageGhost(Fluid, p_All, Fluid_YZAvg, s.p_Fluid_YZAvg, config.IO.YZAverages.length) + var [s.p_Gradient_XZAvg] = PART.PartitionAverageGhost(Fluid, p_All, Fluid_XZAvg, s.p_Fluid_XZAvg, config.IO.XZAverages.length) + var [s.p_Gradient_XYAvg] = PART.PartitionAverageGhost(Fluid, p_All, Fluid_XYAvg, s.p_Fluid_XYAvg, config.IO.XYAverages.length) + + ------------------------------------------------------------------------- + -- 1D Averages + ------------------------------------------------------------------------- + -- Partition the Fluid region based on the specified regions + -- One color for each type of planes var p_XAvg_coloring = regentlib.c.legion_domain_point_coloring_create() var p_YAvg_coloring = regentlib.c.legion_domain_point_coloring_create() var p_ZAvg_coloring = regentlib.c.legion_domain_point_coloring_create(); @@ -851,6 +653,11 @@ function Exports.DeclSymbols(s, Grid, Fluid, p_All, config, MAPPER) (Fluid, Fluid_YAvg, p_All, s.p_Fluid_YAvg, aux) var [s.ZAvg_tiles] = [UTIL.mkExtractRelevantIspace("cross_product", int3d, int3d, Fluid_columns)] (Fluid, Fluid_ZAvg, p_All, s.p_Fluid_ZAvg, aux) + + -- Determine partitions for gradient operations of 2D averages + var [s.p_Gradient_XAvg] = PART.PartitionAverageGhost(Fluid, p_All, Fluid_XAvg, s.p_Fluid_XAvg, config.IO.XAverages.length) + var [s.p_Gradient_YAvg] = PART.PartitionAverageGhost(Fluid, p_All, Fluid_YAvg, s.p_Fluid_YAvg, config.IO.YAverages.length) + var [s.p_Gradient_ZAvg] = PART.PartitionAverageGhost(Fluid, p_All, Fluid_ZAvg, s.p_Fluid_ZAvg, config.IO.ZAverages.length) end end @@ -905,7 +712,7 @@ function Exports.ReadAverages(s, config) end end -function Exports.AddAverages(s, deltaTime, config, Mix) +function Exports.AddAverages(s, Fluid_bounds, deltaTime, config, Mix) local function Add2DAvg(dir) local avg local p1 @@ -928,14 +735,17 @@ function Exports.AddAverages(s, deltaTime, config, Mix) mk_c = function(c, rake) return rexpr int2d{c.z,rake} end end else assert(false) end local fp = "p_Fluid_"..p2 + local gp = "p_Gradient_"..p2 local t = p2.."_tiles" return rquote for rake=0, config.IO.[avg].length do var cs = s.[t][rake].ispace + var { p_GradientGhosts } = s.[gp][rake] __demand(__index_launch) for c in cs do - [mkAddAverages(dir)](s.[fp][rake][c], s.[p1][ [mk_c(c, rake)] ], - Mix, deltaTime) + [mkAddAverages(dir)](p_GradientGhosts[c], s.[fp][rake][c], + s.[p1][ [mk_c(c, rake)] ], Mix, + Fluid_bounds, deltaTime) end end end @@ -962,14 +772,17 @@ function Exports.AddAverages(s, deltaTime, config, Mix) mk_c = function(c, plane) return rexpr int3d{c.x, c.y, plane} end end else assert(false) end local fp = "p_Fluid_"..p2 + local gp = "p_Gradient_"..p2 local t = p2.."_tiles" return rquote for plane=0, config.IO.[avg].length do var cs = s.[t][plane].ispace + var { p_GradientGhosts } = s.[gp][plane] __demand(__index_launch) for c in cs do - [mkAdd1DAverages(dir)](s.[fp][plane][c], s.[p1][ [mk_c(c, plane)] ], - Mix, deltaTime) + [mkAdd1DAverages(dir)](p_GradientGhosts[c], s.[fp][plane][c], + s.[p1][ [mk_c(c, plane)] ], Mix, + Fluid_bounds, deltaTime) end end end @@ -986,7 +799,7 @@ function Exports.AddAverages(s, deltaTime, config, Mix) end end -function Exports.WriteAverages(s, tiles, dirname, IO, SpeciesNames, config) +function Exports.WriteAverages(_2, s, tiles, dirname, IO, SpeciesNames, config) local function write2DAvg(dir) local avg local p @@ -1006,7 +819,7 @@ function Exports.WriteAverages(s, tiles, dirname, IO, SpeciesNames, config) --------------------------------- var Avgdirname = [&int8](C.malloc(256)) format.snprint(Avgdirname, 256, "{}/{}", dirname, [avg]) - var _1 = IO.createDir(Avgdirname) + var _1 = IO.createDir(_2, Avgdirname) _1 = HDF_RAKES.dump( _1, s.[is], Avgdirname, s.[avg], s.[acopy], s.[p], s.[pcopy]) _1 = HDF_RAKES.write.SpeciesNames( _1, s.[is], Avgdirname, s.[avg], s.[p], SpeciesNames) C.free(Avgdirname) @@ -1036,7 +849,7 @@ function Exports.WriteAverages(s, tiles, dirname, IO, SpeciesNames, config) ---------------------------------------------- var Avgdirname = [&int8](C.malloc(256)) format.snprint(Avgdirname, 256, "{}/{}", dirname, [avg]) - var _1 = IO.createDir(Avgdirname) + var _1 = IO.createDir(_2, Avgdirname) _1 = HDF_PLANES.dump( _1, s.[is], Avgdirname, s.[avg], s.[acopy], s.[iop], s.[iopcopy]) _1 = HDF_PLANES.write.SpeciesNames( _1, s.[is], Avgdirname, s.[avg], s.[iop], SpeciesNames) C.free(Avgdirname) diff --git a/src/prometeo_average_types.h b/src/prometeo_average_types.h new file mode 100644 index 0000000..a75c7c3 --- /dev/null +++ b/src/prometeo_average_types.h @@ -0,0 +1,219 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_BC_TYPES_H__ +#define __PROMETEO_BC_TYPES_H__ + +#include "legion.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#include "prometeo_const.h" + +#ifndef nSpec + #error "nSpec is undefined" +#endif + +#ifndef nEq + #error "nEq is undefined" +#endif + +struct Averages_columns { + double weight; + // Grid point + double centerCoordinates[3]; + // Primitive variables + double pressure_avg; + double pressure_rms; + double temperature_avg; + double temperature_rms; + double MolarFracs_avg[nSpec]; + double MolarFracs_rms[nSpec]; + double MassFracs_avg[nSpec]; + double MassFracs_rms[nSpec]; + double velocity_avg[3]; + double velocity_rms[3]; + double velocity_rey[3]; + // Properties + double rho_avg; + double rho_rms; + double mu_avg; + double lam_avg; + double Di_avg[nSpec]; + double SoS_avg; + double cp_avg; + double Ent_avg; + // Electric variables +#ifdef ELECTRIC_FIELD + double electricPotential_avg; + double chargeDensity_avg; +#endif + // Chemical production rates + double ProductionRates_avg[nSpec]; + double ProductionRates_rms[nSpec]; + double HeatReleaseRate_avg; + double HeatReleaseRate_rms; + // Favre averaged primitives + double pressure_favg; + double pressure_frms; + double temperature_favg; + double temperature_frms; + double MolarFracs_favg[nSpec]; + double MolarFracs_frms[nSpec]; + double MassFracs_favg[nSpec]; + double MassFracs_frms[nSpec]; + double velocity_favg[3]; + double velocity_frms[3]; + double velocity_frey[3]; + // Favre averaged properties + double mu_favg; + double lam_favg; + double Di_favg[nSpec]; + double SoS_favg; + double cp_favg; + double Ent_favg; + // Kinetic energy budgets (y is the inhomogeneous direction) + double rhoUUv[3]; + double Up[3]; + double tau[6]; + double utau_y[3]; + double tauGradU[3]; + double pGradU[3]; + // Fluxes + double q[3]; + // Dimensionless numbers + double Pr; + double Pr_rms; + double Ec; + double Ec_rms; + double Ma; + double Sc[nSpec]; + // Correlations + double uT_avg[3]; + double uT_favg[3]; + double uYi_avg[nSpec]; + double vYi_avg[nSpec]; + double wYi_avg[nSpec]; + double uYi_favg[nSpec]; + double vYi_favg[nSpec]; + double wYi_favg[nSpec]; +}; + +// The order of this enum must match the declaration of Fluid_columns +enum Averages_FieldIDs { + // Average weight + AVE_FID_weight = 101, + // Grid point + AVE_FID_centerCoordinates, + // Primitive variables + AVE_FID_pressure_avg, + AVE_FID_pressure_rms, + AVE_FID_temperature_avg, + AVE_FID_temperature_rms, + AVE_FID_MolarFracs_avg, + AVE_FID_MolarFracs_rms, + AVE_FID_MassFracs_avg, + AVE_FID_MassFracs_rms, + AVE_FID_velocity_avg, + AVE_FID_velocity_rms, + AVE_FID_velocity_rey, + // Properties + AVE_FID_rho_avg, + AVE_FID_rho_rms, + AVE_FID_mu_avg, + AVE_FID_lam_avg, + AVE_FID_Di_avg, + AVE_FID_SoS_avg, + AVE_FID_cp_avg, + AVE_FID_Ent_avg, + // Electric variables +#ifdef ELECTRIC_FIELD + AVE_FID_electricPotential_avg, + AVE_FID_chargeDensity_avg, +#endif + // Chemical production rates + AVE_FID_ProductionRates_avg, + AVE_FID_ProductionRates_rms, + AVE_FID_HeatReleaseRate_avg, + AVE_FID_HeatReleaseRate_rms, + // Favre averaged primitives + AVE_FID_pressure_favg, + AVE_FID_pressure_frms, + AVE_FID_temperature_favg, + AVE_FID_temperature_frms, + AVE_FID_MolarFracs_favg, + AVE_FID_MolarFracs_frms, + AVE_FID_MassFracs_favg, + AVE_FID_MassFracs_frms, + AVE_FID_velocity_favg, + AVE_FID_velocity_frms, + AVE_FID_velocity_frey, + // Favre averaged properties + AVE_FID_mu_favg, + AVE_FID_lam_favg, + AVE_FID_Di_favg, + AVE_FID_SoS_favg, + AVE_FID_cp_favg, + AVE_FID_Ent_favg, + // Kinetic energy budgets (y is the inhomogeneous direction) + AVE_FID_rhoUUv, + AVE_FID_Up, + AVE_FID_tau, + AVE_FID_utau_y, + AVE_FID_tauGradU, + AVE_FID_pGradU, + // Fluxes + AVE_FID_q, + // Dimensionless numbers + AVE_FID_Pr, + AVE_FID_Pr_rms, + AVE_FID_Ec, + AVE_FID_Ec_rms, + AVE_FID_Ma, + AVE_FID_Sc, + // Correlations + AVE_FID_uT_avg, + AVE_FID_uT_favg, + AVE_FID_uYi_avg, + AVE_FID_vYi_avg, + AVE_FID_wYi_avg, + AVE_FID_uYi_favg, + AVE_FID_vYi_favg, + AVE_FID_wYi_favg, + // keep last for counting + AVE_FID_last +}; + +#ifdef __cplusplus +} +#endif + +#endif // __PROMETEO_BC_TYPES_H__ diff --git a/src/prometeo_bc.cc b/src/prometeo_bc.cc new file mode 100644 index 0000000..ce1c13e --- /dev/null +++ b/src/prometeo_bc.cc @@ -0,0 +1,460 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_bc.hpp" +#include "prometeo_variables.hpp" + +// AddRecycleAverageTask +/*static*/ const char * const AddRecycleAverageTask::TASK_NAME = "AddRecycleAverage"; +/*static*/ const int AddRecycleAverageTask::TASK_ID = TID_AddRecycleAverageBC; + +void AddRecycleAverageTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 4); + assert(futures.size() == 0); + + // Accessors for cellWidth + const AccessorRO< Vec3, 3> acc_cellWidth (regions[0], FID_cellWidth); + + // Accessors for profile variables + const AccessorRO acc_MolarFracs_profile (regions[0], FID_MolarFracs_profile); + const AccessorRO acc_temperature_profile (regions[0], FID_temperature_profile); + const AccessorRO< Vec3, 3> acc_velocity_profile (regions[0], FID_velocity_profile); + + // Accessors for averages + const AccessorSumRD acc_avg_rho (regions[1], RA_FID_rho, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_avg_temperature (regions[1], RA_FID_temperature, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_avg_MolarFracs (regions[2], RA_FID_MolarFracs, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 1> acc_avg_velocity (regions[3], RA_FID_velocity, REGENT_REDOP_SUM_VEC3); + + // Extract execution domain + Rect<3> r_plane = runtime->get_index_space_domain(ctx, args.plane.get_index_space()); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_plane.lo.z; k <= r_plane.hi.z; k++) + for (int j = r_plane.lo.y; j <= r_plane.hi.y; j++) + for (int i = r_plane.lo.x; i <= r_plane.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + collectAverages(acc_cellWidth, acc_MolarFracs_profile, + acc_temperature_profile, acc_velocity_profile, + acc_avg_MolarFracs, acc_avg_velocity, + acc_avg_temperature, acc_avg_rho, + args.Pbc, p, args.mix); + } +} + + +// SetNSCBC_InflowBCTask +template +void SetNSCBC_InflowBCTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessor for speed of sound + const AccessorRO acc_SoS (regions[0], FID_SoS); + + // Accessors for profile variables + const AccessorRO acc_MolarFracs_profile (regions[0], FID_MolarFracs_profile); + const AccessorRO acc_temperature_profile (regions[0], FID_temperature_profile); + const AccessorRO< Vec3, 3> acc_velocity_profile (regions[0], FID_velocity_profile); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_temperature (regions[1], FID_temperature); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Index of normal direction + constexpr int iN = normalIndex(dir); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) + for (int j = r_BC.lo.y; j <= r_BC.hi.y; j++) + for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + acc_MolarFracs[p] = acc_MolarFracs_profile[p]; + acc_temperature[p] = acc_temperature_profile[p]; + acc_velocity[p] = acc_velocity_profile[p]; + if (fabs(acc_velocity_profile[p][iN]) >= acc_SoS[p]) + // It is supersonic, everything is imposed by the BC + acc_pressure[p] = args.Pbc; + else + // Compute pressure from NSCBC conservation equations + setInflowPressure(acc_Conserved, acc_MolarFracs_profile, acc_temperature_profile, + acc_pressure, p, args.mix); + } +} + +// Specielize SetNSCBC_InflowBCTask for the X direction +template<> +/*static*/ const char * const SetNSCBC_InflowBCTask::TASK_NAME = "SetNSCBC_InflowBC"; +template<> +/*static*/ const int SetNSCBC_InflowBCTask::TASK_ID = TID_SetNSCBC_InflowBC_X; + +// Specielize SetNSCBC_InflowBCTask for the Y direction +template<> +/*static*/ const char * const SetNSCBC_InflowBCTask::TASK_NAME = "SetNSCBC_InflowBC"; +template<> +/*static*/ const int SetNSCBC_InflowBCTask::TASK_ID = TID_SetNSCBC_InflowBC_Y; + +// Specielize SetNSCBC_InflowBCTask for the Z direction +template<> +/*static*/ const char * const SetNSCBC_InflowBCTask::TASK_NAME = "SetNSCBC_InflowBC"; +template<> +/*static*/ const int SetNSCBC_InflowBCTask::TASK_ID = TID_SetNSCBC_InflowBC_Z; + +// SetNSCBC_OutflowBCTask +/*static*/ const char * const SetNSCBC_OutflowBCTask::TASK_NAME = "SetNSCBC_OutflowBC"; +/*static*/ const int SetNSCBC_OutflowBCTask::TASK_ID = TID_SetNSCBC_OutflowBC; + +void SetNSCBC_OutflowBCTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessors for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessors for temperature variables + const AccessorRW acc_temperature (regions[1], FID_temperature); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) + for (int j = r_BC.lo.y; j <= r_BC.hi.y; j++) + for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + UpdatePrimitiveFromConservedTask::UpdatePrimitive( + acc_Conserved, acc_temperature, acc_pressure, + acc_MolarFracs, acc_velocity, + p, args.mix); + } +} + +// SetIncomingShockBCTask +/*static*/ const char * const SetIncomingShockBCTask::TASK_NAME = "SetIncomingShockBC"; +/*static*/ const int SetIncomingShockBCTask::TASK_ID = TID_SetIncomingShockBC; + +void SetIncomingShockBCTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessor for speed of sound + const AccessorRO acc_SoS (regions[0], FID_SoS); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_temperature (regions[1], FID_temperature); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Precompute the mixture averaged molecular weight + VecNSp MolarFracs(args.params.MolarFracs); + const double MixW = args.mix.GetMolarWeightFromXi(MolarFracs); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) + for (int j = r_BC.lo.y; j <= r_BC.hi.y; j++) + for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + + if (i < args.params.iShock) { + // Set to upstream values + acc_MolarFracs[p] = MolarFracs; + acc_velocity[p] = Vec3(args.params.velocity0); + acc_temperature[p] = args.params.temperature0; + acc_pressure[p] = args.params.pressure0; + + } else if (i > args.params.iShock) { + // Treat this point as an NSCBCInflow + acc_MolarFracs[p] = MolarFracs; + acc_velocity[p] = Vec3(args.params.velocity1); + acc_temperature[p] = args.params.temperature1; + if (fabs(args.params.velocity1[1]) >= acc_SoS[p]) + // It is supersonic, everything is imposed by the BC + acc_pressure[p] = args.params.pressure1; + else + // Compute pressure from NSCBC conservation equations + acc_pressure[p] = setPressure(acc_Conserved, args.params.temperature1, MixW, p, args.mix); + + } else { + // Set to downstream values + acc_MolarFracs[p] = MolarFracs; + acc_velocity[p] = Vec3(args.params.velocity1); + acc_temperature[p] = args.params.temperature1; + acc_pressure[p] = args.params.pressure1; + + } + } +} + +// SetRecycleRescalingBCTask +/*static*/ const char * const SetRecycleRescalingBCTask::TASK_NAME = "SetRecycleRescalingBC"; +/*static*/ const int SetRecycleRescalingBCTask::TASK_ID = TID_SetRecycleRescalingBC; + +void SetRecycleRescalingBCTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 5); + assert(futures.size() == 1); + + // Accessor for speed of sound + const AccessorRO< Vec3, 3> acc_centerCoordinates (regions[0], FID_centerCoordinates); + + // Accessor for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessor for speed of sound + const AccessorRO acc_SoS (regions[0], FID_SoS); + + // Accessors for profile variables + const AccessorRO acc_MolarFracs_profile (regions[0], FID_MolarFracs_profile); + const AccessorRO acc_temperature_profile (regions[0], FID_temperature_profile); + const AccessorRO< Vec3, 3> acc_velocity_profile (regions[0], FID_velocity_profile); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_temperature (regions[1], FID_temperature); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Accessors for avg wall-normal coordinate + const AccessorRO acc_avg_y (regions[2], RA_FID_y); + + // Accessors for recycle plane variables + const AccessorRO acc_MolarFracs_recycle (regions[3], FID_MolarFracs_recycle); + const AccessorRO acc_temperature_recycle (regions[3], FID_temperature_recycle); + const AccessorRO< Vec3, 3> acc_velocity_recycle (regions[3], FID_velocity_recycle); + + // Accessors for fast interpolation region + const AccessorRO< float, 1> acc_FI_xloc (regions[4], FI_FID_xloc); + const AccessorRO< float, 1> acc_FI_iloc (regions[4], FI_FID_iloc); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Compute rescaling coefficients + const RescalingDataType RdataRe = futures[0].get_result(); + const double yInnFact = RdataRe.deltaNu /args.RdataIn.deltaNu; + const double yOutFact = RdataRe.delta99VD/args.RdataIn.delta99VD; + const double uInnFact = args.RdataIn.uTau/RdataRe.uTau; + const double uOutFact = uInnFact*sqrt(args.RdataIn.rhow/RdataRe.rhow); + + const double idelta99Inl = 1.0/args.RdataIn.delta99VD; + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) + for (int j = r_BC.lo.y; j <= r_BC.hi.y; j++) + for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + + // Compute the rescaled primitive quantities + double temperatureR; Vec3 velocityR; VecNSp MolarFracsR; + GetRescaled(temperatureR, velocityR, MolarFracsR, acc_centerCoordinates, + acc_temperature_recycle, acc_velocity_recycle, acc_MolarFracs_recycle, + acc_temperature_profile, acc_velocity_profile, acc_MolarFracs_profile, + acc_avg_y, acc_FI_xloc, acc_FI_iloc, args.FIdata, p, + yInnFact, yOutFact, uInnFact, uOutFact, idelta99Inl); + + // Set boundary conditions + acc_MolarFracs[p] = MolarFracsR; + acc_velocity[p] = velocityR; + acc_temperature[p] = temperatureR; + if (fabs(velocityR[0]) >= acc_SoS[p]) + // It is supersonic, everything is imposed by the BC + acc_pressure[p] = args.Pbc; + else + // Compute pressure from NSCBC conservation equations + acc_pressure[p] = setPressure(acc_Conserved, temperatureR, MolarFracsR, p, args.mix); + } +} + +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) +// CorrectIonsBCTask +template +void CorrectIonsBCTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for electric potential + const AccessorRO acc_ePot (regions[0], FID_electricPotential); + + // Accessors for primitive variables + const AccessorRW acc_MolarFracs (regions[1], FID_MolarFracs); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) + for (int j = r_BC.lo.y; j <= r_BC.hi.y; j++) + for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + const Point<3> pInt = getPIntBC(p); + const double dPhi = acc_ePot[pInt] - acc_ePot[p]; + for (int i = 0; i < nIons; i++) { + int ind = args.mix.ions[i]; + if (args.mix.GetSpeciesChargeNumber(ind)*dPhi > 0) + // the ion is flowing into the BC + acc_MolarFracs[p][ind] = acc_MolarFracs[pInt][ind]; + else + // the ion is repelled by the BC + acc_MolarFracs[p][ind] = 1e-60; + } + } +} + +// Specielize CorrectIonsBCTask for the X direction, Minus side +template<> +/*static*/ const char * const CorrectIonsBCTask::TASK_NAME = "CorrectIonsBCXNeg"; +template<> +/*static*/ const int CorrectIonsBCTask::TASK_ID = TID_CorrectIonsBCXNeg; + +// Specielize CorrectIonsBCTask for the X direction, Plus side +template<> +/*static*/ const char * const CorrectIonsBCTask::TASK_NAME = "CorrectIonsBCXPos"; +template<> +/*static*/ const int CorrectIonsBCTask::TASK_ID = TID_CorrectIonsBCXPos; + +// Specielize CorrectIonsBCTask for the Y direction, Minus side +template<> +/*static*/ const char * const CorrectIonsBCTask::TASK_NAME = "CorrectIonsBCYNeg"; +template<> +/*static*/ const int CorrectIonsBCTask::TASK_ID = TID_CorrectIonsBCYNeg; + +// Specielize CorrectIonsBCTask for the Y direction, Plus side +template<> +/*static*/ const char * const CorrectIonsBCTask::TASK_NAME = "CorrectIonsBCYPos"; +template<> +/*static*/ const int CorrectIonsBCTask::TASK_ID = TID_CorrectIonsBCYPos; + +// Specielize CorrectIonsBCTask for the Z direction, Minus side +template<> +/*static*/ const char * const CorrectIonsBCTask::TASK_NAME = "CorrectIonsBCZNeg"; +template<> +/*static*/ const int CorrectIonsBCTask::TASK_ID = TID_CorrectIonsBCZNeg; + +// Specielize CorrectIonsBCTask for the Z direction, Plus side +template<> +/*static*/ const char * const CorrectIonsBCTask::TASK_NAME = "CorrectIonsBCZPos"; +template<> +/*static*/ const int CorrectIonsBCTask::TASK_ID = TID_CorrectIonsBCZPos; +#endif + +void register_bc_tasks() { + + TaskHelper::register_hybrid_variants(); + + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + + TaskHelper::register_hybrid_variants(); + + TaskHelper::register_hybrid_variants(); + + TaskHelper::register_hybrid_variants(); + +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); +#endif +}; diff --git a/src/prometeo_bc.cu b/src/prometeo_bc.cu new file mode 100644 index 0000000..fa913d0 --- /dev/null +++ b/src/prometeo_bc.cu @@ -0,0 +1,645 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_bc.hpp" +#include "prometeo_variables.hpp" +#include "cuda_utils.hpp" + +// Declare a constant memory that will hold the Mixture struct (initialized in prometeo_mixture.cu) +extern __device__ __constant__ Mix mix; + +//----------------------------------------------------------------------------- +// KERNELS FOR AddRecycleAverageTask +//----------------------------------------------------------------------------- + +__global__ +void AddRecycleAverageTask_kernel(const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO MolarFracs_profile, + const AccessorRO temperature_profile, + const AccessorRO< Vec3, 3> velocity_profile, + const AccessorSumRD avg_MolarFracs, + const AccessorSumRD< Vec3, 1> avg_velocity, + const AccessorSumRD avg_temperature, + const AccessorSumRD avg_rho, + const double Pbc, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + AddRecycleAverageTask::collectAverages(cellWidth, + MolarFracs_profile, temperature_profile, velocity_profile, + avg_MolarFracs, avg_velocity, avg_temperature, + avg_rho, Pbc, p, mix); + } +} + +__host__ +void AddRecycleAverageTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 4); + assert(futures.size() == 0); + + // Accessors for cellWidth + const AccessorRO< Vec3, 3> acc_cellWidth (regions[0], FID_cellWidth); + + // Accessors for profile variables + const AccessorRO acc_MolarFracs_profile (regions[0], FID_MolarFracs_profile); + const AccessorRO acc_temperature_profile (regions[0], FID_temperature_profile); + const AccessorRO< Vec3, 3> acc_velocity_profile (regions[0], FID_velocity_profile); + + // Accessors for averages + const AccessorSumRD acc_avg_rho (regions[1], RA_FID_rho, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_avg_temperature (regions[1], RA_FID_temperature, LEGION_REDOP_SUM_FLOAT64); + const AccessorSumRD acc_avg_MolarFracs (regions[2], RA_FID_MolarFracs, REGENT_REDOP_SUM_VECNSP); + const AccessorSumRD< Vec3, 1> acc_avg_velocity (regions[3], RA_FID_velocity, REGENT_REDOP_SUM_VEC3); + + // Extract execution domain + Rect<3> r_plane = runtime->get_index_space_domain(ctx, args.plane.get_index_space()); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_plane); + const dim3 num_blocks_3d = dim3((getSize(r_plane) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_plane) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_plane) + (TPB_3d.z - 1)) / TPB_3d.z); + AddRecycleAverageTask_kernel<<>>(acc_cellWidth, + acc_MolarFracs_profile, acc_temperature_profile, acc_velocity_profile, + acc_avg_MolarFracs, acc_avg_velocity, acc_avg_temperature, acc_avg_rho, + args.Pbc, r_plane, + getSize(r_plane), getSize(r_plane), getSize(r_plane)); +} + +//----------------------------------------------------------------------------- +// KERNELS FOR SetNSCBC_InflowBC +//----------------------------------------------------------------------------- + +template +__global__ +void SetNSCBC_InflowBC_kernel(const AccessorRO Conserved, + const AccessorRO SoS, + const AccessorRO MolarFracs_profile, + const AccessorRO temperature_profile, + const AccessorRO< Vec3, 3> velocity_profile, + const AccessorWO pressure, + const AccessorWO temperature, + const AccessorWO MolarFracs, + const AccessorWO< Vec3, 3> velocity, + const double Pbc, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + // Index of normal direction + constexpr int iN = normalIndex(dir); + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + MolarFracs[p] = MolarFracs_profile[p]; + temperature[p] = temperature_profile[p]; + velocity[p] = velocity_profile[p]; + if (fabs(velocity_profile[p][iN]) >= SoS[p]) + // It is supersonic, everything is imposed by the BC + pressure[p] = Pbc; + else + // Compute pressure from NSCBC conservation equations + SetNSCBC_InflowBCTask::setInflowPressure( + Conserved, MolarFracs_profile, temperature_profile, + pressure, p, mix); + } +} + +template +__host__ +void SetNSCBC_InflowBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessor for speed of sound + const AccessorRO acc_SoS (regions[0], FID_SoS); + + // Accessors for profile variables + const AccessorRO acc_MolarFracs_profile (regions[0], FID_MolarFracs_profile); + const AccessorRO acc_temperature_profile (regions[0], FID_temperature_profile); + const AccessorRO< Vec3, 3> acc_velocity_profile (regions[0], FID_velocity_profile); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_temperature (regions[1], FID_temperature); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_BC); + const dim3 num_blocks_3d = dim3((getSize(r_BC) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_BC) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_BC) + (TPB_3d.z - 1)) / TPB_3d.z); + SetNSCBC_InflowBC_kernel<<>>(acc_Conserved, acc_SoS, + acc_MolarFracs_profile, acc_temperature_profile, acc_velocity_profile, + acc_pressure, acc_temperature, acc_MolarFracs, acc_velocity, + args.Pbc, r_BC, + getSize(r_BC), getSize(r_BC), getSize(r_BC)); +} + +template void SetNSCBC_InflowBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void SetNSCBC_InflowBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void SetNSCBC_InflowBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +//----------------------------------------------------------------------------- +// KERNELS FOR SetNSCBC_OutflowBC +//----------------------------------------------------------------------------- + +__global__ +void SetNSCBC_OutflowBC_kernel(const AccessorRO Conserved, + const AccessorRW temperature, + const AccessorWO pressure, + const AccessorWO MolarFracs, + const AccessorWO< Vec3, 3> velocity, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + UpdatePrimitiveFromConservedTask::UpdatePrimitive( + Conserved, temperature, pressure, + MolarFracs, velocity, + p, mix); + } +} + + +__host__ +void SetNSCBC_OutflowBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessors for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessors for temperature variables + const AccessorRW acc_temperature (regions[1], FID_temperature); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_BC); + const dim3 num_blocks_3d = dim3((getSize(r_BC) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_BC) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_BC) + (TPB_3d.z - 1)) / TPB_3d.z); + SetNSCBC_OutflowBC_kernel<<>>( + acc_Conserved, acc_temperature, acc_pressure, + acc_MolarFracs, acc_velocity, r_BC, + getSize(r_BC), getSize(r_BC), getSize(r_BC)); +} + +//----------------------------------------------------------------------------- +// KERNELS FOR SetIncomingShockBCTask +//----------------------------------------------------------------------------- + +__global__ +void SetIncomingShockBC_kernel(const AccessorRO Conserved, + const AccessorRO SoS, + const AccessorWO temperature, + const AccessorWO pressure, + const AccessorWO MolarFracs, + const AccessorWO< Vec3, 3> velocity, + const Vec3 velocity0, + const double temperature0, + const double pressure0, + const Vec3 velocity1, + const double temperature1, + const double pressure1, + const VecNSp MolarFracs0, + const double MixW, + const int iShock, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + if (p.x < iShock) { + // Set to upstream values + MolarFracs[p] = MolarFracs0; + velocity[p] = velocity0; + temperature[p] = temperature0; + pressure[p] = pressure0; + + } else if (p.x > iShock) { + // Treat this point as an NSCBCInflow + MolarFracs[p] = MolarFracs0; + velocity[p] = velocity1; + temperature[p] = temperature1; + if (fabs(velocity1[1]) >= SoS[p]) + // It is supersonic, everything is imposed by the BC + pressure[p] = pressure1; + else + // Compute pressure from NSCBC conservation equations + pressure[p] = SetIncomingShockBCTask::setPressure(Conserved, temperature1, MixW, p, mix); + + } else { + // Set to downstream values + MolarFracs[p] = MolarFracs0; + velocity[p] = velocity1; + temperature[p] = temperature1; + pressure[p] = pressure1; + + } + } +} + +__host__ +void SetIncomingShockBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessor for speed of sound + const AccessorRO acc_SoS (regions[0], FID_SoS); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_temperature (regions[1], FID_temperature); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Precompute the mixture averaged molecular weight + VecNSp MolarFracs(args.params.MolarFracs); + const double MixW = args.mix.GetMolarWeightFromXi(MolarFracs); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_BC); + const dim3 num_blocks_3d = dim3((getSize(r_BC) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_BC) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_BC) + (TPB_3d.z - 1)) / TPB_3d.z); + SetIncomingShockBC_kernel<<>>( + acc_Conserved, acc_SoS, + acc_temperature, acc_pressure, acc_MolarFracs, acc_velocity, + Vec3(args.params.velocity0), args.params.temperature0, args.params.pressure0, + Vec3(args.params.velocity1), args.params.temperature1, args.params.pressure1, + MolarFracs, MixW, args.params.iShock, + r_BC, getSize(r_BC), getSize(r_BC), getSize(r_BC)); +} + +//----------------------------------------------------------------------------- +// KERNELS FOR SetRecycleRescalingBCTask +//----------------------------------------------------------------------------- + +#ifdef BOUNDS_CHECKS + // See Legion issue #879 for more info + #warning "CUDA variant of RecycleRescalingBC is not available with BOUNDS_CHECKS" +#else +__global__ +void SetRecycleRescalingBC_kernel(const AccessorRO< Vec3, 3> centerCoordinates, + const AccessorRO Conserved, + const AccessorRO SoS, + const AccessorWO temperature, + const AccessorWO pressure, + const AccessorWO MolarFracs, + const AccessorWO< Vec3, 3> velocity, + const AccessorRO temperature_recycle, + const AccessorRO< Vec3, 3> velocity_recycle, + const AccessorRO MolarFracs_recycle, + const AccessorRO temperature_profile, + const AccessorRO< Vec3, 3> velocity_profile, + const AccessorRO MolarFracs_profile, + const AccessorRO avg_y, + const AccessorRO< float, 1> FI_xloc, + const AccessorRO< float, 1> FI_iloc, + const FastInterpData FIdata, + const double Pbc, + const double yInnFact, + const double yOutFact, + const double uInnFact, + const double uOutFact, + const double idelta99Inl, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + + // Compute the rescaled primitive quantities + double temperatureR; Vec3 velocityR; VecNSp MolarFracsR; + SetRecycleRescalingBCTask::GetRescaled( + temperatureR, velocityR, MolarFracsR, centerCoordinates, + temperature_recycle, velocity_recycle, MolarFracs_recycle, + temperature_profile, velocity_profile, MolarFracs_profile, + avg_y, FI_xloc, FI_iloc, FIdata, p, + yInnFact, yOutFact, uInnFact, uOutFact, idelta99Inl); + + MolarFracs[p] = MolarFracsR; + temperature[p] = temperatureR; + velocity[p] = velocityR; + if (fabs(velocityR[0]) >= SoS[p]) + // It is supersonic, everything is imposed by the BC + pressure[p] = Pbc; + else + // Compute pressure from NSCBC conservation equations + pressure[p] = SetRecycleRescalingBCTask::setPressure(Conserved, temperatureR, MolarFracsR, p, mix); + } +} +#endif + +__host__ +void SetRecycleRescalingBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ +#ifdef BOUNDS_CHECKS + // See Legion issue #879 for more info + #warning "CUDA variant of RecycleRescalingBC is not available with BOUNDS_CHECKS" +#else + assert(regions.size() == 5); + assert(futures.size() == 1); + + // Accessor for speed of sound + const AccessorRO< Vec3, 3> acc_centerCoordinates (regions[0], FID_centerCoordinates); + + // Accessor for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessor for speed of sound + const AccessorRO acc_SoS (regions[0], FID_SoS); + + // Accessors for profile variables + const AccessorRO acc_MolarFracs_profile (regions[0], FID_MolarFracs_profile); + const AccessorRO acc_temperature_profile (regions[0], FID_temperature_profile); + const AccessorRO< Vec3, 3> acc_velocity_profile (regions[0], FID_velocity_profile); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_temperature (regions[1], FID_temperature); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Accessors for avg wall-normal coordinate + const AccessorRO acc_avg_y (regions[2], RA_FID_y); + + // Accessors for recycle plane variables + const AccessorRO acc_MolarFracs_recycle (regions[3], FID_MolarFracs_recycle); + const AccessorRO acc_temperature_recycle (regions[3], FID_temperature_recycle); + const AccessorRO< Vec3, 3> acc_velocity_recycle (regions[3], FID_velocity_recycle); + + // Accessors for fast interpolation region + const AccessorRO< float, 1> acc_FI_xloc (regions[4], FI_FID_xloc); + const AccessorRO< float, 1> acc_FI_iloc (regions[4], FI_FID_iloc); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Compute rescaling coefficients + const RescalingDataType RdataRe = futures[0].get_result(); + const double yInnFact = RdataRe.deltaNu /args.RdataIn.deltaNu; + const double yOutFact = RdataRe.delta99VD/args.RdataIn.delta99VD; + const double uInnFact = args.RdataIn.uTau/RdataRe.uTau; + const double uOutFact = uInnFact*sqrt(args.RdataIn.rhow/RdataRe.rhow); + + const double idelta99Inl = 1.0/args.RdataIn.delta99VD; + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_BC); + const dim3 num_blocks_3d = dim3((getSize(r_BC) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_BC) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_BC) + (TPB_3d.z - 1)) / TPB_3d.z); + SetRecycleRescalingBC_kernel<<>>( + acc_centerCoordinates, acc_Conserved, acc_SoS, + acc_temperature, acc_pressure, acc_MolarFracs, acc_velocity, + acc_temperature_recycle, acc_velocity_recycle, acc_MolarFracs_recycle, + acc_temperature_profile, acc_velocity_profile, acc_MolarFracs_profile, + acc_avg_y, acc_FI_xloc, acc_FI_iloc, args.FIdata, args.Pbc, + yInnFact, yOutFact, uInnFact, uOutFact, idelta99Inl, + r_BC, getSize(r_BC), getSize(r_BC), getSize(r_BC)); +#endif +} + +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) +//----------------------------------------------------------------------------- +// KERNELS FOR CorrectIonsBCTask +//----------------------------------------------------------------------------- + +template +__global__ +void CorrectIonsBC_kernel(const AccessorRO ePot, + const AccessorRW MolarFracs, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + const Point<3> pInt = getPIntBC(p); + const double dPhi = ePot[pInt] - ePot[p]; + __UNROLL__ + for (int i = 0; i < nIons; i++) { + int ind = mix.ions[i]; + if (mix.GetSpeciesChargeNumber(ind)*dPhi > 0) + // the ion is flowing into the BC + MolarFracs[p][ind] = MolarFracs[pInt][ind]; + else + // the ion is repelled by the BC + MolarFracs[p][ind] = 1e-60; + } + } +} + +template +__host__ +void CorrectIonsBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for electric potential + const AccessorRO acc_ePot (regions[0], FID_electricPotential); + + // Accessors for primitive variables + const AccessorRW acc_MolarFracs (regions[1], FID_MolarFracs); + + // Extract execution domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_BC); + const dim3 num_blocks_3d = dim3((getSize(r_BC) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_BC) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_BC) + (TPB_3d.z - 1)) / TPB_3d.z); + CorrectIonsBC_kernel<<>>( + acc_ePot, acc_MolarFracs, + r_BC, getSize(r_BC), getSize(r_BC), getSize(r_BC)); +}; + +template void CorrectIonsBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void CorrectIonsBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void CorrectIonsBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void CorrectIonsBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void CorrectIonsBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void CorrectIonsBCTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif + diff --git a/src/AirMix.hpp b/src/prometeo_bc.h similarity index 90% rename from src/AirMix.hpp rename to src/prometeo_bc.h index d4d5e82..d8da975 100644 --- a/src/AirMix.hpp +++ b/src/prometeo_bc.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,10 +27,19 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef AirMix_HPP -#define AirMix_HPP +#ifndef __PROMETEO_BC_H__ +#define __PROMETEO_BC_H__ -#include "AirMix.h" -#include "MultiComponent.hpp" +#include "legion.h" -#endif // AirMix_HPP +#ifdef __cplusplus +extern "C" { +#endif + +void register_bc_tasks(); + +#ifdef __cplusplus +} +#endif + +#endif // __PROMETEO_BC_H__ diff --git a/src/prometeo_bc.hpp b/src/prometeo_bc.hpp new file mode 100644 index 0000000..614262e --- /dev/null +++ b/src/prometeo_bc.hpp @@ -0,0 +1,426 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_BC_HPP__ +#define __PROMETEO_BC_HPP__ + +#include "legion.h" + +using namespace Legion; + +//----------------------------------------------------------------------------- +// LOAD PROMETEO UTILITIES AND MODULES +//----------------------------------------------------------------------------- + +#include "my_array.hpp" +#include "math_utils.hpp" +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" +#include "prometeo_types.h" +#include "prometeo_bc.h" +#include "prometeo_bc_types.h" +#include "prometeo_redop.inl" + +//----------------------------------------------------------------------------- +// TASK THAT COLLECTS THE SPATIAL AVERAGES FOR RECYCLE/RESCALING BC +//----------------------------------------------------------------------------- + +class AddRecycleAverageTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion plane; + LogicalRegion avg; + Mix mix; + double Pbc; + FieldID plane_fields [FID_last - 101]; + RA_FieldIDs avg_fields [RA_FID_last - 101]; + }; +public: + __CUDA_H__ + static inline void collectAverages(const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &MolarFracs_profile, + const AccessorRO &temperature_profile, + const AccessorRO< Vec3, 3> &velocity_profile, + const AccessorSumRD &avg_MolarFracs, + const AccessorSumRD< Vec3, 1> &avg_velocity, + const AccessorSumRD &avg_temperature, + const AccessorSumRD &avg_rho, + const double Pbc, + const Point<3> &p, + const Mix &mix) { + const double vol = cellWidth[p][0]*cellWidth[p][1]*cellWidth[p][2]; + const double MixW = mix.GetMolarWeightFromXi(MolarFracs_profile[p]); + const double rho = mix.GetRho(Pbc, temperature_profile[p], MixW); + double rvol = vol*rho; + avg_rho [p.y] <<= rvol; + avg_temperature[p.y] <<= temperature_profile[p]*rvol; + avg_MolarFracs [p.y] <<= MolarFracs_profile[p]*rvol; + avg_velocity [p.y] <<= velocity_profile[p]*rvol; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT UPDATES THE PRIMITIVE VARIABLES OF A NSCBC INFLOW +//----------------------------------------------------------------------------- + +template +class SetNSCBC_InflowBCTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalPartition Fluid_BC; + Mix mix; + double Pbc; + FieldID Fluid_fields [FID_last - 101]; + }; +public: + __CUDA_H__ + static inline void setInflowPressure(const AccessorRO &Conserved, + const AccessorRO &MolarFracs_profile, + const AccessorRO &temperature_profile, + const AccessorWO &pressure, + const Point<3> &p, + const Mix &mix) { + VecNSp rhoYi; + __UNROLL__ + for (int i=0; i ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + + +//----------------------------------------------------------------------------- +// TASK THAT UPDATES THE PRIMITIVE VARIABLES OF A NSCBC OUTFLOW +//----------------------------------------------------------------------------- + +class SetNSCBC_OutflowBCTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalPartition Fluid_BC; + Mix mix; + FieldID Fluid_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT UPDATES THE PRIMITIVE VARIABLES OF AN INCOMING SHOCK BC +//----------------------------------------------------------------------------- + +class SetIncomingShockBCTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalPartition Fluid_BC; + IncomingShockParams params; + Mix mix; + FieldID Fluid_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + __CUDA_H__ + static inline double setPressure(const AccessorRO &Conserved, + const double temperature, + const double MixW, + const Point<3> &p, + const Mix &mix) { + VecNSp rhoYi; + __UNROLL__ + for (int i=0; i ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT UPDATES THE PRIMITIVE VARIABLES OF AN RECYCLE RESCALING BC +//----------------------------------------------------------------------------- + +class SetRecycleRescalingBCTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalPartition Fluid_BC; + LogicalRegion avg; + LogicalRegion BC_interp; + LogicalRegion FIregion; + FastInterpData FIdata; + RescalingDataType RdataIn; + RescalingDataType RdataRe; + Mix mix; + double Pbc; + FieldID Fluid_fields [FID_last - 101]; + RA_FieldIDs avg_fields [RA_FID_last - 101]; + FieldID BC_interp_fields [FID_last - 101]; + FI_FieldIDs FIregion_fields [FI_FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +private: + __CUDA_H__ + static inline double interp(const double x1, const double x2, const double w) { + return x1*w + x2*(1.0 - w); + } + + __CUDA_H__ + static inline void interpAll(double &t, + Vec3 &v, + VecNSp &Xi, + const AccessorRO &temperature_recycle, + const AccessorRO< Vec3, 3> &velocity_recycle, + const AccessorRO &MolarFracs_recycle, + const AccessorRO &avg_y, + const AccessorRO< float, 1> &FI_xloc, + const AccessorRO< float, 1> &FI_iloc, + const FastInterpData &FIdata, + const Point<3> &p, + const double yR, + const double uFact) { + const coord_t pAvg = FastInterpFindIndex(yR, FI_xloc, FI_iloc, FIdata); + const coord_t pAp1 = pAvg + 1; + const Point<3> pInt = Point<3>(p.x, pAvg, p.z); + const Point<3> pIp1 = Point<3>(p.x, pAp1, p.z); + const double w = (avg_y[pAp1] - yR)/(avg_y[pAp1] - avg_y[pAvg]); + t = interp(temperature_recycle[pInt], temperature_recycle[pIp1], w); + __UNROLL__ + for (int i=0; i<3; i++) + v[i] = interp(velocity_recycle[pInt][i], velocity_recycle[pIp1][i], w)*uFact; + __UNROLL__ + for (int i=0; i 1.0) return 1.0; + // blend otherwise + const double rnum = alpha*(x-b); + const double rden = b + (1.0-2.0*b)*x; + return 0.5*(1.0 + tanh(rnum/rden)/tanh(alpha)); + } + + __CUDA_H__ + static inline double bernardinidamp(const double x) { + return 0.5*(1.0 - tanh(5.0*(x-1.75))); + } + +public: + __CUDA_H__ + static inline void GetRescaled(double &t, + Vec3 &v, + VecNSp &Xi, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const AccessorRO &temperature_recycle, + const AccessorRO< Vec3, 3> &velocity_recycle, + const AccessorRO &MolarFracs_recycle, + const AccessorRO &temperature_profile, + const AccessorRO< Vec3, 3> &velocity_profile, + const AccessorRO &MolarFracs_profile, + const AccessorRO &avg_y, + const AccessorRO< float, 1> &FI_xloc, + const AccessorRO< float, 1> &FI_iloc, + const FastInterpData &FIdata, + const Point<3> &p, + const double yInnFact, + const double yOutFact, + const double uInnFact, + const double uOutFact, + const double idelta99Inl) { + // Wall-normal distance + const double wnDist = centerCoordinates[p][1]; + + // Interpolate fluctuations based on the inner scaling + double temperatureInn; Vec3 velocityInn; VecNSp MolarFracsInn; + interpAll(temperatureInn, velocityInn, MolarFracsInn, + temperature_recycle, velocity_recycle, MolarFracs_recycle, + avg_y, FI_xloc, FI_iloc, FIdata, + p, wnDist*yInnFact, uInnFact); + + // Interpolate fluctuations based on the inner scaling + double temperatureOut; Vec3 velocityOut; VecNSp MolarFracsOut; + interpAll(temperatureOut, velocityOut, MolarFracsOut, + temperature_recycle, velocity_recycle, MolarFracs_recycle, + avg_y, FI_xloc, FI_iloc, FIdata, + p, wnDist*yOutFact, uOutFact); + + // Blend the results, multiply by free-stream dumping, and add mean profiles + const double etaInl = centerCoordinates[p][1]*idelta99Inl; + const double w = weightf(etaInl); + const double damp = bernardinidamp(etaInl); + t = interp(temperatureOut, temperatureInn, w)*damp + temperature_profile[p]; + __UNROLL__ + for (int i=0; i<3; i++) + v[i] = interp(velocityOut[i], velocityInn[i], w)*damp + velocity_profile[p][i]; + __UNROLL__ + for (int i=0; i &Conserved, + const double temperature, + const VecNSp &MolarFracs, + const Point<3> &p, + const Mix &mix) { + VecNSp rhoYi; + __UNROLL__ + for (int i=0; i ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) +//----------------------------------------------------------------------------- +// TASK THAT CORRRECTS THE BOUNDARY CONDITIONS FOR CHARGED SPECIES +//----------------------------------------------------------------------------- + +template +class CorrectIonsBCTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalPartition Fluid_BC; + Mix mix; + FieldID Fluid_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +#endif + +#endif // __PROMETEO_BC_HPP__ diff --git a/src/prometeo_bc.rg b/src/prometeo_bc.rg index a89ecd5..fd3bf5c 100644 --- a/src/prometeo_bc.rg +++ b/src/prometeo_bc.rg @@ -29,13 +29,15 @@ import "regent" -return function(SCHEMA, MIX, CHEM, Fluid_columns, zones_partitions, DEBUG_OUTPUT) local Exports = {} +return function(SCHEMA, MIX, TYPES, zones_partitions, + ELECTRIC_FIELD) local Exports = {} ------------------------------------------------------------------------------- -- IMPORTS ------------------------------------------------------------------------------- local C = regentlib.c local MAPPER = terralib.includec("prometeo_mapper.h") +local BC_TYPES = terralib.includec("prometeo_bc_types.h", {"-DEOS="..os.getenv("EOS")}) local UTIL = require 'util-desugared' local MATH = require 'math_utils' local CONST = require "prometeo_const" @@ -52,6 +54,8 @@ local fabs = regentlib.fabs(double) local sqrt = regentlib.sqrt(double) local atan = regentlib.atan(double) +local Fluid_columns = TYPES.Fluid_columns + -- Variable indices local nSpec = MIX.nSpec -- Number of species composing the mixture local irU = CONST.GetirU(MIX) -- Index of the momentum in Conserved vector @@ -67,58 +71,19 @@ local RecycleVars = CONST.RecycleVars -- DATA STRUCTURES ------------------------------------------------------------------------------- -local struct IncomingShockParams { - -- Index where the shock will be injected - iShock : int; - -- Constant mixture composition - MolarFracs : double[nSpec]; - -- Primitive variables upstream of the shock - pressure0 : double; - temperature0 : double; - velocity0 : double[3]; - -- Primitive variables downstream of the shock - pressure1 : double; - temperature1 : double; - velocity1 : double[3]; -} +-- IncomingShock data types +local IncomingShockParams = BC_TYPES.IncomingShockParams -local struct RecycleAverageType { - -- Average weight - w : double; - -- Distance from the wall - y : double; - -- Properties - rho : double; - -- Primitive variables - temperature : double; - MolarFracs : double[nSpec]; - velocity : double[3]; -} +-- RecycleRescaling data types +local RecycleAverageType = BC_TYPES.RecycleAverageType +local BLDataType = BC_TYPES.BLDataType +local RescalingDataType = BC_TYPES.RescalingDataType -- Load fast interpolation tool local FIData, FIType, FIInitData, FIInitRegion, FIFindIndex, FIGetWeight = unpack(MATH.mkFastInterp(RecycleAverageType, "y")) --- Boundary layer data -local struct BLDataType { - Uinf : double; - aVD : double; - bVD : double; - QVD : double; - Ueq : double; -} - --- Rescaling data -local struct RescalingDataType { - -- Data for outer scaling - delta99VD : double; - -- Data for inner scaling - rhow : double; - uTau : double; - deltaNu : double; -} - local fspace RecycleRescalingParams(Fluid : region(ispace(int3d), Fluid_columns), tiles : ispace(int3d)) { -- Recycling plane BCPlane : partition(disjoint, Fluid, tiles), @@ -210,7 +175,7 @@ task RHresidual(nu : double, var un1 = RHgetUn1(nu, un0) var rho1 = RHgetrho1(nu, rho0) var P1 = RHgetP1(nu, P0, un0, rho0) - var T1 = MIX.GetTFromRhoAndP(rho1, MixW, P1) + var T1 = MIX.GetTFromRhoAndP(rho1, MixW, P1, Mix) return RHgetH1(nu, h0, un0) - MIX.GetEnthalpy(T1, Yi, Mix) end @@ -225,7 +190,7 @@ task InitIncomingShockParams(config : SCHEMA.Config, Mix : MIX.Mixture) -- Shock angle input.beta *= PI/180 - params.MolarFracs = CHEM.ParseConfigMixture(input.Mixture, Mix) + params.MolarFracs = MIX.ParseConfigMixture(input.Mixture, Mix) -- Primitive variables upstream of the shock params.pressure0 = input.pressure0 @@ -233,7 +198,7 @@ task InitIncomingShockParams(config : SCHEMA.Config, Mix : MIX.Mixture) params.velocity0 = input.velocity0 var MixW = MIX.GetMolarWeightFromXi(params.MolarFracs, Mix) - var Yi = MIX.GetMassFractions(MixW, params.MolarFracs, Mix) + var Yi : double[nSpec]; MIX.GetMassFractions(Yi, MixW, params.MolarFracs, Mix) var h0 = MIX.GetEnthalpy(params.temperature0, Yi, Mix) var rho0 = MIX.GetRho(params.pressure0, params.temperature0, MixW, Mix) var theta0 = getThetaFromU(params.velocity0) @@ -257,7 +222,7 @@ task InitIncomingShockParams(config : SCHEMA.Config, Mix : MIX.Mixture) var rho1 = RHgetrho1(nu, rho0) var un1 = RHgetUn1(nu, un0) params.pressure1 = RHgetP1(nu, params.pressure0, un0, rho0) - params.temperature1 = MIX.GetTFromRhoAndP(rho1, MixW, params.pressure1) + params.temperature1 = MIX.GetTFromRhoAndP(rho1, MixW, params.pressure1, Mix) var theta1 = RHgetTheta1(nu, input.beta, theta0) var u1 = getUFromUn(un1, input.beta, theta1) params.velocity1 = array(u1[0], u1[1], params.velocity0[2]) @@ -389,7 +354,7 @@ do var MolarFracsinf = avg[cinf].MolarFracs for i=0, nSpec do MolarFracsinf[i] /= avg[cinf].rho end var MixWinf = MIX.GetMolarWeightFromXi(MolarFracsinf, mix) - var Yiinf = MIX.GetMassFractions(MixWinf, MolarFracsinf, mix) + var Yiinf : double[nSpec]; MIX.GetMassFractions(Yiinf, MixWinf, MolarFracsinf, mix) var gammainf = MIX.GetGamma(Tinf, MixWinf, Yiinf, mix) var Mainf = Uinf/MIX.GetSpeedOfSound(Tinf, gammainf, MixWinf, mix) var muinf = MIX.GetViscosity( Tinf, MolarFracsinf, mix) @@ -502,9 +467,9 @@ local mkAddRecycleAverage = terralib.memoize(function(op) where reads(plane.cellWidth), reads(plane.rho), - reads(plane.{temperature, MolarFracs, velocity}), + reads(plane.{temperature, velocity, MolarFracs}), reduces+(avg.rho), - reduces+(avg.{temperature, MolarFracs, velocity}) + reduces+(avg.{temperature, velocity, MolarFracs}) do __demand(__openmp) for c in plane do @@ -520,32 +485,17 @@ local mkAddRecycleAverage = terralib.memoize(function(op) end end elseif (op == "BC") then - __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED - task AddRecycleAverage(plane : region(ispace(int3d), Fluid_columns), - avg : region(ispace(int1d), RecycleAverageType), - mix : MIX.Mixture, - Pbc : double) + extern task AddRecycleAverage(plane : region(ispace(int3d), Fluid_columns), + avg : region(ispace(int1d), RecycleAverageType), + mix : MIX.Mixture, + Pbc : double) where reads(plane.cellWidth), reads(plane.[ProfilesVars]), reduces+(avg.rho), - reduces+(avg.{temperature, MolarFracs, velocity}) - do - __demand(__openmp) - for c in plane do - var c_avg = int1d(c.y) - var vol = (plane[c].cellWidth[0]* - plane[c].cellWidth[1]* - plane[c].cellWidth[2]) - var MixW = MIX.GetMolarWeightFromXi(plane[c].MolarFracs_profile, mix) - var rho = MIX.GetRho(Pbc, plane[c].temperature_profile, MixW, mix) - var rvol = vol*rho - avg[c_avg].rho += rho*vol - avg[c_avg].temperature += plane[c].temperature_profile*rvol - avg[c_avg].MolarFracs += plane[c].MolarFracs_profile *[UTIL.mkArrayConstant(nSpec, rvol)] - avg[c_avg].velocity += plane[c].velocity_profile *[UTIL.mkArrayConstant( 3, rvol)] - end + reduces+(avg.{temperature, velocity, MolarFracs}) end + AddRecycleAverage:set_task_id(TYPES.TID_AddRecycleAverageBC) else assert(false) end return AddRecycleAverage end) @@ -828,7 +778,10 @@ function Exports.CheckInput(BC, config) return rquote -- Set up flow BC's in y direction if (not((config.BC.yBCLeft.type == SCHEMA.FlowBC_Periodic) and (config.BC.yBCRight.type == SCHEMA.FlowBC_Periodic))) then - if (config.BC.yBCLeft.type == SCHEMA.FlowBC_NSCBC_Outflow) then + if (config.BC.yBCLeft.type == SCHEMA.FlowBC_NSCBC_Inflow) then + [CheckNSCBC_Inflow(BC, rexpr config.BC.yBCLeft.u.NSCBC_Inflow end)]; + + elseif (config.BC.yBCLeft.type == SCHEMA.FlowBC_NSCBC_Outflow) then -- Do nothing elseif (config.BC.yBCLeft.type == SCHEMA.FlowBC_Dirichlet) then @@ -958,8 +911,7 @@ end end -- Set up stuff for RHS of NSCBC inflow local __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED task InitializeGhostNSCBC(Fluid : region(ispace(int3d), Fluid_columns), - Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), - mix : MIX.Mixture) + Fluid_BC : partition(disjoint, Fluid, ispace(int1d))) where reads(Fluid.[Primitives]), writes(Fluid.{velocity_old_NSCBC, temperature_old_NSCBC}) @@ -986,14 +938,14 @@ function Exports.InitBCs(BC, Fluid_Zones, config, Mix) return rquote (config.BC.xBCLeft.type == SCHEMA.FlowBC_RecycleRescaling))then __demand(__index_launch) for c in xNeg_ispace do - InitializeGhostNSCBC(p_All[c], p_xNeg[c], Mix) + InitializeGhostNSCBC(p_All[c], p_xNeg[c]) end end if config.BC.yBCRight.type == SCHEMA.FlowBC_IncomingShock then __demand(__index_launch) for c in yPos_ispace do - InitializeGhostNSCBC(p_All[c], p_yPos[c], Mix) + InitializeGhostNSCBC(p_All[c], p_yPos[c]) end end @@ -1063,87 +1015,35 @@ end local mkSetNSCBC_InflowBC = terralib.memoize(function(dir) local SetNSCBC_InflowBC - local idx - if dir == "x" then - idx = 0 - elseif dir == "y" then - idx = 1 - elseif dir == "z" then - idx = 2 - end - -- NOTE: It is safe to not pass the ghost regions to this task, because we - -- always group ghost cells with their neighboring interior cells. - local __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED - task SetNSCBC_InflowBC(Fluid : region(ispace(int3d), Fluid_columns), - Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), - mix : MIX.Mixture, - Pbc : double) + extern task SetNSCBC_InflowBC(Fluid : region(ispace(int3d), Fluid_columns), + Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), + mix : MIX.Mixture, + Pbc : double) where reads(Fluid.SoS), reads(Fluid.Conserved), reads(Fluid.[ProfilesVars]), writes(Fluid.[Primitives]) - do - var BC = Fluid_BC[0] - __demand(__openmp) - for c in BC do - BC[c].MolarFracs = BC[c].MolarFracs_profile - BC[c].velocity = BC[c].velocity_profile - BC[c].temperature = BC[c].temperature_profile - if (BC[c].velocity_profile[idx] >= BC[c].SoS) then - -- It is supersonic, everything is imposed by the BC - BC[c].pressure = Pbc - else - -- Compute pressure from NSCBC conservation equations - var rhoYi : double[nSpec] - for i=0, nSpec do - rhoYi[i] = BC[c].Conserved[i] - end - var rho = MIX.GetRhoFromRhoYi(rhoYi) - var MixW = MIX.GetMolarWeightFromXi(BC[c].MolarFracs_profile, mix) - BC[c].pressure = MIX.GetPFromRhoAndT(rho, MixW, BC[c].temperature_profile) - end - - end + end + if dir == "x" then + SetNSCBC_InflowBC:set_task_id(TYPES.TID_SetNSCBC_InflowBC_X) + elseif dir == "y" then + SetNSCBC_InflowBC:set_task_id(TYPES.TID_SetNSCBC_InflowBC_Y) + elseif dir == "z" then + SetNSCBC_InflowBC:set_task_id(TYPES.TID_SetNSCBC_InflowBC_Z) end return SetNSCBC_InflowBC end) -local __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED -task SetNSCBC_OutflowBC(Fluid : region(ispace(int3d), Fluid_columns), - Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), - mix : MIX.Mixture) +local extern task SetNSCBC_OutflowBC(Fluid : region(ispace(int3d), Fluid_columns), + Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), + mix : MIX.Mixture) where reads(Fluid.Conserved), reads(Fluid.temperature), writes(Fluid.[Primitives]) -do - var BC = Fluid_BC[0] - var BCst = Fluid_BC[1] - - __demand(__openmp) - for c in BC do - -- Compute values from NSCBC conservation equations - var rhoYi : double[nSpec] - for i=0, nSpec do - rhoYi[i] = BC[c].Conserved[i] - end - var rho = MIX.GetRhoFromRhoYi(rhoYi) - var Yi = MIX.GetYi(rho, rhoYi) - Yi = MIX.ClipYi(Yi) - var MixW = MIX.GetMolarWeightFromYi(Yi, mix) - BC[c].MolarFracs = MIX.GetMolarFractions(MixW, Yi, mix) - var rhoInv = 1.0/rho; - var velocity = array(BC[c].Conserved[irU+0]*rhoInv, - BC[c].Conserved[irU+1]*rhoInv, - BC[c].Conserved[irU+2]*rhoInv) - BC[c].velocity = velocity - var kineticEnergy = (0.5*MACRO.dot(velocity, velocity)) - var InternalEnergy = BC[c].Conserved[irE]*rhoInv - kineticEnergy - BC[c].temperature = MIX.GetTFromInternalEnergy(InternalEnergy, BC[c].temperature, Yi, mix); - BC[c].pressure = MIX.GetPFromRhoAndT(rho, MixW, BC[c].temperature) - end end +SetNSCBC_OutflowBC:set_task_id(TYPES.TID_SetNSCBC_OutflowBC) local mkSetAdiabaticWallBC = terralib.memoize(function(dir) local SetAdiabaticWallBC @@ -1309,216 +1209,86 @@ end) local mkSetIncomingShockBC = terralib.memoize(function(dir) local SetIncomingShockBC - - local idx - local sdir - --if dir == "x" then - -- idx = 0 - --elseif dir == "y" then - if dir == "yPos" then - idx = 1 - sdir = "x" --- elseif dir == "z" then --- idx = 2 - else assert(false) end - - -- NOTE: It is safe to not pass the ghost regions to this task, because we - -- always group ghost cells with their neighboring interior cells. - local __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED - task SetIncomingShockBC(Fluid : region(ispace(int3d), Fluid_columns), - Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), - params : IncomingShockParams, - mix : MIX.Mixture) + extern task SetIncomingShockBC(Fluid : region(ispace(int3d), Fluid_columns), + Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), + params : IncomingShockParams, + mix : MIX.Mixture) where reads(Fluid.SoS), reads(Fluid.Conserved), writes(Fluid.[Primitives]) - do - var BC = Fluid_BC[0] - var MixW = MIX.GetMolarWeightFromXi(params.MolarFracs, mix) - - __demand(__openmp) - for c in BC do - if (c.[sdir] < params.iShock) then - BC[c].MolarFracs = params.MolarFracs - BC[c].velocity = params.velocity0 - BC[c].temperature = params.temperature0 - BC[c].pressure = params.pressure0 - - elseif (c.[sdir] == params.iShock) then - BC[c].MolarFracs = params.MolarFracs - BC[c].velocity = params.velocity1 - BC[c].temperature = params.temperature1 - BC[c].pressure = params.pressure1 - - else - BC[c].MolarFracs = params.MolarFracs - BC[c].velocity = params.velocity1 - BC[c].temperature = params.temperature1 - - if (params.velocity1[idx] <= -BC[c].SoS) then - -- It is supersonic, everything is imposed by the BC - BC[c].pressure = params.pressure1 - else - -- Compute pressure from NSCBC conservation equations - var rhoYi : double[nSpec] - for i=0, nSpec do - rhoYi[i] = BC[c].Conserved[i] - end - var rho = MIX.GetRhoFromRhoYi(rhoYi) - BC[c].pressure = MIX.GetPFromRhoAndT(rho, MixW, params.temperature1) - end - - end - end end - return SetIncomingShockBC -end) - -local mkSetRecycleRescaling = terralib.memoize(function(dir) - local SetRecycleRescaling - local idx - if dir == "x" then - idx = 0 --- elseif dir == "y" then --- idx = 1 + --if dir == "x" then + --elseif dir == "y" then + if dir == "yPos" then + SetIncomingShockBC:set_task_id(TYPES.TID_SetIncomingShockBC) -- elseif dir == "z" then --- idx = 2 else assert(false) end - local function emitInterp(r, c, cp1, fld, w, ind) - if ind == nil then - return rexpr - r[c ].[fld]*w + - r[cp1].[fld]*(1.0-w) - end - else - return rexpr - r[c ].[fld][ind]*w + - r[cp1].[fld][ind]*(1.0-w) - end - end - end - - local function emitInterpAll(r0, rInt, avg, FIregion, FIdata, c, yF, t, v, MF) return rquote - var yR = r0[c].centerCoordinates[1]*yF - var cAvg = FIFindIndex(yR, FIregion, FIdata) - var cAp1 = cAvg+int1d{1} - var cInt = int3d{c.x, cAvg, c.z} - var cIp1 = cInt+int3d{0, 1, 0} - var w = FIGetWeight(yR, avg[cAvg].y, avg[cAp1].y) - t = [emitInterp(rInt, cInt, cIp1, "temperature_recycle", w)]; - for i=0, 3 do - v[i] = [emitInterp(rInt, cInt, cIp1, "velocity_recycle", w, i)] - end - for i=0, nSpec do - MF[i] = [emitInterp(rInt, cInt, cIp1, "MolarFracs_recycle", w, i)] - end - end end - - local alpha = 4.0 --- local b = 0.125 -- for Mach 2 --- local b = 0.3 -- for Mach 3 - local b = 0.4 -- Original - local __demand(__inline) - task weightf(x : double) - var rnum = alpha*(x-b) - var rden = b + (1.0-2.0*b)*x - var weightf = 0.5*(1.0 + tanh(rnum/rden)/tanh(alpha)) - if (x > 1.0) then weightf = 1.0 end - return weightf - end - - local __demand(__inline) - task bernardinidamp(x : double) - return 0.5*(1.0 - tanh(5.0*(x-1.75))) - end + return SetIncomingShockBC +end) - __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED - task SetRecycleRescaling(Fluid : region(ispace(int3d), Fluid_columns), - Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), - avg : region(ispace(int1d), RecycleAverageType), - BC_interp : region(ispace(int3d), Fluid_columns), - FIregion : region(ispace(int1d), FIType), - FIdata : FIData, - RdataIn : RescalingDataType, - RdataRe : RescalingDataType, - mix : MIX.Mixture, - Pbc : double) +local mkSetRecycleRescalingBC = terralib.memoize(function(dir) + local SetRecycleRescalingBC + extern task SetRecycleRescalingBC(Fluid : region(ispace(int3d), Fluid_columns), + Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), + avg : region(ispace(int1d), RecycleAverageType), + BC_interp : region(ispace(int3d), Fluid_columns), + FIregion : region(ispace(int1d), FIType), + FIdata : FIData, + RdataIn : RescalingDataType, + RdataRe : RescalingDataType, + mix : MIX.Mixture, + Pbc : double) where reads(Fluid.centerCoordinates), reads(Fluid.SoS), reads(Fluid.Conserved), reads(Fluid.[ProfilesVars]), - reads(avg.{y}), + reads(avg.y), reads(BC_interp.[RecycleVars]), reads(FIregion), writes(Fluid.[Primitives]) - do - -- Compute rescaling coefficients - var yInnFact = RdataRe.deltaNu /RdataIn.deltaNu - var yOutFact = RdataRe.delta99VD/RdataIn.delta99VD - var uInnFact = RdataIn.uTau/RdataRe.uTau - var uOutFact = uInnFact*sqrt(RdataIn.rhow/RdataRe.rhow) - - var idelta99Inl = 1.0/RdataIn.delta99VD - - -- Set boundary conditions - var BC = Fluid_BC[0] - __demand(__openmp) - for c in BC do - -- Interpolate fluctuations based on the inner scaling - var temperatureInn : double - var velocityInn : double[3] - var MolarFracsInn : double[nSpec] - [emitInterpAll(BC, BC_interp, avg, FIregion, FIdata, c, yInnFact, - temperatureInn, velocityInn, MolarFracsInn)]; - for i=0, 3 do velocityInn[i] *= uInnFact end - - -- Interpolate fluctuations based on the outer scaling - var temperatureOut : double - var velocityOut : double[3] - var MolarFracsOut : double[nSpec] - [emitInterpAll(BC, BC_interp, avg, FIregion, FIdata, c, yOutFact, - temperatureOut, velocityOut, MolarFracsOut)]; - for i=0, 3 do velocityOut[i] *= uOutFact end - - -- Blend the results, multiply by free-stream dumping, and add mean profiles - var etaInl = BC[c].centerCoordinates[1]*idelta99Inl - var w = weightf(etaInl) - var damp = bernardinidamp(etaInl) - var temperature = (temperatureInn*(1.0-w) + temperatureOut*w)*damp + BC[c].temperature_profile - var velocity : double[3] - for i=0, 3 do - velocity[i] = (velocityInn[i]*(1.0-w) + velocityOut[i]*w)*damp + BC[c].velocity_profile[i] - end - var MolarFracs : double[nSpec] - for i=0, nSpec do - MolarFracs[i] = (MolarFracsInn[i]*(1.0-w) + MolarFracsOut[i]*w)*damp + BC[c].MolarFracs_profile[i] - end - - -- Set boundary conditions - BC[c].MolarFracs = MolarFracs - BC[c].velocity = velocity - BC[c].temperature = temperature - if (velocity[idx] >= BC[c].SoS) then - -- It is supersonic, everything is imposed by the BC - BC[c].pressure = Pbc - else - -- Compute pressure from NSCBC conservation equations - var rhoYi : double[nSpec] - for i=0, nSpec do - rhoYi[i] = BC[c].Conserved[i] - end - var rho = MIX.GetRhoFromRhoYi(rhoYi) - var MixW = MIX.GetMolarWeightFromXi(MolarFracs, mix) - BC[c].pressure = MIX.GetPFromRhoAndT(rho, MixW, temperature) - end - end end - return SetRecycleRescaling + if dir == "x" then + SetRecycleRescalingBC:set_task_id(TYPES.TID_SetRecycleRescalingBC) +-- elseif dir == "y" then +-- idx = 1 +-- elseif dir == "z" then +-- idx = 2 + else assert(false) end + return SetRecycleRescalingBC end) +local mkCorrectIonsBC +if (ELECTRIC_FIELD and (MIX.nIons > 0)) then + -- Correct ions bcs + mkCorrectIonsBC = terralib.memoize(function(dir) + local CorrectIonsBC + extern task CorrectIonsBC(Fluid : region(ispace(int3d), Fluid_columns), + Fluid_BC : partition(disjoint, Fluid, ispace(int1d)), + mix : MIX.Mixture) + where + reads(Fluid.electricPotential), + reads writes(Fluid.MolarFracs) + end + if dir == "xNeg" then + CorrectIonsBC:set_task_id(TYPES.TID_CorrectIonsBCXNeg) + elseif dir == "xPos" then + CorrectIonsBC:set_task_id(TYPES.TID_CorrectIonsBCXPos) + elseif dir == "yNeg" then + CorrectIonsBC:set_task_id(TYPES.TID_CorrectIonsBCYNeg) + elseif dir == "yPos" then + CorrectIonsBC:set_task_id(TYPES.TID_CorrectIonsBCYPos) + elseif dir == "zNeg" then + CorrectIonsBC:set_task_id(TYPES.TID_CorrectIonsBCZNeg) + elseif dir == "zPos" then + CorrectIonsBC:set_task_id(TYPES.TID_CorrectIonsBCZPos) + else assert(false) end + return CorrectIonsBC + end) +end + -- Update the ghost cells to impose boundary conditions __demand(__inline) task Exports.UpdateGhostPrimitives(Fluid : region(ispace(int3d), Fluid_columns), @@ -1582,15 +1352,15 @@ do -- update boundary condition __demand(__index_launch) for c in xNeg_ispace do - [mkSetRecycleRescaling("x")](p_All[c], p_xNeg[c], - BCRecycleAverage, - BC_interp[int1d{c.z}], - BCRecycleAverageFI, - BCParams.RecycleRescaling.FIdata, - BCParams.RecycleRescaling.RescalingData, - RescalingDataRec, - Mix, - config.BC.xBCLeft.u.RecycleRescaling.P) + [mkSetRecycleRescalingBC("x")](p_All[c], p_xNeg[c], + BCRecycleAverage, + BC_interp[int1d{c.z}], + BCRecycleAverageFI, + BCParams.RecycleRescaling.FIdata, + BCParams.RecycleRescaling.RescalingData, + RescalingDataRec, + Mix, + config.BC.xBCLeft.u.RecycleRescaling.P) end end @@ -1613,6 +1383,11 @@ do for c in yNeg_ispace do SetDirichletBC(p_All[c], p_yNeg[c], config.BC.yBCLeft.u.Dirichlet.P) end + elseif (BC_yBCLeft == SCHEMA.FlowBC_NSCBC_Inflow) then + __demand(__index_launch) + for c in yNeg_ispace do + [mkSetNSCBC_InflowBC("y")](p_All[c], p_yNeg[c], Mix, config.BC.yBCLeft.u.NSCBC_Inflow.P) + end elseif (BC_yBCLeft == SCHEMA.FlowBC_NSCBC_Outflow) then __demand(__index_launch) for c in yNeg_ispace do @@ -1638,7 +1413,7 @@ do end end - -- yNeg BC + -- zNeg BC if (BC_zBCLeft == SCHEMA.FlowBC_Dirichlet) then __demand(__index_launch) for c in zNeg_ispace do @@ -1646,7 +1421,7 @@ do end end - -- yPos BC + -- zPos BC if (BC_zBCRight == SCHEMA.FlowBC_Dirichlet) then __demand(__index_launch) for c in zPos_ispace do @@ -1713,6 +1488,58 @@ do [mkSetAdiabaticWallBC("xPos")](p_All[c], p_xPos[c]) end end + + -- Correct charged species boundary conditions +[(function() local __quotes = terralib.newlist() +if (ELECTRIC_FIELD and (MIX.nIons > 0)) then __quotes:insert(rquote + if (config.Efield.type ~= SCHEMA.EFieldStruct_Off) then + -- zNeg BC + if (BC_zBCLeft ~= SCHEMA.FlowBC_Periodic) then + __demand(__index_launch) + for c in zNeg_ispace do + [mkCorrectIonsBC("zNeg")](p_All[c], p_zNeg[c], Mix) + end + end + -- zPos BC + if (BC_zBCRight ~= SCHEMA.FlowBC_Periodic) then + __demand(__index_launch) + for c in zPos_ispace do + [mkCorrectIonsBC("zPos")](p_All[c], p_zPos[c], Mix) + end + end + -- yNeg BC + if (BC_yBCLeft ~= SCHEMA.FlowBC_Periodic) then + __demand(__index_launch) + for c in yNeg_ispace do + [mkCorrectIonsBC("yNeg")](p_All[c], p_yNeg[c], Mix) + end + end + -- yPos BC + if (BC_yBCRight ~= SCHEMA.FlowBC_Periodic) then + __demand(__index_launch) + for c in yPos_ispace do + [mkCorrectIonsBC("yPos")](p_All[c], p_yPos[c], Mix) + end + end + -- xNeg BC + if (BC_xBCLeft ~= SCHEMA.FlowBC_Periodic) then + __demand(__index_launch) + for c in xNeg_ispace do + [mkCorrectIonsBC("xNeg")](p_All[c], p_xNeg[c], Mix) + end + end + -- xPos BC + if (BC_xBCRight ~= SCHEMA.FlowBC_Periodic) then + __demand(__index_launch) + for c in xPos_ispace do + [mkCorrectIonsBC("xPos")](p_All[c], p_xPos[c], Mix) + end + end + end +end) +end +return __quotes end)()]; + end ------------------------------------------------------------------------ @@ -1763,7 +1590,7 @@ do yNeg_ispace, yPos_ispace, zNeg_ispace, zPos_ispace} = Fluid_zones - -- Update time derivatives at boundary for NSCBC + -- Update time derivatives at boundary for NSCBCInflow if ((BC_xBCLeft == SCHEMA.FlowBC_NSCBC_Inflow) or (BC_xBCLeft == SCHEMA.FlowBC_RecycleRescaling)) then __demand(__index_launch) @@ -1772,8 +1599,15 @@ do end end + if (BC_xBCLeft == SCHEMA.FlowBC_NSCBC_Inflow) then + __demand(__index_launch) + for c in yNeg_ispace do + UpdateNSCBCGhostCellTimeDerivatives(p_All[c], p_yNeg[c], Integrator_deltaTime) + end + end + -- Update time derivatives at boundary for IncomingShock - if BC_yBCRight == SCHEMA.FlowBC_IncomingShock then + if (BC_yBCRight == SCHEMA.FlowBC_IncomingShock) then __demand(__index_launch) for c in yPos_ispace do UpdateNSCBCGhostCellTimeDerivatives(p_All[c], p_yPos[c], Integrator_deltaTime) diff --git a/src/Species.h b/src/prometeo_bc_types.h similarity index 53% rename from src/Species.h rename to src/prometeo_bc_types.h index d16f0ad..34fb26f 100644 --- a/src/Species.h +++ b/src/prometeo_bc_types.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,60 +27,88 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef Species_H -#define Species_H +#ifndef __PROMETEO_BC_TYPES_H__ +#define __PROMETEO_BC_TYPES_H__ -#include -#include +#include "legion.h" #ifdef __cplusplus extern "C" { #endif -#define RGAS 8.3144598 // [J/(mol K)] +#include "prometeo_const.h" -// Species geometries -//enum SpeciesGeom { -// Atom, -// Linear, -// NonLinear -//}; -#define SpeciesGeom_Atom 0 -#define SpeciesGeom_Linear 1 -#define SpeciesGeom_NonLinear 3 +#ifndef nSpec + #error "nSpec is undefined" +#endif + +// Stores upstream and downstream impinging shock conditions +struct IncomingShockParams { + // Index where the shock will be injected + int iShock; + // Constant mixture composition + double MolarFracs[nSpec]; + // Primitive variables upstream of the shock + double pressure0; + double temperature0; + double velocity0[3]; + // Primitive variables downstream of the shock + double pressure1; + double temperature1; + double velocity1[3]; +}; + +// Stores averages for Recycle/Rescaling BC +struct RecycleAverageType { + // Average weight + double w; + // Distance from the wall + double y; + // Properties + double rho; + // Primitive variables + double temperature; + double MolarFracs[nSpec]; + double velocity[3]; +}; -// NASA polynomials data structure -struct cpCoefficients { - double TSwitch1; // Switch temperature between Low and Mid temperature polynomials - double TSwitch2; // Switch temperature between Mid and High temperature polynomials - double TMin; // Minimum temperature - double TMax; // Maximum temperature - double cpH[9]; // High temperature polynomials - double cpM[9]; // Mid temperature polynomials - double cpL[9]; // Low temperature polynomials +// The order of this enum must match the declaration of RecycleAverageType +enum RA_FieldIDs { + // Average weight + RA_FID_w = 101, + // Distance from the wall + RA_FID_y, + // Properties + RA_FID_rho, + // Primitive variables + RA_FID_temperature, + RA_FID_MolarFracs, + RA_FID_velocity, + // keep last for counting + RA_FID_last }; -// Coefficinets for diffusivity -struct DiffCoefficients { - double sigma; // Lennard-Jones collision diameter [m] - double kbOveps; // Boltzmann constant divided by Lennard-Jones potential well depth [1/K] - double mu; // Dipole moment [C*m] - double alpha; // Polarizabilty [m] - double Z298; // Rotational relaxation collision number +// Stores Van Driest provile data for Recycle/Rescaling BC +struct BLDataType { + double Uinf; + double aVD; + double bVD; + double QVD; + double Ueq; }; -// Species structure -struct Spec { - int8_t Name[10]; // Name of the species - double W; // Molar weight [kg/mol] - int inx; // Index in the species vector - int Geom; // = 0 (Atom), = 1 (Linear), = 2 (Non Linear) - struct cpCoefficients cpCoeff; - struct DiffCoefficients DiffCoeff; +// Stores rescaling data for Recycle/Rescaling BC +struct RescalingDataType { + // Data for outer scaling + double delta99VD; + // Data for inner scaling + double rhow; + double uTau; + double deltaNu; }; #ifdef __cplusplus } #endif -#endif // Species_H +#endif // __PROMETEO_BC_TYPES_H__ diff --git a/src/prometeo_cfl.cc b/src/prometeo_cfl.cc new file mode 100644 index 0000000..30d6822 --- /dev/null +++ b/src/prometeo_cfl.cc @@ -0,0 +1,96 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_cfl.hpp" + +// CalculateMaxSpectralRadiusTask +/*static*/ const char * const CalculateMaxSpectralRadiusTask::TASK_NAME = "CalculateMaxSpectralRadius"; +/*static*/ const int CalculateMaxSpectralRadiusTask::TASK_ID = TID_CalculateMaxSpectralRadius; + +double CalculateMaxSpectralRadiusTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for cellWidth + const AccessorRO< Vec3, 3> acc_cellWidth (regions[0], FID_cellWidth); + + // Accessors for primitive variables + const AccessorRO acc_MassFracs (regions[0], FID_MassFracs); + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_mu (regions[0], FID_mu); + const AccessorRO acc_lam (regions[0], FID_lam); + const AccessorRO acc_Di (regions[0], FID_Di); + const AccessorRO acc_SoS (regions[0], FID_SoS); +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO acc_Ki (regions[0], FID_Ki); + + // Accessors for primitive variables + const AccessorRO< Vec3, 3> acc_eField (regions[0], FID_electricField); +#endif + + // Extract execution domains + Rect<3> r_MyFluid = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Reduce spectral redii into r + double r = 0.0; + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) reduction(max:r) +#endif + for (int k = r_MyFluid.lo.z; k <= r_MyFluid.hi.z; k++) + for (int j = r_MyFluid.lo.y; j <= r_MyFluid.hi.y; j++) + for (int i = r_MyFluid.lo.x; i <= r_MyFluid.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + const double my_r = CalculateMaxSpectralRadius(acc_cellWidth, + acc_temperature, acc_MassFracs, acc_velocity, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, acc_eField, +#endif + p, args.mix); + if (my_r > r) r = my_r; + } + return r; +} + +void register_cfl_tasks() { + + TaskHelper::register_hybrid_variants>(); + +}; diff --git a/src/prometeo_cfl.cu b/src/prometeo_cfl.cu new file mode 100644 index 0000000..70bb684 --- /dev/null +++ b/src/prometeo_cfl.cu @@ -0,0 +1,215 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_cfl.hpp" +#include "cuda_utils.hpp" + +// Declare a constant memory that will hold the Mixture struct (initialized in prometeo_mixture.cu) +extern __device__ __constant__ Mix mix; + +//----------------------------------------------------------------------------- +// KERNEL FOR CalculateMaxSpectralRadiusTask +//----------------------------------------------------------------------------- + +__global__ +void CalculateMaxSpectralRadius_kernel(const DeferredBuffer buffer, + const AccessorRO< Vec3, 3> cellWidth, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO Ki, + const AccessorRO< Vec3, 3> eField, +#endif + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + // We know there is never more than 32 warps in a CTA + __shared__ double trampoline[32]; + + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + double my_r = 0.0; // Spectral radius cannot be lower than 0 + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + my_r = CalculateMaxSpectralRadiusTask::CalculateMaxSpectralRadius(cellWidth, + temperature, MassFracs, velocity, + rho, mu, lam, Di, SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + Ki, eField, +#endif + p, mix); + } + // make sure that everyone is done with computing the spectral radius + __syncthreads(); + + // Perform a local reduction inside the CTA + // Butterfly reduction across all threads in all warps + for (int i = 16; i >= 1; i/=2) + my_r = max(my_r, __shfl_xor_sync(0xfffffff, my_r, i, 32)); + unsigned laneid; + asm volatile("mov.u32 %0, %laneid;" : "=r"(laneid) : ); + unsigned warpid = ((threadIdx.z * blockDim.y + threadIdx.y) * blockDim.x + threadIdx.x) >> 5; + // First thread in each warp writes out all values + if (laneid == 0) + trampoline[warpid] = my_r; + __syncthreads(); + + // Butterfly reduction across all thread in the first warp + if (warpid == 0) { + unsigned numwarps = (blockDim.x * blockDim.y * blockDim.z) >> 5; + my_r = (laneid < numwarps) ? trampoline[laneid] : 0; + for (int i = 16; i >= 1; i/=2) + my_r = max(my_r, __shfl_xor_sync(0xfffffff, my_r, i, 32)); + // First thread writes to the buffer + if (laneid == 0) { + unsigned blockId = (blockIdx.z * gridDim.y + blockIdx.y) * gridDim.x + blockIdx.x; + buffer[blockId] = my_r; + } + } +} + +__global__ +void ReduceBuffer_kernel(const DeferredBuffer buffer, + const DeferredValue result, + const size_t size) { + // We know there is never more than 32 warps in a CTA + __shared__ double trampoline[32]; + + // Each thread reduces all the correspoinding values + int offset = threadIdx.x; + double my_r = 0.0; // Spectral radius cannot be lower than 0 + while (offset < size) { + my_r = max(my_r, buffer[Point<1>(offset)]); + offset += blockDim.x; + } + // make sure that everyone is done with its reduction + __syncthreads(); + + // Perform a local reduction inside the CTA + // Butterfly reduction across all threads in all warps + for (int i = 16; i >= 1; i/=2) + my_r = max(my_r, __shfl_xor_sync(0xfffffff, my_r, i, 32)); + unsigned laneid; + asm volatile("mov.u32 %0, %laneid;" : "=r"(laneid) : ); + unsigned warpid = threadIdx.x >> 5; + // First thread in each warp writes out all values + if (laneid == 0) + trampoline[warpid] = my_r; + __syncthreads(); + + // Butterfly reduction across all threads in the first warp + if (warpid == 0) { + unsigned numwarps = blockDim.x >> 5; + my_r = (laneid < numwarps) ? trampoline[laneid] : 0; + for (int i = 16; i >= 1; i/=2) + my_r = max(my_r, __shfl_xor_sync(0xfffffff, my_r, i, 32)); + // First thread writes to the buffer + if (laneid == 0) + result.write(my_r); + } +} + +__host__ +DeferredValue CalculateMaxSpectralRadiusTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessor for cellWidth + const AccessorRO< Vec3, 3> acc_cellWidth (regions[0], FID_cellWidth); + + // Accessors for primitive variables + const AccessorRO acc_MassFracs (regions[0], FID_MassFracs); + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_mu (regions[0], FID_mu); + const AccessorRO acc_lam (regions[0], FID_lam); + const AccessorRO acc_Di (regions[0], FID_Di); + const AccessorRO acc_SoS (regions[0], FID_SoS); +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO acc_Ki (regions[0], FID_Ki); + + // Accessors for primitive variables + const AccessorRO< Vec3, 3> acc_eField (regions[0], FID_electricField); +#endif + + // Extract execution domains + Rect<3> r_MyFluid = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Define thread grid + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_MyFluid); + const dim3 num_blocks_3d = dim3((getSize(r_MyFluid) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_MyFluid) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_MyFluid) + (TPB_3d.z - 1)) / TPB_3d.z); + + // Store the maximum value per block in a deferred buffer + const size_t total_blocks = num_blocks_3d.x*num_blocks_3d.y*num_blocks_3d.z; + const Rect<1> bounds(Point<1>(0), Point<1>(total_blocks - 1)); + DeferredBuffer buffer(bounds, Memory::GPU_FB_MEM); + CalculateMaxSpectralRadius_kernel<<>>( + buffer, acc_cellWidth, acc_temperature, acc_MassFracs, acc_velocity, + acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, acc_eField, +#endif + r_MyFluid, getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid)); + + // Reduce spectral radii into r + DeferredValue r(0.0); + + // We use at most 1024 blocks + dim3 TPB((total_blocks > 1024) ? 1024 : total_blocks, 1, 1); + // Round up to the nearest multiple of warps + while ((TPB.x % 32) != 0) TPB.x++; + const dim3 num_blocks(1, 1, 1); + ReduceBuffer_kernel<<>>(buffer, r, total_blocks); + + return r; +} + diff --git a/src/CH41StMix.hpp b/src/prometeo_cfl.h similarity index 89% rename from src/CH41StMix.hpp rename to src/prometeo_cfl.h index 01ecae7..4083cdd 100644 --- a/src/CH41StMix.hpp +++ b/src/prometeo_cfl.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,10 +27,19 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CH41StMix_HPP -#define CH41StMix_HPP +#ifndef __PROMETEO_CFL_H__ +#define __PROMETEO_CFL_H__ -#include "CH41StMix.h" -#include "MultiComponent.hpp" +#include "legion.h" -#endif // CH41StMix_HPP +#ifdef __cplusplus +extern "C" { +#endif + +void register_cfl_tasks(); + +#ifdef __cplusplus +} +#endif + +#endif // __PROMETEO_CFL_H__ diff --git a/src/prometeo_cfl.hpp b/src/prometeo_cfl.hpp new file mode 100644 index 0000000..9be707b --- /dev/null +++ b/src/prometeo_cfl.hpp @@ -0,0 +1,186 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_CFL_HPP__ +#define __PROMETEO_CFL_HPP__ + +#include "legion.h" + +using namespace Legion; + +//----------------------------------------------------------------------------- +// LOAD PROMETEO UTILITIES AND MODULES +//----------------------------------------------------------------------------- + +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" +#include "prometeo_types.h" +#include "prometeo_cfl.h" + +//----------------------------------------------------------------------------- +// TASK THAT COMPUTES THE CFL NUMBER +//----------------------------------------------------------------------------- + +#ifndef __CUDACC__ +using std::max; +using std::min; +#endif + +class CalculateMaxSpectralRadiusTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalRegion ModCells; + Mix mix; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +private: + __CUDA_H__ + static inline double CalculateConvectiveSpectralRadius(const Vec3 &cellWidth, + const Vec3 &velocity, + const double SoS) { + double r = 0.0; // Spectral radius cannot be lower than 0 + __UNROLL__ + for (int i = 0; i < 3; i++) + r = max(r, (fabs(velocity[i]) + SoS)/cellWidth[i]); + return r; + }; + + __CUDA_H__ + static inline double CalculateViscousSpectralRadius(const Vec3 &cellWidth, + const double rho, + const double mu) { + const double nu = mu/rho; + double r = 0.0; // Spectral radius cannot be lower than 0 + __UNROLL__ + for (int i = 0; i < 3; i++) + r = max(r, nu/(cellWidth[i]*cellWidth[i])); + r *= 4; + return r; + }; + + __CUDA_H__ + static inline double CalculateHeatConductionSpectralRadius(const Vec3 &cellWidth, + const double temperature, + const VecNSp &MassFracs, + const double rho, + const double lam, + const Mix &mix) { + const double cp = mix.GetHeatCapacity(temperature, MassFracs); + const double DifT = lam/(cp*rho); + double r = 0.0; // Spectral radius cannot be lower than 0 + __UNROLL__ + for (int i = 0; i < 3; i++) + r = max(r, DifT/(cellWidth[i]*cellWidth[i])); + r *= 4; + return r; + }; + + __CUDA_H__ + static inline double CalculateSpeciesDiffusionSpectralRadius(const Vec3 &cellWidth, + const VecNSp &Di) { + double r = 0.0; // Spectral radius cannot be lower than 0 + for (int s = 0; s < nSpec; s++) + __UNROLL__ + for (int i = 0; i < 3; i++) + r = max(r, Di[s]/(cellWidth[i]*cellWidth[i])); + r *= 4; + return r; + }; + +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + __CUDA_H__ + static inline double CalculateSpeciesDriftSpectralRadius(const Vec3 &eField, + const Vec3 &cellWidth, + const VecNIo &Ki) { + double r = 0.0; // Spectral radius cannot be lower than 0 + __UNROLL__ + for (int i = 0; i < 3; i++) + r = max(r, fabs(eField[i])/cellWidth[i]); + // Compute the maximum electric mobility + double Kimax = 0.0; + __UNROLL__ + for (int i = 0; i < nIons; i++) + Kimax = max(Kimax, Ki[i]); + r *= Kimax; + return r; + }; +#endif + +public: + __CUDA_H__ + static inline double CalculateMaxSpectralRadius(const AccessorRO< Vec3, 3> &cellWidth, + const AccessorRO &temperature, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorRO &Ki, + const AccessorRO< Vec3, 3> &eField, +#endif + const Point<3> &p, + const Mix &mix) { + double r = 0.0; // Spectral radius cannot be lower than 0 + r = max(r, CalculateConvectiveSpectralRadius(cellWidth[p], velocity[p], SoS[p])); + r = max(r, CalculateViscousSpectralRadius(cellWidth[p], rho[p], mu[p])); + r = max(r, CalculateHeatConductionSpectralRadius(cellWidth[p], + temperature[p], MassFracs[p], + rho[p], lam[p], mix)); + r = max(r, CalculateSpeciesDiffusionSpectralRadius(cellWidth[p], Di[p])); +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + r = max(r, CalculateSpeciesDriftSpectralRadius(eField[p], cellWidth[p], Ki[p])); +#endif + return r; + } +public: + static double cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static DeferredValue gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +#endif // __PROMETEO_CFL_HPP__ diff --git a/src/prometeo_cfl.rg b/src/prometeo_cfl.rg index b3e7fdc..f893013 100644 --- a/src/prometeo_cfl.rg +++ b/src/prometeo_cfl.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -29,97 +29,34 @@ import "regent" -return function(MIX, Fluid_columns) local Exports = {} - --- Variable indices -local nSpec = MIX.nSpec -- Number of species composing the mixture +return function(MIX, TYPES, ELECTRIC_FIELD) local Exports = {} ------------------------------------------------------------------------------- -- IMPORTS ------------------------------------------------------------------------------- local C = regentlib.c -local fabs = regentlib.fabs(double) + +local Fluid_columns = TYPES.Fluid_columns ------------------------------------------------------------------------------- -- STABILITY CONDITIONS ROUTINES ------------------------------------------------------------------------------- -local __demand(__inline) -task CalculateConvectiveSpectralRadius(Fluid : region(ispace(int3d), Fluid_columns), c : int3d) -where - reads(Fluid.{cellWidth, velocity, SoS}) -do - return (max(max(((fabs(Fluid[c].velocity[0])+Fluid[c].SoS)/Fluid[c].cellWidth[0]), - ((fabs(Fluid[c].velocity[1])+Fluid[c].SoS)/Fluid[c].cellWidth[1])), - ((fabs(Fluid[c].velocity[2])+Fluid[c].SoS)/Fluid[c].cellWidth[2]))) -end - -local __demand(__inline) -task CalculateViscousSpectralRadius(Fluid : region(ispace(int3d), Fluid_columns), c : int3d) -where - reads(Fluid.{cellWidth, rho, mu}) -do - var nu = Fluid[c].mu/Fluid[c].rho - return ((max(max((nu/(Fluid[c].cellWidth[0]*Fluid[c].cellWidth[0])), - (nu/(Fluid[c].cellWidth[1]*Fluid[c].cellWidth[1]))), - (nu/(Fluid[c].cellWidth[2]*Fluid[c].cellWidth[2]))))*4.0) -end - -local __demand(__inline) -task CalculateHeatConductionSpectralRadius(Fluid : region(ispace(int3d), Fluid_columns), - c : int3d, - mix : MIX.Mixture) -where - reads(Fluid.cellWidth), - reads(Fluid.{MassFracs, temperature}), - reads(Fluid.{rho, lam}) -do - var cp = MIX.GetHeatCapacity(Fluid[c].temperature, Fluid[c].MassFracs, mix) - var DifT = (Fluid[c].lam/(cp*Fluid[c].rho)) - return ((max(max((DifT/(Fluid[c].cellWidth[0]*Fluid[c].cellWidth[0])), - (DifT/(Fluid[c].cellWidth[1]*Fluid[c].cellWidth[1]))), - (DifT/(Fluid[c].cellWidth[2]*Fluid[c].cellWidth[2]))))*4.0) +local Prop = terralib.newlist({"rho", "mu", "lam", "Di", "SoS"}) +local Vars = terralib.newlist({"velocity", "MassFracs", "temperature"}) +if (ELECTRIC_FIELD and (MIX.nIons > 0)) then + Prop:insert("Ki") + Vars:insert("electricField") end - -local __demand(__inline) -task CalculateSpeciesDiffusionSpectralRadius(Fluid : region(ispace(int3d), Fluid_columns), c : int3d) -where - reads(Fluid.{cellWidth, Di}) -do - var acc = -math.huge - for i=0, nSpec do - acc max= ((max(max((Fluid[c].Di[i]/(Fluid[c].cellWidth[0]*Fluid[c].cellWidth[0])), - (Fluid[c].Di[i]/(Fluid[c].cellWidth[1]*Fluid[c].cellWidth[1]))), - (Fluid[c].Di[i]/(Fluid[c].cellWidth[2]*Fluid[c].cellWidth[2]))))*4.0) - end - return acc -end - -__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED -task Exports.CalculateMaxSpectralRadius(Fluid : region(ispace(int3d), Fluid_columns), - ModCells : region(ispace(int3d), Fluid_columns), - mix : MIX.Mixture) +extern task Exports.CalculateMaxSpectralRadius(Fluid : region(ispace(int3d), Fluid_columns), + ModCells : region(ispace(int3d), Fluid_columns), + mix : MIX.Mixture) : double where reads(Fluid.cellWidth), - reads(Fluid.{velocity, SoS}), - reads(Fluid.{rho, mu}), - reads(Fluid.{MassFracs, temperature, lam}), - reads(Fluid.Di) -do - var acc = -math.huge - __demand(__openmp) - for c in ModCells do - -- Advection - acc max= CalculateConvectiveSpectralRadius(Fluid, c) - -- Momentum diffusion - acc max= CalculateViscousSpectralRadius(Fluid, c) - -- Heat Conduction - acc max= CalculateHeatConductionSpectralRadius(Fluid, c, mix) - -- Species diffusion - acc max= CalculateSpeciesDiffusionSpectralRadius(Fluid, c) - end - return acc + reads(Fluid.[Prop]), + reads(Fluid.[Vars]) end +Exports.CalculateMaxSpectralRadius:set_task_id(TYPES.TID_CalculateMaxSpectralRadius) return Exports end diff --git a/src/prometeo_chem.cc b/src/prometeo_chem.cc new file mode 100644 index 0000000..e2b9e00 --- /dev/null +++ b/src/prometeo_chem.cc @@ -0,0 +1,120 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_chem.hpp" + +// UpdateChemistryTask +/*static*/ const char * const UpdateChemistryTask::TASK_NAME = "UpdateChemistry"; +/*static*/ const int UpdateChemistryTask::TASK_ID = TID_UpdateChemistry; + +void UpdateChemistryTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 1); + + // Accessors for RHS + const AccessorRO acc_Conserved_t (regions[0], FID_Conserved_t); + + // Accessors for implicit variables + const AccessorRW acc_Conserved (regions[1], FID_Conserved); + const AccessorRW acc_Conserved_t_old (regions[1], FID_Conserved_t_old); + const AccessorRW acc_temperature (regions[1], FID_temperature); + + // Extract execution domain + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Wait for the Integrator_deltaTime + const double Integrator_deltaTime = futures[0].get_result(); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + acc_Conserved_t_old[p] = acc_Conserved_t[p]; + ImplicitSolver s = ImplicitSolver(acc_Conserved_t_old[p], acc_temperature[p], args.mix); + s.solve(acc_Conserved[p], Integrator_deltaTime, Integrator_deltaTime); + } +} + + +// AddChemistrySourcesTask +/*static*/ const char * const AddChemistrySourcesTask::TASK_NAME = "AddChemistrySources"; +/*static*/ const int AddChemistrySourcesTask::TASK_ID = TID_AddChemistrySources; + +void AddChemistrySourcesTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for primitive variables and properites + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_pressure (regions[0], FID_pressure); + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO acc_MassFracs (regions[0], FID_MassFracs); + + // Accessors for RHS + const AccessorRW acc_Conserved_t (regions[1], FID_Conserved_t); + + // Extract execution domain + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + VecNSp w; args.mix.GetProductionRates(w, acc_rho[p], acc_pressure[p], + acc_temperature[p], acc_MassFracs[p]); + for (int i = 0; i(); + + TaskHelper::register_hybrid_variants(); + +}; diff --git a/src/prometeo_chem.cu b/src/prometeo_chem.cu new file mode 100644 index 0000000..c49249b --- /dev/null +++ b/src/prometeo_chem.cu @@ -0,0 +1,163 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_chem.hpp" +#include "cuda_utils.hpp" + +// Declare a constant memory that will hold the Mixture struct (initialized in prometeo_mixture.cu) +extern __device__ __constant__ Mix mix; + +//----------------------------------------------------------------------------- +// KERNELS FOR UpdateChemistryTask +//----------------------------------------------------------------------------- + +__global__ +void UpdateChemistry_kernel(const AccessorRO Conserved_t, + const AccessorRW Conserved, + const AccessorRW Conserved_t_old, + const AccessorRW temperature, + const double Integrator_deltaTime, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + Conserved_t_old[p] = Conserved_t[p]; + ImplicitSolver s = ImplicitSolver(Conserved_t_old[p], temperature[p], mix); + s.solve(Conserved[p], Integrator_deltaTime, Integrator_deltaTime); + } +} + +__host__ +void UpdateChemistryTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 1); + + // Accessors for RHS + const AccessorRO acc_Conserved_t (regions[0], FID_Conserved_t); + + // Accessors for implicit variables + const AccessorRW acc_Conserved (regions[1], FID_Conserved); + const AccessorRW acc_Conserved_t_old (regions[1], FID_Conserved_t_old); + const AccessorRW acc_temperature (regions[1], FID_temperature); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Wait for the Integrator_deltaTime + const double Integrator_deltaTime = futures[0].get_result(); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = dim3((getSize(r_ModCells) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_ModCells) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_ModCells) + (TPB_3d.z - 1)) / TPB_3d.z); + UpdateChemistry_kernel<<>>( + acc_Conserved_t, acc_Conserved, acc_Conserved_t_old, acc_temperature, Integrator_deltaTime, + r_ModCells, getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); +} + + +//----------------------------------------------------------------------------- +// KERNELS FOR AddChemistrySourcesTask +//----------------------------------------------------------------------------- + +__global__ +void AddChemistrySources_kernel(const AccessorRO rho, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO MassFracs, + const AccessorRW Conserved_t, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + VecNSp w; mix.GetProductionRates(w, rho[p], pressure[p], temperature[p], MassFracs[p]); + __UNROLL__ + for (int i = 0; i ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for primitive variables and properites + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_pressure (regions[0], FID_pressure); + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO acc_MassFracs (regions[0], FID_MassFracs); + + // Accessors for RHS + const AccessorRW acc_Conserved_t (regions[1], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = dim3((getSize(r_ModCells) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_ModCells) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_ModCells) + (TPB_3d.z - 1)) / TPB_3d.z); + AddChemistrySources_kernel<<>>( + acc_rho, acc_pressure, acc_temperature, acc_MassFracs, acc_Conserved_t, + r_ModCells, getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); +} + diff --git a/src/prometeo_chem.h b/src/prometeo_chem.h new file mode 100644 index 0000000..632d267 --- /dev/null +++ b/src/prometeo_chem.h @@ -0,0 +1,45 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_CHEM_H__ +#define __PROMETEO_CHEM_H__ + +#include "legion.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void register_chem_tasks(); + +#ifdef __cplusplus +} +#endif + +#endif // __PROMETEO_CHEM_H__ diff --git a/src/prometeo_chem.hpp b/src/prometeo_chem.hpp new file mode 100644 index 0000000..299a9e7 --- /dev/null +++ b/src/prometeo_chem.hpp @@ -0,0 +1,156 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_CHEM_HPP__ +#define __PROMETEO_CHEM_HPP__ + +#include "legion.h" + +using namespace Legion; + +//----------------------------------------------------------------------------- +// LOAD PROMETEO UTILITIES AND MODULES +//----------------------------------------------------------------------------- + +#include "my_array.hpp" +#include "math_utils.hpp" +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" +#include "prometeo_types.h" +#include "prometeo_chem.h" + +//----------------------------------------------------------------------------- +// TASK THAT UPDATES THE CONSERVED VARIABLES BY IMPLICITLY SOLVING THE CHEMISTRY +//----------------------------------------------------------------------------- + +// Implicit problem for the chemistry +class ImplicitSolver : public Rosenbrock { +public: + __CUDA_HD__ + ImplicitSolver(const VecNEq &Conserved_t_old_, + double &temperature_, + const Mix &mix_) : + Conserved_t_old(Conserved_t_old_), + temperature(temperature_), + mix(mix_) + {}; + +private: + __CUDA_HD__ + inline void rhs(VecNEq &r, const VecNEq &x) { + VecNSp rhoYi; + __UNROLL__ + for (int i=0; i ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT ADDS THE CHEMICAL PRODUCTION RATES TO THE RHS OF THE EQUATIONS +//----------------------------------------------------------------------------- + +class AddChemistrySourcesTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalRegion ModCells; + Mix mix; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +#endif // __PROMETEO_CHEM_HPP__ diff --git a/src/prometeo_chem.rg b/src/prometeo_chem.rg index c49aa0f..204d9a0 100644 --- a/src/prometeo_chem.rg +++ b/src/prometeo_chem.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -29,7 +29,7 @@ import "regent" -return function(SCHEMA, MIX, Fluid_columns, ATOMIC) local Exports = {} +return function(SCHEMA, MIX, TYPES, ATOMIC) local Exports = {} ------------------------------------------------------------------------------- -- IMPORTS @@ -55,7 +55,7 @@ local ImplicitVars = terralib.newlist({ }) -- Atomic switch -local Fluid = regentlib.newsymbol(region(ispace(int3d), Fluid_columns), "Fluid") +local Fluid = regentlib.newsymbol(region(ispace(int3d), TYPES.Fluid_columns), "Fluid") local coherence_mode if ATOMIC then coherence_mode = regentlib.coherence(regentlib.atomic, Fluid, "Conserved_t") @@ -67,21 +67,10 @@ end -- CHEMISTRY ROUTINES ------------------------------------------------------------------------------- --- Parse input mixture -__demand(__inline) -task Exports.ParseConfigMixture(Mixture : SCHEMA.Mixture, mix : MIX.Mixture) - var initMolarFracs = [UTIL.mkArrayConstant(nSpec, rexpr 1.0e-60 end)] - for i=0, Mixture.Species.length do - var Species = Mixture.Species.values[i] - initMolarFracs[MIX.FindSpecies(Species.Name, mix)] = Species.MolarFrac - end - return initMolarFracs -end - -- Reset mixture __demand(__cuda, __leaf) -- MANUALLY PARALLELIZED -task Exports.ResetMixture(Fluid : region(ispace(int3d), Fluid_columns), - ModCells : region(ispace(int3d), Fluid_columns), +task Exports.ResetMixture(Fluid : region(ispace(int3d), TYPES.Fluid_columns), + ModCells : region(ispace(int3d), TYPES.Fluid_columns), initMolarFracs : double[nSpec]) where writes(Fluid.MolarFracs) @@ -92,82 +81,25 @@ do end end --- RHS function for the implicit solver -local __demand(__inline) -task rhsChem(Fluid : region(ispace(int3d), Fluid_columns), - c : int3d, - mix : MIX.Mixture) -where - reads writes(Fluid.[ImplicitVars]) -do - var f : double[nEq] - - var rhoYi : double[nSpec] - for i = 0, nSpec do - rhoYi[i] = Fluid[c].Conserved[i] - end - var rho = MIX.GetRhoFromRhoYi(rhoYi) - var Yi = MIX.GetYi(rho, rhoYi) - Yi = MIX.ClipYi(Yi) - var MixW = MIX.GetMolarWeightFromYi(Yi, mix) - - var rhoInv = 1.0/rho - var velocity = array(Fluid[c].Conserved[irU+0]*rhoInv, - Fluid[c].Conserved[irU+1]*rhoInv, - Fluid[c].Conserved[irU+2]*rhoInv) - - var kineticEnergy = (0.5*MACRO.dot(velocity, velocity)) - var InternalEnergy = Fluid[c].Conserved[irE]*rhoInv - kineticEnergy - Fluid[c].temperature = MIX.GetTFromInternalEnergy(InternalEnergy, Fluid[c].temperature, Yi, mix) - var P = MIX.GetPFromRhoAndT(rho, MixW, Fluid[c].temperature) - - var w = MIX.GetProductionRates(rho, P, Fluid[c].temperature, Yi, mix) - - for i = 0, nSpec do - f[i] = w[i] + Fluid[c].Conserved_t_old[i] - end - for i = nSpec, nEq do - f[i] = Fluid[c].Conserved_t_old[i] - end - return f -end - -__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED -task Exports.UpdateChemistry(Fluid : region(ispace(int3d), Fluid_columns), - ModCells : region(ispace(int3d), Fluid_columns), - Integrator_deltaTime : double, - mix : MIX.Mixture) +extern task Exports.UpdateChemistry(Fluid : region(ispace(int3d), TYPES.Fluid_columns), + ModCells : region(ispace(int3d), TYPES.Fluid_columns), + Integrator_deltaTime : double, + mix : MIX.Mixture) where reads(Fluid.Conserved_t), reads writes(Fluid.[ImplicitVars]) -do - var err = 0 - __demand(__openmp) - for c in ModCells do - Fluid[c].Conserved_t_old = Fluid[c].Conserved_t - err += [MATH.mkRosenbrock(nEq, Fluid_columns, ImplicitVars, "Conserved", MIX.Mixture, rhsChem)] - (Fluid, c, Integrator_deltaTime, Integrator_deltaTime, mix) - end - regentlib.assert(err==0, "Something wrong in UpdateChemistry") end +Exports.UpdateChemistry:set_task_id(TYPES.TID_UpdateChemistry) -__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED -task Exports.AddChemistrySources([Fluid], - ModCells : region(ispace(int3d), Fluid_columns), - mix : MIX.Mixture) +extern task Exports.AddChemistrySources([Fluid], + ModCells : region(ispace(int3d), TYPES.Fluid_columns), + mix : MIX.Mixture) where reads(Fluid.{rho, MassFracs, pressure, temperature}), reads writes (Fluid.Conserved_t), [coherence_mode] -do - __demand(__openmp) - for c in ModCells do - var w = MIX.GetProductionRates(Fluid[c].rho, Fluid[c].pressure, Fluid[c].temperature, Fluid[c].MassFracs, mix) - for i = 0, nSpec do - Fluid[c].Conserved_t[i] += w[i] - end - end end +Exports.AddChemistrySources:set_task_id(TYPES.TID_AddChemistrySources) return Exports end diff --git a/src/prometeo_const.h b/src/prometeo_const.h index 92758fa..5e23b01 100644 --- a/src/prometeo_const.h +++ b/src/prometeo_const.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -31,35 +31,23 @@ #ifndef __PROMETEO_CONST_H__ #define __PROMETEO_CONST_H__ -#ifdef __cplusplus -extern "C" { -#endif - //----------------------------------------------------------------------------- // LOAD THE EQUATION OF STATE //----------------------------------------------------------------------------- #define QUOTEME(M) #M -#define INCLUDE_FILE(M) QUOTEME(M.h) +#define INCLUDE_FILE(M) QUOTEME(M.hpp) #include INCLUDE_FILE( EOS ) #undef QUOTEME #undef INCLUDE_FILE +#ifdef __cplusplus +extern "C" { +#endif + //----------------------------------------------------------------------------- -// CONSTANTS +// SOLVER CONSTANTS //----------------------------------------------------------------------------- -#define RGAS 8.3144598 // [J/(mol K)] -#define Na 6.02214086e23 // [1/mol] -#define kb 1.38064852e-23 // [m^2 kg /( s^2 K)] -#define PI 3.1415926535898 - -// Stencil indices -#define Stencil1 0 -#define Stencil2 1 -#define Stencil3 2 -#define Stencil4 3 -#define nStencils 4 - // SSP Runge-Kutta method Gottlieb et al. (2001) // RK_C[*][1] -- Coefficinets for solution at time n // RK_C[*][2] -- Coefficinets for intermediate solution diff --git a/src/prometeo_const.rg b/src/prometeo_const.rg index a9548d4..ea6ce3b 100644 --- a/src/prometeo_const.rg +++ b/src/prometeo_const.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE diff --git a/src/prometeo_electricField.cc b/src/prometeo_electricField.cc new file mode 100644 index 0000000..73cb236 --- /dev/null +++ b/src/prometeo_electricField.cc @@ -0,0 +1,332 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_electricField.hpp" +#include "prometeo_electricField.inl" + +// GetElectricFieldTask +/*static*/ const char * const GetElectricFieldTask::TASK_NAME = "GetElectricField"; +/*static*/ const int GetElectricFieldTask::TASK_ID = TID_GetElectricField; + +void GetElectricFieldTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for variables in the Ghost regions + const AccessorRO acc_ePot (regions[0], FID_electricPotential); + + // Accessors for metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi_d (regions[1], FID_dcsi_d); + const AccessorRO acc_deta_d (regions[1], FID_deta_d); + const AccessorRO acc_dzet_d (regions[1], FID_dzet_d); + + // Accessors for gradients + const AccessorWO< Vec3, 3> acc_eField (regions[2], FID_electricField); + + // Extract execution domains + Rect<3> r_MyFluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_MyFluid.lo.z; k <= r_MyFluid.hi.z; k++) + for (int j = r_MyFluid.lo.y; j <= r_MyFluid.hi.y; j++) + for (int i = r_MyFluid.lo.x; i <= r_MyFluid.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + acc_eField[p] = -getGrad(acc_ePot, p, + acc_nType_x[p], acc_nType_y[p], acc_nType_z[p], + acc_dcsi_d[p], acc_deta_d[p], acc_dzet_d[p], + Fluid_bounds); + } +} + +#if (nIons > 0) +// Specielize UpdateUsingIonDriftFlux for the X direction +template<> +/*static*/ const char * const UpdateUsingIonDriftFluxTask::TASK_NAME = "UpdateUsingIonDriftFluxX"; +template<> +/*static*/ const int UpdateUsingIonDriftFluxTask::TASK_ID = TID_UpdateUsingIonDriftFluxX; +template<> +/*static*/ const FieldID UpdateUsingIonDriftFluxTask::FID_nType = FID_nType_x; +template<> +/*static*/ const FieldID UpdateUsingIonDriftFluxTask::FID_m_e = FID_dcsi_e; + +template<> +void UpdateUsingIonDriftFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for EulerGhost region + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + const AccessorRO< Vec3, 3> acc_eField (regions[0], FID_electricField); + const AccessorRO acc_Ki (regions[0], FID_Ki); + + // Accessors for DiffGhost region + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + + // Accessors for DivgGhost region + const AccessorRO< int, 3> acc_nType (regions[2], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m_e (regions[3], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // update RHS using Euler and Diffision fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { + // Launch the loop for the span + updateRHSSpan(acc_Conserved_t, acc_m_e, acc_nType, + acc_Conserved, acc_MassFracs, acc_Ki, acc_eField, + 0, getSize(r_ModCells), + 0, j-r_ModCells.lo.y, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); + } +} + +// Specielize UpdateUsingIonDriftFlux for the Y direction +template<> +/*static*/ const char * const UpdateUsingIonDriftFluxTask::TASK_NAME = "UpdateUsingIonDriftFluxY"; +template<> +/*static*/ const int UpdateUsingIonDriftFluxTask::TASK_ID = TID_UpdateUsingIonDriftFluxY; +template<> +/*static*/ const FieldID UpdateUsingIonDriftFluxTask::FID_nType = FID_nType_y; +template<> +/*static*/ const FieldID UpdateUsingIonDriftFluxTask::FID_m_e = FID_deta_e; + +template<> +void UpdateUsingIonDriftFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for EulerGhost region + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + const AccessorRO< Vec3, 3> acc_eField (regions[0], FID_electricField); + const AccessorRO acc_Ki (regions[0], FID_Ki); + + // Accessors for DiffGhost region + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + + // Accessors for DivgGhost region + const AccessorRO< int, 3> acc_nType (regions[2], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m_e (regions[3], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // update RHS using Euler and Diffision fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + // Launch the loop for the span + updateRHSSpan(acc_Conserved_t, acc_m_e, acc_nType, + acc_Conserved, acc_MassFracs, acc_Ki, acc_eField, + 0, getSize(r_ModCells), + i-r_ModCells.lo.x, 0, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); + } +} + +// Specielize UpdateUsingIonDriftFlux for the Z direction +template<> +/*static*/ const char * const UpdateUsingIonDriftFluxTask::TASK_NAME = "UpdateUsingIonDriftFluxZ"; +template<> +/*static*/ const int UpdateUsingIonDriftFluxTask::TASK_ID = TID_UpdateUsingIonDriftFluxZ; +template<> +/*static*/ const FieldID UpdateUsingIonDriftFluxTask::FID_nType = FID_nType_z; +template<> +/*static*/ const FieldID UpdateUsingIonDriftFluxTask::FID_m_e = FID_dzet_e; + +template<> +void UpdateUsingIonDriftFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for EulerGhost region + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + const AccessorRO< Vec3, 3> acc_eField (regions[0], FID_electricField); + const AccessorRO acc_Ki (regions[0], FID_Ki); + + // Accessors for DiffGhost region + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + + // Accessors for DivgGhost region + const AccessorRO< int, 3> acc_nType (regions[2], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m_e (regions[3], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // update RHS using Euler and Diffision fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + // Launch the loop for the span + updateRHSSpan(acc_Conserved_t, acc_m_e, acc_nType, + acc_Conserved, acc_MassFracs, acc_Ki, acc_eField, + 0, getSize(r_ModCells), + i-r_ModCells.lo.x, j-r_ModCells.lo.y, 0, + r_ModCells, Fluid_bounds, args.mix); + } +} +#endif + +// AddIonWindSourcesTask +/*static*/ const char * const AddIonWindSourcesTask::TASK_NAME = "AddIonWindSources"; +/*static*/ const int AddIonWindSourcesTask::TASK_ID = TID_AddIonWindSources; + +void AddIonWindSourcesTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 4); + assert(futures.size() == 0); + + // Accessors for stencil variables + const AccessorRO acc_MolarFracs (regions[0], FID_MolarFracs); + + // Accessors for node types and metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi (regions[1], FID_dcsi_d); + const AccessorRO acc_deta (regions[1], FID_deta_d); + const AccessorRO acc_dzet (regions[1], FID_dzet_d); + + // Accessors for primitive variables + const AccessorRO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + const AccessorRO< Vec3, 3> acc_eField (regions[1], FID_electricField); + + // Accessors for properties + const AccessorRO acc_rho (regions[1], FID_rho); + const AccessorRO acc_Di (regions[1], FID_Di); +#if (nIons > 0) + const AccessorRO acc_Ki (regions[1], FID_Ki); +#endif + + // Accessors for RHS + const AccessorRW acc_Conserved_t (regions[2], FID_Conserved_t); + + // Extract execution domain + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + const Point<3> p = Point<3>(i,j,k); + addIonWindSources(acc_Conserved_t[p], + acc_rho, acc_Di, +#if (nIons > 0) + acc_Ki, +#endif + acc_velocity, acc_eField, acc_MolarFracs, + acc_nType_x, acc_nType_y, acc_nType_z, + acc_dcsi, acc_deta, acc_dzet, + p, Fluid_bounds, args.mix); + } +} + +void register_electricField_tasks() { + + // Register task for the Poisson solver + register_poisson_tasks(); + + // Register electric field calculation + TaskHelper::register_hybrid_variants(); + +#if (nIons > 0) + // Refister ion drift flux tasks + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); +#endif + + // Register ion wind source terms task + TaskHelper::register_hybrid_variants(); + +}; diff --git a/src/prometeo_electricField.cu b/src/prometeo_electricField.cu new file mode 100644 index 0000000..c653edc --- /dev/null +++ b/src/prometeo_electricField.cu @@ -0,0 +1,320 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_electricField.hpp" +#include "prometeo_electricField.inl" +#include "cuda_utils.hpp" + +// Declare a constant memory that will hold the Mixture struct (initialized in prometeo_mixture.cu) +extern __device__ __constant__ Mix mix; + +//----------------------------------------------------------------------------- +// KERNELS FOR GetElectricFieldTask +//----------------------------------------------------------------------------- + +__global__ +void GetElectricField_kernel(const AccessorWO< Vec3, 3> eField, + const AccessorRO ePot, + const AccessorRO< int, 3> nType_x, + const AccessorRO< int, 3> nType_y, + const AccessorRO< int, 3> nType_z, + const AccessorRO dcsi_d, + const AccessorRO deta_d, + const AccessorRO dzet_d, + const Rect<3> my_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + eField[p] = -getGrad(ePot, p, + nType_x[p], nType_y[p], nType_z[p], + dcsi_d[p], deta_d[p], dzet_d[p], + Fluid_bounds); + } +} + +__host__ +void GetElectricFieldTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for variables in the Ghost regions + const AccessorRO acc_ePot (regions[0], FID_electricPotential); + + // Accessors for metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi_d (regions[1], FID_dcsi_d); + const AccessorRO acc_deta_d (regions[1], FID_deta_d); + const AccessorRO acc_dzet_d (regions[1], FID_dzet_d); + + // Accessors for gradients + const AccessorWO< Vec3, 3> acc_eField (regions[2], FID_electricField); + + // Extract execution domains + Rect<3> r_MyFluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_MyFluid); + const dim3 num_blocks_3d = dim3((getSize(r_MyFluid) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_MyFluid) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_MyFluid) + (TPB_3d.z - 1)) / TPB_3d.z); + GetElectricField_kernel<<>>( + acc_eField, acc_ePot, + acc_nType_x, acc_nType_y, acc_nType_z, + acc_dcsi_d, acc_deta_d, acc_dzet_d, + r_MyFluid, Fluid_bounds, + getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid)); +} + +#if (nIons > 0) +//----------------------------------------------------------------------------- +// KERNELS FOR UpdateUsingIonDriftFluxTask +//----------------------------------------------------------------------------- + +template +__global__ +void UpdateRHSUsingIonDriftFlux_kernel(const AccessorRW Conserved_t, + const AccessorRO< int, 3> nType, + const AccessorRO m_e, + const AccessorRO rhoYi, + const AccessorRO Yi, + const AccessorRO Ki, + const AccessorRO< Vec3, 3> eField, + const Rect<3> Flux_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if (isThreadInCrossPlane(size_x, size_y, size_z)) { + const coord_t size = getSize(Fluid_bounds); + const coord_t span_size = getSize(Flux_bounds); + const coord_t firstIndex = firstIndexInSpan(span_size); + if (firstIndex < span_size) { + const coord_t lastIndex = lastIndexInSpan(span_size); + UpdateUsingIonDriftFluxTask::updateRHSSpan( + Conserved_t, m_e, nType, + rhoYi, Yi, Ki, eField, + firstIndex, lastIndex, + x, y, z, + Flux_bounds, Fluid_bounds, mix); + } + } +} + +template +__host__ +void UpdateUsingIonDriftFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for EulerGhost region + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + const AccessorRO< Vec3, 3> acc_eField (regions[0], FID_electricField); + const AccessorRO acc_Ki (regions[0], FID_Ki); + + // Accessors for DiffGhost region + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + + // Accessors for DivgGhost region + const AccessorRO< int, 3> acc_nType (regions[2], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m_e (regions[3], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Launch the kernel to update the RHS using the diffusion fluxes + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_ModCells); + UpdateRHSUsingIonDriftFlux_kernel<<>>( + acc_Conserved_t, + acc_nType, acc_m_e, + acc_Conserved, acc_MassFracs, acc_Ki, acc_eField, + r_ModCells, Fluid_bounds, + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); +} + +template void UpdateUsingIonDriftFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void UpdateUsingIonDriftFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void UpdateUsingIonDriftFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif + +//----------------------------------------------------------------------------- +// KERNELS FOR AddIonWindSourcesTask +//----------------------------------------------------------------------------- + +__global__ +void AddIonWindSourcesTask_kernel( + const AccessorRW Conserved_t, + const AccessorRO rho, + const AccessorRO Di, +#if (nIons > 0) + const AccessorRO Ki, +#endif + const AccessorRO< Vec3, 3> velocity, + const AccessorRO< Vec3, 3> eField, + const AccessorRO MolarFracs, + const AccessorRO< int, 3> nType_x, + const AccessorRO< int, 3> nType_y, + const AccessorRO< int, 3> nType_z, + const AccessorRO m_x, + const AccessorRO m_y, + const AccessorRO m_z, + const Rect<3> my_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + AddIonWindSourcesTask::addIonWindSources(Conserved_t[p], + rho, Di, +#if (nIons > 0) + Ki, +#endif + velocity, eField, MolarFracs, + nType_x, nType_y, nType_z, + m_x, m_y, m_z, + p, Fluid_bounds, mix); + } +} + +__host__ +void AddIonWindSourcesTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 4); + assert(futures.size() == 0); + + // Accessors for stencil variables + const AccessorRO acc_MolarFracs (regions[0], FID_MolarFracs); + + // Accessors for node types and metrics + const AccessorRO< int, 3> acc_nType_x (regions[1], FID_nType_x); + const AccessorRO< int, 3> acc_nType_y (regions[1], FID_nType_y); + const AccessorRO< int, 3> acc_nType_z (regions[1], FID_nType_z); + const AccessorRO acc_dcsi (regions[1], FID_dcsi_d); + const AccessorRO acc_deta (regions[1], FID_deta_d); + const AccessorRO acc_dzet (regions[1], FID_dzet_d); + + // Accessors for primitive variables + const AccessorRO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + const AccessorRO< Vec3, 3> acc_eField (regions[1], FID_electricField); + + // Accessors for properties + const AccessorRO acc_rho (regions[1], FID_rho); + const AccessorRO acc_Di (regions[1], FID_Di); +#if (nIons > 0) + const AccessorRO acc_Ki (regions[1], FID_Ki); +#endif + + // Accessors for RHS + const AccessorRW acc_Conserved_t (regions[2], FID_Conserved_t); + + // Extract execution domain + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Launch the kernel to update the RHS using ion wind source terms + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = dim3((getSize(r_ModCells) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_ModCells) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_ModCells) + (TPB_3d.z - 1)) / TPB_3d.z); + AddIonWindSourcesTask_kernel<<>>( + acc_Conserved_t, + acc_rho, acc_Di, +#if (nIons > 0) + acc_Ki, +#endif + acc_velocity, acc_eField, acc_MolarFracs, + acc_nType_x, acc_nType_y, acc_nType_z, + acc_dcsi, acc_deta, acc_dzet, + r_ModCells, Fluid_bounds, + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); +} + diff --git a/src/IsentropicMix.h b/src/prometeo_electricField.h similarity index 89% rename from src/IsentropicMix.h rename to src/prometeo_electricField.h index 0893219..5d68cff 100644 --- a/src/IsentropicMix.h +++ b/src/prometeo_electricField.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,25 +27,21 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef IsentropicMix_H -#define IsentropicMix_H +#ifndef __PROMETEO_ELECTRICFIELD_H__ +#define __PROMETEO_ELECTRICFIELD_H__ -#define nSpec 1 +#include "legion.h" -#define RGAS 8.3144598 // [J/(mol K)] +#include "Poisson.h" #ifdef __cplusplus extern "C" { #endif -struct Mix { - // Mixture properties - double R; - double gamma; -}; +void register_electricField_tasks(); #ifdef __cplusplus } #endif -#endif // IsentropicMix_H +#endif // __PROMETEO_ELECTRICFIELD_H__ diff --git a/src/prometeo_electricField.hpp b/src/prometeo_electricField.hpp new file mode 100644 index 0000000..e47acb0 --- /dev/null +++ b/src/prometeo_electricField.hpp @@ -0,0 +1,211 @@ +// Copyright (c) "2020, by Centre Européen de Recherche et de Formation Avancée en Calcul Scientifiq +// Developer: Mario Di Renzo +// Affiliation: Centre Européen de Recherche et de Formation Avancée en Calcul Scientifique +// URL: https://cerfacs.fr +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_ELECTRICFIELD_HPP__ +#define __PROMETEO_ELECTRICFIELD_HPP__ + +#include "legion.h" + +using namespace Legion; + +//----------------------------------------------------------------------------- +// LOAD PROMETEO UTILITIES AND MODULES +//----------------------------------------------------------------------------- + +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" +#include "prometeo_types.h" +#include "prometeo_electricField.h" + +//----------------------------------------------------------------------------- +// TASK THAT COMPUTES THE ELECTRIC FIELD +//----------------------------------------------------------------------------- +class GetElectricFieldTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Ghost; + LogicalRegion Fluid; + Rect<3> Fluid_bounds; + FieldID Ghost_fields [FID_last - 101]; + FieldID Fluid_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +#if (nIons > 0) +//----------------------------------------------------------------------------- +// TASK THAT UPDATES THE RHS USING THE ION DRIFT FLUXES +//----------------------------------------------------------------------------- + +template +class UpdateUsingIonDriftFluxTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion EulerGhost; + LogicalRegion DiffGhost; + LogicalRegion FluxGhost; + LogicalRegion Fluid; + LogicalRegion ModCells; + Rect<3> Fluid_bounds; + Mix mix; + FieldID EulerGhost_fields[FID_last - 101]; + FieldID DiffGhost_fields [FID_last - 101]; + FieldID DivgGhost_fields [FID_last - 101]; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +private: + // Direction dependent quantities + static const FieldID FID_nType; + static const FieldID FID_m_e; +private: + __CUDA_H__ + static void GetIonDriftFlux(VecNEq &Flux, + const AccessorRO &rhoYi, + const AccessorRO &Yi, + const AccessorRO &Ki, + const AccessorRO< Vec3, 3> &eField, + const Point<3> &p, + const int nType, + const Mix &mix, + const coord_t size, + const Rect<3> &bounds); +public: + __CUDA_H__ + static void updateRHSSpan(const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &rhoYi, + const AccessorRO &Yi, + const AccessorRO &Ki, + const AccessorRO< Vec3, 3> &eField, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix); + +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; +#endif + +//----------------------------------------------------------------------------- +// TASK THAT UPDATES THE RHS USING THE SOURCE TERMS DUE TO ION WIND +//----------------------------------------------------------------------------- + +class AddIonWindSourcesTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion GradGhost; + LogicalRegion Fluid; + LogicalRegion ModCells; + Rect<3> Fluid_bounds; + Mix mix; + FieldID GradGhost_fields [FID_last - 101]; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + __CUDA_H__ + static inline void addIonWindSources(VecNEq &RHS, + const AccessorRO &rho, + const AccessorRO &Di, +#if (nIons > 0) + const AccessorRO &Ki, +#endif + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &eField, + const AccessorRO &MolarFracs, + const AccessorRO< int, 3> &nType_x, + const AccessorRO< int, 3> &nType_y, + const AccessorRO< int, 3> &nType_z, + const AccessorRO &m_x, + const AccessorRO &m_y, + const AccessorRO &m_z, + const Point<3> &p, + const Rect<3> &bounds, + const Mix &mix); +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +#endif // __PROMETEO_ELECTRICFIELD_HPP__ diff --git a/src/prometeo_electricField.inl b/src/prometeo_electricField.inl new file mode 100644 index 0000000..1e38621 --- /dev/null +++ b/src/prometeo_electricField.inl @@ -0,0 +1,200 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_metric.inl" + +#ifndef __CUDACC__ +using std::max; +using std::min; +#endif + +#if (nIons > 0) +//----------------------------------------------------------------------------- +// INLINE FUNCTIONS FOR UpdateUsingIonDriftFluxTask +//----------------------------------------------------------------------------- + +template +__CUDA_H__ +inline void UpdateUsingIonDriftFluxTask::GetIonDriftFlux( + VecNEq &Flux, + const AccessorRO &rhoYi, + const AccessorRO &Yi, + const AccessorRO &Ki, + const AccessorRO< Vec3, 3> &eField, + const Point<3> &p, + const int nType, + const Mix &mix, + const coord_t dsize, + const Rect<3> &bounds) { + + constexpr int iN = normalIndex(dir); + + // Compute points of the stencil + const Point<3> pts[] = {warpPeriodic(bounds, p, dsize, offM2(nType)), + warpPeriodic(bounds, p, dsize, offM1(nType)), + p, + warpPeriodic(bounds, p, dsize, offP1(nType)), + warpPeriodic(bounds, p, dsize, offP2(nType)), + warpPeriodic(bounds, p, dsize, offP3(nType))}; + + // Loop on each ion + double rhoYiViCorr = 0.0; + double FluxP[6]; double FluxM[6]; + __UNROLL__ + for (int i=0; i +__CUDA_H__ +void UpdateUsingIonDriftFluxTask::updateRHSSpan( + const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &rhoYi, + const AccessorRO &Yi, + const AccessorRO &Ki, + const AccessorRO< Vec3, 3> &eField, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix) { + + const coord_t size = getSize(Fluid_bounds); + VecNEq DriftFluxM; VecNEq DriftFluxP; + DriftFluxM.init(0.0); DriftFluxP.init(0.0); + // Compute flux of first minus inter-cell location + { + const Point<3> p = GetPointInSpan(Flux_bounds, firstIndex, x, y, z); + const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + GetIonDriftFlux(DriftFluxM, + rhoYi, Yi, Ki, eField, + pm1, nType[pm1], mix, size, Fluid_bounds); + } + // Loop across my section of the span + for (coord_t i = firstIndex; i < lastIndex; i++) { + const Point<3> p = GetPointInSpan(Flux_bounds, i, x, y, z); + // Update plus flux + GetIonDriftFlux(DriftFluxP, + rhoYi, Yi, Ki, eField, + p, nType[p], mix, size, Fluid_bounds); + + // Update time derivative + Conserved_t[p] += m_e[p]*(DriftFluxP - DriftFluxM); + + // Store plus flux for next point + DriftFluxM = DriftFluxP; + } +} +#endif + +//----------------------------------------------------------------------------- +// INLINE FUNCTIONS FOR AddIonWindSourcesTask +//----------------------------------------------------------------------------- +__CUDA_H__ +void AddIonWindSourcesTask::addIonWindSources(VecNEq &RHS, + const AccessorRO &rho, + const AccessorRO &Di, +#if (nIons > 0) + const AccessorRO &Ki, +#endif + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &eField, + const AccessorRO &MolarFracs, + const AccessorRO< int, 3> &nType_x, + const AccessorRO< int, 3> &nType_y, + const AccessorRO< int, 3> &nType_z, + const AccessorRO &m_x, + const AccessorRO &m_y, + const AccessorRO &m_z, + const Point<3> &p, + const Rect<3> &bounds, + const Mix &mix) { + + const double MixW = mix.GetMolarWeightFromXi(MolarFracs[p]); + +#if (nIons > 0) + __UNROLL__ + for (uint8_t i=0; i 0) then +local mkUpdateUsingIonDriftFlux = terralib.memoize(function(dir) + local UpdateUsingIonDriftFlux + + local nType + local m_e + local m_d + if (dir == "x") then + nType = "nType_x" + m_e = "dcsi_e" + m_d = "dcsi_d" + elseif (dir == "y") then + nType = "nType_y" + m_e = "deta_e" + m_d = "deta_d" + elseif (dir == "z") then + nType = "nType_z" + m_e = "dzet_e" + m_d = "dzet_d" + else assert(false) end + + extern task UpdateUsingIonDriftFlux(EulerGhost : region(ispace(int3d), Fluid_columns), + DiffGhost : region(ispace(int3d), Fluid_columns), + FluxGhost : region(ispace(int3d), Fluid_columns), + [Fluid], + ModCells : region(ispace(int3d), Fluid_columns), + Fluid_bounds : rect3d, + mix : MIX.Mixture) + where + reads(EulerGhost.Conserved), + reads(EulerGhost.electricField), + reads(EulerGhost.Ki), + reads(DiffGhost.MassFracs), + reads(FluxGhost.[nType]), + reads(Fluid.[m_e]), + reads writes(Fluid.Conserved_t), + [coherence_mode] + end + --for k, v in pairs(UpdateUsingDiffusionFlux:get_params_struct():getentries()) do + -- print(k, v) + -- for k2, v2 in pairs(v) do print(k2, v2) end + --end + if (dir == "x") then + UpdateUsingIonDriftFlux:set_task_id(TYPES.TID_UpdateUsingIonDriftFluxX) + elseif (dir == "y") then + UpdateUsingIonDriftFlux:set_task_id(TYPES.TID_UpdateUsingIonDriftFluxY) + elseif (dir == "z") then + UpdateUsingIonDriftFlux:set_task_id(TYPES.TID_UpdateUsingIonDriftFluxZ) + end + return UpdateUsingIonDriftFlux +end) + +__demand(__inline) +task Exports.UpdateUsingIonDriftFlux(Fluid : region(ispace(int3d), Fluid_columns), + tiles : ispace(int3d), + Fluid_Zones : zones_partitions(Fluid, tiles), + Fluid_Ghost : ghost_partitions(Fluid, tiles), + Mix : MIX.Mixture, + config : SCHEMA.Config) +where + reads writes(Fluid) +do + var {p_All, p_x_divg, p_y_divg, p_z_divg} = Fluid_Zones; + var {p_XFluxGhosts, p_YFluxGhosts, p_ZFluxGhosts, + p_XDiffGhosts, p_YDiffGhosts, p_ZDiffGhosts, + p_XEulerGhosts2, p_YEulerGhosts2, p_ZEulerGhosts2} = Fluid_Ghost; + + __demand(__index_launch) + for c in tiles do + [mkUpdateUsingIonDriftFlux("z")](p_ZEulerGhosts2[c], p_ZDiffGhosts[c], p_ZFluxGhosts[c], + p_All[c], p_z_divg[c], Fluid.bounds, Mix) + end + + __demand(__index_launch) + for c in tiles do + [mkUpdateUsingIonDriftFlux("y")](p_YEulerGhosts2[c], p_YDiffGhosts[c], p_YFluxGhosts[c], + p_All[c], p_y_divg[c], Fluid.bounds, Mix) + end + + __demand(__index_launch) + for c in tiles do + [mkUpdateUsingIonDriftFlux("x")](p_XEulerGhosts2[c], p_XDiffGhosts[c], p_XFluxGhosts[c], + p_All[c], p_x_divg[c], Fluid.bounds, Mix) + end +end +end + +------------------------------------------------------------------------------- +-- ELECTRIC SOURCE TERM TASKS +------------------------------------------------------------------------------- + +local Prop = terralib.newlist({"rho", "Di"}) +if (MIX.nIons > 0) then + Prop:insert("Ki") +end +extern task Exports.AddIonWindSources(GradGhost : region(ispace(int3d), Fluid_columns), + [Fluid], + ModCells : region(ispace(int3d), Fluid_columns), + Fluid_bounds : rect3d, + mix : MIX.Mixture) +where + reads(GradGhost.MolarFracs), + reads(Fluid.{nType_x, nType_y, nType_z}), + reads(Fluid.{dcsi_d, deta_d, dzet_d}), + reads(Fluid.{velocity, electricField}), + reads(Fluid.[Prop]), + reads writes(Fluid.Conserved_t), + [coherence_mode] +end +Exports.AddIonWindSources:set_task_id(TYPES.TID_AddIonWindSources) + +return Exports end + diff --git a/src/prometeo_init.rg b/src/prometeo_init.rg index 218f721..b55d748 100644 --- a/src/prometeo_init.rg +++ b/src/prometeo_init.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -29,7 +29,7 @@ import "regent" -return function(SCHEMA, MIX, CHEM, Fluid_columns) local Exports = {} +return function(SCHEMA, MIX, Fluid_columns) local Exports = {} -- Variable indices local nSpec = MIX.nSpec -- Number of species composing the mixture @@ -55,7 +55,7 @@ local Primitives = CONST.Primitives -- INITIALIZATION ROUTINES ------------------------------------------------------------------------------- -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED task Exports.InitializeUniform(Fluid : region(ispace(int3d), Fluid_columns), initPressure : double, initTemperature : double, @@ -96,7 +96,7 @@ do end end -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP task Exports.InitializeTaylorGreen2D(Fluid : region(ispace(int3d), Fluid_columns), taylorGreenPressure : double, taylorGreenTemperature : double, @@ -110,9 +110,8 @@ where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) do - __demand(__openmp) + MIX.ClipYi(&taylorGreenMolarFracs[0], mix) for c in Fluid do - MIX.ClipYi(taylorGreenMolarFracs) var MixW = MIX.GetMolarWeightFromXi(taylorGreenMolarFracs, mix) var taylorGreenDensity = MIX.GetRho(taylorGreenPressure, taylorGreenTemperature, MixW, mix) var xy = Fluid[c].centerCoordinates @@ -122,11 +121,11 @@ do var factor = (cos((2.0*xy[0]))+cos((2.0*xy[1]))) var pressure = (taylorGreenPressure+(((taylorGreenDensity*pow(taylorGreenVelocity, 2.0))/4.0)*factor)) Fluid[c].pressure = pressure - Fluid[c].temperature = MIX.GetTFromRhoAndP(taylorGreenDensity, MixW, pressure) + Fluid[c].temperature = MIX.GetTFromRhoAndP(taylorGreenDensity, MixW, pressure, mix) end end -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP task Exports.InitializeTaylorGreen3D(Fluid : region(ispace(int3d), Fluid_columns), taylorGreenPressure : double, taylorGreenTemperature : double, @@ -140,9 +139,8 @@ where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) do - __demand(__openmp) + MIX.ClipYi(&taylorGreenMolarFracs[0], mix) for c in Fluid do - MIX.ClipYi(taylorGreenMolarFracs) var MixW = MIX.GetMolarWeightFromXi(taylorGreenMolarFracs, mix) var taylorGreenDensity = MIX.GetRho(taylorGreenPressure, taylorGreenTemperature, MixW, mix) var xy = Fluid[c].centerCoordinates @@ -153,7 +151,7 @@ do var factorB = (cos((2.0*xy[0]))+cos((2.0*xy[1]))) var pressure = (taylorGreenPressure+((((taylorGreenDensity*pow(taylorGreenVelocity, 2.0))/16.0)*factorA)*factorB)) Fluid[c].pressure = pressure - Fluid[c].temperature = MIX.GetTFromRhoAndP(taylorGreenDensity, MixW, pressure) + Fluid[c].temperature = MIX.GetTFromRhoAndP(taylorGreenDensity, MixW, pressure, mix) end end @@ -179,10 +177,9 @@ do end -- Test 1 in Toro "Riemann Solvers and Numerical Methods for Fluid Dynamics" (2013) -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED task Exports.InitializeRiemannTestOne(Fluid : region(ispace(int3d), Fluid_columns), - initMolarFracs : double[nSpec], - mix : MIX.Mixture) + initMolarFracs : double[nSpec]) where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) @@ -204,10 +201,9 @@ do end -- Test 4 in Toro "Riemann Solvers and Numerical Methods for Fluid Dynamics" (2013) -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED task Exports.InitializeRiemannTestTwo(Fluid : region(ispace(int3d), Fluid_columns), - initMolarFracs : double[nSpec], - mix : MIX.Mixture) + initMolarFracs : double[nSpec]) where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) @@ -228,10 +224,9 @@ do end end -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED task Exports.InitializeSodProblem(Fluid : region(ispace(int3d), Fluid_columns), - initMolarFracs : double[nSpec], - mix : MIX.Mixture) + initMolarFracs : double[nSpec]) where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) @@ -252,10 +247,9 @@ do end end -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED task Exports.InitializeLaxProblem(Fluid : region(ispace(int3d), Fluid_columns), - initMolarFracs : double[nSpec], - mix : MIX.Mixture) + initMolarFracs : double[nSpec]) where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) @@ -276,10 +270,9 @@ do end end -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED task Exports.InitializeShuOsherProblem(Fluid : region(ispace(int3d), Fluid_columns), - initMolarFracs : double[nSpec], - mix : MIX.Mixture) + initMolarFracs : double[nSpec]) where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) @@ -300,7 +293,7 @@ do end end -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA, NO OPENMP task Exports.InitializeVortexAdvection2D(Fluid : region(ispace(int3d), Fluid_columns), VortexPressure : double, VortexTemperature : double, @@ -312,7 +305,6 @@ where reads(Fluid.centerCoordinates), writes(Fluid.[Primitives]) do - __demand(__openmp) for c in Fluid do var Beta = 5.0 var x0 = 0.0 @@ -323,7 +315,7 @@ do var r2 = rx*rx + ry*ry var MixW = MIX.GetMolarWeightFromXi(VortexMolarFracs, mix) - var Yi = MIX.GetMassFractions(MixW, VortexMolarFracs, mix) + var Yi : double[nSpec]; MIX.GetMassFractions(&Yi[0], MixW, VortexMolarFracs, mix) var gamma = MIX.GetGamma(VortexTemperature, MixW, Yi, mix) var T = VortexTemperature*(1.0 - (gamma - 1.0)*Beta*Beta/(8*PI*PI*gamma)*exp(1.0 - r2)) var P = VortexPressure*pow(T, gamma/(gamma - 1.0)) @@ -337,7 +329,7 @@ do end end -__demand(__cuda,__leaf) -- MANUALLY PARALLELIZED, +__demand(__leaf) -- MANUALLY PARALLELIZED, NO CUDA task Exports.InitializeGrossmanCinnellaProblem(Fluid : region(ispace(int3d), Fluid_columns), mix : MIX.Mixture) where @@ -361,8 +353,8 @@ do C.snprintf([&int8](leftMix.Species.values[4].Name), 10, "O") leftMix.Species.values[4].MolarFrac = 2.125451e-01 - var LeftMolarFracs = CHEM.ParseConfigMixture(leftMix, mix) - + var LeftMolarFracs = MIX.ParseConfigMixture(leftMix, mix) + -- Right-hand side mixture var rightMix : SCHEMA.Mixture rightMix.Species.length = 2 @@ -371,7 +363,7 @@ do C.snprintf([&int8](rightMix.Species.values[1].Name), 10, "O2") rightMix.Species.values[1].MolarFrac = 0.210000e+00 - var RightMolarFracs = CHEM.ParseConfigMixture(rightMix, mix) + var RightMolarFracs = MIX.ParseConfigMixture(rightMix, mix) __demand(__openmp) for c in Fluid do @@ -379,13 +371,13 @@ do if (x < 0.5) then Fluid[c].MolarFracs = LeftMolarFracs Fluid[c].velocity = array(0.0, 0.0, 0.0) - Fluid[c].pressure = 1.95256e5 - Fluid[c].temperature = 9000.0 + Fluid[c].pressure = 1.95256e1 + Fluid[c].temperature = 30.0 else Fluid[c].MolarFracs = RightMolarFracs Fluid[c].velocity = array(0.0, 0.0, 0.0) - Fluid[c].pressure = 1.0e4 - Fluid[c].temperature = 300.0 + Fluid[c].pressure = 1.0 + Fluid[c].temperature = 1.0 end end end @@ -409,7 +401,7 @@ do -- Initializes the channel with a streamwise velocity profile ~y^4 -- streaks and random noise are used for the spanwise and wall-normal directions -- the fluid composition is uniform - MIX.ClipYi(initMolarFracs) + MIX.ClipYi(&initMolarFracs[0], mix) var rngState : C.drand48_data C.srand48_r(C.legion_get_current_time_in_nanos(), &rngState) diff --git a/src/prometeo_mapper.cc b/src/prometeo_mapper.cc index 555a863..187f8a7 100644 --- a/src/prometeo_mapper.cc +++ b/src/prometeo_mapper.cc @@ -384,7 +384,7 @@ class SampleMapping { unsigned coord = (dim_ == 0) ? (dir_ ? 0 : parent_.ranks_per_dim_[0]-1) : (dim_ == 1) ? (dir_ ? 0 : parent_.ranks_per_dim_[1]-1) : - /*dim_ == 2*/ (dir_ ? 0 : parent_.ranks_per_dim_[1]-1) ; + /*dim_ == 2*/ (dir_ ? 0 : parent_.ranks_per_dim_[2]-1) ; return (dim_ == 0) ? Point<3>(coord, point[0], point[1]) : (dim_ == 1) ? Point<3>(point[0], coord, point[1]) : @@ -510,6 +510,10 @@ class PrometeoMapper : public DefaultMapper { EQUALS(task.get_task_name(), "InitializeBoundarLayerData") || EQUALS(task.get_task_name(), "GetRescalingData") || EQUALS(task.get_task_name(), "cache_grid_translation") || +#ifdef ELECTRIC_FIELD + EQUALS(task.get_task_name(), "initCoefficients") || + EQUALS(task.get_task_name(), "InitWaveNumbers") || +#endif STARTS_WITH(task.get_task_name(), "FastInterp") || STARTS_WITH(task.get_task_name(), "readTileAttr")) { @@ -582,6 +586,10 @@ class PrometeoMapper : public DefaultMapper { EQUALS(task.get_task_name(), "ComputeRecycleAveragePosition") || EQUALS(task.get_task_name(), "InitializeBoundarLayerData") || EQUALS(task.get_task_name(), "GetRescalingData") || +#ifdef ELECTRIC_FIELD + EQUALS(task.get_task_name(), "initCoefficients") || + EQUALS(task.get_task_name(), "InitWaveNumbers") || +#endif STARTS_WITH(task.get_task_name(), "FastInterp") || STARTS_WITH(task.get_task_name(), "__unary_") || STARTS_WITH(task.get_task_name(), "__binary_") || @@ -632,6 +640,10 @@ class PrometeoMapper : public DefaultMapper { EQUALS(task.get_task_name(), "ComputeRecycleAveragePosition") || EQUALS(task.get_task_name(), "InitializeBoundarLayerData") || EQUALS(task.get_task_name(), "GetRescalingData") || +#ifdef ELECTRIC_FIELD + EQUALS(task.get_task_name(), "initCoefficients") || + EQUALS(task.get_task_name(), "InitWaveNumbers") || +#endif EQUALS(task.get_task_name(), "cache_grid_translation") || STARTS_WITH(task.get_task_name(), "FastInterp") || STARTS_WITH(task.get_task_name(), "Exports.Console_Write") || @@ -789,7 +801,7 @@ class PrometeoMapper : public DefaultMapper { STARTS_WITH(task.get_task_name(), "UpdateUsingDiffusionFlux") || // STARTS_WITH(task.get_task_name(), "CorrectUsingFlux") || STARTS_WITH(task.get_task_name(), "UpdateVars") || - STARTS_WITH(task.get_task_name(), "Exports.UpdateChemistry")) { + STARTS_WITH(task.get_task_name(), "UpdateChemistry")) { priority = 1; } return priority; @@ -885,8 +897,30 @@ class PrometeoMapper : public DefaultMapper { // zero-copy memory. virtual Memory default_policy_select_target_memory(MapperContext ctx, Processor target_proc, - const RegionRequirement& req) { - return DefaultMapper::default_policy_select_target_memory(ctx, target_proc, req); + const RegionRequirement& req, + MemoryConstraint mc) { +#ifdef ELECTRIC_FIELD + // A root region uses the default policy + if (!runtime->has_parent_logical_partition(ctx, req.region)) { + LOG.debug() << "Root region uses default target memory"; + return DefaultMapper::default_policy_select_target_memory(ctx, target_proc, req, mc); + } + + // Get partition name + LogicalPartition parent_partition = runtime->get_parent_logical_partition(ctx, req.region); + const char *name = get_partition_name(ctx, parent_partition); + CHECK(name != NULL, "Found an unnamed partition"); + +#ifdef REALM_USE_CUDA + if (EQUALS(name, "Poisson_plans")) + // Put FFT plans in zero-copy memory. + return Utilities::MachineQueryInterface::find_memory_kind(machine, target_proc, + Memory::Z_COPY_MEM); +#endif +#endif + + // Otherwise go through the standard path + return DefaultMapper::default_policy_select_target_memory(ctx, target_proc, req, mc); } // Disable an optimization done by the default mapper (attempts to reuse an @@ -912,7 +946,7 @@ class PrometeoMapper : public DefaultMapper { if (EQUALS(name, "p_All") || EQUALS(name, "p_Interior") || EQUALS(name, "p_AllBCs") || - EQUALS(name, "p_solved") || + EQUALS(name, "p_solved") || EQUALS(name, "p_GradientGhosts") || EQUALS(name, "p_MetricGhosts") || EQUALS(name, "p_x_divg") || EQUALS(name, "p_y_divg") || EQUALS(name, "p_z_divg") || diff --git a/src/prometeo_metric.cc b/src/prometeo_metric.cc index c0d24a7..faaf62e 100644 --- a/src/prometeo_metric.cc +++ b/src/prometeo_metric.cc @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -39,7 +39,7 @@ void InitializeMetricTask::cpu_base_impl( const std::vector &futures, Context ctx, Runtime *runtime) { - assert(regions.size() == 5); + assert(regions.size() == 2); assert(futures.size() == 0); // Accessors for variables in the Ghost regions @@ -49,17 +49,17 @@ void InitializeMetricTask::cpu_base_impl( const AccessorRO< int, 3> acc_nType_z (regions[0], FID_nType_z); // Accessors for metrics - const AccessorRW acc_dcsi_e(regions[4], FID_dcsi_e); - const AccessorRW acc_deta_e(regions[4], FID_deta_e); - const AccessorRW acc_dzet_e(regions[4], FID_dzet_e); + const AccessorWO acc_dcsi_e(regions[1], FID_dcsi_e); + const AccessorWO acc_deta_e(regions[1], FID_deta_e); + const AccessorWO acc_dzet_e(regions[1], FID_dzet_e); - const AccessorRW acc_dcsi_d(regions[4], FID_dcsi_d); - const AccessorRW acc_deta_d(regions[4], FID_deta_d); - const AccessorRW acc_dzet_d(regions[4], FID_dzet_d); + const AccessorWO acc_dcsi_d(regions[1], FID_dcsi_d); + const AccessorWO acc_deta_d(regions[1], FID_deta_d); + const AccessorWO acc_dzet_d(regions[1], FID_dzet_d); - const AccessorRW acc_dcsi_s(regions[4], FID_dcsi_s); - const AccessorRW acc_deta_s(regions[4], FID_deta_s); - const AccessorRW acc_dzet_s(regions[4], FID_dzet_s); + const AccessorWO acc_dcsi_s(regions[1], FID_dcsi_s); + const AccessorWO acc_deta_s(regions[1], FID_deta_s); + const AccessorWO acc_dzet_s(regions[1], FID_dzet_s); // Extract execution domains Rect<3> r_MyFluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); diff --git a/src/prometeo_metric.cu b/src/prometeo_metric.cu index 3896138..38c9852 100644 --- a/src/prometeo_metric.cu +++ b/src/prometeo_metric.cu @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -36,36 +36,9 @@ template __global__ -void ReconstructCoordinates_kernel(const DeferredBuffer coord, - const AccessorRO< Vec3, 3> centerCoordinates, - const AccessorRO< int, 3> nType, - const Rect<3> my_bounds, - const Rect<3> Fluid_bounds, - const double width, - const coord_t size_x, - const coord_t size_y, - const coord_t size_z, - const coord_t size) -{ - int x = blockIdx.x * blockDim.x + threadIdx.x; - int y = blockIdx.y * blockDim.y + threadIdx.y; - int z = blockIdx.z * blockDim.z + threadIdx.z; - - if ((x < size_x) && (y < size_y) && (z < size_z)) { - const Point<3> p = Point<3>(x + my_bounds.lo.x, - y + my_bounds.lo.y, - z + my_bounds.lo.z); - (*coord.ptr(p)) = InitializeMetricTask::reconstructCoordEuler(centerCoordinates, p, width, - nType[p], size, Fluid_bounds); - } -} - -template -__global__ -void ComputeMetrics_kernel(const DeferredBuffer coord, - const AccessorRW m_e, - const AccessorRW m_d, - const AccessorRW m_s, +void ComputeMetrics_kernel(const AccessorWO m_e, + const AccessorWO m_d, + const AccessorWO m_s, const AccessorRO< Vec3, 3> centerCoordinates, const AccessorRO< int, 3> nType, const Rect<3> my_bounds, @@ -73,23 +46,44 @@ void ComputeMetrics_kernel(const DeferredBuffer coord, const double width, const coord_t size_x, const coord_t size_y, - const coord_t size_z, - const coord_t size) + const coord_t size_z) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int z = blockIdx.z * blockDim.z + threadIdx.z; - if ((x < size_x) && (y < size_y) && (z < size_z)) { - const Point<3> p = Point<3>(x + my_bounds.lo.x, - y + my_bounds.lo.y, - z + my_bounds.lo.z); - const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); - m_e[p] = 1.0/((*coord.ptr(p)) - unwarpCoordinate((*coord.ptr(pm1)), width, -1, p, Fluid_bounds)); - InitializeMetricTask::ComputeDiffusionMetrics(m_d, m_s, centerCoordinates, p, - width, nType[p], size, Fluid_bounds); + if (isThreadInCrossPlane(size_x, size_y, size_z)) { + const coord_t size = getSize(Fluid_bounds); + const coord_t span_size = getSize(my_bounds); + const coord_t firstIndex = firstIndexInSpan(span_size); + if (firstIndex < span_size) { + const coord_t lastIndex = lastIndexInSpan(span_size); + double coordM_e; double coordP_e; + // Reconstruct the coordinate at -1/2 of the first point + { + const Point<3> p = GetPointInSpan(my_bounds, firstIndex, x, y, z); + const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + coordM_e = InitializeMetricTask::reconstructCoordEuler(centerCoordinates, pm1, width, + nType[pm1], size, Fluid_bounds); + coordM_e = unwarpCoordinate(coordM_e, width, -1, p, Fluid_bounds); + } + // Loop across my section of the span + for (coord_t i = firstIndex; i < lastIndex; i++) { + const Point<3> p = GetPointInSpan(my_bounds, i, x, y, z); + coordP_e = InitializeMetricTask::reconstructCoordEuler(centerCoordinates, p, width, + nType[p], size, Fluid_bounds); + // Compute the metrics + m_e[p] = 1.0/(coordP_e - coordM_e); + InitializeMetricTask::ComputeDiffusionMetrics(m_d, m_s, centerCoordinates, p, + width, nType[p], size, Fluid_bounds); + + // Store plus values for next point + coordM_e = coordP_e; + } + } } } + __host__ void InitializeMetricTask::gpu_base_impl( const Args &args, @@ -97,7 +91,7 @@ void InitializeMetricTask::gpu_base_impl( const std::vector &futures, Context ctx, Runtime *runtime) { - assert(regions.size() == 5); + assert(regions.size() == 2); assert(futures.size() == 0); // Accessors for variables in the Ghost regions @@ -107,17 +101,17 @@ void InitializeMetricTask::gpu_base_impl( const AccessorRO< int, 3> acc_nType_z (regions[0], FID_nType_z); // Accessors for metrics - const AccessorRW acc_dcsi_e(regions[4], FID_dcsi_e); - const AccessorRW acc_deta_e(regions[4], FID_deta_e); - const AccessorRW acc_dzet_e(regions[4], FID_dzet_e); + const AccessorWO acc_dcsi_e(regions[1], FID_dcsi_e); + const AccessorWO acc_deta_e(regions[1], FID_deta_e); + const AccessorWO acc_dzet_e(regions[1], FID_dzet_e); - const AccessorRW acc_dcsi_d(regions[4], FID_dcsi_d); - const AccessorRW acc_deta_d(regions[4], FID_deta_d); - const AccessorRW acc_dzet_d(regions[4], FID_dzet_d); + const AccessorWO acc_dcsi_d(regions[1], FID_dcsi_d); + const AccessorWO acc_deta_d(regions[1], FID_deta_d); + const AccessorWO acc_dzet_d(regions[1], FID_dzet_d); - const AccessorRW acc_dcsi_s(regions[4], FID_dcsi_s); - const AccessorRW acc_deta_s(regions[4], FID_deta_s); - const AccessorRW acc_dzet_s(regions[4], FID_dzet_s); + const AccessorWO acc_dcsi_s(regions[1], FID_dcsi_s); + const AccessorWO acc_deta_s(regions[1], FID_deta_s); + const AccessorWO acc_dzet_s(regions[1], FID_dzet_s); // Extract execution domains Rect<3> r_MyFluid = runtime->get_index_space_domain(ctx, args.Fluid.get_index_space()); @@ -135,101 +129,38 @@ void InitializeMetricTask::gpu_base_impl( // X direction { - const coord_t size = getSize(Fluid_bounds); - - Domain Ghost = runtime->get_index_space_domain(ctx, args.XGhost.get_index_space()); - - // Store the reconstructed coordinate in a deferred buffer - DeferredBuffer X(Memory::GPU_FB_MEM, Ghost); - - // Launch the kernel to reconstruct the coordinates - for (RectInDomainIterator<3> Rit(Ghost); Rit(); Rit++) { - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, *Rit); - const dim3 num_blocks_3d = dim3((getSize(*Rit) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(*Rit) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(*Rit) + (TPB_3d.z - 1)) / TPB_3d.z); - ReconstructCoordinates_kernel<<>>( - X, acc_centerCoordinates, acc_nType_x, (*Rit), - Fluid_bounds, args.Grid_xWidth, - getSize(*Rit), getSize(*Rit), getSize(*Rit), size); - } - // Launch the kernel that computes the metric - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_MyFluid); - const dim3 num_blocks_3d = dim3((getSize(r_MyFluid) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(r_MyFluid) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(r_MyFluid) + (TPB_3d.z - 1)) / TPB_3d.z); + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_MyFluid); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_MyFluid); ComputeMetrics_kernel<<>>( - X, acc_dcsi_e, acc_dcsi_d, acc_dcsi_s, + acc_dcsi_e, acc_dcsi_d, acc_dcsi_s, acc_centerCoordinates, acc_nType_x, r_MyFluid, Fluid_bounds, args.Grid_xWidth, - getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid), size); + getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid)); } // Y direction { - const coord_t size = getSize(Fluid_bounds); - - Domain Ghost = runtime->get_index_space_domain(ctx, args.YGhost.get_index_space()); - - // Store the reconstructed coordinate in a deferred buffer - DeferredBuffer Y(Memory::GPU_FB_MEM, Ghost); - - // Launch the kernel to reconstruct the coordinates - for (RectInDomainIterator<3> Rit(Ghost); Rit(); Rit++) { - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, *Rit); - const dim3 num_blocks_3d = dim3((getSize(*Rit) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(*Rit) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(*Rit) + (TPB_3d.z - 1)) / TPB_3d.z); - ReconstructCoordinates_kernel<<>>( - Y, acc_centerCoordinates, acc_nType_y, (*Rit), - Fluid_bounds, args.Grid_yWidth, - getSize(*Rit), getSize(*Rit), getSize(*Rit), size); - } - // Launch the kernel that computes the metric - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_MyFluid); - const dim3 num_blocks_3d = dim3((getSize(r_MyFluid) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(r_MyFluid) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(r_MyFluid) + (TPB_3d.z - 1)) / TPB_3d.z); + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_MyFluid); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_MyFluid); ComputeMetrics_kernel<<>>( - Y, acc_deta_e, acc_deta_d, acc_deta_s, + acc_deta_e, acc_deta_d, acc_deta_s, acc_centerCoordinates, acc_nType_y, r_MyFluid, Fluid_bounds, args.Grid_yWidth, - getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid), size); + getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid)); } // Z direction { - const coord_t size = getSize(Fluid_bounds); - - Domain Ghost = runtime->get_index_space_domain(ctx, args.ZGhost.get_index_space()); - - // Store the reconstructed coordinate in a deferred buffer - DeferredBuffer Z(Memory::GPU_FB_MEM, Ghost); - - // Launch the kernel to reconstruct the coordinates - for (RectInDomainIterator<3> Rit(Ghost); Rit(); Rit++) { - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, *Rit); - const dim3 num_blocks_3d = dim3((getSize(*Rit) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(*Rit) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(*Rit) + (TPB_3d.z - 1)) / TPB_3d.z); - ReconstructCoordinates_kernel<<>>( - Z, acc_centerCoordinates, acc_nType_z, (*Rit), - Fluid_bounds, args.Grid_zWidth, - getSize(*Rit), getSize(*Rit), getSize(*Rit), size); - } - // Launch the kernel that computes the metric - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_MyFluid); - const dim3 num_blocks_3d = dim3((getSize(r_MyFluid) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(r_MyFluid) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(r_MyFluid) + (TPB_3d.z - 1)) / TPB_3d.z); + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_MyFluid); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_MyFluid); ComputeMetrics_kernel<<>>( - Z, acc_dzet_e, acc_dzet_d, acc_dzet_s, + acc_dzet_e, acc_dzet_d, acc_dzet_s, acc_centerCoordinates, acc_nType_z, r_MyFluid, Fluid_bounds, args.Grid_zWidth, - getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid), size); + getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid)); } // Cleanup the streams diff --git a/src/prometeo_metric.hpp b/src/prometeo_metric.hpp index 0f1dbdf..064b8bd 100644 --- a/src/prometeo_metric.hpp +++ b/src/prometeo_metric.hpp @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -38,8 +38,9 @@ using namespace Legion; // LOAD PROMETEO UTILITIES AND MODULES //----------------------------------------------------------------------------- +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" #include "prometeo_types.h" -#include "task_helper.h" #include "prometeo_metric.h" #include "prometeo_metric.inl" @@ -50,11 +51,11 @@ using namespace Legion; template __CUDA_H__ inline double unwarpCoordinate(double x, const double w, const int off, - Point<3> p, const Rect<3> bounds); + Point<3> p, const Rect<3> &bounds); template<> __CUDA_H__ inline double unwarpCoordinate(double x, const double w, const int off, - Point<3> p, const Rect<3> bounds) { + Point<3> p, const Rect<3> &bounds) { p.x += off; // if we are below the lower bound start by shifting: // - x by -1 width @@ -65,7 +66,7 @@ inline double unwarpCoordinate(double x, const double w, const int off, template<> __CUDA_H__ inline double unwarpCoordinate(double y, const double w, const int off, - Point<3> p, const Rect<3> bounds) { + Point<3> p, const Rect<3> &bounds) { p.y += off; // if we are below the lower bound start by shifting: // - y by -1 width @@ -76,7 +77,7 @@ inline double unwarpCoordinate(double y, const double w, const int off, template<> __CUDA_H__ inline double unwarpCoordinate(double z, const double w, const int off, - Point<3> p, const Rect<3> bounds) { + Point<3> p, const Rect<3> &bounds) { p.z += off; // if we are below the lower bound start by shifting: // - z by -1 width @@ -94,18 +95,12 @@ class InitializeMetricTask { struct Args { uint64_t arg_mask[1]; LogicalRegion MetricGhost; - LogicalRegion XGhost; - LogicalRegion YGhost; - LogicalRegion ZGhost; LogicalRegion Fluid; Rect<3> Fluid_bounds; double Grid_xWidth; double Grid_yWidth; double Grid_zWidth; FieldID MetricGhost_fields [FID_last - 101]; - FieldID XGhost_fields [FID_last - 101]; - FieldID YGhost_fields [FID_last - 101]; - FieldID ZGhost_fields [FID_last - 101]; FieldID Fluid_fields [FID_last - 101]; }; public: @@ -118,18 +113,14 @@ class InitializeMetricTask { // Direction dependent quantities template __CUDA_H__ - static inline double reconstructCoordEuler(const AccessorRO centerCoordinates, - const Point<3> p, + static inline double reconstructCoordEuler(const AccessorRO ¢erCoordinates, + const Point<3> &p, const double width, const int nType, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; + constexpr int iN = normalIndex(dir); // Compute stencil points const Point<3> pM2 = warpPeriodic(bounds, p, dsize, offM2(nType)); @@ -150,20 +141,16 @@ class InitializeMetricTask { template __CUDA_H__ - static inline void ComputeDiffusionMetrics(const AccessorRW m_d, - const AccessorRW m_s, - const AccessorRO< Vec3, 3> centerCoordinates, - const Point<3> p, + static inline void ComputeDiffusionMetrics(const AccessorWO &m_d, + const AccessorWO &m_s, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const Point<3> &p, const double width, const int nType, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; + constexpr int iN = normalIndex(dir); const Point<3> pM1 = warpPeriodic(bounds, p, dsize, offM1(nType)); const Point<3> pP1 = warpPeriodic(bounds, p, dsize, offP1(nType)); @@ -215,13 +202,14 @@ class CorrectGhostMetricTask { static const FieldID FID_m; public: __CUDA_H__ - static inline void CorrectLeftStaggered(const AccessorRW m, - const AccessorRO< Vec3, 3> centerCoordinates, - const Point<3> p) { - int iN; Point<3> pp1; Point<3> pp2; - if (dir == Xdir) { iN = 0; pp1 = p + Point<3>(1, 0, 0); pp2 = p + Point<3>(2, 0, 0); } - else if (dir == Ydir) { iN = 1; pp1 = p + Point<3>(0, 1, 0); pp2 = p + Point<3>(0, 2, 0); } - else if (dir == Zdir) { iN = 2; pp1 = p + Point<3>(0, 0, 1); pp2 = p + Point<3>(0, 0, 2); } + static inline void CorrectLeftStaggered(const AccessorRW &m, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const Point<3> &p) { + constexpr int iN = normalIndex(dir); + Point<3> pp1; Point<3> pp2; + if (dir == Xdir) { pp1 = p + Point<3>(1, 0, 0); pp2 = p + Point<3>(2, 0, 0); } + else if (dir == Ydir) { pp1 = p + Point<3>(0, 1, 0); pp2 = p + Point<3>(0, 2, 0); } + else if (dir == Zdir) { pp1 = p + Point<3>(0, 0, 1); pp2 = p + Point<3>(0, 0, 2); } m[p] = 1.0/(- 8.0/3.0*centerCoordinates[p ][iN] + 3.0 *centerCoordinates[pp1][iN] - 1.0/3.0*centerCoordinates[pp2][iN]); @@ -229,25 +217,27 @@ class CorrectGhostMetricTask { // for computational efficiency. Remeber this comment when you compute the fluxes }; __CUDA_H__ - static inline void CorrectLeftCollocated(const AccessorRW m, - const AccessorRO< Vec3, 3> centerCoordinates, - const Point<3> p) { - int iN; Point<3> pp1; Point<3> pp2; - if (dir == Xdir) { iN = 0; pp1 = p + Point<3>(1, 0, 0); pp2 = p + Point<3>(2, 0, 0); } - else if (dir == Ydir) { iN = 1; pp1 = p + Point<3>(0, 1, 0); pp2 = p + Point<3>(0, 2, 0); } - else if (dir == Zdir) { iN = 2; pp1 = p + Point<3>(0, 0, 1); pp2 = p + Point<3>(0, 0, 2); } + static inline void CorrectLeftCollocated(const AccessorRW &m, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const Point<3> &p) { + constexpr int iN = normalIndex(dir); + Point<3> pp1; Point<3> pp2; + if (dir == Xdir) { pp1 = p + Point<3>(1, 0, 0); pp2 = p + Point<3>(2, 0, 0); } + else if (dir == Ydir) { pp1 = p + Point<3>(0, 1, 0); pp2 = p + Point<3>(0, 2, 0); } + else if (dir == Zdir) { pp1 = p + Point<3>(0, 0, 1); pp2 = p + Point<3>(0, 0, 2); } m[p] = 1.0/(- 1.5*centerCoordinates[p ][iN] + 2.0*centerCoordinates[pp1][iN] - 0.5*centerCoordinates[pp2][iN]); }; __CUDA_H__ - static inline void CorrectRightStaggered(const AccessorRW m, - const AccessorRO< Vec3, 3> centerCoordinates, - const Point<3> p) { - int iN; Point<3> pm1; Point<3> pm2; - if (dir == Xdir) { iN = 0; pm1 = p - Point<3>(1, 0, 0); pm2 = p - Point<3>(2, 0, 0); } - else if (dir == Ydir) { iN = 1; pm1 = p - Point<3>(0, 1, 0); pm2 = p - Point<3>(0, 2, 0); } - else if (dir == Zdir) { iN = 2; pm1 = p - Point<3>(0, 0, 1); pm2 = p - Point<3>(0, 0, 2); } + static inline void CorrectRightStaggered(const AccessorRW &m, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const Point<3> &p) { + constexpr int iN = normalIndex(dir); + Point<3> pm1; Point<3> pm2; + if (dir == Xdir) { pm1 = p - Point<3>(1, 0, 0); pm2 = p - Point<3>(2, 0, 0); } + else if (dir == Ydir) { pm1 = p - Point<3>(0, 1, 0); pm2 = p - Point<3>(0, 2, 0); } + else if (dir == Zdir) { pm1 = p - Point<3>(0, 0, 1); pm2 = p - Point<3>(0, 0, 2); } m[p] = 1.0/( 8.0/3.0*centerCoordinates[p ][iN] - 3.0 *centerCoordinates[pm1][iN] + 1.0/3.0*centerCoordinates[pm2][iN]); @@ -255,13 +245,14 @@ class CorrectGhostMetricTask { // for computational efficiency. Remeber this comment when you compute the fluxes }; __CUDA_H__ - static inline void CorrectRightCollocated(const AccessorRW m, - const AccessorRO< Vec3, 3> centerCoordinates, - const Point<3> p) { - int iN; Point<3> pm1; Point<3> pm2; - if (dir == Xdir) { iN = 0; pm1 = p - Point<3>(1, 0, 0); pm2 = p - Point<3>(2, 0, 0); } - else if (dir == Ydir) { iN = 1; pm1 = p - Point<3>(0, 1, 0); pm2 = p - Point<3>(0, 2, 0); } - else if (dir == Zdir) { iN = 2; pm1 = p - Point<3>(0, 0, 1); pm2 = p - Point<3>(0, 0, 2); } + static inline void CorrectRightCollocated(const AccessorRW &m, + const AccessorRO< Vec3, 3> ¢erCoordinates, + const Point<3> &p) { + constexpr int iN = normalIndex(dir); + Point<3> pm1; Point<3> pm2; + if (dir == Xdir) { pm1 = p - Point<3>(1, 0, 0); pm2 = p - Point<3>(2, 0, 0); } + else if (dir == Ydir) { pm1 = p - Point<3>(0, 1, 0); pm2 = p - Point<3>(0, 2, 0); } + else if (dir == Zdir) { pm1 = p - Point<3>(0, 0, 1); pm2 = p - Point<3>(0, 0, 2); } m[p] = 1.0/( 1.5*centerCoordinates[p ][iN] - 2.0*centerCoordinates[pm1][iN] + 0.5*centerCoordinates[pm2][iN]); diff --git a/src/prometeo_metric.inl b/src/prometeo_metric.inl index 0847483..88afdf6 100644 --- a/src/prometeo_metric.inl +++ b/src/prometeo_metric.inl @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -28,6 +28,8 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "prometeo_metric_coeffs.h" +#include "my_array.hpp" +#include "PointDomain_helper.hpp" #include @@ -49,22 +51,32 @@ #ifndef __CUDACC__ using std::min; +using std::max; #endif +//----------------------------------------------------------------------------- +// Stencil offset helper functions +//----------------------------------------------------------------------------- __CUDA_H__ -inline int offM2(const int t) { return Cp[t][0]; }; +inline int8_t offM2(const int t) { return Cp[t][0]; }; __CUDA_H__ -inline int offM1(const int t) { return Cp[t][1]; }; +inline int8_t offM1(const int t) { return Cp[t][1]; }; __CUDA_H__ -inline int offP1(const int t) { return Cp[t][2]; }; +inline int8_t offP1(const int t) { return Cp[t][2]; }; __CUDA_H__ -inline int offP2(const int t) { return Cp[t][3]; }; +inline int8_t offP2(const int t) { return Cp[t][3]; }; __CUDA_H__ -inline int offP3(const int t) { return Cp[t][4]; }; +inline int8_t offP3(const int t) { return Cp[t][4]; }; +//----------------------------------------------------------------------------- +// Interpolation operator +//----------------------------------------------------------------------------- __CUDA_H__ inline double Interp2Staggered(const int t, const double x1, const double x2) { return Interp[t][0]*(x1) + Interp[t][1]*(x2); }; +//----------------------------------------------------------------------------- +// Spatial derivative operator +//----------------------------------------------------------------------------- __CUDA_H__ inline double getDeriv(const int t, const double xm1, const double x, const double xp1, const double m) { return (Grad[t][0]*(x- xm1) + Grad[t][1]*(xp1 - x))*m; @@ -80,6 +92,73 @@ inline double getDerivRightBC(const int t, const double xm1, const double x, con return (Grad[t][0]*(x- xm1))*m; }; +template +__CUDA_H__ +inline double getDeriv(const AccessorRO &q, + const Point<3> &p, + const int nType, + const double m, + const Rect<3> &bounds) { + // Compute stencil points + const coord_t dsize = getSize(bounds); + const Point<3> pM1 = warpPeriodic(bounds, p, dsize, offM1(nType)); + const Point<3> pP1 = warpPeriodic(bounds, p, dsize, offP1(nType)); + return getDeriv(nType, q[pM1], q[p], q[pP1], m); +}; + +template +__CUDA_H__ +inline double getDeriv(const AccessorRO &q, + const Point<3> &p, + const int i, + const int nType, + const double m, + const Rect<3> &bounds) { + // Compute stencil points + const coord_t dsize = getSize(bounds); + const Point<3> pM1 = warpPeriodic(bounds, p, dsize, offM1(nType)); + const Point<3> pP1 = warpPeriodic(bounds, p, dsize, offP1(nType)); + return getDeriv(nType, q[pM1][i], q[p][i], q[pP1][i], m); +}; + +__CUDA_H__ +inline Vec3 getGrad(const AccessorRO &q, + const Point<3> &p, + const int nType_x, + const int nType_y, + const int nType_z, + const double m_x, + const double m_y, + const double m_z, + const Rect<3> &bounds) { + Vec3 grad; + grad[0] = getDeriv(q, p, nType_x, m_x, bounds); + grad[1] = getDeriv(q, p, nType_y, m_y, bounds); + grad[2] = getDeriv(q, p, nType_z, m_z, bounds); + return grad; +}; + +__CUDA_H__ +inline Vec3 getGrad(const AccessorRO &q, + const Point<3> &p, + const int i, + const int nType_x, + const int nType_y, + const int nType_z, + const double m_x, + const double m_y, + const double m_z, + const Rect<3> &bounds) { + Vec3 grad; + grad[0] = getDeriv(q, p, i, nType_x, m_x, bounds); + grad[1] = getDeriv(q, p, i, nType_y, m_y, bounds); + grad[2] = getDeriv(q, p, i, nType_z, m_z, bounds); + return grad; +}; + +//----------------------------------------------------------------------------- +// Linear reconstruction operator +//----------------------------------------------------------------------------- // TODO: this is extremely ineficient (do not use in the actual calculation) // Linear reconstruction based on TENO __CUDA_H__ @@ -100,6 +179,9 @@ inline double LinearReconstruct(const double ym2, const double ym1, const double yp3*(Recon[6*Stencil1+5]*Coeffs[Stencil1] + Recon[6*Stencil2+5]*Coeffs[Stencil2] + Recon[6*Stencil3+5]*Coeffs[Stencil3] + Recon[6*Stencil4+5]*Coeffs[Stencil4]); } +//----------------------------------------------------------------------------- +// Kennedy Gruber reconstruction operator +//----------------------------------------------------------------------------- // See Eq. 16 of Pirozzoli JCP (2010) __CUDA_H__ inline double KennedyReconstruct(const double *rho, const double *u, const double *phi, const int nType) { @@ -181,48 +263,152 @@ inline double KennedyReconstruct(const double *phi, const int nType) { return flux; } -// Ren sensor coefficients -const __CUDA_CONST__ double Ren_r_c = 0.2; -const __CUDA_CONST__ double Ren_eps = 0.9*Ren_r_c*1e-6/(1.0 - 0.9*Ren_r_c); -const __CUDA_CONST__ double Ren_irc = 1.0/Ren_r_c; +//----------------------------------------------------------------------------- +// TENO sensors +//----------------------------------------------------------------------------- +class TENOsensor { +public: + __CUDA_H__ + static inline bool TENO(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + + if ((nType == L_S_node) or (nType == Rm1_S_node)) + // Staggered nodes + return true; + + else if (nType == L_C_node) { + // Ren sensor + const double var1 = yp1 - y; + const double var2 = yp2 - yp1; + const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); + return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); -// Constants TENO cut-off -const __CUDA_CONST__ double TENO_cut_off = 1e-6; + } + else if (nType == Rm1_C_node) { + // Ren sensor + const double var1 = y - ym1; + const double var2 = yp1 - y; + const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); + return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); -const __CUDA_CONST__ double TENO_Smooth_pow = 12.5; -const __CUDA_CONST__ double TENO_Diff_pow = TENO_Smooth_pow - 5.0; + } + else { + // Compute smoothness factors + double aux1; double aux2; double aux3; + aux1 = (ym1 - 2*y + yp1); aux2 = ( ym1 - yp1); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (y - 2*yp1 + yp2); aux2 = (3*y - 4*yp1 + yp2); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (ym2 - 2*ym1 + y ); aux2 = (3*y - 4*ym1 + ym2); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (-11*y + 18*yp1 - 9*yp2 + 2*yp3); + aux2 = ( 2*y - 5*yp1 + 4*yp2 - yp3); + aux3 = (- y + 3*yp1 - 3*yp2 + yp3); + const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; + + // We can do this as we know that the sensor is applied on density and density is always > 0 + double eps = (ym2 + ym1 + y + yp1 + yp2 + yp3)/6; + eps *= eps*1e-4; + const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); + const double a1 = pow(1 + tau6/(s1 + eps), 6); + const double a2 = pow(1 + tau6/(s2 + eps), 6); + const double a3 = pow(1 + tau6/(s3 + eps), 6); + const double a4 = pow(1 + tau6/(s4 + eps), 6); + + const double a = 1.0/(a1 + a2 + a3 + a4); + + return ((a1*a > TENO_cut_off) and + (a2*a > TENO_cut_off) and + (a3*a > TENO_cut_off) and + (a4*a > TENO_cut_off)); + } + }; -// JS coefficients -const __CUDA_CONST__ double C13 = 13.0/12.0; -const __CUDA_CONST__ double C23 = 3.0/12.0; -const __CUDA_CONST__ double C14 = 1.0/36.0; -const __CUDA_CONST__ double C24 = 13.0/12.0; -const __CUDA_CONST__ double C34 = 781.0/720.0; + __CUDA_H__ + static inline bool TENOA(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType, const double Phi) { -__CUDA_H__ -inline bool TENOsensor(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + if ((nType == L_S_node) or (nType == Rm1_S_node)) + // Staggered nodes + return true; - if ((nType == L_S_node) or (nType == Rm1_S_node)) - // Staggered nodes - return true; + else if (nType == L_C_node) { + // Ren sensor + const double var1 = yp1 - y; + const double var2 = yp2 - yp1; + const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); + return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); - else if (nType == L_C_node) { - // Ren sensor - const double var1 = yp1 - y; - const double var2 = yp2 - yp1; - const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); - return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); + } + else if (nType == Rm1_C_node) { + // Ren sensor + const double var1 = y - ym1; + const double var2 = yp1 - y; + const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); + return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); - } - else if (nType == Rm1_C_node) { - // Ren sensor - const double var1 = y - ym1; - const double var2 = yp1 - y; - const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); - return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); + } + else { + // Compute smoothness factors + double aux1; double aux2; double aux3; + aux1 = (ym1 - 2*y + yp1); aux2 = ( ym1 - yp1); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (y - 2*yp1 + yp2); aux2 = (3*y - 4*yp1 + yp2); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (ym2 - 2*ym1 + y ); aux2 = (3*y - 4*ym1 + ym2); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (-11*y + 18*yp1 - 9*yp2 + 2*yp3); + aux2 = ( 2*y - 5*yp1 + 4*yp2 - yp3); + aux3 = (- y + 3*yp1 - 3*yp2 + yp3); + const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; + + const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); + const double a1 = pow(1 + tau6/(s1 + eps), 6); + const double a2 = pow(1 + tau6/(s2 + eps), 6); + const double a3 = pow(1 + tau6/(s3 + eps), 6); + const double a4 = pow(1 + tau6/(s4 + eps), 6); + + const double a = 1.0/(a1 + a2 + a3 + a4); + + // Use TENO-A cutoff adaptation + const double decay = pow((1 - Phi), 12) * (1 + 12*Phi); + const int power = floor(Smooth_pow - Diff_pow*(1 - decay)); + const float cut_off = p10[power]; + + return ((a1*a > cut_off) and + (a2*a > cut_off) and + (a3*a > cut_off) and + (a4*a > cut_off)); + } + }; + +private: + // Ren sensor coefficients + static constexpr double Ren_r_c = 0.2; + static constexpr double Ren_eps = 0.9*Ren_r_c*1e-6/(1.0 - 0.9*Ren_r_c); + static constexpr double Ren_irc = 1.0/Ren_r_c; + + // Constants for TENO cut-off + static constexpr double TENO_cut_off = 1e-6; + static constexpr double Smooth_pow = 12.5; + static constexpr double Shock_pow = 5.0; + static constexpr double Diff_pow = Smooth_pow - Shock_pow; + + // Small number + static constexpr double eps = 1e-8; + + // JS coefficients + static constexpr double C13 = 13.0/12.0; + static constexpr double C23 = 3.0/12.0; + static constexpr double C14 = 1.0/36.0; + static constexpr double C24 = 13.0/12.0; + static constexpr double C34 = 781.0/720.0; +}; + +//----------------------------------------------------------------------------- +// TENO reconstruction operators +//----------------------------------------------------------------------------- +class TENO_Op { +public: + __CUDA_H__ + static inline double reconstructPlus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + + // Load coefficients + const double *Coeffs = Coeffs_Plus[nType]; + const double *Recon = Recon_Plus[nType]; - } - else { // Compute smoothness factors double aux1; double aux2; double aux3; aux1 = (ym1 - 2*y + yp1); aux2 = ( ym1 - yp1); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; @@ -233,48 +419,172 @@ inline bool TENOsensor(const double ym2, const double ym1, const double y, const aux3 = (- y + 3*yp1 - 3*yp2 + yp3); const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; - // We can do this as we know that the sensor is applied on density and density is always > 0 - double eps = (ym2 + ym1 + y + yp1 + yp2 + yp3)/6; - eps *= eps*1e-4; + // not recommend to rescale the small number const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); - const double a1 = pow(1 + tau6/(s1 + eps), 6); - const double a2 = pow(1 + tau6/(s2 + eps), 6); - const double a3 = pow(1 + tau6/(s3 + eps), 6); - const double a4 = pow(1 + tau6/(s4 + eps), 6); + double a1 = pow(1 + tau6/(s1 + eps), 6); + double a2 = pow(1 + tau6/(s2 + eps), 6); + double a3 = pow(1 + tau6/(s3 + eps), 6); + double a4 = pow(1 + tau6/(s4 + eps), 6); + + if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; + if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; + if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; + if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; + + double a = 1.0/(a1 + a2 + a3 + a4); + const int b1 = (a1*a < cut_off) ? 0 : 1; + const int b2 = (a2*a < cut_off) ? 0 : 1; + const int b3 = (a3*a < cut_off) ? 0 : 1; + const int b4 = (a4*a < cut_off) ? 0 : 1; + + const double Variation1 = ym2*Recon[6*Stencil1+0] + + ym1*Recon[6*Stencil1+1] + + y *Recon[6*Stencil1+2] + + yp1*Recon[6*Stencil1+3] + + yp2*Recon[6*Stencil1+4] + + yp3*Recon[6*Stencil1+5] - y; + + const double Variation2 = ym2*Recon[6*Stencil2+0] + + ym1*Recon[6*Stencil2+1] + + y *Recon[6*Stencil2+2] + + yp1*Recon[6*Stencil2+3] + + yp2*Recon[6*Stencil2+4] + + yp3*Recon[6*Stencil2+5] - y; + + const double Variation3 = ym2*Recon[6*Stencil3+0] + + ym1*Recon[6*Stencil3+1] + + y *Recon[6*Stencil3+2] + + yp1*Recon[6*Stencil3+3] + + yp2*Recon[6*Stencil3+4] + + yp3*Recon[6*Stencil3+5] - y; + + const double Variation4 = ym2*Recon[6*Stencil4+0] + + ym1*Recon[6*Stencil4+1] + + y *Recon[6*Stencil4+2] + + yp1*Recon[6*Stencil4+3] + + yp2*Recon[6*Stencil4+4] + + yp3*Recon[6*Stencil4+5] - y; + + // Assemble the operator + a1 = Coeffs[Stencil1]*b1; + a2 = Coeffs[Stencil2]*b2; + a3 = Coeffs[Stencil3]*b3; + a4 = Coeffs[Stencil4]*b4; + + a = 1.0/(a1 + a2 + a3 + a4); + const double w1 = a1*a; + const double w2 = a2*a; + const double w3 = a3*a; + const double w4 = a4*a; + + return y + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; + } - const double a = 1.0/(a1 + a2 + a3 + a4); + __CUDA_H__ + static inline double reconstructMinus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + + // Load coefficients + const double *Coeffs = Coeffs_Minus[nType]; + const double *Recon = Recon_Minus[nType]; + + // Compute smoothness factors + double aux1; double aux2; double aux3; + aux1 = (yp2 - 2*yp1 + y ); aux2 = ( yp2 - y ); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (yp1 - 2*y + ym1); aux2 = (3*yp1 - 4*y + ym1); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (yp3 - 2*yp2 + yp1); aux2 = (3*yp1 - 4*yp2 + yp3); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (-11*yp1 + 18*y - 9*ym1 + 2*ym2); + aux2 = ( 2*yp1 - 5*y + 4*ym1 - ym2); + aux3 = (- yp1 + 3*y - 3*ym1 + ym2); + const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; - return ((a1*a > TENO_cut_off) and - (a2*a > TENO_cut_off) and - (a3*a > TENO_cut_off) and - (a4*a > TENO_cut_off)); + // not recommend to rescale the small number + const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); + double a1 = pow(1 + tau6/(s1 + eps), 6); + double a2 = pow(1 + tau6/(s2 + eps), 6); + double a3 = pow(1 + tau6/(s3 + eps), 6); + double a4 = pow(1 + tau6/(s4 + eps), 6); + + if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; + if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; + if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; + if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; + + double a = 1.0/(a1 + a2 + a3 + a4); + const int b1 = (a1*a < cut_off) ? 0 : 1; + const int b2 = (a2*a < cut_off) ? 0 : 1; + const int b3 = (a3*a < cut_off) ? 0 : 1; + const int b4 = (a4*a < cut_off) ? 0 : 1; + + const double Variation1 = ym2*Recon[6*Stencil1+0] + + ym1*Recon[6*Stencil1+1] + + y *Recon[6*Stencil1+2] + + yp1*Recon[6*Stencil1+3] + + yp2*Recon[6*Stencil1+4] + + yp3*Recon[6*Stencil1+5] - yp1; + + const double Variation2 = ym2*Recon[6*Stencil2+0] + + ym1*Recon[6*Stencil2+1] + + y *Recon[6*Stencil2+2] + + yp1*Recon[6*Stencil2+3] + + yp2*Recon[6*Stencil2+4] + + yp3*Recon[6*Stencil2+5] - yp1; + + const double Variation3 = ym2*Recon[6*Stencil3+0] + + ym1*Recon[6*Stencil3+1] + + y *Recon[6*Stencil3+2] + + yp1*Recon[6*Stencil3+3] + + yp2*Recon[6*Stencil3+4] + + yp3*Recon[6*Stencil3+5] - yp1; + + const double Variation4 = ym2*Recon[6*Stencil4+0] + + ym1*Recon[6*Stencil4+1] + + y *Recon[6*Stencil4+2] + + yp1*Recon[6*Stencil4+3] + + yp2*Recon[6*Stencil4+4] + + yp3*Recon[6*Stencil4+5] - yp1; + + // Assemble the operator + a1 = Coeffs[Stencil1]*b1; + a2 = Coeffs[Stencil2]*b2; + a3 = Coeffs[Stencil3]*b3; + a4 = Coeffs[Stencil4]*b4; + + a = 1.0/(a1 + a2 + a3 + a4); + const double w1 = a1*a; + const double w2 = a2*a; + const double w3 = a3*a; + const double w4 = a4*a; + + return yp1 + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; } -}; -__CUDA_H__ -inline bool TENOsensor(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType, const double Phi) { +private: + // Constant TENO cut-off + static constexpr double cut_off = 1e-6; - if ((nType == L_S_node) or (nType == Rm1_S_node)) - // Staggered nodes - return true; + // Small number + static constexpr double eps = 1e-10; - else if (nType == L_C_node) { - // Ren sensor - const double var1 = yp1 - y; - const double var2 = yp2 - yp1; - const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); - return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); + // JS coefficients + static constexpr double C13 = 13.0/12.0; + static constexpr double C23 = 3.0/12.0; + static constexpr double C14 = 1.0/36.0; + static constexpr double C24 = 13.0/12.0; + static constexpr double C34 = 781.0/720.0; +}; - } - else if (nType == Rm1_C_node) { - // Ren sensor - const double var1 = y - ym1; - const double var2 = yp1 - y; - const double eta = (fabs(2.0*var1*var2) + Ren_eps)/(var1*var1 + var2*var2 + Ren_eps); - return ((1.0 - min(1.0, Ren_irc*eta)) < 0.5); +//----------------------------------------------------------------------------- +// TENO-A reconstruction operators +//----------------------------------------------------------------------------- +class TENOA_Op { +public: + __CUDA_H__ + static inline double reconstructPlus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + + // Load coefficients + const double *Coeffs = Coeffs_Plus[nType]; + const double *Recon = Recon_Plus[nType]; - } - else { // Compute smoothness factors double aux1; double aux2; double aux3; aux1 = (ym1 - 2*y + yp1); aux2 = ( ym1 - yp1); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; @@ -285,370 +595,404 @@ inline bool TENOsensor(const double ym2, const double ym1, const double y, const aux3 = (- y + 3*yp1 - 3*yp2 + yp3); const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; + // not recommend to rescale the small number const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); - const double a1 = pow(1 + tau6/(s1 + 1.0e-8), 6); - const double a2 = pow(1 + tau6/(s2 + 1.0e-8), 6); - const double a3 = pow(1 + tau6/(s3 + 1.0e-8), 6); - const double a4 = pow(1 + tau6/(s4 + 1.0e-8), 6); - - const double a = 1.0/(a1 + a2 + a3 + a4); - - // Use TENO-A cutoff adaptation - const double decay = pow((1 - Phi), 12) * (1 + 12*Phi); - const int power = ceil(TENO_Diff_pow*(1 - decay) - TENO_Smooth_pow); - const double cut_off = pow(10, power); - - return ((a1*a > cut_off) and - (a2*a > cut_off) and - (a3*a > cut_off) and - (a4*a > cut_off)); + double a1 = pow(1 + tau6/(s1 + 1.0e-10), 6); + double a2 = pow(1 + tau6/(s2 + 1.0e-10), 6); + double a3 = pow(1 + tau6/(s3 + 1.0e-10), 6); + double a4 = pow(1 + tau6/(s4 + 1.0e-10), 6); + + if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; + if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; + if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; + if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; + + // Adapt cut_off based on Ren sensor + const double var2 = fabs(ym1 - ym2); + const double var3 = fabs(y - ym1); + const double var4 = fabs(yp1 - y ); + const double var5 = fabs(yp2 - yp1); + const double var6 = fabs(yp3 - yp2); + + double eta = min((2*var2*var3 + Ren_eps) / (var2*var2 + var3*var3 + Ren_eps), + (2*var3*var4 + Ren_eps) / (var3*var3 + var4*var4 + Ren_eps)); + eta = min(eta, (2*var4*var5 + Ren_eps) / (var4*var4 + var5*var5 + Ren_eps)); + eta = min(eta, (2*var5*var6 + Ren_eps) / (var5*var5 + var6*var6 + Ren_eps)); + + const double delta = 1 - min(eta*Ren_irc, 1.0); + const double decay = pow((1 - delta), 8) * (1 + 8*delta); + const int power = floor(Smooth_pow - Diff_pow*(1 - decay)); + const float cut_off = p10[power]; + + // Select stencils + double a = 1.0/(a1 + a2 + a3 + a4); + const int b1 = (a1*a < cut_off) ? 0 : 1; + const int b2 = (a2*a < cut_off) ? 0 : 1; + const int b3 = (a3*a < cut_off) ? 0 : 1; + const int b4 = (a4*a < cut_off) ? 0 : 1; + + const double Variation1 = ym2*Recon[6*Stencil1+0] + + ym1*Recon[6*Stencil1+1] + + y *Recon[6*Stencil1+2] + + yp1*Recon[6*Stencil1+3] + + yp2*Recon[6*Stencil1+4] + + yp3*Recon[6*Stencil1+5] - y; + + const double Variation2 = ym2*Recon[6*Stencil2+0] + + ym1*Recon[6*Stencil2+1] + + y *Recon[6*Stencil2+2] + + yp1*Recon[6*Stencil2+3] + + yp2*Recon[6*Stencil2+4] + + yp3*Recon[6*Stencil2+5] - y; + + const double Variation3 = ym2*Recon[6*Stencil3+0] + + ym1*Recon[6*Stencil3+1] + + y *Recon[6*Stencil3+2] + + yp1*Recon[6*Stencil3+3] + + yp2*Recon[6*Stencil3+4] + + yp3*Recon[6*Stencil3+5] - y; + + const double Variation4 = ym2*Recon[6*Stencil4+0] + + ym1*Recon[6*Stencil4+1] + + y *Recon[6*Stencil4+2] + + yp1*Recon[6*Stencil4+3] + + yp2*Recon[6*Stencil4+4] + + yp3*Recon[6*Stencil4+5] - y; + + // Assemble the operator + a1 = Coeffs[Stencil1]*b1; + a2 = Coeffs[Stencil2]*b2; + a3 = Coeffs[Stencil3]*b3; + a4 = Coeffs[Stencil4]*b4; + + a = 1.0/(a1 + a2 + a3 + a4); + const double w1 = a1*a; + const double w2 = a2*a; + const double w3 = a3*a; + const double w4 = a4*a; + + return y + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; } -}; -__CUDA_H__ -inline double TENOreconstructionPlus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + __CUDA_H__ + static inline double reconstructMinus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { - // Load coefficients - const double *Coeffs = Coeffs_Plus[nType]; - const double *Recon = Recon_Plus[nType]; + // Load coefficients + const double *Coeffs = Coeffs_Minus[nType]; + const double *Recon = Recon_Minus[nType]; - // Compute smoothness factors - double aux1; double aux2; double aux3; - aux1 = (ym1 - 2*y + yp1); aux2 = ( ym1 - yp1); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (y - 2*yp1 + yp2); aux2 = (3*y - 4*yp1 + yp2); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (ym2 - 2*ym1 + y ); aux2 = (3*y - 4*ym1 + ym2); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (-11*y + 18*yp1 - 9*yp2 + 2*yp3); - aux2 = ( 2*y - 5*yp1 + 4*yp2 - yp3); - aux3 = (- y + 3*yp1 - 3*yp2 + yp3); - const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; - - // not recommend to rescale the small number - const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); - double a1 = pow(1 + tau6/(s1 + 1.0e-10), 6); - double a2 = pow(1 + tau6/(s2 + 1.0e-10), 6); - double a3 = pow(1 + tau6/(s3 + 1.0e-10), 6); - double a4 = pow(1 + tau6/(s4 + 1.0e-10), 6); - - if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; - if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; - if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; - if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; - - double a = 1.0/(a1 + a2 + a3 + a4); - const int b1 = (a1*a < TENO_cut_off) ? 0 : 1; - const int b2 = (a2*a < TENO_cut_off) ? 0 : 1; - const int b3 = (a3*a < TENO_cut_off) ? 0 : 1; - const int b4 = (a4*a < TENO_cut_off) ? 0 : 1; - - const double Variation1 = ym2*Recon[6*Stencil1+0] + - ym1*Recon[6*Stencil1+1] + - y *Recon[6*Stencil1+2] + - yp1*Recon[6*Stencil1+3] + - yp2*Recon[6*Stencil1+4] + - yp3*Recon[6*Stencil1+5] - y; - - const double Variation2 = ym2*Recon[6*Stencil2+0] + - ym1*Recon[6*Stencil2+1] + - y *Recon[6*Stencil2+2] + - yp1*Recon[6*Stencil2+3] + - yp2*Recon[6*Stencil2+4] + - yp3*Recon[6*Stencil2+5] - y; - - const double Variation3 = ym2*Recon[6*Stencil3+0] + - ym1*Recon[6*Stencil3+1] + - y *Recon[6*Stencil3+2] + - yp1*Recon[6*Stencil3+3] + - yp2*Recon[6*Stencil3+4] + - yp3*Recon[6*Stencil3+5] - y; - - const double Variation4 = ym2*Recon[6*Stencil4+0] + - ym1*Recon[6*Stencil4+1] + - y *Recon[6*Stencil4+2] + - yp1*Recon[6*Stencil4+3] + - yp2*Recon[6*Stencil4+4] + - yp3*Recon[6*Stencil4+5] - y; - - // Assemble the operator - a1 = Coeffs[Stencil1]*b1; - a2 = Coeffs[Stencil2]*b2; - a3 = Coeffs[Stencil3]*b3; - a4 = Coeffs[Stencil4]*b4; - - a = 1.0/(a1 + a2 + a3 + a4); - const double w1 = a1*a; - const double w2 = a2*a; - const double w3 = a3*a; - const double w4 = a4*a; - - return y + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; -} + // Compute smoothness factors + double aux1; double aux2; double aux3; + aux1 = (yp2 - 2*yp1 + y ); aux2 = ( yp2 - y ); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (yp1 - 2*y + ym1); aux2 = (3*yp1 - 4*y + ym1); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (yp3 - 2*yp2 + yp1); aux2 = (3*yp1 - 4*yp2 + yp3); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (-11*yp1 + 18*y - 9*ym1 + 2*ym2); + aux2 = ( 2*yp1 - 5*y + 4*ym1 - ym2); + aux3 = (- yp1 + 3*y - 3*ym1 + ym2); + const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; -__CUDA_H__ -inline double TENOreconstructionMinus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + // not recommend to rescale the small number + const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); + double a1 = pow(1 + tau6/(s1 + eps), 6); + double a2 = pow(1 + tau6/(s2 + eps), 6); + double a3 = pow(1 + tau6/(s3 + eps), 6); + double a4 = pow(1 + tau6/(s4 + eps), 6); + + if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; + if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; + if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; + if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; + + // Adapt cut_off based on Ren sensor + const double var2 = fabs(ym1 - ym2); + const double var3 = fabs(y - ym1); + const double var4 = fabs(yp1 - y ); + const double var5 = fabs(yp2 - yp1); + const double var6 = fabs(yp3 - yp2); + + double eta = min((2*var2*var3 + Ren_eps) / (var2*var2 + var3*var3 + Ren_eps), + (2*var3*var4 + Ren_eps) / (var3*var3 + var4*var4 + Ren_eps)); + eta = min(eta, (2*var4*var5 + Ren_eps) / (var4*var4 + var5*var5 + Ren_eps)); + eta = min(eta, (2*var5*var6 + Ren_eps) / (var5*var5 + var6*var6 + Ren_eps)); + + const double delta = 1 - min(eta*Ren_irc, 1.0); + const double decay = pow((1 - delta), 8) * (1 + 8*delta); + const int power = floor(Smooth_pow - Diff_pow*(1 - decay)); + const float cut_off = p10[power]; + + // Select stencils + double a = 1.0/(a1 + a2 + a3 + a4); + const int b1 = (a1*a < cut_off) ? 0 : 1; + const int b2 = (a2*a < cut_off) ? 0 : 1; + const int b3 = (a3*a < cut_off) ? 0 : 1; + const int b4 = (a4*a < cut_off) ? 0 : 1; + + const double Variation1 = ym2*Recon[6*Stencil1+0] + + ym1*Recon[6*Stencil1+1] + + y *Recon[6*Stencil1+2] + + yp1*Recon[6*Stencil1+3] + + yp2*Recon[6*Stencil1+4] + + yp3*Recon[6*Stencil1+5] - yp1; + + const double Variation2 = ym2*Recon[6*Stencil2+0] + + ym1*Recon[6*Stencil2+1] + + y *Recon[6*Stencil2+2] + + yp1*Recon[6*Stencil2+3] + + yp2*Recon[6*Stencil2+4] + + yp3*Recon[6*Stencil2+5] - yp1; + + const double Variation3 = ym2*Recon[6*Stencil3+0] + + ym1*Recon[6*Stencil3+1] + + y *Recon[6*Stencil3+2] + + yp1*Recon[6*Stencil3+3] + + yp2*Recon[6*Stencil3+4] + + yp3*Recon[6*Stencil3+5] - yp1; + + const double Variation4 = ym2*Recon[6*Stencil4+0] + + ym1*Recon[6*Stencil4+1] + + y *Recon[6*Stencil4+2] + + yp1*Recon[6*Stencil4+3] + + yp2*Recon[6*Stencil4+4] + + yp3*Recon[6*Stencil4+5] - yp1; + + // Assemble the operator + a1 = Coeffs[Stencil1]*b1; + a2 = Coeffs[Stencil2]*b2; + a3 = Coeffs[Stencil3]*b3; + a4 = Coeffs[Stencil4]*b4; + + a = 1.0/(a1 + a2 + a3 + a4); + const double w1 = a1*a; + const double w2 = a2*a; + const double w3 = a3*a; + const double w4 = a4*a; + + return yp1 + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; + } - // Load coefficients - const double *Coeffs = Coeffs_Minus[nType]; - const double *Recon = Recon_Minus[nType]; - - // Compute smoothness factors - double aux1; double aux2; double aux3; - aux1 = (yp2 - 2*yp1 + y ); aux2 = ( yp2 - y ); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (yp1 - 2*y + ym1); aux2 = (3*yp1 - 4*y + ym1); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (yp3 - 2*yp2 + yp1); aux2 = (3*yp1 - 4*yp2 + yp3); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (-11*yp1 + 18*y - 9*ym1 + 2*ym2); - aux2 = ( 2*yp1 - 5*y + 4*ym1 - ym2); - aux3 = (- yp1 + 3*y - 3*ym1 + ym2); - const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; - - // not recommend to rescale the small number - const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); - double a1 = pow(1 + tau6/(s1 + 1.0e-10), 6); - double a2 = pow(1 + tau6/(s2 + 1.0e-10), 6); - double a3 = pow(1 + tau6/(s3 + 1.0e-10), 6); - double a4 = pow(1 + tau6/(s4 + 1.0e-10), 6); - - if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; - if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; - if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; - if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; - - double a = 1.0/(a1 + a2 + a3 + a4); - const int b1 = (a1*a < TENO_cut_off) ? 0 : 1; - const int b2 = (a2*a < TENO_cut_off) ? 0 : 1; - const int b3 = (a3*a < TENO_cut_off) ? 0 : 1; - const int b4 = (a4*a < TENO_cut_off) ? 0 : 1; - - const double Variation1 = ym2*Recon[6*Stencil1+0] + - ym1*Recon[6*Stencil1+1] + - y *Recon[6*Stencil1+2] + - yp1*Recon[6*Stencil1+3] + - yp2*Recon[6*Stencil1+4] + - yp3*Recon[6*Stencil1+5] - yp1; - - const double Variation2 = ym2*Recon[6*Stencil2+0] + - ym1*Recon[6*Stencil2+1] + - y *Recon[6*Stencil2+2] + - yp1*Recon[6*Stencil2+3] + - yp2*Recon[6*Stencil2+4] + - yp3*Recon[6*Stencil2+5] - yp1; - - const double Variation3 = ym2*Recon[6*Stencil3+0] + - ym1*Recon[6*Stencil3+1] + - y *Recon[6*Stencil3+2] + - yp1*Recon[6*Stencil3+3] + - yp2*Recon[6*Stencil3+4] + - yp3*Recon[6*Stencil3+5] - yp1; - - const double Variation4 = ym2*Recon[6*Stencil4+0] + - ym1*Recon[6*Stencil4+1] + - y *Recon[6*Stencil4+2] + - yp1*Recon[6*Stencil4+3] + - yp2*Recon[6*Stencil4+4] + - yp3*Recon[6*Stencil4+5] - yp1; - - // Assemble the operator - a1 = Coeffs[Stencil1]*b1; - a2 = Coeffs[Stencil2]*b2; - a3 = Coeffs[Stencil3]*b3; - a4 = Coeffs[Stencil4]*b4; - - a = 1.0/(a1 + a2 + a3 + a4); - const double w1 = a1*a; - const double w2 = a2*a; - const double w3 = a3*a; - const double w4 = a4*a; - - return yp1 + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; -} +private: + // Ren sensor coefficients + static constexpr double Ren_r_c = 0.2; + static constexpr double Ren_eps = 0.9*Ren_r_c*1e-6/(1.0 - 0.9*Ren_r_c); + static constexpr double Ren_irc = 1.0/Ren_r_c; -__CUDA_H__ -inline double TENOAreconstructionPlus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + // Constants for TENO cut-off adaptation + static constexpr double Smooth_pow = 12.5; + static constexpr double Shock_pow = 5.0; + static constexpr double Diff_pow = Smooth_pow - Shock_pow; - // Load coefficients - const double *Coeffs = Coeffs_Plus[nType]; - const double *Recon = Recon_Plus[nType]; + // Small number + static constexpr double eps = 1e-10; - // Compute smoothness factors - double aux1; double aux2; double aux3; - aux1 = (ym1 - 2*y + yp1); aux2 = ( ym1 - yp1); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (y - 2*yp1 + yp2); aux2 = (3*y - 4*yp1 + yp2); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (ym2 - 2*ym1 + y ); aux2 = (3*y - 4*ym1 + ym2); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (-11*y + 18*yp1 - 9*yp2 + 2*yp3); - aux2 = ( 2*y - 5*yp1 + 4*yp2 - yp3); - aux3 = (- y + 3*yp1 - 3*yp2 + yp3); - const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; - - // not recommend to rescale the small number - const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); - double a1 = pow(1 + tau6/(s1 + 1.0e-10), 6); - double a2 = pow(1 + tau6/(s2 + 1.0e-10), 6); - double a3 = pow(1 + tau6/(s3 + 1.0e-10), 6); - double a4 = pow(1 + tau6/(s4 + 1.0e-10), 6); - - if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; - if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; - if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; - if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; - - // Adapt cut_off based on Ren sensor - const double var2 = fabs(ym1 - ym2); - const double var3 = fabs(y - ym1); - const double var4 = fabs(yp1 - y ); - const double var5 = fabs(yp2 - yp1); - const double var6 = fabs(yp3 - yp2); - - double eta = min((2*var2*var3 + Ren_eps) / (var2*var2 + var3*var3 + Ren_eps), - (2*var3*var4 + Ren_eps) / (var3*var3 + var4*var4 + Ren_eps)); - eta = min(eta, (2*var4*var5 + Ren_eps) / (var4*var4 + var5*var5 + Ren_eps)); - eta = min(eta, (2*var5*var6 + Ren_eps) / (var5*var5 + var6*var6 + Ren_eps)); - - const double delta = 1 - min(eta*Ren_irc, 1.0); - const double decay = pow((1 - delta), 8) * (1 + 8*delta); - const int power = ceil(TENO_Diff_pow*(1 - decay) - TENO_Smooth_pow); - const double cut_off = pow(10, power); - - // Select stencils - double a = 1.0/(a1 + a2 + a3 + a4); - const int b1 = (a1*a < cut_off) ? 0 : 1; - const int b2 = (a2*a < cut_off) ? 0 : 1; - const int b3 = (a3*a < cut_off) ? 0 : 1; - const int b4 = (a4*a < cut_off) ? 0 : 1; - - const double Variation1 = ym2*Recon[6*Stencil1+0] + - ym1*Recon[6*Stencil1+1] + - y *Recon[6*Stencil1+2] + - yp1*Recon[6*Stencil1+3] + - yp2*Recon[6*Stencil1+4] + - yp3*Recon[6*Stencil1+5] - y; - - const double Variation2 = ym2*Recon[6*Stencil2+0] + - ym1*Recon[6*Stencil2+1] + - y *Recon[6*Stencil2+2] + - yp1*Recon[6*Stencil2+3] + - yp2*Recon[6*Stencil2+4] + - yp3*Recon[6*Stencil2+5] - y; - - const double Variation3 = ym2*Recon[6*Stencil3+0] + - ym1*Recon[6*Stencil3+1] + - y *Recon[6*Stencil3+2] + - yp1*Recon[6*Stencil3+3] + - yp2*Recon[6*Stencil3+4] + - yp3*Recon[6*Stencil3+5] - y; - - const double Variation4 = ym2*Recon[6*Stencil4+0] + - ym1*Recon[6*Stencil4+1] + - y *Recon[6*Stencil4+2] + - yp1*Recon[6*Stencil4+3] + - yp2*Recon[6*Stencil4+4] + - yp3*Recon[6*Stencil4+5] - y; - - // Assemble the operator - a1 = Coeffs[Stencil1]*b1; - a2 = Coeffs[Stencil2]*b2; - a3 = Coeffs[Stencil3]*b3; - a4 = Coeffs[Stencil4]*b4; - - a = 1.0/(a1 + a2 + a3 + a4); - const double w1 = a1*a; - const double w2 = a2*a; - const double w3 = a3*a; - const double w4 = a4*a; - - return y + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; -} + // JS coefficients + static constexpr double C13 = 13.0/12.0; + static constexpr double C23 = 3.0/12.0; + static constexpr double C14 = 1.0/36.0; + static constexpr double C24 = 13.0/12.0; + static constexpr double C34 = 781.0/720.0; -__CUDA_H__ -inline double TENOAreconstructionMinus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { +}; - // Load coefficients - const double *Coeffs = Coeffs_Minus[nType]; - const double *Recon = Recon_Minus[nType]; - - // Compute smoothness factors - double aux1; double aux2; double aux3; - aux1 = (yp2 - 2*yp1 + y ); aux2 = ( yp2 - y ); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (yp1 - 2*y + ym1); aux2 = (3*yp1 - 4*y + ym1); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (yp3 - 2*yp2 + yp1); aux2 = (3*yp1 - 4*yp2 + yp3); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; - aux1 = (-11*yp1 + 18*y - 9*ym1 + 2*ym2); - aux2 = ( 2*yp1 - 5*y + 4*ym1 - ym2); - aux3 = (- yp1 + 3*y - 3*ym1 + ym2); - const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; - - // not recommend to rescale the small number - const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); - double a1 = pow(1 + tau6/(s1 + 1.0e-10), 6); - double a2 = pow(1 + tau6/(s2 + 1.0e-10), 6); - double a3 = pow(1 + tau6/(s3 + 1.0e-10), 6); - double a4 = pow(1 + tau6/(s4 + 1.0e-10), 6); - - if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; - if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; - if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; - if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; - - // Adapt cut_off based on Ren sensor - const double var2 = fabs(ym1 - ym2); - const double var3 = fabs(y - ym1); - const double var4 = fabs(yp1 - y ); - const double var5 = fabs(yp2 - yp1); - const double var6 = fabs(yp3 - yp2); - - double eta = min((2*var2*var3 + Ren_eps) / (var2*var2 + var3*var3 + Ren_eps), - (2*var3*var4 + Ren_eps) / (var3*var3 + var4*var4 + Ren_eps)); - eta = min(eta, (2*var4*var5 + Ren_eps) / (var4*var4 + var5*var5 + Ren_eps)); - eta = min(eta, (2*var5*var6 + Ren_eps) / (var5*var5 + var6*var6 + Ren_eps)); - - const double delta = 1 - min(eta*Ren_irc, 1.0); - const double decay = pow((1 - delta), 8) * (1 + 8*delta); - const int power = ceil(TENO_Diff_pow*(1 - decay) - TENO_Smooth_pow); - const double cut_off = pow(10, power); - - // Select stencils - double a = 1.0/(a1 + a2 + a3 + a4); - const int b1 = (a1*a < cut_off) ? 0 : 1; - const int b2 = (a2*a < cut_off) ? 0 : 1; - const int b3 = (a3*a < cut_off) ? 0 : 1; - const int b4 = (a4*a < cut_off) ? 0 : 1; - - const double Variation1 = ym2*Recon[6*Stencil1+0] + - ym1*Recon[6*Stencil1+1] + - y *Recon[6*Stencil1+2] + - yp1*Recon[6*Stencil1+3] + - yp2*Recon[6*Stencil1+4] + - yp3*Recon[6*Stencil1+5] - yp1; - - const double Variation2 = ym2*Recon[6*Stencil2+0] + - ym1*Recon[6*Stencil2+1] + - y *Recon[6*Stencil2+2] + - yp1*Recon[6*Stencil2+3] + - yp2*Recon[6*Stencil2+4] + - yp3*Recon[6*Stencil2+5] - yp1; - - const double Variation3 = ym2*Recon[6*Stencil3+0] + - ym1*Recon[6*Stencil3+1] + - y *Recon[6*Stencil3+2] + - yp1*Recon[6*Stencil3+3] + - yp2*Recon[6*Stencil3+4] + - yp3*Recon[6*Stencil3+5] - yp1; - - const double Variation4 = ym2*Recon[6*Stencil4+0] + - ym1*Recon[6*Stencil4+1] + - y *Recon[6*Stencil4+2] + - yp1*Recon[6*Stencil4+3] + - yp2*Recon[6*Stencil4+4] + - yp3*Recon[6*Stencil4+5] - yp1; - - // Assemble the operator - a1 = Coeffs[Stencil1]*b1; - a2 = Coeffs[Stencil2]*b2; - a3 = Coeffs[Stencil3]*b3; - a4 = Coeffs[Stencil4]*b4; - - a = 1.0/(a1 + a2 + a3 + a4); - const double w1 = a1*a; - const double w2 = a2*a; - const double w3 = a3*a; - const double w4 = a4*a; - - return yp1 + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; -} +//----------------------------------------------------------------------------- +// TENO-LAD reconstruction operators +// See Peng et al. Journal of Computational Physics 425, 2021 +//----------------------------------------------------------------------------- +class TENOLAD_Op { +public: + __CUDA_H__ + static inline double reconstructPlus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + + // Load coefficients + const double *Coeffs = Coeffs_Plus[nType]; + const double *Recon = Recon_Plus[nType]; + + // Compute smoothness factors + double aux1; double aux2; double aux3; + aux1 = (ym1 - 2*y + yp1); aux2 = ( ym1 - yp1); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (y - 2*yp1 + yp2); aux2 = (3*y - 4*yp1 + yp2); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (ym2 - 2*ym1 + y ); aux2 = (3*y - 4*ym1 + ym2); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (-11*y + 18*yp1 - 9*yp2 + 2*yp3); + aux2 = ( 2*y - 5*yp1 + 4*yp2 - yp3); + aux3 = (- y + 3*yp1 - 3*yp2 + yp3); + const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; + + // not recommend to rescale the small number + const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); + const double chi1 = tau6/(s1 + eps); + const double chi2 = tau6/(s2 + eps); + const double chi3 = tau6/(s3 + eps); + const double chi4 = tau6/(s4 + eps); + double a1 = pow(1 + chi1, 6); + double a2 = pow(1 + chi2, 6); + double a3 = pow(1 + chi3, 6); + double a4 = pow(1 + chi4, 6); + + if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; + if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; + if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; + if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; + + // Adapt cut_off + const double chiMax = max(chi1, max(chi2, + max(chi3, chi4))); + const double theta = 1.0/(1 + chiMax*iH); + const int power = floor(Shock_pow + Diff_pow*theta); + const float cut_off = p10[power]; + + // Select stencils + double a = 1.0/(a1 + a2 + a3 + a4); + const int b1 = (a1*a < cut_off) ? 0 : 1; + const int b2 = (a2*a < cut_off) ? 0 : 1; + const int b3 = (a3*a < cut_off) ? 0 : 1; + const int b4 = (a4*a < cut_off) ? 0 : 1; + + const double Variation1 = ym2*Recon[6*Stencil1+0] + + ym1*Recon[6*Stencil1+1] + + y *Recon[6*Stencil1+2] + + yp1*Recon[6*Stencil1+3] + + yp2*Recon[6*Stencil1+4] + + yp3*Recon[6*Stencil1+5] - y; + + const double Variation2 = ym2*Recon[6*Stencil2+0] + + ym1*Recon[6*Stencil2+1] + + y *Recon[6*Stencil2+2] + + yp1*Recon[6*Stencil2+3] + + yp2*Recon[6*Stencil2+4] + + yp3*Recon[6*Stencil2+5] - y; + + const double Variation3 = ym2*Recon[6*Stencil3+0] + + ym1*Recon[6*Stencil3+1] + + y *Recon[6*Stencil3+2] + + yp1*Recon[6*Stencil3+3] + + yp2*Recon[6*Stencil3+4] + + yp3*Recon[6*Stencil3+5] - y; + + const double Variation4 = ym2*Recon[6*Stencil4+0] + + ym1*Recon[6*Stencil4+1] + + y *Recon[6*Stencil4+2] + + yp1*Recon[6*Stencil4+3] + + yp2*Recon[6*Stencil4+4] + + yp3*Recon[6*Stencil4+5] - y; + + // Assemble the operator + a1 = Coeffs[Stencil1]*b1; + a2 = Coeffs[Stencil2]*b2; + a3 = Coeffs[Stencil3]*b3; + a4 = Coeffs[Stencil4]*b4; + + a = 1.0/(a1 + a2 + a3 + a4); + const double w1 = a1*a; + const double w2 = a2*a; + const double w3 = a3*a; + const double w4 = a4*a; + + return y + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; + }; + + __CUDA_H__ + static inline double reconstructMinus(const double ym2, const double ym1, const double y, const double yp1, const double yp2, const double yp3, const int nType) { + + // Load coefficients + const double *Coeffs = Coeffs_Minus[nType]; + const double *Recon = Recon_Minus[nType]; + + // Compute smoothness factors + double aux1; double aux2; double aux3; + aux1 = (yp2 - 2*yp1 + y ); aux2 = ( yp2 - y ); const double s1 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (yp1 - 2*y + ym1); aux2 = (3*yp1 - 4*y + ym1); const double s2 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (yp3 - 2*yp2 + yp1); aux2 = (3*yp1 - 4*yp2 + yp3); const double s3 = C13*aux1*aux1 + C23*aux2*aux2; + aux1 = (-11*yp1 + 18*y - 9*ym1 + 2*ym2); + aux2 = ( 2*yp1 - 5*y + 4*ym1 - ym2); + aux3 = (- yp1 + 3*y - 3*ym1 + ym2); + const double s4 = C14*aux1*aux1 + C24*aux2*aux2 + C34*aux3*aux3; + + // not recommend to rescale the small number + const double tau6 = fabs(s4 - (s3 + s2 + 4*s1)/6); + const double chi1 = tau6/(s1 + eps); + const double chi2 = tau6/(s2 + eps); + const double chi3 = tau6/(s3 + eps); + const double chi4 = tau6/(s4 + eps); + double a1 = pow(1 + chi1, 6); + double a2 = pow(1 + chi2, 6); + double a3 = pow(1 + chi3, 6); + double a4 = pow(1 + chi4, 6); + + if (Coeffs[Stencil1] < 1e-10) a1 = 0.0; + if (Coeffs[Stencil2] < 1e-10) a2 = 0.0; + if (Coeffs[Stencil3] < 1e-10) a3 = 0.0; + if (Coeffs[Stencil4] < 1e-10) a4 = 0.0; + + // Adapt cut_off + const double chiMax = max(chi1, max(chi2, + max(chi3, chi4))); + const double theta = 1.0/(1 + chiMax*iH); + const int power = floor(Shock_pow + Diff_pow*theta); + const float cut_off = p10[power]; + + // Select stencils + double a = 1.0/(a1 + a2 + a3 + a4); + const int b1 = (a1*a < cut_off) ? 0 : 1; + const int b2 = (a2*a < cut_off) ? 0 : 1; + const int b3 = (a3*a < cut_off) ? 0 : 1; + const int b4 = (a4*a < cut_off) ? 0 : 1; + + const double Variation1 = ym2*Recon[6*Stencil1+0] + + ym1*Recon[6*Stencil1+1] + + y *Recon[6*Stencil1+2] + + yp1*Recon[6*Stencil1+3] + + yp2*Recon[6*Stencil1+4] + + yp3*Recon[6*Stencil1+5] - yp1; + + const double Variation2 = ym2*Recon[6*Stencil2+0] + + ym1*Recon[6*Stencil2+1] + + y *Recon[6*Stencil2+2] + + yp1*Recon[6*Stencil2+3] + + yp2*Recon[6*Stencil2+4] + + yp3*Recon[6*Stencil2+5] - yp1; + + const double Variation3 = ym2*Recon[6*Stencil3+0] + + ym1*Recon[6*Stencil3+1] + + y *Recon[6*Stencil3+2] + + yp1*Recon[6*Stencil3+3] + + yp2*Recon[6*Stencil3+4] + + yp3*Recon[6*Stencil3+5] - yp1; + + const double Variation4 = ym2*Recon[6*Stencil4+0] + + ym1*Recon[6*Stencil4+1] + + y *Recon[6*Stencil4+2] + + yp1*Recon[6*Stencil4+3] + + yp2*Recon[6*Stencil4+4] + + yp3*Recon[6*Stencil4+5] - yp1; + + // Assemble the operator + a1 = Coeffs[Stencil1]*b1; + a2 = Coeffs[Stencil2]*b2; + a3 = Coeffs[Stencil3]*b3; + a4 = Coeffs[Stencil4]*b4; + + a = 1.0/(a1 + a2 + a3 + a4); + const double w1 = a1*a; + const double w2 = a2*a; + const double w3 = a3*a; + const double w4 = a4*a; + + return yp1 + w1*Variation1 + w2*Variation2 + w3*Variation3 + w4*Variation4; + }; + +private: + // Constants for TENO cut-off adaptation + static constexpr double Smooth_pow = 12.5; + static constexpr double Shock_pow = 3.0; + static constexpr double iH = 1e-1; + static constexpr double Diff_pow = Smooth_pow - Shock_pow; + + // Small number + static constexpr double eps = 1e-16; + + // JS coefficients + static constexpr double C13 = 13.0/12.0; + static constexpr double C23 = 3.0/12.0; + static constexpr double C14 = 1.0/36.0; + static constexpr double C24 = 13.0/12.0; + static constexpr double C34 = 781.0/720.0; +}; diff --git a/src/prometeo_metric.rg b/src/prometeo_metric.rg index f68486f..346ece4 100644 --- a/src/prometeo_metric.rg +++ b/src/prometeo_metric.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -29,7 +29,7 @@ import "regent" -return function(SCHEMA, Fluid_columns) local Exports = {} +return function(SCHEMA, TYPES, Fluid_columns) local Exports = {} ------------------------------------------------------------------------------- -- IMPORTS @@ -39,7 +39,6 @@ local C = regentlib.c local MATH = require "math_utils" local MACRO = require "prometeo_macro" local CONST = require "prometeo_const" -local TYPES = terralib.includec("prometeo_types.h", {"-DEOS="..os.getenv("EOS")}) local pow = regentlib.pow(double) local fabs = regentlib.fabs(double) @@ -76,15 +75,15 @@ local nStencils = CONST.nStencils -- NOTE: DO NOT USE THESE COEFFICIENTS IN ACTUAL TASKS (unless they are CPU only) -- THEY ARE HERE UNTIL THE TEST SUITE IS TRANSITIONED TO C++ -local Cp = COEFFS.Cp -local Recon_Plus = COEFFS.Recon_Plus -local Recon_Minus = COEFFS.Recon_Minus -local Coeffs_Plus = COEFFS.Coeffs_Plus -local Coeffs_Minus = COEFFS.Coeffs_Minus -local Interp = COEFFS.Interp -local Grad = COEFFS.Grad -local KennedyOrder = COEFFS.KennedyOrder -local KennedyCoeff = COEFFS.KennedyCoeff +local Cp = COEFFS.Cp_cpu +local Recon_Plus = COEFFS.Recon_Plus_cpu +local Recon_Minus = COEFFS.Recon_Minus_cpu +local Coeffs_Plus = COEFFS.Coeffs_Plus_cpu +local Coeffs_Minus = COEFFS.Coeffs_Minus_cpu +local Interp = COEFFS.Interp_cpu +local Grad = COEFFS.Grad_cpu +local KennedyOrder = COEFFS.KennedyOrder_cpu +local KennedyCoeff = COEFFS.KennedyCoeff_cpu -- Helper functions local function GetCp(dir, c, t, i, b) @@ -264,9 +263,6 @@ end) ------------------------------------------------------------------------------- extern task Exports.InitializeMetric(MetricGhosts : region(ispace(int3d), Fluid_columns), - XGhosts : region(ispace(int3d), Fluid_columns), - YGhosts : region(ispace(int3d), Fluid_columns), - ZGhosts : region(ispace(int3d), Fluid_columns), Fluid : region(ispace(int3d), Fluid_columns), Fluid_bounds : rect3d, Grid_xWidth : double, Grid_yWidth : double, Grid_zWidth : double) @@ -277,7 +273,6 @@ where writes(Fluid.{dcsi_d, deta_d, dzet_d}), writes(Fluid.{dcsi_s, deta_s, dzet_s}) end -Exports.InitializeMetric:set_calling_convention(regentlib.convention.manual()) Exports.InitializeMetric:set_task_id(TYPES.TID_InitializeMetric) --for k, v in pairs(Exports.InitializeMetric:get_params_struct():getentries()) do -- print(k, v) @@ -306,7 +301,6 @@ Exports.mkCorrectGhostMetric = terralib.memoize(function(sdir) reads(Fluid.[nType]), reads writes(Fluid.[N]) end - CorrectGhostMetric:set_calling_convention(regentlib.convention.manual()) if sdir == "x" then CorrectGhostMetric:set_task_id(TYPES.TID_CorrectGhostMetricX) elseif sdir == "y" then diff --git a/src/prometeo_metric_coeffs.cc b/src/prometeo_metric_coeffs.cc new file mode 100644 index 0000000..4d3dc1f --- /dev/null +++ b/src/prometeo_metric_coeffs.cc @@ -0,0 +1,316 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_metric_coeffs.h" +#include "prometeo_metric_coeffs_macros.h" + +//----------------------------------------- +// Assemble vectors with coefficients +//---------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +// Indices offsets +const int8_t Cp_cpu[][5] = { +/* [Std_node ] =*/ Std_Cp, +/* [L_S_node ] =*/ L_S_Cp, +/* [Lp1_S_node] =*/ Lp1_S_Cp, +/* [Lp2_S_node] =*/ Lp2_S_Cp, +/* [Rm3_S_node] =*/ Rm3_S_Cp, +/* [Rm2_S_node] =*/ Rm2_S_Cp, +/* [Rm1_S_node] =*/ Rm1_S_Cp, +/* [R_S_node ] =*/ R_S_Cp, +/* [L_C_node ] =*/ L_C_Cp, +/* [Lp1_C_node] =*/ Lp1_C_Cp, +/* [Rm2_C_node] =*/ Rm2_C_Cp, +/* [Rm1_C_node] =*/ Rm1_C_Cp, +/* [R_C_node ] =*/ R_C_Cp, +}; + +// Face reconstruction operators [c-2, ..., c+3] +const double Recon_Plus_cpu[][24] = { +/* [ Std_node] =*/ Std_Recon_Plus, +/* [ L_S_node] =*/ L_S_Recon_Plus, +/* [Lp1_S_node] =*/ Lp1_S_Recon_Plus, +/* [Lp2_S_node] =*/ Lp2_S_Recon_Plus, +/* [Rm3_S_node] =*/ Rm3_S_Recon_Plus, +/* [Rm2_S_node] =*/ Rm2_S_Recon_Plus, +/* [Rm1_S_node] =*/ Rm1_S_Recon_Plus, +/* [ R_S_node] =*/ R_S_Recon_Plus, +/* [ L_C_node] =*/ L_C_Recon_Plus, +/* [Lp1_C_node] =*/ Lp1_C_Recon_Plus, +/* [Rm2_C_node] =*/ Rm2_C_Recon_Plus, +/* [Rm1_C_node] =*/ Rm1_C_Recon_Plus, +/* [ R_C_node] =*/ R_C_Recon_Plus, +}; + +const double Recon_Minus_cpu[][24] = { +/* [ Std_node] =*/ Std_Recon_Minus, +/* [ L_S_node] =*/ L_S_Recon_Minus, +/* [Lp1_S_node] =*/ Lp1_S_Recon_Minus, +/* [Lp2_S_node] =*/ Lp2_S_Recon_Minus, +/* [Rm3_S_node] =*/ Rm3_S_Recon_Minus, +/* [Rm2_S_node] =*/ Rm2_S_Recon_Minus, +/* [Rm1_S_node] =*/ Rm1_S_Recon_Minus, +/* [ R_S_node] =*/ R_S_Recon_Minus, +/* [ L_C_node] =*/ L_C_Recon_Minus, +/* [Lp1_C_node] =*/ Lp1_C_Recon_Minus, +/* [Rm2_C_node] =*/ Rm2_C_Recon_Minus, +/* [Rm1_C_node] =*/ Rm1_C_Recon_Minus, +/* [ R_C_node] =*/ R_C_Recon_Minus, +}; + +// Blending coefficients to obtain sixth order reconstruction +const double Coeffs_Plus_cpu[][4] = { +/* [ Std_node] =*/ Std_Coeffs_Plus, +/* [ L_S_node] =*/ L_S_Coeffs_Plus, +/* [Lp1_S_node] =*/ Lp1_S_Coeffs_Plus, +/* [Lp2_S_node] =*/ Lp2_S_Coeffs_Plus, +/* [Rm3_S_node] =*/ Rm3_S_Coeffs_Plus, +/* [Rm2_S_node] =*/ Rm2_S_Coeffs_Plus, +/* [Rm1_S_node] =*/ Rm1_S_Coeffs_Plus, +/* [ R_S_node] =*/ R_S_Coeffs_Plus, +/* [ L_C_node] =*/ L_C_Coeffs_Plus, +/* [Lp1_C_node] =*/ Lp1_C_Coeffs_Plus, +/* [Rm2_C_node] =*/ Rm2_C_Coeffs_Plus, +/* [Rm1_C_node] =*/ Rm1_C_Coeffs_Plus, +/* [ R_C_node] =*/ R_C_Coeffs_Plus, +}; + +const double Coeffs_Minus_cpu[][4] = { +/* [ Std_node] =*/ Std_Coeffs_Minus, +/* [ L_S_node] =*/ L_S_Coeffs_Minus, +/* [Lp1_S_node] =*/ Lp1_S_Coeffs_Minus, +/* [Lp2_S_node] =*/ Lp2_S_Coeffs_Minus, +/* [Rm3_S_node] =*/ Rm3_S_Coeffs_Minus, +/* [Rm2_S_node] =*/ Rm2_S_Coeffs_Minus, +/* [Rm1_S_node] =*/ Rm1_S_Coeffs_Minus, +/* [ R_S_node] =*/ R_S_Coeffs_Minus, +/* [ L_C_node] =*/ L_C_Coeffs_Minus, +/* [Lp1_C_node] =*/ Lp1_C_Coeffs_Minus, +/* [Rm2_C_node] =*/ Rm2_C_Coeffs_Minus, +/* [Rm1_C_node] =*/ Rm1_C_Coeffs_Minus, +/* [ R_C_node] =*/ R_C_Coeffs_Minus +}; + +// Staggered interpolation operator [c, c+1] +const float Interp_cpu[][2] = { +/* [ Std_node] =*/ {0.5, 0.5}, +/* [ L_S_node] =*/ {1.0, 0.0}, +/* [Lp1_S_node] =*/ {0.5, 0.5}, +/* [Lp2_S_node] =*/ {0.5, 0.5}, +/* [Rm3_S_node] =*/ {0.5, 0.5}, +/* [Rm2_S_node] =*/ {0.5, 0.5}, +/* [Rm1_S_node] =*/ {0.0, 1.0}, +/* [ R_S_node] =*/ {0.5, 0.5}, +/* [ L_C_node] =*/ {0.5, 0.5}, +/* [Lp1_C_node] =*/ {0.5, 0.5}, +/* [Rm2_C_node] =*/ {0.5, 0.5}, +/* [Rm1_C_node] =*/ {0.5, 0.5}, +/* [ R_C_node] =*/ {0.5, 0.5} +}; + +// Cell-center gradient operator [c - c-1, c+1 - c] +const float Grad[][2] = { +/* [ Std_node] =*/ {0.5, 0.5}, +/* [ L_S_node] =*/ {0.0, 2.0}, +/* [Lp1_S_node] =*/ {1.0, 0.5}, +/* [Lp2_S_node] =*/ {0.5, 0.5}, +/* [Rm3_S_node] =*/ {0.5, 0.5}, +/* [Rm2_S_node] =*/ {0.5, 0.5}, +/* [Rm1_S_node] =*/ {0.5, 1.0}, +/* [ R_S_node] =*/ {2.0, 0.0}, +/* [ L_C_node] =*/ {0.0, 1.0}, +/* [Lp1_C_node] =*/ {0.5, 0.5}, +/* [Rm2_C_node] =*/ {0.5, 0.5}, +/* [Rm1_C_node] =*/ {0.5, 0.5}, +/* [ R_C_node] =*/ {1.0, 0.0} +}; + +// Order of the Kennedy reconstruction scheme +const int8_t KennedyOrder_cpu[] = { +/* [ Std_node] =*/ Std_KennedyOrder, +/* [ L_S_node] =*/ L_S_KennedyOrder, +/* [Lp1_S_node] =*/ Lp1_S_KennedyOrder, +/* [Lp2_S_node] =*/ Lp2_S_KennedyOrder, +/* [Rm3_S_node] =*/ Rm3_S_KennedyOrder, +/* [Rm2_S_node] =*/ Rm2_S_KennedyOrder, +/* [Rm1_S_node] =*/ Rm1_S_KennedyOrder, +/* [ R_S_node] =*/ R_S_KennedyOrder, +/* [ L_C_node] =*/ L_C_KennedyOrder, +/* [Lp1_C_node] =*/ Lp1_C_KennedyOrder, +/* [Rm2_C_node] =*/ Rm2_C_KennedyOrder, +/* [Rm1_C_node] =*/ Rm1_C_KennedyOrder, +/* [ R_C_node] =*/ R_C_KennedyOrder +}; + +const double KennedyCoeff_cpu[][3] = { +/* [ Std_node] =*/ Std_KennedyCoeff, +/* [ L_S_node] =*/ L_S_KennedyCoeff, +/* [Lp1_S_node] =*/ Lp1_S_KennedyCoeff, +/* [Lp2_S_node] =*/ Lp2_S_KennedyCoeff, +/* [Rm3_S_node] =*/ Rm3_S_KennedyCoeff, +/* [Rm2_S_node] =*/ Rm2_S_KennedyCoeff, +/* [Rm1_S_node] =*/ Rm1_S_KennedyCoeff, +/* [ R_S_node] =*/ R_S_KennedyCoeff, +/* [ L_C_node] =*/ L_C_KennedyCoeff, +/* [Lp1_C_node] =*/ Lp1_C_KennedyCoeff, +/* [Rm2_C_node] =*/ Rm2_C_KennedyCoeff, +/* [Rm1_C_node] =*/ Rm1_C_KennedyCoeff, +/* [ R_C_node] =*/ R_C_KennedyCoeff +}; + +const int8_t KennedyNSum_cpu[] = { +/* [ Std_node] =*/ 3, +/* [ L_S_node] =*/ 0, +/* [Lp1_S_node] =*/ 3, +/* [Lp2_S_node] =*/ 3, +/* [Rm3_S_node] =*/ 2, +/* [Rm2_S_node] =*/ 1, +/* [Rm1_S_node] =*/ 0, +/* [ R_S_node] =*/ 0, +/* [ L_C_node] =*/ 3, +/* [Lp1_C_node] =*/ 3, +/* [Rm2_C_node] =*/ 2, +/* [Rm1_C_node] =*/ 1, +/* [ R_C_node] =*/ 0 +}; + +// Powers of 10 +const float p10[] = { 1, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9, + 1e-10, 1e-11, 1e-12, 1e-13}; + +#ifdef __cplusplus +} +#endif + +//----------------------------------------- +// Clean-up +//---------------------------------------- + +#undef Std_Cp +#undef L_S_Cp +#undef Lp1_S_Cp +#undef Lp2_S_Cp +#undef Rm3_S_Cp +#undef Rm2_S_Cp +#undef Rm1_S_Cp +#undef R_S_Cp +#undef L_C_Cp +#undef Lp1_C_Cp +#undef Rm2_C_Cp +#undef Rm1_C_Cp +#undef R_C_Cp + +#undef Std_Recon_Plus +#undef L_S_Recon_Plus +#undef Lp1_S_Recon_Plus +#undef Lp2_S_Recon_Plus +#undef Rm3_S_Recon_Plus +#undef Rm2_S_Recon_Plus +#undef Rm1_S_Recon_Plus +#undef R_S_Recon_Plus +#undef L_C_Recon_Plus +#undef Lp1_C_Recon_Plus +#undef Rm2_C_Recon_Plus +#undef Rm1_C_Recon_Plus +#undef R_C_Recon_Plus + +#undef Std_Recon_Minus +#undef L_S_Recon_Minus +#undef Lp1_S_Recon_Minus +#undef Lp2_S_Recon_Minus +#undef Rm3_S_Recon_Minus +#undef Rm2_S_Recon_Minus +#undef Rm1_S_Recon_Minus +#undef R_S_Recon_Minus +#undef L_C_Recon_Minus +#undef Lp1_C_Recon_Minus +#undef Rm2_C_Recon_Minus +#undef Rm1_C_Recon_Minus +#undef R_C_Recon_Minus + +#undef Std_Coeffs_Plus +#undef L_S_Coeffs_Plus +#undef Lp1_S_Coeffs_Plus +#undef Lp2_S_Coeffs_Plus +#undef Rm3_S_Coeffs_Plus +#undef Rm2_S_Coeffs_Plus +#undef Rm1_S_Coeffs_Plus +#undef R_S_Coeffs_Plus +#undef L_C_Coeffs_Plus +#undef Lp1_C_Coeffs_Plus +#undef Rm2_C_Coeffs_Plus +#undef Rm1_C_Coeffs_Plus +#undef R_C_Coeffs_Plus + +#undef Std_Coeffs_Minus +#undef L_S_Coeffs_Minus +#undef Lp1_S_Coeffs_Minus +#undef Lp2_S_Coeffs_Minus +#undef Rm3_S_Coeffs_Minus +#undef Rm2_S_Coeffs_Minus +#undef Rm1_S_Coeffs_Minus +#undef R_S_Coeffs_Minus +#undef L_C_Coeffs_Minus +#undef Lp1_C_Coeffs_Minus +#undef Rm2_C_Coeffs_Minus +#undef Rm1_C_Coeffs_Minus +#undef R_C_Coeffs_Minus + +#undef Std_KennedyOrder +#undef L_S_KennedyOrder +#undef Lp1_S_KennedyOrder +#undef Lp2_S_KennedyOrder +#undef Rm3_S_KennedyOrder +#undef Rm2_S_KennedyOrder +#undef Rm1_S_KennedyOrder +#undef R_S_KennedyOrder +#undef L_C_KennedyOrder +#undef Lp1_C_KennedyOrder +#undef Rm2_C_KennedyOrder +#undef Rm1_C_KennedyOrder +#undef R_C_KennedyOrder + +#undef Std_KennedyCoeff +#undef L_S_KennedyCoeff +#undef Lp1_S_KennedyCoeff +#undef Lp2_S_KennedyCoeff +#undef Rm3_S_KennedyCoeff +#undef Rm2_S_KennedyCoeff +#undef Rm1_S_KennedyCoeff +#undef R_S_KennedyCoeff +#undef L_C_KennedyCoeff +#undef Lp1_C_KennedyCoeff +#undef Rm2_C_KennedyCoeff +#undef Rm1_C_KennedyCoeff +#undef R_C_KennedyCoeff + diff --git a/src/prometeo_metric_coeffs.cu b/src/prometeo_metric_coeffs.cu new file mode 100644 index 0000000..835a8a9 --- /dev/null +++ b/src/prometeo_metric_coeffs.cu @@ -0,0 +1,316 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_metric_coeffs.h" +#include "prometeo_metric_coeffs_macros.h" + +//----------------------------------------- +// Assemble vectors with coefficients +//---------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +// Indices offsets +__CUDA_CONST__ int8_t Cp_gpu[][5] = { +/* [Std_node ] =*/ Std_Cp, +/* [L_S_node ] =*/ L_S_Cp, +/* [Lp1_S_node] =*/ Lp1_S_Cp, +/* [Lp2_S_node] =*/ Lp2_S_Cp, +/* [Rm3_S_node] =*/ Rm3_S_Cp, +/* [Rm2_S_node] =*/ Rm2_S_Cp, +/* [Rm1_S_node] =*/ Rm1_S_Cp, +/* [R_S_node ] =*/ R_S_Cp, +/* [L_C_node ] =*/ L_C_Cp, +/* [Lp1_C_node] =*/ Lp1_C_Cp, +/* [Rm2_C_node] =*/ Rm2_C_Cp, +/* [Rm1_C_node] =*/ Rm1_C_Cp, +/* [R_C_node ] =*/ R_C_Cp, +}; + +// Face reconstruction operators [c-2, ..., c+3] +__CUDA_CONST__ double Recon_Plus_gpu[][24] = { +/* [ Std_node] =*/ Std_Recon_Plus, +/* [ L_S_node] =*/ L_S_Recon_Plus, +/* [Lp1_S_node] =*/ Lp1_S_Recon_Plus, +/* [Lp2_S_node] =*/ Lp2_S_Recon_Plus, +/* [Rm3_S_node] =*/ Rm3_S_Recon_Plus, +/* [Rm2_S_node] =*/ Rm2_S_Recon_Plus, +/* [Rm1_S_node] =*/ Rm1_S_Recon_Plus, +/* [ R_S_node] =*/ R_S_Recon_Plus, +/* [ L_C_node] =*/ L_C_Recon_Plus, +/* [Lp1_C_node] =*/ Lp1_C_Recon_Plus, +/* [Rm2_C_node] =*/ Rm2_C_Recon_Plus, +/* [Rm1_C_node] =*/ Rm1_C_Recon_Plus, +/* [ R_C_node] =*/ R_C_Recon_Plus, +}; + +__CUDA_CONST__ double Recon_Minus_gpu[][24] = { +/* [ Std_node] =*/ Std_Recon_Minus, +/* [ L_S_node] =*/ L_S_Recon_Minus, +/* [Lp1_S_node] =*/ Lp1_S_Recon_Minus, +/* [Lp2_S_node] =*/ Lp2_S_Recon_Minus, +/* [Rm3_S_node] =*/ Rm3_S_Recon_Minus, +/* [Rm2_S_node] =*/ Rm2_S_Recon_Minus, +/* [Rm1_S_node] =*/ Rm1_S_Recon_Minus, +/* [ R_S_node] =*/ R_S_Recon_Minus, +/* [ L_C_node] =*/ L_C_Recon_Minus, +/* [Lp1_C_node] =*/ Lp1_C_Recon_Minus, +/* [Rm2_C_node] =*/ Rm2_C_Recon_Minus, +/* [Rm1_C_node] =*/ Rm1_C_Recon_Minus, +/* [ R_C_node] =*/ R_C_Recon_Minus, +}; + +// Blending coefficients to obtain sixth order reconstruction +__CUDA_CONST__ double Coeffs_Plus_gpu[][4] = { +/* [ Std_node] =*/ Std_Coeffs_Plus, +/* [ L_S_node] =*/ L_S_Coeffs_Plus, +/* [Lp1_S_node] =*/ Lp1_S_Coeffs_Plus, +/* [Lp2_S_node] =*/ Lp2_S_Coeffs_Plus, +/* [Rm3_S_node] =*/ Rm3_S_Coeffs_Plus, +/* [Rm2_S_node] =*/ Rm2_S_Coeffs_Plus, +/* [Rm1_S_node] =*/ Rm1_S_Coeffs_Plus, +/* [ R_S_node] =*/ R_S_Coeffs_Plus, +/* [ L_C_node] =*/ L_C_Coeffs_Plus, +/* [Lp1_C_node] =*/ Lp1_C_Coeffs_Plus, +/* [Rm2_C_node] =*/ Rm2_C_Coeffs_Plus, +/* [Rm1_C_node] =*/ Rm1_C_Coeffs_Plus, +/* [ R_C_node] =*/ R_C_Coeffs_Plus, +}; + +__CUDA_CONST__ double Coeffs_Minus_gpu[][4] = { +/* [ Std_node] =*/ Std_Coeffs_Minus, +/* [ L_S_node] =*/ L_S_Coeffs_Minus, +/* [Lp1_S_node] =*/ Lp1_S_Coeffs_Minus, +/* [Lp2_S_node] =*/ Lp2_S_Coeffs_Minus, +/* [Rm3_S_node] =*/ Rm3_S_Coeffs_Minus, +/* [Rm2_S_node] =*/ Rm2_S_Coeffs_Minus, +/* [Rm1_S_node] =*/ Rm1_S_Coeffs_Minus, +/* [ R_S_node] =*/ R_S_Coeffs_Minus, +/* [ L_C_node] =*/ L_C_Coeffs_Minus, +/* [Lp1_C_node] =*/ Lp1_C_Coeffs_Minus, +/* [Rm2_C_node] =*/ Rm2_C_Coeffs_Minus, +/* [Rm1_C_node] =*/ Rm1_C_Coeffs_Minus, +/* [ R_C_node] =*/ R_C_Coeffs_Minus +}; + +// Staggered interpolation operator [c, c+1] +__CUDA_CONST__ float Interp_gpu[][2] = { +/* [ Std_node] =*/ {0.5, 0.5}, +/* [ L_S_node] =*/ {1.0, 0.0}, +/* [Lp1_S_node] =*/ {0.5, 0.5}, +/* [Lp2_S_node] =*/ {0.5, 0.5}, +/* [Rm3_S_node] =*/ {0.5, 0.5}, +/* [Rm2_S_node] =*/ {0.5, 0.5}, +/* [Rm1_S_node] =*/ {0.0, 1.0}, +/* [ R_S_node] =*/ {0.5, 0.5}, +/* [ L_C_node] =*/ {0.5, 0.5}, +/* [Lp1_C_node] =*/ {0.5, 0.5}, +/* [Rm2_C_node] =*/ {0.5, 0.5}, +/* [Rm1_C_node] =*/ {0.5, 0.5}, +/* [ R_C_node] =*/ {0.5, 0.5} +}; + +// Cell-center gradient operator [c - c-1, c+1 - c] +__CUDA_CONST__ float Grad_gpu[][2] = { +/* [ Std_node] =*/ {0.5, 0.5}, +/* [ L_S_node] =*/ {0.0, 2.0}, +/* [Lp1_S_node] =*/ {1.0, 0.5}, +/* [Lp2_S_node] =*/ {0.5, 0.5}, +/* [Rm3_S_node] =*/ {0.5, 0.5}, +/* [Rm2_S_node] =*/ {0.5, 0.5}, +/* [Rm1_S_node] =*/ {0.5, 1.0}, +/* [ R_S_node] =*/ {2.0, 0.0}, +/* [ L_C_node] =*/ {0.0, 1.0}, +/* [Lp1_C_node] =*/ {0.5, 0.5}, +/* [Rm2_C_node] =*/ {0.5, 0.5}, +/* [Rm1_C_node] =*/ {0.5, 0.5}, +/* [ R_C_node] =*/ {1.0, 0.0} +}; + +// Order of the Kennedy reconstruction scheme +__CUDA_CONST__ int8_t KennedyOrder_gpu[] = { +/* [ Std_node] =*/ Std_KennedyOrder, +/* [ L_S_node] =*/ L_S_KennedyOrder, +/* [Lp1_S_node] =*/ Lp1_S_KennedyOrder, +/* [Lp2_S_node] =*/ Lp2_S_KennedyOrder, +/* [Rm3_S_node] =*/ Rm3_S_KennedyOrder, +/* [Rm2_S_node] =*/ Rm2_S_KennedyOrder, +/* [Rm1_S_node] =*/ Rm1_S_KennedyOrder, +/* [ R_S_node] =*/ R_S_KennedyOrder, +/* [ L_C_node] =*/ L_C_KennedyOrder, +/* [Lp1_C_node] =*/ Lp1_C_KennedyOrder, +/* [Rm2_C_node] =*/ Rm2_C_KennedyOrder, +/* [Rm1_C_node] =*/ Rm1_C_KennedyOrder, +/* [ R_C_node] =*/ R_C_KennedyOrder +}; + +__CUDA_CONST__ double KennedyCoeff_gpu[][3] = { +/* [ Std_node] =*/ Std_KennedyCoeff, +/* [ L_S_node] =*/ L_S_KennedyCoeff, +/* [Lp1_S_node] =*/ Lp1_S_KennedyCoeff, +/* [Lp2_S_node] =*/ Lp2_S_KennedyCoeff, +/* [Rm3_S_node] =*/ Rm3_S_KennedyCoeff, +/* [Rm2_S_node] =*/ Rm2_S_KennedyCoeff, +/* [Rm1_S_node] =*/ Rm1_S_KennedyCoeff, +/* [ R_S_node] =*/ R_S_KennedyCoeff, +/* [ L_C_node] =*/ L_C_KennedyCoeff, +/* [Lp1_C_node] =*/ Lp1_C_KennedyCoeff, +/* [Rm2_C_node] =*/ Rm2_C_KennedyCoeff, +/* [Rm1_C_node] =*/ Rm1_C_KennedyCoeff, +/* [ R_C_node] =*/ R_C_KennedyCoeff +}; + +__CUDA_CONST__ int8_t KennedyNSum_gpu[] = { +/* [ Std_node] =*/ 3, +/* [ L_S_node] =*/ 0, +/* [Lp1_S_node] =*/ 3, +/* [Lp2_S_node] =*/ 3, +/* [Rm3_S_node] =*/ 2, +/* [Rm2_S_node] =*/ 1, +/* [Rm1_S_node] =*/ 0, +/* [ R_S_node] =*/ 0, +/* [ L_C_node] =*/ 3, +/* [Lp1_C_node] =*/ 3, +/* [Rm2_C_node] =*/ 2, +/* [Rm1_C_node] =*/ 1, +/* [ R_C_node] =*/ 0 +}; + +// Powers of 10 +__CUDA_CONST__ float p10[] = { 1, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9, + 1e-10, 1e-11, 1e-12, 1e-13}; + +#ifdef __cplusplus +} +#endif + +//----------------------------------------- +// Clean-up +//---------------------------------------- + +#undef Std_Cp +#undef L_S_Cp +#undef Lp1_S_Cp +#undef Lp2_S_Cp +#undef Rm3_S_Cp +#undef Rm2_S_Cp +#undef Rm1_S_Cp +#undef R_S_Cp +#undef L_C_Cp +#undef Lp1_C_Cp +#undef Rm2_C_Cp +#undef Rm1_C_Cp +#undef R_C_Cp + +#undef Std_Recon_Plus +#undef L_S_Recon_Plus +#undef Lp1_S_Recon_Plus +#undef Lp2_S_Recon_Plus +#undef Rm3_S_Recon_Plus +#undef Rm2_S_Recon_Plus +#undef Rm1_S_Recon_Plus +#undef R_S_Recon_Plus +#undef L_C_Recon_Plus +#undef Lp1_C_Recon_Plus +#undef Rm2_C_Recon_Plus +#undef Rm1_C_Recon_Plus +#undef R_C_Recon_Plus + +#undef Std_Recon_Minus +#undef L_S_Recon_Minus +#undef Lp1_S_Recon_Minus +#undef Lp2_S_Recon_Minus +#undef Rm3_S_Recon_Minus +#undef Rm2_S_Recon_Minus +#undef Rm1_S_Recon_Minus +#undef R_S_Recon_Minus +#undef L_C_Recon_Minus +#undef Lp1_C_Recon_Minus +#undef Rm2_C_Recon_Minus +#undef Rm1_C_Recon_Minus +#undef R_C_Recon_Minus + +#undef Std_Coeffs_Plus +#undef L_S_Coeffs_Plus +#undef Lp1_S_Coeffs_Plus +#undef Lp2_S_Coeffs_Plus +#undef Rm3_S_Coeffs_Plus +#undef Rm2_S_Coeffs_Plus +#undef Rm1_S_Coeffs_Plus +#undef R_S_Coeffs_Plus +#undef L_C_Coeffs_Plus +#undef Lp1_C_Coeffs_Plus +#undef Rm2_C_Coeffs_Plus +#undef Rm1_C_Coeffs_Plus +#undef R_C_Coeffs_Plus + +#undef Std_Coeffs_Minus +#undef L_S_Coeffs_Minus +#undef Lp1_S_Coeffs_Minus +#undef Lp2_S_Coeffs_Minus +#undef Rm3_S_Coeffs_Minus +#undef Rm2_S_Coeffs_Minus +#undef Rm1_S_Coeffs_Minus +#undef R_S_Coeffs_Minus +#undef L_C_Coeffs_Minus +#undef Lp1_C_Coeffs_Minus +#undef Rm2_C_Coeffs_Minus +#undef Rm1_C_Coeffs_Minus +#undef R_C_Coeffs_Minus + +#undef Std_KennedyOrder +#undef L_S_KennedyOrder +#undef Lp1_S_KennedyOrder +#undef Lp2_S_KennedyOrder +#undef Rm3_S_KennedyOrder +#undef Rm2_S_KennedyOrder +#undef Rm1_S_KennedyOrder +#undef R_S_KennedyOrder +#undef L_C_KennedyOrder +#undef Lp1_C_KennedyOrder +#undef Rm2_C_KennedyOrder +#undef Rm1_C_KennedyOrder +#undef R_C_KennedyOrder + +#undef Std_KennedyCoeff +#undef L_S_KennedyCoeff +#undef Lp1_S_KennedyCoeff +#undef Lp2_S_KennedyCoeff +#undef Rm3_S_KennedyCoeff +#undef Rm2_S_KennedyCoeff +#undef Rm1_S_KennedyCoeff +#undef R_S_KennedyCoeff +#undef L_C_KennedyCoeff +#undef Lp1_C_KennedyCoeff +#undef Rm2_C_KennedyCoeff +#undef Rm1_C_KennedyCoeff +#undef R_C_KennedyCoeff + diff --git a/src/prometeo_metric_coeffs.h b/src/prometeo_metric_coeffs.h index 0db4149..f2d63cb 100644 --- a/src/prometeo_metric_coeffs.h +++ b/src/prometeo_metric_coeffs.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -30,9 +30,11 @@ #ifndef __PROMETEO_METRIC_COEFFS_H__ #define __PROMETEO_METRIC_COEFFS_H__ +#include + #ifndef __CUDA_CONST__ #ifdef __CUDACC__ -#define __CUDA_CONST__ __constant__ +#define __CUDA_CONST__ __device__ __constant__ #else #define __CUDA_CONST__ #endif @@ -42,6 +44,13 @@ extern "C" { #endif +// Stencil indices +#define Stencil1 0 +#define Stencil2 1 +#define Stencil3 2 +#define Stencil4 3 +#define nStencils 4 + // Node types #define Std_node 0 // Node with standard stencil #define L_S_node 1 // Left node on staggered bc @@ -57,801 +66,95 @@ extern "C" { #define Rm1_C_node 11 // Right minus one node on collocated bc #define R_C_node 12 // Right node on collocated bc -//----------------------------------------------------------------------------- -// STANDARD NODE -//----------------------------------------------------------------------------- -// -// dxm2: |-----------------------------------------| -// dxm1: |---------------------------| -// dx: |-------------| -// dxp1: |-------------| -// dxp2: |---------------------------| -// dxp3: |-----------------------------------------| -// c-2 c-1 c x=0 c+1 c+2 c+3 -// |------x------|------x------|------x------|------x------|------x------|------x------| -// -// Plus reconstruction: -// 1st: o-------------o-----> <-----o -// 2nd: o-----> <-----o-------------o -// 3rd: o-------------o-------------o-----> -// 4th: o-----> <-----o-------------o-------------o -// -// Minus reconstruction: -// 1st: o-----> <-----o-------------o -// 2nd: o-------------o-----> <-----o -// 3rd: <-----o-------------o-------------o -// 4th: o-------------o-------------o-----> <-----o - - -#define Std_Cp { -2, -1, 1, 2, 3} - -#define Std_Recon_Plus { \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 2.0/6.0, -7.0/6.0, 11.0/6.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 3.0/12.0, 13.0/12.0, -5.0/12.0, 1.0/12.0} - -#define Std_Recon_Minus { \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 11.0/6.0, -7.0/6.0, 2.0/6.0, \ - 1.0/12.0, -5.0/12.0, 13.0/12.0, 3.0/12.0, 0.0, 0.0} - -#define Std_Coeffs_Plus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} -#define Std_Coeffs_Minus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} - -//const double Std_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; -//for i=1,6 do -// for St =1,nStencils do -// Std_Recon[i] = Std_Recon[i] + Std_Recon_Plus[(St-1)*6+i]*Std_Coeffs_Plus[St] -// end -//end - -#define Std_KennedyOrder 3 // Sixth-order -#define Std_KennedyCoeff {3.0/4.0, -3.0/20.0, 1.0/60.0} - -//----------------------------------------------------------------------------- -// STAGGERED LEFT BC -//----------------------------------------------------------------------------- - -// Boundary node is staggered on the face so we do not need any reconstruction -#define L_S_Recon_Plus { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} -#define L_S_Recon_Minus { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} - -#define L_S_Cp {0,0,1,1,1} -#define L_S_Coeffs_Plus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} -#define L_S_Coeffs_Minus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} - -//local L_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// L_S_Recon[i] = L_S_Recon[i] + L_S_Recon_Plus[(St-1)*6+i]*L_S_Coeffs_Plus[St] -// end -//end - -#define L_S_KennedyOrder 0 // Zero-order -#define L_S_KennedyCoeff {0.0, 0.0, 0.0} - - -// dx: |-------------| -// dxp1: |-------------| -// dxp2: |---------------------------| -// dxp3: |-----------------------------------------| -// c-0.5 c x=0 c+1 c+2 c+3 -// x------x------|------x------|------x------|------x------| -// -// Plus reconstruction: -// 1st: o------o-----> <-----o -// 2nd: o-----> <-----o-------------o -// 3rd: does not exist -// 4th: o-----> <-----o-------------o-------------o -// -// Minus reconstruction: -// 1st: o-----> <-----o-------------o -// 2nd: o------o-----> <-----o -// 3rd: <-----o-------------o-------------o -// 4th: does not exist - -#define Lp1_S_Cp { -1, -1, 1, 2, 3} - -#define Lp1_S_Recon_Plus { \ - 0.0, -2.0/4.0, 5.0/4.0, 1.0/4.0, 0.0, 0.0, \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 3.0/12.0, 13.0/12.0, -5.0/12.0, 1.0/12.0} - -#define Lp1_S_Recon_Minus { \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, -2.0/4.0, 5.0/4.0, 1.0/4.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 11.0/6.0, -7.0/6.0, 2.0/6.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define Lp1_S_Coeffs_Plus {2.0/4.0, 1.0/4.0, 0.0, 1.0/4.0} -#define Lp1_S_Coeffs_Minus {7.0/16.0, 8.0/16.0, 1.0/16.0, 0.0 } - -//local Lp1_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// Lp1_S_Recon[i] = Lp1_S_Recon[i] + Lp1_S_Recon_Plus[(St-1)*6+i]*Lp1_S_Coeffs_Plus[St] -// end -//end - -#define Lp1_S_KennedyOrder 1 // Second-order -#define Lp1_S_KennedyCoeff {0.5, 0.0, 0.0} - - -// dxm1: |---------------------------| -// dx: |-------------| -// dxp1: |-------------| -// dxp2: |---------------------------| -// dxp3: |-----------------------------------------| -// c-1.5 c-1 c x=0 c+1 c+2 c+3 -// x------x------|------x------|------x------|------x------|------x------| -// -// Plus reconstruction: -// 1st: o-------------o-----> <-----o -// 2nd: o-----> <-----o-------------o -// 3rd: o------o-------------o-----> -// 4th: o-----> <-----o-------------o-------------o -// -// Minus reconstruction: -// 1st: o-----> <-----o-------------o -// 2nd: o-------------o-----> <-----o -// 3rd: <-----o-------------o-------------o -// 4th: o------o-------------o-----> <-----o - -#define Lp2_S_Cp { -2, -1, 1, 2, 3} - -#define Lp2_S_Recon_Plus { \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 1.0, -2.0, 2.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 3.0/12.0, 13.0/12.0, -5.0/12.0, 1.0/12.0} - -#define Lp2_S_Recon_Minus { \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 11.0/6.0, -7.0/6.0, 2.0/6.0, \ - 3.0/9.0, -7.0/9.0, 11.0/9.0, 2.0/9.0, 0.0, 0.0} \ - -#define Lp2_S_Coeffs_Plus {47.0/100.0, 27.0/100.0, 10.0/100.0, 16.0/100.0} -#define Lp2_S_Coeffs_Minus {39.0/100.0, 27.0/100.0, 4.0/100.0, 30.0/100.0} - -//local Lp2_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// Lp2_S_Recon[i] = Lp2_S_Recon[i] + Lp2_S_Recon_Plus[(St-1)*6+i]*Lp2_S_Coeffs_Plus[St] -// end -//end - -#define Lp2_S_KennedyOrder 2 // Fourth-order -#define Lp2_S_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} - - -//------------------------------------------------------------------------------- -//-- COLLOCATED LEFT BC -//------------------------------------------------------------------------------- - -// dx: |-------------| -// dxp1: |-------------| -// c x=0 c+1 -// |------x------|------x------| -// -// Plus reconstruction: -// 1st: o-----> -// 2nd: does not exist -// 3rd: does not exist -// 4th: does not exist -// -// Minus reconstruction: -// 1st: <-----o -// 2nd: does not exist -// 3rd: does not exist -// 4th: does not exist - -#define L_C_Cp { 0, 0, 1, 2, 2} - -#define L_C_Recon_Plus { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} -#define L_C_Recon_Minus { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define L_C_Coeffs_Plus {1.0, 0.0, 0.0, 0.0} -#define L_C_Coeffs_Minus {1.0, 0.0, 0.0, 0.0} - -#define L_C_Recon {0.0, 0.0, 0.5, 0.5, 0.0, 0.0} - -#define L_C_KennedyOrder 1 // Second-order -#define L_C_KennedyCoeff {0.5, 0.0, 0.0} - - -// dxm1: |---------------------------| -// dx: |-------------| -// dxp1: |-------------| -// dxp2: |---------------------------| -// dxp3: |-----------------------------------------| -// c-1 c x=0 c+1 c+2 c+3 -// |------x------|------x------|------x------|------x------|------x------| -// -// Plus reconstruction: -// 1st: o-------------o-----> <-----o -// 2nd: o-----> <-----o-------------o -// 3rd: does not exist -// 4th: does not exist -// -// Minus reconstruction: -// 1st: o-----> <-----o-------------o -// 2nd: o-------------o-----> <-----o -// 3rd: does not exist -// 4th: does not exist - -#define Lp1_C_Cp { -1, -1, 1, 2, 2} - -#define Lp1_C_Recon_Plus { \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define Lp1_C_Recon_Minus { \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define Lp1_C_Coeffs_Plus {1.0/2.0, 1.0/2.0, 0.0, 0.0} -#define Lp1_C_Coeffs_Minus {1.0/2.0, 1.0/2.0, 0.0, 0.0} - -//local Lp1_C_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// Lp1_C_Recon[i] = Lp1_C_Recon[i] + Lp1_C_Recon_Plus[(St-1)*6+i]*Lp1_C_Coeffs_Plus[St] -// end -//end - -#define Lp1_C_KennedyOrder 2 // Fourth-order -#define Lp1_C_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} - -//----------------------------------------------------------------------------- -// STAGGERED RIGHT BC -//----------------------------------------------------------------------------- - -#define R_S_Cp {-1, -1, 0, 0, 0} - -#define R_S_Recon_Plus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} -#define R_S_Recon_Minus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define R_S_Coeffs_Plus {0.0, 0.0, 0.0, 0.0} -#define R_S_Coeffs_Minus {0.0, 0.0, 0.0, 0.0} - -//local R_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) - -#define R_S_KennedyOrder 0 // Zero-order -#define R_S_KennedyCoeff {0.0, 0.0, 0.0} - -// Boundary node is staggered on the face so we do not need any reconstruction -#define Rm1_S_Cp {-1, -1, 1, 1, 1} - -#define Rm1_S_Recon_Plus {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 1.0, 0.0, 0.0} -#define Rm1_S_Recon_Minus {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 1.0, 0.0, 0.0} - -#define Rm1_S_Coeffs_Plus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} -#define Rm1_S_Coeffs_Minus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} - -//local Rm1_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// Rm1_S_Recon[i] = Rm1_S_Recon[i] + Rm1_S_Recon_Plus[(St-1)*6+i]*Rm1_S_Coeffs_Plus[St] -// end -//end - -#define Rm1_S_KennedyOrder 0 // Zero-order -#define Rm1_S_KennedyCoeff {0.0, 0.0, 0.0} - - -// dxm2: |-----------------------------------------| -// dxm1: |---------------------------| -// dx: |-------------| -// dxp1: |-------------| -// c-2 c-1 c x=0 c+1 c+1.5 -// |------x------|------x------|------x------|------x------x -// -// Plus reconstruction: -// 1st: o-------------o-----> <-----o -// 2nd: o-----> <-----o------o -// 3rd: o-------------o-------------o-----> -// 4th: does not exist -// -// Minus reconstruction: -// 1st: o-----> <-----o------o -// 2nd: o-------------o-----> <-----o -// 3rd: does not exist -// 4th: o-------------o-------------o-----> <-----o - -#define Rm2_S_Cp { -2, -1, 1, 2, 2} - -#define Rm2_S_Recon_Plus { \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 1.0/4.0, 5.0/4.0, -2.0/4.0, 0.0, \ - 2.0/6.0, -7.0/6.0, 11.0/6.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define Rm2_S_Recon_Minus { \ - 0.0, 0.0, 1.0/4.0, 5.0/4.0, -2.0/4.0, 0.0, \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 1.0/12.0, -5.0/12.0, 13.0/12.0, 3.0/12.0, 0.0, 0.0} - -#define Rm2_S_Coeffs_Plus {7.0/16.0, 8.0/16.0, 1.0/16.0, 0.0 } -#define Rm2_S_Coeffs_Minus {2.0/4.0, 1.0/4.0, 0.0, 1.0/4.0} - -//local Rm2_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// Rm2_S_Recon[i] = Rm2_S_Recon[i] + Rm2_S_Recon_Plus[(St-1)*6+i]*Rm2_S_Coeffs_Plus[St] -// end -//end - -#define Rm2_S_KennedyOrder 1 // Second-order -#define Rm2_S_KennedyCoeff {0.5, 0.0, 0.0} - - -// dxm2: |-----------------------------------------| -// dxm1: |---------------------------| -// dx: |-------------| -// dxp1: |-------------| -// dxp2: |---------------------------| -// c-2 c-1 c x=0 c+1 c+2 c+2.5 -// |------x------|------x------|------x------|------x------|------x------x -// -// Plus reconstruction: -// 1st: o-------------o-----> <-----o -// 2nd: o-----> <-----o-------------o -// 3rd: o-------------o-------------o-----> -// 4th: o-----> <-----o-------------o------o -// -// Minus reconstruction: -// 1st: o-----> <-----o-------------o -// 2nd: o-------------o-----> <-----o -// 3rd: <-----o-------------o------o -// 4th: o-------------o-------------o-----> <-----o - -#define Rm3_S_Cp { -2, -1, 1, 2, 3} - -#define Rm3_S_Recon_Plus { \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 2.0/6.0, -7.0/6.0, 11.0/6.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 2.0/9.0, 11.0/9.0, -7.0/9.0, 3.0/9.0} - -#define Rm3_S_Recon_Minus { \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 2.0, -2.0, 1.0, \ - 1.0/12.0, -5.0/12.0, 13.0/12.0, 3.0/12.0, 0.0, 0.0} - -#define Rm3_S_Coeffs_Plus {39.0/100.0, 27.0/100.0, 4.0/100.0, 30.0/100.0} -#define Rm3_S_Coeffs_Minus {47.0/100.0, 27.0/100.0, 10.0/100.0, 16.0/100.0} - -//local Rm3_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// Rm3_S_Recon[i] = Rm3_S_Recon[i] + Rm3_S_Recon_Plus[(St-1)*6+i]*Rm3_S_Coeffs_Plus[St] -// end -//end - -#define Rm3_S_KennedyOrder 2 // Fourth-order -#define Rm3_S_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} - - -//----------------------------------------------------------------------------- -// COLLOCATED RIGHT BC -//----------------------------------------------------------------------------- - -#define R_C_Cp {-1, -1, 0, 0, 0} - -#define R_C_Recon_Plus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} -#define R_C_Recon_Minus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define R_C_Coeffs_Plus {0.0, 0.0, 0.0, 0.0} -#define R_C_Coeffs_Minus {0.0, 0.0, 0.0, 0.0} - -//local R_C_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) - -#define R_C_KennedyOrder 0 // Zero-order -#define R_C_KennedyCoeff {0.0, 0.0, 0.0} - - -// dxm2: |-----------------------------------------| -// dxm1: |---------------------------| -// dx: |-------------| -// dxp1: |-------------| -// c-2 c-1 c x=0 c+1 -// |------x------|------x------|------x------|------x------| -// -// Plus reconstruction: -// 1st: o-----> -// 2nd: does not exist -// 3rd: does not exist -// 4th: does not exist -// -// Minus reconstruction: -// 1st: <-----o -// 2nd: does not exist -// 3rd: does not exist -// 4th: does not exist - -#define Rm1_C_Cp { -1, -1, 1, 1, 1} - -#define Rm1_C_Recon_Plus {0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} -#define Rm1_C_Recon_Minus {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define Rm1_C_Coeffs_Plus {1.0, 0.0, 0.0, 0.0} -#define Rm1_C_Coeffs_Minus {1.0, 0.0, 0.0, 0.0} - -//local Rm1_C_Recon = terralib.newlist({0.0, 0.0, 0.5, 0.5, 0.0, 0.0}) - -#define Rm1_C_KennedyOrder 1 // Second-order -#define Rm1_C_KennedyCoeff {0.5, 0.0, 0.0} - - -// dxm2: |-----------------------------------------| -// dxm1: |---------------------------| -// dx: |-------------| -// dxp1: |-------------| -// dxp2: |---------------------------| -// c-2 c-1 c x=0 c+1 c+2 -// |------x------|------x------|------x------|------x------|------x------| -// -// Plus reconstruction: -// 1st: o-------------o-----> <-----o -// 2nd: o-----> <-----o-------------o -// 3rd: does not exist -// 4th: does not exist -// -// Minus reconstruction: -// 1st: o-----> <-----o-------------o -// 2nd: o-------------o-----> <-----o -// 3rd: does not exist -// 4th: does not exist - -#define Rm2_C_Cp { -1, -1, 1, 2, 2} - -#define Rm2_C_Recon_Plus { \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define Rm2_C_Recon_Minus { \ - 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ - 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} - -#define Rm2_C_Coeffs_Plus {1.0/2.0, 1.0/2.0, 0.0, 0.0} -#define Rm2_C_Coeffs_Minus {1.0/2.0, 1.0/2.0, 0.0, 0.0} - -//local Rm2_C_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -//for i=1,6 do -// for St =1,nStencils do -// Rm2_C_Recon[i] = Rm2_C_Recon[i] + Rm2_C_Recon_Plus[(St-1)*6+i]*Rm2_C_Coeffs_Plus[St] -// end -//end - -#define Rm2_C_KennedyOrder 2 // Fourth-order -#define Rm2_C_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} - - -//----------------------------------------- -// Assemble vectors with coefficients -//---------------------------------------- +///////////////////////////////// +// Constants for CPU tasks +///////////////////////////////// // Indices offsets -const __CUDA_CONST__ int Cp[][5] = { -/* [Std_node ] =*/ Std_Cp, -/* [L_S_node ] =*/ L_S_Cp, -/* [Lp1_S_node] =*/ Lp1_S_Cp, -/* [Lp2_S_node] =*/ Lp2_S_Cp, -/* [Rm3_S_node] =*/ Rm3_S_Cp, -/* [Rm2_S_node] =*/ Rm2_S_Cp, -/* [Rm1_S_node] =*/ Rm1_S_Cp, -/* [R_S_node ] =*/ R_S_Cp, -/* [L_C_node ] =*/ L_C_Cp, -/* [Lp1_C_node] =*/ Lp1_C_Cp, -/* [Rm2_C_node] =*/ Rm2_C_Cp, -/* [Rm1_C_node] =*/ Rm1_C_Cp, -/* [R_C_node ] =*/ R_C_Cp, -}; +extern const int8_t Cp_cpu[13][5]; // Face reconstruction operators [c-2, ..., c+3] -const __CUDA_CONST__ double Recon_Plus[][24] = { -/* [ Std_node] =*/ Std_Recon_Plus, -/* [ L_S_node] =*/ L_S_Recon_Plus, -/* [Lp1_S_node] =*/ Lp1_S_Recon_Plus, -/* [Lp2_S_node] =*/ Lp2_S_Recon_Plus, -/* [Rm3_S_node] =*/ Rm3_S_Recon_Plus, -/* [Rm2_S_node] =*/ Rm2_S_Recon_Plus, -/* [Rm1_S_node] =*/ Rm1_S_Recon_Plus, -/* [ R_S_node] =*/ R_S_Recon_Plus, -/* [ L_C_node] =*/ L_C_Recon_Plus, -/* [Lp1_C_node] =*/ Lp1_C_Recon_Plus, -/* [Rm2_C_node] =*/ Rm2_C_Recon_Plus, -/* [Rm1_C_node] =*/ Rm1_C_Recon_Plus, -/* [ R_C_node] =*/ R_C_Recon_Plus, -}; - -const __CUDA_CONST__ double Recon_Minus[][24] = { -/* [ Std_node] =*/ Std_Recon_Minus, -/* [ L_S_node] =*/ L_S_Recon_Minus, -/* [Lp1_S_node] =*/ Lp1_S_Recon_Minus, -/* [Lp2_S_node] =*/ Lp2_S_Recon_Minus, -/* [Rm3_S_node] =*/ Rm3_S_Recon_Minus, -/* [Rm2_S_node] =*/ Rm2_S_Recon_Minus, -/* [Rm1_S_node] =*/ Rm1_S_Recon_Minus, -/* [ R_S_node] =*/ R_S_Recon_Minus, -/* [ L_C_node] =*/ L_C_Recon_Minus, -/* [Lp1_C_node] =*/ Lp1_C_Recon_Minus, -/* [Rm2_C_node] =*/ Rm2_C_Recon_Minus, -/* [Rm1_C_node] =*/ Rm1_C_Recon_Minus, -/* [ R_C_node] =*/ R_C_Recon_Minus, -}; +extern const double Recon_Plus_cpu [13][24]; +extern const double Recon_Minus_cpu[13][24]; // Blending coefficients to obtain sixth order reconstruction -const __CUDA_CONST__ double Coeffs_Plus[][4] = { -/* [ Std_node] =*/ Std_Coeffs_Plus, -/* [ L_S_node] =*/ L_S_Coeffs_Plus, -/* [Lp1_S_node] =*/ Lp1_S_Coeffs_Plus, -/* [Lp2_S_node] =*/ Lp2_S_Coeffs_Plus, -/* [Rm3_S_node] =*/ Rm3_S_Coeffs_Plus, -/* [Rm2_S_node] =*/ Rm2_S_Coeffs_Plus, -/* [Rm1_S_node] =*/ Rm1_S_Coeffs_Plus, -/* [ R_S_node] =*/ R_S_Coeffs_Plus, -/* [ L_C_node] =*/ L_C_Coeffs_Plus, -/* [Lp1_C_node] =*/ Lp1_C_Coeffs_Plus, -/* [Rm2_C_node] =*/ Rm2_C_Coeffs_Plus, -/* [Rm1_C_node] =*/ Rm1_C_Coeffs_Plus, -/* [ R_C_node] =*/ R_C_Coeffs_Plus, -}; - -const __CUDA_CONST__ double Coeffs_Minus[][4] = { -/* [ Std_node] =*/ Std_Coeffs_Minus, -/* [ L_S_node] =*/ L_S_Coeffs_Minus, -/* [Lp1_S_node] =*/ Lp1_S_Coeffs_Minus, -/* [Lp2_S_node] =*/ Lp2_S_Coeffs_Minus, -/* [Rm3_S_node] =*/ Rm3_S_Coeffs_Minus, -/* [Rm2_S_node] =*/ Rm2_S_Coeffs_Minus, -/* [Rm1_S_node] =*/ Rm1_S_Coeffs_Minus, -/* [ R_S_node] =*/ R_S_Coeffs_Minus, -/* [ L_C_node] =*/ L_C_Coeffs_Minus, -/* [Lp1_C_node] =*/ Lp1_C_Coeffs_Minus, -/* [Rm2_C_node] =*/ Rm2_C_Coeffs_Minus, -/* [Rm1_C_node] =*/ Rm1_C_Coeffs_Minus, -/* [ R_C_node] =*/ R_C_Coeffs_Minus -}; +extern const double Coeffs_Plus_cpu[13][4]; +extern const double Coeffs_Minus_cpu[13][4]; // Staggered interpolation operator [c, c+1] -const __CUDA_CONST__ double Interp[][2] = { -/* [ Std_node] =*/ {0.5, 0.5}, -/* [ L_S_node] =*/ {1.0, 0.0}, -/* [Lp1_S_node] =*/ {0.5, 0.5}, -/* [Lp2_S_node] =*/ {0.5, 0.5}, -/* [Rm3_S_node] =*/ {0.5, 0.5}, -/* [Rm2_S_node] =*/ {0.5, 0.5}, -/* [Rm1_S_node] =*/ {0.0, 1.0}, -/* [ R_S_node] =*/ {0.5, 0.5}, -/* [ L_C_node] =*/ {0.5, 0.5}, -/* [Lp1_C_node] =*/ {0.5, 0.5}, -/* [Rm2_C_node] =*/ {0.5, 0.5}, -/* [Rm1_C_node] =*/ {0.5, 0.5}, -/* [ R_C_node] =*/ {0.5, 0.5} -}; +extern const float Interp_cpu[13][2]; // Cell-center gradient operator [c - c-1, c+1 - c] -const __CUDA_CONST__ double Grad[][2] = { -/* [ Std_node] =*/ {0.5, 0.5}, -/* [ L_S_node] =*/ {0.0, 2.0}, -/* [Lp1_S_node] =*/ {1.0, 0.5}, -/* [Lp2_S_node] =*/ {0.5, 0.5}, -/* [Rm3_S_node] =*/ {0.5, 0.5}, -/* [Rm2_S_node] =*/ {0.5, 0.5}, -/* [Rm1_S_node] =*/ {0.5, 1.0}, -/* [ R_S_node] =*/ {2.0, 0.0}, -/* [ L_C_node] =*/ {0.0, 1.0}, -/* [Lp1_C_node] =*/ {0.5, 0.5}, -/* [Rm2_C_node] =*/ {0.5, 0.5}, -/* [Rm1_C_node] =*/ {0.5, 0.5}, -/* [ R_C_node] =*/ {1.0, 0.0} -}; +extern const float Grad_cpu[13][2]; // Order of the Kennedy reconstruction scheme -const __CUDA_CONST__ int KennedyOrder[] = { -/* [ Std_node] =*/ Std_KennedyOrder, -/* [ L_S_node] =*/ L_S_KennedyOrder, -/* [Lp1_S_node] =*/ Lp1_S_KennedyOrder, -/* [Lp2_S_node] =*/ Lp2_S_KennedyOrder, -/* [Rm3_S_node] =*/ Rm3_S_KennedyOrder, -/* [Rm2_S_node] =*/ Rm2_S_KennedyOrder, -/* [Rm1_S_node] =*/ Rm1_S_KennedyOrder, -/* [ R_S_node] =*/ R_S_KennedyOrder, -/* [ L_C_node] =*/ L_C_KennedyOrder, -/* [Lp1_C_node] =*/ Lp1_C_KennedyOrder, -/* [Rm2_C_node] =*/ Rm2_C_KennedyOrder, -/* [Rm1_C_node] =*/ Rm1_C_KennedyOrder, -/* [ R_C_node] =*/ R_C_KennedyOrder -}; +extern const int8_t KennedyOrder_cpu[13]; +extern const double KennedyCoeff_cpu[13][3]; +extern const int8_t KennedyNSum_cpu[13]; -const __CUDA_CONST__ double KennedyCoeff[][3] = { -/* [ Std_node] =*/ Std_KennedyCoeff, -/* [ L_S_node] =*/ L_S_KennedyCoeff, -/* [Lp1_S_node] =*/ Lp1_S_KennedyCoeff, -/* [Lp2_S_node] =*/ Lp2_S_KennedyCoeff, -/* [Rm3_S_node] =*/ Rm3_S_KennedyCoeff, -/* [Rm2_S_node] =*/ Rm2_S_KennedyCoeff, -/* [Rm1_S_node] =*/ Rm1_S_KennedyCoeff, -/* [ R_S_node] =*/ R_S_KennedyCoeff, -/* [ L_C_node] =*/ L_C_KennedyCoeff, -/* [Lp1_C_node] =*/ Lp1_C_KennedyCoeff, -/* [Rm2_C_node] =*/ Rm2_C_KennedyCoeff, -/* [Rm1_C_node] =*/ Rm1_C_KennedyCoeff, -/* [ R_C_node] =*/ R_C_KennedyCoeff -}; +// Store powers of 10 in a vector +extern const float p10_cpu[14]; -const __CUDA_CONST__ int KennedyNSum[] = { -/* [ Std_node] =*/ 3, -/* [ L_S_node] =*/ 0, -/* [Lp1_S_node] =*/ 3, -/* [Lp2_S_node] =*/ 3, -/* [Rm3_S_node] =*/ 2, -/* [Rm2_S_node] =*/ 1, -/* [Rm1_S_node] =*/ 0, -/* [ R_S_node] =*/ 0, -/* [ L_C_node] =*/ 3, -/* [Lp1_C_node] =*/ 3, -/* [Rm2_C_node] =*/ 2, -/* [Rm1_C_node] =*/ 1, -/* [ R_C_node] =*/ 0 -}; +#ifdef LEGION_USE_CUDA +///////////////////////////////// +// Constants for CUDA tasks +///////////////////////////////// +// Indices offsets +extern __CUDA_CONST__ int8_t Cp_gpu[13][5]; -//----------------------------------------- -// Clean-up -//---------------------------------------- - -#undef Std_Cp -#undef L_S_Cp -#undef Lp1_S_Cp -#undef Lp2_S_Cp -#undef Rm3_S_Cp -#undef Rm2_S_Cp -#undef Rm1_S_Cp -#undef R_S_Cp -#undef L_C_Cp -#undef Lp1_C_Cp -#undef Rm2_C_Cp -#undef Rm1_C_Cp -#undef R_C_Cp +// Face reconstruction operators [c-2, ..., c+3] +extern __CUDA_CONST__ double Recon_Plus_gpu [13][24]; +extern __CUDA_CONST__ double Recon_Minus_gpu[13][24]; -#undef Std_Recon_Plus -#undef L_S_Recon_Plus -#undef Lp1_S_Recon_Plus -#undef Lp2_S_Recon_Plus -#undef Rm3_S_Recon_Plus -#undef Rm2_S_Recon_Plus -#undef Rm1_S_Recon_Plus -#undef R_S_Recon_Plus -#undef L_C_Recon_Plus -#undef Lp1_C_Recon_Plus -#undef Rm2_C_Recon_Plus -#undef Rm1_C_Recon_Plus -#undef R_C_Recon_Plus +// Blending coefficients to obtain sixth order reconstruction +extern __CUDA_CONST__ double Coeffs_Plus_gpu[13][4]; +extern __CUDA_CONST__ double Coeffs_Minus_gpu[13][4]; -#undef Std_Recon_Minus -#undef L_S_Recon_Minus -#undef Lp1_S_Recon_Minus -#undef Lp2_S_Recon_Minus -#undef Rm3_S_Recon_Minus -#undef Rm2_S_Recon_Minus -#undef Rm1_S_Recon_Minus -#undef R_S_Recon_Minus -#undef L_C_Recon_Minus -#undef Lp1_C_Recon_Minus -#undef Rm2_C_Recon_Minus -#undef Rm1_C_Recon_Minus -#undef R_C_Recon_Minus +// Staggered interpolation operator [c, c+1] +extern __CUDA_CONST__ float Interp_gpu[13][2]; -#undef Std_Coeffs_Plus -#undef L_S_Coeffs_Plus -#undef Lp1_S_Coeffs_Plus -#undef Lp2_S_Coeffs_Plus -#undef Rm3_S_Coeffs_Plus -#undef Rm2_S_Coeffs_Plus -#undef Rm1_S_Coeffs_Plus -#undef R_S_Coeffs_Plus -#undef L_C_Coeffs_Plus -#undef Lp1_C_Coeffs_Plus -#undef Rm2_C_Coeffs_Plus -#undef Rm1_C_Coeffs_Plus -#undef R_C_Coeffs_Plus +// Cell-center gradient operator [c - c-1, c+1 - c] +extern __CUDA_CONST__ float Grad_gpu[13][2]; -#undef Std_Coeffs_Minus -#undef L_S_Coeffs_Minus -#undef Lp1_S_Coeffs_Minus -#undef Lp2_S_Coeffs_Minus -#undef Rm3_S_Coeffs_Minus -#undef Rm2_S_Coeffs_Minus -#undef Rm1_S_Coeffs_Minus -#undef R_S_Coeffs_Minus -#undef L_C_Coeffs_Minus -#undef Lp1_C_Coeffs_Minus -#undef Rm2_C_Coeffs_Minus -#undef Rm1_C_Coeffs_Minus -#undef R_C_Coeffs_Minus +// Order of the Kennedy reconstruction scheme +extern __CUDA_CONST__ int8_t KennedyOrder_gpu[13]; +extern __CUDA_CONST__ double KennedyCoeff_gpu[13][3]; +extern __CUDA_CONST__ int8_t KennedyNSum_gpu[13]; -#undef Std_KennedyOrder -#undef L_S_KennedyOrder -#undef Lp1_S_KennedyOrder -#undef Lp2_S_KennedyOrder -#undef Rm3_S_KennedyOrder -#undef Rm2_S_KennedyOrder -#undef Rm1_S_KennedyOrder -#undef R_S_KennedyOrder -#undef L_C_KennedyOrder -#undef Lp1_C_KennedyOrder -#undef Rm2_C_KennedyOrder -#undef Rm1_C_KennedyOrder -#undef R_C_KennedyOrder +// Store powers of 10 in a vector +extern __CUDA_CONST__ float p10_gpu[14]; -#undef Std_KennedyCoeff -#undef L_S_KennedyCoeff -#undef Lp1_S_KennedyCoeff -#undef Lp2_S_KennedyCoeff -#undef Rm3_S_KennedyCoeff -#undef Rm2_S_KennedyCoeff -#undef Rm1_S_KennedyCoeff -#undef R_S_KennedyCoeff -#undef L_C_KennedyCoeff -#undef Lp1_C_KennedyCoeff -#undef Rm2_C_KennedyCoeff -#undef Rm1_C_KennedyCoeff -#undef R_C_KennedyCoeff +#endif #ifdef __cplusplus } #endif +#ifdef __CUDACC__ + #define Cp Cp_gpu + #define Recon_Plus Recon_Plus_gpu + #define Recon_Minus Recon_Minus_gpu + #define Coeffs_Plus Coeffs_Plus_gpu + #define Coeffs_Minus Coeffs_Minus_gpu + #define Interp Interp_gpu + #define Grad Grad_gpu + #define KennedyOrder KennedyOrder_gpu + #define KennedyCoeff KennedyCoeff_gpu + #define KennedyNSum KennedyNSum_gpu + #define p10 p10_gpu +#else + #define Cp Cp_cpu + #define Recon_Plus Recon_Plus_cpu + #define Recon_Minus Recon_Minus_cpu + #define Coeffs_Plus Coeffs_Plus_cpu + #define Coeffs_Minus Coeffs_Minus_cpu + #define Interp Interp_cpu + #define Grad Grad_cpu + #define KennedyOrder KennedyOrder_cpu + #define KennedyCoeff KennedyCoeff_cpu + #define KennedyNSum KennedyNSum_cpu + #define p10 p10_cpu +#endif + #endif // __PROMETEO_METRIC_COEFFS_H__ diff --git a/src/prometeo_metric_coeffs_macros.h b/src/prometeo_metric_coeffs_macros.h new file mode 100644 index 0000000..92a8f7a --- /dev/null +++ b/src/prometeo_metric_coeffs_macros.h @@ -0,0 +1,552 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_METRIC_COEFFS_MACROS_H__ +#define __PROMETEO_METRIC_COEFFS_MACROS_H__ + +//----------------------------------------------------------------------------- +// STANDARD NODE +//----------------------------------------------------------------------------- +// +// dxm2: |-----------------------------------------| +// dxm1: |---------------------------| +// dx: |-------------| +// dxp1: |-------------| +// dxp2: |---------------------------| +// dxp3: |-----------------------------------------| +// c-2 c-1 c x=0 c+1 c+2 c+3 +// |------x------|------x------|------x------|------x------|------x------|------x------| +// +// Plus reconstruction: +// 1st: o-------------o-----> <-----o +// 2nd: o-----> <-----o-------------o +// 3rd: o-------------o-------------o-----> +// 4th: o-----> <-----o-------------o-------------o +// +// Minus reconstruction: +// 1st: o-----> <-----o-------------o +// 2nd: o-------------o-----> <-----o +// 3rd: <-----o-------------o-------------o +// 4th: o-------------o-------------o-----> <-----o + + +#define Std_Cp { -2, -1, 1, 2, 3} + +#define Std_Recon_Plus { \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 2.0/6.0, -7.0/6.0, 11.0/6.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 3.0/12.0, 13.0/12.0, -5.0/12.0, 1.0/12.0} + +#define Std_Recon_Minus { \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 11.0/6.0, -7.0/6.0, 2.0/6.0, \ + 1.0/12.0, -5.0/12.0, 13.0/12.0, 3.0/12.0, 0.0, 0.0} + +#define Std_Coeffs_Plus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} +#define Std_Coeffs_Minus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} + +//const double Std_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; +//for i=1,6 do +// for St =1,nStencils do +// Std_Recon[i] = Std_Recon[i] + Std_Recon_Plus[(St-1)*6+i]*Std_Coeffs_Plus[St] +// end +//end + +#define Std_KennedyOrder 3 // Sixth-order +#define Std_KennedyCoeff {3.0/4.0, -3.0/20.0, 1.0/60.0} + +//----------------------------------------------------------------------------- +// STAGGERED LEFT BC +//----------------------------------------------------------------------------- + +// Boundary node is staggered on the face so we do not need any reconstruction +#define L_S_Recon_Plus { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} +#define L_S_Recon_Minus { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 1.0, 0.0, 0.0, 0.0} + +#define L_S_Cp {0,0,1,1,1} +#define L_S_Coeffs_Plus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} +#define L_S_Coeffs_Minus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} + +//local L_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// L_S_Recon[i] = L_S_Recon[i] + L_S_Recon_Plus[(St-1)*6+i]*L_S_Coeffs_Plus[St] +// end +//end + +#define L_S_KennedyOrder 0 // Zero-order +#define L_S_KennedyCoeff {0.0, 0.0, 0.0} + + +// dx: |-------------| +// dxp1: |-------------| +// dxp2: |---------------------------| +// dxp3: |-----------------------------------------| +// c-0.5 c x=0 c+1 c+2 c+3 +// x------x------|------x------|------x------|------x------| +// +// Plus reconstruction: +// 1st: o------o-----> <-----o +// 2nd: o-----> <-----o-------------o +// 3rd: does not exist +// 4th: o-----> <-----o-------------o-------------o +// +// Minus reconstruction: +// 1st: o-----> <-----o-------------o +// 2nd: o------o-----> <-----o +// 3rd: <-----o-------------o-------------o +// 4th: does not exist + +#define Lp1_S_Cp { -1, -1, 1, 2, 3} + +#define Lp1_S_Recon_Plus { \ + 0.0, -2.0/4.0, 5.0/4.0, 1.0/4.0, 0.0, 0.0, \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 3.0/12.0, 13.0/12.0, -5.0/12.0, 1.0/12.0} + +#define Lp1_S_Recon_Minus { \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, -2.0/4.0, 5.0/4.0, 1.0/4.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 11.0/6.0, -7.0/6.0, 2.0/6.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define Lp1_S_Coeffs_Plus {2.0/4.0, 1.0/4.0, 0.0, 1.0/4.0} +#define Lp1_S_Coeffs_Minus {7.0/16.0, 8.0/16.0, 1.0/16.0, 0.0 } + +//local Lp1_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// Lp1_S_Recon[i] = Lp1_S_Recon[i] + Lp1_S_Recon_Plus[(St-1)*6+i]*Lp1_S_Coeffs_Plus[St] +// end +//end + +#define Lp1_S_KennedyOrder 1 // Second-order +#define Lp1_S_KennedyCoeff {0.5, 0.0, 0.0} + + +// dxm1: |---------------------------| +// dx: |-------------| +// dxp1: |-------------| +// dxp2: |---------------------------| +// dxp3: |-----------------------------------------| +// c-1.5 c-1 c x=0 c+1 c+2 c+3 +// x------x------|------x------|------x------|------x------|------x------| +// +// Plus reconstruction: +// 1st: o-------------o-----> <-----o +// 2nd: o-----> <-----o-------------o +// 3rd: o------o-------------o-----> +// 4th: o-----> <-----o-------------o-------------o +// +// Minus reconstruction: +// 1st: o-----> <-----o-------------o +// 2nd: o-------------o-----> <-----o +// 3rd: <-----o-------------o-------------o +// 4th: o------o-------------o-----> <-----o + +#define Lp2_S_Cp { -2, -1, 1, 2, 3} + +#define Lp2_S_Recon_Plus { \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 1.0, -2.0, 2.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 3.0/12.0, 13.0/12.0, -5.0/12.0, 1.0/12.0} + +#define Lp2_S_Recon_Minus { \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 11.0/6.0, -7.0/6.0, 2.0/6.0, \ + 3.0/9.0, -7.0/9.0, 11.0/9.0, 2.0/9.0, 0.0, 0.0} \ + +#define Lp2_S_Coeffs_Plus {47.0/100.0, 27.0/100.0, 10.0/100.0, 16.0/100.0} +#define Lp2_S_Coeffs_Minus {39.0/100.0, 27.0/100.0, 4.0/100.0, 30.0/100.0} + +//local Lp2_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// Lp2_S_Recon[i] = Lp2_S_Recon[i] + Lp2_S_Recon_Plus[(St-1)*6+i]*Lp2_S_Coeffs_Plus[St] +// end +//end + +#define Lp2_S_KennedyOrder 2 // Fourth-order +#define Lp2_S_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} + + +//------------------------------------------------------------------------------- +//-- COLLOCATED LEFT BC +//------------------------------------------------------------------------------- + +// dx: |-------------| +// dxp1: |-------------| +// c x=0 c+1 +// |------x------|------x------| +// +// Plus reconstruction: +// 1st: o-----> +// 2nd: does not exist +// 3rd: does not exist +// 4th: does not exist +// +// Minus reconstruction: +// 1st: <-----o +// 2nd: does not exist +// 3rd: does not exist +// 4th: does not exist + +#define L_C_Cp { 0, 0, 1, 2, 2} + +#define L_C_Recon_Plus { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} +#define L_C_Recon_Minus { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define L_C_Coeffs_Plus {1.0, 0.0, 0.0, 0.0} +#define L_C_Coeffs_Minus {1.0, 0.0, 0.0, 0.0} + +#define L_C_Recon {0.0, 0.0, 0.5, 0.5, 0.0, 0.0} + +#define L_C_KennedyOrder 1 // Second-order +#define L_C_KennedyCoeff {0.5, 0.0, 0.0} + + +// dxm1: |---------------------------| +// dx: |-------------| +// dxp1: |-------------| +// dxp2: |---------------------------| +// dxp3: |-----------------------------------------| +// c-1 c x=0 c+1 c+2 c+3 +// |------x------|------x------|------x------|------x------|------x------| +// +// Plus reconstruction: +// 1st: o-------------o-----> <-----o +// 2nd: o-----> <-----o-------------o +// 3rd: does not exist +// 4th: does not exist +// +// Minus reconstruction: +// 1st: o-----> <-----o-------------o +// 2nd: o-------------o-----> <-----o +// 3rd: does not exist +// 4th: does not exist + +#define Lp1_C_Cp { -1, -1, 1, 2, 2} + +#define Lp1_C_Recon_Plus { \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define Lp1_C_Recon_Minus { \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define Lp1_C_Coeffs_Plus {1.0/2.0, 1.0/2.0, 0.0, 0.0} +#define Lp1_C_Coeffs_Minus {1.0/2.0, 1.0/2.0, 0.0, 0.0} + +//local Lp1_C_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// Lp1_C_Recon[i] = Lp1_C_Recon[i] + Lp1_C_Recon_Plus[(St-1)*6+i]*Lp1_C_Coeffs_Plus[St] +// end +//end + +#define Lp1_C_KennedyOrder 2 // Fourth-order +#define Lp1_C_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} + +//----------------------------------------------------------------------------- +// STAGGERED RIGHT BC +//----------------------------------------------------------------------------- + +#define R_S_Cp {-1, -1, 0, 0, 0} + +#define R_S_Recon_Plus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} +#define R_S_Recon_Minus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define R_S_Coeffs_Plus {0.0, 0.0, 0.0, 0.0} +#define R_S_Coeffs_Minus {0.0, 0.0, 0.0, 0.0} + +//local R_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) + +#define R_S_KennedyOrder 0 // Zero-order +#define R_S_KennedyCoeff {0.0, 0.0, 0.0} + +// Boundary node is staggered on the face so we do not need any reconstruction +#define Rm1_S_Cp {-1, -1, 1, 1, 1} + +#define Rm1_S_Recon_Plus {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0} +#define Rm1_S_Recon_Minus {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 1.0, 0.0, 0.0} + +#define Rm1_S_Coeffs_Plus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} +#define Rm1_S_Coeffs_Minus {9.0/20.0, 6.0/20.0, 1.0/20.0, 4.0/20.0} + +//local Rm1_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// Rm1_S_Recon[i] = Rm1_S_Recon[i] + Rm1_S_Recon_Plus[(St-1)*6+i]*Rm1_S_Coeffs_Plus[St] +// end +//end + +#define Rm1_S_KennedyOrder 0 // Zero-order +#define Rm1_S_KennedyCoeff {0.0, 0.0, 0.0} + + +// dxm2: |-----------------------------------------| +// dxm1: |---------------------------| +// dx: |-------------| +// dxp1: |-------------| +// c-2 c-1 c x=0 c+1 c+1.5 +// |------x------|------x------|------x------|------x------x +// +// Plus reconstruction: +// 1st: o-------------o-----> <-----o +// 2nd: o-----> <-----o------o +// 3rd: o-------------o-------------o-----> +// 4th: does not exist +// +// Minus reconstruction: +// 1st: o-----> <-----o------o +// 2nd: o-------------o-----> <-----o +// 3rd: does not exist +// 4th: o-------------o-------------o-----> <-----o + +#define Rm2_S_Cp { -2, -1, 1, 2, 2} + +#define Rm2_S_Recon_Plus { \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 1.0/4.0, 5.0/4.0, -2.0/4.0, 0.0, \ + 2.0/6.0, -7.0/6.0, 11.0/6.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define Rm2_S_Recon_Minus { \ + 0.0, 0.0, 1.0/4.0, 5.0/4.0, -2.0/4.0, 0.0, \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 1.0/12.0, -5.0/12.0, 13.0/12.0, 3.0/12.0, 0.0, 0.0} + +#define Rm2_S_Coeffs_Plus {7.0/16.0, 8.0/16.0, 1.0/16.0, 0.0 } +#define Rm2_S_Coeffs_Minus {2.0/4.0, 1.0/4.0, 0.0, 1.0/4.0} + +//local Rm2_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// Rm2_S_Recon[i] = Rm2_S_Recon[i] + Rm2_S_Recon_Plus[(St-1)*6+i]*Rm2_S_Coeffs_Plus[St] +// end +//end + +#define Rm2_S_KennedyOrder 1 // Second-order +#define Rm2_S_KennedyCoeff {0.5, 0.0, 0.0} + + +// dxm2: |-----------------------------------------| +// dxm1: |---------------------------| +// dx: |-------------| +// dxp1: |-------------| +// dxp2: |---------------------------| +// c-2 c-1 c x=0 c+1 c+2 c+2.5 +// |------x------|------x------|------x------|------x------|------x------x +// +// Plus reconstruction: +// 1st: o-------------o-----> <-----o +// 2nd: o-----> <-----o-------------o +// 3rd: o-------------o-------------o-----> +// 4th: o-----> <-----o-------------o------o +// +// Minus reconstruction: +// 1st: o-----> <-----o-------------o +// 2nd: o-------------o-----> <-----o +// 3rd: <-----o-------------o------o +// 4th: o-------------o-------------o-----> <-----o + +#define Rm3_S_Cp { -2, -1, 1, 2, 3} + +#define Rm3_S_Recon_Plus { \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 2.0/6.0, -7.0/6.0, 11.0/6.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 2.0/9.0, 11.0/9.0, -7.0/9.0, 3.0/9.0} + +#define Rm3_S_Recon_Minus { \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 2.0, -2.0, 1.0, \ + 1.0/12.0, -5.0/12.0, 13.0/12.0, 3.0/12.0, 0.0, 0.0} + +#define Rm3_S_Coeffs_Plus {39.0/100.0, 27.0/100.0, 4.0/100.0, 30.0/100.0} +#define Rm3_S_Coeffs_Minus {47.0/100.0, 27.0/100.0, 10.0/100.0, 16.0/100.0} + +//local Rm3_S_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// Rm3_S_Recon[i] = Rm3_S_Recon[i] + Rm3_S_Recon_Plus[(St-1)*6+i]*Rm3_S_Coeffs_Plus[St] +// end +//end + +#define Rm3_S_KennedyOrder 2 // Fourth-order +#define Rm3_S_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} + + +//----------------------------------------------------------------------------- +// COLLOCATED RIGHT BC +//----------------------------------------------------------------------------- + +#define R_C_Cp {-1, -1, 0, 0, 0} + +#define R_C_Recon_Plus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} +#define R_C_Recon_Minus { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define R_C_Coeffs_Plus {0.0, 0.0, 0.0, 0.0} +#define R_C_Coeffs_Minus {0.0, 0.0, 0.0, 0.0} + +//local R_C_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) + +#define R_C_KennedyOrder 0 // Zero-order +#define R_C_KennedyCoeff {0.0, 0.0, 0.0} + + +// dxm2: |-----------------------------------------| +// dxm1: |---------------------------| +// dx: |-------------| +// dxp1: |-------------| +// c-2 c-1 c x=0 c+1 +// |------x------|------x------|------x------|------x------| +// +// Plus reconstruction: +// 1st: o-----> +// 2nd: does not exist +// 3rd: does not exist +// 4th: does not exist +// +// Minus reconstruction: +// 1st: <-----o +// 2nd: does not exist +// 3rd: does not exist +// 4th: does not exist + +#define Rm1_C_Cp { -1, -1, 1, 1, 1} + +#define Rm1_C_Recon_Plus {0.0, 0.0, 1.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} +#define Rm1_C_Recon_Minus {0.0, 0.0, 0.0, 1.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define Rm1_C_Coeffs_Plus {1.0, 0.0, 0.0, 0.0} +#define Rm1_C_Coeffs_Minus {1.0, 0.0, 0.0, 0.0} + +//local Rm1_C_Recon = terralib.newlist({0.0, 0.0, 0.5, 0.5, 0.0, 0.0}) + +#define Rm1_C_KennedyOrder 1 // Second-order +#define Rm1_C_KennedyCoeff {0.5, 0.0, 0.0} + + +// dxm2: |-----------------------------------------| +// dxm1: |---------------------------| +// dx: |-------------| +// dxp1: |-------------| +// dxp2: |---------------------------| +// c-2 c-1 c x=0 c+1 c+2 +// |------x------|------x------|------x------|------x------|------x------| +// +// Plus reconstruction: +// 1st: o-------------o-----> <-----o +// 2nd: o-----> <-----o-------------o +// 3rd: does not exist +// 4th: does not exist +// +// Minus reconstruction: +// 1st: o-----> <-----o-------------o +// 2nd: o-------------o-----> <-----o +// 3rd: does not exist +// 4th: does not exist + +#define Rm2_C_Cp { -1, -1, 1, 2, 2} + +#define Rm2_C_Recon_Plus { \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define Rm2_C_Recon_Minus { \ + 0.0, 0.0, 2.0/6.0, 5.0/6.0, -1.0/6.0, 0.0, \ + 0.0, -1.0/6.0, 5.0/6.0, 2.0/6.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, \ + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0} + +#define Rm2_C_Coeffs_Plus {1.0/2.0, 1.0/2.0, 0.0, 0.0} +#define Rm2_C_Coeffs_Minus {1.0/2.0, 1.0/2.0, 0.0, 0.0} + +//local Rm2_C_Recon = terralib.newlist({0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) +//for i=1,6 do +// for St =1,nStencils do +// Rm2_C_Recon[i] = Rm2_C_Recon[i] + Rm2_C_Recon_Plus[(St-1)*6+i]*Rm2_C_Coeffs_Plus[St] +// end +//end + +#define Rm2_C_KennedyOrder 2 // Fourth-order +#define Rm2_C_KennedyCoeff {2.0/3.0, -1.0/12.0, 0.0} + +#endif // __PROMETEO_METRIC_COEFFS_MACROS_H__ diff --git a/src/prometeo_mixture.cc b/src/prometeo_mixture.cc new file mode 100644 index 0000000..6eaf3b4 --- /dev/null +++ b/src/prometeo_mixture.cc @@ -0,0 +1,220 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_mixture.hpp" +#include "prometeo_mixture_wrappers.hpp" + +/*static*/ const char * const LoadMixtureTask::TASK_NAME = "LoadMixture"; +/*static*/ const int LoadMixtureTask::TASK_ID = TID_LoadMixture; + +void LoadMixtureTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 1); + assert(futures.size() == 0); + // Nothing to do +} + +void register_mixture_tasks() { + + TaskHelper::register_hybrid_variants(); + +}; + +//----------------------------------------------------------------------------- +// C WRAPPERS OF MIXTURE METHODS +//----------------------------------------------------------------------------- + +struct Mix InitMixture(const struct Config config) { + return Mix(config); +} + +char* GetSpeciesName(const int i, const struct Mix mix) { + return mix.GetSpeciesName(i); +} + +int FindSpecies(const char *Name, const struct Mix mix) { + return mix.FindSpecies(Name); +}; + +bool CheckMixture(const double Yi[nSpec], const struct Mix mix) { + return mix.CheckMixture(VecNSp(Yi)); +}; + +void ClipYi(double *Yi, const struct Mix mix) { + VecNSp Y(Yi); + mix.ClipYi(Y); + for (int i=0; i < nSpec; i++) Yi[i] = Y[i]; +}; + +double GetMolarWeightFromYi(const double Yi[nSpec], const struct Mix mix) { + return mix.GetMolarWeightFromYi(VecNSp(Yi)); +}; + +double GetMolarWeightFromXi(const double Xi[nSpec], const struct Mix mix) { + return mix.GetMolarWeightFromXi(VecNSp(Xi)); +}; + +void GetMolarFractions(double *Xi, const double MixW, const double Yi[nSpec], const struct Mix mix) { + VecNSp X; + mix.GetMolarFractions(X, MixW, VecNSp(Yi)); + for (int i=0; i < nSpec; i++) Xi[i] = X[i]; +}; + +void GetMassFractions(double *Yi, const double MixW, const double Xi[nSpec], const struct Mix mix) { + VecNSp Y; + mix.GetMassFractions(Y, MixW, VecNSp(Xi)); + for (int i=0; i < nSpec; i++) Yi[i] = Y[i]; +}; + +double GetRhoFromRhoYi(const double rhoYi[nSpec], const struct Mix mix) { + return mix.GetRhoFromRhoYi(VecNSp(rhoYi)); +}; + +void GetRhoYiFromYi(double *rhoYi, const double rho, const double Yi[nSpec], const struct Mix mix) { + VecNSp rhoY; + mix.GetRhoYiFromYi(rhoY, rho, VecNSp(Yi)); + for (int i=0; i < nSpec; i++) rhoYi[i] = rhoY[i]; +}; + +void GetYi(double *Yi, const double rho, const double rhoYi[nSpec], const struct Mix mix) { + VecNSp Y; + mix.GetYi(Y, rho, VecNSp(rhoYi)); + for (int i=0; i < nSpec; i++) Yi[i] = Y[i]; +}; + +double GetRho(const double P, const double T, const double MixW, const struct Mix mix) { + return mix.GetRho(P, T, MixW); +}; + +double GetHeatCapacity(const double T, const double Yi[nSpec], const struct Mix mix) { + return mix.GetHeatCapacity(T, VecNSp(Yi)); +}; + +double GetEnthalpy(const double T, const double Yi[nSpec], const struct Mix mix) { + return mix.GetEnthalpy(T, VecNSp(Yi)); +}; + +double GetSpeciesEnthalpy(const int i, const double T, const struct Mix mix) { + return mix.GetSpeciesEnthalpy(i, T); +}; + +double GetSpeciesMolarWeight(const int i, const struct Mix mix) { + return mix.GetSpeciesMolarWeight(i); +}; + +double GetInternalEnergy(const double T, const double Yi[nSpec], const struct Mix mix) { + return mix.GetInternalEnergy(T, VecNSp(Yi)); +}; + +double GetSpecificInternalEnergy(const int i, const double T, const struct Mix mix) { + return mix.GetSpecificInternalEnergy(i, T); +}; + +double GetTFromInternalEnergy(const double e0, double T, const double Yi[nSpec], const struct Mix mix) { + return mix.GetTFromInternalEnergy(e0, T, VecNSp(Yi)); +}; + +bool isValidInternalEnergy(const double e, const double Yi[nSpec], const struct Mix mix) { + return mix.isValidInternalEnergy(e, VecNSp(Yi)); +}; + +double GetTFromRhoAndP(const double rho, const double MixW, const double P, const struct Mix mix) { + return mix.GetTFromRhoAndP(rho, MixW, P); +}; + +double GetPFromRhoAndT(const double rho, const double MixW, const double T, const struct Mix mix) { + return mix.GetPFromRhoAndT(rho, MixW, T); +}; + +double GetViscosity(const double T, const double Xi[nSpec], const struct Mix mix) { + return mix.GetViscosity(T, VecNSp(Xi)); +}; + +double GetHeatConductivity(const double T, const double Xi[nSpec], const struct Mix mix) { + return mix.GetHeatConductivity(T, VecNSp(Xi)); +}; + +double GetGamma(const double T, const double MixW, const double Yi[nSpec], const struct Mix mix) { + return mix.GetGamma(T, MixW, VecNSp(Yi)); +}; + +double GetSpeedOfSound(const double T, const double gamma, const double MixW, const struct Mix mix) { + return mix.GetSpeedOfSound(T, gamma, MixW); +}; + +void GetDiffusivity(double *Di, const double P, const double T, const double MixW, const double Xi[nSpec], const struct Mix mix) { + VecNSp D; + mix.GetDiffusivity(D, P, T, MixW, VecNSp(Xi)); + for (int i=0; i < nSpec; i++) Di[i] = D[i]; +}; + +#if (nIons > 0) +void GetElectricMobility(double *Ki, const double Pn, const double Tn, const double Xi[nSpec], const struct Mix mix) { + VecNIo K; + mix.GetElectricMobility(K, Pn, Tn, VecNSp(Xi)); + for (int i=0; i < nIons; i++) Ki[i] = K[i]; +}; +#endif + +double GetPartialElectricChargeDensity(const uint8_t i, const double rhon, const double MixW, const double Xi[nSpec], const struct Mix mix) { + return mix.GetPartialElectricChargeDensity(i, rhon, MixW, VecNSp(Xi)); +} + +double GetElectricChargeDensity(const double rhon, const double MixW, const double Xi[nSpec], const struct Mix mix) { + return mix.GetElectricChargeDensity(rhon, MixW, VecNSp(Xi)); +}; + +int8_t GetSpeciesChargeNumber(const int i, const struct Mix mix) { + return mix.GetSpeciesChargeNumber(i); +}; + +double GetDielectricPermittivity(const struct Mix mix) { + return mix.GetDielectricPermittivity(); +}; + +void GetProductionRates(double *wi, const double rhon, const double Pn, const double Tn, const double Yi[nSpec], const struct Mix mix) { + VecNSp w; + mix.GetProductionRates(w, rhon, Pn, Tn, VecNSp(Yi)); + for (int i=0; i < nSpec; i++) wi[i] = w[i]; +}; + +double Getdpde(const double rho, const double gamma, const struct Mix mix) { + return mix.Getdpde(rho, gamma); +}; + +void Getdpdrhoi(double *dpdrhoi, const double gamma, const double T, const double Yi[nSpec], const struct Mix mix) { + VecNSp dpdrho; + mix.Getdpdrhoi(dpdrho, gamma, T, VecNSp(Yi)); + for (int i=0; i < nSpec; i++) dpdrhoi[i] = dpdrho[i]; +}; + diff --git a/src/CH41StMix.h b/src/prometeo_mixture.cu similarity index 75% rename from src/CH41StMix.h rename to src/prometeo_mixture.cu index a1fd3d4..7736d4d 100644 --- a/src/CH41StMix.h +++ b/src/prometeo_mixture.cu @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,36 +27,22 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CH41StMix_H -#define CH41StMix_H +#include "prometeo_mixture.hpp" -#define nSpec 4 -#define nReac 1 +// Define a constant memory that will hold the Mixture struct +__device__ __constant__ Mix mix; -#define MAX_NUM_REACTANTS 2 -#define MAX_NUM_TB 0 +__host__ +void LoadMixtureTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 1); + assert(futures.size() == 0); -#define RGAS 8.3144598 // [J/(mol K)] -#define Na 6.02214086e23 // [1/mol] -#define kb 1.38064852e-23 // [m^2 kg /( s^2 K)] - -#include "Species.h" -#include "Reaction.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct Mix { - struct Spec species[nSpec]; - struct Reaction reactions[nReac]; - // Max an min acceptable temeperatures - double TMax; - double TMin; -}; - -#ifdef __cplusplus + // Copy the mixture to the device + cudaMemcpyToSymbol(mix, &(args.mix), sizeof(Mix), 0, cudaMemcpyHostToDevice); } -#endif -#endif // CH41StMix_H diff --git a/src/prometeo_mixture.h b/src/prometeo_mixture.h new file mode 100644 index 0000000..175fee4 --- /dev/null +++ b/src/prometeo_mixture.h @@ -0,0 +1,45 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_MIXTURE_H__ +#define __PROMETEO_MIXTURE_H__ + +#include "legion.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void register_mixture_tasks(); + +#ifdef __cplusplus +} +#endif + +#endif // __PROMETEO_MIXTURE_H__ diff --git a/src/Reaction.h b/src/prometeo_mixture.hpp similarity index 54% rename from src/Reaction.h rename to src/prometeo_mixture.hpp index a42345b..59124ca 100644 --- a/src/Reaction.h +++ b/src/prometeo_mixture.hpp @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,53 +27,51 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef Reaction_H -#define Reaction_H +#ifndef __PROMETEO_MIXTURE_HPP__ +#define __PROMETEO_MIXTURE_HPP__ -#ifndef MAX_NUM_REACTANTS - #error "MAX_NUM_REACTANTS is undefined" -#endif - -#ifndef MAX_NUM_TB - #error "MAX_NUM_TB is undefined" -#endif +#include "legion.h" -#include +using namespace Legion; -#ifdef __cplusplus -extern "C" { -#endif +//----------------------------------------------------------------------------- +// LOAD PROMETEO UTILITIES AND MODULES +//----------------------------------------------------------------------------- -// Generic reactant -struct Reactant { - int ind; // Index in the species vector - double nu; // Stoichiometric coefficient - double ord; // Order of the reactant -}; +#include "prometeo_types.h" +#include "task_helper.hpp" +#include "prometeo_mixture.h" +#include "config_schema.h" -struct ThirdBd { - int ind; // Index in the species vector - double eff; // Efficiency as a third body -}; +//----------------------------------------------------------------------------- +// TASK THAT LOADS THE MIXTURE ON THE GPUs +//----------------------------------------------------------------------------- -// Reaction structure -struct Reaction { - double A; // Arrhenius pre-exponential factor [m^{3*(o-1)}/(mol^(o-1) s)] where o is the order fo the reaction - double n; // Arrhenius temperature exponent - double EovR; // Arrhenius activation energy [K] - bool has_backward; // Self-explenatory - - int Neducts; // number of reactants - int Npducts; // number of products - int Nthirdb; // number of third bodies - - struct Reactant educts[MAX_NUM_REACTANTS]; // List of reactants and stoichiometric coefficients - struct Reactant pducts[MAX_NUM_REACTANTS]; // List of products and stoichiometric coefficients - struct ThirdBd thirdb[MAX_NUM_TB]; // List of third bodies and efficiencies -}; - -#ifdef __cplusplus -} +class LoadMixtureTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + Mix mix; + FieldID Fluid_fields[FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); #endif +}; -#endif // Reaction_H +#endif // __PROMETEO_MIXTURE_HPP__ diff --git a/src/prometeo_mixture.rg b/src/prometeo_mixture.rg new file mode 100644 index 0000000..88a581c --- /dev/null +++ b/src/prometeo_mixture.rg @@ -0,0 +1,176 @@ +-- Copyright (c) "2019, by Stanford University +-- Developer: Mario Di Renzo +-- Affiliation: Center for Turbulence Research, Stanford University +-- URL: https://ctr.stanford.edu +-- Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +-- HTR solver: An open-source exascale-oriented task-based +-- multi-GPU high-order code for hypersonic aerothermodynamics. +-- Computer Physics Communications 255, 107262" +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions are met: +-- * Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- * Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +-- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import "regent" + +return function(SCHEMA, TYPES) local Exports = {} + +------------------------------------------------------------------------------- +-- IMPORTS +------------------------------------------------------------------------------- +local C = regentlib.c +local UTIL = require 'util-desugared' + +-- Store Mix data structure +Exports.Mixture = TYPES.Mix +Exports.nSpec = TYPES.nSpec +Exports.nIons = TYPES.nIons + +-- Load C wrappers +local MIX = terralib.includec("prometeo_mixture_wrappers.hpp", {"-DEOS="..os.getenv("EOS")}) + +MIX.InitMixture.replicable = true +MIX.GetSpeciesName.replicable = true +MIX.FindSpecies.replicable = true +MIX.CheckMixture.replicable = true +MIX.ClipYi.replicable = true +MIX.GetMolarWeightFromXi.replicable = true +MIX.GetMolarWeightFromYi.replicable = true +MIX.GetMolarFractions.replicable = true +MIX.GetMassFractions.replicable = true +MIX.GetRhoFromRhoYi.replicable = true +MIX.GetRhoYiFromYi.replicable = true +MIX.GetYi.replicable = true +MIX.GetRho.replicable = true +MIX.GetHeatCapacity.replicable = true +MIX.GetEnthalpy.replicable = true +MIX.GetSpeciesEnthalpy.replicable = true +MIX.GetSpeciesMolarWeight.replicable = true +MIX.GetInternalEnergy.replicable = true +MIX.GetSpecificInternalEnergy.replicable = true +MIX.GetTFromInternalEnergy.replicable = true +MIX.isValidInternalEnergy.replicable = true +MIX.GetTFromRhoAndP.replicable = true +MIX.GetPFromRhoAndT.replicable = true +MIX.GetViscosity.replicable = true +MIX.GetHeatConductivity.replicable = true +MIX.GetGamma.replicable = true +MIX.GetSpeedOfSound.replicable = true +MIX.GetDiffusivity.replicable = true +if Exports.nIons > 0 then + MIX.GetElectricMobility.replicable = true +end +MIX.GetPartialElectricChargeDensity.replicable = true +MIX.GetElectricChargeDensity.replicable = true +MIX.GetSpeciesChargeNumber.replicable = true +MIX.GetDielectricPermittivity.replicable = true +MIX.GetProductionRates.replicable = true +MIX.Getdpde.replicable = true +MIX.Getdpdrhoi.replicable = true + +Exports.InitMixtureStruct = MIX.InitMixture +Exports.FindSpecies = MIX.FindSpecies +Exports.CheckMixture = MIX.CheckMixture +Exports.ClipYi = MIX.ClipYi +Exports.GetMolarWeightFromXi = MIX.GetMolarWeightFromXi +Exports.GetMolarWeightFromYi = MIX.GetMolarWeightFromYi +Exports.GetMolarFractions = MIX.GetMolarFractions +Exports.GetMassFractions = MIX.GetMassFractions +Exports.GetRhoFromRhoYi = MIX.GetRhoFromRhoYi +Exports.GetRhoYiFromYi = MIX.GetRhoYiFromYi +Exports.GetYi = MIX.GetYi +Exports.GetRho = MIX.GetRho +Exports.GetHeatCapacity = MIX.GetHeatCapacity +Exports.GetEnthalpy = MIX.GetEnthalpy +Exports.GetSpeciesEnthalpy = MIX.GetSpeciesEnthalpy +Exports.GetSpeciesMolarWeight = MIX.GetSpeciesMolarWeight +Exports.GetInternalEnergy = MIX.GetInternalEnergy +Exports.GetSpecificInternalEnergy = MIX.GetSpecificInternalEnergy +Exports.GetTFromInternalEnergy = MIX.GetTFromInternalEnergy +Exports.isValidInternalEnergy = MIX.isValidInternalEnergy +Exports.GetTFromRhoAndP = MIX.GetTFromRhoAndP +Exports.GetPFromRhoAndT = MIX.GetPFromRhoAndT +Exports.GetViscosity = MIX.GetViscosity +Exports.GetHeatConductivity = MIX.GetHeatConductivity +Exports.GetGamma = MIX.GetGamma +Exports.GetSpeedOfSound = MIX.GetSpeedOfSound +Exports.GetDiffusivity = MIX.GetDiffusivity +if Exports.nIons > 0 then + Exports.GetElectricMobility = MIX.GetElectricMobility +end +Exports.GetPartialElectricChargeDensity = MIX.GetPartialElectricChargeDensity +Exports.GetElectricChargeDensity = MIX.GetElectricChargeDensity +Exports.GetSpeciesChargeNumber = MIX.GetSpeciesChargeNumber +Exports.GetDielectricPermittivity = MIX.GetDielectricPermittivity +Exports.GetProductionRates = MIX.GetProductionRates +Exports.Getdpde = MIX.Getdpde +Exports.Getdpdrhoi = MIX.Getdpdrhoi + +------------------------------------------------------------------------------- +-- GENERATES A VECTRO WITH ALL THE SPECIES NAMES +------------------------------------------------------------------------------- + +__demand(__inline) +task Exports.GetSpeciesNames(mix : TYPES.Mix) + var Names : regentlib.string[TYPES.nSpec] + for i = 0, TYPES.nSpec do + Names[i] = MIX.GetSpeciesName(i, mix) + end + return Names +end + +------------------------------------------------------------------------------- +-- PARSES A COMPOSITION SPECIFIED IN THE INPUT FILE +------------------------------------------------------------------------------- + +__demand(__inline) +task Exports.ParseConfigMixture(Mixture : SCHEMA.Mixture, mix : TYPES.Mix) + var initMolarFracs = [UTIL.mkArrayConstant(TYPES.nSpec, rexpr 1.0e-60 end)] + for i=0, Mixture.Species.length do + var Species = Mixture.Species.values[i] + initMolarFracs[MIX.FindSpecies(Species.Name, mix)] = Species.MolarFrac + end + regentlib.assert(Exports.CheckMixture(initMolarFracs, mix), + "Molar fractions specified in the input file do not add to one") + return initMolarFracs +end + +------------------------------------------------------------------------------- +-- LOAD MIXTURE TASK +------------------------------------------------------------------------------- + +local extern task LoadMixture(Fluid : region(ispace(int3d), TYPES.Fluid_columns), + mix : TYPES.Mix) +LoadMixture:set_task_id(TYPES.TID_LoadMixture) + +__demand(__inline) +task Exports.InitMixture(Fluid : region(ispace(int3d), TYPES.Fluid_columns), + tiles : ispace(int3d), + p_all : partition(disjoint, Fluid, tiles), + config : SCHEMA.Config) + var Mix = MIX.InitMixture(config) + __demand(__index_launch) + for c in tiles do LoadMixture(p_all[c], Mix) end + -- Make sure that the mixurte is loaded everywhere + __fence(__execution, __block) + return Mix +end + +return Exports end + diff --git a/src/prometeo_mixture_wrappers.hpp b/src/prometeo_mixture_wrappers.hpp new file mode 100644 index 0000000..b1fa9ef --- /dev/null +++ b/src/prometeo_mixture_wrappers.hpp @@ -0,0 +1,125 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_MIXTURE_WRAPPERS_HPP__ +#define __PROMETEO_MIXTURE_WRAPPERS_HPP__ + +//----------------------------------------------------------------------------- +// LOAD PROMETEO TYPES +//----------------------------------------------------------------------------- + +#include "prometeo_types.h" + +//----------------------------------------------------------------------------- +// C WRAPPERS OF MIXTURE METHODS +//----------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif + +struct Mix InitMixture(const struct Config config); + +char* GetSpeciesName(const int i, const struct Mix mix); + +int FindSpecies(const char *Name, const struct Mix mix); + +bool CheckMixture(const double Yi[nSpec], const struct Mix mix); + +void ClipYi(double *Yi, const struct Mix mix); + +double GetMolarWeightFromYi(const double Yi[nSpec], const struct Mix mix); + +double GetMolarWeightFromXi(const double Xi[nSpec], const struct Mix mix); + +void GetMolarFractions(double *Xi, const double MixW, const double Yi[nSpec], const struct Mix mix); + +void GetMassFractions(double *Yi, const double MixW, const double Xi[nSpec], const struct Mix mix); + +double GetRhoFromRhoYi(const double rhoYi[nSpec], const struct Mix mix); + +void GetRhoYiFromYi(double *rhoYi, const double rho, const double Yi[nSpec], const struct Mix mix); + +void GetYi(double *Yi, const double rho, const double rhoYi[nSpec], const struct Mix mix); + +double GetRho(const double P, const double T, const double MixW, const struct Mix mix); + +double GetHeatCapacity(const double T, const double Yi[nSpec], const struct Mix mix); + +double GetEnthalpy(const double T, const double Yi[nSpec], const struct Mix mix); + +double GetSpeciesEnthalpy(const int i, const double T, const struct Mix mix); + +double GetSpeciesMolarWeight(const int i, const struct Mix mix); + +double GetInternalEnergy(const double T, const double Yi[nSpec], const struct Mix mix); + +double GetSpecificInternalEnergy(const int i, const double T, const struct Mix mix); + +double GetTFromInternalEnergy(const double e0, double T, const double Yi[nSpec], const struct Mix mix); + +bool isValidInternalEnergy(const double e, const double Yi[nSpec], const struct Mix mix); + +double GetTFromRhoAndP(const double rho, const double MixW, const double P, const struct Mix mix); + +double GetPFromRhoAndT(const double rho, const double MixW, const double T, const struct Mix mix); + +double GetViscosity(const double T, const double Xi[nSpec], const struct Mix mix); + +double GetHeatConductivity(const double T, const double Xi[nSpec], const struct Mix mix); + +double GetGamma(const double T, const double MixW, const double Yi[nSpec], const struct Mix mix); + +double GetSpeedOfSound(const double T, const double gamma, const double MixW, const struct Mix mix); + +void GetDiffusivity(double *Di, const double P, const double T, const double MixW, const double Xi[nSpec], const struct Mix mix); + +#if (nIons > 0) +void GetElectricMobility(double *Ki, const double Pn, const double Tn, const double Xi[nSpec], const struct Mix mix); +#endif + +double GetPartialElectricChargeDensity(const uint8_t i, const double rhon, const double MixW, const double Xi[nSpec], const struct Mix mix); + +double GetElectricChargeDensity(const double rhon, const double MixW, const double Xi[nSpec], const struct Mix mix); + +int8_t GetSpeciesChargeNumber(const int i, const struct Mix mix); + +double GetDielectricPermittivity(const struct Mix mix); + +void GetProductionRates(double *wi, const double rhon, const double Pn, const double Tn, const double Yi[nSpec], const struct Mix mix); + +double Getdpde(const double rho, const double gamma, const struct Mix mix); + +void Getdpdrhoi(double *dpdrhoi, const double gamma, const double T, const double Yi[nSpec], const struct Mix mix); + +#ifdef __cplusplus +}; +#endif + +#endif // __PROMETEO_MIXTURE_WRAPPERS_HPP__ diff --git a/src/prometeo_partitioner.rg b/src/prometeo_partitioner.rg index 364f94f..113ad0e 100644 --- a/src/prometeo_partitioner.rg +++ b/src/prometeo_partitioner.rg @@ -141,9 +141,6 @@ local fspace ghost_partitions(Fluid : region(ispace(int3d), Fluid_columns), til p_ZSensorGhosts2 : partition(aliased, Fluid, tiles), -- Metric routines p_MetricGhosts : partition(aliased, Fluid, tiles), - p_MetricGhostsX : partition(aliased, Fluid, tiles), - p_MetricGhostsY : partition(aliased, Fluid, tiles), - p_MetricGhostsZ : partition(aliased, Fluid, tiles), -- Euler fluxes routines p_XEulerGhosts : partition(aliased, Fluid, tiles), p_YEulerGhosts : partition(aliased, Fluid, tiles), @@ -156,9 +153,15 @@ local fspace ghost_partitions(Fluid : region(ispace(int3d), Fluid_columns), til p_ZSensorGhosts : partition(aliased, Fluid, tiles), } +local fspace average_ghost_partitions(Fluid : region(ispace(int3d), Fluid_columns), tiles : ispace(int3d)) { + -- Gradient routines + p_GradientGhosts : partition(aliased, Fluid, tiles), +} + Exports.zones_partitions = zones_partitions Exports.output_partitions = output_partitions Exports.ghost_partitions = ghost_partitions +Exports.average_ghost_partitions = average_ghost_partitions ------------------------------------------------------------------------------- -- ZONES PARTITIONING ROUTINES @@ -1243,13 +1246,6 @@ do [emitEulerGhostRegion("z", Fluid, aux, MetricGhostsZ)]; [UTIL.emitPartitionNameAttach(rexpr p_MetricGhosts end, "p_MetricGhosts")]; - var p_MetricGhostsX = Fluid & MetricGhostsX - var p_MetricGhostsY = Fluid & MetricGhostsY - var p_MetricGhostsZ = Fluid & MetricGhostsZ; - [UTIL.emitPartitionNameAttach(rexpr p_MetricGhostsX end, "p_MetricGhostsX")]; - [UTIL.emitPartitionNameAttach(rexpr p_MetricGhostsY end, "p_MetricGhostsY")]; - [UTIL.emitPartitionNameAttach(rexpr p_MetricGhostsZ end, "p_MetricGhostsZ")]; - -- Euler fluxes routines (uses [-2:+3] direction by direction) var p_XEulerGhosts = p_x_faces | x_facesM2 | x_facesM1 | x_facesP1 | x_facesP2 | x_facesP3 var p_YEulerGhosts = p_y_faces | y_facesM2 | y_facesM1 | y_facesP1 | y_facesP2 | y_facesP3 @@ -1284,9 +1280,6 @@ do p_AllWithGhosts = p_AllWithGhosts, -- Metric routines p_MetricGhosts = p_MetricGhosts, - p_MetricGhostsX = p_MetricGhostsX, - p_MetricGhostsY = p_MetricGhostsY, - p_MetricGhostsZ = p_MetricGhostsZ, -- Fluxes stencil access p_XFluxGhosts = p_XFluxGhosts, p_YFluxGhosts = p_YFluxGhosts, @@ -1316,5 +1309,64 @@ do } end +__demand(__inline) +task Exports.PartitionAverageGhost( + Fluid : region(ispace(int3d), Fluid_columns), + p_All : partition(disjoint, Fluid, ispace(int3d)), + p_Avg : partition(aliased, Fluid, ispace(int1d)), + cr_Avg : cross_product(p_Avg, p_All), + n_Avg : int) +where + reads(Fluid) +do + var tiles = p_All.colors + -- This line matches the maximum number of average specified in config_schema.lua:341-347 + var p : average_ghost_partitions(Fluid, tiles)[10] + + if (n_Avg > 0) then + -- Define an auxiliary region that will store the stencil indices + var aux = region(Fluid.ispace, indices_columns) + var All = aux & p_All + + -- Compute stencil indices + InitializeIndices(aux, tiles, All) + __demand(__index_launch) + for c in tiles do + ComputeIndices(p_All[c], All[c], Fluid.bounds) + end + + -- Define the Ghost partition for each partition of the cross product + for i=0, n_Avg do + var Avg = aux & cr_Avg[i] + + -- Compute auxiliary partitions + var AvgM1x = [emitGhostRegion("x", -1, aux, aux, Avg)]; + var AvgP1x = [emitGhostRegion("x", 1, aux, aux, Avg)]; + + var AvgM1y = [emitGhostRegion("y", -1, aux, aux, Avg)]; + var AvgP1y = [emitGhostRegion("y", 1, aux, aux, Avg)]; + + var AvgM1z = [emitGhostRegion("z", -1, aux, aux, Avg)]; + var AvgP1z = [emitGhostRegion("z", 1, aux, aux, Avg)]; + + -- Gradient tasks use [-1:+1] in all three directions + var p_GradientGhosts = Fluid & (Avg | AvgM1x | AvgP1x | + AvgM1y | AvgP1y | + AvgM1z | AvgP1z); + [UTIL.emitPartitionNameAttach(rexpr p_GradientGhosts end, "p_GradientGhosts")]; + + -- Store in the array of fspaces + p[i] = [average_ghost_partitions(Fluid, tiles)] { + -- Gradient routines + p_GradientGhosts = p_GradientGhosts, + } + end + + -- Delete aux (avoid deletion until Legion issue #812 is fixed) + --__delete(aux) + end + return p +end + return Exports end diff --git a/src/prometeo_probe.rg b/src/prometeo_probe.rg index a0a1122..30d4301 100644 --- a/src/prometeo_probe.rg +++ b/src/prometeo_probe.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -112,19 +112,19 @@ end function Exports.DeclSymbols(s, Grid, Fluid, p_All, config) return rquote - -- Declare array of volumes + -- Declare array of volumes var [s.Volumes]; - -- Write probe file headers + -- Write probe file headers __forbid(__index_launch) - for probeId = 0, config.IO.probes.length do + for probeId = 0, config.IO.probes.length do IO.Probe_WriteHeader(config.Mapping, probeId) - end + end -- Partition the Fluid region based on the specified regions var probe_coloring = regentlib.c.legion_domain_point_coloring_create() - for p=0, config.IO.probes.length do + for p=0, config.IO.probes.length do -- Clip rectangles from the input var sample = config.IO.probes.values[p] sample.fromCell[0] max= 0 @@ -147,6 +147,11 @@ function Exports.DeclSymbols(s, Grid, Fluid, p_All, config) -- Make partitions of Fluid var Fluid_Probes = partition(aliased, Fluid, probe_coloring, ispace(int1d, max(config.IO.probes.length, 1))) + -- Ensure that probes volumes are not empty + for p=0, config.IO.probes.length do + regentlib.assert(Fluid_Probes[p].volume ~= 0, "Found a probe with empty volume") + end + -- Split over tiles var [s.p_Probes] = cross_product(Fluid_Probes, p_All) @@ -169,7 +174,7 @@ end function Exports.InitProbes(s, config) return rquote -- Store volume of each probe - for p=0, config.IO.probes.length do + for p=0, config.IO.probes.length do s.Volumes[p] = 0.0 var cs = s.probes_tiles[p].ispace __demand(__index_launch) @@ -183,7 +188,7 @@ end function Exports.WriteProbes(s, Integrator_timeStep, Integrator_simTime, config) return rquote if (Integrator_timeStep % config.IO.probesSamplingInterval == 0) then - for p=0, config.IO.probes.length do + for p=0, config.IO.probes.length do var cs = s.probes_tiles[p].ispace var avgTemperature = 0.0 var avgPressure = 0.0 diff --git a/src/prometeo_profiles.rg b/src/prometeo_profiles.rg index 4c87861..7dac193 100644 --- a/src/prometeo_profiles.rg +++ b/src/prometeo_profiles.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -38,7 +38,6 @@ local C = regentlib.c local UTIL = require 'util-desugared' local CONST = require "prometeo_const" local MACRO = require "prometeo_macro" -local CHEM = (require 'prometeo_chem')(SCHEMA, MIX, Fluid_columns) -- Variable indices local nSpec = MIX.nSpec -- Number of species composing the mixture @@ -69,7 +68,7 @@ function Exports.mkInitializeProfilesField(Side) if (config.BC.[Side].type == SCHEMA.FlowBC_Dirichlet) then var Dirichlet = config.BC.[Side].u.Dirichlet if Dirichlet.MixtureProfile.type == SCHEMA.MixtureProfile_Constant then - var BC_Mixture = CHEM.ParseConfigMixture(Dirichlet.MixtureProfile.u.Constant.Mixture, mix) + var BC_Mixture = MIX.ParseConfigMixture(Dirichlet.MixtureProfile.u.Constant.Mixture, mix) fill(BC.MolarFracs_profile, BC_Mixture) end if Dirichlet.VelocityProfile.type == SCHEMA.InflowProfile_Constant then @@ -82,7 +81,7 @@ function Exports.mkInitializeProfilesField(Side) elseif (config.BC.[Side].type == SCHEMA.FlowBC_NSCBC_Inflow) then var NSCBC_Inflow = config.BC.[Side].u.NSCBC_Inflow if NSCBC_Inflow.MixtureProfile.type == SCHEMA.MixtureProfile_Constant then - var BC_Mixture = CHEM.ParseConfigMixture(NSCBC_Inflow.MixtureProfile.u.Constant.Mixture, mix) + var BC_Mixture = MIX.ParseConfigMixture(NSCBC_Inflow.MixtureProfile.u.Constant.Mixture, mix) fill(BC.MolarFracs_profile, BC_Mixture) end if NSCBC_Inflow.VelocityProfile.type == SCHEMA.InflowProfile_Constant then @@ -107,7 +106,7 @@ function Exports.mkInitializeProfilesField(Side) elseif (config.BC.[Side].type == SCHEMA.FlowBC_RecycleRescaling) then var RecycleRescaling = config.BC.[Side].u.RecycleRescaling if RecycleRescaling.MixtureProfile.type == SCHEMA.MixtureProfile_Constant then - var BC_Mixture = CHEM.ParseConfigMixture(RecycleRescaling.MixtureProfile.u.Constant.Mixture, mix) + var BC_Mixture = MIX.ParseConfigMixture(RecycleRescaling.MixtureProfile.u.Constant.Mixture, mix) fill(BC.MolarFracs_profile, BC_Mixture) end if RecycleRescaling.VelocityProfile.type == SCHEMA.InflowProfile_Constant then diff --git a/src/prometeo_redop.inl b/src/prometeo_redop.inl new file mode 100644 index 0000000..fc598bb --- /dev/null +++ b/src/prometeo_redop.inl @@ -0,0 +1,309 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "prometeo_types.h" +#include "task_helper.hpp" + +#ifndef __CUDA_H__ +#ifdef __CUDACC__ +#define __CUDA_H__ __device__ +#else +#define __CUDA_H__ +#endif +#endif + +#ifndef __UNROLL__ +#ifdef __CUDACC__ +#define __UNROLL__ #pragma unroll +#else +#define __UNROLL__ +#endif +#endif + +namespace Legion { +//----------------------------------------------------------------------------- +// SumReduction for Vec3 +//----------------------------------------------------------------------------- + +template<> template<> __CUDA_HD__ inline +void SumReduction::apply(LHS &lhs, RHS rhs) { + lhs += rhs; +} + +template<> template<> __CUDA_HD__ inline +void SumReduction::apply(LHS &lhs, RHS rhs) { + #ifdef __CUDA_ARCH__ + #if __CUDA_ARCH__ >= 600 + __UNROLL__ + for (int i=0; i<3; i++) + atomicAdd(&lhs[i], rhs[i]); + #else + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) { + unsigned long long *target = (unsigned long long *)&lhs[i]; + newval.as_int = *target; + do { + oldval.as_int = newval.as_int; + newval.as_float += rhs[i]; + newval.as_int = atomicCAS(target, oldval.as_int, newval.as_int); + } while (oldval.as_int != newval.as_int); + } + #endif + #else + // No atomic floating point operations so use compare and swap + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) { + volatile unsigned long long *target = (unsigned long long *)&lhs[i]; + do { + oldval.as_int = *target; + newval.as_float = oldval.as_float + rhs[i]; + } while (!__sync_bool_compare_and_swap(target, oldval.as_int, newval.as_int)); + } + #endif +} + +template<> template<> __CUDA_HD__ inline +void SumReduction::fold(RHS &rhs1, RHS rhs2) { + rhs1 += rhs2; +} + +template<> template<> __CUDA_HD__ inline +void SumReduction::fold(RHS &rhs1, RHS rhs2) { + #ifdef __CUDA_ARCH__ + #if __CUDA_ARCH__ >= 600 + __UNROLL__ + for (int i=0; i<3; i++) + atomicAdd(&rhs1[i], rhs2[i]); + #else + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) { + unsigned long long *target = (unsigned long long *)&rhs1[i]; + newval.as_int = *target; + do { + oldval.as_int = newval.as_int; + newval.as_float += rhs2[i]; + newval.as_int = atomicCAS(target, oldval.as_int, newval.as_int); + } while (oldval.as_int != newval.as_int); + } + #endif + #else + // No atomic floating point operations so use compare and swap + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) { + volatile unsigned long long *target = (unsigned long long *)&rhs1[i]; + do { + oldval.as_int = *target; + newval.as_float = oldval.as_float + rhs2[i]; + } while (!__sync_bool_compare_and_swap(target, oldval.as_int, newval.as_int)); + } + #endif +} + +//----------------------------------------------------------------------------- +// SumReduction for VecNSp +//----------------------------------------------------------------------------- + +template<> template<> __CUDA_HD__ inline +void SumReduction::apply(LHS &lhs, RHS rhs) { + lhs += rhs; +} + +template<> template<> __CUDA_HD__ inline +void SumReduction::apply(LHS &lhs, RHS rhs) { + #ifdef __CUDA_ARCH__ + #if __CUDA_ARCH__ >= 600 + __UNROLL__ + for (int i=0; i template<> __CUDA_HD__ inline +void SumReduction::fold(RHS &rhs1, RHS rhs2) { + rhs1 += rhs2; +} + +template<> template<> __CUDA_HD__ inline +void SumReduction::fold(RHS &rhs1, RHS rhs2) { + #ifdef __CUDA_ARCH__ + #if __CUDA_ARCH__ >= 600 + __UNROLL__ + for (int i=0; i +//----------------------------------------------------------------------------- + +template<> template<> __CUDA_HD__ inline +void SumReduction>::apply(LHS &lhs, RHS rhs) { + lhs += rhs; +} + +template<> template<> __CUDA_HD__ inline +void SumReduction>::apply(LHS &lhs, RHS rhs) { + #ifdef __CUDA_ARCH__ + #if __CUDA_ARCH__ >= 600 + __UNROLL__ + for (int i=0; i<3; i++) + __UNROLL__ + for (int j=i; j<3; j++) + atomicAdd(&lhs(i,j), rhs(i,j)); + #else + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) + __UNROLL__ + for (int j=i; j<3; j++) { + unsigned long long *target = (unsigned long long *)&lhs(i,j); + newval.as_int = *target; + do { + oldval.as_int = newval.as_int; + newval.as_float += rhs(i,j); + newval.as_int = atomicCAS(target, oldval.as_int, newval.as_int); + } while (oldval.as_int != newval.as_int); + } + #endif + #else + // No atomic floating point operations so use compare and swap + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) + __UNROLL__ + for (int j=i; j<3; j++) { + volatile unsigned long long *target = (unsigned long long *)&lhs(i,j); + do { + oldval.as_int = *target; + newval.as_float = oldval.as_float + rhs(i,j); + } while (!__sync_bool_compare_and_swap(target, oldval.as_int, newval.as_int)); + } + #endif +} + +template<> template<> __CUDA_HD__ inline +void SumReduction>::fold(RHS &rhs1, RHS rhs2) { + rhs1 += rhs2; +} + +template<> template<> __CUDA_HD__ inline +void SumReduction>::fold(RHS &rhs1, RHS rhs2) { + #ifdef __CUDA_ARCH__ + #if __CUDA_ARCH__ >= 600 + __UNROLL__ + for (int i=0; i<3; i++) + __UNROLL__ + for (int j=i; j<3; j++) + atomicAdd(&rhs1(i,j), rhs2(i,j)); + #else + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) + __UNROLL__ + for (int j=i; j<3; j++) { + unsigned long long *target = (unsigned long long *)&rhs1(i,j); + newval.as_int = *target; + do { + oldval.as_int = newval.as_int; + newval.as_float += rhs2(i,j); + newval.as_int = atomicCAS(target, oldval.as_int, newval.as_int); + } while (oldval.as_int != newval.as_int); + } + #endif + #else + // No atomic floating point operations so use compare and swap + union { unsigned long long as_int; double as_float; } oldval, newval; + __UNROLL__ + for (int i=0; i<3; i++) + __UNROLL__ + for (int j=i; j<3; j++) { + volatile unsigned long long *target = (unsigned long long *)&rhs1(i,j); + do { + oldval.as_int = *target; + newval.as_float = oldval.as_float + rhs2(i,j); + } while (!__sync_bool_compare_and_swap(target, oldval.as_int, newval.as_int)); + } + #endif +} + +}; + diff --git a/src/prometeo_registrar.cc b/src/prometeo_registrar.cc index bd01777..cda2a9f 100644 --- a/src/prometeo_registrar.cc +++ b/src/prometeo_registrar.cc @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -36,6 +36,9 @@ void register_all() { // Register task for primitive and auxiliary variables register_variables_tasks(); + // Register task for the mixture + register_mixture_tasks(); + // Register task for the metric register_metric_tasks(); @@ -44,4 +47,21 @@ void register_all() { // Register task for the RHS register_rhs_tasks(); + + // Register task for the chemistry + register_chem_tasks(); + + // Register task for the bcs + register_bc_tasks(); + + // Register task for spatial and temporal averages + register_average_tasks(); + + // Register task that compute CFL number + register_cfl_tasks(); + +#ifdef ELECTRIC_FIELD + // Register task for the electric field solver and ion wind + register_electricField_tasks(); +#endif } diff --git a/src/prometeo_registrar.h b/src/prometeo_registrar.h index b486d45..3745e0a 100644 --- a/src/prometeo_registrar.h +++ b/src/prometeo_registrar.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -32,9 +32,17 @@ #include "prometeo_mapper.h" #include "prometeo_variables.h" +#include "prometeo_mixture.h" #include "prometeo_metric.h" #include "prometeo_sensor.h" +#include "prometeo_chem.h" +#include "prometeo_bc.h" #include "prometeo_rhs.h" +#include "prometeo_cfl.h" +#include "prometeo_average.h" +#ifdef ELECTRIC_FIELD +#include "prometeo_electricField.h" +#endif #ifdef __cplusplus extern "C" { diff --git a/src/prometeo_rhs.cc b/src/prometeo_rhs.cc index df38bd9..0e5bb35 100644 --- a/src/prometeo_rhs.cc +++ b/src/prometeo_rhs.cc @@ -5,7 +5,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -13,7 +13,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -34,12 +34,6 @@ template<> /*static*/ const char * const UpdateUsingHybridEulerFluxTask::TASK_NAME = "UpdateUsingHybridEulerFluxX"; template<> /*static*/ const int UpdateUsingHybridEulerFluxTask::TASK_ID = TID_UpdateUsingHybridEulerFluxX; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iN = 0; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iT1 = 1; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iT2 = 2; template<> /*static*/ const FieldID UpdateUsingHybridEulerFluxTask::FID_nType = FID_nType_x; template<> @@ -84,103 +78,33 @@ void UpdateUsingHybridEulerFluxTask::cpu_base_impl( Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); Rect<3> Fluid_bounds = args.Fluid_bounds; - // Allocate a buffer for the summations of the KG scheme of size (3 * 3 * (nEq+1)) for each thread - // TODO: can reduce it to (6*(nEq+1)) + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread #ifdef REALM_USE_OPENMP - double *KGSum = new double[9*(nEq+1)*omp_get_max_threads()]; + double *KGSum = new double[6*(nEq+1)*omp_get_max_threads()]; #else - double *KGSum = new double[9*(nEq+1)]; + double *KGSum = new double[6*(nEq+1)]; #endif // update RHS using Euler fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { - - double FluxM[nEq]; - double FluxP[nEq]; - #ifdef REALM_USE_OPENMP - double *myKGSum = &KGSum[9*(nEq+1)*omp_get_thread_num()]; + double *myKGSum = &KGSum[6*(nEq+1)*omp_get_thread_num()]; #else double *myKGSum = &KGSum[0]; #endif - - // Reconstruct the Euler flux at i-1/2 of the first point - { - const Point<3> p = warpPeriodic(Fluid_bounds, Point<3>{r_ModCells.lo.x,j,k}, size, -1); - const Point<3> pM2 = warpPeriodic(Fluid_bounds, p, size, offM2(acc_nType[p])); - const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(acc_nType[p])); - const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(acc_nType[p])); - - // Compute KG summations - ComputeKGSums(&myKGSum[0], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - ComputeKGSums(&myKGSum[3*(nEq+1)], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - pM1, acc_nType[p], size, Fluid_bounds); - ComputeKGSums(&myKGSum[6*(nEq+1)], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - pM2, acc_nType[p], size, Fluid_bounds); - - if (acc_shockSensor[pM1] and - acc_shockSensor[p ] and - acc_shockSensor[pP1]) - // KG reconstruction - KGFluxReconstruction(FluxM, myKGSum, - acc_Conserved, acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - else - // TENO reconstruction - TENOFluxReconstruction(FluxM, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - } - - for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - const Point<3> p = Point<3>{i,j,k}; - const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(acc_nType[p])); - const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(acc_nType[p])); - - // Shift and update KG summations - for (int l=0; l<3*(nEq+1); l++) myKGSum[6*(nEq+1) + l] = myKGSum[3*(nEq+1) + l]; - for (int l=0; l<3*(nEq+1); l++) myKGSum[3*(nEq+1) + l] = myKGSum[ l]; - ComputeKGSums(&myKGSum[0], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - - if (acc_shockSensor[pM1] and - acc_shockSensor[p ] and - acc_shockSensor[pP1]) - // KG reconstruction - KGFluxReconstruction(FluxP, myKGSum, - acc_Conserved, acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - else - // TENO reconstruction - TENOFluxReconstruction(FluxP, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + 0, j-r_ModCells.lo.y, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); } // Cleanup delete[] KGSum; @@ -191,12 +115,6 @@ template<> /*static*/ const char * const UpdateUsingHybridEulerFluxTask::TASK_NAME = "UpdateUsingHybridEulerFluxY"; template<> /*static*/ const int UpdateUsingHybridEulerFluxTask::TASK_ID = TID_UpdateUsingHybridEulerFluxY; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iN = 1; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iT1 = 0; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iT2 = 2; template<> /*static*/ const FieldID UpdateUsingHybridEulerFluxTask::FID_nType = FID_nType_y; template<> @@ -241,103 +159,33 @@ void UpdateUsingHybridEulerFluxTask::cpu_base_impl( Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); Rect<3> Fluid_bounds = args.Fluid_bounds; - // Allocate a buffer for the summations of the KG scheme of size (3 * 3 * (nEq+1)) for each thread - // TODO: can reduce it to (6*(nEq+1)) + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread #ifdef REALM_USE_OPENMP - double *KGSum = new double[9*(nEq+1)*omp_get_max_threads()]; + double *KGSum = new double[6*(nEq+1)*omp_get_max_threads()]; #else - double *KGSum = new double[9*(nEq+1)]; + double *KGSum = new double[6*(nEq+1)]; #endif // update RHS using Euler fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - - double FluxM[nEq]; - double FluxP[nEq]; - #ifdef REALM_USE_OPENMP - double *myKGSum = &KGSum[9*(nEq+1)*omp_get_thread_num()]; + double *myKGSum = &KGSum[6*(nEq+1)*omp_get_thread_num()]; #else double *myKGSum = &KGSum[0]; #endif - - // Reconstruct the Euler flux at j-1/2 of the first point - { - const Point<3> p = warpPeriodic(Fluid_bounds, Point<3>{i,r_ModCells.lo.y,k}, size, -1); - const Point<3> pM2 = warpPeriodic(Fluid_bounds, p, size, offM2(acc_nType[p])); - const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(acc_nType[p])); - const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(acc_nType[p])); - - // Compute KG summations - ComputeKGSums(&myKGSum[0], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - ComputeKGSums(&myKGSum[3*(nEq+1)], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - pM1, acc_nType[p], size, Fluid_bounds); - ComputeKGSums(&myKGSum[6*(nEq+1)], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - pM2, acc_nType[p], size, Fluid_bounds); - - if (acc_shockSensor[pM1] and - acc_shockSensor[p ] and - acc_shockSensor[pP1]) - // KG reconstruction - KGFluxReconstruction(FluxM, myKGSum, - acc_Conserved, acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - else - // TENO reconstruction - TENOFluxReconstruction(FluxM, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - } - - for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { - const Point<3> p = Point<3>{i,j,k}; - const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(acc_nType[p])); - const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(acc_nType[p])); - - // Shift and update KG summations - for (int l=0; l<3*(nEq+1); l++) myKGSum[6*(nEq+1) + l] = myKGSum[3*(nEq+1) + l]; - for (int l=0; l<3*(nEq+1); l++) myKGSum[3*(nEq+1) + l] = myKGSum[ l]; - ComputeKGSums(&myKGSum[0], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - - if (acc_shockSensor[pM1] and - acc_shockSensor[p ] and - acc_shockSensor[pP1]) - // KG reconstruction - KGFluxReconstruction(FluxP, myKGSum, - acc_Conserved, acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - else - // TENO reconstruction - TENOFluxReconstruction(FluxP, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + i-r_ModCells.lo.x, 0, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); } // Cleanup delete[] KGSum; @@ -348,12 +196,6 @@ template<> /*static*/ const char * const UpdateUsingHybridEulerFluxTask::TASK_NAME = "UpdateUsingHybridEulerFluxZ"; template<> /*static*/ const int UpdateUsingHybridEulerFluxTask::TASK_ID = TID_UpdateUsingHybridEulerFluxZ; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iN = 2; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iT1 = 0; -//template<> -///*static*/ const int UpdateUsingHybridEulerFluxTask::iT2 = 1; template<> /*static*/ const FieldID UpdateUsingHybridEulerFluxTask::FID_nType = FID_nType_z; template<> @@ -398,103 +240,33 @@ void UpdateUsingHybridEulerFluxTask::cpu_base_impl( Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); Rect<3> Fluid_bounds = args.Fluid_bounds; - // Allocate a buffer for the summations of the KG scheme of size (3 * 3 * (nEq+1)) for each thread - // TODO: can reduce it to (6*(nEq+1)) + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread #ifdef REALM_USE_OPENMP - double *KGSum = new double[9*(nEq+1)*omp_get_max_threads()]; + double *KGSum = new double[6*(nEq+1)*omp_get_max_threads()]; #else - double *KGSum = new double[9*(nEq+1)]; + double *KGSum = new double[6*(nEq+1)]; #endif // update RHS using Euler fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - - double FluxM[nEq]; - double FluxP[nEq]; - #ifdef REALM_USE_OPENMP - double *myKGSum = &KGSum[9*(nEq+1)*omp_get_thread_num()]; + double *myKGSum = &KGSum[6*(nEq+1)*omp_get_thread_num()]; #else double *myKGSum = &KGSum[0]; #endif - - // Reconstruct the Euler flux at k-1/2 of the first point - { - const Point<3> p = warpPeriodic(Fluid_bounds, Point<3>{i,j,r_ModCells.lo.z}, size, -1); - const Point<3> pM2 = warpPeriodic(Fluid_bounds, p, size, offM2(acc_nType[p])); - const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(acc_nType[p])); - const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(acc_nType[p])); - - // Compute KG summations - ComputeKGSums(&myKGSum[0], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - ComputeKGSums(&myKGSum[3*(nEq+1)], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - pM1, acc_nType[p], size, Fluid_bounds); - ComputeKGSums(&myKGSum[6*(nEq+1)], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - pM2, acc_nType[p], size, Fluid_bounds); - - if (acc_shockSensor[pM1] and - acc_shockSensor[p ] and - acc_shockSensor[pP1]) - // KG reconstruction - KGFluxReconstruction(FluxM, myKGSum, - acc_Conserved, acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - else - // TENO reconstruction - TENOFluxReconstruction(FluxM, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - } - - for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) { - const Point<3> p = Point<3>{i,j,k}; - const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(acc_nType[p])); - const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(acc_nType[p])); - - // Shift and update KG summations - for (int l=0; l<3*(nEq+1); l++) myKGSum[6*(nEq+1) + l] = myKGSum[3*(nEq+1) + l]; - for (int l=0; l<3*(nEq+1); l++) myKGSum[3*(nEq+1) + l] = myKGSum[ l]; - ComputeKGSums(&myKGSum[0], - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - - if (acc_shockSensor[pM1] and - acc_shockSensor[p ] and - acc_shockSensor[pP1]) - // KG reconstruction - KGFluxReconstruction(FluxP, myKGSum, - acc_Conserved, acc_velocity, acc_pressure, - p, acc_nType[p], size, Fluid_bounds); - else - // TENO reconstruction - TENOFluxReconstruction(FluxP, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + i-r_ModCells.lo.x, j-r_ModCells.lo.y, 0, + r_ModCells, Fluid_bounds, args.mix); } // Cleanup delete[] KGSum; @@ -505,12 +277,6 @@ template<> /*static*/ const char * const UpdateUsingTENOAEulerFluxTask::TASK_NAME = "UpdateUsingTENOAEulerFluxX"; template<> /*static*/ const int UpdateUsingTENOAEulerFluxTask::TASK_ID = TID_UpdateUsingTENOAEulerFluxX; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iN = 0; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iT1 = 1; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iT2 = 2; template<> /*static*/ const FieldID UpdateUsingTENOAEulerFluxTask::FID_nType = FID_nType_x; template<> @@ -551,43 +317,20 @@ void UpdateUsingTENOAEulerFluxTask::cpu_base_impl( Rect<3> Fluid_bounds = args.Fluid_bounds; // update RHS using Euler fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { - - double FluxM[nEq]; - double FluxP[nEq]; - - // Reconstruct the Euler flux at i-1/2 of the first point - { - const Point<3> p = warpPeriodic(Fluid_bounds, Point<3>{r_ModCells.lo.x,j,k}, size, -1); - // TENOA reconstruction - TENOAFluxReconstruction(FluxM, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - } - - for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - const Point<3> p = Point<3>{i,j,k}; - // TENOA reconstruction - TENOAFluxReconstruction(FluxP, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + 0, j-r_ModCells.lo.y, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); } } @@ -596,12 +339,6 @@ template<> /*static*/ const char * const UpdateUsingTENOAEulerFluxTask::TASK_NAME = "UpdateUsingTENOAEulerFluxY"; template<> /*static*/ const int UpdateUsingTENOAEulerFluxTask::TASK_ID = TID_UpdateUsingTENOAEulerFluxY; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iN = 1; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iT1 = 0; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iT2 = 2; template<> /*static*/ const FieldID UpdateUsingTENOAEulerFluxTask::FID_nType = FID_nType_y; template<> @@ -642,43 +379,20 @@ void UpdateUsingTENOAEulerFluxTask::cpu_base_impl( Rect<3> Fluid_bounds = args.Fluid_bounds; // update RHS using Euler fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - - double FluxM[nEq]; - double FluxP[nEq]; - - // Reconstruct the Euler flux at j-1/2 of the first point - { - const Point<3> p = warpPeriodic(Fluid_bounds, Point<3>{i,r_ModCells.lo.y,k}, size, -1); - // TENOA reconstruction - TENOAFluxReconstruction(FluxM, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - } - - for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { - const Point<3> p = Point<3>{i,j,k}; - // TENOA reconstruction - TENOAFluxReconstruction(FluxP, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + i-r_ModCells.lo.x, 0, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); } } @@ -687,12 +401,6 @@ template<> /*static*/ const char * const UpdateUsingTENOAEulerFluxTask::TASK_NAME = "UpdateUsingTENOAEulerFluxZ"; template<> /*static*/ const int UpdateUsingTENOAEulerFluxTask::TASK_ID = TID_UpdateUsingTENOAEulerFluxZ; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iN = 2; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iT1 = 0; -//template<> -///*static*/ const int UpdateUsingTENOAEulerFluxTask::iT2 = 1; template<> /*static*/ const FieldID UpdateUsingTENOAEulerFluxTask::FID_nType = FID_nType_z; template<> @@ -733,46 +441,425 @@ void UpdateUsingTENOAEulerFluxTask::cpu_base_impl( Rect<3> Fluid_bounds = args.Fluid_bounds; // update RHS using Euler fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + // Launch the loop for the span + updateRHSSpan( + acc_Conserved_t, acc_m, acc_nType, + acc_Conserved, acc_rho, acc_SoS, + acc_MassFracs, acc_velocity, acc_pressure, acc_temperature, + 0, getSize(r_ModCells), + i-r_ModCells.lo.x, j-r_ModCells.lo.y, 0, + r_ModCells, Fluid_bounds, args.mix); + } +} + +// Specielize UpdateUsingTENOLADEulerFlux for the X direction +template<> +/*static*/ const char * const UpdateUsingTENOLADEulerFluxTask::TASK_NAME = "UpdateUsingTENOLADEulerFluxX"; +template<> +/*static*/ const int UpdateUsingTENOLADEulerFluxTask::TASK_ID = TID_UpdateUsingTENOLADEulerFluxX; +template<> +/*static*/ const FieldID UpdateUsingTENOLADEulerFluxTask::FID_nType = FID_nType_x; +template<> +/*static*/ const FieldID UpdateUsingTENOLADEulerFluxTask::FID_m_e = FID_dcsi_e; + +template<> +void UpdateUsingTENOLADEulerFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_SoS (regions[0], FID_SoS); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for quantities needed for the Roe averages + const AccessorRO acc_temperature(regions[1], FID_temperature); + const AccessorRO acc_MassFracs( regions[1], FID_MassFracs); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[2], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m(regions[3], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // update RHS using Euler fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { + // Launch the loop for the span + updateRHSSpan( + acc_Conserved_t, acc_m, acc_nType, + acc_Conserved, acc_rho, acc_SoS, + acc_MassFracs, acc_velocity, acc_pressure, acc_temperature, + 0, getSize(r_ModCells), + 0, j-r_ModCells.lo.y, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); + } +} + +// Specielize UpdateUsingTENOLADEulerFlux for the Y direction +template<> +/*static*/ const char * const UpdateUsingTENOLADEulerFluxTask::TASK_NAME = "UpdateUsingTENOLADEulerFluxY"; +template<> +/*static*/ const int UpdateUsingTENOLADEulerFluxTask::TASK_ID = TID_UpdateUsingTENOLADEulerFluxY; +template<> +/*static*/ const FieldID UpdateUsingTENOLADEulerFluxTask::FID_nType = FID_nType_y; +template<> +/*static*/ const FieldID UpdateUsingTENOLADEulerFluxTask::FID_m_e = FID_deta_e; + +template<> +void UpdateUsingTENOLADEulerFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_SoS (regions[0], FID_SoS); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for quantities needed for the Roe averages + const AccessorRO acc_temperature(regions[1], FID_temperature); + const AccessorRO acc_MassFracs( regions[1], FID_MassFracs); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[2], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m(regions[3], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // update RHS using Euler fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + // Launch the loop for the span + updateRHSSpan( + acc_Conserved_t, acc_m, acc_nType, + acc_Conserved, acc_rho, acc_SoS, + acc_MassFracs, acc_velocity, acc_pressure, acc_temperature, + 0, getSize(r_ModCells), + i-r_ModCells.lo.x, 0, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); + } +} + +// Specielize UpdateUsingTENOLADEulerFlux for the Z direction +template<> +/*static*/ const char * const UpdateUsingTENOLADEulerFluxTask::TASK_NAME = "UpdateUsingTENOLADEulerFluxZ"; +template<> +/*static*/ const int UpdateUsingTENOLADEulerFluxTask::TASK_ID = TID_UpdateUsingTENOLADEulerFluxZ; +template<> +/*static*/ const FieldID UpdateUsingTENOLADEulerFluxTask::FID_nType = FID_nType_z; +template<> +/*static*/ const FieldID UpdateUsingTENOLADEulerFluxTask::FID_m_e = FID_dzet_e; + +template<> +void UpdateUsingTENOLADEulerFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_SoS (regions[0], FID_SoS); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for quantities needed for the Roe averages + const AccessorRO acc_temperature(regions[1], FID_temperature); + const AccessorRO acc_MassFracs( regions[1], FID_MassFracs); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[2], FID_nType); - double FluxM[nEq]; - double FluxP[nEq]; - - // Reconstruct the Euler flux at k-1/2 of the first point - { - const Point<3> p = warpPeriodic(Fluid_bounds, Point<3>{i,j,r_ModCells.lo.z}, size, -1); - // TENOA reconstruction - TENOAFluxReconstruction(FluxM, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - } - - for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) { - const Point<3> p = Point<3>{i,j,k}; - // TENOA reconstruction - TENOAFluxReconstruction(FluxP, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, - p, acc_nType[p], args.mix, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l acc_m(regions[3], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // update RHS using Euler fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + // Launch the loop for the span + updateRHSSpan( + acc_Conserved_t, acc_m, acc_nType, + acc_Conserved, acc_rho, acc_SoS, + acc_MassFracs, acc_velocity, acc_pressure, acc_temperature, + 0, getSize(r_ModCells), + i-r_ModCells.lo.x, j-r_ModCells.lo.y, 0, + r_ModCells, Fluid_bounds, args.mix); } } +// Specielize UpdateUsingSkewSymmetricEulerFlux for the X direction +template<> +/*static*/ const char * const UpdateUsingSkewSymmetricEulerFluxTask::TASK_NAME = "UpdateUsingSkewSymmetricEulerFluxX"; +template<> +/*static*/ const int UpdateUsingSkewSymmetricEulerFluxTask::TASK_ID = TID_UpdateUsingSkewSymmetricEulerFluxX; +template<> +/*static*/ const FieldID UpdateUsingSkewSymmetricEulerFluxTask::FID_nType = FID_nType_x; +template<> +/*static*/ const FieldID UpdateUsingSkewSymmetricEulerFluxTask::FID_m_e = FID_dcsi_e; + +template<> +void UpdateUsingSkewSymmetricEulerFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 5); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_MassFracs(regions[0], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[1], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m(regions[2], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[3], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread +#ifdef REALM_USE_OPENMP + double *KGSum = new double[6*(nEq+1)*omp_get_max_threads()]; +#else + double *KGSum = new double[6*(nEq+1)]; +#endif + + // update RHS using Euler fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { +#ifdef REALM_USE_OPENMP + double *myKGSum = &KGSum[6*(nEq+1)*omp_get_thread_num()]; +#else + double *myKGSum = &KGSum[0]; +#endif + // Launch the loop for the span + updateRHSSpan(myKGSum, + acc_Conserved_t, acc_m, acc_nType, + acc_Conserved, acc_rho, + acc_MassFracs, acc_velocity, acc_pressure, + 0, getSize(r_ModCells), + 0, j-r_ModCells.lo.y, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds); + } + // Cleanup + delete[] KGSum; +} + +// Specielize UpdateUsingSkewSymmetricEulerFlux for the Y direction +template<> +/*static*/ const char * const UpdateUsingSkewSymmetricEulerFluxTask::TASK_NAME = "UpdateUsingSkewSymmetricEulerFluxY"; +template<> +/*static*/ const int UpdateUsingSkewSymmetricEulerFluxTask::TASK_ID = TID_UpdateUsingSkewSymmetricEulerFluxY; +template<> +/*static*/ const FieldID UpdateUsingSkewSymmetricEulerFluxTask::FID_nType = FID_nType_y; +template<> +/*static*/ const FieldID UpdateUsingSkewSymmetricEulerFluxTask::FID_m_e = FID_deta_e; + +template<> +void UpdateUsingSkewSymmetricEulerFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 5); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_MassFracs(regions[0], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[1], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m(regions[2], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[3], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread +#ifdef REALM_USE_OPENMP + double *KGSum = new double[6*(nEq+1)*omp_get_max_threads()]; +#else + double *KGSum = new double[6*(nEq+1)]; +#endif + + // update RHS using Euler fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { +#ifdef REALM_USE_OPENMP + double *myKGSum = &KGSum[6*(nEq+1)*omp_get_thread_num()]; +#else + double *myKGSum = &KGSum[0]; +#endif + // Launch the loop for the span + updateRHSSpan(myKGSum, + acc_Conserved_t, acc_m, acc_nType, + acc_Conserved, acc_rho, + acc_MassFracs, acc_velocity, acc_pressure, + 0, getSize(r_ModCells), + i-r_ModCells.lo.x, 0, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds); + } + // Cleanup + delete[] KGSum; +} + +// Specielize UpdateUsingSkewSymmetricEulerFlux for the Z direction +template<> +/*static*/ const char * const UpdateUsingSkewSymmetricEulerFluxTask::TASK_NAME = "UpdateUsingSkewSymmetricEulerFluxZ"; +template<> +/*static*/ const int UpdateUsingSkewSymmetricEulerFluxTask::TASK_ID = TID_UpdateUsingSkewSymmetricEulerFluxZ; +template<> +/*static*/ const FieldID UpdateUsingSkewSymmetricEulerFluxTask::FID_nType = FID_nType_z; +template<> +/*static*/ const FieldID UpdateUsingSkewSymmetricEulerFluxTask::FID_m_e = FID_dzet_e; + +template<> +void UpdateUsingSkewSymmetricEulerFluxTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 5); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_MassFracs(regions[0], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[1], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m(regions[2], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[3], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread +#ifdef REALM_USE_OPENMP + double *KGSum = new double[6*(nEq+1)*omp_get_max_threads()]; +#else + double *KGSum = new double[6*(nEq+1)]; +#endif + + // update RHS using Euler fluxes + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { +#ifdef REALM_USE_OPENMP + double *myKGSum = &KGSum[6*(nEq+1)*omp_get_thread_num()]; +#else + double *myKGSum = &KGSum[0]; +#endif + // Launch the loop for the span + updateRHSSpan(myKGSum, + acc_Conserved_t, acc_m, acc_nType, + acc_Conserved, acc_rho, + acc_MassFracs, acc_velocity, acc_pressure, + 0, getSize(r_ModCells), + i-r_ModCells.lo.x, j-r_ModCells.lo.y, 0, + r_ModCells, Fluid_bounds); + } + // Cleanup + delete[] KGSum; +} + // Specielize UpdateUsingDiffusionFlux for the X direction template<> /*static*/ const char * const UpdateUsingDiffusionFluxTask::TASK_NAME = "UpdateUsingDiffusionFluxX"; @@ -826,44 +913,20 @@ void UpdateUsingDiffusionFluxTask::cpu_base_impl( Rect<3> Fluid_bounds = args.Fluid_bounds; // update RHS using Euler and Diffision fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { - double DiffFluxM[nEq]; - double DiffFluxP[nEq]; - - // Compute flux of first minus inter-cell location - { - const Point<3> p = Point<3>{(r_ModCells.lo.x-1 - Fluid_bounds.lo.x + size) % size + Fluid_bounds.lo.x, j, k}; - GetDiffusionFlux(DiffFluxM, acc_nType[p], acc_m_s[p], args.mix, - acc_rho, acc_mu, acc_lam, acc_Di, - acc_temperature, acc_velocity, acc_MolarFracs, - acc_Conserved, acc_vGradY, acc_vGradZ, - p, size, Fluid_bounds); - } - - // Now loop along the x line - for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - const Point<3> p = Point<3>{i,j,k}; - GetDiffusionFlux(DiffFluxP, acc_nType[p], acc_m_s[p], args.mix, - acc_rho, acc_mu, acc_lam, acc_Di, - acc_temperature, acc_velocity, acc_MolarFracs, - acc_Conserved, acc_vGradY, acc_vGradZ, - p, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + 0, j-r_ModCells.lo.y, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); } } @@ -920,44 +983,20 @@ void UpdateUsingDiffusionFluxTask::cpu_base_impl( Rect<3> Fluid_bounds = args.Fluid_bounds; // update RHS using Euler and Diffision fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - double DiffFluxM[nEq]; - double DiffFluxP[nEq]; - - // Compute flux of first minus inter-cell location - { - const Point<3> p = Point<3>{i,(r_ModCells.lo.y-1 - Fluid_bounds.lo.y + size) % size + Fluid_bounds.lo.y, k}; - GetDiffusionFlux(DiffFluxM, acc_nType[p], acc_m_s[p], args.mix, - acc_rho, acc_mu, acc_lam, acc_Di, - acc_temperature, acc_velocity, acc_MolarFracs, - acc_Conserved, acc_vGradX, acc_vGradZ, - p, size, Fluid_bounds); - } - - // Now loop along the y line - for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) { - const Point<3> p = Point<3>{i,j,k}; - GetDiffusionFlux(DiffFluxP, acc_nType[p], acc_m_s[p], args.mix, - acc_rho, acc_mu, acc_lam, acc_Di, - acc_temperature, acc_velocity, acc_MolarFracs, - acc_Conserved, acc_vGradX, acc_vGradZ, - p, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + i-r_ModCells.lo.x, 0, k-r_ModCells.lo.z, + r_ModCells, Fluid_bounds, args.mix); } } @@ -1014,44 +1053,20 @@ void UpdateUsingDiffusionFluxTask::cpu_base_impl( Rect<3> Fluid_bounds = args.Fluid_bounds; // update RHS using Euler and Diffision fluxes - const coord_t size = getSize(Fluid_bounds); // Here we are assuming C layout of the instance #ifdef REALM_USE_OPENMP #pragma omp parallel for collapse(2) #endif for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { - double DiffFluxM[nEq]; - double DiffFluxP[nEq]; - - // Compute flux of first minus inter-cell location - { - const Point<3> p = Point<3>{i,j,(r_ModCells.lo.z-1 - Fluid_bounds.lo.z + size) % size + Fluid_bounds.lo.z}; - GetDiffusionFlux(DiffFluxM, acc_nType[p], acc_m_s[p], args.mix, - acc_rho, acc_mu, acc_lam, acc_Di, - acc_temperature, acc_velocity, acc_MolarFracs, - acc_Conserved, acc_vGradX, acc_vGradY, - p, size, Fluid_bounds); - } - - // Now loop along the x line - for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) { - const Point<3> p = Point<3>{i,j,k}; - GetDiffusionFlux(DiffFluxP, acc_nType[p], acc_m_s[p], args.mix, - acc_rho, acc_mu, acc_lam, acc_Di, - acc_temperature, acc_velocity, acc_MolarFracs, - acc_Conserved, acc_vGradX, acc_vGradY, - p, size, Fluid_bounds); - - // Update time derivative - for (int l=0; l(r_ModCells), + i-r_ModCells.lo.x, j-r_ModCells.lo.y, 0, + r_ModCells, Fluid_bounds, args.mix); } } @@ -1105,14 +1120,73 @@ void UpdateUsingFluxNSCBCInflowMinusSideTask::cpu_base_impl( for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) for (int j = r_BC.lo.y; j <= r_BC.hi.y; j++) { const Point<3> p = Point<3>(i,j,k); - addLODIfluxes(acc_Conserved_t[p].v, + addLODIfluxes(acc_Conserved_t[p], + acc_MassFracs, acc_pressure, + acc_SoS[p], acc_rho[p], acc_temperature[p], + acc_velocity[p], acc_vGrad[p], acc_dudt[p], acc_dTdt[p], + p, acc_nType[p], acc_m_d[p], args.mix); + } +}; + +// Specielize UpdateUsingFluxNSCBCInflowMinusSide for the Y direction +template<> +/*static*/ const char * const UpdateUsingFluxNSCBCInflowMinusSideTask::TASK_NAME = "UpdateUsingFluxNSCBCInflowYNeg"; +template<> +/*static*/ const int UpdateUsingFluxNSCBCInflowMinusSideTask::TASK_ID = TID_UpdateUsingFluxNSCBCInflowYNeg; +template<> +/*static*/ const FieldID UpdateUsingFluxNSCBCInflowMinusSideTask::FID_nType = FID_nType_y; +template<> +/*static*/ const FieldID UpdateUsingFluxNSCBCInflowMinusSideTask::FID_m_d = FID_deta_d; +template<> +/*static*/ const FieldID UpdateUsingFluxNSCBCInflowMinusSideTask::FID_vGrad = FID_velocityGradientY; + + +template<> +void UpdateUsingFluxNSCBCInflowMinusSideTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 2); + assert(futures.size() == 0); + + // Accessors for Input data + const AccessorRO< int, 3> acc_nType (regions[0], FID_nType); + const AccessorRO acc_m_d (regions[0], FID_m_d); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_SoS (regions[0], FID_SoS); + const AccessorRO acc_MassFracs (regions[0], FID_MassFracs); + const AccessorRO acc_pressure (regions[0], FID_pressure); + const AccessorRO acc_temperature(regions[0], FID_temperature); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO< Vec3, 3> acc_vGrad (regions[0], FID_vGrad); + const AccessorRO< Vec3, 3> acc_dudt (regions[0], FID_dudtBoundary); + const AccessorRO acc_dTdt (regions[0], FID_dTdtBoundary); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[1], FID_Conserved_t); + + // Extract BC domain + Rect<3> r_BC = runtime->get_index_space_domain(ctx, + runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); + + const int j = r_BC.lo.y; +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(2) +#endif + for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) + for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { + const Point<3> p = Point<3>(i,j,k); + addLODIfluxes(acc_Conserved_t[p], acc_MassFracs, acc_pressure, acc_SoS[p], acc_rho[p], acc_temperature[p], - acc_velocity[p].v, acc_vGrad[p].v, acc_dudt[p].v, acc_dTdt[p], + acc_velocity[p], acc_vGrad[p], acc_dudt[p], acc_dTdt[p], p, acc_nType[p], acc_m_d[p], args.mix); } }; + // Specielize UpdateUsingFluxNSCBCInflowPlusSide for the Y direction template<> /*static*/ const char * const UpdateUsingFluxNSCBCInflowPlusSideTask::TASK_NAME = "UpdateUsingFluxNSCBCInflowYPos"; @@ -1163,10 +1237,10 @@ void UpdateUsingFluxNSCBCInflowPlusSideTask::cpu_base_impl( for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { const Point<3> p = Point<3>(i,j,k); - addLODIfluxes(acc_Conserved_t[p].v, + addLODIfluxes(acc_Conserved_t[p], acc_MassFracs, acc_pressure, acc_SoS[p], acc_rho[p], acc_temperature[p], - acc_velocity[p].v, acc_vGrad[p].v, acc_dudt[p].v, acc_dTdt[p], + acc_velocity[p], acc_vGrad[p], acc_dudt[p], acc_dTdt[p], p, acc_nType[p], acc_m_d[p], args.mix); } }; @@ -1229,10 +1303,10 @@ void UpdateUsingFluxNSCBCOutflowMinusSideTask::cpu_base_impl( for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { const Point<3> p = Point<3>(i,j,k); - addLODIfluxes(acc_Conserved_t[p].v, + addLODIfluxes(acc_Conserved_t[p], acc_MassFracs, acc_rho, acc_mu, acc_pressure, acc_velocity, acc_vGradN, acc_vGradT1, acc_vGradT2, - acc_SoS[p], acc_temperature[p], acc_Conserved[p].v, + acc_SoS[p], acc_temperature[p], acc_Conserved[p], p, acc_nType[p], acc_m_d[p], MaxMach, args.LengthScale, args.PInf, args.mix); } @@ -1296,10 +1370,10 @@ void UpdateUsingFluxNSCBCOutflowPlusSideTask::cpu_base_impl( for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) for (int j = r_BC.lo.y; j <= r_BC.hi.y; j++) { const Point<3> p = Point<3>(i,j,k); - addLODIfluxes(acc_Conserved_t[p].v, + addLODIfluxes(acc_Conserved_t[p], acc_MassFracs, acc_rho, acc_mu, acc_pressure, acc_velocity, acc_vGradN, acc_vGradT1, acc_vGradT2, - acc_SoS[p], acc_temperature[p], acc_Conserved[p].v, + acc_SoS[p], acc_temperature[p], acc_Conserved[p], p, acc_nType[p], acc_m_d[p], MaxMach, args.LengthScale, args.PInf, args.mix); } @@ -1363,10 +1437,10 @@ void UpdateUsingFluxNSCBCOutflowPlusSideTask::cpu_base_impl( for (int k = r_BC.lo.z; k <= r_BC.hi.z; k++) for (int i = r_BC.lo.x; i <= r_BC.hi.x; i++) { const Point<3> p = Point<3>(i,j,k); - addLODIfluxes(acc_Conserved_t[p].v, + addLODIfluxes(acc_Conserved_t[p], acc_MassFracs, acc_rho, acc_mu, acc_pressure, acc_velocity, acc_vGradN, acc_vGradT1, acc_vGradT2, - acc_SoS[p], acc_temperature[p], acc_Conserved[p].v, + acc_SoS[p], acc_temperature[p], acc_Conserved[p], p, acc_nType[p], acc_m_d[p], MaxMach, args.LengthScale, args.PInf, args.mix); } @@ -1382,11 +1456,20 @@ void register_rhs_tasks() { TaskHelper::register_hybrid_variants>(); TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); TaskHelper::register_hybrid_variants>(); TaskHelper::register_hybrid_variants>(); TaskHelper::register_hybrid_variants>(); + TaskHelper::register_hybrid_variants>(); TaskHelper::register_hybrid_variants>(); @@ -1394,4 +1477,5 @@ void register_rhs_tasks() { TaskHelper::register_hybrid_variants>(); TaskHelper::register_hybrid_variants>(); + }; diff --git a/src/prometeo_rhs.cu b/src/prometeo_rhs.cu index 17eb67f..1bc008f 100644 --- a/src/prometeo_rhs.cu +++ b/src/prometeo_rhs.cu @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -31,143 +31,57 @@ #include "prometeo_rhs.inl" #include "cuda_utils.hpp" -// Load thrust -#include -#include -#include - -// Define a constant memory that will hold the Mixture struct -__device__ __constant__ Mix mix; - -//----------------------------------------------------------------------------- -// COMMON KERNELS -//----------------------------------------------------------------------------- -template -__global__ -void UpdateRHSUsingFlux_kernel(const DeferredBuffer Flux, - const AccessorRO m, - const AccessorRW Conserved_t, - const Rect<3> Divg_bounds, - const Rect<3> Fluid_bounds, - const coord_t size_x, - const coord_t size_y, - const coord_t size_z, - const coord_t size) -{ - int x = blockIdx.x * blockDim.x + threadIdx.x; - int y = blockIdx.y * blockDim.y + threadIdx.y; - int z = blockIdx.z * blockDim.z + threadIdx.z; - - if ((x < size_x) && (y < size_y) && (z < size_z)) { - const Point<3> p = Point<3>(x + Divg_bounds.lo.x, - y + Divg_bounds.lo.y, - z + Divg_bounds.lo.z); - const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, -1); - #pragma unroll - for (int i=0; i -struct is_KGPoint { - is_KGPoint(const AccessorRO< bool, 3> shockSensor_, - const AccessorRO< int, 3> nType_, - const Rect<3> bounds_, - const coord_t size_) : - shockSensor(shockSensor_), - nType(nType_), - bounds(bounds_), - size(size_) {}; - - __device__ - bool operator()(const Point<3> p) { - const Point<3> pM1 = warpPeriodic(bounds, p, size, offM1(nType[p])); - const Point<3> pP1 = warpPeriodic(bounds, p, size, offP1(nType[p])); - return (shockSensor[pM1] && - shockSensor[p ] && - shockSensor[pP1]); - } -private: - const AccessorRO< bool, 3> shockSensor; - const AccessorRO< int, 3> nType; - const Rect<3> bounds; - const coord_t size; -}; - __global__ -void storePoints_kernel(const DeferredBuffer, 1> Points, - const Rect<3> bounds, - const coord_t size_x, - const coord_t size_y, - const coord_t size_z, - const coord_t first) +void UpdateRHSUsingHybridFlux_kernel(const AccessorRW Conserved_t, + const AccessorRO m_e, + const AccessorRO Conserved, + const AccessorRO rho, + const AccessorRO SoS, + const AccessorRO MassFracs, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO pressure, + const AccessorRO temperature, + const AccessorRO< int, 3> nType, + const AccessorRO< bool, 3> shockSensor, + const Rect<3> Flux_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int z = blockIdx.z * blockDim.z + threadIdx.z; - if ((x < size_x) && (y < size_y) && (z < size_z)) - Points[Point<1>(first + x + y*size_x + z*size_x*size_y)] = - Point<3>(x + bounds.lo.x, - y + bounds.lo.y, - z + bounds.lo.z); -} -template -__global__ -void KGFluxReconstruction_kernel(const DeferredBuffer Flux, - const DeferredBuffer, 1> Points, - const AccessorRO Conserved, - const AccessorRO rho, - const AccessorRO MassFracs, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const AccessorRO< int, 3> nType, - const Rect<3> Fluid_bounds, - const coord_t offset, - const coord_t size) -{ - const coord_t tid = blockIdx.x * blockDim.x + threadIdx.x; - if (tid < offset) { - const Point<3> p = Points[tid]; - UpdateUsingEulerFluxUtils::KGFluxReconstruction( - Flux[p].v, - Conserved, rho, MassFracs, - velocity, pressure, - p, nType[p], size, Fluid_bounds); + if (isThreadInCrossPlane(size_x, size_y, size_z)) { + const coord_t size = getSize(Fluid_bounds); + const coord_t span_size = getSize(Flux_bounds); + const coord_t firstIndex = firstIndexInSpan(span_size); + if (firstIndex < span_size) { + const coord_t lastIndex = lastIndexInSpan(span_size); + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread + double KGSum[6*(nEq+1)]; + // Launch the loop for the span + UpdateUsingHybridEulerFluxTask::updateRHSSpan( + KGSum, + Conserved_t, m_e, nType, shockSensor, + Conserved, rho, SoS, + MassFracs, velocity, pressure, temperature, + firstIndex, lastIndex, + x, y, z, + Flux_bounds, Fluid_bounds, mix); + } } } -template -__global__ -void TENOFluxReconstruction_kernel(const DeferredBuffer Flux, - const DeferredBuffer, 1> Points, - const AccessorRO Conserved, - const AccessorRO SoS, - const AccessorRO rho, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const AccessorRO MassFracs, - const AccessorRO temperature, - const AccessorRO< int, 3> nType, - const Rect<3> Fluid_bounds, - const coord_t offset, - const coord_t volume, - const coord_t size) -{ - int tid = blockIdx.x * blockDim.x + threadIdx.x + offset; - if (tid < volume) { - const Point<3> p = Points[tid]; - UpdateUsingEulerFluxUtils::TENOFluxReconstruction(Flux[p].v, - Conserved, SoS, rho, velocity, - pressure, MassFracs, temperature, - p, nType[p], mix, size, Fluid_bounds); - } -} template __host__ @@ -207,103 +121,17 @@ void UpdateUsingHybridEulerFluxTask::gpu_base_impl( Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); Rect<3> Fluid_bounds = args.Fluid_bounds; - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); - - // Store the Flux domain and the linear size of Fluid - Domain FluxDomain = runtime->get_index_space_domain(ctx, args.FluxGhost.get_index_space()); - const coord_t size = getSize(Fluid_bounds); - + // Launch the kernel to update the RHS using the Euler fluxes reconstructed with hybrid scheme const int threads_per_block = 256; - - // Extract lists of points where we are going to deploy the KG or TENO reconstruction - // Points for KG reconstruction are in PointsList[0, offset) - // Points for TENO reconstruction are in PointsList[offset, FluxDomainVolume) - cudaStream_t default_stream; - cudaStreamCreate(&default_stream); - const coord_t FluxDomainVolume = FluxDomain.get_volume(); - DeferredBuffer, 1> PointsList(Rect<1>(0, FluxDomainVolume), Memory::GPU_FB_MEM); - coord_t first = 0; - for (RectInDomainIterator<3> Rit(FluxDomain); Rit(); Rit++) { - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, *Rit); - const dim3 num_blocks_3d = dim3((getSize(*Rit) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(*Rit) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(*Rit) + (TPB_3d.z - 1)) / TPB_3d.z); - storePoints_kernel<<>>(PointsList, (*Rit), - getSize(*Rit), getSize(*Rit), getSize(*Rit), - first); - first += getSize(*Rit)*getSize(*Rit)*getSize(*Rit); - } - assert(first == FluxDomainVolume); - // Partition the PointsList vector based on the shock sensor - thrust::device_ptr> PointsList_vec(PointsList.ptr(Point<1>(0))); - const coord_t offset = thrust::stable_partition(thrust::cuda::par.on(default_stream), - PointsList_vec, PointsList_vec + FluxDomainVolume, - is_KGPoint(acc_shockSensor, acc_nType, Fluid_bounds, size)) - - PointsList_vec; - // Record an event on the KG stream - cudaEvent_t ListDone; - cudaEventCreate(&ListDone); - cudaEventRecord(ListDone, default_stream); - - // Store all diffusion fluxes in a deferred buffer - DeferredBuffer Flux(Memory::GPU_FB_MEM, FluxDomain); - - // Launch the kernel to reconstruct the fluxes using KG (after the node list is built) - cudaStream_t KGstream; - cudaStreamCreateWithFlags(&KGstream, cudaStreamNonBlocking); - cudaStreamWaitEvent(KGstream, ListDone, 0); - if (offset > 0) { - const int num_blocks = (offset + (threads_per_block-1)) / threads_per_block; - KGFluxReconstruction_kernel<<>>( - Flux, PointsList, - acc_Conserved, acc_rho, acc_MassFracs, - acc_velocity, acc_pressure, acc_nType, - Fluid_bounds, offset, size); - } - // Record an event on the KG stream - cudaEvent_t KGend; - cudaEventCreate(&KGend); - cudaEventRecord(KGend, KGstream); - - // Launch the kernel to reconstruct the fluxes using TENO (after the node list is built) - cudaStream_t TENOstream; - cudaStreamCreateWithFlags(&TENOstream, cudaStreamNonBlocking); - cudaStreamWaitEvent(TENOstream, ListDone, 0); - if (FluxDomainVolume - offset > 0) { - const int num_blocks = ((FluxDomainVolume - offset) + (threads_per_block-1)) / threads_per_block; - TENOFluxReconstruction_kernel<<>>( - Flux, PointsList, - acc_Conserved, acc_SoS, acc_rho, - acc_velocity, acc_pressure, acc_MassFracs, acc_temperature, acc_nType, - Fluid_bounds, offset, FluxDomainVolume, size); - } - // Record an event on the TENO stream - cudaEvent_t TENOend; - cudaEventCreate(&TENOend); - cudaEventRecord(TENOend, TENOstream); - - // Ensure that reconstruction kernels are done and cleanup the reconstruction streams - cudaStreamWaitEvent(default_stream, KGend, 0); - cudaStreamWaitEvent(default_stream, TENOend, 0); - cudaEventDestroy(ListDone); - cudaEventDestroy( KGend); - cudaEventDestroy( TENOend); - cudaStreamDestroy( KGstream); - cudaStreamDestroy(TENOstream); - - // Launch the kernel to update the RHS using the fluxes on each point of the FluxDomain - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); - const dim3 num_blocks_3d = dim3((getSize(r_ModCells) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(r_ModCells) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(r_ModCells) + (TPB_3d.z - 1)) / TPB_3d.z); - UpdateRHSUsingFlux_kernel<<>>( - Flux, acc_m_e, acc_Conserved_t, + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_ModCells); + UpdateRHSUsingHybridFlux_kernel<<>>( + acc_Conserved_t, acc_m_e, + acc_Conserved, acc_rho, acc_SoS, + acc_MassFracs, acc_velocity, acc_pressure, acc_temperature, + acc_nType, acc_shockSensor, r_ModCells, Fluid_bounds, - getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells), size); - - // Cleanup default stream - cudaStreamDestroy(default_stream); + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); } // Force the compiler to instanciate these functions @@ -331,7 +159,8 @@ template void UpdateUsingHybridEulerFluxTask::gpu_base_impl( template __global__ -void TENOAFluxReconstruction_kernel(const DeferredBuffer Flux, +void UpdateRHSUsingTENOAFlux_kernel(const AccessorRW Conserved_t, + const AccessorRO m_e, const AccessorRO Conserved, const AccessorRO SoS, const AccessorRO rho, @@ -344,21 +173,26 @@ void TENOAFluxReconstruction_kernel(const DeferredBuffer Flux, const Rect<3> Fluid_bounds, const coord_t size_x, const coord_t size_y, - const coord_t size_z, - const coord_t size) + const coord_t size_z) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int z = blockIdx.z * blockDim.z + threadIdx.z; - if ((x < size_x) && (y < size_y) && (z < size_z)) { - const Point<3> p = Point<3>(x + Flux_bounds.lo.x, - y + Flux_bounds.lo.y, - z + Flux_bounds.lo.z); - UpdateUsingEulerFluxUtils::TENOAFluxReconstruction(Flux[p].v, - Conserved, SoS, rho, velocity, - pressure, MassFracs, temperature, - p, nType[p], mix, size, Fluid_bounds); + if (isThreadInCrossPlane(size_x, size_y, size_z)) { + const coord_t span_size = getSize(Flux_bounds); + const coord_t firstIndex = firstIndexInSpan(span_size); + if (firstIndex < span_size) { + const coord_t lastIndex = lastIndexInSpan(span_size); + // Launch the loop for the span + UpdateUsingTENOAEulerFluxTask::updateRHSSpan( + Conserved_t, m_e, nType, + Conserved, rho, SoS, + MassFracs, velocity, pressure, temperature, + firstIndex, lastIndex, + x, y, z, + Flux_bounds, Fluid_bounds, mix); + } } } @@ -397,101 +231,297 @@ void UpdateUsingTENOAEulerFluxTask::gpu_base_impl( Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); Rect<3> Fluid_bounds = args.Fluid_bounds; - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); + // Launch the kernel to update the RHS using the Euler fluxes reconstructed with TENOA + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_ModCells); + UpdateRHSUsingTENOAFlux_kernel<<>>( + acc_Conserved_t, acc_m_e, + acc_Conserved, acc_SoS, acc_rho, acc_velocity, + acc_pressure, acc_MassFracs, acc_temperature, acc_nType, + r_ModCells, Fluid_bounds, + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); +} + +// Force the compiler to instanciate these functions +template void UpdateUsingTENOAEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void UpdateUsingTENOAEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); - // Store the Flux domain and the linear size of Fluid - Domain FluxDomain = runtime->get_index_space_domain(ctx, args.FluxGhost.get_index_space()); - const coord_t size = getSize(Fluid_bounds); +template void UpdateUsingTENOAEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); - // Store all Euler fluxes in a deferred buffer - DeferredBuffer Flux(Memory::GPU_FB_MEM, FluxDomain); +//----------------------------------------------------------------------------- +// KERNELS FOR UpdateUsingTENOLADEulerFluxTask +//----------------------------------------------------------------------------- - const int threads_per_block = 256; +template +__global__ +void UpdateRHSUsingTENOLADFlux_kernel(const AccessorRW Conserved_t, + const AccessorRO m_e, + const AccessorRO Conserved, + const AccessorRO SoS, + const AccessorRO rho, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO pressure, + const AccessorRO MassFracs, + const AccessorRO temperature, + const AccessorRO< int, 3> nType, + const Rect<3> Flux_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; - // Launch the kernel to compute the fluxes on each point of the FluxDomain - for (RectInDomainIterator<3> Rit(FluxDomain); Rit(); Rit++) { - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, *Rit); - const dim3 num_blocks_3d = dim3((getSize(*Rit) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(*Rit) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(*Rit) + (TPB_3d.z - 1)) / TPB_3d.z); - TENOAFluxReconstruction_kernel<<>>(Flux, - acc_Conserved, acc_SoS, acc_rho, acc_velocity, - acc_pressure, acc_MassFracs, acc_temperature, acc_nType, - (*Rit), Fluid_bounds, - getSize(*Rit), getSize(*Rit), getSize(*Rit), size); + if (isThreadInCrossPlane(size_x, size_y, size_z)) { + const coord_t span_size = getSize(Flux_bounds); + const coord_t firstIndex = firstIndexInSpan(span_size); + if (firstIndex < span_size) { + const coord_t lastIndex = lastIndexInSpan(span_size); + // Launch the loop for the span + UpdateUsingTENOLADEulerFluxTask::updateRHSSpan( + Conserved_t, m_e, nType, + Conserved, rho, SoS, + MassFracs, velocity, pressure, temperature, + firstIndex, lastIndex, + x, y, z, + Flux_bounds, Fluid_bounds, mix); + } } +} + +template +__host__ +void UpdateUsingTENOLADEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 6); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_SoS (regions[0], FID_SoS); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for quantities needed for the Roe averages + const AccessorRO acc_temperature(regions[1], FID_temperature); + const AccessorRO acc_MassFracs (regions[1], FID_MassFracs); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[2], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m_e(regions[3], FID_m_e); - // Launch the kernel to update the RHS using the fluxes on each point of the FluxDomain - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); - const dim3 num_blocks_3d = dim3((getSize(r_ModCells) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(r_ModCells) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(r_ModCells) + (TPB_3d.z - 1)) / TPB_3d.z); - UpdateRHSUsingFlux_kernel<<>>( - Flux, acc_m_e, acc_Conserved_t, + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[4], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Launch the kernel to update the RHS using the Euler fluxes reconstructed with TENOLAD + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_ModCells); + UpdateRHSUsingTENOLADFlux_kernel<<>>( + acc_Conserved_t, acc_m_e, + acc_Conserved, acc_SoS, acc_rho, acc_velocity, + acc_pressure, acc_MassFracs, acc_temperature, acc_nType, r_ModCells, Fluid_bounds, - getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells), size); + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); } // Force the compiler to instanciate these functions -template void UpdateUsingTENOAEulerFluxTask::gpu_base_impl( +template void UpdateUsingTENOLADEulerFluxTask::gpu_base_impl( const Args &args, const std::vector ®ions, const std::vector &futures, Context ctx, Runtime *runtime); -template void UpdateUsingTENOAEulerFluxTask::gpu_base_impl( +template void UpdateUsingTENOLADEulerFluxTask::gpu_base_impl( const Args &args, const std::vector ®ions, const std::vector &futures, Context ctx, Runtime *runtime); -template void UpdateUsingTENOAEulerFluxTask::gpu_base_impl( +template void UpdateUsingTENOLADEulerFluxTask::gpu_base_impl( const Args &args, const std::vector ®ions, const std::vector &futures, Context ctx, Runtime *runtime); //----------------------------------------------------------------------------- -// KERNELS FOR UpdateUsingDiffusionFluxTask +// KERNELS FOR UpdateUsingSkewSymmetricEulerFluxTask //----------------------------------------------------------------------------- template __global__ -void ComputeDiffusionFlux_kernel(const DeferredBuffer Flux, - const AccessorRO< int, 3> nType, - const AccessorRO metric, +void UpdateRHSUsingKGFlux_kernel(const AccessorRW Conserved_t, + const AccessorRO m_e, + const AccessorRO Conserved, const AccessorRO rho, - const AccessorRO mu, - const AccessorRO lam, - const AccessorRO Di, - const AccessorRO temperature, + const AccessorRO MassFracs, const AccessorRO< Vec3, 3> velocity, - const AccessorRO Xi, - const AccessorRO rhoYi, - const AccessorRO< Vec3, 3> vGrad1, - const AccessorRO< Vec3, 3> vGrad2, + const AccessorRO pressure, + const AccessorRO< int, 3> nType, const Rect<3> Flux_bounds, const Rect<3> Fluid_bounds, const coord_t size_x, const coord_t size_y, - const coord_t size_z, - const coord_t size) + const coord_t size_z) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int z = blockIdx.z * blockDim.z + threadIdx.z; - if ((x < size_x) && (y < size_y) && (z < size_z)) { - const Point<3> p = Point<3>(x + Flux_bounds.lo.x, - y + Flux_bounds.lo.y, - z + Flux_bounds.lo.z); - UpdateUsingDiffusionFluxTask::GetDiffusionFlux( - Flux[p].v, nType[p], metric[p], mix, - rho, mu, lam, Di, - temperature, velocity, Xi, - rhoYi, vGrad1, vGrad2, - p, size, Fluid_bounds); + if (isThreadInCrossPlane(size_x, size_y, size_z)) { + const coord_t span_size = getSize(Flux_bounds); + const coord_t firstIndex = firstIndexInSpan(span_size); + if (firstIndex < span_size) { + const coord_t lastIndex = lastIndexInSpan(span_size); + // Allocate a buffer for the summations of the KG scheme of size (3 * (3+1)/2 * (nEq+1)) for each thread + double KGSum[6*(nEq+1)]; + // Launch the loop for the span + UpdateUsingSkewSymmetricEulerFluxTask::updateRHSSpan( + KGSum, + Conserved_t, m_e, nType, + Conserved, rho, + MassFracs, velocity, pressure, + firstIndex, lastIndex, + x, y, z, + Flux_bounds, Fluid_bounds); + } + } +} + +template +__host__ +void UpdateUsingSkewSymmetricEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 5); + assert(futures.size() == 0); + + // Accessors for variables in the Flux stencil + const AccessorRO acc_Conserved(regions[0], FID_Conserved); + const AccessorRO acc_rho (regions[0], FID_rho); + const AccessorRO acc_MassFracs(regions[0], FID_MassFracs); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + const AccessorRO acc_pressure (regions[0], FID_pressure); + + // Accessors for node types + const AccessorRO< int, 3> acc_nType(regions[1], FID_nType); + + // Accessors for metrics + const AccessorRO acc_m_e(regions[2], FID_m_e); + + // Accessors for RHS + const AccessorRW acc_Conserved_t(regions[3], FID_Conserved_t); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + Rect<3> Fluid_bounds = args.Fluid_bounds; + + // Launch the kernel to update the RHS using the Euler fluxes reconstructed with KG + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_ModCells); + UpdateRHSUsingKGFlux_kernel<<>>( + acc_Conserved_t, acc_m_e, + acc_Conserved, acc_rho, acc_MassFracs, + acc_velocity, acc_pressure, acc_nType, + r_ModCells, Fluid_bounds, + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); +} + +// Force the compiler to instanciate these functions +template void UpdateUsingSkewSymmetricEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void UpdateUsingSkewSymmetricEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +template void UpdateUsingSkewSymmetricEulerFluxTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + +//----------------------------------------------------------------------------- +// KERNELS FOR UpdateUsingDiffusionFluxTask +//----------------------------------------------------------------------------- + +template +__global__ +void UpdateRHSUsingDiffusionFlux_kernel(const AccessorRW Conserved_t, + const AccessorRO< int, 3> nType, + const AccessorRO m_s, + const AccessorRO m_d, + const AccessorRO rho, + const AccessorRO mu, + const AccessorRO lam, + const AccessorRO Di, + const AccessorRO temperature, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO Xi, + const AccessorRO rhoYi, + const AccessorRO< Vec3, 3> vGrad1, + const AccessorRO< Vec3, 3> vGrad2, + const Rect<3> Flux_bounds, + const Rect<3> Fluid_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if (isThreadInCrossPlane(size_x, size_y, size_z)) { + const coord_t size = getSize(Fluid_bounds); + const coord_t span_size = getSize(Flux_bounds); + const coord_t firstIndex = firstIndexInSpan(span_size); + if (firstIndex < span_size) { + const coord_t lastIndex = lastIndexInSpan(span_size); + UpdateUsingDiffusionFluxTask::updateRHSSpan( + Conserved_t, m_s, m_d, nType, + rho, mu, lam, Di, + temperature, velocity, Xi, rhoYi, + vGrad1, vGrad2, + firstIndex, lastIndex, + x, y, z, + Flux_bounds, Fluid_bounds, mix); + } } } @@ -532,41 +562,18 @@ void UpdateUsingDiffusionFluxTask::gpu_base_impl( Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); Rect<3> Fluid_bounds = args.Fluid_bounds; - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); - - // Store the Flux domain and the linear size of Fluid - Domain FluxDomain = runtime->get_index_space_domain(ctx, args.FluxGhost.get_index_space()); - const coord_t size = getSize(Fluid_bounds); - - // Store all diffusion fluxes in a deferred buffer - DeferredBuffer Flux(Memory::GPU_FB_MEM, FluxDomain); - - // Launch the kernel to compute the fluxes on each point of the FluxDomain + // Launch the kernel to update the RHS using the diffusion fluxes const int threads_per_block = 256; - for (RectInDomainIterator<3> Rit(FluxDomain); Rit(); Rit++) { - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, *Rit); - const dim3 num_blocks_3d = dim3((getSize(*Rit) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(*Rit) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(*Rit) + (TPB_3d.z - 1)) / TPB_3d.z); - ComputeDiffusionFlux_kernel<<>>( - Flux, acc_nType, acc_m_s, + const dim3 TPB_3d = splitThreadsPerBlockSpan(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = numBlocksSpan(TPB_3d, r_ModCells); + UpdateRHSUsingDiffusionFlux_kernel<<>>( + acc_Conserved_t, + acc_nType, acc_m_s, acc_m_d, acc_rho, acc_mu, acc_lam, acc_Di, acc_temperature, acc_velocity, acc_MolarFracs, acc_Conserved, acc_vGrad1, acc_vGrad2, - (*Rit), Fluid_bounds, - getSize(*Rit), getSize(*Rit), getSize(*Rit), size); - } - - // Launch the kernel to update the RHS using the fluxes on each point of the FluxDomain - const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); - const dim3 num_blocks_3d = dim3((getSize(r_ModCells) + (TPB_3d.x - 1)) / TPB_3d.x, - (getSize(r_ModCells) + (TPB_3d.y - 1)) / TPB_3d.y, - (getSize(r_ModCells) + (TPB_3d.z - 1)) / TPB_3d.z); - UpdateRHSUsingFlux_kernel<<>>( - Flux, acc_m_d, acc_Conserved_t, r_ModCells, Fluid_bounds, - getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells), size); + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); } template void UpdateUsingDiffusionFluxTask::gpu_base_impl( @@ -620,10 +627,10 @@ void UpdateUsingFluxNSCBCInflowMinusSideTask_kernel( y + BC_bounds.lo.y, z + BC_bounds.lo.z); UpdateUsingFluxNSCBCInflowMinusSideTask::addLODIfluxes( - Conserved_t[p].v, + Conserved_t[p], MassFracs, pressure, SoS[p], rho[p], temperature[p], - velocity[p].v, vGrad[p].v, dudt[p].v, dTdt[p], + velocity[p], vGrad[p], dudt[p], dTdt[p], p, nType[p], m_d[p], mix); } @@ -660,9 +667,6 @@ void UpdateUsingFluxNSCBCInflowMinusSideTask::gpu_base_impl( Rect<3> r_BC = runtime->get_index_space_domain(ctx, runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); - // Launch the kernel to update the RHS NSCBC nodes const int threads_per_block = 256; const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_BC); @@ -684,6 +688,12 @@ template void UpdateUsingFluxNSCBCInflowMinusSideTask::gpu_base_impl( const std::vector &futures, Context ctx, Runtime *runtime); +template void UpdateUsingFluxNSCBCInflowMinusSideTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); + //----------------------------------------------------------------------------- // KERNELS FOR UpdateUsingFluxNSCBCInflowPlusSideTask //----------------------------------------------------------------------------- @@ -716,11 +726,11 @@ void UpdateUsingFluxNSCBCInflowPlusSideTask_kernel( const Point<3> p = Point<3>(x + BC_bounds.lo.x, y + BC_bounds.lo.y, z + BC_bounds.lo.z); - UpdateUsingFluxNSCBCInflowMinusSideTask::addLODIfluxes( - Conserved_t[p].v, + UpdateUsingFluxNSCBCInflowPlusSideTask::addLODIfluxes( + Conserved_t[p], MassFracs, pressure, SoS[p], rho[p], temperature[p], - velocity[p].v, vGrad[p].v, dudt[p].v, dTdt[p], + velocity[p], vGrad[p], dudt[p], dTdt[p], p, nType[p], m_d[p], mix); } @@ -757,16 +767,13 @@ void UpdateUsingFluxNSCBCInflowPlusSideTask::gpu_base_impl( Rect<3> r_BC = runtime->get_index_space_domain(ctx, runtime->get_logical_subregion_by_color(args.Fluid_BC, 0).get_index_space()); - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); - // Launch the kernel to update the RHS NSCBC nodes const int threads_per_block = 256; const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_BC); const dim3 num_blocks_3d = dim3((getSize(r_BC) + (TPB_3d.x - 1)) / TPB_3d.x, (getSize(r_BC) + (TPB_3d.y - 1)) / TPB_3d.y, (getSize(r_BC) + (TPB_3d.z - 1)) / TPB_3d.z); - UpdateUsingFluxNSCBCInflowMinusSideTask_kernel<<>>( + UpdateUsingFluxNSCBCInflowPlusSideTask_kernel<<>>( acc_Conserved_t, acc_MassFracs, acc_pressure, acc_SoS, acc_rho, acc_temperature, acc_velocity, acc_vGrad, acc_dudt, acc_dTdt, @@ -819,10 +826,10 @@ void UpdateUsingFluxNSCBCOutflowMinusSideTask_kernel( y + BC_bounds.lo.y, z + BC_bounds.lo.z); UpdateUsingFluxNSCBCOutflowMinusSideTask::addLODIfluxes( - Conserved_t[p].v, + Conserved_t[p], MassFracs, rho, mu, pressure, velocity, vGradN, vGradT1, vGradT2, - SoS[p], temperature[p], Conserved[p].v, + SoS[p], temperature[p], Conserved[p], p, nType[p], m_d[p], MaxMach, LengthScale, PInf, mix); } @@ -857,9 +864,6 @@ void UpdateUsingFluxNSCBCOutflowMinusSideTask::gpu_base_impl( // Accessors for RHS const AccessorRW acc_Conserved_t(regions[1], FID_Conserved_t); - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); - // Wait for the maximum Mach number const double MaxMach = futures[0].get_result(); @@ -927,10 +931,10 @@ void UpdateUsingFluxNSCBCOutflowPlusSideTask_kernel( y + BC_bounds.lo.y, z + BC_bounds.lo.z); UpdateUsingFluxNSCBCOutflowPlusSideTask::addLODIfluxes( - Conserved_t[p].v, + Conserved_t[p], MassFracs, rho, mu, pressure, velocity, vGradN, vGradT1, vGradT2, - SoS[p], temperature[p], Conserved[p].v, + SoS[p], temperature[p], Conserved[p], p, nType[p], m_d[p], MaxMach, LengthScale, PInf, mix); } @@ -965,9 +969,6 @@ void UpdateUsingFluxNSCBCOutflowPlusSideTask::gpu_base_impl( // Accessors for RHS const AccessorRW acc_Conserved_t(regions[1], FID_Conserved_t); - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); - // Wait for the maximum Mach number const double MaxMach = futures[0].get_result(); diff --git a/src/prometeo_rhs.hpp b/src/prometeo_rhs.hpp index 6f27e0b..de54683 100644 --- a/src/prometeo_rhs.hpp +++ b/src/prometeo_rhs.hpp @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -41,21 +41,13 @@ using namespace Legion; //----------------------------------------------------------------------------- #include "math_utils.hpp" +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" #include "prometeo_types.h" -#include "task_helper.h" #include "prometeo_rhs.h" //----------------------------------------------------------------------------- -// LOAD THE EQUATION OF STATE FUNCTIONS -//----------------------------------------------------------------------------- -#define QUOTEME(M) #M -#define INCLUDE_FILE(M) QUOTEME(M.hpp) -#include INCLUDE_FILE( EOS ) -#undef QUOTEME -#undef INCLUDE_FILE - -//----------------------------------------------------------------------------- -// TASK THAT UPDATES THE RHS USING THE EULER FLUXES +// TASKS THAT UPDATE THE RHS USING THE EULER FLUXES //----------------------------------------------------------------------------- template @@ -68,114 +60,106 @@ class UpdateUsingEulerFluxUtils { double H; double a2; double rho; - double velocity[3]; - double Yi[nSpec]; + Vec3 velocity; + VecNSp Yi; double dpde; - double dpdrhoi[nSpec]; + VecNSp dpdrhoi; }; // Computes KG summations __CUDA_H__ static inline void ComputeKGSums(double * Sums, - const AccessorRO Conserved, - const AccessorRO rho, - const AccessorRO MassFracs, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const Point<3> p, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const Point<3> &p, const int nType, const coord_t dsize, - const Rect<3> bounds); + const Rect<3> &bounds); -public: // Computes KG reconstructions __CUDA_H__ - static inline void KGFluxReconstruction(double * Flux, + static inline void KGFluxReconstruction(VecNEq &Flux, const double * Sums, - const AccessorRO Conserved, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const Point<3> p, + const AccessorRO &Conserved, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const Point<3> &p, const int nType, const coord_t dsize, - const Rect<3> bounds); + const Rect<3> &bounds); // Computes KG reconstructions __CUDA_H__ - static inline void KGFluxReconstruction(double * Flux, - const AccessorRO Conserved, - const AccessorRO rho, - const AccessorRO MassFracs, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const Point<3> p, + static inline void KGFluxReconstruction(VecNEq &Flux, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const Point<3> &p, const int nType, const coord_t dsize, - const Rect<3> bounds); + const Rect<3> &bounds); -protected: // Computes Roe averages across the Rieman problem __CUDA_H__ - static inline const RoeAveragesStruct ComputeRoeAverages(const Mix &mix, - const double *ConservedL, const double *ConservedR, - const double *YiL, const double *YiR, + static inline void ComputeRoeAverages( + RoeAveragesStruct &avgs, const Mix &mix, + const VecNEq &ConservedL, const VecNEq &ConservedR, + const VecNSp &YiL, const VecNSp &YiR, const double TL, const double TR, const double pressureL, const double pressureR, - const double *velocityL, const double *velocityR, + const Vec3 &velocityL, const Vec3 &velocityR, const double rhoL, const double rhoR); __CUDA_H__ - static inline void computeLeftEigenvectors( double *L, const RoeAveragesStruct &avgs); + static inline void computeLeftEigenvectors( MyMatrix &L, const RoeAveragesStruct &avgs); + __CUDA_H__ + static inline void computeRightEigenvectors(MyMatrix &K, const RoeAveragesStruct &avgs); + + // Projects the state vector q in the characteristic space from the physiscal space + __CUDA_H__ + static inline void projectToCharacteristicSpace(VecNEq &r, const VecNEq &q, const RoeAveragesStruct &avgs); + + // Projects the state vector q from the characteristic space to the physiscal space __CUDA_H__ - static inline void computeRightEigenvectors(double *K, const RoeAveragesStruct &avgs); + static inline void projectFromCharacteristicSpace(VecNEq &r, const VecNEq &q, const RoeAveragesStruct &avgs); + // Performs the flux splitting __CUDA_H__ - static inline void getPlusMinusFlux(double *FluxP, double *FluxM, - const double *L, - const double *Conserved, + static inline void getPlusMinusFlux(VecNEq &FluxP, VecNEq &FluxM, + const RoeAveragesStruct &avgs, + const VecNEq &Conserved, const double velocity, const double pressure, const double Lam1, const double Lam, const double LamN); -public: // Performs TENO reconstruction + template __CUDA_H__ - static inline void TENOFluxReconstruction(double *Flux, - const AccessorRO Conserved, - const AccessorRO SoS, - const AccessorRO rho, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const AccessorRO MassFracs, - const AccessorRO temperature, - const Point<3> p, - const int nType, - const Mix &mix, - const coord_t dsize, - const Rect<3> bounds); - - // Performs TENOA reconstruction - __CUDA_H__ - static inline void TENOAFluxReconstruction(double *Flux, - const AccessorRO Conserved, - const AccessorRO SoS, - const AccessorRO rho, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const AccessorRO MassFracs, - const AccessorRO temperature, - const Point<3> p, + static inline void FluxReconstruction(VecNEq &Flux, + const AccessorRO &Conserved, + const AccessorRO &SoS, + const AccessorRO &rho, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &MassFracs, + const AccessorRO &temperature, + const Point<3> &p, const int nType, const Mix &mix, const coord_t dsize, - const Rect<3> bounds); + const Rect<3> &bounds); }; template -class UpdateUsingHybridEulerFluxTask: public UpdateUsingEulerFluxUtils { +class UpdateUsingHybridEulerFluxTask : private UpdateUsingEulerFluxUtils { public: struct Args { uint64_t arg_mask[1]; @@ -205,6 +189,91 @@ class UpdateUsingHybridEulerFluxTask: public UpdateUsingEulerFluxUtils { static const FieldID FID_nType; static const FieldID FID_m_e; static const FieldID FID_shockSensor; +public: + // Direction dependent functions + __CUDA_H__ + static inline void updateRHSSpan(double *KGSum, + const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO< bool, 3> &shockSensor, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &SoS, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &temperature, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix); +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +template +class UpdateUsingTENOAEulerFluxTask: private UpdateUsingEulerFluxUtils { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion EulerGhost; + LogicalRegion DiffGhost; + LogicalRegion FluxGhost; + LogicalRegion Fluid; + LogicalRegion ModCells; + Rect<3> Fluid_bounds; + Mix mix; + FieldID EulerGhost_fields [FID_last - 101]; + FieldID DiffGhost_fields [FID_last - 101]; + FieldID FluxGhost_fields [FID_last - 101]; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +private: + // Direction dependent quantities + static const FieldID FID_nType; + static const FieldID FID_m_e; +public: + // Direction dependent functions + __CUDA_H__ + static inline void updateRHSSpan(const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &SoS, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &temperature, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix); public: static void cpu_base_impl(const Args &args, const std::vector ®ions, @@ -219,7 +288,7 @@ class UpdateUsingHybridEulerFluxTask: public UpdateUsingEulerFluxUtils { }; template -class UpdateUsingTENOAEulerFluxTask: public UpdateUsingEulerFluxUtils { +class UpdateUsingTENOLADEulerFluxTask: private UpdateUsingEulerFluxUtils { public: struct Args { uint64_t arg_mask[1]; @@ -246,6 +315,85 @@ class UpdateUsingTENOAEulerFluxTask: public UpdateUsingEulerFluxUtils { // Direction dependent quantities static const FieldID FID_nType; static const FieldID FID_m_e; +public: + // Direction dependent functions + __CUDA_H__ + static inline void updateRHSSpan(const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &SoS, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &temperature, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix); +public: + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +template +class UpdateUsingSkewSymmetricEulerFluxTask : private UpdateUsingEulerFluxUtils { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion EulerGhost; + LogicalRegion FluxGhost; + LogicalRegion Fluid; + LogicalRegion ModCells; + Rect<3> Fluid_bounds; + Mix mix; + FieldID EulerGhost_fields [FID_last - 101]; + FieldID FluxGhost_fields [FID_last - 101]; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; +private: + // Direction dependent quantities + static const FieldID FID_nType; + static const FieldID FID_m_e; +public: + // Direction dependent functions + __CUDA_H__ + static inline void updateRHSSpan(double *KGSum, + const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds); public: static void cpu_base_impl(const Args &args, const std::vector ®ions, @@ -292,30 +440,53 @@ class UpdateUsingDiffusionFluxTask { static const FieldID FID_nType; static const FieldID FID_m_s; static const FieldID FID_m_d; -public: +private: __CUDA_H__ - static void GetDiffusionFlux(double *Flux, const int nType, const double m_s, const Mix &mix, - const AccessorRO rho, - const AccessorRO mu, - const AccessorRO lam, - const AccessorRO Di, - const AccessorRO temperature, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO Xi, - const AccessorRO rhoYi, - const AccessorRO< Vec3, 3> vGrad1, - const AccessorRO< Vec3, 3> vGrad2, - const Point<3> p, + static void GetDiffusionFlux(VecNEq &Flux, const int nType, const double m_s, const Mix &mix, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &temperature, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &Xi, + const AccessorRO &rhoYi, + const AccessorRO< Vec3, 3> &vGrad1, + const AccessorRO< Vec3, 3> &vGrad2, + const Point<3> &p, const coord_t size, - const Rect<3> bounds); -private: + const Rect<3> &bounds); __CUDA_H__ - static void GetSigma(double *sigma, const int nType, const double m_s, - const AccessorRO mu, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGrad1, - const AccessorRO< Vec3, 3> vGrad2, - const Point<3> p, const Point<3> pp1); + static Vec3 GetSigma(const int nType, const double m_s, + const AccessorRO &mu, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGrad1, + const AccessorRO< Vec3, 3> &vGrad2, + const Point<3> &p, const Point<3> &pp1); +public: + __CUDA_H__ + static void updateRHSSpan(const AccessorRW &Conserved_t, + const AccessorRO &m_s, + const AccessorRO &m_d, + const AccessorRO< int, 3> &nType, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &temperature, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &Xi, + const AccessorRO &rhoYi, + const AccessorRO< Vec3, 3> &vGrad1, + const AccessorRO< Vec3, 3> &vGrad2, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix); public: static void cpu_base_impl(const Args &args, @@ -357,20 +528,20 @@ class UpdateUsingFluxNSCBCInflowMinusSideTask { static const FieldID FID_vGrad; // Direction dependent functions __CUDA_H__ - static inline void addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO pressure, - const double SoS, - const double rho, - const double T, - const double *velocity, - const double *vGrad, - const double *dudt, - const double dTdt, - const Point<3> p, - const int nType, - const double m, - const Mix &mix); + static inline void addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &pressure, + const double SoS, + const double rho, + const double T, + const Vec3 &velocity, + const Vec3 &vGrad, + const Vec3 &dudt, + const double dTdt, + const Point<3> &p, + const int nType, + const double m, + const Mix &mix); public: static void cpu_base_impl(const Args &args, @@ -408,20 +579,20 @@ class UpdateUsingFluxNSCBCInflowPlusSideTask { static const FieldID FID_vGrad; // Direction dependent functions __CUDA_H__ - static inline void addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO pressure, - const double SoS, - const double rho, - const double T, - const double *velocity, - const double *vGrad, - const double *dudt, - const double dTdt, - const Point<3> p, - const int nType, - const double m, - const Mix &mix); + static inline void addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &pressure, + const double SoS, + const double rho, + const double T, + const Vec3 &velocity, + const Vec3 &vGrad, + const Vec3 &dudt, + const double dTdt, + const Point<3> &p, + const int nType, + const double m, + const Mix &mix); public: static void cpu_base_impl(const Args &args, @@ -468,25 +639,25 @@ class UpdateUsingFluxNSCBCOutflowMinusSideTask { static const FieldID FID_vGradT2; // Direction dependent functions __CUDA_H__ - static inline void addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO rho, - const AccessorRO mu, - const AccessorRO pressure, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGradN, - const AccessorRO< Vec3, 3> vGradT1, - const AccessorRO< Vec3, 3> vGradT2, - const double SoS, - const double T, - const double *Conserved, - const Point<3> p, - const int nType, - const double m, - const double MaxMach, - const double LengthScale, - const double PInf, - const Mix &mix); + static inline void addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &pressure, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGradN, + const AccessorRO< Vec3, 3> &vGradT1, + const AccessorRO< Vec3, 3> &vGradT2, + const double SoS, + const double T, + const VecNEq &Conserved, + const Point<3> &p, + const int nType, + const double m, + const double MaxMach, + const double LengthScale, + const double PInf, + const Mix &mix); public: static void cpu_base_impl(const Args &args, const std::vector ®ions, @@ -528,25 +699,25 @@ class UpdateUsingFluxNSCBCOutflowPlusSideTask { static const FieldID FID_vGradT2; // Direction dependent functions __CUDA_H__ - static inline void addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO rho, - const AccessorRO mu, - const AccessorRO pressure, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGradN, - const AccessorRO< Vec3, 3> vGradT1, - const AccessorRO< Vec3, 3> vGradT2, - const double SoS, - const double T, - const double *Conserved, - const Point<3> p, - const int nType, - const double m, - const double MaxMach, - const double LengthScale, - const double PInf, - const Mix &mix); + static inline void addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &pressure, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGradN, + const AccessorRO< Vec3, 3> &vGradT1, + const AccessorRO< Vec3, 3> &vGradT2, + const double SoS, + const double T, + const VecNEq &Conserved, + const Point<3> &p, + const int nType, + const double m, + const double MaxMach, + const double LengthScale, + const double PInf, + const Mix &mix); public: static void cpu_base_impl(const Args &args, const std::vector ®ions, @@ -560,5 +731,4 @@ class UpdateUsingFluxNSCBCOutflowPlusSideTask { #endif }; - #endif // __PROMETEO_RHS_HPP__ diff --git a/src/prometeo_rhs.inl b/src/prometeo_rhs.inl index 8f28fbc..5dbfac6 100644 --- a/src/prometeo_rhs.inl +++ b/src/prometeo_rhs.inl @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -40,21 +40,18 @@ using std::min; template __CUDA_H__ void UpdateUsingEulerFluxUtils::ComputeKGSums(double * Sums, - const AccessorRO Conserved, - const AccessorRO rho, - const AccessorRO MassFracs, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const Point<3> p, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const Point<3> &p, const int nType, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; + // Index of normal direction + constexpr int iN = normalIndex(dir); const double H = (Conserved[p][irE] + pressure[p])/rho[p]; @@ -66,8 +63,10 @@ void UpdateUsingEulerFluxUtils::ComputeKGSums(double * Sums, // compute the summations const double rhom = rho[p] + rho[pp]; const double vm = -(velocity[p][iN] + velocity[pp][iN]); + __UNROLL__ for (int i=0; i::ComputeKGSums(double * Sums, template __CUDA_H__ -void UpdateUsingEulerFluxUtils::KGFluxReconstruction(double *Flux, +void UpdateUsingEulerFluxUtils::KGFluxReconstruction(VecNEq &Flux, const double *Sums, - const AccessorRO Conserved, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const Point<3> p, + const AccessorRO &Conserved, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const Point<3> &p, const int nType, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; + // Index of normal direction + constexpr int iN = normalIndex(dir); if (nType == L_S_node) { // This is a staggered node + __UNROLL__ for (int i=0; i::KGFluxReconstruction(double *Flux, else if (nType == Rm1_S_node) { // This is a staggered node const Point<3> pp = warpPeriodic(bounds, p, dsize, offP1(nType)); + __UNROLL__ for (int i=0; i::KGFluxReconstruction(double *Flux, double f[nEq+1]; double acc[nEq+1]; const double * Coeff = KennedyCoeff[nType]; + __UNROLL__ for (int i=0; i::KGFluxReconstruction(double *Flux, template __CUDA_H__ -void UpdateUsingEulerFluxUtils::KGFluxReconstruction(double * Flux, - const AccessorRO Conserved, - const AccessorRO rho, - const AccessorRO MassFracs, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const Point<3> p, +void UpdateUsingEulerFluxUtils::KGFluxReconstruction(VecNEq &Flux, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const Point<3> &p, const int nType, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; + // Index of normal direction + constexpr int iN = normalIndex(dir); // Compute points of the stencil const Point<3> pM2 = warpPeriodic(bounds, p, dsize, offM2(nType)); @@ -198,26 +197,27 @@ void UpdateUsingEulerFluxUtils::KGFluxReconstruction(double * Flux, template __CUDA_H__ -const typename UpdateUsingEulerFluxUtils::RoeAveragesStruct UpdateUsingEulerFluxUtils::ComputeRoeAverages( - const Mix &mix, - const double *ConservedL, const double *ConservedR, - const double *YiL, const double *YiR, +void UpdateUsingEulerFluxUtils::ComputeRoeAverages( + RoeAveragesStruct &avgs, const Mix &mix, + const VecNEq &ConservedL, const VecNEq &ConservedR, + const VecNSp &YiL, const VecNSp &YiR, const double TL, const double TR, const double pressureL, const double pressureR, - const double *velocityL, const double *velocityR, + const Vec3 &velocityL, const Vec3 &velocityR, const double rhoL, const double rhoR) { + // Compute quantities on the left (L) and right (R) states - const double MixWL = GetMolarWeightFromYi(YiL, mix); - const double MixWR = GetMolarWeightFromYi(YiR, mix); + const double MixWL = mix.GetMolarWeightFromYi(YiL); + const double MixWR = mix.GetMolarWeightFromYi(YiR); - const double gammaL = GetGamma(TL, MixWL, YiL, mix); - const double gammaR = GetGamma(TR, MixWR, YiR, mix); + const double gammaL = mix.GetGamma(TL, MixWL, YiL); + const double gammaR = mix.GetGamma(TR, MixWR, YiR); - /*const*/ double dpdrhoiL[nSpec]; Getdpdrhoi(dpdrhoiL, gammaL, TL, YiL, mix); - /*const*/ double dpdrhoiR[nSpec]; Getdpdrhoi(dpdrhoiR, gammaR, TR, YiR, mix); + /*const*/ VecNSp dpdrhoiL; mix.Getdpdrhoi(dpdrhoiL, gammaL, TL, YiL); + /*const*/ VecNSp dpdrhoiR; mix.Getdpdrhoi(dpdrhoiR, gammaR, TR, YiR); - const double dpdeL = Getdpde(rhoL, gammaL, mix); - const double dpdeR = Getdpde(rhoR, gammaR, mix); + const double dpdeL = mix.Getdpde(rhoL, gammaL); + const double dpdeR = mix.Getdpde(rhoR, gammaR); const double TotalEnergyL = ConservedL[irE]/rhoL; const double TotalEnergyR = ConservedR[irE]/rhoR; @@ -226,8 +226,6 @@ const typename UpdateUsingEulerFluxUtils::RoeAveragesStruct UpdateUsingEule const double TotalEnthalpyR = TotalEnergyR + pressureR/rhoR; // Compute Roe averaged state - RoeAveragesStruct avgs; - const double RoeFactorL = sqrt(rhoL)/(sqrt(rhoL) + sqrt(rhoR)); const double RoeFactorR = sqrt(rhoR)/(sqrt(rhoL) + sqrt(rhoR)); @@ -253,9 +251,9 @@ const typename UpdateUsingEulerFluxUtils::RoeAveragesStruct UpdateUsingEule // correct the pressure derivatives in order to satisfy the pressure jump condition // using the procedure in Shuen, Liou and Leer (1990) const double dp = pressureR - pressureL; - const double de = TotalEnergyR - 0.5*dot(velocityR, velocityR) - -(TotalEnergyL - 0.5*dot(velocityL, velocityL)); - double drhoi[nSpec]; + const double de = TotalEnergyR - 0.5*velocityR.mod2() + -(TotalEnergyL - 0.5*velocityL.mod2()); + VecNSp drhoi; __UNROLL__ for (int i=0; i::RoeAveragesStruct UpdateUsingEule for (int i=0; i __CUDA_H__ -void UpdateUsingEulerFluxUtils::computeLeftEigenvectors(double *L, const RoeAveragesStruct &avgs) { +inline void UpdateUsingEulerFluxUtils::computeLeftEigenvectors(MyMatrix &L, const RoeAveragesStruct &avgs) { - // TODO: implement some sort of static_if - int iN; int iT1; int iT2; - if (dir == Xdir) { iN = 0; iT1 = 1; iT2 = 2; } - else if (dir == Ydir) { iN = 1; iT1 = 0; iT2 = 2; } - else if (dir == Zdir) { iN = 2; iT1 = 0; iT2 = 1; } + constexpr int iN = normalIndex(dir); + constexpr int iT1 = tangential1Index(dir); + constexpr int iT2 = tangential2Index(dir); // initialize L - __UNROLL__ - for (int i = 0; i __CUDA_H__ -void UpdateUsingEulerFluxUtils::computeRightEigenvectors(double *K, const RoeAveragesStruct &avgs) { +inline void UpdateUsingEulerFluxUtils::computeRightEigenvectors(MyMatrix &K, const RoeAveragesStruct &avgs) { - // TODO: implement some sort of static_if - int iN; int iT1; int iT2; - if (dir == Xdir) { iN = 0; iT1 = 1; iT2 = 2; } - else if (dir == Ydir) { iN = 1; iT1 = 0; iT2 = 2; } - else if (dir == Zdir) { iN = 2; iT1 = 0; iT2 = 1; } + constexpr int iN = normalIndex(dir); + constexpr int iT1 = tangential1Index(dir); + constexpr int iT2 = tangential2Index(dir); // initialize K - __UNROLL__ - for (int i = 0; i +__CUDA_H__ +inline void UpdateUsingEulerFluxUtils::projectToCharacteristicSpace(VecNEq &r, const VecNEq &q, const RoeAveragesStruct &avgs) { + + constexpr int iN = normalIndex(dir); + constexpr int iT1 = tangential1Index(dir); + constexpr int iT2 = tangential2Index(dir); + + // Initialize r + r.init(0); + + // Compute constants + const double iaRoe = 1.0/avgs.a; + const double iaRoe2 = 1.0/avgs.a2; + const double Coeff = (avgs.E - avgs.velocity.mod2())*avgs.dpde/avgs.rho; + VecNSp b; + __UNROLL__ + for (int i=0; i +__CUDA_H__ +inline void UpdateUsingEulerFluxUtils::projectFromCharacteristicSpace(VecNEq &r, const VecNEq &q, const RoeAveragesStruct &avgs) { + + constexpr int iN = normalIndex(dir); + constexpr int iT1 = tangential1Index(dir); + constexpr int iT2 = tangential2Index(dir); + + // initialize r + r.init(0); + + // First nSpec rows + __UNROLL__ + for (int i = 0; i __CUDA_H__ -void UpdateUsingEulerFluxUtils::getPlusMinusFlux(double *FluxP, double *FluxM, - const double *L, - const double *Conserved, +void UpdateUsingEulerFluxUtils::getPlusMinusFlux(VecNEq &FluxP, VecNEq &FluxM, + const RoeAveragesStruct &avgs, + const VecNEq &Conserved, const double velocity, const double pressure, const double Lam1, const double Lam, const double LamN) { - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; + constexpr int iN = normalIndex(dir); // Compute the Euler fluxes - double Flux[nEq]; + VecNEq Flux; __UNROLL__ for (int i=0; i::getPlusMinusFlux(double *FluxP, double *Flu Flux[irE ] += pressure*velocity; // Project in the characteristic space - double Q[nEq]; MatMul(L, Conserved, Q); - double F[nEq]; MatMul(L, Flux, F); + VecNEq Q; projectToCharacteristicSpace(Q, Conserved, avgs); + VecNEq F; projectToCharacteristicSpace(F, Flux, avgs); // Plus fluxes FluxP[ 0] = F[ 0] + Lam1*Q[ 0]; @@ -496,26 +624,23 @@ void UpdateUsingEulerFluxUtils::getPlusMinusFlux(double *FluxP, double *Flu } template +template __CUDA_H__ -void UpdateUsingEulerFluxUtils::TENOFluxReconstruction(double *Flux, - const AccessorRO Conserved, - const AccessorRO SoS, - const AccessorRO rho, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const AccessorRO MassFracs, - const AccessorRO temperature, - const Point<3> p, +void UpdateUsingEulerFluxUtils::FluxReconstruction(VecNEq &Flux, + const AccessorRO &Conserved, + const AccessorRO &SoS, + const AccessorRO &rho, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &MassFracs, + const AccessorRO &temperature, + const Point<3> &p, const int nType, const Mix &mix, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; + constexpr int iN = normalIndex(dir); // Compute points of the stencil const Point<3> pM2 = warpPeriodic(bounds, p, dsize, offM2(nType)); @@ -550,147 +675,338 @@ void UpdateUsingEulerFluxUtils::TENOFluxReconstruction(double *Flux, fabs(velocity[pP3][iN] + SoS[pP3])); // Compute the RoeAverages - const RoeAveragesStruct RoeAvgs = ComputeRoeAverages(mix, - Conserved[p].v, Conserved[pP1].v, - MassFracs[p].v, MassFracs[pP1].v, - temperature[p] , temperature[pP1], - pressure[p] , pressure[pP1], - velocity[p].v, velocity[pP1].v, - rho[p] , rho[pP1]); - - // Compute left eigenvector matrix - double K[nEq*nEq]; computeLeftEigenvectors(K, RoeAvgs); + RoeAveragesStruct RoeAvgs; + ComputeRoeAverages(RoeAvgs, mix, + Conserved[p], Conserved[pP1], + MassFracs[p], MassFracs[pP1], + temperature[p], temperature[pP1], + pressure[p], pressure[pP1], + velocity[p], velocity[pP1], + rho[p], rho[pP1]); // Compute +/- fluxes - double FluxPM2[nEq]; double FluxMM2[nEq]; getPlusMinusFlux(FluxPM2, FluxMM2, K, Conserved[pM2].v, velocity[pM2][iN], pressure[pM2], Lam1, Lam, LamN); - double FluxPM1[nEq]; double FluxMM1[nEq]; getPlusMinusFlux(FluxPM1, FluxMM1, K, Conserved[pM1].v, velocity[pM1][iN], pressure[pM1], Lam1, Lam, LamN); - double FluxP [nEq]; double FluxM [nEq]; getPlusMinusFlux(FluxP , FluxM , K, Conserved[p ].v, velocity[p ][iN], pressure[p ], Lam1, Lam, LamN); - double FluxPP1[nEq]; double FluxMP1[nEq]; getPlusMinusFlux(FluxPP1, FluxMP1, K, Conserved[pP1].v, velocity[pP1][iN], pressure[pP1], Lam1, Lam, LamN); - double FluxPP2[nEq]; double FluxMP2[nEq]; getPlusMinusFlux(FluxPP2, FluxMP2, K, Conserved[pP2].v, velocity[pP2][iN], pressure[pP2], Lam1, Lam, LamN); - double FluxPP3[nEq]; double FluxMP3[nEq]; getPlusMinusFlux(FluxPP3, FluxMP3, K, Conserved[pP3].v, velocity[pP3][iN], pressure[pP3], Lam1, Lam, LamN); + VecNEq FluxPM2; VecNEq FluxMM2; getPlusMinusFlux(FluxPM2, FluxMM2, RoeAvgs, Conserved[pM2], velocity[pM2][iN], pressure[pM2], Lam1, Lam, LamN); + VecNEq FluxPM1; VecNEq FluxMM1; getPlusMinusFlux(FluxPM1, FluxMM1, RoeAvgs, Conserved[pM1], velocity[pM1][iN], pressure[pM1], Lam1, Lam, LamN); + VecNEq FluxP ; VecNEq FluxM ; getPlusMinusFlux(FluxP , FluxM , RoeAvgs, Conserved[p ], velocity[p ][iN], pressure[p ], Lam1, Lam, LamN); + VecNEq FluxPP1; VecNEq FluxMP1; getPlusMinusFlux(FluxPP1, FluxMP1, RoeAvgs, Conserved[pP1], velocity[pP1][iN], pressure[pP1], Lam1, Lam, LamN); + VecNEq FluxPP2; VecNEq FluxMP2; getPlusMinusFlux(FluxPP2, FluxMP2, RoeAvgs, Conserved[pP2], velocity[pP2][iN], pressure[pP2], Lam1, Lam, LamN); + VecNEq FluxPP3; VecNEq FluxMP3; getPlusMinusFlux(FluxPP3, FluxMP3, RoeAvgs, Conserved[pP3], velocity[pP3][iN], pressure[pP3], Lam1, Lam, LamN); // Reconstruct Fluxes - double FPlus[nEq]; - __UNROLL__ + VecNEq FPlus; for (int i=0; i(K, F, Flux); + projectFromCharacteristicSpace(Flux, F, RoeAvgs); } +//----------------------------------------------------------------------------- +// INLINE FUNCTIONS FOR UpdateUsingHybridEulerFluxTask +//----------------------------------------------------------------------------- + template __CUDA_H__ -void UpdateUsingEulerFluxUtils::TENOAFluxReconstruction(double *Flux, - const AccessorRO Conserved, - const AccessorRO SoS, - const AccessorRO rho, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO pressure, - const AccessorRO MassFracs, - const AccessorRO temperature, - const Point<3> p, - const int nType, - const Mix &mix, - const coord_t dsize, - const Rect<3> bounds) { - - // TODO: implement some sort of static_if - int iN; - if (dir == Xdir) iN = 0; - else if (dir == Ydir) iN = 1; - else if (dir == Zdir) iN = 2; - - // Compute points of the stencil - const Point<3> pM2 = warpPeriodic(bounds, p, dsize, offM2(nType)); - const Point<3> pM1 = warpPeriodic(bounds, p, dsize, offM1(nType)); - const Point<3> pP1 = warpPeriodic(bounds, p, dsize, offP1(nType)); - const Point<3> pP2 = warpPeriodic(bounds, p, dsize, offP2(nType)); - const Point<3> pP3 = warpPeriodic(bounds, p, dsize, offP3(nType)); - - // Compute maximum eigenvalues - const double Lam1 = max(max(max(max(max( - fabs(velocity[pM2][iN] - SoS[pM2]), - fabs(velocity[pM1][iN] - SoS[pM1])), - fabs(velocity[p ][iN] - SoS[p ])), - fabs(velocity[pP1][iN] - SoS[pP1])), - fabs(velocity[pP2][iN] - SoS[pP2])), - fabs(velocity[pP3][iN] - SoS[pP3])); - - const double Lam = max(max(max(max(max( - fabs(velocity[pM2][iN]), - fabs(velocity[pM1][iN])), - fabs(velocity[p ][iN])), - fabs(velocity[pP1][iN])), - fabs(velocity[pP2][iN])), - fabs(velocity[pP3][iN])); - - const double LamN = max(max(max(max(max( - fabs(velocity[pM2][iN] + SoS[pM2]), - fabs(velocity[pM1][iN] + SoS[pM1])), - fabs(velocity[p ][iN] + SoS[p ])), - fabs(velocity[pP1][iN] + SoS[pP1])), - fabs(velocity[pP2][iN] + SoS[pP2])), - fabs(velocity[pP3][iN] + SoS[pP3])); - - // Compute the RoeAverages - const RoeAveragesStruct RoeAvgs = ComputeRoeAverages(mix, - Conserved[p].v, Conserved[pP1].v, - MassFracs[p].v, MassFracs[pP1].v, - temperature[p] , temperature[pP1], - pressure[p] , pressure[pP1], - velocity[p].v, velocity[pP1].v, - rho[p] , rho[pP1]); - - // Compute left eigenvector matrix - double K[nEq*nEq]; computeLeftEigenvectors(K, RoeAvgs); +void UpdateUsingHybridEulerFluxTask::updateRHSSpan( + double *KGSum, + const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO< bool, 3> &shockSensor, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &SoS, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &temperature, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix) { + + VecNEq FluxM; VecNEq FluxP; + const coord_t size = getSize(Fluid_bounds); + // Compute flux of first minus inter-cell location + { + const Point<3> p0 = GetPointInSpan(Flux_bounds, firstIndex, x, y, z); + const Point<3> p = warpPeriodic(Fluid_bounds, p0, size, offM1(nType[p0])); + const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(nType[p])); + const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + const Point<3> pM2 = warpPeriodic(Fluid_bounds, p, size, offM2(nType[p])); + // Compute KG summations (... the order is fundamental) + UpdateUsingEulerFluxUtils::ComputeKGSums(&KGSum[3*(nEq+1)], + Conserved, rho, MassFracs, + velocity, pressure, + pM2, nType[p], size, Fluid_bounds); + UpdateUsingEulerFluxUtils::ComputeKGSums(&KGSum[2*(nEq+1)], + Conserved, rho, MassFracs, + velocity, pressure, + pM1, nType[p], size, Fluid_bounds); + UpdateUsingEulerFluxUtils::ComputeKGSums(&KGSum[0], + Conserved, rho, MassFracs, + velocity, pressure, + p, nType[p], size, Fluid_bounds); + if (shockSensor[pM1] && + shockSensor[p ] && + shockSensor[pP1]) + // KG reconstruction + UpdateUsingEulerFluxUtils::KGFluxReconstruction(FluxM, KGSum, + Conserved, velocity, pressure, + p, nType[p], size, Fluid_bounds); + else + // TENO reconstruction + UpdateUsingEulerFluxUtils::template FluxReconstruction( + FluxM, + Conserved, SoS, rho, velocity, + pressure, MassFracs, temperature, + p, nType[p], mix, size, Fluid_bounds); + } + // Loop across my section of the span + for (coord_t i = firstIndex; i < lastIndex; i++) { + const Point<3> p = GetPointInSpan(Flux_bounds, i, x, y, z); + const Point<3> pM1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + const Point<3> pP1 = warpPeriodic(Fluid_bounds, p, size, offP1(nType[p])); + // Shift and update KG summations + __UNROLL__ + for (int l=0; l::ComputeKGSums(&KGSum[0], + Conserved, rho, MassFracs, + velocity, pressure, + p, nType[p], size, Fluid_bounds); + + if (shockSensor[pM1] && + shockSensor[p ] && + shockSensor[pP1]) + // KG reconstruction + UpdateUsingEulerFluxUtils::KGFluxReconstruction(FluxP, KGSum, + Conserved, velocity, pressure, + p, nType[p], size, Fluid_bounds); + else + // TENO reconstruction + UpdateUsingEulerFluxUtils::template FluxReconstruction( + FluxP, + Conserved, SoS, rho, velocity, + pressure, MassFracs, temperature, + p, nType[p], mix, size, Fluid_bounds); + + + // Update time derivative + Conserved_t[p] += m_e[p]*(FluxP - FluxM); + + // Store plus flux for next point + FluxM = FluxP; + } +} - // Compute +/- fluxes - double FluxPM2[nEq]; double FluxMM2[nEq]; getPlusMinusFlux(FluxPM2, FluxMM2, K, Conserved[pM2].v, velocity[pM2][iN], pressure[pM2], Lam1, Lam, LamN); - double FluxPM1[nEq]; double FluxMM1[nEq]; getPlusMinusFlux(FluxPM1, FluxMM1, K, Conserved[pM1].v, velocity[pM1][iN], pressure[pM1], Lam1, Lam, LamN); - double FluxP [nEq]; double FluxM [nEq]; getPlusMinusFlux(FluxP , FluxM , K, Conserved[p ].v, velocity[p ][iN], pressure[p ], Lam1, Lam, LamN); - double FluxPP1[nEq]; double FluxMP1[nEq]; getPlusMinusFlux(FluxPP1, FluxMP1, K, Conserved[pP1].v, velocity[pP1][iN], pressure[pP1], Lam1, Lam, LamN); - double FluxPP2[nEq]; double FluxMP2[nEq]; getPlusMinusFlux(FluxPP2, FluxMP2, K, Conserved[pP2].v, velocity[pP2][iN], pressure[pP2], Lam1, Lam, LamN); - double FluxPP3[nEq]; double FluxMP3[nEq]; getPlusMinusFlux(FluxPP3, FluxMP3, K, Conserved[pP3].v, velocity[pP3][iN], pressure[pP3], Lam1, Lam, LamN); +//----------------------------------------------------------------------------- +// INLINE FUNCTIONS FOR UpdateUsingTENOAEulerFluxTask +//----------------------------------------------------------------------------- - // Reconstruct Fluxes - double FPlus[nEq]; - __UNROLL__ - for (int i=0; i +__CUDA_H__ +void UpdateUsingTENOAEulerFluxTask::updateRHSSpan( + const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &SoS, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &temperature, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix) { + + VecNEq FluxM; VecNEq FluxP; + const coord_t size = getSize(Fluid_bounds); + // Compute flux of first minus inter-cell location + { + const Point<3> p = GetPointInSpan(Flux_bounds, firstIndex, x, y, z); + const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + UpdateUsingEulerFluxUtils::template FluxReconstruction( + FluxM, + Conserved, SoS, rho, velocity, + pressure, MassFracs, temperature, + pm1, nType[pm1], mix, size, Fluid_bounds); + } + // Loop across my section of the span + for (coord_t i = firstIndex; i < lastIndex; i++) { + const Point<3> p = GetPointInSpan(Flux_bounds, i, x, y, z); + // Update plus flux + UpdateUsingEulerFluxUtils::template FluxReconstruction( + FluxP, + Conserved, SoS, rho, velocity, + pressure, MassFracs, temperature, + p, nType[p], mix, size, Fluid_bounds); + + // Update time derivative + Conserved_t[p] += m_e[p]*(FluxP - FluxM); + + // Store plus flux for next point + FluxM = FluxP; + } +}; - double FMinus[nEq]; - __UNROLL__ - for (int i=0; i +__CUDA_H__ +void UpdateUsingTENOLADEulerFluxTask::updateRHSSpan( + const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &SoS, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const AccessorRO &temperature, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix) { + + VecNEq FluxM; VecNEq FluxP; + const coord_t size = getSize(Fluid_bounds); + // Compute flux of first minus inter-cell location + { + const Point<3> p = GetPointInSpan(Flux_bounds, firstIndex, x, y, z); + const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + UpdateUsingEulerFluxUtils::template FluxReconstruction( + FluxM, + Conserved, SoS, rho, velocity, + pressure, MassFracs, temperature, + pm1, nType[pm1], mix, size, Fluid_bounds); + } + // Loop across my section of the span + for (coord_t i = firstIndex; i < lastIndex; i++) { + const Point<3> p = GetPointInSpan(Flux_bounds, i, x, y, z); + // Update plus flux + UpdateUsingEulerFluxUtils::template FluxReconstruction( + FluxP, + Conserved, SoS, rho, velocity, + pressure, MassFracs, temperature, + p, nType[p], mix, size, Fluid_bounds); + + // Update time derivative + Conserved_t[p] += m_e[p]*(FluxP - FluxM); + + // Store plus flux for next point + FluxM = FluxP; + } +}; - // Compute right eigenvector matrix - computeRightEigenvectors(K, RoeAvgs); +//----------------------------------------------------------------------------- +// INLINE FUNCTIONS FOR UpdateUsingSkewSymmetricEulerFluxTask +//----------------------------------------------------------------------------- - // Go back to the physical space - MatMul(K, F, Flux); +template +__CUDA_H__ +void UpdateUsingSkewSymmetricEulerFluxTask::updateRHSSpan( + double *KGSum, + const AccessorRW &Conserved_t, + const AccessorRO &m_e, + const AccessorRO< int, 3> &nType, + const AccessorRO &Conserved, + const AccessorRO &rho, + const AccessorRO &MassFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &pressure, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds) { + + VecNEq FluxM; VecNEq FluxP; + const coord_t size = getSize(Fluid_bounds); + // Compute flux of first minus inter-cell location + { + const Point<3> p0 = GetPointInSpan(Flux_bounds, firstIndex, x, y, z); + const Point<3> p = warpPeriodic(Fluid_bounds, p0, size, offM1(nType[p0])); + const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + const Point<3> pm2 = warpPeriodic(Fluid_bounds, p, size, offM2(nType[p])); + // Compute KG summations (... the order is fundamental) + UpdateUsingEulerFluxUtils::ComputeKGSums(&KGSum[3*(nEq+1)], + Conserved, rho, MassFracs, + velocity, pressure, + pm2, nType[p], size, Fluid_bounds); + UpdateUsingEulerFluxUtils::ComputeKGSums(&KGSum[2*(nEq+1)], + Conserved, rho, MassFracs, + velocity, pressure, + pm1, nType[p], size, Fluid_bounds); + UpdateUsingEulerFluxUtils::ComputeKGSums(&KGSum[0], + Conserved, rho, MassFracs, + velocity, pressure, + p, nType[p], size, Fluid_bounds); + + // KG reconstruction + UpdateUsingEulerFluxUtils::KGFluxReconstruction(FluxM, KGSum, + Conserved, velocity, pressure, + p, nType[p], size, Fluid_bounds); + } + // Loop across my section of the span + for (coord_t i = firstIndex; i < lastIndex; i++) { + const Point<3> p = GetPointInSpan(Flux_bounds, i, x, y, z); + // Shift and update KG summations + __UNROLL__ + for (int l=0; l::ComputeKGSums(&KGSum[0], + Conserved, rho, MassFracs, + velocity, pressure, + p, nType[p], size, Fluid_bounds); + + // KG reconstruction + UpdateUsingEulerFluxUtils::KGFluxReconstruction(FluxP, KGSum, + Conserved, velocity, pressure, + p, nType[p], size, Fluid_bounds); + + // Update time derivative + Conserved_t[p] += m_e[p]*(FluxP - FluxM); + + // Store plus flux for next point + FluxM = FluxP; + } } //----------------------------------------------------------------------------- @@ -699,13 +1015,13 @@ void UpdateUsingEulerFluxUtils::TENOAFluxReconstruction(double *Flux, template<> __CUDA_H__ -inline void UpdateUsingDiffusionFluxTask::GetSigma( - double *sigma, const int nType, const double m_s, - const AccessorRO mu, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGradY, - const AccessorRO< Vec3, 3> vGradZ, - const Point<3> p, const Point<3> pp1) { +inline Vec3 UpdateUsingDiffusionFluxTask::GetSigma( + const int nType, const double m_s, + const AccessorRO &mu, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGradY, + const AccessorRO< Vec3, 3> &vGradZ, + const Point<3> &p, const Point<3> &pp1) { const double mu_s = Interp2Staggered(nType, mu[p], mu[pp1]); @@ -717,20 +1033,22 @@ inline void UpdateUsingDiffusionFluxTask::GetSigma( const double dUdZ_s = Interp2Staggered(nType, vGradZ[p][0], vGradZ[pp1][0]); const double dWdZ_s = Interp2Staggered(nType, vGradZ[p][2], vGradZ[pp1][2]); + Vec3 sigma; sigma[0] = mu_s*(4*dUdX_s - 2*dVdY_s - 2*dWdZ_s)/3; sigma[1] = mu_s*(dVdX_s+dUdY_s); sigma[2] = mu_s*(dWdX_s+dUdZ_s); + return sigma; } template<> __CUDA_H__ -inline void UpdateUsingDiffusionFluxTask::GetSigma( - double *sigma, const int nType, const double m_s, - const AccessorRO mu, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGradX, - const AccessorRO< Vec3, 3> vGradZ, - const Point<3> p, const Point<3> pp1) { +inline Vec3 UpdateUsingDiffusionFluxTask::GetSigma( + const int nType, const double m_s, + const AccessorRO &mu, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGradX, + const AccessorRO< Vec3, 3> &vGradZ, + const Point<3> &p, const Point<3> &pp1) { const double mu_s = Interp2Staggered(nType, mu[p], mu[pp1]); @@ -742,20 +1060,22 @@ inline void UpdateUsingDiffusionFluxTask::GetSigma( const double dVdZ_s = Interp2Staggered(nType, vGradZ[p][1], vGradZ[pp1][1]); const double dWdZ_s = Interp2Staggered(nType, vGradZ[p][2], vGradZ[pp1][2]); + Vec3 sigma; sigma[0] = mu_s*(dUdY_s+dVdX_s); sigma[1] = mu_s*(4*dVdY_s - 2*dUdX_s - 2*dWdZ_s)/3; sigma[2] = mu_s*(dWdY_s+dVdZ_s); + return sigma; } template<> __CUDA_H__ -inline void UpdateUsingDiffusionFluxTask::GetSigma( - double *sigma, const int nType, const double m_s, - const AccessorRO mu, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGradX, - const AccessorRO< Vec3, 3> vGradY, - const Point<3> p, const Point<3> pp1) { +inline Vec3 UpdateUsingDiffusionFluxTask::GetSigma( + const int nType, const double m_s, + const AccessorRO &mu, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGradX, + const AccessorRO< Vec3, 3> &vGradY, + const Point<3> &p, const Point<3> &pp1) { const double mu_s = Interp2Staggered(nType, mu[p], mu[pp1]); @@ -767,58 +1087,53 @@ inline void UpdateUsingDiffusionFluxTask::GetSigma( const double dVdY_s = Interp2Staggered(nType, vGradY[p][1], vGradY[pp1][1]); const double dWdY_s = Interp2Staggered(nType, vGradY[p][2], vGradY[pp1][2]); + Vec3 sigma; sigma[0] = mu_s*(dUdZ_s+dWdX_s); sigma[1] = mu_s*(dVdZ_s+dWdY_s); sigma[2] = mu_s*(4*dWdZ_s - 2*dUdX_s - 2*dVdY_s)/3; + return sigma; } template __CUDA_H__ inline void UpdateUsingDiffusionFluxTask::GetDiffusionFlux( - double *Flux, const int nType, const double m_s, const Mix &mix, - const AccessorRO rho, - const AccessorRO mu, - const AccessorRO lam, - const AccessorRO Di, - const AccessorRO temperature, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO Xi, - const AccessorRO rhoYi, - const AccessorRO< Vec3, 3> vGradY, - const AccessorRO< Vec3, 3> vGradZ, - const Point<3> p, + VecNEq &Flux, const int nType, const double m_s, const Mix &mix, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &temperature, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &Xi, + const AccessorRO &rhoYi, + const AccessorRO< Vec3, 3> &vGradY, + const AccessorRO< Vec3, 3> &vGradZ, + const Point<3> &p, const coord_t size, - const Rect<3> bounds) { + const Rect<3> &bounds) { // access i+1 point (warp around boundaries) const Point<3> pp1 = warpPeriodic(bounds, p, size, 1); // Mixture properties at the staggered location const double rho_s = Interp2Staggered(nType, rho[p], rho[pp1]); - const double iMixW_s = 1.0/Interp2Staggered(nType, GetMolarWeightFromXi(Xi.ptr(p )->v, mix), - GetMolarWeightFromXi(Xi.ptr(pp1)->v, mix)); + const double iMixW_s = 1.0/Interp2Staggered(nType, mix.GetMolarWeightFromXi(Xi[p ]), + mix.GetMolarWeightFromXi(Xi[pp1])); // Primitive and conserved variables at the staggered location - const double T_s = Interp2Staggered(nType, temperature[p], temperature[pp1]); - const double vel_s[] = {Interp2Staggered(nType, velocity[p][0], velocity[pp1][0]), - Interp2Staggered(nType, velocity[p][1], velocity[pp1][1]), - Interp2Staggered(nType, velocity[p][2], velocity[pp1][2])}; - - // Viscous stress - double sigma[3]; GetSigma(sigma, nType, m_s, mu, velocity, vGradY, vGradZ, p, pp1); + const double T_s = Interp2Staggered(nType, temperature[p], temperature[pp1]); // Assemble the fluxes - const double uSigma = dot(vel_s, sigma); double heatFlux = Interp2Staggered(nType, lam[p], lam[pp1])*m_s*(temperature[p] - temperature[pp1]); // Species diffusion velocity - double YiVi[nSpec]; + VecNSp YiVi; double ViCorr = 0.0; __UNROLL__ for (int i=0; i::GetDiffusionFlux( for (int i=0; i +__CUDA_H__ +void UpdateUsingDiffusionFluxTask::updateRHSSpan( + const AccessorRW &Conserved_t, + const AccessorRO &m_s, + const AccessorRO &m_d, + const AccessorRO< int, 3> &nType, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &lam, + const AccessorRO &Di, + const AccessorRO &temperature, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &Xi, + const AccessorRO &rhoYi, + const AccessorRO< Vec3, 3> &vGrad1, + const AccessorRO< Vec3, 3> &vGrad2, + const coord_t firstIndex, + const coord_t lastIndex, + const int x, + const int y, + const int z, + const Rect<3> &Flux_bounds, + const Rect<3> &Fluid_bounds, + const Mix &mix) { + + const coord_t size = getSize(Fluid_bounds); + VecNEq DiffFluxM; VecNEq DiffFluxP; + // Compute flux of first minus inter-cell location + { + const Point<3> p = GetPointInSpan(Flux_bounds, firstIndex, x, y, z); + const Point<3> pm1 = warpPeriodic(Fluid_bounds, p, size, offM1(nType[p])); + GetDiffusionFlux(DiffFluxM, nType[pm1], m_s[pm1], mix, + rho, mu, lam, Di, + temperature, velocity, Xi, + rhoYi, vGrad1, vGrad2, + pm1, size, Fluid_bounds); + } + // Loop across my section of the span + for (coord_t i = firstIndex; i < lastIndex; i++) { + const Point<3> p = GetPointInSpan(Flux_bounds, i, x, y, z); + // Update plus flux + GetDiffusionFlux(DiffFluxP, nType[p], m_s[p], mix, + rho, mu, lam, Di, + temperature, velocity, Xi, + rhoYi, vGrad1, vGrad2, + p, size, Fluid_bounds); + + // Update time derivative + Conserved_t[p] += m_d[p]*(DiffFluxP - DiffFluxM); + + // Store plus flux for next point + DiffFluxM = DiffFluxP; + } +} + //----------------------------------------------------------------------------- // INLINE FUNCTIONS FOR UpdateUsingFluxNSCBCInflowTask //----------------------------------------------------------------------------- template __CUDA_H__ -void UpdateUsingFluxNSCBCInflowMinusSideTask::addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO pressure, - const double SoS, - const double rho, - const double T, - const double *velocity, - const double *vGrad, - const double *dudt, - const double dTdt, - const Point<3> p, - const int nType, - const double m, - const Mix &mix) { - - // TODO: implement some sort of static_if - const int iN = (dir == Xdir) ? 0 : - (dir == Ydir) ? 1 : - /*(dir == Zdir) ?*/ 2; +void UpdateUsingFluxNSCBCInflowMinusSideTask::addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &pressure, + const double SoS, + const double rho, + const double T, + const Vec3 &velocity, + const Vec3 &vGrad, + const Vec3 &dudt, + const double dTdt, + const Point<3> &p, + const int nType, + const double m, + const Mix &mix) { + + constexpr int iN = normalIndex(dir); if (velocity[iN] >= SoS) { // Supersonic inlet @@ -875,11 +1248,11 @@ void UpdateUsingFluxNSCBCInflowMinusSideTask::addLODIfluxes(double *RHS, // Subsonic inlet (add NSCBC fluxes) const Point<3> p_int = (dir == Xdir) ? Point<3>(p.x+1, p.y , p.z ) : (dir == Ydir) ? Point<3>(p.x , p.y+1, p.z ) : - /*(dir == Ydir) ?*/Point<3>(p.x , p.y , p.z+1); + /*(dir == Zdir) ?*/Point<3>(p.x , p.y , p.z+1); // Thermo-chemical quantities - const double MixW_bnd = GetMolarWeightFromYi(MassFracs[p].v, mix); - const double Cp_bnd = GetHeatCapacity(T, MassFracs[p].v, mix); + const double MixW_bnd = mix.GetMolarWeightFromYi(MassFracs[p]); + const double Cp_bnd = mix.GetHeatCapacity(T, MassFracs[p]); // characteristic velocity leaving the domain const double lambda_1 = velocity[iN] - SoS; @@ -890,21 +1263,17 @@ void UpdateUsingFluxNSCBCInflowMinusSideTask::addLODIfluxes(double *RHS, // compute waves amplitudes const double dp_dn = getDerivLeftBC(nType, pressure[p], pressure[p_int], m); const double du_dn = vGrad[iN]; - double dY_dn[nSpec]; - __UNROLL__ - for (int s=0; s::addLODIfluxes(double *RHS, template __CUDA_H__ -void UpdateUsingFluxNSCBCInflowPlusSideTask::addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO pressure, - const double SoS, - const double rho, - const double T, - const double *velocity, - const double *vGrad, - const double *dudt, - const double dTdt, - const Point<3> p, - const int nType, - const double m, - const Mix &mix) { - - // TODO: implement some sort of static_if - const int iN = (dir == Xdir) ? 0 : - (dir == Ydir) ? 1 : - /*(dir == Zdir) ?*/ 2; +void UpdateUsingFluxNSCBCInflowPlusSideTask::addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &pressure, + const double SoS, + const double rho, + const double T, + const Vec3 &velocity, + const Vec3 &vGrad, + const Vec3 &dudt, + const double dTdt, + const Point<3> &p, + const int nType, + const double m, + const Mix &mix) { + + constexpr int iN = normalIndex(dir); if (velocity[iN] <= -SoS) { // Supersonic inlet @@ -949,11 +1315,11 @@ void UpdateUsingFluxNSCBCInflowPlusSideTask::addLODIfluxes(double *RHS, // Subsonic inlet (add NSCBC fluxes) const Point<3> p_int = (dir == Xdir) ? Point<3>(p.x-1, p.y , p.z ) : (dir == Ydir) ? Point<3>(p.x , p.y-1, p.z ) : - /*(dir == Ydir) ?*/Point<3>(p.x , p.y , p.z-1); + /*(dir == Zdir) ?*/Point<3>(p.x , p.y , p.z-1); // Thermo-chemical quantities - const double MixW_bnd = GetMolarWeightFromYi(MassFracs[p].v, mix); - const double Cp_bnd = GetHeatCapacity(T, MassFracs[p].v, mix); + const double MixW_bnd = mix.GetMolarWeightFromYi(MassFracs[p]); + const double Cp_bnd = mix.GetHeatCapacity(T, MassFracs[p]); // characteristic velocity leaving the domain const double lambda_N = velocity[iN] + SoS; @@ -964,21 +1330,17 @@ void UpdateUsingFluxNSCBCInflowPlusSideTask::addLODIfluxes(double *RHS, // compute waves amplitudes const double dp_dn = getDerivRightBC(nType, pressure[p_int], pressure[p], m); const double du_dn = vGrad[iN]; - double dY_dn[nSpec]; - __UNROLL__ - for (int s=0; s::addLODIfluxes(double *RHS, template __CUDA_H__ -void UpdateUsingFluxNSCBCOutflowMinusSideTask::addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO rho, - const AccessorRO mu, - const AccessorRO pressure, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGradN, - const AccessorRO< Vec3, 3> vGradT1, - const AccessorRO< Vec3, 3> vGradT2, - const double SoS, - const double T, - const double *Conserved, - const Point<3> p, - const int nType, - const double m, - const double MaxMach, - const double LengthScale, - const double PInf, - const Mix &mix) { - - // TODO: implement some sort of static_if - int iN; int iT1; int iT2; Point<3> p_int; - if (dir == Xdir) { iN = 0; iT1 = 1; iT2 = 2; p_int = Point<3>(p.x+1, p.y , p.z ); } - else if (dir == Ydir) { iN = 1; iT1 = 0; iT2 = 2; p_int = Point<3>(p.x , p.y+1, p.z ); } - else if (dir == Zdir) { iN = 2; iT1 = 0; iT2 = 1; p_int = Point<3>(p.x , p.y , p.z+1); } - - // Thermo-chemical quantities - const double Cp_bnd = GetHeatCapacity(T, MassFracs[p].v, mix); - - // BC-normal gradients - const double dp_dn = getDerivLeftBC(nType, pressure[p], pressure[p_int], m); - const double drho_dn = getDerivLeftBC(nType, rho[p], rho[p_int], m); - double dY_dn[nSpec]; - __UNROLL__ - for (int s=0; s::addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &pressure, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGradN, + const AccessorRO< Vec3, 3> &vGradT1, + const AccessorRO< Vec3, 3> &vGradT2, + const double SoS, + const double T, + const VecNEq &Conserved, + const Point<3> &p, + const int nType, + const double m, + const double MaxMach, + const double LengthScale, + const double PInf, + const Mix &mix) { + + constexpr int iN = normalIndex(dir); + constexpr int iT1 = tangential1Index(dir); + constexpr int iT2 = tangential2Index(dir); + const Point<3> p_int = getPIntBC(p); + + // BC-normal pressure derivative + const double dp_dn = getDerivLeftBC(nType, pressure[p], pressure[p_int], m); + + // Characteristic velocities const double lambda_1 = velocity[p][iN] - SoS; const double lambda = velocity[p][iN]; const double lambda_N = velocity[p][iN] + SoS; // compute waves amplitudes const double L1 = lambda_1*(dp_dn - rho[p]*SoS*vGradN[p][iN]); - double LM[3]; - LM[iN ] = lambda*(dp_dn - SoS*SoS*drho_dn); - LM[iT1] = lambda*vGradN[p][iT1]; - LM[iT2] = lambda*vGradN[p][iT2]; - double LS[nSpec]; + const double LM = lambda*(dp_dn - SoS*SoS*getDerivLeftBC(nType, rho[p], rho[p_int], m)); + VecNSp LS; __UNROLL__ for (int s=0; s::addLODIfluxes(double *RHS, } // Compute LODI fluxes - const double d1 = (0.5*(L1 + LN) - LM[iN])/(SoS*SoS); - double dM[3]; + const double d1 = (0.5*(L1 + LN) - LM)/(SoS*SoS); + Vec3 dM; dM[iN ] = (LN - L1)/(2*rho[p]*SoS); - dM[iT1] = LM[iT1]; - dM[iT2] = LM[iT2]; - const double dN = LM[iN]/(SoS*SoS); + dM[iT1] = lambda*vGradN[p][iT1]; + dM[iT2] = lambda*vGradN[p][iT2]; + const double dN = LM/(SoS*SoS); // Compute viscous terms const double tauNN_bnd = mu[p ]*(4*vGradN[p ][iN] - 2*vGradT1[p ][iT1] - 2*vGradT2[p ][iT2])/3; @@ -1088,58 +1438,49 @@ void UpdateUsingFluxNSCBCOutflowMinusSideTask::addLODIfluxes(double *RHS, + Conserved[irU+iN ]*dM[iN ] + Conserved[irU+iT1]*dM[iT1] + Conserved[irU+iT2]*dM[iT2] - + Cp_bnd*T*dN + + mix.GetHeatCapacity(T, MassFracs[p])*T*dN - viscous_heating); __UNROLL__ for (int s=0; s __CUDA_H__ -void UpdateUsingFluxNSCBCOutflowPlusSideTask::addLODIfluxes(double *RHS, - const AccessorRO MassFracs, - const AccessorRO rho, - const AccessorRO mu, - const AccessorRO pressure, - const AccessorRO< Vec3, 3> velocity, - const AccessorRO< Vec3, 3> vGradN, - const AccessorRO< Vec3, 3> vGradT1, - const AccessorRO< Vec3, 3> vGradT2, - const double SoS, - const double T, - const double *Conserved, - const Point<3> p, - const int nType, - const double m, - const double MaxMach, - const double LengthScale, - const double PInf, - const Mix &mix) { - - // TODO: implement some sort of static_if - int iN; int iT1; int iT2; Point<3> p_int; - if (dir == Xdir) { iN = 0; iT1 = 1; iT2 = 2; p_int = Point<3>(p.x-1, p.y , p.z ); } - else if (dir == Ydir) { iN = 1; iT1 = 0; iT2 = 2; p_int = Point<3>(p.x , p.y-1, p.z ); } - else if (dir == Zdir) { iN = 2; iT1 = 0; iT2 = 1; p_int = Point<3>(p.x , p.y , p.z-1); } - - // Thermo-chemical quantities - const double Cp_bnd = GetHeatCapacity(T, MassFracs[p].v, mix); - - // BC-normal gradients - const double dp_dn = getDerivRightBC(nType, pressure[p_int], pressure[p], m); - const double drho_dn = getDerivRightBC(nType, rho[p_int], rho[p], m); - double dY_dn[nSpec]; - __UNROLL__ - for (int s=0; s::addLODIfluxes(VecNEq &RHS, + const AccessorRO &MassFracs, + const AccessorRO &rho, + const AccessorRO &mu, + const AccessorRO &pressure, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO< Vec3, 3> &vGradN, + const AccessorRO< Vec3, 3> &vGradT1, + const AccessorRO< Vec3, 3> &vGradT2, + const double SoS, + const double T, + const VecNEq &Conserved, + const Point<3> &p, + const int nType, + const double m, + const double MaxMach, + const double LengthScale, + const double PInf, + const Mix &mix) { + + constexpr int iN = normalIndex(dir); + constexpr int iT1 = tangential1Index(dir); + constexpr int iT2 = tangential2Index(dir); + const Point<3> p_int = getPIntBC(p); + + // BC-normal pressure derivative + const double dp_dn = getDerivRightBC(nType, pressure[p_int], pressure[p], m); + + // Characteristic velocities const double lambda_1 = velocity[p][iN] - SoS; const double lambda = velocity[p][iN]; const double lambda_N = velocity[p][iN] + SoS; - // compute waves amplitudes + // Compute waves amplitudes const double sigma = 0.25; /*const*/ double L1; if (lambda_1 > 0) @@ -1151,23 +1492,20 @@ void UpdateUsingFluxNSCBCOutflowPlusSideTask::addLODIfluxes(double *RHS, sigma*(SoS-(velocity[p][iN]*velocity[p][iN])/SoS)/LengthScale; L1 = K*(pressure[p] - PInf); } - double LM[3]; - LM[iN ] = lambda*(dp_dn - SoS*SoS*drho_dn); - LM[iT1] = lambda*vGradN[p][iT1]; - LM[iT2] = lambda*vGradN[p][iT2]; - double LS[nSpec]; + const double LM = lambda*(dp_dn - SoS*SoS*getDerivRightBC(nType, rho[p_int], rho[p], m)); + VecNSp LS; __UNROLL__ for (int s=0; s::addLODIfluxes(double *RHS, + Conserved[irU+iN ]*dM[iN ] + Conserved[irU+iT1]*dM[iT1] + Conserved[irU+iT2]*dM[iT2] - + Cp_bnd*T*dN + + mix.GetHeatCapacity(T, MassFracs[p])*T*dN - viscous_heating); __UNROLL__ for (int s=0; s::cpu_base_impl( const Point<3> pP3 = warpPeriodic(Fluid_bounds, p, size, offP3(acc_nType[p])); const double Phi = std::max(std::max(std::max(std::max(std::max( - DucrosSensor(acc_vGradX[pM2].v, acc_vGradY[pM2].v, acc_vGradZ[pM2].v, eps), - DucrosSensor(acc_vGradX[pM1].v, acc_vGradY[pM1].v, acc_vGradZ[pM1].v, eps)), - DucrosSensor(acc_vGradX[p ].v, acc_vGradY[p ].v, acc_vGradZ[p ].v, eps)), - DucrosSensor(acc_vGradX[pP1].v, acc_vGradY[pP1].v, acc_vGradZ[pP1].v, eps)), - DucrosSensor(acc_vGradX[pP2].v, acc_vGradY[pP2].v, acc_vGradZ[pP2].v, eps)), - DucrosSensor(acc_vGradX[pP3].v, acc_vGradY[pP3].v, acc_vGradZ[pP3].v, eps)); + DucrosSensor(acc_vGradX[pM2], acc_vGradY[pM2], acc_vGradZ[pM2], eps), + DucrosSensor(acc_vGradX[pM1], acc_vGradY[pM1], acc_vGradZ[pM1], eps)), + DucrosSensor(acc_vGradX[p ], acc_vGradY[p ], acc_vGradZ[p ], eps)), + DucrosSensor(acc_vGradX[pP1], acc_vGradY[pP1], acc_vGradZ[pP1], eps)), + DucrosSensor(acc_vGradX[pP2], acc_vGradY[pP2], acc_vGradZ[pP2], eps)), + DucrosSensor(acc_vGradX[pP3], acc_vGradY[pP3], acc_vGradZ[pP3], eps)); bool sensor = true; for (int h=0; h DucrosS, const Point<3> p = Point<3>(x + my_bounds.lo.x, y + my_bounds.lo.y, z + my_bounds.lo.z); - DucrosS[p] = DucrosSensor(vGradX[p].v, vGradY[p].v, vGradZ[p].v, eps); + DucrosS[p] = DucrosSensor(vGradX[p], vGradY[p], vGradZ[p], eps); } } @@ -98,9 +98,9 @@ void UpdateShockSensor_kernel(const DeferredBuffer DucrosS, bool sensor = true; #pragma unroll for (int i=0; i -#ifdef __cplusplus -extern "C" { -#endif - #include "prometeo_const.h" #ifndef nSpec @@ -46,6 +42,10 @@ extern "C" { #error "nEq is undefined" #endif +#ifdef __cplusplus +extern "C" { +#endif + struct Fluid_columns { // Grid point double centerCoordinates[3]; @@ -72,17 +72,25 @@ struct Fluid_columns { double lam; double Di[nSpec]; double SoS; +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + double Ki[nIons]; +#endif // Primitive variables double pressure; double temperature; double MassFracs[ nSpec]; double MolarFracs[nSpec]; double velocity[3]; + // Electric variables +#ifdef ELECTRIC_FIELD + double electricPotential; + double electricField[3]; +#endif // Gradients double velocityGradientX[ 3]; double velocityGradientY[ 3]; double velocityGradientZ[ 3]; - double temperatureGradient[3]; +// double temperatureGradient[3]; // Conserved variables double Conserved[ nEq]; double Conserved_old[ nEq]; @@ -139,17 +147,25 @@ enum FieldIDs { FID_lam, FID_Di, FID_SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + FID_Ki, +#endif // Primitive variables FID_pressure, FID_temperature, FID_MassFracs, FID_MolarFracs, FID_velocity, + // Electric variables +#ifdef ELECTRIC_FIELD + FID_electricPotential, + FID_electricField, +#endif // Gradients FID_velocityGradientX, FID_velocityGradientY, FID_velocityGradientZ, - FID_temperatureGradient, +// FID_temperatureGradient, // Conserved variables FID_Conserved, FID_Conserved_old, @@ -182,34 +198,103 @@ enum FieldIDs { }; enum { - TID_InitializeMetric = 1, + TID_LoadMixture = 1, + // Metric tasks + TID_InitializeMetric, TID_CorrectGhostMetricX, TID_CorrectGhostMetricY, TID_CorrectGhostMetricZ, + // Variables tasks TID_UpdatePropertiesFromPrimitive, + TID_UpdateConservedFromPrimitive, + TID_UpdatePrimitiveFromConserved, TID_GetVelocityGradients, - TID_GetTemperatureGradient, +// TID_GetTemperatureGradient, + // Sensor tasks TID_UpdateShockSensorX, TID_UpdateShockSensorY, TID_UpdateShockSensorZ, + // RHS tasks TID_UpdateUsingHybridEulerFluxX, TID_UpdateUsingHybridEulerFluxY, TID_UpdateUsingHybridEulerFluxZ, TID_UpdateUsingTENOAEulerFluxX, TID_UpdateUsingTENOAEulerFluxY, TID_UpdateUsingTENOAEulerFluxZ, + TID_UpdateUsingTENOLADEulerFluxX, + TID_UpdateUsingTENOLADEulerFluxY, + TID_UpdateUsingTENOLADEulerFluxZ, + TID_UpdateUsingSkewSymmetricEulerFluxX, + TID_UpdateUsingSkewSymmetricEulerFluxY, + TID_UpdateUsingSkewSymmetricEulerFluxZ, TID_UpdateUsingDiffusionFluxX, TID_UpdateUsingDiffusionFluxY, TID_UpdateUsingDiffusionFluxZ, TID_UpdateUsingFluxNSCBCInflowXNeg, + TID_UpdateUsingFluxNSCBCInflowYNeg, TID_UpdateUsingFluxNSCBCInflowYPos, TID_UpdateUsingFluxNSCBCOutflowXPos, TID_UpdateUsingFluxNSCBCOutflowYNeg, - TID_UpdateUsingFluxNSCBCOutflowYPos + TID_UpdateUsingFluxNSCBCOutflowYPos, + // BC tasks + TID_AddRecycleAverageBC, + TID_SetNSCBC_InflowBC_X, + TID_SetNSCBC_InflowBC_Y, + TID_SetNSCBC_InflowBC_Z, + TID_SetNSCBC_OutflowBC, + TID_SetIncomingShockBC, + TID_SetRecycleRescalingBC, + // Chemistry tasks + TID_UpdateChemistry, + TID_AddChemistrySources, + // CFL tasks + TID_CalculateMaxSpectralRadius, + // Average tasks + TID_Add2DAveragesX, + TID_Add2DAveragesY, + TID_Add2DAveragesZ, + TID_Add1DAveragesX, + TID_Add1DAveragesY, + TID_Add1DAveragesZ, +#ifdef ELECTRIC_FIELD + // Electric field solver tasks + TID_initFFTplans, + TID_destroyFFTplans, + TID_performDirFFTFromField, + TID_performDirFFTFromMix, + TID_performInvFFT, + TID_solveTridiagonals, + TID_GetElectricField, + TID_UpdateUsingIonDriftFluxX, + TID_UpdateUsingIonDriftFluxY, + TID_UpdateUsingIonDriftFluxZ, + TID_AddIonWindSources, + TID_CorrectIonsBCXNeg, + TID_CorrectIonsBCXPos, + TID_CorrectIonsBCYNeg, + TID_CorrectIonsBCYPos, + TID_CorrectIonsBCZNeg, + TID_CorrectIonsBCZPos, +#endif +}; + +enum REDOP_ID{ + REGENT_REDOP_SUM_VEC3 = 101, + REGENT_REDOP_SUM_VECNSP, + REGENT_REDOP_SUM_VEC6, }; #ifdef __cplusplus } #endif +#ifdef __cplusplus +#include "my_array.hpp" +// Define common tipe of arrays and matrices that we are going to use +// NOTE: Regent is not going to see this when includes this file +typedef MyArray Vec3; +typedef MyArray VecNSp; +typedef MyArray VecNEq; +#endif + #endif // Prometeo_Types_H diff --git a/src/prometeo_variables.cc b/src/prometeo_variables.cc index d6e0a1f..33014ed 100644 --- a/src/prometeo_variables.cc +++ b/src/prometeo_variables.cc @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -30,7 +30,7 @@ #include "prometeo_variables.hpp" // UpdatePropertiesFromPrimitiveTask -/*static*/ const char * const UpdatePropertiesFromPrimitiveTask::TASK_NAME = "UpdatePropertiesFromPrimitiveTask"; +/*static*/ const char * const UpdatePropertiesFromPrimitiveTask::TASK_NAME = "UpdatePropertiesFromPrimitive"; /*static*/ const int UpdatePropertiesFromPrimitiveTask::TASK_ID = TID_UpdatePropertiesFromPrimitive; void UpdatePropertiesFromPrimitiveTask::cpu_base_impl( @@ -56,6 +56,9 @@ void UpdatePropertiesFromPrimitiveTask::cpu_base_impl( const AccessorWO acc_lam (regions[1], FID_lam); const AccessorWO acc_Di (regions[1], FID_Di); const AccessorWO acc_SoS (regions[1], FID_SoS); +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorWO acc_Ki (regions[1], FID_Ki); +#endif // Extract execution domain Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); @@ -68,16 +71,107 @@ void UpdatePropertiesFromPrimitiveTask::cpu_base_impl( for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { const Point<3> p = Point<3>{i,j,k}; - // TODO: Add a Mixture check + // Mixture check + assert(args.mix.CheckMixture(acc_MolarFracs[p])); UpdateProperties(acc_pressure, acc_temperature, acc_MolarFracs, acc_velocity, acc_MassFracs, acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, +#endif p, args.mix); } } +// UpdateConservedFromPrimitiveTask +/*static*/ const char * const UpdateConservedFromPrimitiveTask::TASK_NAME = "UpdateConservedFromPrimitive"; +/*static*/ const int UpdateConservedFromPrimitiveTask::TASK_ID = TID_UpdateConservedFromPrimitive; + +void UpdateConservedFromPrimitiveTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for primitive variables + const AccessorRO acc_MassFracs (regions[0], FID_MassFracs); + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[0], FID_rho); + + // Accessors for conserved variables + const AccessorWO acc_Conserved (regions[1], FID_Conserved); + + // Extract execution domain + Domain r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Launch domain might be composed by multiple rectangles + for (RectInDomainIterator<3> Rit(r_ModCells); Rit(); Rit++) { + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = (*Rit).lo.z; k <= (*Rit).hi.z; k++) + for (int j = (*Rit).lo.y; j <= (*Rit).hi.y; j++) + for (int i = (*Rit).lo.x; i <= (*Rit).hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + // Mixture check + assert(args.mix.CheckMixture(acc_MassFracs[p])); + UpdateConserved(acc_MassFracs, acc_temperature, acc_velocity, + acc_rho, acc_Conserved, + p, args.mix); + } + } +} + +// UpdatePrimitiveFromConservedTask +/*static*/ const char * const UpdatePrimitiveFromConservedTask::TASK_NAME = "UpdatePrimitiveFromConserved"; +/*static*/ const int UpdatePrimitiveFromConservedTask::TASK_ID = TID_UpdatePrimitiveFromConserved; + +void UpdatePrimitiveFromConservedTask::cpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessors for temperature variables + const AccessorRW acc_temperature (regions[1], FID_temperature); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domain + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Here we are assuming C layout of the instance +#ifdef REALM_USE_OPENMP + #pragma omp parallel for collapse(3) +#endif + for (int k = r_ModCells.lo.z; k <= r_ModCells.hi.z; k++) + for (int j = r_ModCells.lo.y; j <= r_ModCells.hi.y; j++) + for (int i = r_ModCells.lo.x; i <= r_ModCells.hi.x; i++) { + const Point<3> p = Point<3>{i,j,k}; + UpdatePrimitive(acc_Conserved, acc_temperature, acc_pressure, + acc_MolarFracs, acc_velocity, + p, args.mix); + } +} + // GetVelocityGradientsTask /*static*/ const char * const GetVelocityGradientsTask::TASK_NAME = "GetVelocityGradients"; @@ -142,6 +236,7 @@ void GetVelocityGradientsTask::cpu_base_impl( } } +#if 0 // GetTemperatureGradientTask /*static*/ const char * const GetTemperatureGradientTask::TASK_NAME = "GetTemperatureGradient"; /*static*/ const int GetTemperatureGradientTask::TASK_ID = TID_GetTemperatureGradient; @@ -202,14 +297,19 @@ void GetTemperatureGradientTask::cpu_base_impl( zsize, Fluid_bounds); } } +#endif void register_variables_tasks() { TaskHelper::register_hybrid_variants(); + TaskHelper::register_hybrid_variants(); + + TaskHelper::register_hybrid_variants(); + TaskHelper::register_hybrid_variants(); - TaskHelper::register_hybrid_variants(); +// TaskHelper::register_hybrid_variants(); }; diff --git a/src/prometeo_variables.cu b/src/prometeo_variables.cu index 7d34cb5..2b1b274 100644 --- a/src/prometeo_variables.cu +++ b/src/prometeo_variables.cu @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -30,8 +30,8 @@ #include "prometeo_variables.hpp" #include "cuda_utils.hpp" -// Define a constant memory that will hold the Mixture struct -__device__ __constant__ Mix mix; +// Declare a constant memory that will hold the Mixture struct (initialized in prometeo_mixture.cu) +extern __device__ __constant__ Mix mix; //----------------------------------------------------------------------------- // KERNELS FOR UpdatePropertiesFromPrimitiveTask @@ -48,6 +48,9 @@ void UpdatePropertiesFromPrimitive_kernel(const AccessorRO pressure, const AccessorWO lam, const AccessorWO Di, const AccessorWO SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorWO Ki, +#endif const Rect<3> my_bounds, const coord_t size_x, const coord_t size_y, @@ -61,11 +64,15 @@ void UpdatePropertiesFromPrimitive_kernel(const AccessorRO pressure, const Point<3> p = Point<3>(x + my_bounds.lo.x, y + my_bounds.lo.y, z + my_bounds.lo.z); - // TODO: Add a Mixture check + // Mixture check + assert(mix.CheckMixture(MolarFracs[p])); UpdatePropertiesFromPrimitiveTask::UpdateProperties( pressure, temperature, MolarFracs, velocity, MassFracs, rho, mu, lam, Di, SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + Ki, +#endif p, mix); } } @@ -94,13 +101,13 @@ void UpdatePropertiesFromPrimitiveTask::gpu_base_impl( const AccessorWO acc_lam (regions[1], FID_lam); const AccessorWO acc_Di (regions[1], FID_Di); const AccessorWO acc_SoS (regions[1], FID_SoS); +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorWO acc_Ki (regions[1], FID_Ki); +#endif // Extract execution domains Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); - // Copy the mixture to the device - cudaMemcpyToSymbolAsync(mix, &(args.mix), sizeof(Mix)); - // Launch the kernel const int threads_per_block = 256; const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); @@ -111,9 +118,147 @@ void UpdatePropertiesFromPrimitiveTask::gpu_base_impl( acc_pressure, acc_temperature, acc_MolarFracs, acc_velocity, acc_MassFracs, acc_rho, acc_mu, acc_lam, acc_Di, acc_SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + acc_Ki, +#endif r_ModCells, getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); } +//----------------------------------------------------------------------------- +// KERNELS FOR UpdateConservedFromPrimitiveTask +//----------------------------------------------------------------------------- + +__global__ +void UpdateConservedFromPrimitive_kernel(const AccessorRO MassFracs, + const AccessorRO temperature, + const AccessorRO< Vec3, 3> velocity, + const AccessorRO rho, + const AccessorWO Conserved, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + // Mixture check + assert(mix.CheckMixture(MassFracs[p])); + UpdateConservedFromPrimitiveTask::UpdateConserved( + MassFracs, temperature, velocity, + rho, Conserved, + p, mix); + } +} + +__host__ +void UpdateConservedFromPrimitiveTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for primitive variables + const AccessorRO acc_MassFracs (regions[0], FID_MassFracs); + const AccessorRO acc_temperature (regions[0], FID_temperature); + const AccessorRO< Vec3, 3> acc_velocity (regions[0], FID_velocity); + + // Accessors for properties + const AccessorRO acc_rho (regions[0], FID_rho); + + // Accessors for conserved variables + const AccessorWO acc_Conserved (regions[1], FID_Conserved); + + // Extract execution domains + Domain r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Launch the kernel (launch domain might be composed by multiple rectangles) + for (RectInDomainIterator<3> Rit(r_ModCells); Rit(); Rit++) { + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, (*Rit)); + const dim3 num_blocks_3d = dim3((getSize(*Rit) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(*Rit) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(*Rit) + (TPB_3d.z - 1)) / TPB_3d.z); + UpdateConservedFromPrimitive_kernel<<>>( + acc_MassFracs, acc_temperature, acc_velocity, + acc_rho, acc_Conserved, (*Rit), + getSize(*Rit), getSize(*Rit), getSize(*Rit)); + } +} + +//----------------------------------------------------------------------------- +// KERNELS FOR UpdatePrimitiveFromConservedTask +//----------------------------------------------------------------------------- + +__global__ +void UpdatePrimitiveFromConserved_kernel(const AccessorRO Conserved, + const AccessorRW temperature, + const AccessorWO pressure, + const AccessorWO MolarFracs, + const AccessorWO< Vec3, 3> velocity, + const Rect<3> my_bounds, + const coord_t size_x, + const coord_t size_y, + const coord_t size_z) +{ + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; + int z = blockIdx.z * blockDim.z + threadIdx.z; + + if ((x < size_x) && (y < size_y) && (z < size_z)) { + const Point<3> p = Point<3>(x + my_bounds.lo.x, + y + my_bounds.lo.y, + z + my_bounds.lo.z); + UpdatePrimitiveFromConservedTask::UpdatePrimitive( + Conserved, temperature, pressure, + MolarFracs, velocity, + p, mix); + } +} + +__host__ +void UpdatePrimitiveFromConservedTask::gpu_base_impl( + const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime) +{ + assert(regions.size() == 3); + assert(futures.size() == 0); + + // Accessors for conserved variables + const AccessorRO acc_Conserved (regions[0], FID_Conserved); + + // Accessors for temperature variables + const AccessorRW acc_temperature (regions[1], FID_temperature); + + // Accessors for primitive variables + const AccessorWO acc_pressure (regions[1], FID_pressure); + const AccessorWO acc_MolarFracs (regions[1], FID_MolarFracs); + const AccessorWO< Vec3, 3> acc_velocity (regions[1], FID_velocity); + + // Extract execution domains + Rect<3> r_ModCells = runtime->get_index_space_domain(ctx, args.ModCells.get_index_space()); + + // Launch the kernel + const int threads_per_block = 256; + const dim3 TPB_3d = splitThreadsPerBlock(threads_per_block, r_ModCells); + const dim3 num_blocks_3d = dim3((getSize(r_ModCells) + (TPB_3d.x - 1)) / TPB_3d.x, + (getSize(r_ModCells) + (TPB_3d.y - 1)) / TPB_3d.y, + (getSize(r_ModCells) + (TPB_3d.z - 1)) / TPB_3d.z); + UpdatePrimitiveFromConserved_kernel<<>>( + acc_Conserved, acc_temperature, acc_pressure, + acc_MolarFracs, acc_velocity, r_ModCells, + getSize(r_ModCells), getSize(r_ModCells), getSize(r_ModCells)); +} //----------------------------------------------------------------------------- // KERNELS FOR GetVelocityGradientsTask @@ -206,6 +351,7 @@ void GetVelocityGradientsTask::gpu_base_impl( xsize, ysize, zsize); } +#if 0 //----------------------------------------------------------------------------- // KERNELS FOR GetTemperatureGradientTask //----------------------------------------------------------------------------- @@ -289,3 +435,4 @@ void GetTemperatureGradientTask::gpu_base_impl( getSize(r_MyFluid), getSize(r_MyFluid), getSize(r_MyFluid), xsize, ysize, zsize); } +#endif diff --git a/src/prometeo_variables.h b/src/prometeo_variables.h index 0a1c37c..65871a6 100644 --- a/src/prometeo_variables.h +++ b/src/prometeo_variables.h @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE diff --git a/src/prometeo_variables.hpp b/src/prometeo_variables.hpp index 018d5b9..9316348 100644 --- a/src/prometeo_variables.hpp +++ b/src/prometeo_variables.hpp @@ -7,7 +7,7 @@ // multi-GPU high-order code for hypersonic aerothermodynamics. // Computer Physics Communications 255, 107262" // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -38,20 +38,13 @@ using namespace Legion; // LOAD PROMETEO UTILITIES AND MODULES //----------------------------------------------------------------------------- +#include "my_array.hpp" +#include "task_helper.hpp" +#include "PointDomain_helper.hpp" #include "prometeo_types.h" -#include "task_helper.h" #include "prometeo_variables.h" #include "prometeo_metric.inl" -//----------------------------------------------------------------------------- -// LOAD THE EQUATION OF STATE FUNCTIONS -//----------------------------------------------------------------------------- -#define QUOTEME(M) #M -#define INCLUDE_FILE(M) QUOTEME(M.hpp) -#include INCLUDE_FILE( EOS ) -#undef QUOTEME -#undef INCLUDE_FILE - //----------------------------------------------------------------------------- // TASK THAT COMPUTES THE MIXTURE PROPERTIES //----------------------------------------------------------------------------- @@ -68,27 +61,141 @@ class UpdatePropertiesFromPrimitiveTask { }; public: __CUDA_H__ - static inline void UpdateProperties(const AccessorRO pressure, - const AccessorRO temperature, - const AccessorRO MolarFracs, - const AccessorRO< Vec3, 3> velocity, - const AccessorWO MassFracs, - const AccessorWO rho, - const AccessorWO mu, - const AccessorWO lam, - const AccessorWO Di, - const AccessorWO SoS, - const Point<3> p, + static inline void UpdateProperties(const AccessorRO &pressure, + const AccessorRO &temperature, + const AccessorRO &MolarFracs, + const AccessorRO< Vec3, 3> &velocity, + const AccessorWO &MassFracs, + const AccessorWO &rho, + const AccessorWO &mu, + const AccessorWO &lam, + const AccessorWO &Di, + const AccessorWO &SoS, +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + const AccessorWO &Ki, +#endif + const Point<3> &p, const Mix &mix) { - const double MixW = GetMolarWeightFromXi(MolarFracs[p].v, mix); - rho[p] = GetRho(pressure[p], temperature[p], MixW, mix); - mu[p] = GetViscosity(temperature[p], MolarFracs[p].v, mix); - lam[p] = GetHeatConductivity(temperature[p], MolarFracs[p].v, mix); - GetDiffusivity(Di[p].v, pressure[p], temperature[p], MixW, MolarFracs[p].v, mix); - GetMassFractions(MassFracs[p].v, MixW, MolarFracs[p].v, mix); - double gamma = GetGamma(temperature[p], MixW, MassFracs[p].v, mix); - SoS[p] = GetSpeedOfSound(temperature[p], gamma, MixW, mix); + const double MixW = mix.GetMolarWeightFromXi(MolarFracs[p]); + rho[p] = mix.GetRho(pressure[p], temperature[p], MixW); + mu[p] = mix.GetViscosity(temperature[p], MolarFracs[p]); + lam[p] = mix.GetHeatConductivity(temperature[p], MolarFracs[p]); + mix.GetDiffusivity(Di[p], pressure[p], temperature[p], MixW, MolarFracs[p]); + mix.GetMassFractions(MassFracs[p], MixW, MolarFracs[p]); + const double gamma = mix.GetGamma(temperature[p], MixW, MassFracs[p]); + SoS[p] = mix.GetSpeedOfSound(temperature[p], gamma, MixW); +#if (defined(ELECTRIC_FIELD) && (nIons > 0)) + mix.GetElectricMobility(Ki[p], pressure[p], temperature[p], MolarFracs[p]); +#endif + } + +public: + static const char * const TASK_NAME; + static const int TASK_ID; + static const bool CPU_BASE_LEAF = true; + static const bool GPU_BASE_LEAF = true; + static const int MAPPER_ID = 0; + static void cpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT COMPUTES THE CONSERVED VARIABLES FROM THE PRIMITIVE VARIABLES +//----------------------------------------------------------------------------- + +class UpdateConservedFromPrimitiveTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalRegion ModCells; + Mix mix; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + __CUDA_H__ + static inline void UpdateConserved(const AccessorRO &MassFracs, + const AccessorRO &temperature, + const AccessorRO< Vec3, 3> &velocity, + const AccessorRO &rho, + const AccessorWO &Conserved, + const Point<3> &p, + const Mix &mix) { + VecNSp rhoYi; mix.GetRhoYiFromYi(rhoYi, rho[p], MassFracs[p]); + __UNROLL__ + for (int i=0; i ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#ifdef LEGION_USE_CUDA + static void gpu_base_impl(const Args &args, + const std::vector ®ions, + const std::vector &futures, + Context ctx, Runtime *runtime); +#endif +}; + +//----------------------------------------------------------------------------- +// TASK THAT COMPUTES THE PRIMITIVE VARIABLES FROM THE CONSERVED VARIABLES +//----------------------------------------------------------------------------- + +class UpdatePrimitiveFromConservedTask { +public: + struct Args { + uint64_t arg_mask[1]; + LogicalRegion Fluid; + LogicalRegion ModCells; + Mix mix; + FieldID Fluid_fields [FID_last - 101]; + FieldID ModCells_fields [FID_last - 101]; + }; +public: + __CUDA_H__ + static inline void UpdatePrimitive(const AccessorRO &Conserved, + const AccessorRW &temperature, + const AccessorWO &pressure, + const AccessorWO &MolarFracs, + const AccessorWO< Vec3, 3> &velocity, + const Point<3> &p, + const Mix &mix) { + VecNSp rhoYi; + __UNROLL__ + for (int i=0; i __CUDA_H__ - static inline void computeDerivatives(const AccessorWO vGrad, - const AccessorRO velocity, - const Point<3> p, + static inline void computeDerivatives(const AccessorWO &vGrad, + const AccessorRO &velocity, + const Point<3> &p, const int nType, const double m, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { // Compute stencil points const Point<3> pM1 = warpPeriodic(bounds, p, dsize, offM1(nType)); const Point<3> pP1 = warpPeriodic(bounds, p, dsize, offP1(nType)); @@ -160,6 +268,7 @@ class GetVelocityGradientsTask { #endif }; +#if 0 //----------------------------------------------------------------------------- // TASK THAT COMPUTES THE VELOCITY GRADIENT //----------------------------------------------------------------------------- @@ -184,12 +293,12 @@ class GetTemperatureGradientTask { // Direction dependent quantities template __CUDA_H__ - static inline double computeDerivative(const AccessorRO temperature, - const Point<3> p, + static inline double computeDerivative(const AccessorRO &temperature, + const Point<3> &p, const int nType, const double m, const coord_t dsize, - const Rect<3> bounds) { + const Rect<3> &bounds) { // Compute stencil points const Point<3> pM1 = warpPeriodic(bounds, p, dsize, offM1(nType)); const Point<3> pP1 = warpPeriodic(bounds, p, dsize, offP1(nType)); @@ -207,5 +316,6 @@ class GetTemperatureGradientTask { Context ctx, Runtime *runtime); #endif }; +#endif #endif // __PROMETEO_VARIABLES_HPP__ diff --git a/src/prometeo_variables.rg b/src/prometeo_variables.rg index 596ab7f..f1b4bdd 100644 --- a/src/prometeo_variables.rg +++ b/src/prometeo_variables.rg @@ -7,7 +7,7 @@ -- multi-GPU high-order code for hypersonic aerothermodynamics. -- Computer Physics Communications 255, 107262" -- All rights reserved. --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -29,17 +29,18 @@ import "regent" -return function(SCHEMA, MIX, METRIC, Fluid_columns, DEBUG_OUTPUT) local Exports = {} +return function(SCHEMA, MIX, METRIC, TYPES, + ELECTRIC_FIELD) local Exports = {} ------------------------------------------------------------------------------- -- IMPORTS ------------------------------------------------------------------------------- local CONST = require "prometeo_const" local MACRO = require "prometeo_macro" -local TYPES = terralib.includec("prometeo_types.h", {"-DEOS="..os.getenv("EOS")}) -- Variable indices local nSpec = MIX.nSpec -- Number of species composing the mixture +local nIons = MIX.nIons -- Number of ions in the mixture local irU = CONST.GetirU(MIX) -- Index of the momentum in Conserved vector local irE = CONST.GetirE(MIX) -- Index of the total energy density in Conserved vector local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver @@ -47,10 +48,16 @@ local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solve local Primitives = CONST.Primitives local Properties = CONST.Properties +local Fluid_columns = TYPES.Fluid_columns + ------------------------------------------------------------------------------- -- MIXTURE PROPERTIES ROUTINES ------------------------------------------------------------------------------- +if (ELECTRIC_FIELD and (MIX.nIons > 0)) then + Properties:insert("Ki") +end + extern task Exports.UpdatePropertiesFromPrimitive(Fluid : region(ispace(int3d), Fluid_columns), ModCells : region(ispace(int3d), Fluid_columns), mix : MIX.Mixture) @@ -61,70 +68,31 @@ where writes(Fluid.[Properties]) end -Exports.UpdatePropertiesFromPrimitive:set_calling_convention(regentlib.convention.manual()) Exports.UpdatePropertiesFromPrimitive:set_task_id(TYPES.TID_UpdatePropertiesFromPrimitive) ------------------------------------------------------------------------------- -- CONSERVED TO PRIMITIVE/PRIMITIVE TO CONSERVED ROUTINES ------------------------------------------------------------------------------- -__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED -task Exports.UpdateConservedFromPrimitive(Fluid : region(ispace(int3d), Fluid_columns), - ModCells : region(ispace(int3d), Fluid_columns), - mix : MIX.Mixture) +extern task Exports.UpdateConservedFromPrimitive(Fluid : region(ispace(int3d), Fluid_columns), + ModCells : region(ispace(int3d), Fluid_columns), + mix : MIX.Mixture) where reads(Fluid.{MassFracs, temperature, velocity}), reads(Fluid.rho), writes(Fluid.Conserved) -do - __demand(__openmp) - for c in ModCells do - var rhoYi = MIX.GetRhoYiFromYi(Fluid[c].rho, Fluid[c].MassFracs) - var Conserved : double[nEq] - for i=0, nSpec do - Conserved[i] = rhoYi[i] - end - for i=0, 3 do - Conserved[i+irU] = Fluid[c].rho*Fluid[c].velocity[i] - end - Conserved[irE] = (Fluid[c].rho*(0.5*MACRO.dot(Fluid[c].velocity, Fluid[c].velocity) - + MIX.GetInternalEnergy(Fluid[c].temperature, Fluid[c].MassFracs, mix))) - -- TODO this trick is needed because of the bug in the write privileges in regent - Fluid[c].Conserved = Conserved - end end +Exports.UpdateConservedFromPrimitive:set_task_id(TYPES.TID_UpdateConservedFromPrimitive) -__demand(__cuda, __leaf) -- MANUALLY PARALLELIZED -task Exports.UpdatePrimitiveFromConserved(Fluid : region(ispace(int3d), Fluid_columns), - ModCells : region(ispace(int3d), Fluid_columns), - mix : MIX.Mixture) +extern task Exports.UpdatePrimitiveFromConserved(Fluid : region(ispace(int3d), Fluid_columns), + ModCells : region(ispace(int3d), Fluid_columns), + mix : MIX.Mixture) where reads(Fluid.Conserved), reads(Fluid.temperature), writes(Fluid.[Primitives]) -do - __demand(__openmp) - for c in ModCells do - var rhoYi : double[nSpec] - for i=0, nSpec do - rhoYi[i] = Fluid[c].Conserved[i] - end - var rho = MIX.GetRhoFromRhoYi(rhoYi) - var Yi = MIX.GetYi(rho, rhoYi) - Yi = MIX.ClipYi(Yi) - var MixW = MIX.GetMolarWeightFromYi(Yi, mix) - Fluid[c].MolarFracs = MIX.GetMolarFractions(MixW, Yi, mix) - var rhoInv = 1.0/rho - var velocity = array(Fluid[c].Conserved[irU+0]*rhoInv, - Fluid[c].Conserved[irU+1]*rhoInv, - Fluid[c].Conserved[irU+2]*rhoInv) - Fluid[c].velocity = velocity - var kineticEnergy = (0.5*MACRO.dot(velocity, velocity)) - var InternalEnergy = Fluid[c].Conserved[irE]*rhoInv - kineticEnergy - Fluid[c].temperature = MIX.GetTFromInternalEnergy(InternalEnergy, Fluid[c].temperature, Yi, mix) - Fluid[c].pressure = MIX.GetPFromRhoAndT(rho, MixW, Fluid[c].temperature) - end end +Exports.UpdatePrimitiveFromConserved:set_task_id(TYPES.TID_UpdatePrimitiveFromConserved) ------------------------------------------------------------------------------- -- GRADIENT ROUTINES @@ -139,20 +107,18 @@ where reads(Fluid.{dcsi_d, deta_d, dzet_d}), writes(Fluid.{velocityGradientX, velocityGradientY, velocityGradientZ}) end -Exports.GetVelocityGradients:set_calling_convention(regentlib.convention.manual()) Exports.GetVelocityGradients:set_task_id(TYPES.TID_GetVelocityGradients) -extern task Exports.GetTemperatureGradients(Ghost : region(ispace(int3d), Fluid_columns), - Fluid : region(ispace(int3d), Fluid_columns), - Fluid_bounds : rect3d) -where - reads(Ghost.temperature), - reads(Fluid.{nType_x, nType_y, nType_z}), - reads(Fluid.{dcsi_d, deta_d, dzet_d}), - writes(Fluid.temperatureGradient) -end -Exports.GetTemperatureGradients:set_calling_convention(regentlib.convention.manual()) -Exports.GetTemperatureGradients:set_task_id(TYPES.TID_GetTemperatureGradient) +--extern task Exports.GetTemperatureGradients(Ghost : region(ispace(int3d), Fluid_columns), +-- Fluid : region(ispace(int3d), Fluid_columns), +-- Fluid_bounds : rect3d) +--where +-- reads(Ghost.temperature), +-- reads(Fluid.{nType_x, nType_y, nType_z}), +-- reads(Fluid.{dcsi_d, deta_d, dzet_d}), +-- writes(Fluid.temperatureGradient) +--end +--Exports.GetTemperatureGradients:set_task_id(TYPES.TID_GetTemperatureGradient) return Exports end diff --git a/src/task_helper.h b/src/task_helper.h deleted file mode 100644 index 1172297..0000000 --- a/src/task_helper.h +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) "2019, by Stanford University -// Developer: Mario Di Renzo -// Affiliation: Center for Turbulence Research, Stanford University -// URL: https://ctr.stanford.edu -// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). -// HTR solver: An open-source exascale-oriented task-based -// multi-GPU high-order code for hypersonic aerothermodynamics. -// Computer Physics Communications 255, 107262" -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef __TASK_HELPER_H__ -#define __TASK_HELPER_H__ - -template using AccessorRO = FieldAccessor< READ_ONLY,FT,N,T,Realm::AffineAccessor >; -template using AccessorRW = FieldAccessor >; -template using AccessorWO = FieldAccessor >; - -#ifndef __CUDA_HD__ -#ifdef __CUDACC__ -#define __CUDA_HD__ __host__ __device__ -#else -#define __CUDA_HD__ -#endif -#endif - -#ifndef __CUDA_H__ -#ifdef __CUDACC__ -#define __CUDA_H__ __device__ -#else -#define __CUDA_H__ -#endif -#endif - -#ifndef __UNROLL__ -#ifdef __CUDACC__ -#define __UNROLL__ #pragma unroll -#else -#define __UNROLL__ -#endif -#endif - -#ifndef nSpec - #error "nSpec is undefined" -#endif - -#ifndef nEq - #error "nEq is undefined" -#endif - -template -struct MyArray { -public: - __CUDA_HD__ - inline T& operator[](int index) { -#ifdef BOUNDS_CHECKS - assert(index >= 0); - assert(index < SIZE); -#endif - return v[index]; - } - __CUDA_HD__ - inline T operator[](int index) const { -#ifdef BOUNDS_CHECKS - assert(index >= 0); - assert(index < SIZE); -#endif - return v[index]; - } -public: - T v[SIZE]; -}; - -typedef MyArray Vec3; -typedef MyArray VecNEq; -typedef MyArray VecNSp; - -enum direction { - Xdir, - Ydir, - Zdir -}; - -enum side { - Plus, - Minus -}; - -// Utility that computes the size of a Rect<3> -template -__CUDA_HD__ -inline coord_t getSize(const Rect<3> bounds); -template<> -__CUDA_HD__ -inline coord_t getSize(const Rect<3> bounds) { return bounds.hi.x - bounds.lo.x + 1; }; -template<> -__CUDA_HD__ -inline coord_t getSize(const Rect<3> bounds) { return bounds.hi.y - bounds.lo.y + 1; }; -template<> -__CUDA_HD__ -inline coord_t getSize(const Rect<3> bounds) { return bounds.hi.z - bounds.lo.z + 1; }; - -// Utility that computes the stencil point warping the point aroud periodic boundaries -template -static inline Point<3> warpPeriodic(const Rect<3> bounds, Point<3> p, const coord_t size, const int off); -template<> -__CUDA_HD__ -inline Point<3> warpPeriodic(const Rect<3> bounds, Point<3> p, const coord_t size, const int off) { - return Point<3>(((p.x + off - bounds.lo.x) % size + size) % size + bounds.lo.x, p.y, p.z); -}; -template<> -__CUDA_HD__ -inline Point<3> warpPeriodic(const Rect<3> bounds, Point<3> p, const coord_t size, const int off) { - return Point<3>((p.x + off - bounds.lo.x) % size + bounds.lo.x, p.y, p.z); -}; -template<> -__CUDA_HD__ -inline Point<3> warpPeriodic(const Rect<3> bounds, Point<3> p, const coord_t size, const int off) { - return Point<3>(p.x, ((p.y + off - bounds.lo.y) % size + size) % size + bounds.lo.y, p.z); -}; -template<> -__CUDA_HD__ -inline Point<3> warpPeriodic(const Rect<3> bounds, Point<3> p, const coord_t size, const int off) { - return Point<3>(p.x, (p.y + off - bounds.lo.y) % size + bounds.lo.y, p.z); -}; -template<> -__CUDA_HD__ -inline Point<3> warpPeriodic(const Rect<3> bounds, Point<3> p, const coord_t size, const int off) { - return Point<3>(p.x, p.y, ((p.z + off - bounds.lo.z) % size + size) % size + bounds.lo.z); -}; -template<> -__CUDA_HD__ -inline Point<3> warpPeriodic(const Rect<3> bounds, Point<3> p, const coord_t size, const int off) { - return Point<3>(p.x, p.y, (p.z + off - bounds.lo.z) % size + bounds.lo.z); -}; - -// Utility that registers tasks -namespace TaskHelper { - template - void base_cpu_wrapper(const Task *task, - const std::vector ®ions, - Context ctx, Runtime *runtime) - { - assert(task->arglen == 0); - assert(task->local_arglen == sizeof(typename T::Args)); - const typename T::Args *a = (typename T::Args*)task->local_args; - T::cpu_base_impl(*a, regions, task->futures, ctx, runtime); - } - -#ifdef LEGION_USE_CUDA - template - void base_gpu_wrapper(const Task *task, - const std::vector ®ions, - Context ctx, Runtime *runtime) - { - assert(task->arglen == 0); - assert(task->local_arglen == sizeof(typename T::Args)); - const typename T::Args *a = (typename T::Args*)task->local_args; - T::gpu_base_impl(*a, regions, task->futures, ctx, runtime); - } -#endif - - template - void register_hybrid_variants(void) - { - { - TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); - registrar.add_constraint(ProcessorConstraint(Processor::LOC_PROC)); - registrar.set_leaf(T::CPU_BASE_LEAF); - Runtime::preregister_task_variant >(registrar, T::TASK_NAME); - } -#ifdef REALM_USE_OPENMP - { - TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); - registrar.add_constraint(ProcessorConstraint(Processor::OMP_PROC)); - registrar.set_leaf(T::CPU_BASE_LEAF); - Runtime::preregister_task_variant >(registrar, T::TASK_NAME); - } -#endif -#ifdef LEGION_USE_CUDA - { - TaskVariantRegistrar registrar(T::TASK_ID, T::TASK_NAME); - registrar.add_constraint(ProcessorConstraint(Processor::TOC_PROC)); - registrar.set_leaf(T::GPU_BASE_LEAF); - Runtime::preregister_task_variant >(registrar, T::TASK_NAME); - } -#endif - } -}; - -#endif // __TASK_HELPER_H__ - diff --git a/testcases/Blasius/Blasius.json b/testcases/Blasius/Blasius.json index af158af..4ee8323 100644 --- a/testcases/Blasius/Blasius.json +++ b/testcases/Blasius/Blasius.json @@ -32,8 +32,10 @@ "cfl" : 0.9, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -119,5 +121,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/Blasius/MakeProfile.py b/testcases/Blasius/MakeProfile.py index 1f695bd..a0b8941 100644 --- a/testcases/Blasius/MakeProfile.py +++ b/testcases/Blasius/MakeProfile.py @@ -115,7 +115,7 @@ def objective(A): if (uB[i] > 0.99*U): delta = yB[i] break -data["Integrator"]["vorticityScale"] = U/delta +data["Integrator"]["EulerScheme"]["vorticityScale"] = U/delta u = np.interp(y, yB, uB) v = np.interp(y, yB, vB) diff --git a/testcases/Coleman/base.json b/testcases/Coleman/base.json index 36fba81..9d641ea 100644 --- a/testcases/Coleman/base.json +++ b/testcases/Coleman/base.json @@ -40,8 +40,10 @@ "cfl" : 0.5, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -113,6 +115,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/testcases/Coleman/postProc.py b/testcases/Coleman/postProc.py index c201dd3..3d38c31 100755 --- a/testcases/Coleman/postProc.py +++ b/testcases/Coleman/postProc.py @@ -226,7 +226,7 @@ rhoW = rho_avg[0] muW = mu_avg[0] -tauW = tau[0,3] +tauW = tau[0,1] uTau = np.sqrt(tauW/rhoW) ReTau = rhoW*uTau*yWidth*0.5/muW diff --git a/testcases/CompressibleBL/CBL.json b/testcases/CompressibleBL/CBL.json index 9216368..979451d 100644 --- a/testcases/CompressibleBL/CBL.json +++ b/testcases/CompressibleBL/CBL.json @@ -32,8 +32,10 @@ "cfl" : 0.5, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -115,5 +117,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/CompressibleBL/MakeInput.py b/testcases/CompressibleBL/MakeInput.py index b3c8c70..0c467fa 100755 --- a/testcases/CompressibleBL/MakeInput.py +++ b/testcases/CompressibleBL/MakeInput.py @@ -123,7 +123,7 @@ if (uB[i] > 0.99): delta = yB[i] break -config["Integrator"]["vorticityScale"] = UInf/delta +config["Integrator"]["EulerScheme"]["vorticityScale"] = UInf/delta uB *= UInf vB *= UInf diff --git a/testcases/Franko/MakeInput.py b/testcases/Franko/MakeInput.py index 0ecb806..3a45bb7 100755 --- a/testcases/Franko/MakeInput.py +++ b/testcases/Franko/MakeInput.py @@ -153,7 +153,7 @@ def VanDriestII(Cf): delta = yBin[i] break -config["Integrator"]["vorticityScale"] = UInf/delta +config["Integrator"]["EulerScheme"]["vorticityScale"] = UInf/delta # Rescale quantities uB *= UInf diff --git a/testcases/Franko/base.json b/testcases/Franko/base.json index 1d72c94..777f0b3 100644 --- a/testcases/Franko/base.json +++ b/testcases/Franko/base.json @@ -44,8 +44,10 @@ "cfl" : 0.8, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -134,6 +136,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/testcases/Franko/postProc.py b/testcases/Franko/postProc.py index 30fed99..834f99f 100755 --- a/testcases/Franko/postProc.py +++ b/testcases/Franko/postProc.py @@ -202,7 +202,7 @@ def VanDriestII(Cf): cfTurb, indT = getCfTurb((xGrid-xOrigin)/deltaStarIn) plt.figure(0) -plt.plot((xGrid-xOrigin)/deltaStarIn/100, 2.0*Xavg.tau[:,3]/(rhoInf*UInf**2)*1e4, label="Present formulation") +plt.plot((xGrid-xOrigin)/deltaStarIn/100, 2.0*Xavg.tau[:,1]/(rhoInf*UInf**2)*1e4, label="Present formulation") plt.plot((xGrid-xOrigin)/deltaStarIn/100, cfLam*1e4, '--k', label="Laminar BL") plt.plot((xGrid[indT:]-xOrigin)/deltaStarIn/100, cfTurb[indT:]*1e4, '-.k', label="Turbulent BL") plt.plot( CfProf["x"][:].values, CfProf["Cf"][:].values, 'ok', label="Franko and Lele (2013)") diff --git a/testcases/GrossmanCinnellaProblem/600.json b/testcases/GrossmanCinnellaProblem/600.json index 283a28f..73798e1 100644 --- a/testcases/GrossmanCinnellaProblem/600.json +++ b/testcases/GrossmanCinnellaProblem/600.json @@ -28,12 +28,14 @@ "startTime" : 0.0, "resetTime" : false, "maxIter" : 900, - "maxTime" : 0.2, + "maxTime" : 58.807109394117276, "cfl" : -0.002, - "fixedDeltaTime" : 1.0e-07, + "fixedDeltaTime" : 2.9403554697058637e-05, "implicitChemistry" : true, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -43,10 +45,10 @@ "type" : "Constant", "velocity" : [0.0, 0.0, 0.0] }, - "P" : 1.95256e5, + "P" : 1.95256e1, "TemperatureProfile" : { "type" : "Constant", - "temperature" : 9000.0 + "temperature" : 30.0 }, "MixtureProfile" : { "type" : "Constant", @@ -61,7 +63,7 @@ }, "xBCRight" : { "type" : "NSCBC_Outflow", - "P" : 1.0e4 + "P" : 1.0 }, "yBCLeft" : { "type" : "Periodic" }, "yBCRight" : { "type" : "Periodic" }, @@ -70,7 +72,16 @@ }, "Flow" : { - "mixture" : { "type" : "AirMix" }, + "mixture" : { + "type" : "AirMix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 1.0e4, + "XiRef" : { + "Species" : [{"Name" : "N2", "MolarFrac" : 0.79 }, + {"Name" : "O2", "MolarFrac" : 0.21 }] + } + }, "initCase" : { "type" : "GrossmanCinnellaProblem" }, "resetMixture" : false, "initMixture" : { @@ -95,5 +106,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/GrossmanCinnellaProblem/postProc.py b/testcases/GrossmanCinnellaProblem/postProc.py index 2b48664..c3fea97 100644 --- a/testcases/GrossmanCinnellaProblem/postProc.py +++ b/testcases/GrossmanCinnellaProblem/postProc.py @@ -73,9 +73,9 @@ def process(case, i): T = f['temperature' ][0,0,:] Xi = f['MolarFracs' ][0,0,:][:,:] - u /= 3.477201e+02 - p /= abs( p[xNum-1]) - rho /= abs(rho[xNum-1]) + u /= np.sqrt(1.4) + #p /= abs( p[xNum-1]) + #rho /= abs(rho[xNum-1]) ############################################################################## diff --git a/testcases/LaxProblem/100.json b/testcases/LaxProblem/100.json index 1e509ff..e889139 100644 --- a/testcases/LaxProblem/100.json +++ b/testcases/LaxProblem/100.json @@ -32,8 +32,10 @@ "cfl" : -0.4, "fixedDeltaTime" : 8.0e-4, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -113,5 +115,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/M2_Re4736/MakeInput.py b/testcases/M2_Re4736/MakeInput.py index f1202a7..5dea897 100755 --- a/testcases/M2_Re4736/MakeInput.py +++ b/testcases/M2_Re4736/MakeInput.py @@ -63,7 +63,7 @@ # Inlet boundary layer thickness delta99In = muInf*ReIn/(UInf*rhoInf) -config["Integrator"]["vorticityScale"] = UInf/delta99In +config["Integrator"]["EulerScheme"]["vorticityScale"] = UInf/delta99In # Wall properties r = Pr**(1.0/3.0) diff --git a/testcases/M2_Re4736/base.json b/testcases/M2_Re4736/base.json index 6065d2e..60486e3 100644 --- a/testcases/M2_Re4736/base.json +++ b/testcases/M2_Re4736/base.json @@ -45,8 +45,10 @@ "cfl" : 0.9, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -124,6 +126,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/testcases/M2_Re4736/postProc.py b/testcases/M2_Re4736/postProc.py index a15843a..ea86889 100755 --- a/testcases/M2_Re4736/postProc.py +++ b/testcases/M2_Re4736/postProc.py @@ -84,7 +84,7 @@ ############################################################################## # Skin Friction coefficient -Cf0 = 2.0*avg.tau[0,0,3]/(rhoInf*UInf**2) +Cf0 = 2.0*avg.tau[0,0,1]/(rhoInf*UInf**2) def getX0(Cf0): def VanDriestII(x0): Rexv = rhoInf*UInf*(avg.centerCoordinates[0,0,0] + x0)/muInf @@ -162,8 +162,8 @@ def VanDriestII(Cf): theta[i] += 0.5*dy*(rhoUNorm[j ]*(1.0 - UNorm[j ])+ rhoUNorm[j-1]*(1.0 - UNorm[j-1])) -uTau = np.sqrt(avg.tau[0,:,3]/avg.rho_avg[0,:]) -cf = 2.0*avg.tau[0,:,3]/(rhoInf*UInf**2) +uTau = np.sqrt(avg.tau[0,:,1]/avg.rho_avg[0,:]) +cf = 2.0*avg.tau[0,:,1]/(rhoInf*UInf**2) ReTau = avg.rho_avg[0,:]*uTau*delta99/avg.mu_avg[0,:] ReDelta = avg.rho_avg[-1,:]*ufav[-1,:]*delta99/avg.mu_avg[-1,:] ReTheta = avg.rho_avg[-1,:]*ufav[-1,:]* theta/avg.mu_avg[-1,:] @@ -207,7 +207,7 @@ def printSection(xR): ############################## iFig = 0 plt.figure(iFig); iFig +=1 -plt.plot(avg.centerCoordinates[0,:,0], 2.0*avg.tau[0,:,3]/(rhoInf*UInf**2), "k", label="Present formulation") +plt.plot(avg.centerCoordinates[0,:,0], 2.0*avg.tau[0,:,1]/(rhoInf*UInf**2), "k", label="Present formulation") plt.plot(avg.centerCoordinates[0,:,0], cfTurb, "-.k", label="Van Driest II") plt.xlabel(r"$(x-x_0)/\delta_0$", fontsize = 20) plt.ylabel(r"$\overline{C_f}$" , fontsize = 20) diff --git a/testcases/MultispeciesTBL/MakeInput.py b/testcases/MultispeciesTBL/MakeInput.py index b41a348..b8691e2 100755 --- a/testcases/MultispeciesTBL/MakeInput.py +++ b/testcases/MultispeciesTBL/MakeInput.py @@ -135,7 +135,7 @@ def VanDriestII(Cf): return cf -Cf = getCfTurb(config["Grid"]["xWidth"]+x0) +Cf = getCfTurb(config["Grid"]["xWidth"]+x0/deltaStarIn) TauW = Cf*(rhoInf*UInf**2)*0.5 uTau = np.sqrt(TauW/rhoW) deltaNu = muW/(uTau*rhoW) @@ -147,12 +147,43 @@ def VanDriestII(Cf): if (uB[i] > 0.99*UInf): delta = yB[i] break -config["Integrator"]["vorticityScale"] = UInf/delta +# Normalization scales +LRef = config["Flow"]["mixture"]["LRef"] = deltaStarIn +TRef = config["Flow"]["mixture"]["TRef"] = TInf +PRef = config["Flow"]["mixture"]["PRef"] = PInf +rhoRef = rhoInf +uRef = np.sqrt(PRef/rhoRef) +config["Flow"]["mixture"]["XiRef"] = [ + {"Name" : "N2", "MolarFrac" : N2B[-1]}, + {"Name" : "O2", "MolarFrac" : O2B[-1]}, + {"Name" : "NO", "MolarFrac" : NOB[-1]}, + {"Name" : "O", "MolarFrac" : OB[-1]}, + {"Name" : "N", "MolarFrac" : NB[-1]}] + +# Normalize everything +TInf = 1.0 +PInf = 1.0 +rhoInf = 1.0 +UInf /= uRef +cInf /= uRef +muInf /= np.sqrt(config["Flow"]["mixture"]["PRef"]*rhoRef)*LRef + +Tw /= config["Flow"]["mixture"]["TRef"] +muW /= np.sqrt(config["Flow"]["mixture"]["PRef"]*rhoRef)*LRef +rhoW /= rhoRef +delta /= config["Flow"]["mixture"]["LRef"] + +config["Integrator"]["EulerScheme"]["vorticityScale"] = UInf/delta + +x0 /= LRef +deltaStarIn /= LRef +deltaNu /= LRef config["Grid"]["origin"][0] = x0 -config["Grid"]["xWidth"] *= deltaStarIn -config["Grid"]["yWidth"] *= deltaStarIn -config["Grid"]["zWidth"] *= deltaStarIn + +uB /= uRef +TB /= TRef +rhoB /= rhoRef ############################################################################## # Boundary conditions # @@ -231,7 +262,7 @@ def objective(yStretching): config["Grid"]["zWidth"]/deltaNu) print(dx[0]/deltaNu, " x ", - dy[0]/deltaNu, " x ", + dy[1]/deltaNu, " x ", dz[0]/deltaNu) # Set maxTime diff --git a/testcases/MultispeciesTBL/base.json b/testcases/MultispeciesTBL/base.json index 3c29157..336918a 100644 --- a/testcases/MultispeciesTBL/base.json +++ b/testcases/MultispeciesTBL/base.json @@ -44,8 +44,10 @@ "cfl" : 0.8, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -93,7 +95,16 @@ }, "Flow" : { - "mixture" : { "type" : "AirMix" }, + "mixture" : { + "type" : "AirMix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 101325.0, + "XiRef" : { + "Species" : [{"Name" : "N2", "MolarFrac" : 0.79 }, + {"Name" : "O2", "MolarFrac" : 0.21 }] + } + }, "initCase" : { "type" : "Restart", "restartDir" : "" @@ -123,6 +134,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/testcases/MultispeciesTBL/postProc.py b/testcases/MultispeciesTBL/postProc.py index 71a40d3..eccf81b 100755 --- a/testcases/MultispeciesTBL/postProc.py +++ b/testcases/MultispeciesTBL/postProc.py @@ -139,7 +139,7 @@ if not os.path.exists(figureDir): os.makedirs(figureDir) -Cf = 2.0*Xavg.tau[:,3]/(rhoInf*UInf**2) +Cf = 2.0*Xavg.tau[:,1]/(rhoInf*UInf**2) Q = -Xavg.q[:,1]/(rhoInf*UInf*UInf*UInf) plt.rcParams.update({'font.size': 12}) diff --git a/testcases/PlanarJet/MakeInput.py b/testcases/PlanarJet/MakeInput.py index 7d20b4a..e8076fe 100755 --- a/testcases/PlanarJet/MakeInput.py +++ b/testcases/PlanarJet/MakeInput.py @@ -64,12 +64,17 @@ # Inlet displacement thickness h = mu_Ox*ReIn/((U_F-U_Ox)*rho_Ox) -config["Integrator"]["vorticityScale"] = (U_F-U_Ox)/h # Rescale quantities -config["Grid"]["xWidth"] *= h -config["Grid"]["yWidth"] *= h -config["Grid"]["zWidth"] *= h +U_F *= np.sqrt(rho_Ox/PInf) +U_Ox *= np.sqrt(rho_Ox/PInf) +config["Flow"]["mixture"]["LRef"] = h +config["Flow"]["mixture"]["PRef"] = PInf +config["Flow"]["mixture"]["TRef"] = TInf +config["Integrator"]["EulerScheme"]["vorticityScale"] = (U_F-U_Ox)/1.0 +#config["Grid"]["xWidth"] *= h +#config["Grid"]["yWidth"] *= h +#config["Grid"]["zWidth"] *= h config["Grid"]["origin"][1] = -0.5*config["Grid"]["yWidth"] ############################################################################## @@ -80,18 +85,18 @@ config["BC"]["xBCLeft"]["VelocityProfile"]["FileDir"] = restartDir assert config["BC"]["xBCLeft"]["TemperatureProfile"]["type"] == "File" config["BC"]["xBCLeft"]["TemperatureProfile"]["FileDir"] = restartDir -config["BC"]["xBCLeft"]["P"] = PInf +config["BC"]["xBCLeft"]["P"] = 1.0 assert config["BC"]["xBCLeft"]["MixtureProfile"]["type"] == "File" config["BC"]["xBCLeft"]["MixtureProfile"]["FileDir"] = restartDir assert config["BC"]["xBCRight"]["type"] == "NSCBC_Outflow" -config["BC"]["xBCRight"]["P"] = PInf +config["BC"]["xBCRight"]["P"] = 1.0 assert config["BC"]["yBCLeft"]["type"] == "NSCBC_Outflow" -config['BC']["yBCLeft"]["P"] = PInf +config['BC']["yBCLeft"]["P"] = 1.0 assert config["BC"]["yBCRight"]["type"] == "NSCBC_Outflow" -config["BC"]["yBCRight"]["P"] = PInf +config["BC"]["yBCRight"]["P"] = 1.0 ############################################################################## # Generate Grid # @@ -99,7 +104,7 @@ xGrid, dx = gridGen.GetGrid(config["Grid"]["origin"][0], config["Grid"]["xWidth"], - config["Grid"]["xNum"], + config["Grid"]["xNum"], config["Grid"]["xType"], 1.0, False) @@ -107,14 +112,14 @@ yGrid, dy = gridGen.GetGrid(config["Grid"]["origin"][1], config["Grid"]["yWidth"], - config["Grid"]["yNum"], + config["Grid"]["yNum"], config["Grid"]["yType"], config["Grid"]["yStretching"], False) zGrid, dz = gridGen.GetGrid(config["Grid"]["origin"][2], config["Grid"]["zWidth"], - config["Grid"]["zNum"], + config["Grid"]["zNum"], config["Grid"]["zType"], 1.0, True) @@ -166,8 +171,9 @@ if not os.path.exists(restartDir): os.makedirs(restartDir) -def profile(y, U1, U2, theta): - return 0.5*(U1+U2) + 0.5*(U1-U2)*np.tanh(0.5*(y-0.5*h)/theta) +def profile(y, U1, U2, ell, theta): + theta *= ell + return 0.5*(U1+U2) + 0.5*(U1-U2)*np.tanh(0.5*(y-0.5*ell)/theta) def writeTile(xt, yt, zt): lo_bound = [(xt )*NxTile +halo[0], (yt )*NyTile +halo[1], (zt )*NzTile +halo[2]] @@ -196,22 +202,22 @@ def writeTile(xt, yt, zt): velocity = np.ndarray(shape, dtype=np.dtype('(3,)f8')) dudtBoundary = np.ndarray(shape, dtype=np.dtype('(3,)f8')) dTdtBoundary = np.ndarray(shape) - pressure[:] = PInf + pressure[:] = 1.0 + temperature[:] = 1.0 + rho [:] = 1.0 + dudtBoundary[:] = [0.0, 0.0, 0.0] + dTdtBoundary[:] = 0.0 for (k,kc) in enumerate(centerCoordinates): for (j,jc) in enumerate(kc): for (i,ic) in enumerate(jc): y = abs(yGrid[j+lo_bound[1]]) - u = profile(y, U_F, U_Ox, 0.05*h) - X_F = profile(y, 1.0, 1e-60, 0.05*h) + u = profile(y, U_F, U_Ox, 1.0, 0.05) + X_F = profile(y, 1.0, 1e-60, 1.0, 0.05) X_Ox = 1.0-X_F centerCoordinates[k,j,i] = [xGrid[i+lo_bound[0]], yGrid[j+lo_bound[1]], zGrid[k+lo_bound[2]]] cellWidth [k,j,i] = [ dx[i+lo_bound[0]], dy[j+lo_bound[1]], dz[k+lo_bound[2]]] - temperature [k,j,i] = TInf - rho [k,j,i] = 1.0 MolarFracs [k,j,i] = [X_F, X_Ox, 1e-60, 1e-60] velocity [k,j,i] = [ u, 0.0, 0.0] - dudtBoundary [k,j,i] = [0.0, 0.0, 0.0] - dTdtBoundary [k,j,i] = 0.0 with h5py.File(os.path.join(restartDir, filename), 'w') as fout: fout.attrs.create("SpeciesNames", ["CH4".encode(), @@ -244,8 +250,6 @@ def writeTile(xt, yt, zt): fout["velocity"][:] = velocity fout["dudtBoundary"][:] = dudtBoundary fout["dTdtBoundary"][:] = dTdtBoundary - fout["velocity_old_NSCBC"][:] = velocity - fout["temperature_old_NSCBC"][:] = temperature fout["MolarFracs_profile"][:] = MolarFracs fout["velocity_profile"][:] = velocity fout["temperature_profile"][:] = temperature diff --git a/testcases/PlanarJet/base.json b/testcases/PlanarJet/base.json index 8fbbb75..55f4f3c 100644 --- a/testcases/PlanarJet/base.json +++ b/testcases/PlanarJet/base.json @@ -42,8 +42,10 @@ "cfl" : 0.8, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -109,6 +111,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/testcases/README.md b/testcases/README.md index 09ed78f..cdc2836 100644 --- a/testcases/README.md +++ b/testcases/README.md @@ -119,10 +119,37 @@ $HTR_DIR/prometeo.sh -i Stats.json python postProc.py -json Stats.json -in [Averages files produced by the code] ``` +### Speelman burner stabilized flame + +``` +cd Speelman +python Speelman.py (This is optional. It produces the reference solution using Cantera) +$HTR_DIR/prometeo.sh -i Speelman.json +python postProc.py +``` + +### Speelman_DV250 burner stabilized flame with applied voltage +### NB: This testacase requires the solver to be compiled with the `ELECTRIC_FIELD=1` + +``` +cd Speelman_DV250 +python mkHTRrestart.py +$HTR_DIR/prometeo.sh -i Speelman.json +python postProc.py +``` + ### Weak scaling test ``` -cd scalingTest/WS +cd scalingTest/WeakScaling +python scale_up.py -n [Number of refinements] -out [output dir] base.json +python postProc.py -n [Number of refinements] -out [output dir] +``` + +### Strong scaling test + +``` +cd scalingTest/StrongScaling python scale_up.py -n [Number of refinements] -out [output dir] base.json python postProc.py -n [Number of refinements] -out [output dir] ``` diff --git a/testcases/Sciacovelli/base.json b/testcases/Sciacovelli/base.json index 3c95272..103b9c3 100644 --- a/testcases/Sciacovelli/base.json +++ b/testcases/Sciacovelli/base.json @@ -40,8 +40,10 @@ "cfl" : 0.8, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -113,6 +115,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/testcases/Sciacovelli/postProc.py b/testcases/Sciacovelli/postProc.py index b6f887b..db11b05 100755 --- a/testcases/Sciacovelli/postProc.py +++ b/testcases/Sciacovelli/postProc.py @@ -73,7 +73,7 @@ rhoW = avg.rho_avg[0] muW = avg.mu_avg[0] -tauW = avg.tau[0,3] +tauW = avg.tau[0,1] uTau = np.sqrt(tauW/rhoW) ReTau = rhoW*uTau*yWidth*0.5/muW diff --git a/testcases/ShuOsherProblem/200.json b/testcases/ShuOsherProblem/200.json index 7175844..099f485 100644 --- a/testcases/ShuOsherProblem/200.json +++ b/testcases/ShuOsherProblem/200.json @@ -32,8 +32,10 @@ "cfl" : -0.4, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -99,5 +101,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/SodProblem/100.json b/testcases/SodProblem/100.json index ddff961..a570ef0 100644 --- a/testcases/SodProblem/100.json +++ b/testcases/SodProblem/100.json @@ -4,7 +4,7 @@ "tilesPerRank" : [1,1,1], "sampleId" : -1, "outDir" : "100", - "wallTime" : 10000 + "wallTime" : 10 }, "Grid" : { @@ -32,8 +32,10 @@ "cfl" : -0.4, "fixedDeltaTime" : 1.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0e-6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0e-6 + } }, "BC" : { @@ -113,5 +115,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/SodProblem/run.sh b/testcases/SodProblem/run.sh index 959587c..8278d9d 100644 --- a/testcases/SodProblem/run.sh +++ b/testcases/SodProblem/run.sh @@ -3,5 +3,5 @@ rm -rf sample* slurm* for cases in 100; do rm -r $cases mkdir $cases - USE_CUDA=1 PROFILE=0 QUEUE="gpu" $HTR_DIR/jobscripts/prometeo.sh -i $cases.json -o $cases + PROFILE=0 $HTR_DIR/prometeo.sh -i $cases.json -o $cases done diff --git a/testcases/Speelman/Lu.cti b/testcases/Speelman/Lu.cti new file mode 100644 index 0000000..8323e51 --- /dev/null +++ b/testcases/Speelman/Lu.cti @@ -0,0 +1,1351 @@ +""" + A 30-species skeletal mechanism based on GRI3.0 + + by Tianfeng Lu + Email: tlu@engr.uconn.edu + + Reference: + Tianfeng Lu and Chung K. Law, + "A criterion based on computational singular perturbation + for the identification of quasi steady state species: + A reduced mechanism for methane oxidation with NO chemistry," + Combustion and Flame, Vol.154 No.4 pp.761774, 2008. + + +""" + +units(length='cm', time='s', quantity='mol', act_energy='cal/mol') + +ideal_gas(name='gas', + elements="O H C N Ar", + species="""H2 H O O2 OH H2O HO2 + H2O2 C CH CH2 CH2(S) CH3 CH4 + CO CO2 HCO CH2O CH2OH CH3O CH3OH + C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO + CH2CHO N2""", + reactions='all', + transport='Mix', + initial_state=state(temperature=300.0, pressure=OneAtm)) + +#------------------------------------------------------------------------------- +# Species data +#------------------------------------------------------------------------------- + +species(name=u'H2', + atoms='H:2', + thermo=(NASA([200.00, 1000.00], + [ 2.34433112E+00, 7.98052075E-03, -1.94781510E-05, + 2.01572094E-08, -7.37611761E-12, -9.17935173E+02, + 6.83010238E-01]), + NASA([1000.00, 3500.00], + [ 3.33727920E+00, -4.94024731E-05, 4.99456778E-07, + -1.79566394E-10, 2.00255376E-14, -9.50158922E+02, + -3.20502331E+00])), + transport=gas_transport(geom='linear', + diam=2.92, + well_depth=38.0, + polar=0.79, + rot_relax=280.0), + note=u'TPIS78') + +species(name=u'H', + atoms='H:1', + thermo=(NASA([200.00, 1000.00], + [ 2.50000000E+00, 7.05332819E-13, -1.99591964E-15, + 2.30081632E-18, -9.27732332E-22, 2.54736599E+04, + -4.46682853E-01]), + NASA([1000.00, 3500.00], + [ 2.50000001E+00, -2.30842973E-11, 1.61561948E-14, + -4.73515235E-18, 4.98197357E-22, 2.54736599E+04, + -4.46682914E-01])), + transport=gas_transport(geom='atom', + diam=2.05, + well_depth=145.0), + note=u'L7/88') + +species(name=u'O', + atoms='O:1', + thermo=(NASA([200.00, 1000.00], + [ 3.16826710E+00, -3.27931884E-03, 6.64306396E-06, + -6.12806624E-09, 2.11265971E-12, 2.91222592E+04, + 2.05193346E+00]), + NASA([1000.00, 3500.00], + [ 2.56942078E+00, -8.59741137E-05, 4.19484589E-08, + -1.00177799E-11, 1.22833691E-15, 2.92175791E+04, + 4.78433864E+00])), + transport=gas_transport(geom='atom', + diam=2.75, + well_depth=80.0), + note=u'L1/90') + +species(name=u'O2', + atoms='O:2', + thermo=(NASA([200.00, 1000.00], + [ 3.78245636E+00, -2.99673416E-03, 9.84730201E-06, + -9.68129509E-09, 3.24372837E-12, -1.06394356E+03, + 3.65767573E+00]), + NASA([1000.00, 3500.00], + [ 3.28253784E+00, 1.48308754E-03, -7.57966669E-07, + 2.09470555E-10, -2.16717794E-14, -1.08845772E+03, + 5.45323129E+00])), + transport=gas_transport(geom='linear', + diam=3.458, + well_depth=107.4, + polar=1.6, + rot_relax=3.8), + note=u'TPIS89') + +species(name=u'OH', + atoms='H:1 O:1', + thermo=(NASA([200.00, 1000.00], + [ 3.99201543E+00, -2.40131752E-03, 4.61793841E-06, + -3.88113333E-09, 1.36411470E-12, 3.61508056E+03, + -1.03925458E-01]), + NASA([1000.00, 3500.00], + [ 3.09288767E+00, 5.48429716E-04, 1.26505228E-07, + -8.79461556E-11, 1.17412376E-14, 3.85865700E+03, + 4.47669610E+00])), + transport=gas_transport(geom='linear', + diam=2.75, + well_depth=80.0), + note=u'RUS78') + +species(name=u'H2O', + atoms='H:2 O:1', + thermo=(NASA([200.00, 1000.00], + [ 4.19864056E+00, -2.03643410E-03, 6.52040211E-06, + -5.48797062E-09, 1.77197817E-12, -3.02937267E+04, + -8.49032208E-01]), + NASA([1000.00, 3500.00], + [ 3.03399249E+00, 2.17691804E-03, -1.64072518E-07, + -9.70419870E-11, 1.68200992E-14, -3.00042971E+04, + 4.96677010E+00])), + transport=gas_transport(geom='nonlinear', + diam=2.605, + well_depth=572.4, + dipole=1.844, + rot_relax=4.0), + note=u'L8/89') + +species(name=u'HO2', + atoms='H:1 O:2', + thermo=(NASA([200.00, 1000.00], + [ 4.30179801E+00, -4.74912051E-03, 2.11582891E-05, + -2.42763894E-08, 9.29225124E-12, 2.94808040E+02, + 3.71666245E+00]), + NASA([1000.00, 3500.00], + [ 4.01721090E+00, 2.23982013E-03, -6.33658150E-07, + 1.14246370E-10, -1.07908535E-14, 1.11856713E+02, + 3.78510215E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.458, + well_depth=107.4, + rot_relax=1.0), + note=u'L5/89') + +species(name=u'H2O2', + atoms='H:2 O:2', + thermo=(NASA([200.00, 1000.00], + [ 4.27611269E+00, -5.42822417E-04, 1.67335701E-05, + -2.15770813E-08, 8.62454363E-12, -1.77025821E+04, + 3.43505074E+00]), + NASA([1000.00, 3500.00], + [ 4.16500285E+00, 4.90831694E-03, -1.90139225E-06, + 3.71185986E-10, -2.87908305E-14, -1.78617877E+04, + 2.91615662E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.458, + well_depth=107.4, + rot_relax=3.8), + note=u'L7/88') + +species(name=u'C', + atoms='C:1', + thermo=(NASA([200.00, 1000.00], + [ 2.55423955E+00, -3.21537724E-04, 7.33792245E-07, + -7.32234889E-10, 2.66521446E-13, 8.54438832E+04, + 4.53130848E+00]), + NASA([1000.00, 3500.00], + [ 2.49266888E+00, 4.79889284E-05, -7.24335020E-08, + 3.74291029E-11, -4.87277893E-15, 8.54512953E+04, + 4.80150373E+00])), + transport=gas_transport(geom='atom', + diam=3.298, + well_depth=71.4), + note=u'L11/88') + +species(name=u'CH', + atoms='H:1 C:1', + thermo=(NASA([200.00, 1000.00], + [ 3.48981665E+00, 3.23835541E-04, -1.68899065E-06, + 3.16217327E-09, -1.40609067E-12, 7.07972934E+04, + 2.08401108E+00]), + NASA([1000.00, 3500.00], + [ 2.87846473E+00, 9.70913681E-04, 1.44445655E-07, + -1.30687849E-10, 1.76079383E-14, 7.10124364E+04, + 5.48497999E+00])), + transport=gas_transport(geom='linear', + diam=2.75, + well_depth=80.0), + note=u'TPIS79') + +species(name=u'CH2', + atoms='H:2 C:1', + thermo=(NASA([200.00, 1000.00], + [ 3.76267867E+00, 9.68872143E-04, 2.79489841E-06, + -3.85091153E-09, 1.68741719E-12, 4.60040401E+04, + 1.56253185E+00]), + NASA([1000.00, 3500.00], + [ 2.87410113E+00, 3.65639292E-03, -1.40894597E-06, + 2.60179549E-10, -1.87727567E-14, 4.62636040E+04, + 6.17119324E+00])), + transport=gas_transport(geom='linear', + diam=3.8, + well_depth=144.0), + note=u'LS/93') + +species(name=u'CH2(S)', + atoms='H:2 C:1', + thermo=(NASA([200.00, 1000.00], + [ 4.19860411E+00, -2.36661419E-03, 8.23296220E-06, + -6.68815981E-09, 1.94314737E-12, 5.04968163E+04, + -7.69118967E-01]), + NASA([1000.00, 3500.00], + [ 2.29203842E+00, 4.65588637E-03, -2.01191947E-06, + 4.17906000E-10, -3.39716365E-14, 5.09259997E+04, + 8.62650169E+00])), + transport=gas_transport(geom='linear', + diam=3.8, + well_depth=144.0), + note=u'LS/93') + +species(name=u'CH3', + atoms='H:3 C:1', + thermo=(NASA([200.00, 1000.00], + [ 3.67359040E+00, 2.01095175E-03, 5.73021856E-06, + -6.87117425E-09, 2.54385734E-12, 1.64449988E+04, + 1.60456433E+00]), + NASA([1000.00, 3500.00], + [ 2.28571772E+00, 7.23990037E-03, -2.98714348E-06, + 5.95684644E-10, -4.67154394E-14, 1.67755843E+04, + 8.48007179E+00])), + transport=gas_transport(geom='linear', + diam=3.8, + well_depth=144.0), + note=u'L11/89') + +species(name=u'CH4', + atoms='H:4 C:1', + thermo=(NASA([200.00, 1000.00], + [ 5.14987613E+00, -1.36709788E-02, 4.91800599E-05, + -4.84743026E-08, 1.66693956E-11, -1.02466476E+04, + -4.64130376E+00]), + NASA([1000.00, 3500.00], + [ 7.48514950E-02, 1.33909467E-02, -5.73285809E-06, + 1.22292535E-09, -1.01815230E-13, -9.46834459E+03, + 1.84373180E+01])), + transport=gas_transport(geom='nonlinear', + diam=3.746, + well_depth=141.4, + polar=2.6, + rot_relax=13.0), + note=u'L8/88') + +species(name=u'CO', + atoms='C:1 O:1', + thermo=(NASA([200.00, 1000.00], + [ 3.57953347E+00, -6.10353680E-04, 1.01681433E-06, + 9.07005884E-10, -9.04424499E-13, -1.43440860E+04, + 3.50840928E+00]), + NASA([1000.00, 3500.00], + [ 2.71518561E+00, 2.06252743E-03, -9.98825771E-07, + 2.30053008E-10, -2.03647716E-14, -1.41518724E+04, + 7.81868772E+00])), + transport=gas_transport(geom='linear', + diam=3.65, + well_depth=98.1, + polar=1.95, + rot_relax=1.8), + note=u'TPIS79') + +species(name=u'CO2', + atoms='C:1 O:2', + thermo=(NASA([200.00, 1000.00], + [ 2.35677352E+00, 8.98459677E-03, -7.12356269E-06, + 2.45919022E-09, -1.43699548E-13, -4.83719697E+04, + 9.90105222E+00]), + NASA([1000.00, 3500.00], + [ 3.85746029E+00, 4.41437026E-03, -2.21481404E-06, + 5.23490188E-10, -4.72084164E-14, -4.87591660E+04, + 2.27163806E+00])), + transport=gas_transport(geom='linear', + diam=3.763, + well_depth=244.0, + polar=2.65, + rot_relax=2.1), + note=u'L7/88') + +species(name=u'HCO', + atoms='H:1 C:1 O:1', + thermo=(NASA([200.00, 1000.00], + [ 4.22118584E+00, -3.24392532E-03, 1.37799446E-05, + -1.33144093E-08, 4.33768865E-12, 3.83956496E+03, + 3.39437243E+00]), + NASA([1000.00, 3500.00], + [ 2.77217438E+00, 4.95695526E-03, -2.48445613E-06, + 5.89161778E-10, -5.33508711E-14, 4.01191815E+03, + 9.79834492E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.59, + well_depth=498.0), + note=u'L12/89') + +species(name=u'CH2O', + atoms='H:2 C:1 O:1', + thermo=(NASA([200.00, 1000.00], + [ 4.79372315E+00, -9.90833369E-03, 3.73220008E-05, + -3.79285261E-08, 1.31772652E-11, -1.43089567E+04, + 6.02812900E-01]), + NASA([1000.00, 3500.00], + [ 1.76069008E+00, 9.20000082E-03, -4.42258813E-06, + 1.00641212E-09, -8.83855640E-14, -1.39958323E+04, + 1.36563230E+01])), + transport=gas_transport(geom='nonlinear', + diam=3.59, + well_depth=498.0, + rot_relax=2.0), + note=u'L8/88') + +species(name=u'CH2OH', + atoms='H:3 C:1 O:1', + thermo=(NASA([200.00, 1000.00], + [ 3.86388918E+00, 5.59672304E-03, 5.93271791E-06, + -1.04532012E-08, 4.36967278E-12, -3.19391367E+03, + 5.47302243E+00]), + NASA([1000.00, 3500.00], + [ 3.69266569E+00, 8.64576797E-03, -3.75101120E-06, + 7.87234636E-10, -6.48554201E-14, -3.24250627E+03, + 5.81043215E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.69, + well_depth=417.0, + dipole=1.7, + rot_relax=2.0), + note=u'GUNL93') + +species(name=u'CH3O', + atoms='H:3 C:1 O:1', + thermo=(NASA([300.00, 1000.00], + [ 2.10620400E+00, 7.21659500E-03, 5.33847200E-06, + -7.37763600E-09, 2.07561000E-12, 9.78601100E+02, + 1.31521770E+01]), + NASA([1000.00, 3000.00], + [ 3.77079900E+00, 7.87149700E-03, -2.65638400E-06, + 3.94443100E-10, -2.11261600E-14, 1.27832520E+02, + 2.92957500E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.69, + well_depth=417.0, + dipole=1.7, + rot_relax=2.0), + note=u'121686') + +species(name=u'CH3OH', + atoms='H:4 C:1 O:1', + thermo=(NASA([200.00, 1000.00], + [ 5.71539582E+00, -1.52309129E-02, 6.52441155E-05, + -7.10806889E-08, 2.61352698E-11, -2.56427656E+04, + -1.50409823E+00]), + NASA([1000.00, 3500.00], + [ 1.78970791E+00, 1.40938292E-02, -6.36500835E-06, + 1.38171085E-09, -1.17060220E-13, -2.53748747E+04, + 1.45023623E+01])), + transport=gas_transport(geom='nonlinear', + diam=3.626, + well_depth=481.8, + rot_relax=1.0), + note=u'L8/88') + +species(name=u'C2H2', + atoms='H:2 C:2', + thermo=(NASA([200.00, 1000.00], + [ 8.08681094E-01, 2.33615629E-02, -3.55171815E-05, + 2.80152437E-08, -8.50072974E-12, 2.64289807E+04, + 1.39397051E+01]), + NASA([1000.00, 3500.00], + [ 4.14756964E+00, 5.96166664E-03, -2.37294852E-06, + 4.67412171E-10, -3.61235213E-14, 2.59359992E+04, + -1.23028121E+00])), + transport=gas_transport(geom='linear', + diam=4.1, + well_depth=209.0, + rot_relax=2.5), + note=u'L1/91') + +species(name=u'C2H3', + atoms='H:3 C:2', + thermo=(NASA([200.00, 1000.00], + [ 3.21246645E+00, 1.51479162E-03, 2.59209412E-05, + -3.57657847E-08, 1.47150873E-11, 3.48598468E+04, + 8.51054025E+00]), + NASA([1000.00, 3500.00], + [ 3.01672400E+00, 1.03302292E-02, -4.68082349E-06, + 1.01763288E-09, -8.62607041E-14, 3.46128739E+04, + 7.78732378E+00])), + transport=gas_transport(geom='nonlinear', + diam=4.1, + well_depth=209.0, + rot_relax=1.0), + note=u'L2/92') + +species(name=u'C2H4', + atoms='H:4 C:2', + thermo=(NASA([200.00, 1000.00], + [ 3.95920148E+00, -7.57052247E-03, 5.70990292E-05, + -6.91588753E-08, 2.69884373E-11, 5.08977593E+03, + 4.09733096E+00]), + NASA([1000.00, 3500.00], + [ 2.03611116E+00, 1.46454151E-02, -6.71077915E-06, + 1.47222923E-09, -1.25706061E-13, 4.93988614E+03, + 1.03053693E+01])), + transport=gas_transport(geom='nonlinear', + diam=3.971, + well_depth=280.8, + rot_relax=1.5), + note=u'L1/91') + +species(name=u'C2H5', + atoms='H:5 C:2', + thermo=(NASA([200.00, 1000.00], + [ 4.30646568E+00, -4.18658892E-03, 4.97142807E-05, + -5.99126606E-08, 2.30509004E-11, 1.28416265E+04, + 4.70720924E+00]), + NASA([1000.00, 3500.00], + [ 1.95465642E+00, 1.73972722E-02, -7.98206668E-06, + 1.75217689E-09, -1.49641576E-13, 1.28575200E+04, + 1.34624343E+01])), + transport=gas_transport(geom='nonlinear', + diam=4.302, + well_depth=252.3, + rot_relax=1.5), + note=u'L12/92') + +species(name=u'C2H6', + atoms='H:6 C:2', + thermo=(NASA([200.00, 1000.00], + [ 4.29142492E+00, -5.50154270E-03, 5.99438288E-05, + -7.08466285E-08, 2.68685771E-11, -1.15222055E+04, + 2.66682316E+00]), + NASA([1000.00, 3500.00], + [ 1.07188150E+00, 2.16852677E-02, -1.00256067E-05, + 2.21412001E-09, -1.90002890E-13, -1.14263932E+04, + 1.51156107E+01])), + transport=gas_transport(geom='nonlinear', + diam=4.302, + well_depth=252.3, + rot_relax=1.5), + note=u'L8/88') + +species(name=u'HCCO', + atoms='H:1 C:2 O:1', + thermo=(NASA([300.00, 1000.00], + [ 2.25172140E+00, 1.76550210E-02, -2.37291010E-05, + 1.72757590E-08, -5.06648110E-12, 2.00594490E+04, + 1.24904170E+01]), + NASA([1000.00, 4000.00], + [ 5.62820580E+00, 4.08534010E-03, -1.59345470E-06, + 2.86260520E-10, -1.94078320E-14, 1.93272150E+04, + -3.93025950E+00])), + transport=gas_transport(geom='nonlinear', + diam=2.5, + well_depth=150.0, + rot_relax=1.0), + note=u'SRIC91') + +species(name=u'CH2CO', + atoms='H:2 C:2 O:1', + thermo=(NASA([200.00, 1000.00], + [ 2.13583630E+00, 1.81188721E-02, -1.73947474E-05, + 9.34397568E-09, -2.01457615E-12, -7.04291804E+03, + 1.22156480E+01]), + NASA([1000.00, 3500.00], + [ 4.51129732E+00, 9.00359745E-03, -4.16939635E-06, + 9.23345882E-10, -7.94838201E-14, -7.55105311E+03, + 6.32247205E-01])), + transport=gas_transport(geom='nonlinear', + diam=3.97, + well_depth=436.0, + rot_relax=2.0), + note=u'L5/90') + +species(name=u'CH2CHO', + atoms='H:3 C:2 O:1', + thermo=(NASA([300.00, 1000.00], + [ 3.40906200E+00, 1.07385740E-02, 1.89149200E-06, + -7.15858300E-09, 2.86738500E-12, 1.52147660E+03, + 9.55829000E+00]), + NASA([1000.00, 5000.00], + [ 5.97567000E+00, 8.13059100E-03, -2.74362400E-06, + 4.07030400E-10, -2.17601700E-14, 4.90321800E+02, + -5.04525100E+00])), + transport=gas_transport(geom='nonlinear', + diam=3.97, + well_depth=436.0, + rot_relax=2.0), + note=u'SAND86') + +species(name=u'N2', + atoms='N:2', + thermo=(NASA([300.00, 1000.00], + [ 3.29867700E+00, 1.40824040E-03, -3.96322200E-06, + 5.64151500E-09, -2.44485400E-12, -1.02089990E+03, + 3.95037200E+00]), + NASA([1000.00, 5000.00], + [ 2.92664000E+00, 1.48797680E-03, -5.68476000E-07, + 1.00970380E-10, -6.75335100E-15, -9.22797700E+02, + 5.98052800E+00])), + transport=gas_transport(geom='linear', + diam=3.621, + well_depth=97.53, + polar=1.76, + rot_relax=4.0), + note=u'121286') + +#------------------------------------------------------------------------------- +# Reaction data +#------------------------------------------------------------------------------- +# R1 + +# Reaction 1 +three_body_reaction('2 O + M <=> O2 + M', [1.200000e+17, -1.0, 0.0], + efficiencies='CO2:3.6 CO:1.75 H2:2.4 H2O:15.4 CH4:2.0 C2H6:3.0') +# R2 + +# Reaction 2 +three_body_reaction('O + H + M <=> OH + M', [5.000000e+17, -1.0, 0.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0') +# R3 + +# Reaction 3 +reaction('O + H2 <=> H + OH', [3.870000e+04, 2.7, 6260.0]) +# R4 + +# Reaction 4 +reaction('O + HO2 <=> OH + O2', [2.000000e+13, 0.0, 0.0]) +# R5 + +# Reaction 5 +reaction('O + H2O2 <=> OH + HO2', [9.630000e+06, 2.0, 4000.0]) +# R6 + +# Reaction 6 +reaction('O + CH <=> H + CO', [5.700000e+13, 0.0, 0.0]) +# R7 + +# Reaction 7 +reaction('O + CH2 <=> H + HCO', [8.000000e+13, 0.0, 0.0]) +# R8 + +# Reaction 8 +reaction('O + CH2(S) <=> H2 + CO', [1.500000e+13, 0.0, 0.0]) +# R9 + +# Reaction 9 +reaction('O + CH2(S) <=> H + HCO', [1.500000e+13, 0.0, 0.0]) +# R10 + +# Reaction 10 +reaction('O + CH3 <=> H + CH2O', [5.060000e+13, 0.0, 0.0]) +# R11 + +# Reaction 11 +reaction('O + CH4 <=> OH + CH3', [1.020000e+09, 1.5, 8600.0]) +# R12 + +# Reaction 12 +falloff_reaction('O + CO (+ M) <=> CO2 (+ M)', + kf=[1.800000e+10, 0.0, 2385.0], + kf0=[6.020000e+14, 0.0, 3000.0], + efficiencies='CO2:3.5 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0 O2:6.0') +# R13 + +# Reaction 13 +reaction('O + HCO <=> OH + CO', [3.000000e+13, 0.0, 0.0]) +# R14 + +# Reaction 14 +reaction('O + HCO <=> H + CO2', [3.000000e+13, 0.0, 0.0]) +# R15 + +# Reaction 15 +reaction('O + CH2O <=> OH + HCO', [3.900000e+13, 0.0, 3540.0]) +# R16 + +# Reaction 16 +reaction('O + CH2OH <=> OH + CH2O', [1.000000e+13, 0.0, 0.0]) +# R17 + +# Reaction 17 +reaction('O + CH3O <=> OH + CH2O', [1.000000e+13, 0.0, 0.0]) +# R18 + +# Reaction 18 +reaction('O + CH3OH <=> OH + CH2OH', [3.880000e+05, 2.5, 3100.0]) +# R19 + +# Reaction 19 +reaction('O + CH3OH <=> OH + CH3O', [1.300000e+05, 2.5, 5000.0]) +# R20 + +# Reaction 20 +reaction('O + C2H2 <=> H + HCCO', [1.350000e+07, 2.0, 1900.0]) +# R21 + +# Reaction 21 +reaction('O + C2H2 <=> CO + CH2', [6.940000e+06, 2.0, 1900.0]) +# R22 + +# Reaction 22 +reaction('O + C2H3 <=> H + CH2CO', [3.000000e+13, 0.0, 0.0]) +# R23 + +# Reaction 23 +reaction('O + C2H4 <=> CH3 + HCO', [1.250000e+07, 1.83, 220.0]) +# R24 + +# Reaction 24 +reaction('O + C2H5 <=> CH3 + CH2O', [2.240000e+13, 0.0, 0.0]) +# R25 + +# Reaction 25 +reaction('O + C2H6 <=> OH + C2H5', [8.980000e+07, 1.92, 5690.0]) +# R26 + +# Reaction 26 +reaction('O + HCCO <=> H + 2 CO', [1.000000e+14, 0.0, 0.0]) +# R27 + +# Reaction 27 +reaction('O + CH2CO <=> OH + HCCO', [1.000000e+13, 0.0, 8000.0]) +# R28 + +# Reaction 28 +reaction('O + CH2CO <=> CH2 + CO2', [1.750000e+12, 0.0, 1350.0]) +# R29 + +# Reaction 29 +reaction('O2 + CO <=> O + CO2', [2.500000e+12, 0.0, 47800.0]) +# R30 + +# Reaction 30 +reaction('O2 + CH2O <=> HO2 + HCO', [1.000000e+14, 0.0, 40000.0]) +# R31 + +# Reaction 31 +three_body_reaction('H + O2 + M <=> HO2 + M', [2.800000e+18, -0.86, 0.0], + efficiencies='CO2:1.5 CO:0.75 H2O:0.0 C2H6:1.5 N2:0.0 O2:0.0') +# R32 + +# Reaction 32 +reaction('H + 2 O2 <=> HO2 + O2', [2.080000e+19, -1.24, 0.0]) +# R33 + +# Reaction 33 +reaction('H + O2 + H2O <=> HO2 + H2O', [1.126000e+19, -0.76, 0.0]) +# R34 + +# Reaction 34 +reaction('H + O2 + N2 <=> HO2 + N2', [2.600000e+19, -1.24, 0.0]) +# R35 + +# Reaction 35 +reaction('H + O2 <=> O + OH', [2.650000e+16, -0.6707, 17041.0]) +# R36 + +# Reaction 36 +three_body_reaction('2 H + M <=> H2 + M', [1.000000e+18, -1.0, 0.0], + efficiencies='H2:0.0 C2H6:3.0 H2O:0.0 CO2:0.0 CH4:2.0') +# R37 + +# Reaction 37 +reaction('2 H + H2 <=> 2 H2', [9.000000e+16, -0.6, 0.0]) +# R38 + +# Reaction 38 +reaction('2 H + H2O <=> H2 + H2O', [6.000000e+19, -1.25, 0.0]) +# R39 + +# Reaction 39 +reaction('2 H + CO2 <=> H2 + CO2', [5.500000e+20, -2.0, 0.0]) +# R40 + +# Reaction 40 +three_body_reaction('H + OH + M <=> H2O + M', [2.200000e+22, -2.0, 0.0], + efficiencies='H2:0.73 C2H6:3.0 H2O:3.65 CH4:2.0') +# R41 + +# Reaction 41 +reaction('H + HO2 <=> O + H2O', [3.970000e+12, 0.0, 671.0]) +# R42 + +# Reaction 42 +reaction('H + HO2 <=> O2 + H2', [4.480000e+13, 0.0, 1068.0]) +# R43 + +# Reaction 43 +reaction('H + HO2 <=> 2 OH', [8.400000e+13, 0.0, 635.0]) +# R44 + +# Reaction 44 +reaction('H + H2O2 <=> HO2 + H2', [1.210000e+07, 2.0, 5200.0]) +# R45 + +# Reaction 45 +reaction('H + H2O2 <=> OH + H2O', [1.000000e+13, 0.0, 3600.0]) +# R46 + +# Reaction 46 +reaction('H + CH <=> C + H2', [1.650000e+14, 0.0, 0.0]) +# R47 + +# Reaction 47 +falloff_reaction('H + CH2 (+ M) <=> CH3 (+ M)', + kf=[6.000000e+14, 0.0, 0.0], + kf0=[1.040000e+26, -2.76, 1600.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.562, T3=91.0, T1=5836.0, T2=8552.0)) +# R48 + +# Reaction 48 +reaction('H + CH2(S) <=> CH + H2', [3.000000e+13, 0.0, 0.0]) +# R49 + +# Reaction 49 +falloff_reaction('H + CH3 (+ M) <=> CH4 (+ M)', + kf=[1.390000e+16, -0.534, 536.0], + kf0=[2.620000e+33, -4.76, 2440.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:3.0 C2H6:3.0', + falloff=Troe(A=0.783, T3=74.0, T1=2941.0, T2=6964.0)) +# R50 + +# Reaction 50 +reaction('H + CH4 <=> CH3 + H2', [6.600000e+08, 1.62, 10840.0]) +# R51 + +# Reaction 51 +falloff_reaction('H + HCO (+ M) <=> CH2O (+ M)', + kf=[1.090000e+12, 0.48, -260.0], + kf0=[2.470000e+24, -2.57, 425.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.7824, T3=271.0, T1=2755.0, T2=6570.0)) +# R52 + +# Reaction 52 +reaction('H + HCO <=> H2 + CO', [7.340000e+13, 0.0, 0.0]) +# R53 + +# Reaction 53 +falloff_reaction('H + CH2O (+ M) <=> CH2OH (+ M)', + kf=[5.400000e+11, 0.454, 3600.0], + kf0=[1.270000e+32, -4.82, 6530.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.7187, T3=103.0, T1=1291.0, T2=4160.0)) +# R54 + +# Reaction 54 +falloff_reaction('H + CH2O (+ M) <=> CH3O (+ M)', + kf=[5.400000e+11, 0.454, 2600.0], + kf0=[2.200000e+30, -4.8, 5560.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.758, T3=94.0, T1=1555.0, T2=4200.0)) +# R55 + +# Reaction 55 +reaction('H + CH2O <=> HCO + H2', [5.740000e+07, 1.9, 2742.0]) +# R56 + +# Reaction 56 +falloff_reaction('H + CH2OH (+ M) <=> CH3OH (+ M)', + kf=[1.055000e+12, 0.5, 86.0], + kf0=[4.360000e+31, -4.65, 5080.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.6, T3=100.0, T1=90000.0, T2=10000.0)) +# R57 + +# Reaction 57 +reaction('H + CH2OH <=> H2 + CH2O', [2.000000e+13, 0.0, 0.0]) +# R58 + +# Reaction 58 +reaction('H + CH2OH <=> OH + CH3', [1.650000e+11, 0.65, -284.0]) +# R59 + +# Reaction 59 +reaction('H + CH2OH <=> CH2(S) + H2O', [3.280000e+13, -0.09, 610.0]) +# R60 + +# Reaction 60 +falloff_reaction('H + CH3O (+ M) <=> CH3OH (+ M)', + kf=[2.430000e+12, 0.515, 50.0], + kf0=[4.660000e+41, -7.44, 14080.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.7, T3=100.0, T1=90000.0, T2=10000.0)) +# R61 + +# Reaction 61 +reaction('H + CH3O <=> H + CH2OH', [4.150000e+07, 1.63, 1924.0]) +# R62 + +# Reaction 62 +reaction('H + CH3O <=> H2 + CH2O', [2.000000e+13, 0.0, 0.0]) +# R63 + +# Reaction 63 +reaction('H + CH3O <=> OH + CH3', [1.500000e+12, 0.5, -110.0]) +# R64 + +# Reaction 64 +reaction('H + CH3O <=> CH2(S) + H2O', [2.620000e+14, -0.23, 1070.0]) +# R65 + +# Reaction 65 +reaction('H + CH3OH <=> CH2OH + H2', [1.700000e+07, 2.1, 4870.0]) +# R66 + +# Reaction 66 +reaction('H + CH3OH <=> CH3O + H2', [4.200000e+06, 2.1, 4870.0]) +# R67 + +# Reaction 67 +falloff_reaction('H + C2H2 (+ M) <=> C2H3 (+ M)', + kf=[5.600000e+12, 0.0, 2400.0], + kf0=[3.800000e+40, -7.27, 7220.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.7507, T3=98.5, T1=1302.0, T2=4167.0)) +# R68 + +# Reaction 68 +falloff_reaction('H + C2H3 (+ M) <=> C2H4 (+ M)', + kf=[6.080000e+12, 0.27, 280.0], + kf0=[1.400000e+30, -3.86, 3320.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.782, T3=207.5, T1=2663.0, T2=6095.0)) +# R69 + +# Reaction 69 +reaction('H + C2H3 <=> H2 + C2H2', [3.000000e+13, 0.0, 0.0]) +# R70 + +# Reaction 70 +falloff_reaction('H + C2H4 (+ M) <=> C2H5 (+ M)', + kf=[5.400000e+11, 0.454, 1820.0], + kf0=[6.000000e+41, -7.62, 6970.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.9753, T3=210.0, T1=984.0, T2=4374.0)) +# R71 + +# Reaction 71 +reaction('H + C2H4 <=> C2H3 + H2', [1.325000e+06, 2.53, 12240.0]) +# R72 + +# Reaction 72 +falloff_reaction('H + C2H5 (+ M) <=> C2H6 (+ M)', + kf=[5.210000e+17, -0.99, 1580.0], + kf0=[1.990000e+41, -7.08, 6685.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.8422, T3=125.0, T1=2219.0, T2=6882.0)) +# R73 + +# Reaction 73 +reaction('H + C2H5 <=> H2 + C2H4', [2.000000e+12, 0.0, 0.0]) +# R74 + +# Reaction 74 +reaction('H + C2H6 <=> C2H5 + H2', [1.150000e+08, 1.9, 7530.0]) +# R75 + +# Reaction 75 +reaction('H + HCCO <=> CH2(S) + CO', [1.000000e+14, 0.0, 0.0]) +# R76 + +# Reaction 76 +reaction('H + CH2CO <=> HCCO + H2', [5.000000e+13, 0.0, 8000.0]) +# R77 + +# Reaction 77 +reaction('H + CH2CO <=> CH3 + CO', [1.130000e+13, 0.0, 3428.0]) +# R78 + +# Reaction 78 +falloff_reaction('H2 + CO (+ M) <=> CH2O (+ M)', + kf=[4.300000e+07, 1.5, 79600.0], + kf0=[5.070000e+27, -3.42, 84350.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.932, T3=197.0, T1=1540.0, T2=10300.0)) +# R79 + +# Reaction 79 +reaction('OH + H2 <=> H + H2O', [2.160000e+08, 1.51, 3430.0]) +# R80 + +# Reaction 80 +falloff_reaction('2 OH (+ M) <=> H2O2 (+ M)', + kf=[7.400000e+13, -0.37, 0.0], + kf0=[2.300000e+18, -0.9, -1700.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.7346, T3=94.0, T1=1756.0, T2=5182.0)) +# R81 + +# Reaction 81 +reaction('2 OH <=> O + H2O', [3.570000e+04, 2.4, -2110.0]) +# R82 + +# Reaction 82 +reaction('OH + HO2 <=> O2 + H2O', [1.450000e+13, 0.0, -500.0], + options='duplicate') +# R83 + +# Reaction 83 +reaction('OH + H2O2 <=> HO2 + H2O', [2.000000e+12, 0.0, 427.0], + options='duplicate') +# R84 + +# Reaction 84 +reaction('OH + H2O2 <=> HO2 + H2O', [1.700000e+18, 0.0, 29410.0], + options='duplicate') +# R85 + +# Reaction 85 +reaction('OH + C <=> H + CO', [5.000000e+13, 0.0, 0.0]) +# R86 + +# Reaction 86 +reaction('OH + CH <=> H + HCO', [3.000000e+13, 0.0, 0.0]) +# R87 + +# Reaction 87 +reaction('OH + CH2 <=> H + CH2O', [2.000000e+13, 0.0, 0.0]) +# R88 + +# Reaction 88 +reaction('OH + CH2 <=> CH + H2O', [1.130000e+07, 2.0, 3000.0]) +# R89 + +# Reaction 89 +reaction('OH + CH2(S) <=> H + CH2O', [3.000000e+13, 0.0, 0.0]) +# R90 + +# Reaction 90 +falloff_reaction('OH + CH3 (+ M) <=> CH3OH (+ M)', + kf=[2.790000e+18, -1.43, 1330.0], + kf0=[4.000000e+36, -5.92, 3140.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.412, T3=195.0, T1=5900.0, T2=6394.0)) +# R91 + +# Reaction 91 +reaction('OH + CH3 <=> CH2 + H2O', [5.600000e+07, 1.6, 5420.0]) +# R92 + +# Reaction 92 +reaction('OH + CH3 <=> CH2(S) + H2O', [6.440000e+17, -1.34, 1417.0]) +# R93 + +# Reaction 93 +reaction('OH + CH4 <=> CH3 + H2O', [1.000000e+08, 1.6, 3120.0]) +# R94 + +# Reaction 94 +reaction('OH + CO <=> H + CO2', [4.760000e+07, 1.228, 70.0]) +# R95 + +# Reaction 95 +reaction('OH + HCO <=> H2O + CO', [5.000000e+13, 0.0, 0.0]) +# R96 + +# Reaction 96 +reaction('OH + CH2O <=> HCO + H2O', [3.430000e+09, 1.18, -447.0]) +# R97 + +# Reaction 97 +reaction('OH + CH2OH <=> H2O + CH2O', [5.000000e+12, 0.0, 0.0]) +# R98 + +# Reaction 98 +reaction('OH + CH3O <=> H2O + CH2O', [5.000000e+12, 0.0, 0.0]) +# R99 + +# Reaction 99 +reaction('OH + CH3OH <=> CH2OH + H2O', [1.440000e+06, 2.0, -840.0]) +# R100 + +# Reaction 100 +reaction('OH + CH3OH <=> CH3O + H2O', [6.300000e+06, 2.0, 1500.0]) +# R101 + +# Reaction 101 +reaction('OH + C2H2 <=> H + CH2CO', [2.180000e-04, 4.5, -1000.0]) +# R102 + +# Reaction 102 +reaction('OH + C2H2 <=> CH3 + CO', [4.830000e-04, 4.0, -2000.0]) +# R103 + +# Reaction 103 +reaction('OH + C2H3 <=> H2O + C2H2', [5.000000e+12, 0.0, 0.0]) +# R104 + +# Reaction 104 +reaction('OH + C2H4 <=> C2H3 + H2O', [3.600000e+06, 2.0, 2500.0]) +# R105 + +# Reaction 105 +reaction('OH + C2H6 <=> C2H5 + H2O', [3.540000e+06, 2.12, 870.0]) +# R106 + +# Reaction 106 +reaction('OH + CH2CO <=> HCCO + H2O', [7.500000e+12, 0.0, 2000.0]) +# R107 + +# Reaction 107 +reaction('2 HO2 <=> O2 + H2O2', [1.300000e+11, 0.0, -1630.0], + options='duplicate') +# R108 + +# Reaction 108 +reaction('2 HO2 <=> O2 + H2O2', [4.200000e+14, 0.0, 12000.0], + options='duplicate') +# R109 + +# Reaction 109 +reaction('HO2 + CH2 <=> OH + CH2O', [2.000000e+13, 0.0, 0.0]) +# R110 + +# Reaction 110 +reaction('HO2 + CH3 <=> O2 + CH4', [1.000000e+12, 0.0, 0.0]) +# R111 + +# Reaction 111 +reaction('HO2 + CH3 <=> OH + CH3O', [3.780000e+13, 0.0, 0.0]) +# R112 + +# Reaction 112 +reaction('HO2 + CO <=> OH + CO2', [1.500000e+14, 0.0, 23600.0]) +# R113 + +# Reaction 113 +reaction('HO2 + CH2O <=> HCO + H2O2', [5.600000e+06, 2.0, 12000.0]) +# R114 + +# Reaction 114 +reaction('C + O2 <=> O + CO', [5.800000e+13, 0.0, 576.0]) +# R115 + +# Reaction 115 +reaction('C + CH3 <=> H + C2H2', [5.000000e+13, 0.0, 0.0]) +# R116 + +# Reaction 116 +reaction('CH + O2 <=> O + HCO', [6.710000e+13, 0.0, 0.0]) +# R117 + +# Reaction 117 +reaction('CH + H2 <=> H + CH2', [1.080000e+14, 0.0, 3110.0]) +# R118 + +# Reaction 118 +reaction('CH + H2O <=> H + CH2O', [5.710000e+12, 0.0, -755.0]) +# R119 + +# Reaction 119 +reaction('CH + CH2 <=> H + C2H2', [4.000000e+13, 0.0, 0.0]) +# R120 + +# Reaction 120 +reaction('CH + CH3 <=> H + C2H3', [3.000000e+13, 0.0, 0.0]) +# R121 + +# Reaction 121 +reaction('CH + CH4 <=> H + C2H4', [6.000000e+13, 0.0, 0.0]) +# R122 + +# Reaction 122 +falloff_reaction('CH + CO (+ M) <=> HCCO (+ M)', + kf=[5.000000e+13, 0.0, 0.0], + kf0=[2.690000e+28, -3.74, 1936.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.5757, T3=237.0, T1=1652.0, T2=5069.0)) +# R123 + +# Reaction 123 +reaction('CH + CO2 <=> HCO + CO', [1.900000e+14, 0.0, 15792.0]) +# R124 + +# Reaction 124 +reaction('CH + CH2O <=> H + CH2CO', [9.460000e+13, 0.0, -515.0]) +# R125 + +# Reaction 125 +reaction('CH + HCCO <=> CO + C2H2', [5.000000e+13, 0.0, 0.0]) +# R126 + +# Reaction 126 +reaction('CH2 + O2 => OH + H + CO', [5.000000e+12, 0.0, 1500.0]) +# R127 + +# Reaction 127 +reaction('CH2 + H2 <=> H + CH3', [5.000000e+05, 2.0, 7230.0]) +# R128 + +# Reaction 128 +reaction('2 CH2 <=> H2 + C2H2', [1.600000e+15, 0.0, 11944.0]) +# R129 + +# Reaction 129 +reaction('CH2 + CH3 <=> H + C2H4', [4.000000e+13, 0.0, 0.0]) +# R130 + +# Reaction 130 +reaction('CH2 + CH4 <=> 2 CH3', [2.460000e+06, 2.0, 8270.0]) +# R131 + +# Reaction 131 +falloff_reaction('CH2 + CO (+ M) <=> CH2CO (+ M)', + kf=[8.100000e+11, 0.5, 4510.0], + kf0=[2.690000e+33, -5.11, 7095.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.5907, T3=275.0, T1=1226.0, T2=5185.0)) +# R132 + +# Reaction 132 +reaction('CH2 + HCCO <=> C2H3 + CO', [3.000000e+13, 0.0, 0.0]) +# R133 + +# Reaction 133 +reaction('CH2(S) + N2 <=> CH2 + N2', [1.500000e+13, 0.0, 600.0]) +# R134 + +# Reaction 134 +reaction('CH2(S) + O2 <=> H + OH + CO', [2.800000e+13, 0.0, 0.0]) +# R135 + +# Reaction 135 +reaction('CH2(S) + O2 <=> CO + H2O', [1.200000e+13, 0.0, 0.0]) +# R136 + +# Reaction 136 +reaction('CH2(S) + H2 <=> CH3 + H', [7.000000e+13, 0.0, 0.0]) +# R137 + +# Reaction 137 +falloff_reaction('CH2(S) + H2O (+ M) <=> CH3OH (+ M)', + kf=[4.820000e+17, -1.16, 1145.0], + kf0=[1.880000e+38, -6.36, 5040.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.6027, T3=208.0, T1=3922.0, T2=10180.0)) +# R138 + +# Reaction 138 +reaction('CH2(S) + H2O <=> CH2 + H2O', [3.000000e+13, 0.0, 0.0]) +# R139 + +# Reaction 139 +reaction('CH2(S) + CH3 <=> H + C2H4', [1.200000e+13, 0.0, -570.0]) +# R140 + +# Reaction 140 +reaction('CH2(S) + CH4 <=> 2 CH3', [1.600000e+13, 0.0, -570.0]) +# R141 + +# Reaction 141 +reaction('CH2(S) + CO <=> CH2 + CO', [9.000000e+12, 0.0, 0.0]) +# R142 + +# Reaction 142 +reaction('CH2(S) + CO2 <=> CH2 + CO2', [7.000000e+12, 0.0, 0.0]) +# R143 + +# Reaction 143 +reaction('CH2(S) + CO2 <=> CO + CH2O', [1.400000e+13, 0.0, 0.0]) +# R144 + +# Reaction 144 +reaction('CH2(S) + C2H6 <=> CH3 + C2H5', [4.000000e+13, 0.0, -550.0]) +# R145 + +# Reaction 145 +reaction('CH3 + O2 <=> O + CH3O', [3.560000e+13, 0.0, 30480.0]) +# R146 + +# Reaction 146 +reaction('CH3 + O2 <=> OH + CH2O', [2.310000e+12, 0.0, 20315.0]) +# R147 + +# Reaction 147 +reaction('CH3 + H2O2 <=> HO2 + CH4', [2.450000e+04, 2.47, 5180.0]) +# R148 + +# Reaction 148 +falloff_reaction('2 CH3 (+ M) <=> C2H6 (+ M)', + kf=[6.770000e+16, -1.18, 654.0], + kf0=[3.400000e+41, -7.03, 2762.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.619, T3=73.2, T1=1180.0, T2=9999.0)) +# R149 + +# Reaction 149 +reaction('2 CH3 <=> H + C2H5', [6.840000e+12, 0.1, 10600.0]) +# R150 + +# Reaction 150 +reaction('CH3 + HCO <=> CH4 + CO', [2.648000e+13, 0.0, 0.0]) +# R151 + +# Reaction 151 +reaction('CH3 + CH2O <=> HCO + CH4', [3.320000e+03, 2.81, 5860.0]) +# R152 + +# Reaction 152 +reaction('CH3 + CH3OH <=> CH2OH + CH4', [3.000000e+07, 1.5, 9940.0]) +# R153 + +# Reaction 153 +reaction('CH3 + CH3OH <=> CH3O + CH4', [1.000000e+07, 1.5, 9940.0]) +# R154 + +# Reaction 154 +reaction('CH3 + C2H4 <=> C2H3 + CH4', [2.270000e+05, 2.0, 9200.0]) +# R155 + +# Reaction 155 +reaction('CH3 + C2H6 <=> C2H5 + CH4', [6.140000e+06, 1.74, 10450.0]) +# R156 + +# Reaction 156 +reaction('HCO + H2O <=> H + CO + H2O', [1.500000e+18, -1.0, 17000.0]) +# R157 + +# Reaction 157 +three_body_reaction('HCO + M <=> H + CO + M', [1.870000e+17, -1.0, 17000.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:0.0 CH4:2.0 C2H6:3.0') +# R158 + +# Reaction 158 +reaction('HCO + O2 <=> HO2 + CO', [1.345000e+13, 0.0, 400.0]) +# R159 + +# Reaction 159 +reaction('CH2OH + O2 <=> HO2 + CH2O', [1.800000e+13, 0.0, 900.0]) +# R160 + +# Reaction 160 +reaction('CH3O + O2 <=> HO2 + CH2O', [4.280000e-13, 7.6, -3530.0]) +# R161 + +# Reaction 161 +reaction('C2H3 + O2 <=> HCO + CH2O', [4.580000e+16, -1.39, 1015.0]) +# R162 + +# Reaction 162 +falloff_reaction('C2H4 (+ M) <=> H2 + C2H2 (+ M)', + kf=[8.000000e+12, 0.44, 86770.0], + kf0=[1.580000e+51, -9.3, 97800.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.7345, T3=180.0, T1=1035.0, T2=5417.0)) +# R163 + +# Reaction 163 +reaction('C2H5 + O2 <=> HO2 + C2H4', [8.400000e+11, 0.0, 3875.0]) +# R164 + +# Reaction 164 +reaction('HCCO + O2 <=> OH + 2 CO', [3.200000e+12, 0.0, 854.0]) +# R165 + +# Reaction 165 +reaction('2 HCCO <=> 2 CO + C2H2', [1.000000e+13, 0.0, 0.0]) +# R166 + +# Reaction 166 +reaction('O + CH3 => H + H2 + CO', [3.370000e+13, 0.0, 0.0]) +# R167 + +# Reaction 167 +reaction('O + C2H4 <=> H + CH2CHO', [6.700000e+06, 1.83, 220.0]) +# R168 + +# Reaction 168 +reaction('OH + HO2 <=> O2 + H2O', [5.000000e+15, 0.0, 17330.0], + options='duplicate') +# R169 + +# Reaction 169 +reaction('OH + CH3 => H2 + CH2O', [8.000000e+09, 0.5, -1755.0]) +# R170 + +# Reaction 170 +falloff_reaction('CH + H2 (+ M) <=> CH3 (+ M)', + kf=[1.970000e+12, 0.43, -370.0], + kf0=[4.820000e+25, -2.8, 590.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.578, T3=122.0, T1=2535.0, T2=9365.0)) +# R171 + +# Reaction 171 +reaction('CH2 + O2 => 2 H + CO2', [5.800000e+12, 0.0, 1500.0]) +# R172 + +# Reaction 172 +reaction('CH2 + O2 <=> O + CH2O', [2.400000e+12, 0.0, 1500.0]) +# R173 + +# Reaction 173 +reaction('CH2 + CH2 => 2 H + C2H2', [2.000000e+14, 0.0, 10989.0]) +# R174 + +# Reaction 174 +reaction('CH2(S) + H2O => H2 + CH2O', [6.820000e+10, 0.25, -935.0]) +# R175 + +# Reaction 175 +reaction('C2H3 + O2 <=> O + CH2CHO', [3.030000e+11, 0.29, 11.0]) +# R176 + +# Reaction 176 +reaction('C2H3 + O2 <=> HO2 + C2H2', [1.337000e+06, 1.61, -384.0]) +# R177 + +# Reaction 177 +falloff_reaction('H + CH2CO (+ M) <=> CH2CHO (+ M)', + kf=[4.865000e+11, 0.422, -1755.0], + kf0=[1.012000e+42, -7.63, 3854.0], + efficiencies='CO2:2.0 CO:1.5 H2:2.0 H2O:6.0 CH4:2.0 C2H6:3.0', + falloff=Troe(A=0.465, T3=201.0, T1=1773.0, T2=5333.0)) +# R178 + +# Reaction 178 +reaction('O + CH2CHO => H + CH2 + CO2', [1.500000e+14, 0.0, 0.0]) +# R179 + +# Reaction 179 +reaction('O2 + CH2CHO => OH + CO + CH2O', [1.810000e+10, 0.0, 0.0]) +# R180 + +# Reaction 180 +reaction('O2 + CH2CHO => OH + 2 HCO', [2.350000e+10, 0.0, 0.0]) +# R181 + +# Reaction 181 +reaction('H + CH2CHO <=> CH3 + HCO', [2.200000e+13, 0.0, 0.0]) +# R182 + +# Reaction 182 +reaction('H + CH2CHO <=> CH2CO + H2', [1.100000e+13, 0.0, 0.0]) +# R183 + +# Reaction 183 +reaction('OH + CH2CHO <=> H2O + CH2CO', [1.200000e+13, 0.0, 0.0]) +# R184 + +# Reaction 184 +reaction('OH + CH2CHO <=> HCO + CH2OH', [3.010000e+13, 0.0, 0.0]) diff --git a/testcases/Speelman/Ref.dat b/testcases/Speelman/Ref.dat new file mode 100644 index 0000000..06554a5 --- /dev/null +++ b/testcases/Speelman/Ref.dat @@ -0,0 +1,106 @@ + y T rho X_CH4 X_O2 X_N2 X_CH X_CO X_CO2 X_H2O X_H2 + 0.0000000e+00 3.5000000e+02 9.5397800e-01 9.0080342e-02 1.8442423e-01 7.0755621e-01 6.6111466e-18 1.4602472e-03 3.7253127e-04 8.5589633e-03 7.4068352e-03 + 1.5625000e-05 3.6488460e+02 9.1435719e-01 8.9172195e-02 1.8333865e-01 7.0684122e-01 1.5164176e-19 1.7991673e-03 4.8443291e-04 1.0313936e-02 7.8689127e-03 + 3.1250000e-05 3.8232881e+02 8.7191320e-01 8.8125434e-02 1.8206433e-01 7.0607068e-01 4.8500165e-19 2.2022143e-03 6.2443502e-04 1.2337025e-02 8.3436824e-03 + 4.6875000e-05 4.0256568e+02 8.2734527e-01 8.6929420e-02 1.8058156e-01 7.0524867e-01 2.1674646e-18 2.6768107e-03 7.9746047e-04 1.4642705e-02 8.8289932e-03 + 6.2500000e-05 4.2579693e+02 7.8146566e-01 8.5574880e-02 1.7887182e-01 7.0438132e-01 1.1657299e-17 3.2301356e-03 1.0086757e-03 1.7240916e-02 9.3226352e-03 + 7.0312500e-05 4.3862541e+02 7.5823005e-01 8.4822706e-02 1.7790926e-01 7.0392586e-01 3.0350414e-17 3.5441362e-03 1.1327371e-03 1.8676077e-02 9.5757743e-03 + 7.8125000e-05 4.5229758e+02 7.3493165e-01 8.4024262e-02 1.7687774e-01 7.0346123e-01 7.8598186e-17 3.8824191e-03 1.2695800e-03 2.0192847e-02 9.8304322e-03 + 8.5937500e-05 4.6682760e+02 7.1168125e-01 8.3178629e-02 1.7577505e-01 7.0298874e-01 2.0346828e-16 4.2459145e-03 1.4200255e-03 2.1791380e-02 1.0086332e-02 + 9.3750000e-05 4.8222632e+02 6.8858366e-01 8.2284999e-02 1.7459911e-01 7.0250978e-01 5.2363421e-16 4.6355093e-03 1.5848950e-03 2.3471535e-02 1.0343208e-02 + 1.0156250e-04 4.9850126e+02 6.6573601e-01 8.1342677e-02 1.7334807e-01 7.0202580e-01 1.3310497e-15 5.0520443e-03 1.7650072e-03 2.5232904e-02 1.0600810e-02 + 1.0937500e-04 5.1565668e+02 6.4322637e-01 8.0351076e-02 1.7202023e-01 7.0153824e-01 3.3219470e-15 5.4963123e-03 1.9611750e-03 2.7074837e-02 1.0858906e-02 + 1.1718750e-04 5.3369368e+02 6.2113280e-01 7.9309707e-02 1.7061408e-01 7.0104859e-01 8.0978959e-15 5.9690581e-03 2.1742041e-03 2.8996466e-02 1.1117278e-02 + 1.2500000e-04 5.5261038e+02 5.9952292e-01 7.8218179e-02 1.6912832e-01 7.0055829e-01 1.9198346e-14 6.4709771e-03 2.4048906e-03 3.0996735e-02 1.1375728e-02 + 1.3281250e-04 5.7240206e+02 5.7845369e-01 7.7076191e-02 1.6756183e-01 7.0006877e-01 4.4115771e-14 7.0027159e-03 2.6540197e-03 3.3074422e-02 1.1634078e-02 + 1.4062500e-04 5.9306132e+02 5.5797172e-01 7.5883529e-02 1.6591365e-01 6.9958143e-01 9.8013094e-14 7.5648712e-03 2.9223646e-03 3.5228158e-02 1.1892164e-02 + 1.4843750e-04 6.1457828e+02 5.3811367e-01 7.4640058e-02 1.6418303e-01 6.9909761e-01 2.1020137e-13 8.1579905e-03 3.2106856e-03 3.7456449e-02 1.2149843e-02 + 1.5625000e-04 6.3694071e+02 5.1890693e-01 7.3345717e-02 1.6236937e-01 6.9861857e-01 4.3481125e-13 8.7825711e-03 3.5197293e-03 3.9757693e-02 1.2406987e-02 + 1.6406250e-04 6.6013428e+02 5.0037041e-01 7.2000513e-02 1.6047222e-01 6.9814555e-01 8.6747166e-13 9.4390597e-03 3.8502287e-03 4.2130190e-02 1.2663480e-02 + 1.7187500e-04 6.8414268e+02 4.8251541e-01 7.0604514e-02 1.5849126e-01 6.9767968e-01 1.6702365e-12 1.0127852e-02 4.2029030e-03 4.4572161e-02 1.2919222e-02 + 1.7968750e-04 7.0894781e+02 4.6534652e-01 6.9157842e-02 1.5642627e-01 6.9722203e-01 3.1077509e-12 1.0849288e-02 4.5784576e-03 4.7081757e-02 1.3174117e-02 + 1.8750000e-04 7.3452994e+02 4.4886252e-01 6.7660667e-02 1.5427718e-01 6.9677360e-01 5.5994391e-12 1.1603655e-02 4.9775847e-03 4.9657069e-02 1.3428078e-02 + 1.9531250e-04 7.6086780e+02 4.3305726e-01 6.6113203e-02 1.5204395e-01 6.9633532e-01 9.7966523e-12 1.2391178e-02 5.4009638e-03 5.2296138e-02 1.3681017e-02 + 2.0312500e-04 7.8793870e+02 4.1792051e-01 6.4515708e-02 1.4972665e-01 6.9590802e-01 1.6702167e-11 1.3212016e-02 5.8492622e-03 5.4996962e-02 1.3932841e-02 + 2.1093750e-04 8.1571851e+02 4.0343873e-01 6.2868493e-02 1.4732542e-01 6.9549248e-01 2.7864484e-11 1.4066254e-02 6.3231349e-03 5.7757495e-02 1.4183446e-02 + 2.1875000e-04 8.4418149e+02 3.8959588e-01 6.1171928e-02 1.4484048e-01 6.9508940e-01 4.5703715e-11 1.4953892e-02 6.8232249e-03 6.0575641e-02 1.4432711e-02 + 2.2656250e-04 8.7330013e+02 3.7637409e-01 5.9426473e-02 1.4227217e-01 6.9469939e-01 7.4063068e-11 1.5874833e-02 7.3501616e-03 6.3449245e-02 1.4680490e-02 + 2.3437500e-04 9.0304473e+02 3.6375423e-01 5.7632706e-02 1.3962095e-01 6.9432302e-01 1.1913681e-10 1.6828858e-02 7.9045591e-03 6.6376069e-02 1.4926599e-02 + 2.4218750e-04 9.3338288e+02 3.5171655e-01 5.5791372e-02 1.3688746e-01 6.9396076e-01 1.9101396e-10 1.7815613e-02 8.4870128e-03 6.9353758e-02 1.5170813e-02 + 2.5000000e-04 9.6427897e+02 3.4024105e-01 5.3903436e-02 1.3407257e-01 6.9361300e-01 3.0621640e-10 1.8834572e-02 9.0980948e-03 7.2379797e-02 1.5412849e-02 + 2.5781250e-04 9.9569344e+02 3.2930793e-01 5.1970158e-02 1.3117746e-01 6.9328010e-01 4.9182637e-10 1.9885012e-02 9.7383475e-03 7.5451459e-02 1.5652356e-02 + 2.6562500e-04 1.0275821e+03 3.1889780e-01 4.9993163e-02 1.2820368e-01 6.9296235e-01 7.9212448e-10 2.0965969e-02 1.0408276e-02 7.8565744e-02 1.5888900e-02 + 2.7343750e-04 1.0598948e+03 3.0899222e-01 4.7974538e-02 1.2515322e-01 6.9265999e-01 1.2791294e-09 2.2076199e-02 1.1108337e-02 8.1719305e-02 1.6121952e-02 + 2.8125000e-04 1.0925753e+03 2.9957346e-01 4.5916914e-02 1.2202861e-01 6.9237322e-01 2.0691626e-09 2.3214121e-02 1.1838929e-02 8.4908373e-02 1.6350866e-02 + 2.8906250e-04 1.1255614e+03 2.9062457e-01 4.3823573e-02 1.1883302e-01 6.9210224e-01 3.3478299e-09 2.4377766e-02 1.2600377e-02 8.8128677e-02 1.6574866e-02 + 2.9687500e-04 1.1587845e+03 2.8212942e-01 4.1698541e-02 1.1557034e-01 6.9184725e-01 5.4078432e-09 2.5564708e-02 1.3392914e-02 9.1375359e-02 1.6793026e-02 + 3.0468750e-04 1.1921687e+03 2.7407276e-01 3.9546677e-02 1.1224527e-01 6.9160847e-01 8.7033069e-09 2.6772001e-02 1.4216666e-02 9.4642891e-02 1.7004252e-02 + 3.1250000e-04 1.2256314e+03 2.6644020e-01 3.7373756e-02 1.0886341e-01 6.9138614e-01 1.3925679e-08 2.7996107e-02 1.5071629e-02 9.7925012e-02 1.7207268e-02 + 3.2031250e-04 1.2590831e+03 2.5921814e-01 3.5186530e-02 1.0543138e-01 6.9118059e-01 2.2105147e-08 2.9232824e-02 1.5957651e-02 1.0121466e-01 1.7400599e-02 + 3.2812500e-04 1.2924273e+03 2.5239375e-01 3.2992763e-02 1.0195682e-01 6.9099218e-01 3.4738582e-08 3.0477228e-02 1.6874411e-02 1.0450392e-01 1.7582571e-02 + 3.3593750e-04 1.3255617e+03 2.4595489e-01 3.0801229e-02 9.8448461e-02 6.9082137e-01 5.3939400e-08 3.1723609e-02 1.7821399e-02 1.0778404e-01 1.7751307e-02 + 3.4375000e-04 1.3583783e+03 2.3989001e-01 2.8621672e-02 9.4916150e-02 6.9066869e-01 8.2594952e-08 3.2965439e-02 1.8797901e-02 1.1104542e-01 1.7904743e-02 + 3.5156250e-04 1.3907644e+03 2.3418811e-01 2.6464709e-02 9.1370793e-02 6.9053473e-01 1.2450305e-07 3.4195353e-02 1.9802989e-02 1.1427767e-01 1.8040649e-02 + 3.5937500e-04 1.4226040e+03 2.2883858e-01 2.4341679e-02 8.7824300e-02 6.9042011e-01 1.8444222e-07 3.5405162e-02 2.0835513e-02 1.1746971e-01 1.8156676e-02 + 3.6718750e-04 1.4537793e+03 2.2383116e-01 2.2264428e-02 8.4289455e-02 6.9032548e-01 2.6811344e-07 3.6585908e-02 2.1894098e-02 1.2060991e-01 1.8250405e-02 + 3.7500000e-04 1.4841718e+03 2.1915580e-01 2.0245042e-02 8.0779748e-02 6.9025144e-01 3.8188150e-07 3.7727962e-02 2.2977155e-02 1.2368626e-01 1.8319429e-02 + 3.8281250e-04 1.5136648e+03 2.1480254e-01 1.8295525e-02 7.7309155e-02 6.9019851e-01 5.3224907e-07 3.8821164e-02 2.4082891e-02 1.2668664e-01 1.8361436e-02 + 3.9062500e-04 1.5421453e+03 2.1076145e-01 1.6427431e-02 7.3891870e-02 6.9016707e-01 7.2502768e-07 3.9855029e-02 2.5209322e-02 1.2959903e-01 1.8374314e-02 + 3.9843750e-04 1.5695062e+03 2.0702241e-01 1.4651492e-02 7.0542015e-02 6.9015734e-01 9.6422948e-07 4.0818992e-02 2.6354299e-02 1.3241183e-01 1.8356258e-02 + 4.0625000e-04 1.5956493e+03 2.0357510e-01 1.2977226e-02 6.7273320e-02 6.9016933e-01 1.2507916e-06 4.1702706e-02 2.7515523e-02 1.3511413e-01 1.8305881e-02 + 4.1406250e-04 1.6204874e+03 2.0040877e-01 1.1412595e-02 6.4098796e-02 6.9020281e-01 1.5813410e-06 4.2496378e-02 2.8690567e-02 1.3769605e-01 1.8222325e-02 + 4.2187500e-04 1.6439472e+03 1.9751224e-01 9.9636990e-03 6.1030430e-02 6.9025727e-01 1.9472853e-06 4.3191131e-02 2.9876897e-02 1.4014898e-01 1.8105346e-02 + 4.2968750e-04 1.6659717e+03 1.9487373e-01 8.6345600e-03 5.8078897e-02 6.9033197e-01 2.3345328e-06 4.3779364e-02 3.1071882e-02 1.4246583e-01 1.7955396e-02 + 4.3750000e-04 1.6865221e+03 1.9248080e-01 7.4270000e-03 5.5253325e-02 6.9042591e-01 2.7240801e-06 4.4255107e-02 3.2272806e-02 1.4464125e-01 1.7773663e-02 + 4.4531250e-04 1.7055798e+03 1.9032037e-01 6.3406258e-03 5.2561108e-02 6.9053790e-01 3.0935459e-06 4.4614319e-02 3.3476882e-02 1.4667171e-01 1.7562085e-02 + 4.5312500e-04 1.7231469e+03 1.8837866e-01 5.3729246e-03 5.0007791e-02 6.9066652e-01 3.4195106e-06 4.4855123e-02 3.4681261e-02 1.4855564e-01 1.7323321e-02 + 4.6093750e-04 1.7392463e+03 1.8664128e-01 4.5194595e-03 4.7597021e-02 6.9081026e-01 3.6803007e-06 4.4977946e-02 3.5883044e-02 1.5029335e-01 1.7060684e-02 + 4.6875000e-04 1.7539213e+03 1.8509331e-01 3.7741486e-03 4.5330565e-02 6.9096748e-01 3.8587079e-06 4.4985542e-02 3.7079304e-02 1.5188695e-01 1.6778036e-02 + 4.7656250e-04 1.7672333e+03 1.8371946e-01 3.1296023e-03 4.3208394e-02 6.9113649e-01 3.9441149e-06 4.4882894e-02 3.8267108e-02 1.5334025e-01 1.6479649e-02 + 4.8437500e-04 1.7792597e+03 1.8250425e-01 2.5774936e-03 4.1228822e-02 6.9131560e-01 3.9336225e-06 4.4677002e-02 3.9443555e-02 1.5465848e-01 1.6170043e-02 + 4.9218750e-04 1.7900906e+03 1.8143225e-01 2.1089308e-03 3.9388681e-02 6.9150314e-01 3.8320059e-06 4.4376560e-02 4.0605807e-02 1.5584809e-01 1.5853812e-02 + 5.0000000e-04 1.7998247e+03 1.8048830e-01 1.7148104e-03 3.7683532e-02 6.9169749e-01 3.6505923e-06 4.3991564e-02 4.1751138e-02 1.5691647e-01 1.5535453e-02 + 5.0781250e-04 1.8085661e+03 1.7965773e-01 1.3861279e-03 3.6107897e-02 6.9189714e-01 3.4053682e-06 4.3532866e-02 4.2876971e-02 1.5787166e-01 1.5219205e-02 + 5.1562500e-04 1.8164203e+03 1.7892664e-01 1.1142343e-03 3.4655485e-02 6.9210064e-01 3.1147424e-06 4.3011734e-02 4.3980924e-02 1.5872208e-01 1.4908915e-02 + 5.2343750e-04 1.8234907e+03 1.7828201e-01 8.9103203e-04 3.3319421e-02 6.9230667e-01 2.7973815e-06 4.2439426e-02 4.5060839e-02 1.5947633e-01 1.4607938e-02 + 5.3125000e-04 1.8298762e+03 1.7771189e-01 7.0910796e-04 3.2092461e-02 6.9251404e-01 2.4704386e-06 4.1826830e-02 4.6114812e-02 1.6014294e-01 1.4319068e-02 + 5.3906250e-04 1.8356687e+03 1.7720548e-01 5.6181065e-04 3.0967177e-02 6.9272166e-01 2.1483494e-06 4.1184163e-02 4.7141209e-02 1.6073022e-01 1.4044513e-02 + 5.4687500e-04 1.8409521e+03 1.7675317e-01 4.4327780e-04 2.9936125e-02 6.9292858e-01 1.8422233e-06 4.0520763e-02 4.8138679e-02 1.6124612e-01 1.3785897e-02 + 5.5468750e-04 1.8458011e+03 1.7634651e-01 3.4842479e-04 2.8991985e-02 6.9313397e-01 1.5597511e-06 3.9844956e-02 4.9106146e-02 1.6169816e-01 1.3544290e-02 + 5.6250000e-04 1.8502812e+03 1.7597820e-01 2.7290417e-04 2.8127663e-02 6.9333710e-01 1.3054909e-06 3.9163995e-02 5.0042808e-02 1.6209336e-01 1.3320259e-02 + 5.7031250e-04 1.8544491e+03 1.7564199e-01 2.1304595e-04 2.7336382e-02 6.9353738e-01 1.0813814e-06 3.8484058e-02 5.0948119e-02 1.6243819e-01 1.3113935e-02 + 5.7812500e-04 1.8583529e+03 1.7533259e-01 1.6578673e-04 2.6611735e-02 6.9373429e-01 8.8735215e-07 3.7810295e-02 5.1821768e-02 1.6273860e-01 1.2925083e-02 + 5.8593750e-04 1.8620332e+03 1.7504557e-01 1.2859444e-04 2.5947724e-02 6.9392742e-01 7.2194342e-07 3.7146904e-02 5.2663663e-02 1.6300001e-01 1.2753171e-02 + 5.9375000e-04 1.8655239e+03 1.7477725e-01 9.9393571e-05 2.5338781e-02 6.9411647e-01 5.8290968e-07 3.6497229e-02 5.3473899e-02 1.6322731e-01 1.2597444e-02 + 6.0937500e-04 1.8720212e+03 1.7428718e-01 5.9923171e-05 2.4271585e-02 6.9448124e-01 3.7702290e-07 3.5247919e-02 5.4998787e-02 1.6359259e-01 1.2331993e-02 + 6.2500000e-04 1.8780421e+03 1.7384140e-01 3.5912294e-05 2.3365272e-02 6.9482783e-01 2.3953586e-07 3.4075041e-02 5.6404872e-02 1.6387000e-01 1.2118708e-02 + 6.4062500e-04 1.8836933e+03 1.7342827e-01 2.1415190e-05 2.2590742e-02 6.9515581e-01 1.4995150e-07 3.2984055e-02 5.7697572e-02 1.6408271e-01 1.1948740e-02 + 6.5625000e-04 1.8890457e+03 1.7304006e-01 1.2705567e-05 2.1924146e-02 6.9546533e-01 9.2670970e-08 3.1975766e-02 5.8883274e-02 1.6424889e-01 1.1813714e-02 + 6.7187500e-04 1.8941474e+03 1.7267164e-01 7.4791818e-06 2.1346074e-02 6.9575695e-01 5.6481093e-08 3.1048069e-02 5.9968880e-02 1.6438264e-01 1.1706169e-02 + 6.8750000e-04 1.8990316e+03 1.7231949e-01 4.3211523e-06 2.0840791e-02 6.9603146e-01 3.3674094e-08 3.0197159e-02 6.0961464e-02 1.6449478e-01 1.1619722e-02 + 7.1875000e-04 1.9082215e+03 1.7165617e-01 1.5932799e-06 2.0011291e-02 6.9653157e-01 1.2994130e-08 2.8713447e-02 6.2686358e-02 1.6467871e-01 1.1494364e-02 + 7.5000000e-04 1.9167811e+03 1.7103617e-01 5.8677870e-07 1.9343851e-02 6.9697639e-01 4.9702777e-09 2.7467467e-02 6.4133215e-02 1.6484953e-01 1.1401971e-02 + 7.8125000e-04 1.9247917e+03 1.7045308e-01 2.1449422e-07 1.8791891e-02 6.9737376e-01 1.8745869e-09 2.6420481e-02 6.5348305e-02 1.6502726e-01 1.1324585e-02 + 8.1250000e-04 1.9323145e+03 1.6990266e-01 7.2411569e-08 1.8323972e-02 6.9773081e-01 6.5087826e-10 2.5538376e-02 6.6371398e-02 1.6522078e-01 1.1251882e-02 + 8.7500000e-04 1.9460490e+03 1.6888924e-01 1.2804756e-08 1.7576396e-02 6.9834198e-01 1.1932739e-10 2.4184055e-02 6.7939335e-02 1.6566262e-01 1.1103942e-02 + 9.3750000e-04 1.9584167e+03 1.6797275e-01 2.2935662e-09 1.6972846e-02 6.9885774e-01 2.2049709e-11 2.3177367e-02 6.9104960e-02 1.6615928e-01 1.0940855e-02 + 1.0000000e-03 1.9696341e+03 1.6714064e-01 3.5234692e-10 1.6464040e-02 6.9930399e-01 3.4776528e-12 2.2405852e-02 6.9997659e-02 1.6668703e-01 1.0764675e-02 + 1.1250000e-03 1.9891157e+03 1.6569707e-01 2.5994003e-11 1.5645452e-02 7.0004132e-01 2.6325345e-13 2.1339810e-02 7.1227848e-02 1.6777036e-01 1.0389446e-02 + 1.2500000e-03 2.0058660e+03 1.6446868e-01 2.0105095e-12 1.4967819e-02 7.0065802e-01 2.0874209e-14 2.0561884e-02 7.2125213e-02 1.6880888e-01 1.0014957e-02 + 1.3750000e-03 2.0204697e+03 1.6341103e-01 1.6308017e-13 1.4383893e-02 7.0119291e-01 1.7828656e-15 1.9936762e-02 7.2844851e-02 1.6977063e-01 9.6570537e-03 + 1.5000000e-03 2.0333398e+03 1.6249109e-01 1.4022079e-14 1.3868225e-02 7.0166763e-01 2.1132841e-16 1.9399493e-02 7.3461555e-02 1.7064797e-01 9.3220471e-03 + 1.6250000e-03 2.0447791e+03 1.6168389e-01 1.4203867e-15 1.3405792e-02 7.0209517e-01 7.0695980e-17 1.8918245e-02 7.4012228e-02 1.7144380e-01 9.0114399e-03 + 1.7500000e-03 2.0550159e+03 1.6097037e-01 2.8661979e-16 1.2986974e-02 7.0248397e-01 5.2658321e-17 1.8476895e-02 7.4515740e-02 1.7216487e-01 8.7245369e-03 + 1.8750000e-03 2.0642248e+03 1.6033591e-01 1.6310205e-16 1.2605215e-02 7.0283996e-01 4.6406019e-17 1.8066898e-02 7.4982210e-02 1.7281877e-01 8.4597521e-03 + 2.0000000e-03 2.0725383e+03 1.5976938e-01 1.3551042e-16 1.2255953e-02 7.0316755e-01 4.1983526e-17 1.7683533e-02 7.5417290e-02 1.7341258e-01 8.2152560e-03 + 2.2500000e-03 2.0867723e+03 1.5881396e-01 1.0870999e-16 1.1646992e-02 7.0374684e-01 3.5258058e-17 1.6990720e-02 7.6200292e-02 1.7443417e-01 7.7833184e-03 + 2.5000000e-03 2.0988534e+03 1.5801583e-01 9.0485132e-17 1.1119043e-02 7.0424969e-01 3.0202111e-17 1.6369551e-02 7.6899848e-02 1.7530311e-01 7.4086469e-03 + 2.7500000e-03 2.1092248e+03 1.5733997e-01 7.7295488e-17 1.0657256e-02 7.0469007e-01 2.6274876e-17 1.5810672e-02 7.7527485e-02 1.7604996e-01 7.0811505e-03 + 3.0000000e-03 2.1181952e+03 1.5676248e-01 6.7439034e-17 1.0251156e-02 7.0507854e-01 2.3148484e-17 1.5306858e-02 7.8091994e-02 1.7669669e-01 6.7930614e-03 + 3.5000000e-03 2.1325208e+03 1.5585530e-01 5.4217314e-17 9.5890920e-03 7.0572270e-01 1.8598690e-17 1.4453970e-02 7.9043486e-02 1.7772943e-01 6.3197471e-03 + 4.0000000e-03 2.1439722e+03 1.5514120e-01 4.5631706e-17 9.0482770e-03 7.0624797e-01 1.5381151e-17 1.3737522e-02 7.9840520e-02 1.7855423e-01 5.9354562e-03 + 5.0000000e-03 2.1601970e+03 1.5414828e-01 3.5892213e-17 8.2635478e-03 7.0702165e-01 1.1382590e-17 1.2656848e-02 8.1036719e-02 1.7971894e-01 5.3764154e-03 + 6.0000000e-03 2.1720259e+03 1.5343467e-01 3.0381219e-17 7.6788632e-03 7.0758904e-01 8.9247846e-18 1.1835624e-02 8.1943287e-02 1.8056616e-01 4.9669063e-03 + 7.0000000e-03 2.1809060e+03 1.5290278e-01 2.7029117e-17 7.2331136e-03 7.0800621e-01 7.3409492e-18 1.1209066e-02 8.2635045e-02 1.8120273e-01 4.6630532e-03 + 8.5000000e-03 2.1897122e+03 1.5237260e-01 2.4461768e-17 6.7871020e-03 7.0837803e-01 6.0438272e-18 1.0609232e-02 8.3302791e-02 1.8183634e-01 4.3807701e-03 + 1.0000000e-02 2.1897122e+03 1.5237260e-01 2.4461768e-17 6.7871020e-03 7.0837803e-01 6.0438272e-18 1.0609232e-02 8.3302791e-02 1.8183634e-01 4.3807701e-03 diff --git a/testcases/Speelman/Speelman.json b/testcases/Speelman/Speelman.json new file mode 100644 index 0000000..952d8fa --- /dev/null +++ b/testcases/Speelman/Speelman.json @@ -0,0 +1,128 @@ +{ + "Mapping" : { + "tiles" : [1,1,1], + "tilesPerRank" : [1,1,1], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 720 + }, + + "Grid" : { + "xNum" : 1, + "yNum" : 600, + "zNum" : 1, + "origin" : [0.0, 0.0, 0.0], + "xWidth" : 1.0, + "yWidth" : 10.0, + "zWidth" : 1.0, + "xType" : "Uniform", + "yType" : "SinhMinus", + "zType" : "Uniform", + "xStretching" : 1.0, + "yStretching" : 1.0, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 4000000, + "maxTime" : 10000.0, + "cfl" : -0.5, + "fixedDeltaTime" : 1.0e-3, + "implicitChemistry" : false, + "EulerScheme" : { + "type" : "TENOA" + } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { + "type" : "NSCBC_Inflow", + "VelocityProfile" : { + "type" : "Constant", + "velocity" : [0.0, 0.0013383529450437532, 0.0] + }, + "TemperatureProfile" : { + "type" : "Constant", + "temperature" : 1.0 + }, + "MixtureProfile" : { + "type" : "Constant", + "Mixture" : { + "Species" : [{"Name" : "H2", "MolarFrac" : 7.40684e-03 }, + {"Name" : "O2", "MolarFrac" : 1.84424e-01 }, + {"Name" : "H2O", "MolarFrac" : 8.55896e-03 }, + {"Name" : "HO2", "MolarFrac" : 1.93613e-05 }, + {"Name" : "CH4", "MolarFrac" : 9.00803e-02 }, + {"Name" : "CO", "MolarFrac" : 1.46025e-03 }, + {"Name" : "CO2", "MolarFrac" : 3.72531e-04 }, + {"Name" : "CH2O", "MolarFrac" : 5.65397e-05 }, + {"Name" : "CH3OH", "MolarFrac" : 1.05251e-05 }, + {"Name" : "C2H4", "MolarFrac" : 1.19638e-05 }, + {"Name" : "C2H6", "MolarFrac" : 2.85111e-05 }, + {"Name" : "N2", "MolarFrac" : 7.07556e-01 }] + } + }, + "P" : 1.0 + }, + "yBCRight" : { + "type" : "NSCBC_Outflow", + "P" : 1.0 + }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture" : { + "type" : "CH4_30SpMix", + "LRef" : 1.0e-3, + "PRef" : 1.01325e5, + "TRef" : 350.0, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 0.22 }, + {"Name" : "N2", "MolarFrac" : 0.78 }] + } + }, + "initCase" : { + "type" : "Uniform", + "pressure" : 1.0, + "temperature" : 5.5, + "velocity" : [0.0, 0.0013383529450437532, 0.0], + "molarFracs" : { + "Species" : [{"Name" :"CH4", "MolarFrac" : 0.02 }, + {"Name" : "O2", "MolarFrac" : 0.10 }, + {"Name" : "N2", "MolarFrac" : 0.88 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 0.22 }, + {"Name" : "N2", "MolarFrac" : 0.78 }] + }, + "bodyForce" : [0.0, 0.0, 0.0], + "turbForcing" : { "type" : "OFF" } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 50000, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [] + }, + + "Efield" : { "type" : "Off" } +} diff --git a/testcases/Speelman/Speelman.py b/testcases/Speelman/Speelman.py new file mode 100644 index 0000000..3b4a2c8 --- /dev/null +++ b/testcases/Speelman/Speelman.py @@ -0,0 +1,33 @@ +import cantera as ct +import numpy as np + +gas = ct.Solution("Lu.cti") +gas.set_equivalence_ratio(1.0, 'CH4', {'O2':1.0, 'N2':3.76}) +gas.TP = 300, ct.one_atm + +species_names = gas.species_names + +gas() + +flame = ct.BurnerFlame(gas, width=1.0e-2) +flame.burner.T = 350 +flame.burner.mdot = 0.40472 +flame.burner.Y = gas.Y +flame.set_refine_criteria(ratio=2.0, slope=0.1, curve=0.15, prune=0.03) +flame.solve() + +f = open("Ref.dat", "w") +f.write((11*"%15s"+"\n")%("y", "T", "rho", "X_CH4", "X_O2", "X_N2", "X_CH", "X_CO", "X_CO2", "X_H2O", "X_H2")) + +for i, y in enumerate(flame.grid): + f.write((11*"%15.7e"+"\n")%(y, flame.T[i], flame.density[i], + flame.X[species_names.index("CH4")][i], + flame.X[species_names.index( "O2")][i], + flame.X[species_names.index( "N2")][i], + flame.X[species_names.index( "CH")][i], + flame.X[species_names.index( "CO")][i], + flame.X[species_names.index("CO2")][i], + flame.X[species_names.index("H2O")][i], + flame.X[species_names.index( "H2")][i])) +f.close() + diff --git a/testcases/Speelman/postProc.py b/testcases/Speelman/postProc.py new file mode 100644 index 0000000..50d6abf --- /dev/null +++ b/testcases/Speelman/postProc.py @@ -0,0 +1,117 @@ +import numpy as np +import json +#import argparse +import matplotlib.pyplot as plt +import matplotlib.ticker +from matplotlib.legend_handler import HandlerTuple +import sys +import os +import subprocess +import h5py +import pandas + +# load local modules +sys.path.insert(0, os.path.expandvars("$HTR_DIR/scripts/modules")) +import MulticomponentMix + +dir_name = os.path.join(os.environ['HTR_DIR'], 'testcases/Speelman') +input_file = os.path.join(dir_name, 'Speelman.json') +ref_file = os.path.join(dir_name, 'Ref.dat') + +############################################################################## +# Read HTR input file # +############################################################################## +with open(input_file) as f: + data = json.load(f) + +xNum = data["Grid"]["xNum"] +yNum = data["Grid"]["yNum"] +zNum = data["Grid"]["zNum"] + +mix = MulticomponentMix.Mix(data["Flow"]["mixture"]) + +############################################################################## +# Read reference solution # +############################################################################## + +Ref = pandas.read_csv(ref_file, delim_whitespace=True, encoding= "unicode_escape") + +############################################################################## +# Process result file # +############################################################################## +def process(nstep): + filename = os.path.join(dir_name, 'sample0/fluid_iter'+str(nstep).zfill(10)+'/0,0,0-0,'+str(yNum+1)+',0.hdf') + exists = os.path.isfile(filename) + if (not exists): + # merge files from different tiles + merge_command = 'python {} {}'.format(os.path.expandvars('$HTR_DIR/scripts/merge.py'), + os.path.join(dir_name, 'sample0/fluid_iter'+str(nstep).zfill(10)+'/*.hdf')) + mv_command = 'mv {} {}'.format('./0,0,0-'+str(xNum+1)+','+str(yNum+1)+',0.hdf', + os.path.join(dir_name, 'sample0/fluid_iter'+str(nstep).zfill(10)+'/')) + try: + subprocess.call(merge_command, shell=True) + except OSError: + print("Failed command: {}".format(merge_command)) + sys.exit() + try: + subprocess.call( mv_command, shell=True) + except OSError: + print("Failed command: {}".format(mv_command)) + sys.exit() + +############################################################################## +# Read HTR output data # +############################################################################## + + f = h5py.File(filename, 'r') + + # Get the data + x = f["centerCoordinates"][:][0,:,0,1] + pressure = f["pressure"][:][0,:,0] + temperature = f["temperature"][:][0,:,0] + density = f["rho"][:][0,:,0] + velocity = f["velocity"][:][0,:,0,:] + molarFracs = f["MolarFracs"][:][0,:,0,:] + + return x*mix.LRef, pressure*mix.PRef, temperature*mix.TRef, density*mix.rhoRef, velocity*mix.uRef, molarFracs, f.attrs.get("SpeciesNames") + +############################################################################## +# Plot # +############################################################################## + +x, pressure, temperature, density, velocity, molarFracs, specieNames = process(3700000) + +plt.rcParams.update({'font.size': 16}) + +plt.figure(1) +plt.plot(x, temperature, '-k', label="HTR solver") +plt.plot(Ref["y"], Ref["T"], 'ok', label="Cantera", markevery=5e-2) +plt.xlabel(r'$x [m]$', fontsize = 20) +plt.ylabel(r'$T [K]$', fontsize = 20) +plt.ticklabel_format(axis="x", style="sci", scilimits=(0,0), useMathText=True) +plt.gca().set_xlim(0, 5e-3) +plt.gca().set_ylim(350, 2400) +plt.legend() +plt.savefig('Temperature.eps', bbox_inches='tight') + +plt.figure(2) +CH4my, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("CH4", specieNames)], '-k') +CO2my, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("CO2", specieNames)], '-r') +CHmy, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("CH", specieNames)], '-b') +H2my, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("H2", specieNames)], '-g') +CH4ca, = plt.semilogy(Ref["y"], Ref["X_CH4"], 'ok', markevery=0.05) +CO2ca, = plt.semilogy(Ref["y"], Ref["X_CO2"], 'or', markevery=0.05) +CHca, = plt.semilogy(Ref["y"], Ref["X_CH"], 'ob', markevery=0.05) +H2ca, = plt.semilogy(Ref["y"], Ref["X_H2"], 'og', markevery=0.05) +plt.xlabel(r'$x [m]$', fontsize = 20) +plt.ylabel(r'$X_i$', fontsize = 20) +plt.ticklabel_format(axis="x", style="sci", scilimits=(0,0), useMathText=True) +plt.gca().set_xlim(0, 5e-3) +plt.gca().set_ylim(1e-8, 0.5) +plt.legend([(CH4my, CH4ca), (CO2my, CO2ca), (CHmy, CHca), (H2my, H2ca),], + [r"$X_{CH_4}$", r"$X_{CO_2}$", r"$X_{CH}$", r"$X_{H2}$"], + handler_map={tuple: HandlerTuple(ndivide=None)}, handlelength=8.0) +plt.savefig('MolarFractions.eps', bbox_inches='tight') + +plt.show() + diff --git a/testcases/Speelman_DV250/Speelman.json b/testcases/Speelman_DV250/Speelman.json new file mode 100644 index 0000000..82a6c12 --- /dev/null +++ b/testcases/Speelman_DV250/Speelman.json @@ -0,0 +1,129 @@ +{ + "Mapping" : { + "tiles" : [1,1,1], + "tilesPerRank" : [1,1,1], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 720 + }, + + "Grid" : { + "xNum" : 1, + "yNum" : 600, + "zNum" : 1, + "origin" : [0.0, 0.0, 0.0], + "xWidth" : 1.0, + "yWidth" : 10.0, + "zWidth" : 1.0, + "xType" : "Uniform", + "yType" : "SinhMinus", + "zType" : "Uniform", + "xStretching" : 1.0, + "yStretching" : 1.0, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 4000000, + "maxTime" : 10000.0, + "cfl" : 0.5, + "fixedDeltaTime" : 1.0e-7, + "implicitChemistry" : false, + "EulerScheme" : { + "type" : "TENOA" + } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { + "type" : "NSCBC_Inflow", + "VelocityProfile" : { + "type" : "Constant", + "velocity" : [0.0, 1.33371e-03, 0.0] + }, + "TemperatureProfile" : { + "type" : "Constant", + "temperature" : 1.0 + }, + "MixtureProfile" : { + "type" : "Constant", + "Mixture" : { + "Species" : [{"Name" : "N2", "MolarFrac" : 7.08249e-01 }, + {"Name" : "H2", "MolarFrac" : 6.79719e-03 }, + {"Name" : "O2", "MolarFrac" : 1.85422e-01 }, + {"Name" : "H2O", "MolarFrac" : 7.17151e-03 }, + {"Name" : "H2O2", "MolarFrac" : 4.96793e-06 }, + {"Name" : "HO2", "MolarFrac" : 1.27489e-05 }, + {"Name" : "CO", "MolarFrac" : 1.13144e-03 }, + {"Name" : "CO2", "MolarFrac" : 2.63158e-04 }, + {"Name" : "CH4", "MolarFrac" : 9.08305e-02 }, + {"Name" : "CH3O2", "MolarFrac" : 6.75100e-06 }, + {"Name" : "CH3OH", "MolarFrac" : 2.33956e-05 }, + {"Name" : "CH2O", "MolarFrac" : 3.09441e-05 }, + {"Name" : "C2H6", "MolarFrac" : 2.43035e-05 }, + {"Name" : "C2H4", "MolarFrac" : 2.63498e-05 }, + {"Name" : "C2H2", "MolarFrac" : 4.85256e-06 }] + } + }, + "P" : 1.0 + }, + "yBCRight" : { + "type" : "NSCBC_Outflow", + "P" : 1.0 + }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture" : { + "type" : "CH4_43SpIonsMix", + "LRef" : 1.0e-3, + "PRef" : 1.01325e5, + "TRef" : 350.0, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 0.22 }, + {"Name" : "N2", "MolarFrac" : 0.78 }] + } + }, + "initCase" : { + "type" : "Restart", + "restartDir" : "restart" + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 0.22 }, + {"Name" : "N2", "MolarFrac" : 0.78 }] + }, + "bodyForce" : [0.0, 0.0, 0.0], + "turbForcing" : { "type" : "OFF" } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 50000, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [] + }, + + "Efield" : { + "type" : "Ybc", + "Phi_bottom" : 0.0, + "Phi_top" : 8288.944390108263, + "Robin_bc" : false + } +} diff --git a/testcases/Speelman_DV250/mkHTRrestart.py b/testcases/Speelman_DV250/mkHTRrestart.py new file mode 100644 index 0000000..770bfe8 --- /dev/null +++ b/testcases/Speelman_DV250/mkHTRrestart.py @@ -0,0 +1,231 @@ +import cantera as ct +import numpy as np +import os +from scipy import interpolate + +solution_name = "flame.xml" + +gas = ct.Solution("reducedS43R464_0.cti") +gas.TP = 350, ct.one_atm +gas.X = {'O2':0.22, 'N2':0.78} +rhoRef = gas.density +species_names = gas.species_names + +gas.set_equivalence_ratio(1.0, 'CH4', {'O2':1.0, 'N2':3.76}) +gas.TP = 350, ct.one_atm +gas() + +flame = ct.IonBurnerFlame(gas, width=1.0e-2) +flame.transport_model = 'Ion' +flame.burner.T = 350 +flame.burner.mdot = 0.4104536576956711 +flame.burner.Y = gas.Y +flame.set_refine_criteria(ratio=2.0, slope=0.05, curve=0.05, prune=0.01) +flame.delta_electric_potential = 250 +if os.path.isfile(solution_name): + flame.restore(solution_name) +else: + flame.solve(stage=2) + flame.save(solution_name) + +uRef = np.sqrt(ct.one_atm/rhoRef) +print("u_0 = %10.5e"%(flame.velocity[0]/uRef)) +Xi = flame.X[:,0] + +def extrapolateSpecies(yp, y, X): + f = interpolate.interp1d(y, X, "cubic", fill_value="extrapolate") + return max(1e-60, f(yp)) + +for i, X in enumerate(Xi): + X = extrapolateSpecies(-1.4181995066908476e-05, flame.grid, flame.X[i,:]) + if X > 1e-6: + print('{{\"Name\" : \"{0:}\", \"MolarFrac\" : {1:10.5e} }},'.format(species_names[i], X)) + +print("u_o = %10.5e"%(flame.velocity[-1]/uRef)) +print("T_o = %10.5e"%(flame.T[-1]/350)) +Xo = flame.X[:,-1] +for i, X in enumerate(Xo): + if X > 1e-6: + print('{{\"Name\" : \"{0:}\", \"MolarFrac\" : {1:10.5e} }},'.format(species_names[i], X)) + +f = open("Ref.dat", "w") +f.write((19*"%15s"+"\n")%("y", "T", "rho", "Phi", "rho_q", + "X_CH4", "X_O2", "X_N2", "X_CH", "X_CO", "X_CO2", "X_H2O", "X_H2", + "X_H3O+", "X_E", "X_C2H3O+", "X_CH5O+", "X_O2-", "X_OH-")) + +electric_charge_density = flame.electric_charge_density + +for i, y in enumerate(flame.grid): + f.write((19*"%15.7e"+"\n")%(y, + flame.T[i], + flame.density[i], + flame.electric_potential[i], + electric_charge_density[i], + flame.X[species_names.index( "CH4")][i], + flame.X[species_names.index( "O2")][i], + flame.X[species_names.index( "N2")][i], + flame.X[species_names.index( "CH")][i], + flame.X[species_names.index( "CO")][i], + flame.X[species_names.index( "CO2")][i], + flame.X[species_names.index( "H2O")][i], + flame.X[species_names.index( "H2")][i], + flame.X[species_names.index( "H3O+")][i], + flame.X[species_names.index( "E")][i], + flame.X[species_names.index("C2H3O+")][i], + flame.X[species_names.index( "CH5O+")][i], + flame.X[species_names.index( "O2-")][i], + flame.X[species_names.index( "OH-")][i])) +f.close() + +import sys +import json +import h5py +sys.path.insert(0, os.path.expandvars("$HTR_DIR/scripts/modules")) +import gridGen +import MulticomponentMix + +with open("Speelman.json") as f: + config = json.load(f) + +mix = MulticomponentMix.Mix(config["Flow"]["mixture"]) + +xGrid, dx = gridGen.GetGrid(config["Grid"]["origin"][0], + config["Grid"]["xWidth"], + config["Grid"]["xNum"], + config["Grid"]["xType"], + config["Grid"]["xStretching"], + True) + +yGrid, dy = gridGen.GetGrid(config["Grid"]["origin"][1], + config["Grid"]["yWidth"], + config["Grid"]["yNum"], + config["Grid"]["yType"], + config["Grid"]["yStretching"], + False) + +zGrid, dz = gridGen.GetGrid(config["Grid"]["origin"][2], + config["Grid"]["zWidth"], + config["Grid"]["zNum"], + config["Grid"]["zType"], + config["Grid"]["yStretching"], + True) + +# Load mapping +assert config["Mapping"]["tiles"][0] % config["Mapping"]["tilesPerRank"][0] == 0 +assert config["Mapping"]["tiles"][1] % config["Mapping"]["tilesPerRank"][1] == 0 +assert config["Mapping"]["tiles"][2] % config["Mapping"]["tilesPerRank"][2] == 0 +Ntiles = config["Mapping"]["tiles"] +Ntiles[0] = int(Ntiles[0]/config["Mapping"]["tilesPerRank"][0]) +Ntiles[1] = int(Ntiles[1]/config["Mapping"]["tilesPerRank"][1]) +Ntiles[2] = int(Ntiles[2]/config["Mapping"]["tilesPerRank"][2]) + +assert config["Grid"]["xNum"] % Ntiles[0] == 0 +assert config["Grid"]["yNum"] % Ntiles[1] == 0 +assert config["Grid"]["zNum"] % Ntiles[2] == 0 + +NxTile = int(config["Grid"]["xNum"]/Ntiles[0]) +NyTile = int(config["Grid"]["yNum"]/Ntiles[1]) +NzTile = int(config["Grid"]["zNum"]/Ntiles[2]) + +halo = [0, 1, 0] + +############################################################################## +# Produce restart and profile files # +############################################################################## + +restartDir="restart" + +if not os.path.exists(restartDir): + os.makedirs(restartDir) + +def writeTile(xt, yt, zt): + lo_bound = [(xt )*NxTile +halo[0], (yt )*NyTile +halo[1], (zt )*NzTile +halo[2]] + hi_bound = [(xt+1)*NxTile-1+halo[0], (yt+1)*NyTile-1+halo[1], (zt+1)*NzTile-1+halo[2]] + if (xt == 0): lo_bound[0] -= halo[0] + if (yt == 0): lo_bound[1] -= halo[1] + if (zt == 0): lo_bound[2] -= halo[2] + if (xt == Ntiles[0]-1): hi_bound[0] += halo[0] + if (yt == Ntiles[1]-1): hi_bound[1] += halo[1] + if (zt == Ntiles[2]-1): hi_bound[2] += halo[2] + filename = ('%s,%s,%s-%s,%s,%s.hdf' + % (lo_bound[0], lo_bound[1], lo_bound[2], + hi_bound[0], hi_bound[1], hi_bound[2])) + print("Working on: ", filename) + + shape = [hi_bound[2] - lo_bound[2] +1, + hi_bound[1] - lo_bound[1] +1, + hi_bound[0] - lo_bound[0] +1] + + gridIn = flame.grid/mix.LRef + + with h5py.File(os.path.join(restartDir, filename), 'w') as fout: + fout.attrs.create("timeStep", 0) + fout.attrs.create("simTime", 0.0) + fout.attrs.create("channelForcing", 0.0) + + fout.create_dataset("centerCoordinates", shape=shape, dtype = np.dtype("(3,)f8")) + fout.create_dataset("cellWidth", shape=shape, dtype = np.dtype("(3,)f8")) + fout.create_dataset("rho", shape=shape, dtype = np.dtype("f8")) + fout.create_dataset("pressure", shape=shape, dtype = np.dtype("f8")) + fout.create_dataset("temperature", shape=shape, dtype = np.dtype("f8")) + fout.create_dataset("MolarFracs", shape=shape, dtype = np.dtype("(43,)f8")) + fout.create_dataset("velocity", shape=shape, dtype = np.dtype("(3,)f8")) + fout.create_dataset("dudtBoundary", shape=shape, dtype = np.dtype("(3,)f8")) + fout.create_dataset("dTdtBoundary", shape=shape, dtype = np.dtype("f8")) + fout.create_dataset("MolarFracs_profile", shape=shape, dtype = np.dtype("(43,)f8")) + fout.create_dataset("velocity_profile", shape=shape, dtype = np.dtype("(3,)f8")) + fout.create_dataset("temperature_profile", shape=shape, dtype = np.dtype("f8")) + fout.create_dataset("electricPotential", shape=shape, dtype = np.dtype("f8")) + + fout["centerCoordinates"][:] = np.reshape([(x,y,z) + for z in zGrid[lo_bound[2]:hi_bound[2]+1] + for y in yGrid[lo_bound[1]:hi_bound[1]+1] + for x in xGrid[lo_bound[0]:hi_bound[0]+1]], + (shape[0], shape[1], shape[2], 3)) + + fout["cellWidth"][:] = np.reshape([(x,y,z) + for z in dz[lo_bound[2]:hi_bound[2]+1] + for y in dy[lo_bound[1]:hi_bound[1]+1] + for x in dx[lo_bound[0]:hi_bound[0]+1]], + (shape[0], shape[1], shape[2], 3)) + + fout["pressure"][:] = ct.one_atm/mix.PRef + fout["dTdtBoundary"][:] = np.zeros(shape=shape, dtype = np.dtype("f8")) + fout["dudtBoundary"][:] = np.zeros(shape=shape, dtype = np.dtype("(3,)f8")) + + v = np.interp(yGrid[lo_bound[1]:hi_bound[1]+1], gridIn, flame.velocity/mix.uRef) + velocity = np.ndarray(shape, dtype=np.dtype('(3,)f8')) + for j in range(hi_bound[1]-lo_bound[1]+1): velocity[:,j,:] = [ 0.0, v[j], 0.0] + fout["velocity"][:] = velocity[:] + fout["velocity_profile"][:] = velocity[:] + del velocity + + temperature = np.ndarray(shape) + T = np.interp(yGrid[lo_bound[1]:hi_bound[1]+1], gridIn, flame.T/mix.TRef) + for j in range(hi_bound[1]-lo_bound[1]+1): temperature[:,j,:] = T[j] + fout["temperature"][:] = temperature + fout["temperature_profile"][:] = temperature + del temperature + + rho = np.ndarray(shape) + r = np.interp(yGrid[lo_bound[1]:hi_bound[1]+1], gridIn, flame.density/mix.rhoRef) + for j in range(hi_bound[1]-lo_bound[1]+1): rho[:,j,:] = r[j] + fout["rho"][:] = rho + del rho + + MolarFracs = np.ndarray(shape, dtype=np.dtype('(43,)f8')) + for i, x in enumerate(Xi): + X = np.interp(yGrid[lo_bound[1]:hi_bound[1]+1], gridIn, flame.X[i,:]) + for j in range(hi_bound[1]-lo_bound[1]+1): MolarFracs[:,j,:,i] = X[j] + fout["MolarFracs"][:] = MolarFracs + fout["MolarFracs_profile"][:] = MolarFracs + del MolarFracs + + Phi = np.ndarray(shape) + p = np.interp(yGrid[lo_bound[1]:hi_bound[1]+1], gridIn, flame.electric_potential/mix.delPhi) + for j in range(hi_bound[1]-lo_bound[1]+1): Phi[:,j,:] = p[j] + fout["electricPotential"][:] = Phi + del Phi + +for x, y, z in np.ndindex((Ntiles[0], Ntiles[1], Ntiles[2])): writeTile(x, y, z) + diff --git a/testcases/Speelman_DV250/postProc.py b/testcases/Speelman_DV250/postProc.py new file mode 100644 index 0000000..546757f --- /dev/null +++ b/testcases/Speelman_DV250/postProc.py @@ -0,0 +1,149 @@ +import numpy as np +import json +#import argparse +import matplotlib.pyplot as plt +import matplotlib.ticker +from matplotlib.legend_handler import HandlerTuple +import sys +import os +import subprocess +import h5py +import pandas + +# load local modules +sys.path.insert(0, os.path.expandvars("$HTR_DIR/scripts/modules")) +import MulticomponentMix + +dir_name = os.path.join(os.environ['HTR_DIR'], 'testcases/Speelman_DV250') +input_file = os.path.join(dir_name, 'Speelman.json') +ref_file = os.path.join(dir_name, 'Ref.dat') + +############################################################################## +# Read HTR input file # +############################################################################## +with open(input_file) as f: + data = json.load(f) + +xNum = data["Grid"]["xNum"] +yNum = data["Grid"]["yNum"] +zNum = data["Grid"]["zNum"] + +mix = MulticomponentMix.Mix(data["Flow"]["mixture"]) + +############################################################################## +# Read reference solution # +############################################################################## + +Ref = pandas.read_csv(ref_file, delim_whitespace=True, encoding= "unicode_escape") + +############################################################################## +# Process result file # +############################################################################## +def process(nstep): + filename = os.path.join(dir_name, 'sample0/fluid_iter'+str(nstep).zfill(10)+'/0,0,0-0,'+str(yNum+1)+',0.hdf') +# filename = os.path.join(dir_name, 'data_old/fluid_iter'+str(nstep).zfill(10)+'/0,0,0-0,'+str(yNum+1)+',0.hdf') + exists = os.path.isfile(filename) + if (not exists): + # merge files from different tiles + merge_command = 'python {} {}'.format(os.path.expandvars('$HTR_DIR/scripts/merge.py'), + os.path.join(dir_name, 'sample0/fluid_iter'+str(nstep).zfill(10)+'/*.hdf')) + mv_command = 'mv {} {}'.format('./0,0,0-'+str(xNum+1)+','+str(yNum+1)+',0.hdf', + os.path.join(dir_name, 'sample0/fluid_iter'+str(nstep).zfill(10)+'/')) + try: + subprocess.call(merge_command, shell=True) + except OSError: + print("Failed command: {}".format(merge_command)) + sys.exit() + try: + subprocess.call( mv_command, shell=True) + except OSError: + print("Failed command: {}".format(mv_command)) + sys.exit() + +############################################################################## +# Read HTR output data # +############################################################################## + + f = h5py.File(filename, 'r') + + # Get the data + x = f["centerCoordinates"][:][0,:,0,1] + pressure = f["pressure"][:][0,:,0] + temperature = f["temperature"][:][0,:,0] + density = f["rho"][:][0,:,0] + velocity = f["velocity"][:][0,:,0,:] + molarFracs = f["MolarFracs"][:][0,:,0,:] + ePotential = f["electricPotential"][:][0,:,0] + + return x*mix.LRef, pressure*mix.PRef, temperature*mix.TRef, density*mix.rhoRef, velocity*mix.uRef, molarFracs, ePotential*mix.delPhi, f.attrs.get("SpeciesNames") + +############################################################################## +# Plot # +############################################################################## + +x , pressure , temperature , density , velocity , molarFracs , ePotential , specieNames = process(800000) + +plt.rcParams.update({'font.size': 16}) + +plt.figure(1) +plt.plot(x, temperature, '-k', label="HTR solver") +plt.plot(Ref["y"], Ref["T"], 'ok', label="Cantera", markevery=5e-2) +plt.xlabel(r'$x [m]$', fontsize = 20) +plt.ylabel(r'$T [K]$', fontsize = 20) +plt.ticklabel_format(axis="x", style="sci", scilimits=(0,0), useMathText=True) +plt.gca().set_xlim(0, 5e-3) +plt.gca().set_ylim(350, 2400) +plt.legend() +plt.savefig('Temperature.eps', bbox_inches='tight') + +plt.figure(2) +CH4my, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("CH4", specieNames)], '-k') +CO2my, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("CO2", specieNames)], '-r') +CHmy, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("CH", specieNames)], '-b') +H2my, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("H2", specieNames)], '-g') +CH4ca, = plt.semilogy(Ref["y"], Ref["X_CH4"], 'ok', markevery=0.05) +CO2ca, = plt.semilogy(Ref["y"], Ref["X_CO2"], 'or', markevery=0.05) +CHca, = plt.semilogy(Ref["y"], Ref["X_CH"], 'ob', markevery=0.05) +H2ca, = plt.semilogy(Ref["y"], Ref["X_H2"], 'og', markevery=0.05) +plt.xlabel(r'$x [m]$', fontsize = 20) +plt.ylabel(r'$X_i$', fontsize = 20) +plt.ticklabel_format(axis="x", style="sci", scilimits=(0,0), useMathText=True) +plt.gca().set_xlim(0, 5e-3) +plt.gca().set_ylim(1e-8, 0.5) +plt.legend([(CH4my, CH4ca), (CO2my, CO2ca), (CHmy, CHca), (H2my, H2ca),], + [r"$X_{CH_4}$", r"$X_{CO_2}$", r"$X_{CH}$", r"$X_{H2}$"], + handler_map={tuple: HandlerTuple(ndivide=None)}, handlelength=8.0) +plt.savefig('MolarFractions.eps', bbox_inches='tight') + +plt.figure(3) +plt.plot(x, ePotential, '-k' , label="HTR solver") +plt.plot(Ref["y"], Ref["Phi"], 'ok', label="Cantera", markevery=5e-2) +plt.xlabel(r'$x [m]$', fontsize = 20) +plt.ylabel(r'$\Delta \Phi [V]$', fontsize = 20) +plt.ticklabel_format(axis="x", style="sci", scilimits=(0,0), useMathText=True) +plt.gca().set_xlim(0, 1e-2) +plt.legend() +plt.savefig('Phi.eps', bbox_inches='tight') + +plt.figure(4) +Emy, = plt.semilogy(x, molarFracs[:, mix.FindSpecies( "E", specieNames)], '-k') +H3Omy, = plt.semilogy(x, molarFracs[:, mix.FindSpecies( "H3O+", specieNames)], '-r') +O2Mmy, = plt.semilogy(x, molarFracs[:, mix.FindSpecies( "O2-", specieNames)], '-b') +CH5Omy, = plt.semilogy(x, molarFracs[:, mix.FindSpecies("CH5O+", specieNames)], '-g') +Eca, = plt.semilogy(Ref["y"], Ref["X_E" ], 'ok', markevery=0.05) +H3Oca, = plt.semilogy(Ref["y"], Ref["X_H3O+" ], 'or', markevery=0.05) +O2Mca, = plt.semilogy(Ref["y"], Ref["X_O2-" ], 'ob', markevery=0.05) +CH5Oca, = plt.semilogy(Ref["y"], Ref["X_CH5O+"], 'og', markevery=0.05) +plt.xlabel(r'$x [m]$', fontsize = 20) +plt.ylabel(r'$X_i$', fontsize = 20) +plt.ticklabel_format(axis="x", style="sci", scilimits=(0,0), useMathText=True) +#plt.gca().set_xlim(0, 5e-3) +plt.gca().set_xlim(0, 1e-2) +plt.gca().set_ylim(1e-15, 1e-8) +plt.legend([(Emy, Eca), (H3Omy, H3Oca), (O2Mmy, O2Mca), (CH5Omy, CH5Oca)], + [r"$X_{e^-}$", r"$X_{H_3O^+}$", r"$X_{O_2^-}$", r"$X_{CH_5O^+}$"], + handler_map={tuple: HandlerTuple(ndivide=None)}, handlelength=8.0) +plt.savefig('Ions.eps', bbox_inches='tight') + +plt.show() + diff --git a/testcases/Speelman_DV250/reducedS43R464_0.cti b/testcases/Speelman_DV250/reducedS43R464_0.cti new file mode 100644 index 0000000..ae4e476 --- /dev/null +++ b/testcases/Speelman_DV250/reducedS43R464_0.cti @@ -0,0 +1,2790 @@ +#--------------------------------------------------------------------------- +# CTI File converted from Solution Object +#--------------------------------------------------------------------------- + +units(length = "cm", time = "s", quantity = "mol", act_energy = "cal/mol") + +ideal_gas(name = "gas", + elements = "N H O C E", + species = """ N2 H2 H O2 O H2O OH H2O2 HO2 CO CO2 CH4 CH3 CH2 + CH2(S) C CH CH3O2 CH3OH CH3O CH2OH CH2O HCO C2H6 C2H5 C2H4 C2H3 C2H2 + C2H CH3CHO CH3CO CH2CHO CH2CO HCCO C3H6 C3H5-A CHO+ + C2H3O+ CH5O+ H3O+ OH- O2- E """, + reactions = "all", + initial_state = state(temperature = 3.000000E+02, pressure= 1.013250E+05) ) + +#--------------------------------------------------------------------------- +# Species data +#--------------------------------------------------------------------------- + +species(name = "N2", + atoms = "N:2", + thermo = ( + NASA( [200.0, 1050.0], [3.731006820e+00, -1.831597300e-03, + 4.323246620e-06, -3.043781510e-09, + 7.460715620e-13, -1.062874260e+03, + 2.168211980e+00] ), + NASA( [1050.0, 3500.0], [2.811660730e+00, 1.670673530e-03, + -6.799974280e-07, 1.328813790e-10, + -1.027674420e-14, + -8.698115790e+02, 6.648380500e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.621, + well_depth = 97.53, + polar = 1.76, + rot_relax = 4.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "H2", + atoms = "H:2", + thermo = ( + NASA( [200.0, 700.0], [2.642044380e+00, 5.495292740e-03, + -1.271636340e-05, 1.287491730e-08, + -4.700277490e-12, + -9.432366140e+02, + -5.122311020e-01] ), + NASA( [700.0, 3500.0], [3.781998810e+00, -1.018732590e-03, + 1.242262330e-06, -4.190118980e-10, + 4.755437930e-14, -1.102830230e+03, + -5.605259100e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 2.9200000000000004, + well_depth = 38.0, + polar = 0.7900000000000001, + rot_relax = 280.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "H", + atoms = "H:1", + thermo = ( + NASA( [200.0, 860.0], [2.499505440e+00, 2.991640460e-06, + -5.927597590e-09, 4.878101650e-12, + -1.455393200e-15, 2.547378660e+04, + -4.445740180e-01] ), + NASA( [860.0, 3500.0], [2.500314930e+00, -7.734068280e-07, + 6.393453460e-10, -2.125517910e-13, + 2.444791910e-17, 2.547364740e+04, + -4.483572280e-01] ) + ), + transport = gas_transport( + geom = "atom", + diam = 2.05, + well_depth = 145.0, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "O2", + atoms = "O:2", + thermo = ( + NASA( [200.0, 700.0], [3.744039210e+00, -2.797401470e-03, + 9.801225580e-06, -1.032596430e-08, + 3.799312470e-12, -1.060698270e+03, + 3.821326460e+00] ), + NASA( [700.0, 3500.0], [2.820124080e+00, 2.482113570e-03, + -1.512020940e-06, 4.485562010e-10, + -4.873056680e-14, + -9.313501480e+02, 7.949145520e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.458, + well_depth = 107.4, + polar = 1.6, + rot_relax = 3.8, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "O", + atoms = "O:1", + thermo = ( + NASA( [200.0, 720.0], [3.147992010e+00, -3.111740650e-03, + 6.181378970e-06, -5.638087980e-09, + 1.948660160e-12, 2.913091180e+04, + 2.134465490e+00] ), + NASA( [720.0, 3500.0], [2.625491430e+00, -2.089596440e-04, + 1.339185460e-07, -3.858758960e-11, + 4.389186890e-15, 2.920615190e+04, + 4.483585190e+00] ) + ), + transport = gas_transport( + geom = "atom", + diam = 2.7500000000000004, + well_depth = 80.0, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "H2O", + atoms = "H:2 O:1", + thermo = ( + NASA( [200.0, 1420.0], [4.060611720e+00, -8.658071890e-04, + 3.244095280e-06, -1.802430790e-09, + 3.324832930e-13, -3.028313140e+04, + -2.961504810e-01] ), + NASA( [1420.0, 3500.0], [2.667770750e+00, 3.057688490e-03, + -9.004424110e-07, 1.433615520e-10, + -1.008578170e-14, + -2.988756450e+04, 6.911911310e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 2.6050000000000004, + well_depth = 572.4, + polar = 0.0, + rot_relax = 4.0, + disp_coeff = 0.0, + quad_polar = 0.0, + dipole= 1.8440005262719967) + ) + +species(name = "OH", + atoms = "H:1 O:1", + thermo = ( + NASA( [200.0, 1700.0], [3.913546310e+00, -1.662759260e-03, + 2.309200290e-06, -1.023595080e-09, + 1.588296290e-13, 3.400050470e+03, + 2.054747190e-01] ), + NASA( [1700.0, 3500.0], [2.498673690e+00, 1.666352790e-03, + -6.282515160e-07, 1.283468060e-10, + -1.057358940e-14, 3.881107160e+03, + 7.782188620e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 2.7500000000000004, + well_depth = 80.0, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "H2O2", + atoms = "H:2 O:2", + thermo = ( + NASA( [200.0, 1800.0], [3.347742240e+00, 7.050054370e-03, + -3.845220060e-06, 1.167206610e-09, + -1.476181050e-13, + -1.757847850e+04, 7.178688510e+00] ), + NASA( [1800.0, 3500.0], [4.768696390e+00, 3.892378480e-03, + -1.213823490e-06, 1.926152850e-10, + -1.225819900e-14, + -1.809002200e+04, + -5.118117770e-01] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.458, + well_depth = 107.4, + polar = 0.0, + rot_relax = 3.8, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "HO2", + atoms = "H:1 O:2", + thermo = ( + NASA( [200.0, 700.0], [3.619942990e+00, 1.058057050e-03, + 5.066789410e-06, -6.338007620e-09, + 2.415972810e-12, 3.158982340e+02, + 6.444114820e+00] ), + NASA( [700.0, 3500.0], [3.023918890e+00, 4.463909070e-03, + -2.231464920e-06, 6.127107990e-10, + -6.642662370e-14, 3.993416090e+02, + 9.106999730e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.458, + well_depth = 107.4, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CO", + atoms = "C:1 O:1", + thermo = ( + NASA( [200.0, 960.0], [3.757238910e+00, -2.144652410e-03, + 5.420790050e-06, -4.170259630e-09, + 1.119011270e-12, -1.435755300e+04, + 2.799767990e+00] ), + NASA( [960.0, 3500.0], [2.792553810e+00, 1.874868860e-03, + -8.597119260e-07, 1.912000700e-10, + -1.678552860e-14, + -1.417233350e+04, 7.414435600e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.65, + well_depth = 98.1, + polar = 1.9500000000000002, + rot_relax = 1.8, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CO2", + atoms = "C:1 O:2", + thermo = ( + NASA( [200.0, 1450.0], [2.316843470e+00, 9.227550360e-03, + -7.756540930e-06, 3.282253600e-09, + -5.487224820e-13, + -4.836260670e+04, 1.007862340e+01] ), + NASA( [1450.0, 3500.0], [4.708764680e+00, 2.629147040e-03, + -9.306064620e-07, 1.438929200e-10, + -7.625814140e-15, + -4.905626390e+04, + -2.349764520e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.763, + well_depth = 244.0, + polar = 2.6500000000000004, + rot_relax = 2.1, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH4", + atoms = "C:1 H:4", + thermo = ( + NASA( [300.0, 700.0], [5.239673350e+00, -1.468351230e-02, + 5.297327110e-05, -5.416688220e-08, + 1.963185660e-11, -1.025263080e+04, + -4.976497480e+00] ), + NASA( [700.0, 3500.0], [5.053464050e-01, 1.236978450e-02, + -4.998079220e-06, 1.043927650e-09, + -8.628974160e-14, + -9.589825010e+03, 1.617527750e+01] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.7460000000000004, + well_depth = 141.4, + polar = 2.6, + rot_relax = 13.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH3", + atoms = "C:1 H:3", + thermo = ( + NASA( [300.0, 1060.0], [3.478293100e+00, 3.547647730e-03, + 1.474084400e-06, -1.943759550e-09, + 5.219212320e-13, 1.643995160e+04, + 2.408759560e+00] ), + NASA( [1060.0, 3500.0], [2.788051040e+00, 6.152334770e-03, + -2.211793490e-06, 3.744026480e-10, + -2.481513490e-14, 1.658628290e+04, + 5.778998180e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.8, + well_depth = 144.0, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH2", + atoms = "C:1 H:2", + thermo = ( + NASA( [300.0, 1800.0], [3.764894600e+00, 1.438391910e-03, + 4.755830770e-07, -4.317885910e-10, + 7.582928740e-14, 4.586456990e+04, + 1.489531530e+00] ), + NASA( [1800.0, 3500.0], [2.812729720e+00, 3.554313880e-03, + -1.287685230e-06, 2.212737440e-10, + -1.487381470e-14, 4.620734920e+04, + 6.642846520e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.8, + well_depth = 144.0, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH2(S)", + atoms = "C:1 H:2", + thermo = ( + NASA( [300.0, 970.0], [4.181854340e+00, -2.211343140e-03, + 7.715275410e-06, -5.959503810e-09, + 1.583146280e-12, 5.036694070e+04, + -7.030026020e-01] ), + NASA( [970.0, 3500.0], [2.759342990e+00, 3.654683070e-03, + -1.355899140e-06, 2.749804110e-10, + -2.367954720e-14, 5.064290790e+04, + 6.116463830e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.8, + well_depth = 144.0, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C", + atoms = "C:1", + thermo = ( + NASA( [200.0, 700.0], [2.544951920e+00, -2.477252810e-04, + 5.480182770e-07, -5.485512500e-10, + 2.041173310e-13, 8.544341050e+04, + 4.568742730e+00] ), + NASA( [700.0, 3500.0], [2.494725310e+00, 3.928394760e-05, + -6.700149800e-08, 3.718186940e-11, + -5.073068850e-15, 8.545044220e+04, + 4.793142540e+00] ) + ), + transport = gas_transport( + geom = "atom", + diam = 3.2980000000000005, + well_depth = 71.4, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH", + atoms = "C:1 H:1", + thermo = ( + NASA( [300.0, 1590.0], [3.772643320e+00, -1.585473500e-03, + 2.835122380e-06, -1.361460580e-09, + 2.239953320e-13, 7.063124920e+04, + 8.794079040e-01] ), + NASA( [1590.0, 3500.0], [2.279901280e+00, 2.169852380e-03, + -7.076378850e-07, 1.239734940e-10, + -9.563485150e-15, 7.110594120e+04, + 8.773260610e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 2.7500000000000004, + well_depth = 80.0, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH3O2", + atoms = "C:1 H:3 O:2", + thermo = ( + NASA( [300.0, 1800.0], [1.442896320e+00, 1.807333140e-02, + -1.099465450e-05, 3.423339840e-09, + -4.344521420e-13, 3.213663900e+02, + 1.930412930e+01] ), + NASA( [1800.0, 3500.0], [5.641418170e+00, 8.743282810e-03, + -3.219614060e-06, 5.436952180e-10, + -3.450150080e-14, + -1.190101480e+03, + -3.419146830e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.6260000000000003, + well_depth = 481.8, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH3OH", + atoms = "C:1 H:4 O:1", + thermo = ( + NASA( [300.0, 1800.0], [8.473304790e-01, 1.630869040e-02, + -8.483449610e-06, 2.293043410e-09, + -2.599520130e-13, + -2.509625440e+04, 1.959332970e+01] ), + NASA( [1800.0, 3500.0], [2.717015300e+00, 1.215383530e-02, + -5.021070310e-06, 1.010680700e-09, + -8.184608230e-14, + -2.576934090e+04, 9.474205400e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.6260000000000003, + well_depth = 481.8, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH3O", + atoms = "C:1 H:3 O:1", + thermo = ( + NASA( [300.0, 1740.0], [8.896609850e-01, 1.701197670e-02, + -1.138073510e-05, 3.882809280e-09, + -5.328414790e-13, 1.603161210e+03, + 1.850011340e+01] ), + NASA( [1740.0, 3500.0], [5.722380620e+00, 5.902276370e-03, + -1.803407200e-06, 2.133350090e-10, + -5.618164090e-15, + -7.862522250e+01, + -7.491736770e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.6900000000000004, + well_depth = 417.0, + polar = 0.0, + rot_relax = 2.0, + disp_coeff = 0.0, + quad_polar = 0.0, + dipole= 1.7000004851748343) + ) + +species(name = "CH2OH", + atoms = "C:1 H:3 O:1", + thermo = ( + NASA( [300.0, 1360.0], [2.348215790e+00, 1.396001680e-02, + -1.086322060e-05, 4.624984160e-09, + -8.084991620e-13, + -3.302221060e+03, 1.226619770e+01] ), + NASA( [1360.0, 3500.0], [5.045349500e+00, 6.027270590e-03, + -2.113868210e-06, 3.360859050e-10, + -2.009874820e-14, + -4.035841430e+03, + -1.575240730e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.6900000000000004, + well_depth = 417.0, + polar = 0.0, + rot_relax = 2.0, + disp_coeff = 0.0, + quad_polar = 0.0, + dipole= 1.7000004851748343) + ) + +species(name = "CH2O", + atoms = "C:1 H:2 O:1", + thermo = ( + NASA( [300.0, 700.0], [4.326212960e+00, -7.011518530e-03, + 3.151769610e-05, -3.364786380e-08, + 1.234540230e-11, -1.432701690e+04, + 2.620289020e+00] ), + NASA( [700.0, 3500.0], [1.333356520e+00, 1.009051830e-02, + -5.129525620e-06, 1.254252070e-09, + -1.196391090e-13, + -1.390801700e+04, 1.599161440e+01] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.59, + well_depth = 498.00000000000006, + polar = 0.0, + rot_relax = 2.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "HCO", + atoms = "C:1 H:1 O:1", + thermo = ( + NASA( [200.0, 770.0], [4.034839790e+00, -2.158368640e-03, + 1.182338750e-05, -1.184594060e-08, + 4.005939540e-12, 3.836363920e+03, + 4.200087700e+00] ), + NASA( [770.0, 3500.0], [2.600493180e+00, 5.292782580e-03, + -2.691842110e-06, 7.213577980e-10, + -7.435214090e-14, 4.057253300e+03, + 1.074509330e+01] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.59, + well_depth = 498.00000000000006, + polar = 0.0, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C2H6", + atoms = "C:2 H:6", + thermo = ( + NASA( [300.0, 1800.0], [-2.417787240e-01, 2.534757090e-02, + -1.396451120e-05, 4.032574520e-09, + -4.877543870e-13, + -1.103911210e+04, 2.195726250e+01] ), + NASA( [1800.0, 3500.0], [4.079591410e+00, 1.574452610e-02, + -5.961973930e-06, 1.068671820e-09, + -7.610123400e-14, + -1.259480530e+04, + -1.430894120e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 4.35, + well_depth = 247.5, + polar = 0.0, + rot_relax = 1.5, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C2H5", + atoms = "C:2 H:5", + thermo = ( + NASA( [300.0, 1800.0], [6.754218010e-01, 2.115426170e-02, + -1.208780170e-05, 3.649511800e-09, + -4.597532370e-13, 1.334571860e+04, + 1.956284390e+01] ), + NASA( [1800.0, 3500.0], [5.197913600e+00, 1.110428000e-02, + -3.712816860e-06, 5.476655710e-10, + -2.894126040e-14, 1.171762150e+04, + -4.913825130e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 4.35, + well_depth = 247.5, + polar = 0.0, + rot_relax = 1.5, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C2H4", + atoms = "C:2 H:4", + thermo = ( + NASA( [300.0, 1650.0], [-6.029324500e-02, 2.081339700e-02, + -1.343078670e-05, 4.606383010e-09, + -6.516874810e-13, 5.511516760e+03, + 2.106421720e+01] ), + NASA( [1650.0, 3500.0], [4.604027180e+00, 9.505953500e-03, + -3.151292610e-06, 4.530520740e-10, + -2.239491590e-14, 3.972291020e+03, + -3.774209050e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.496, + well_depth = 238.4, + polar = 0.0, + rot_relax = 1.5, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C2H3", + atoms = "C:2 H:3", + thermo = ( + NASA( [300.0, 1450.0], [1.234212140e+00, 1.562222040e-02, + -1.101715720e-05, 4.279893370e-09, + -6.915415090e-13, 3.469676920e+04, + 1.686370480e+01] ), + NASA( [1450.0, 3500.0], [4.187283760e+00, 7.475815880e-03, + -2.589842270e-06, 4.052657950e-10, + -2.350227210e-14, 3.384037850e+04, + 1.519587510e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.7210000000000005, + well_depth = 265.3, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C2H2", + atoms = "C:2 H:2", + thermo = ( + NASA( [300.0, 790.0], [7.705369070e-01, 2.371079980e-02, + -3.666220440e-05, 2.959897610e-08, + -9.275792550e-12, 2.643179750e+04, + 1.409076830e+01] ), + NASA( [790.0, 3500.0], [4.372674540e+00, 5.472128300e-03, + -2.031815420e-06, 3.750191160e-10, + -2.770490620e-14, 2.586265970e+04, + -2.438359210e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.7210000000000005, + well_depth = 265.3, + polar = 0.0, + rot_relax = 2.5, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C2H", + atoms = "C:2 H:1", + thermo = ( + NASA( [300.0, 1710.0], [4.608735990e+00, 1.427667850e-03, + 8.541586430e-07, -6.839033440e-10, + 1.219405890e-13, 6.688017720e+04, + -1.058940680e+00] ), + NASA( [1710.0, 3500.0], [3.417882570e+00, 4.213289890e-03, + -1.589369460e-06, 2.687391910e-10, + -1.733463590e-14, 6.728744910e+04, + 5.325123670e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.7210000000000005, + well_depth = 265.3, + polar = 0.0, + rot_relax = 2.5, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH3CHO", + atoms = "C:2 H:4 O:1", + thermo = ( + NASA( [300.0, 1800.0], [9.759166370e-01, 2.231678710e-02, + -1.346678680e-05, 4.198836620e-09, + -5.363971870e-13, + -2.117356210e+04, 2.007856130e+01] ), + NASA( [1800.0, 3500.0], [6.221953710e+00, 1.065892700e-02, + -3.751903290e-06, 6.007316280e-10, + -3.666038240e-14, + -2.306213550e+04, + -8.314085770e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.97, + well_depth = 436.0, + polar = 0.0, + rot_relax = 2.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH3CO", + atoms = "C:2 H:3 O:1", + thermo = ( + NASA( [300.0, 1800.0], [1.473880640e+00, 1.835870340e-02, + -1.134264170e-05, 3.595769310e-09, + -4.639992670e-13, + -2.410927050e+03, 1.875752320e+01] ), + NASA( [1800.0, 3500.0], [6.076890160e+00, 8.129793390e-03, + -2.818549990e-06, 4.386983070e-10, + -2.551718370e-14, + -4.068010470e+03, + -6.154924530e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.97, + well_depth = 436.0, + polar = 0.0, + rot_relax = 2.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH2CHO", + atoms = "C:2 H:3 O:1", + thermo = ( + NASA( [300.0, 1340.0], [7.378682810e-01, 2.504543570e-02, + -2.201350260e-05, 1.000312940e-08, + -1.808363570e-12, 3.763893390e+02, + 2.099628370e+01] ), + NASA( [1340.0, 3500.0], [6.477037920e+00, 7.913586040e-03, + -2.836058910e-06, 4.621126550e-10, + -2.832312970e-14, + -1.161708120e+03, + -8.371572860e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.97, + well_depth = 436.0, + polar = 0.0, + rot_relax = 2.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CH2CO", + atoms = "C:2 H:2 O:1", + thermo = ( + NASA( [300.0, 1360.0], [2.495039780e+00, 1.588075920e-02, + -1.271714440e-05, 5.472261190e-09, + -9.591407180e-13, + -7.188989600e+03, 1.181156570e+01] ), + NASA( [1360.0, 3500.0], [5.695236280e+00, 6.468416580e-03, + -2.335884140e-06, 3.834081100e-10, + -2.368978500e-14, + -8.059443050e+03, + -4.611544030e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.97, + well_depth = 436.0, + polar = 0.0, + rot_relax = 2.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "HCCO", + atoms = "C:2 H:1 O:1", + thermo = ( + NASA( [300.0, 1220.0], [3.330286610e+00, 1.203516290e-02, + -1.142479490e-05, 5.707312670e-09, + -1.136181050e-12, 2.000875430e+04, + 7.536503870e+00] ), + NASA( [1220.0, 3500.0], [5.814205130e+00, 3.891167790e-03, + -1.411686080e-06, 2.356685330e-10, + -1.494249710e-14, 1.940267820e+04, + -4.940896470e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 2.5, + well_depth = 150.0, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C3H6", + atoms = "C:3 H:6", + thermo = ( + NASA( [298.0, 1800.0], [-8.559871880e-02, 3.081122550e-02, + -1.845740960e-05, 5.686864910e-09, + -7.137476740e-13, 1.925678190e+03, + 2.409356870e+01] ), + NASA( [1800.0, 3500.0], [6.317552010e+00, 1.658200170e-02, + -6.599723020e-06, 1.295129160e-09, + -1.037843750e-13, + -3.794560710e+02, + -1.056161870e+01] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 4.14, + well_depth = 307.8, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "C3H5-A", + atoms = "C:3 H:5", + thermo = ( + NASA( [298.0, 1600.0], [-3.578880960e-01, 3.270285360e-02, + -2.400535800e-05, 9.073457290e-09, + -1.370164870e-12, 2.002356950e+04, + 2.428456030e+01] ), + NASA( [1600.0, 3500.0], [8.538777920e+00, 1.046118850e-02, + -3.153797080e-06, 3.853068840e-10, + -1.264136890e-14, 1.717663630e+04, + -2.281817580e+01] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 4.22, + well_depth = 316.0, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +species(name = "CHO+", + atoms = "C:1 E:-1 H:1 O:1", + thermo = ( + NASA( [298.15, 3654.18], [2.876276800e+00, 4.948602000e-03, + -2.308530600e-06, 5.112175200e-10, + -4.352063100e-14, 9.913002200e+04, + 6.502026600e+00] ), + NASA( [3654.18, 20000.0], [6.915726500e+00, 1.663110700e-04, + -1.847634300e-08, 9.085642900e-13, + -1.645444100e-17, 9.612933300e+04, + -1.808951000e+01] ) + ), + transport = gas_transport( + geom = "linear", + diam = 2.7500000000000004, + well_depth = 80.0, + polar = 1.341, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 0.41600000000000004) + ) + +species(name = "C2H3O+", + atoms = "C:2 E:-1 H:3 O:1", + thermo = ( + NASA( [200.0, 1000.0], [4.035870500e+00, 8.772948700e-04, + 3.071001000e-05, -3.924756500e-08, + 1.529686900e-11, 7.786483200e+04, + 7.861768200e+00] ), + NASA( [1000.0, 6000.0], [5.313716500e+00, 9.173779300e-03, + -3.322038600e-06, 5.394745600e-10, + -3.245236800e-14, 7.690186500e+04, + -1.675755800e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.97, + well_depth = 436.0, + polar = 3.0360000000000005, + rot_relax = 2.0, + quad_polar = 0.0, + disp_coeff = 4.625000000000001) + ) + +species(name = "CH5O+", + atoms = "C:1 E:-1 H:5 O:1", + thermo = ( + NASA( [300.0, 1000.0], [2.660115000e+00, 7.341508000e-03, + 7.170050000e-06, -8.793194000e-09, + 2.390570000e-12, 6.933546700e+04, + 1.123263100e+01] ), + NASA( [1000.0, 5000.0], [4.029061000e+00, 9.376593000e-03, + -3.050254000e-06, 4.358793000e-10, + -2.224723000e-14, 6.853103700e+04, + 2.378195000e+00] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.97, + well_depth = 436.0, + polar = 2.1260000000000003, + rot_relax = 2.0, + quad_polar = 0.0, + disp_coeff = 4.308) + ) + +species(name = "H3O+", + atoms = "E:-1 H:3 O:1", + thermo = ( + NASA( [298.15, 5430.9], [2.688523200e+00, 5.445365400e-03, + -1.705556600e-06, 2.483329300e-10, + -1.376944000e-14, 7.089026800e+04, + 6.360821700e+00] ), + NASA( [5430.9, 20000.0], [8.950880300e+00, 2.528166800e-04, + -2.459439700e-08, 1.087831800e-12, + -1.809083700e-17, 6.448074900e+04, + -3.387331900e+01] ) + ), + transport = gas_transport( + geom = "nonlinear", + diam = 3.15, + well_depth = 106.2, + polar = 0.9640000000000002, + rot_relax = 10.0, + quad_polar = 0.0, + disp_coeff = 0.9670000000000001) + ) + +species(name = "OH-", + atoms = "E:1 H:1 O:1", + thermo = ( + NASA( [298.15, 1000.0], [3.432799560e+00, 6.196563100e-04, + -1.899309920e-06, 2.373659460e-09, + -8.551037550e-13, + -1.826130860e+04, 1.060536700e+00] ), + NASA( [1000.0, 6000.0], [2.834057010e+00, 1.070580230e-03, + -2.624593980e-07, 3.083764350e-11, + -1.313838620e-15, + -1.801869740e+04, 4.494647620e+00] ) + ), + transport = gas_transport( + geom = "linear", + diam = 2.7500000000000004, + well_depth = 80.0, + polar = 6.4, + rot_relax = 0.0, + quad_polar = 0.0, + disp_coeff = 3.9040000000000004) + ) + +species(name = "O2-", + atoms = "E:1 O:2", + thermo = ( + NASA( [298.15, 2008.71], [3.102171800e+00, 2.798087500e-03, + -2.265112600e-06, 8.691651700e-10, + -1.272188400e-13, + -6.807479300e+03, 6.760902000e+00] ), + NASA( [2008.71, 6000.0], [4.259286700e+00, 2.246807200e-04, + -5.139795500e-08, 7.354597800e-12, + -3.855865200e-16, + -7.242625200e+03, 4.759969700e-01] ) + ), + transport = gas_transport( + geom = "linear", + diam = 3.3300000000000005, + well_depth = 136.5, + polar = 1.581, + rot_relax = 3.8, + quad_polar = 0.0, + disp_coeff = 0.059) + ) + +species(name = "E", + atoms = "E:1", + thermo = ( + NASA( [200.0, 27300.0], [2.500000000e+00, -8.150260800e-18, + 1.302986700e-21, -7.264833300e-26, + 1.306624700e-30, -7.453750000e+02, + -1.173397500e+01] ), + NASA( [27300.0, 30100.0], [2.500000000e+00, 0.000000000e+00, + 0.000000000e+00, 0.000000000e+00, + 0.000000000e+00, -7.453750000e+02, + -1.173397500e+01] ) + ), + transport = gas_transport( + geom = "atom", + diam = 425.00000000000006, + well_depth = 850.0, + polar = 0.0, + rot_relax = 1.0, + quad_polar = 0.0, + disp_coeff = 0.0) + ) + +#--------------------------------------------------------------------------- +# Reaction Data +#--------------------------------------------------------------------------- + +# Reaction 1 +three_body_reaction( "H2 + M <=> 2 H + M", [4.577000E+19, -1.400000E+00, 1.044000E+05], + efficiencies = "CH4:2.0 CO:1.9 CO2:3.8 H2:2.5 H2O:12.0") + +# Reaction 2 +reaction( "H2 + O <=> H + OH", [5.080000E+04, 2.670000E+00, 6.292000E+03]) + +# Reaction 3 +reaction( "H2 + OH <=> H + H2O", [4.380000E+13, 0.000000E+00, 6.990000E+03]) + +# Reaction 4 +three_body_reaction( "2 O + M <=> O2 + M", [6.165000E+15, -5.000000E-01, 0.000000E+00], + efficiencies = "CH4:2.0 CO:1.9 CO2:3.8 H2:2.5 H2O:12.0") + +# Reaction 5 +reaction( "H + O2 <=> O + OH", [1.140000E+14, 0.000000E+00, 1.528600E+04]) + +# Reaction 6 +three_body_reaction( "H + OH + M <=> H2O + M", [3.500000E+22, -2.000000E+00, 0.000000E+00], + efficiencies = "CH4:2.0 H2:0.73 H2O:3.65") + +# Reaction 7 +reaction( "H2O + O <=> 2 OH", [6.700000E+07, 1.704000E+00, 1.498680E+04]) + +# Reaction 8 +three_body_reaction( "H + O + M <=> OH + M", [4.714000E+18, -1.000000E+00, 0.000000E+00], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.5 H2O:12.0") + +# Reaction 9 +falloff_reaction( "H2O2 (+M) <=> 2 OH (+M)", + kf = [2.000000E+12, 9.000000E-01, 4.874900E+04], + kf0 = [2.490000E+24, -2.300000E+00, 4.874900E+04], + efficiencies = "CO:2.8 CO2:1.6 H2:3.7 H2O:7.65 H2O2:7.7 N2:1.5 O2:1.2", + falloff = Troe(A = 0.43, T3 = 1e-30, T1 = 1.0000000000000002e+30, T2 = 0.0) ) + +# Reaction 10 +reaction( "H + H2O2 <=> H2O + OH", [2.410000E+13, 0.000000E+00, 3.970000E+03]) + +# Reaction 11 +reaction( "H + H2O2 <=> H2 + HO2", [2.150000E+10, 1.000000E+00, 6.000000E+03]) + +# Reaction 12 +reaction( "H2O2 + O <=> HO2 + OH", [9.550000E+06, 2.000000E+00, 3.970000E+03]) + +# Reaction 13 +reaction( "H2O2 + OH <=> H2O + HO2", [1.740000E+12, 0.000000E+00, 3.180000E+02], + options = 'duplicate') + +# Reaction 14 +reaction( "H2O2 + OH <=> H2O + HO2", [7.590000E+13, 0.000000E+00, 7.269000E+03], + options = 'duplicate') + +# Reaction 15 +reaction( "H + HO2 <=> 2 OH", [7.079000E+13, 0.000000E+00, 2.950000E+02]) + +# Reaction 16 +reaction( "H + HO2 <=> H2 + O2", [1.140200E+10, 1.083000E+00, 5.537800E+02]) + +# Reaction 17 +reaction( "HO2 + O <=> O2 + OH", [3.250000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 18 +reaction( "HO2 + OH <=> H2O + O2", [7.000000E+12, 0.000000E+00, -1.092960E+03], + options = 'duplicate') + +# Reaction 19 +reaction( "HO2 + OH <=> H2O + O2", [4.500000E+14, 0.000000E+00, 1.092960E+04], + options = 'duplicate') + +# Reaction 20 +reaction( "2 HO2 <=> H2O2 + O2", [1.000000E+14, 0.000000E+00, 1.104088E+04], + options = 'duplicate') + +# Reaction 21 +reaction( "2 HO2 <=> H2O2 + O2", [1.900000E+11, 0.000000E+00, -1.408920E+03], + options = 'duplicate') + +# Reaction 22 +falloff_reaction( "H + O2 (+M) <=> HO2 (+M)", + kf = [4.650000E+12, 4.400000E-01, 0.000000E+00], + kf0 = [1.740000E+19, -1.230000E+00, 0.000000E+00], + efficiencies = "CH4:2.0 CO:1.9 CO2:3.8 H2:1.3 H2O:10.0", + falloff = Troe(A = 0.67, T3 = 1e-30, T1 = 1.0000000000000002e+30, T2 = 1e+30) ) + +# Reaction 23 +falloff_reaction( "CO + O (+M) <=> CO2 (+M)", + kf = [1.362000E+10, 0.000000E+00, 2.384000E+03], + kf0 = [1.170000E+24, -2.790000E+00, 4.191000E+03], + efficiencies = "CO:1.75 CO2:3.6 H2:2.0 H2O:12.0") + +# Reaction 24 +reaction( "CO + OH <=> CO2 + H", [7.015000E+04, 2.053000E+00, -3.557000E+02], + options = 'duplicate') + +# Reaction 25 +reaction( "CO + OH <=> CO2 + H", [5.757000E+12, -6.640000E-01, 3.318000E+02], + options = 'duplicate') + +# Reaction 26 +reaction( "CO + HO2 <=> CO2 + OH", [1.570000E+05, 2.180000E+00, 1.794000E+04]) + +# Reaction 27 +reaction( "CO + O2 <=> CO2 + O", [1.119000E+12, 0.000000E+00, 4.770000E+04]) + +# Reaction 28 +falloff_reaction( "CH3 + H (+M) <=> CH4 (+M)", + kf = [1.270000E+16, -6.300000E-01, 3.830000E+02], + kf0 = [2.480000E+33, -4.760000E+00, 2.440000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.783, T3 = 74.0, T1 = 2941.0, T2 = 6964.0) ) + +# Reaction 29 +reaction( "CH4 + H <=> CH3 + H2", [6.140000E+05, 2.500000E+00, 9.587000E+03]) + +# Reaction 30 +reaction( "CH4 + O <=> CH3 + OH", [1.020000E+09, 1.500000E+00, 8.600000E+03]) + +# Reaction 31 +reaction( "CH4 + OH <=> CH3 + H2O", [5.830000E+04, 2.600000E+00, 2.190000E+03]) + +# Reaction 32 +reaction( "CH4 + HO2 <=> CH3 + H2O2", [1.130000E+01, 3.740000E+00, 2.101000E+04]) + +# Reaction 33 +reaction( "CH3 + HO2 <=> CH4 + O2", [1.160000E+05, 2.230000E+00, -3.022000E+03]) + +# Reaction 34 +reaction( "CH2 + CH4 <=> 2 CH3", [2.460000E+06, 2.000000E+00, 8.270000E+03]) + +# Reaction 35 +reaction( "CH2(S) + N2 <=> CH2 + N2", [1.500000E+13, 0.000000E+00, 6.000000E+02]) + +# Reaction 36 +reaction( "CH2(S) + H2O <=> CH2 + H2O", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 37 +reaction( "CH2(S) + CO <=> CH2 + CO", [9.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 38 +reaction( "CH2(S) + CO2 <=> CH2 + CO2", [7.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 39 +reaction( "CH2(S) + O2 => CO + H + OH", [2.800000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 40 +reaction( "CH2(S) + O2 <=> CO + H2O", [1.200000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 41 +reaction( "CH2(S) + O <=> CO + H2", [1.500000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 42 +reaction( "CH2(S) + O <=> H + HCO", [1.500000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 43 +reaction( "CH2(S) + H2 <=> CH3 + H", [7.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 44 +reaction( "CH2(S) + H <=> CH + H2", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 45 +reaction( "CH2(S) + OH <=> CH2O + H", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 46 +reaction( "CH2(S) + CO2 <=> CH2O + CO", [1.400000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 47 +falloff_reaction( "CH2 + H (+M) <=> CH3 (+M)", + kf = [2.500000E+16, -8.000000E-01, 0.000000E+00], + kf0 = [3.200000E+27, -3.140000E+00, 1.230000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.68, T3 = 78.0, T1 = 1995.0, T2 = 5590.0) ) + +# Reaction 48 +reaction( "CH2 + O2 <=> HCO + OH", [1.060000E+13, 0.000000E+00, 1.500000E+03]) + +# Reaction 49 +reaction( "CH2 + O2 => CO2 + 2 H", [2.640000E+12, 0.000000E+00, 1.500000E+03]) + +# Reaction 50 +reaction( "CH2 + O => CO + 2 H", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 51 +reaction( "CH2 + H <=> CH + H2", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 52 +reaction( "CH2 + OH <=> CH + H2O", [1.130000E+07, 2.000000E+00, 3.000000E+03]) + +# Reaction 53 +reaction( "CH + O2 <=> HCO + O", [3.300000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 54 +reaction( "CH + O <=> CO + H", [5.700000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 55 +reaction( "CH + H <=> C + H2", [1.100000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 56 +reaction( "CH + OH <=> H + HCO", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 57 +reaction( "CH + H2O <=> CH2O + H", [1.774000E+16, -1.220000E+00, 2.380000E+01]) + +# Reaction 58 +reaction( "CH + CO2 <=> CO + HCO", [1.700000E+12, 0.000000E+00, 6.850000E+02]) + +# Reaction 59 +reaction( "C + OH <=> CO + H", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 60 +reaction( "C + O2 <=> CO + O", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 61 +falloff_reaction( "CH3 + O2 (+M) <=> CH3O2 (+M)", + kf = [7.812000E+09, 9.000000E-01, 0.000000E+00], + kf0 = [6.850000E+24, -3.000000E+00, 0.000000E+00], + falloff = Troe(A = 0.6, T3 = 1000.0, T1 = 70.0, T2 = 1700.0) ) + +# Reaction 62 +reaction( "CH3 + O2 <=> CH3O + O", [7.546000E+12, 0.000000E+00, 2.832000E+04]) + +# Reaction 63 +reaction( "CH3 + O2 <=> CH2O + OH", [2.641000E+00, 3.283000E+00, 8.105000E+03]) + +# Reaction 64 +reaction( "CH3 + O <=> CH2O + H", [5.540000E+13, 5.000000E-02, -1.360000E+02]) + +# Reaction 65 +pdep_arrhenius( "CH3 + OH <=> CH2(S) + H2O", + [1.013250E+03, 4.936000E+14, -6.690000E-01, -4.458000E+02], + [1.013250E+04, 1.207000E+15, -7.780000E-01, -1.756000E+02], + [1.013250E+05, 5.282000E+17, -1.518000E+00, 1.772000E+03], + [1.013250E+06, 4.788000E+23, -3.155000E+00, 7.003000E+03], + [1.013250E+07, 8.433000E+19, -1.962000E+00, 8.244000E+03]) + +# Reaction 66 +pdep_arrhenius( "CH3 + OH <=> CH2O + H2", + [1.013250E+03, 3.502000E+05, 1.441000E+00, -3.244000E+03], + [1.013250E+04, 8.854000E+05, 1.327000E+00, -2.975000E+03], + [1.013250E+05, 1.650000E+07, 9.730000E-01, -2.010000E+03], + [1.013250E+06, 5.374000E+09, 2.870000E-01, 2.800000E+02], + [1.013250E+07, 9.494000E+18, -2.199000E+00, 9.769000E+03]) + +# Reaction 67 +pdep_arrhenius( "CH3 + OH <=> CH2OH + H", + [1.013250E+03, 1.621000E+10, 9.650000E-01, 3.214000E+03], + [1.013250E+04, 1.807000E+10, 9.500000E-01, 3.247000E+03], + [1.013250E+05, 4.686000E+10, 8.330000E-01, 3.566000E+03], + [1.013250E+06, 1.525000E+13, 1.340000E-01, 5.641000E+03], + [1.013250E+07, 3.590000E+14, -1.860000E-01, 8.601000E+03]) + +# Reaction 68 +pdep_arrhenius( "CH3 + OH <=> CH3O + H", + [1.013250E+03, 1.186000E+09, 1.016000E+00, 1.194000E+04], + [1.013250E+04, 1.188000E+09, 1.016000E+00, 1.194000E+04], + [1.013250E+05, 1.230000E+09, 1.011000E+00, 1.195000E+04], + [1.013250E+06, 1.798000E+09, 9.650000E-01, 1.206000E+04], + [1.013250E+07, 5.242000E+10, 5.510000E-01, 1.307000E+04]) + +# Reaction 69 +reaction( "CH3 + OH <=> CH2 + H2O", [4.293000E+04, 2.568000E+00, 3.997800E+03]) + +# Reaction 70 +reaction( "CH3 + HO2 <=> CH3O + OH", [1.000000E+12, 2.690000E-01, -6.875000E+02]) + +# Reaction 71 +reaction( "CH3O2 + O <=> CH3O + O2", [3.600000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 72 +reaction( "CH3O2 + H <=> CH3O + OH", [9.600000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 73 +reaction( "CH3O2 + OH <=> CH3OH + O2", [6.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 74 +reaction( "CH3 + CH3O2 <=> 2 CH3O", [5.080000E+12, 0.000000E+00, -1.411000E+03]) + +# Reaction 75 +reaction( "2 CH3O2 => CH2O + CH3OH + O2", [3.110000E+14, -1.610000E+00, -1.051000E+03]) + +# Reaction 76 +reaction( "2 CH3O2 => 2 CH3O + O2", [1.400000E+16, -1.610000E+00, 1.860000E+03]) + +# Reaction 77 +falloff_reaction( "CH3OH (+M) <=> CH3 + OH (+M)", + kf = [2.084000E+18, -6.150000E-01, 9.254060E+04], + kf0 = [1.500000E+43, -6.995000E+00, 9.799220E+04], + falloff = Troe(A = -0.4748, T3 = 35580.0, T1 = 1116.0, T2 = 9023.0) ) + +# Reaction 78 +falloff_reaction( "CH3OH (+M) <=> CH2(S) + H2O (+M)", + kf = [3.121000E+18, -1.017000E+00, 9.171200E+04], + kf0 = [1.430000E+47, -8.227000E+00, 9.941710E+04], + falloff = Troe(A = 2.545, T3 = 3290.0, T1 = 47320.0, T2 = 47110.0) ) + +# Reaction 79 +falloff_reaction( "CH3OH (+M) <=> CH2OH + H (+M)", + kf = [7.896000E-03, 5.038000E+00, 8.446740E+04], + kf0 = [3.390000E+42, -7.244000E+00, 1.052303E+05], + falloff = Troe(A = -73.91, T3 = 37050.0, T1 = 41500.0, T2 = 5220.0) ) + +# Reaction 80 +reaction( "CH3OH + H <=> CH3O + H2", [1.990000E+05, 2.560000E+00, 1.030000E+04]) + +# Reaction 81 +reaction( "CH3OH + H <=> CH2OH + H2", [3.070000E+05, 2.550000E+00, 5.440000E+03]) + +# Reaction 82 +reaction( "CH3OH + O <=> CH3O + OH", [3.880000E+04, 2.500000E+00, 3.080000E+03]) + +# Reaction 83 +reaction( "CH3OH + O <=> CH2OH + OH", [3.880000E+05, 2.500000E+00, 3.080000E+03]) + +# Reaction 84 +reaction( "CH3OH + OH <=> CH3O + H2O", [1.500000E+02, 3.030000E+00, -7.630000E+02]) + +# Reaction 85 +reaction( "CH3OH + OH <=> CH2OH + H2O", [3.080000E+04, 2.650000E+00, -8.067000E+02]) + +# Reaction 86 +reaction( "CH3OH + O2 <=> CH3O + HO2", [3.580000E+04, 2.270000E+00, 4.276450E+04]) + +# Reaction 87 +reaction( "CH3OH + O2 <=> CH2OH + HO2", [3.580000E+05, 2.270000E+00, 4.276450E+04]) + +# Reaction 88 +reaction( "CH3OH + HO2 <=> CH3O + H2O2", [1.220000E+12, 0.000000E+00, 2.007070E+04]) + +# Reaction 89 +reaction( "CH3OH + HO2 <=> CH2OH + H2O2", [3.260000E+13, 0.000000E+00, 1.878220E+04]) + +# Reaction 90 +reaction( "CH3 + CH3OH <=> CH2OH + CH4", [2.130000E-01, 3.953000E+00, 7.055100E+03]) + +# Reaction 91 +reaction( "CH3 + CH3OH <=> CH3O + CH4", [3.220000E+03, 2.425000E+00, 8.579500E+03]) + +# Reaction 92 +reaction( "CH3OH + HCO <=> CH2O + CH2OH", [1.800000E+03, 2.900000E+00, 1.311000E+04]) + +# Reaction 93 +reaction( "CH3O + CH3OH <=> CH2OH + CH3OH", [3.000000E+11, 0.000000E+00, 4.074000E+03]) + +# Reaction 94 +reaction( "CH2OH + O2 <=> CH2O + HO2", [1.510000E+15, -1.000000E+00, 0.000000E+00], + options = 'duplicate') + +# Reaction 95 +reaction( "CH2OH + O2 <=> CH2O + HO2", [2.410000E+14, 0.000000E+00, 5.017000E+03], + options = 'duplicate') + +# Reaction 96 +reaction( "CH2OH + H <=> CH2O + H2", [6.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 97 +reaction( "CH2OH + HO2 <=> CH2O + H2O2", [1.200000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 98 +reaction( "CH2OH + HCO <=> 2 CH2O", [1.800000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 99 +reaction( "CH2OH + HCO <=> CH3OH + CO", [1.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 100 +reaction( "CH2OH + CH3O <=> CH2O + CH3OH", [2.400000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 101 +reaction( "CH2OH + OH <=> CH2O + H2O", [2.400000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 102 +reaction( "CH2OH + O <=> CH2O + OH", [4.200000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 103 +reaction( "2 CH2OH <=> CH2O + CH3OH", [3.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 104 +reaction( "CH3O + O2 <=> CH2O + HO2", [4.380000E-19, 9.500000E+00, -5.501000E+03]) + +# Reaction 105 +reaction( "CH3O + H <=> CH2O + H2", [2.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 106 +reaction( "CH3O + HO2 <=> CH2O + H2O2", [3.010000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 107 +reaction( "CH3 + CH3O <=> CH2O + CH4", [1.200000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 108 +reaction( "2 CH3O <=> CH2O + CH3OH", [6.030000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 109 +falloff_reaction( "H + HCO (+M) <=> CH2O (+M)", + kf = [1.090000E+12, 4.800000E-01, -2.600000E+02], + kf0 = [1.350000E+24, -2.570000E+00, 1.425000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.7824, T3 = 271.0, T1 = 2755.0, T2 = 6570.0) ) + +# Reaction 110 +falloff_reaction( "CO + H2 (+M) <=> CH2O (+M)", + kf = [4.300000E+07, 1.500000E+00, 7.960000E+04], + kf0 = [5.070000E+27, -3.420000E+00, 8.434800E+04], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.932, T3 = 197.00000000000003, T1 = 1540.0, T2 = 10300.0) ) + +# Reaction 111 +reaction( "CH2O + O2 <=> HCO + HO2", [8.070000E+15, 0.000000E+00, 5.342000E+04]) + +# Reaction 112 +reaction( "CH2O + O <=> HCO + OH", [6.260000E+09, 1.150000E+00, 2.260000E+03]) + +# Reaction 113 +reaction( "CH2O + H <=> H2 + HCO", [5.740000E+07, 1.900000E+00, 2.740000E+03]) + +# Reaction 114 +reaction( "CH2O + OH <=> H2O + HCO", [7.820000E+07, 1.630000E+00, -1.055000E+03]) + +# Reaction 115 +reaction( "CH2O + HO2 <=> H2O2 + HCO", [1.880000E+04, 2.700000E+00, 1.152000E+04]) + +# Reaction 116 +reaction( "CH2O + CH3 <=> CH4 + HCO", [3.830000E+01, 3.360000E+00, 4.312000E+03]) + +# Reaction 117 +reaction( "CH2O + CH3O <=> CH3OH + HCO", [6.620000E+11, 0.000000E+00, 2.294000E+03]) + +# Reaction 118 +three_body_reaction( "HCO + M <=> CO + H + M", [5.700000E+11, 6.600000E-01, 1.487000E+04], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0") + +# Reaction 119 +reaction( "HCO + O2 <=> CO + HO2", [7.580000E+12, 0.000000E+00, 4.100000E+02]) + +# Reaction 120 +reaction( "HCO + O <=> CO + OH", [3.020000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 121 +reaction( "H + HCO <=> CO + H2", [7.340000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 122 +reaction( "HCO + OH <=> CO + H2O", [3.011000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 123 +reaction( "CH3 + HCO <=> CH4 + CO", [2.650000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 124 +reaction( "2 HCO <=> CH2O + CO", [1.800000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 125 +reaction( "HCO + O <=> CO2 + H", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 126 +reaction( "HCO + HO2 => CO2 + H + OH", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 127 +reaction( "2 HCO => 2 CO + H2", [3.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 128 +falloff_reaction( "CH2O + H (+M) <=> CH2OH (+M)", + kf = [5.400000E+11, 4.540000E-01, 3.600000E+03], + kf0 = [1.270000E+32, -4.820000E+00, 6.530000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.7187, T3 = 103.00000000000001, T1 = 1291.0, T2 = 4160.0) ) + +# Reaction 129 +falloff_reaction( "CH3O (+M) <=> CH2O + H (+M)", + kf = [6.800000E+13, 0.000000E+00, 2.617000E+04], + kf0 = [1.870000E+25, -3.000000E+00, 2.430700E+04], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.9, T3 = 2500.0, T1 = 1300.0, T2 = 1e+99) ) + +# Reaction 130 +falloff_reaction( "2 CH3 (+M) <=> C2H6 (+M)", + kf = [2.277000E+15, -6.900000E-01, 1.749000E+02], + kf0 = [8.050000E+31, -3.750000E+00, 9.816000E+02], + efficiencies = "CO:2.0 CO2:3.0 H2O:5.0", + falloff = Troe(A = 0.0, T3 = 570.0, T1 = 1.0000000000000002e+30, T2 = 1e+30) ) + +# Reaction 131 +falloff_reaction( "C2H5 + H (+M) <=> C2H6 (+M)", + kf = [5.210000E+17, -9.900000E-01, 1.580000E+03], + kf0 = [1.990000E+41, -7.080000E+00, 6.685000E+03], + efficiencies = "C2H6:3.0 CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.842, T3 = 125.0, T1 = 2219.0, T2 = 6882.0) ) + +# Reaction 132 +reaction( "C2H6 + O2 <=> C2H5 + HO2", [6.030000E+13, 0.000000E+00, 5.187000E+04]) + +# Reaction 133 +reaction( "C2H6 + O <=> C2H5 + OH", [3.550000E+06, 2.400000E+00, 5.830000E+03]) + +# Reaction 134 +reaction( "C2H6 + H <=> C2H5 + H2", [1.150000E+08, 1.900000E+00, 7.530000E+03]) + +# Reaction 135 +reaction( "C2H6 + OH <=> C2H5 + H2O", [1.480000E+07, 1.900000E+00, 9.500000E+02]) + +# Reaction 136 +reaction( "C2H6 + HO2 <=> C2H5 + H2O2", [3.460000E+01, 3.610000E+00, 1.692000E+04]) + +# Reaction 137 +reaction( "C2H6 + CH <=> C2H5 + CH2", [1.100000E+14, 0.000000E+00, -2.600000E+02]) + +# Reaction 138 +reaction( "C2H6 + CH2(S) <=> C2H5 + CH3", [1.200000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 139 +reaction( "C2H6 + CH3 <=> C2H5 + CH4", [5.550000E-04, 4.720000E+00, 3.231000E+03]) + +# Reaction 140 +reaction( "C2H6 + CH3O <=> C2H5 + CH3OH", [2.410000E+11, 0.000000E+00, 7.090000E+03]) + +# Reaction 141 +falloff_reaction( "C2H4 + H (+M) <=> C2H5 (+M)", + kf = [9.569000E+08, 1.463000E+00, 1.355000E+03], + kf0 = [1.420000E+39, -6.642000E+00, 5.769000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = -0.569, T3 = 299.0, T1 = -9147.0, T2 = 152.4) ) + +# Reaction 142 +reaction( "C2H5 + H <=> C2H4 + H2", [2.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 143 +reaction( "2 C2H4 <=> C2H3 + C2H5", [4.820000E+14, 0.000000E+00, 7.153000E+04]) + +# Reaction 144 +reaction( "C2H5 + CH3 <=> C2H4 + CH4", [1.180000E+04, 2.450000E+00, -2.921000E+03]) + +# Reaction 145 +reaction( "C2H5 + O <=> CH3CHO + H", [1.100000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 146 +pdep_arrhenius( "2 CH3 <=> C2H5 + H", + [1.013250E+03, 4.740000E+12, 1.050000E-01, 1.066430E+04], + [1.013250E+04, 2.570000E+13, -9.600000E-02, 1.140610E+04], + [1.013250E+05, 3.100000E+14, -3.620000E-01, 1.337250E+04], + [1.013250E+06, 2.150000E+10, 8.850000E-01, 1.353250E+04], + [1.013250E+07, 1.032000E+02, 3.230000E+00, 1.123610E+04]) + +# Reaction 147 +pdep_arrhenius( "C2H5 + O2 <=> C2H4 + HO2", + [4.053000E+03, 2.094000E+09, 4.900000E-01, -3.914000E+02], + [1.013250E+05, 1.843000E+07, 1.130000E+00, -7.206000E+02], + [1.013250E+06, 7.561000E+14, -1.010000E+00, 4.749000E+03]) + +# Reaction 148 +pdep_arrhenius( "C2H5 + O2 <=> CH3CHO + OH", + [4.053000E+03, 4.908000E-06, 4.760000E+00, 2.543000E+02], + [1.013250E+05, 6.803000E-02, 3.570000E+00, 2.643000E+03], + [1.013250E+06, 8.265000E+02, 2.410000E+00, 5.285000E+03]) + +# Reaction 149 +falloff_reaction( "C2H3 + H (+M) <=> C2H4 (+M)", + kf = [6.080000E+12, 2.700000E-01, 2.800000E+02], + kf0 = [1.400000E+30, -3.860000E+00, 3.320000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.782, T3 = 207.49999999999997, T1 = 2663.0, T2 = 6095.0) ) + +# Reaction 150 +three_body_reaction( "C2H4 + M <=> C2H2 + H2 + M", [2.610000E+16, 0.000000E+00, 6.782300E+04], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0") + +# Reaction 151 +reaction( "C2H4 + O2 <=> C2H3 + HO2", [4.220000E+13, 0.000000E+00, 5.762310E+04]) + +# Reaction 152 +reaction( "C2H4 + H <=> C2H3 + H2", [5.070000E+07, 1.930000E+00, 1.295000E+04]) + +# Reaction 153 +reaction( "C2H4 + OH <=> C2H3 + H2O", [2.230000E+04, 2.745000E+00, 2.215500E+03]) + +# Reaction 154 +reaction( "C2H4 + CH3O <=> C2H3 + CH3OH", [1.200000E+11, 0.000000E+00, 6.750000E+03]) + +# Reaction 155 +reaction( "C2H4 + CH3 <=> C2H3 + CH4", [9.760000E+02, 2.947000E+00, 1.514800E+04], + options = 'duplicate') + +# Reaction 156 +reaction( "C2H4 + CH3 <=> C2H3 + CH4", [8.130000E-05, 4.417000E+00, 8.835800E+03], + options = 'duplicate') + +# Reaction 157 +reaction( "C2H4 + O <=> CH3 + HCO", [7.453000E+06, 1.880000E+00, 1.830000E+02]) + +# Reaction 158 +reaction( "C2H4 + O <=> CH2CHO + H", [6.098000E+06, 1.880000E+00, 1.830000E+02]) + +# Reaction 159 +reaction( "CH + CH4 <=> C2H4 + H", [6.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 160 +reaction( "CH2(S) + CH3 <=> C2H4 + H", [2.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 161 +pdep_arrhenius( "C2H4 + OH <=> CH2O + CH3", + [1.013250E+03, 5.350000E+00, 2.920000E+00, -1.732700E+03], + [2.533125E+03, 3.190000E+01, 2.710000E+00, -1.172300E+03], + [1.013250E+04, 5.550000E+02, 2.360000E+00, -1.808000E+02], + [1.013250E+05, 1.780000E+05, 1.680000E+00, 2.060500E+03], + [1.013250E+06, 2.370000E+09, 5.600000E-01, 6.006700E+03], + [1.013250E+07, 2.760000E+13, -5.000000E-01, 1.145510E+04]) + +# Reaction 162 +pdep_arrhenius( "C2H4 + OH <=> CH3CHO + H", + [1.013250E+03, 2.370000E-07, 5.300000E+00, -2.050600E+03], + [2.533125E+03, 8.730000E-05, 4.570000E+00, -6.180000E+02], + [1.013250E+04, 4.030000E-01, 3.540000E+00, 1.881700E+03], + [1.013250E+05, 2.380000E-02, 3.910000E+00, 1.722700E+03], + [1.013250E+06, 8.250000E+08, 1.010000E+00, 1.050730E+04], + [1.013250E+07, 6.800000E+09, 8.100000E-01, 1.386730E+04]) + +# Reaction 163 +falloff_reaction( "C2H2 + H (+M) <=> C2H3 (+M)", + kf = [1.710000E+10, 1.266000E+00, 2.709000E+03], + kf0 = [6.350000E+31, -4.664000E+00, 3.780000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.788, T3 = -10200.0, T1 = 1e-30, T2 = 0.0) ) + +# Reaction 164 +pdep_arrhenius( "C2H3 + O2 <=> CH2CHO + O", + [1.013250E+03, 7.880000E+20, -2.670000E+00, 6.742000E+03], + [1.013250E+04, 7.720000E+20, -2.670000E+00, 6.713000E+03], + [3.201870E+04, 9.870000E+20, -2.700000E+00, 6.724000E+03], + [1.013250E+05, 7.100000E+20, -2.650000E+00, 6.489000E+03], + [3.201870E+05, 4.500000E+20, -2.530000E+00, 6.406000E+03], + [1.013250E+06, 1.760000E+23, -3.220000E+00, 8.697000E+03], + [3.201870E+06, 3.140000E+25, -3.770000E+00, 1.153000E+04], + [1.013250E+07, 1.020000E+26, -3.800000E+00, 1.391000E+04], + options='duplicate') + +# Reaction 165 +pdep_arrhenius( "C2H3 + O2 <=> CH2CHO + O", + [1.013250E+03, 1.360000E+10, 6.200000E-01, -2.776000E+02], + [1.013250E+04, 1.420000E+10, 6.200000E-01, -2.477000E+02], + [3.201870E+04, 1.660000E+10, 6.000000E-01, -1.625000E+02], + [1.013250E+05, 2.020000E+10, 5.800000E-01, 3.840000E+01], + [3.201870E+05, 9.750000E+09, 6.700000E-01, 2.480000E+02], + [1.013250E+06, 7.340000E+09, 7.200000E-01, 7.781000E+02], + [3.201870E+06, 1.570000E+09, 9.200000E-01, 1.219000E+03], + [1.013250E+07, 7.850000E+07, 1.280000E+00, 1.401000E+03], + options='duplicate') + +# Reaction 166 +pdep_arrhenius( "C2H3 + O2 <=> C2H2 + HO2", + [1.013250E+03, 1.080000E+07, 1.280000E+00, 3.322000E+03], + [1.013250E+04, 7.750000E+06, 1.330000E+00, 3.216000E+03], + [3.201870E+04, 1.210000E+07, 1.270000E+00, 3.311000E+03], + [1.013250E+05, 2.150000E+07, 1.190000E+00, 3.367000E+03], + [3.201870E+05, 1.130000E+08, 1.000000E+00, 3.695000E+03], + [1.013250E+06, 1.310000E+11, 1.200000E-01, 5.872000E+03], + [3.201870E+06, 1.190000E+09, 8.200000E-01, 5.617000E+03], + [1.013250E+07, 1.060000E+17, -1.450000E+00, 1.223000E+04], + options='duplicate') + +# Reaction 167 +pdep_arrhenius( "C2H3 + O2 <=> C2H2 + HO2", + [1.013250E+03, 4.760000E+01, 2.750000E+00, -7.964000E+02], + [1.013250E+04, 5.160000E+01, 2.730000E+00, -7.683000E+02], + [3.201870E+04, 5.550000E+01, 2.730000E+00, -6.585000E+02], + [1.013250E+05, 4.600000E+01, 2.760000E+00, -4.928000E+02], + [3.201870E+05, 3.750000E+00, 3.070000E+00, -6.010000E+02], + [1.013250E+06, 5.480000E+00, 3.070000E+00, 8.570000E+01], + [3.201870E+06, 4.470000E+08, 0.000000E+00, 9.550000E+02], + [1.013250E+07, 2.020000E+01, 2.940000E+00, 1.847000E+03], + options='duplicate') + +# Reaction 168 +pdep_arrhenius( "C2H3 + O2 <=> CH2CO + OH", + [1.013250E+03, 8.660000E+02, 2.410000E+00, 6.061000E+03], + [1.013250E+04, 8.910000E+02, 2.410000E+00, 6.078000E+03], + [3.201870E+04, 9.430000E+02, 2.400000E+00, 6.112000E+03], + [1.013250E+05, 1.060000E+03, 2.390000E+00, 6.180000E+03], + [3.201870E+05, 1.090000E+03, 2.380000E+00, 6.179000E+03], + [1.013250E+06, 1.390000E+03, 2.360000E+00, 6.074000E+03], + [3.201870E+06, 2.490000E+06, 1.420000E+00, 8.480000E+03], + [1.013250E+07, 1.660000E+10, 3.600000E-01, 1.201000E+04], + options='duplicate') + +# Reaction 169 +pdep_arrhenius( "C2H3 + O2 <=> CH2CO + OH", + [1.013250E+03, 1.820000E-01, 3.120000E+00, 1.331000E+03], + [1.013250E+04, 2.070000E-01, 3.110000E+00, 1.383000E+03], + [3.201870E+04, 2.710000E-01, 3.080000E+00, 1.496000E+03], + [1.013250E+05, 5.260000E-01, 3.010000E+00, 1.777000E+03], + [3.201870E+05, 1.370000E+00, 2.900000E+00, 2.225000E+03], + [1.013250E+06, 4.190000E-01, 2.930000E+00, 2.052000E+03], + [3.201870E+06, 1.190000E-04, 4.210000E+00, 2.043000E+03], + [1.013250E+07, 1.300000E-03, 3.970000E+00, 3.414000E+03], + options='duplicate') + +# Reaction 170 +pdep_arrhenius( "C2H3 + O2 <=> CH2O + HCO", + [1.013250E+03, 2.490000E+36, -7.600000E+00, 1.264000E+04], + [1.013250E+04, 2.430000E+36, -7.600000E+00, 1.261000E+04], + [3.201870E+04, 1.950000E+36, -7.570000E+00, 1.249000E+04], + [1.013250E+05, 2.730000E+35, -7.320000E+00, 1.182000E+04], + [3.201870E+05, 1.430000E+36, -7.470000E+00, 1.246000E+04], + [1.013250E+06, 5.180000E+35, -7.200000E+00, 1.343000E+04], + [3.201870E+06, 3.190000E+20, -2.570000E+00, 5.578000E+03], + [1.013250E+07, 2.730000E+33, -6.280000E+00, 1.600000E+04], + options='duplicate') + +# Reaction 171 +pdep_arrhenius( "C2H3 + O2 <=> CH2O + HCO", + [1.013250E+03, 4.540000E+15, -1.280000E+00, 5.153000E+02], + [1.013250E+04, 4.590000E+15, -1.280000E+00, 5.130000E+02], + [3.201870E+04, 4.810000E+15, -1.290000E+00, 5.206000E+02], + [1.013250E+05, 6.080000E+15, -1.310000E+00, 6.457000E+02], + [3.201870E+05, 9.450000E+15, -1.360000E+00, 1.066000E+03], + [1.013250E+06, 2.560000E+15, -1.180000E+00, 1.429000E+03], + [3.201870E+06, 1.030000E+69, -1.923000E+01, 1.476000E+04], + [1.013250E+07, 4.210000E+10, 1.900000E-01, 8.306000E+02], + options='duplicate') + +# Reaction 172 +pdep_arrhenius( "C2H3 + O2 => CH2O + CO + H", + [1.013250E+03, 5.820000E+36, -7.600000E+00, 1.264000E+04], + [1.013250E+04, 5.660000E+36, -7.600000E+00, 1.261000E+04], + [3.201870E+04, 4.550000E+36, -7.570000E+00, 1.249000E+04], + [1.013250E+05, 6.360000E+35, -7.320000E+00, 1.182000E+04], + [3.201870E+05, 3.350000E+36, -7.470000E+00, 1.246000E+04], + [1.013250E+06, 1.210000E+36, -7.200000E+00, 1.343000E+04], + [3.201870E+06, 7.430000E+20, -2.570000E+00, 5.578000E+03], + [1.013250E+07, 6.360000E+33, -6.280000E+00, 1.600000E+04], + options='duplicate') + +# Reaction 173 +pdep_arrhenius( "C2H3 + O2 => CH2O + CO + H", + [1.013250E+03, 1.060000E+16, -1.280000E+00, 5.153000E+02], + [1.013250E+04, 1.070000E+16, -1.280000E+00, 5.130000E+02], + [3.201870E+04, 1.130000E+16, -1.290000E+00, 5.206000E+02], + [1.013250E+05, 1.420000E+16, -1.310000E+00, 6.457000E+02], + [3.201870E+05, 2.200000E+16, -1.360000E+00, 1.066000E+03], + [1.013250E+06, 5.980000E+15, -1.180000E+00, 1.429000E+03], + [3.201870E+06, 2.390000E+69, -1.923000E+01, 1.476000E+04], + [1.013250E+07, 9.810000E+10, 1.900000E-01, 8.306000E+02], + options='duplicate') + +# Reaction 174 +pdep_arrhenius( "C2H3 + O2 <=> CH3O + CO", + [1.013250E+03, 8.190000E+18, -2.660000E+00, 3.201000E+03], + [1.013250E+04, 4.060000E+14, -1.320000E+00, 8.858000E+02], + [3.201870E+04, 4.340000E+14, -1.330000E+00, 9.006000E+02], + [1.013250E+05, 1.030000E+11, -3.300000E-01, -7.478000E+02], + [3.201870E+05, 1.890000E+12, -3.000000E+00, -8.995000E+03], + [1.013250E+06, 1.930000E+24, -5.630000E+00, 1.800000E+00], + [3.201870E+06, 1.100000E+18, -2.220000E+00, 5.178000E+03], + [1.013250E+07, 5.790000E+32, -6.450000E+00, 1.681000E+04], + options='duplicate') + +# Reaction 175 +pdep_arrhenius( "C2H3 + O2 <=> CH3O + CO", + [1.013250E+03, 1.290000E+09, 1.800000E-01, -1.717000E+03], + [1.013250E+04, 5.990000E+11, -2.930000E+00, -9.564000E+03], + [3.201870E+04, 2.910000E+11, -2.930000E+00, -1.012000E+04], + [1.013250E+05, 5.770000E+21, -3.540000E+00, 4.772000E+03], + [3.201870E+05, 4.990000E+15, -1.620000E+00, 1.849000E+03], + [1.013250E+06, 9.330000E+16, -1.960000E+00, 3.324000E+03], + [3.201870E+06, 1.020000E+72, -2.069000E+01, 1.586000E+04], + [1.013250E+07, 1.100000E+09, 3.100000E-01, 1.024000E+03], + options='duplicate') + +# Reaction 176 +pdep_arrhenius( "C2H3 + O2 <=> CH3 + CO2", + [1.013250E+03, 2.370000E+35, -7.760000E+00, 1.263000E+04], + [1.013250E+04, 1.730000E+35, -7.720000E+00, 1.252000E+04], + [3.201870E+04, 4.470000E+34, -7.550000E+00, 1.214000E+04], + [1.013250E+05, 7.250000E+31, -6.700000E+00, 1.044000E+04], + [3.201870E+05, 3.630000E+35, -7.750000E+00, 1.283000E+04], + [1.013250E+06, 2.090000E+35, -7.530000E+00, 1.405000E+04], + [3.201870E+06, 3.840000E+18, -2.440000E+00, 5.408000E+03], + [1.013250E+07, 1.210000E+32, -6.320000E+00, 1.619000E+04], + options='duplicate') + +# Reaction 177 +pdep_arrhenius( "C2H3 + O2 <=> CH3 + CO2", + [1.013250E+03, 6.270000E+13, -1.160000E+00, 4.063000E+02], + [1.013250E+04, 6.240000E+13, -1.160000E+00, 4.014000E+02], + [3.201870E+04, 6.120000E+13, -1.160000E+00, 3.970000E+02], + [1.013250E+05, 5.320000E+13, -1.140000E+00, 4.467000E+02], + [3.201870E+05, 1.450000E+14, -1.260000E+00, 9.877000E+02], + [1.013250E+06, 5.020000E+13, -1.110000E+00, 1.409000E+03], + [3.201870E+06, 1.400000E+70, -2.011000E+01, 1.543000E+04], + [1.013250E+07, 9.210000E+08, 2.500000E-01, 8.553000E+02], + options='duplicate') + +# Reaction 178 +reaction( "C2H3 + H <=> C2H2 + H2", [9.635300E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 179 +reaction( "C2H3 + OH <=> C2H2 + H2O", [3.011000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 180 +reaction( "C2H3 + CH3 <=> C2H2 + CH4", [3.920000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 181 +reaction( "2 C2H3 <=> C2H2 + C2H4", [9.600000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 182 +falloff_reaction( "C2H + H (+M) <=> C2H2 (+M)", + kf = [1.000000E+17, -1.000000E+00, 0.000000E+00], + kf0 = [3.750000E+33, -4.800000E+00, 1.900000E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.646, T3 = 132.0, T1 = 1315.0, T2 = 5566.0) ) + +# Reaction 183 +reaction( "C2H2 + O <=> CH2 + CO", [7.395000E+08, 1.280000E+00, 2.472000E+03]) + +# Reaction 184 +reaction( "C2H2 + O <=> H + HCCO", [2.958000E+09, 1.280000E+00, 2.472000E+03]) + +# Reaction 185 +reaction( "C2H2 + HO2 <=> CH2CO + OH", [6.030000E+09, 0.000000E+00, 7.949000E+03]) + +# Reaction 186 +reaction( "C2H2 + HCO <=> C2H3 + CO", [1.000000E+07, 2.000000E+00, 6.000000E+03]) + +# Reaction 187 +reaction( "C2H2 + OH <=> C2H + H2O", [2.632000E+06, 2.140000E+00, 1.706000E+04]) + +# Reaction 188 +pdep_arrhenius( "C2H2 + OH <=> CH2CO + H", + [1.013250E+03, 1.578000E+03, 2.560000E+00, -8.445000E+02], + [2.533125E+03, 1.518000E+04, 2.280000E+00, -2.921000E+02], + [1.013250E+04, 3.017000E+05, 1.920000E+00, 5.981000E+02], + [1.013250E+05, 7.528000E+06, 1.550000E+00, 2.106000E+03], + [1.013250E+06, 5.101000E+06, 1.650000E+00, 3.400000E+03], + [1.013250E+07, 1.457000E+04, 2.450000E+00, 4.477000E+03]) + +# Reaction 189 +pdep_arrhenius( "C2H2 + OH <=> CH3 + CO", + [1.013250E+03, 4.757000E+05, 1.680000E+00, -3.298000E+02], + [2.533125E+03, 4.372000E+06, 1.400000E+00, 2.265000E+02], + [1.013250E+04, 7.648000E+07, 1.050000E+00, 1.115000E+03], + [1.013250E+05, 1.277000E+09, 7.300000E-01, 2.579000E+03], + [1.013250E+06, 4.312000E+08, 9.200000E-01, 3.736000E+03], + [1.013250E+07, 8.250000E+05, 1.770000E+00, 4.697000E+03]) + +# Reaction 190 +reaction( "C2H + O2 <=> CO + HCO", [5.000000E+13, 0.000000E+00, 1.500000E+03]) + +# Reaction 191 +reaction( "C2H + O <=> CH + CO", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 192 +reaction( "C2H + H2 <=> C2H2 + H", [4.900000E+05, 2.500000E+00, 5.600000E+02]) + +# Reaction 193 +reaction( "C2H + OH <=> H + HCCO", [2.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 194 +falloff_reaction( "CH3CHO (+M) <=> CH3 + HCO (+M)", + kf = [2.450000E+22, -1.740000E+00, 8.635500E+04], + kf0 = [1.030000E+59, -1.130000E+01, 9.591250E+04], + falloff = Troe(A = 0.00249, T3 = 718.1, T1 = 6.089, T2 = 3780.0) ) + +# Reaction 195 +falloff_reaction( "CH3CHO (+M) <=> CH4 + CO (+M)", + kf = [2.720000E+21, -1.740000E+00, 8.635500E+04], + kf0 = [1.140000E+58, -1.130000E+01, 9.591250E+04], + falloff = Troe(A = 0.00249, T3 = 718.1, T1 = 6.089, T2 = 3780.0) ) + +# Reaction 196 +reaction( "CH3CHO + O2 <=> CH3CO + HO2", [3.010000E+13, 0.000000E+00, 3.915000E+04]) + +# Reaction 197 +reaction( "CH3CHO + O <=> CH3CO + OH", [5.940000E+12, 0.000000E+00, 1.868000E+03]) + +# Reaction 198 +reaction( "CH3CHO + OH <=> CH3CO + H2O", [3.370000E+12, 0.000000E+00, -6.190000E+02]) + +# Reaction 199 +reaction( "CH3CHO + HO2 <=> CH3CO + H2O2", [1.000000E+12, 0.000000E+00, 1.192000E+04]) + +# Reaction 200 +reaction( "CH3CHO + H <=> CH2CHO + H2", [2.720000E+03, 3.100000E+00, 5.210000E+03]) + +# Reaction 201 +reaction( "CH3CHO + OH <=> CH2CHO + H2O", [1.720000E+05, 2.400000E+00, 8.150000E+02]) + +# Reaction 202 +pdep_arrhenius( "CH3CO <=> CH3 + CO", + [1.013250E+04, 1.960000E+16, -2.090000E+00, 1.519660E+04], + [1.013250E+05, 6.450000E+18, -2.520000E+00, 1.643650E+04], + [1.013250E+06, 8.180000E+19, -2.550000E+00, 1.726310E+04], + [1.013250E+07, 1.260000E+20, -2.320000E+00, 1.801210E+04]) + +# Reaction 203 +pdep_arrhenius( "CH3CO + O2 <=> CH2CO + HO2", + [1.013250E+04, 1.300000E+08, 1.986000E+00, 2.280000E+02], + [1.013250E+05, 3.600000E+10, 5.440000E-01, 3.721000E+03], + [1.013250E+06, 7.700000E+13, -3.350000E-01, 7.510000E+03]) + +# Reaction 204 +falloff_reaction( "CH3CO (+M) <=> CH2CO + H (+M)", + kf = [9.413000E+07, 1.917000E+00, 4.498720E+04], + kf0 = [1.520000E+51, -1.027000E+01, 5.539000E+04], + falloff = Troe(A = 0.6009, T3 = 8103000000.0, T1 = 667.7, T2 = 5000000000.0) ) + +# Reaction 205 +reaction( "CH3CO + H <=> CH2CO + H2", [2.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 206 +reaction( "CH3CO + O <=> CH2CO + OH", [2.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 207 +reaction( "CH3 + CH3CO <=> CH2CO + CH4", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 208 +falloff_reaction( "CH2CHO (+M) <=> CH2CO + H (+M)", + kf = [1.430000E+15, -1.500000E-01, 4.560000E+04], + kf0 = [6.000000E+29, -3.800000E+00, 4.342390E+04], + falloff = Troe(A = 0.985, T3 = 392.99999999999994, T1 = 9800000000.0, T2 = 5000000000.0) ) + +# Reaction 209 +falloff_reaction( "CH2CHO (+M) <=> CH3 + CO (+M)", + kf = [2.930000E+12, 2.900000E-01, 4.030000E+04], + kf0 = [9.520000E+33, -5.070000E+00, 4.130000E+04], + falloff = Troe(A = 7.13e-17, T3 = 1150.0, T1 = 4990000000.0, T2 = 1790000000.0) ) + +# Reaction 210 +falloff_reaction( "CH2CO (+M) <=> CH2 + CO (+M)", + kf = [3.000000E+13, 0.000000E+00, 7.100000E+04], + kf0 = [3.000000E+15, 0.000000E+00, 5.700000E+04], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0") + +# Reaction 211 +reaction( "C2H3 + O <=> CH2CO + H", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 212 +reaction( "CH2CO + H <=> CH3 + CO", [7.770000E+08, 1.450000E+00, 2.780000E+03]) + +# Reaction 213 +pdep_arrhenius( "CH3 + HCO <=> CH2CO + H2", + [5.066250E+03, 6.100000E+06, 1.240000E+00, -1.733000E+03], + [1.013250E+04, 1.100000E+07, 1.180000E+00, -1.303000E+03], + [1.013250E+05, 4.900000E+08, 7.500000E-01, 8.420000E+02], + [1.013250E+06, 1.600000E+11, 1.090000E-01, 4.387000E+03]) + +# Reaction 214 +reaction( "CH + CH2O <=> CH2CO + H", [9.460000E+13, 0.000000E+00, -5.150000E+02]) + +# Reaction 215 +reaction( "CH2CO + O <=> CH2 + CO2", [1.750000E+12, 0.000000E+00, 1.350000E+03]) + +# Reaction 216 +reaction( "CH2CO + OH <=> CH2OH + CO", [2.000000E+12, 0.000000E+00, -1.010000E+03]) + +# Reaction 217 +reaction( "CH2(S) + CH2CO <=> C2H4 + CO", [2.000000E+13, 0.000000E+00, -5.260000E+02]) + +# Reaction 218 +reaction( "CH2CO + CH3 <=> C2H5 + CO", [4.769000E+04, 2.312000E+00, 9.468000E+03]) + +# Reaction 219 +reaction( "HCCO + OH => 2 CO + H2", [1.000000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 220 +reaction( "HCCO + O => 2 CO + H", [8.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 221 +three_body_reaction( "CH + CO + M <=> HCCO + M", [7.570000E+22, -1.900000E+00, 0.000000E+00]) + +# Reaction 222 +reaction( "H + HCCO <=> CH2(S) + CO", [1.000000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 223 +reaction( "HCCO + O2 => 2 CO + OH", [1.910000E+11, -2.000000E-02, 1.020000E+03]) + +# Reaction 224 +reaction( "HCCO + O2 => CO + CO2 + H", [4.780000E+12, -1.420000E-01, 1.150000E+03]) + +# Reaction 225 +reaction( "CH + HCCO <=> C2H2 + CO", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 226 +falloff_reaction( "C2H3 + CH3 (+M) <=> C3H6 (+M)", + kf = [2.500000E+13, 0.000000E+00, 0.000000E+00], + kf0 = [4.270000E+58, -1.194000E+01, 9.769800E+03], + falloff = Troe(A = 0.175, T3 = 1341.0, T1 = 60000.0, T2 = 10140.0) ) + +# Reaction 227 +pdep_arrhenius( "C2H4 + CH2(S) <=> C3H6", + [1.013250E+03, 4.820000E+57, -1.430000E+01, 1.710000E+04], + [1.013250E+04, 3.840000E+59, -1.440000E+01, 1.840000E+04], + [1.013250E+05, 2.130000E+58, -1.350000E+01, 2.040000E+04], + [1.013250E+06, 8.480000E+52, -1.160000E+01, 2.070000E+04], + [1.013250E+07, 6.070000E+47, -9.850000E+00, 2.210000E+04], + options='duplicate') + +# Reaction 228 +pdep_arrhenius( "C2H4 + CH2(S) <=> C3H6", + [1.013250E+03, 1.150000E+45, -1.110000E+01, 6.145200E+03], + [1.013250E+04, 1.830000E+45, -1.070000E+01, 6.638500E+03], + [1.013250E+05, 1.300000E+40, -8.770000E+00, 5.863800E+03], + [1.013250E+06, 2.270000E+32, -6.140000E+00, 4.317900E+03], + [1.013250E+07, 1.280000E+24, -3.490000E+00, 2.529900E+03], + options='duplicate') + +# Reaction 229 +pdep_arrhenius( "C2H4 + CH2(S) <=> C3H5-A + H", + [1.013250E+03, 8.200000E+19, -2.060000E+00, 1.150000E+03], + [1.013250E+04, 2.270000E+21, -2.440000E+00, 2.650000E+03], + [1.013250E+05, 4.440000E+35, -6.550000E+00, 1.390000E+04], + [1.013250E+06, 1.180000E+28, -4.090000E+00, 1.400000E+04], + [1.013250E+07, 6.510000E+26, -3.580000E+00, 1.890000E+04], + options='duplicate') + +# Reaction 230 +pdep_arrhenius( "C2H4 + CH2(S) <=> C3H5-A + H", + [1.013250E+03, 1.080000E+07, 1.620000E+00, -3.174600E+03], + [1.013250E+04, 1.370000E+05, 2.150000E+00, -3.799200E+03], + [1.013250E+05, 3.890000E+14, -4.200000E-01, 1.237600E+03], + [1.013250E+06, 2.450000E+10, 6.700000E-01, 7.509300E+02], + [1.013250E+07, 1.810000E+02, 2.970000E+00, -7.460300E+02], + options='duplicate') + +# Reaction 231 +pdep_arrhenius( "C2H4 + CH2(S) <=> C2H3 + CH3", + [1.013250E+03, 1.770000E+19, -1.940000E+00, 6.790000E+03], + [1.013250E+04, 1.680000E+19, -1.800000E+00, 4.310000E+03], + [1.013250E+05, 4.160000E+24, -3.190000E+00, 9.760000E+03], + [1.013250E+06, 7.890000E+24, -3.070000E+00, 1.390000E+04], + [1.013250E+07, 7.360000E+29, -4.280000E+00, 2.380000E+04], + options='duplicate') + +# Reaction 232 +pdep_arrhenius( "C2H4 + CH2(S) <=> C2H3 + CH3", + [1.013250E+03, 4.300000E+12, 1.900000E-01, -1.104100E+02], + [1.013250E+04, 2.260000E+11, 5.400000E-01, 4.781000E+01], + [1.013250E+05, 4.920000E+09, 1.020000E+00, 5.997700E+02], + [1.013250E+06, 1.470000E+08, 1.330000E+00, 1.228400E+03], + [1.013250E+07, 8.110000E+10, 5.500000E-01, 5.506500E+03], + options='duplicate') + +# Reaction 233 +pdep_arrhenius( "C2H3 + CH3 <=> C3H5-A + H", + [1.013250E+03, 4.120000E+29, -4.950000E+00, 8.000000E+03], + [1.013250E+04, 4.860000E+30, -5.030000E+00, 1.130000E+04], + [1.013250E+05, 5.300000E+29, -4.570000E+00, 1.440000E+04], + [1.013250E+06, 1.320000E+30, -4.540000E+00, 1.930000E+04], + [1.013250E+07, 5.160000E+28, -4.030000E+00, 2.380000E+04], + options='duplicate') + +# Reaction 234 +pdep_arrhenius( "C2H3 + CH3 <=> C3H5-A + H", + [1.013250E+03, 5.730000E+15, -7.700000E-01, 1.195900E+03], + [1.013250E+04, 2.060000E+13, -7.400000E-02, 1.428700E+03], + [1.013250E+05, 4.480000E+10, 6.000000E-01, 1.421600E+03], + [1.013250E+06, 4.100000E+06, 1.710000E+00, 1.056900E+03], + [1.013250E+07, 1.370000E-01, 3.910000E+00, -3.535500E+02], + options='duplicate') + +# Reaction 235 +pdep_arrhenius( "C3H6 <=> C2H3 + CH3", + [1.013250E+03, 1.880000E+78, -1.870000E+01, 1.300000E+05], + [1.013250E+04, 8.730000E+76, -1.790000E+01, 1.320000E+05], + [1.013250E+05, 5.800000E+75, -1.720000E+01, 1.340000E+05], + [1.013250E+06, 8.120000E+71, -1.580000E+01, 1.360000E+05], + [1.013250E+07, 2.150000E+64, -1.340000E+01, 1.350000E+05], + options='duplicate') + +# Reaction 236 +pdep_arrhenius( "C3H6 <=> C2H3 + CH3", + [1.013250E+03, 1.690000E+59, -1.360000E+01, 1.132900E+05], + [1.013250E+04, 2.000000E+60, -1.370000E+01, 1.148900E+05], + [1.013250E+05, 6.700000E+54, -1.180000E+01, 1.138400E+05], + [1.013250E+06, 1.060000E+47, -9.270000E+00, 1.115100E+05], + [1.013250E+07, 7.290000E+38, -6.700000E+00, 1.087400E+05], + options='duplicate') + +# Reaction 237 +pdep_arrhenius( "C3H6 <=> C3H5-A + H", + [1.013250E+03, 9.160000E+74, -1.760000E+01, 1.200000E+05], + [1.013250E+04, 1.730000E+70, -1.600000E+01, 1.200000E+05], + [1.013250E+05, 1.080000E+71, -1.590000E+01, 1.248600E+05], + [1.013250E+06, 6.400000E+65, -1.420000E+01, 1.250000E+05], + [1.013250E+07, 8.050000E+56, -1.150000E+01, 1.220000E+05], + options='duplicate') + +# Reaction 238 +pdep_arrhenius( "C3H6 <=> C3H5-A + H", + [1.013250E+03, 2.980000E+54, -1.230000E+01, 1.012000E+05], + [1.013250E+04, 1.370000E+43, -8.870000E+00, 9.636500E+04], + [1.013250E+05, 6.280000E+42, -8.510000E+00, 9.800400E+04], + [1.013250E+06, 4.730000E+35, -6.260000E+00, 9.564400E+04], + [1.013250E+07, 4.340000E+28, -4.060000E+00, 9.311400E+04], + options='duplicate') + +# Reaction 239 +reaction( "C3H6 + H <=> C3H5-A + H2", [3.644000E+05, 2.455000E+00, 4.361200E+03]) + +# Reaction 240 +reaction( "C3H6 + O2 <=> C3H5-A + HO2", [1.200000E+20, -1.670000E+00, 4.619210E+04]) + +# Reaction 241 +reaction( "C3H6 + O <=> C3H5-A + OH", [5.240000E+11, 7.000000E-01, 5.884000E+03]) + +# Reaction 242 +reaction( "C3H6 + OH <=> C3H5-A + H2O", [4.460000E+06, 2.072000E+00, 1.050800E+03]) + +# Reaction 243 +reaction( "C3H6 + HO2 <=> C3H5-A + H2O2", [3.070000E-02, 4.403000E+00, 1.354720E+04]) + +# Reaction 244 +reaction( "C3H6 + CH3 <=> C3H5-A + CH4", [2.210000E+00, 3.500000E+00, 5.675000E+03]) + +# Reaction 245 +reaction( "C3H6 + CH3O <=> C3H5-A + CH3OH", [8.400000E+10, 0.000000E+00, 2.600000E+03]) + +# Reaction 246 +reaction( "C2H5 + C3H6 <=> C2H6 + C3H5-A", [1.000000E+11, 0.000000E+00, 9.800000E+03]) + +# Reaction 247 +reaction( "C3H6 + O <=> C2H5 + HCO", [7.450000E+06, 1.880000E+00, 1.830000E+02]) + +# Reaction 248 +reaction( "C3H6 + O => CH2CO + CH3 + H", [3.050000E+06, 1.880000E+00, 1.830000E+02]) + +# Reaction 249 +pdep_arrhenius( "C3H6 + H <=> C2H4 + CH3", + [1.317225E+02, 1.540000E+09, 1.350000E+00, 2.542000E+03], + [4.053000E+03, 7.880000E+10, 8.700000E-01, 3.599600E+03], + [1.013250E+05, 2.670000E+12, 4.700000E-01, 5.431100E+03], + [1.013250E+06, 9.250000E+22, -2.600000E+00, 1.289800E+04], + [1.013250E+07, 1.320000E+23, -2.420000E+00, 1.650000E+04], + options='duplicate') + +# Reaction 250 +pdep_arrhenius( "C3H6 + H <=> C2H4 + CH3", + [1.317225E+02, 1.000000E-10, 0.000000E+00, 0.000000E+00], + [4.053000E+03, 1.000000E-10, 0.000000E+00, 0.000000E+00], + [1.013250E+05, 1.000000E-10, 0.000000E+00, 0.000000E+00], + [1.013250E+06, 1.240000E+05, 2.520000E+00, 3.679100E+03], + [1.013250E+07, 2.510000E+03, 2.910000E+00, 3.980900E+03], + options='duplicate') + +# Reaction 251 +reaction( "C2H5 + C3H5-A <=> C2H4 + C3H6", [4.000000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 252 +reaction( "C3H5-A + HCO <=> C3H6 + CO", [6.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 253 +pdep_arrhenius( "C3H5-A + O2 <=> CH2O + CH3CO", + [1.013250E+05, 1.190000E+15, -1.010000E+00, 2.012800E+04], + [1.013250E+06, 7.140000E+15, -1.210000E+00, 2.104600E+04]) + +# Reaction 254 +pdep_arrhenius( "C2H3 + CH2O <=> C2H4 + HCO", + [1.013250E+02, 1.110000E+07, 1.090000E+00, 1.807200E+03], + [1.013250E+03, 2.470000E+07, 9.930000E-01, 1.994900E+03], + [1.013250E+04, 2.470000E+08, 7.040000E-01, 2.596200E+03], + [1.013250E+05, 1.420000E+10, 2.090000E-01, 3.934200E+03], + [1.013250E+06, 3.450000E+13, -7.260000E-01, 6.944300E+03], + [1.013250E+07, 3.310000E+14, -8.660000E-01, 1.096570E+04], + [1.013250E+08, 1.650000E+01, 3.170000E+00, 9.399800E+03]) + +# Reaction 255 +pdep_arrhenius( "C3H6 + OH <=> CH3 + CH3CHO", + [1.317225E+02, 6.930000E+05, 1.490000E+00, -5.360000E+02], + [1.013250E+03, 5.940000E+03, 2.010000E+00, -5.600000E+02], + [1.317225E+03, 1.100000E+03, 2.220000E+00, -6.800000E+02], + [2.533125E+03, 1.070000E+02, 2.500000E+00, -7.590000E+02], + [1.013250E+04, 7.830000E-01, 3.100000E+00, -9.190000E+02], + [1.332424E+04, 3.070000E-01, 3.220000E+00, -9.460000E+02], + [1.013250E+05, 3.160000E-04, 4.050000E+00, -1.144000E+03], + [1.013250E+06, 7.590000E-06, 4.490000E+00, -6.800000E+02], + [1.013250E+07, 5.450000E-05, 4.220000E+00, 1.141000E+03]) + +# Reaction 256 +pdep_arrhenius( "C2H2 + CH3 <=> C3H5-A", + [1.013250E+04, 8.200000E+53, -1.332000E+01, 3.320000E+04], + [1.013250E+05, 2.680000E+53, -1.282000E+01, 3.573000E+04], + [2.026500E+05, 3.640000E+52, -1.246000E+01, 3.612700E+04], + [5.066250E+05, 1.040000E+51, -1.189000E+01, 3.647600E+04], + [1.013250E+06, 4.400000E+49, -1.140000E+01, 3.670000E+04], + [1.013250E+07, 3.800000E+44, -9.630000E+00, 3.760000E+04]) + +# Reaction 257 +reaction( "CH3CHO <=> CH2CO + H2", [4.000000E+13, 0.000000E+00, 8.050000E+04]) + +# Reaction 258 +reaction( "C2H2 + O => CH2CO", [1.000000E+13, 0.000000E+00, 1.500000E+04]) + +# Reaction 259 +reaction( "CH2CO + O => 2 HCO", [2.000000E+13, 0.000000E+00, 2.300000E+03]) + +# Reaction 260 +reaction( "CH2CO + O => CH2O + CO", [1.000000E+12, 0.000000E+00, 5.000000E+03]) + +# Reaction 261 +reaction( "CH2CO + OH => CH3 + CO2", [1.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 262 +reaction( "CH2CO + O2 => CH2O + CO2", [1.000000E+14, 0.000000E+00, 3.700000E+04]) + +# Reaction 263 +reaction( "CH2CO + O2 => CO + HCO + OH", [3.000000E+14, 0.000000E+00, 4.000000E+04]) + +# Reaction 264 +reaction( "CH3CO + OH => CH2CO + H2O", [3.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 265 +reaction( "CH2CHO + OH => CH2CO + H2O", [5.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 266 +reaction( "CH2CO + HO2 => CH2O + CO + OH", [1.000000E+10, 0.000000E+00, 5.000000E+03]) + +# Reaction 267 +reaction( "CH2CHO + O2 => CH2CO + HO2", [5.000000E+11, 0.000000E+00, 3.000000E+03]) + +# Reaction 268 +reaction( "2 CH2CO <=> CH3CO + HCCO", [1.500000E+13, 0.000000E+00, 6.050000E+04]) + +# Reaction 269 +reaction( "2 CH2CO => C2H4 + 2 CO", [7.500000E+10, 0.000000E+00, 4.000000E+04]) + +# Reaction 270 +reaction( "CH2CO => H + HCCO", [1.500000E+14, 0.000000E+00, 1.024000E+05]) + +# Reaction 271 +reaction( "CH2 + CH2CO <=> C2H4 + CO", [5.000000E+03, 2.800000E+00, 6.210000E+03]) + +# Reaction 272 +reaction( "CH2 + CH2CO <=> CH3 + HCCO", [3.600000E+13, 0.000000E+00, 1.100000E+04]) + +# Reaction 273 +reaction( "HCCO + OH <=> CO + H + HCO", [1.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 274 +reaction( "HCCO + O2 <=> CO2 + HCO", [2.400000E+11, 0.000000E+00, -8.540000E+02]) + +# Reaction 275 +reaction( "CH2 + HCCO <=> C2H3 + CO", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 276 +reaction( "2 HCCO => C2H2 + 2 CO", [1.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 277 +reaction( "C2H2 + O2 <=> HCCO + OH", [2.000000E+07, 1.500000E+00, 3.000000E+04]) + +# Reaction 278 +reaction( "C2H + O2 <=> HCCO + O", [2.300000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 279 +three_body_reaction( "O + OH + M <=> HO2 + M", [1.000000E+16, 0.000000E+00, 0.000000E+00]) + +# Reaction 280 +reaction( "C2H + O2 <=> CH + CO2", [4.500000E+15, 0.000000E+00, 2.500000E+04]) + +# Reaction 281 +reaction( "CH + OH <=> C + H2O", [4.000000E+07, 2.000000E+00, 3.000000E+03]) + +# Reaction 282 +reaction( "C2H5 + O2 => CH2O + CH3O", [1.000000E+14, 0.000000E+00, 2.400000E+04]) + +# Reaction 283 +reaction( "C2H5 + O2 => CH2O + CH3 + O", [1.000000E+13, 0.000000E+00, 2.700000E+04]) + +# Reaction 284 +reaction( "C2H5 + O => 0.3 C2H4 + 0.35 CH2O + 0.35 CH3 + 0.35 CH3CHO + 0.35 H + 0.3 OH", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 285 +reaction( "C2H5 + HO2 => CH2O + CH3 + OH", [5.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 286 +reaction( "C2H4 + O => CH3CHO", [1.000000E+09, 0.000000E+00, 5.000000E+03]) + +# Reaction 287 +reaction( "CH3O2 <=> CH2O + OH", [1.500000E+13, 0.000000E+00, 4.700000E+04]) + +# Reaction 288 +reaction( "CH3O2 + OH => CH3O + HO2", [3.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 289 +reaction( "CH3O2 + HO2 => CH2O + H2O + O2", [5.000000E+10, 0.000000E+00, 0.000000E+00]) + +# Reaction 290 +reaction( "C3H5-A + CH3O2 => C2H3 + CH2O + CH3O", [7.500000E+10, 0.000000E+00, 0.000000E+00]) + +# Reaction 291 +reaction( "CH2O + CH3O2 => CH2O + CO + H2 + OH", [2.000000E+11, 0.000000E+00, 1.100000E+04]) + +# Reaction 292 +reaction( "CH3O2 + CO => CH3O + CO2", [1.000000E+14, 0.000000E+00, 2.400000E+04]) + +# Reaction 293 +reaction( "CH2O + CH3 <=> CH3CHO + H", [2.000000E+11, 0.000000E+00, 7.600000E+03]) + +# Reaction 294 +reaction( "CH2 + HCO <=> CH3 + CO", [2.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 295 +reaction( "CH2 + O <=> CO + H2", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 296 +reaction( "CH2 + OH <=> CH2O + H", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 297 +reaction( "CH2 + CO2 <=> CH2O + CO", [1.100000E+11, 0.000000E+00, 1.000000E+03]) + +# Reaction 298 +reaction( "CH2(S) + O <=> CO + 2 H", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 299 +reaction( "CH + CH3 <=> C2H3 + H", [3.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 300 +reaction( "C + CH3 <=> C2H2 + H", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 301 +reaction( "CH2(S) + CH4 <=> 2 CH3", [4.300000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 302 +reaction( "2 C2H2 <=> C2H + C2H3", [1.700000E+14, 0.000000E+00, 9.200000E+04]) + +# Reaction 303 +reaction( "C2H2 + C2H6 <=> C2H3 + C2H5", [2.000000E+14, 0.000000E+00, 6.000000E+04]) + +# Reaction 304 +reaction( "2 CH3 => C2H4 + H2", [5.000000E+14, 0.000000E+00, 3.200000E+04]) + +# Reaction 305 +reaction( "2 CH2 => C2H2 + 2 H", [1.200000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 306 +reaction( "CH + CH2 <=> C2H2 + H", [4.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 307 +reaction( "C + CH2 <=> C2H + H", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 308 +reaction( "C2H2 + C3H6 <=> C2H3 + C3H5-A", [4.000000E+13, 0.000000E+00, 4.680000E+04]) + +# Reaction 309 +reaction( "C2H6 <=> C2H4 + H2", [3.000000E+13, 0.000000E+00, 7.850000E+04]) + +# Reaction 310 +reaction( "CH3CO + H <=> CH3CHO", [1.300000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 311 +reaction( "CH3CHO + O2 <=> CH2CHO + HO2", [4.000000E+13, 0.000000E+00, 4.900000E+04]) + +# Reaction 312 +reaction( "CH3CHO + H <=> CH3CO + H2", [5.000000E+07, 2.000000E+00, 3.600000E+03]) + +# Reaction 313 +reaction( "CH3OH + H => CH3 + H2O", [6.500000E+11, 0.000000E+00, 5.300000E+03]) + +# Reaction 314 +reaction( "CH2O + O => CO2 + 2 H", [2.000000E+13, 0.000000E+00, 5.000000E+03]) + +# Reaction 315 +reaction( "CH3CHO + O => CH3 + CO2 + H", [2.000000E+13, 0.000000E+00, 3.000000E+03]) + +# Reaction 316 +reaction( "CH2O + OH => CO2 + H + H2", [1.000000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 317 +reaction( "CH3CHO + OH => CH3 + CO2 + H2", [1.000000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 318 +reaction( "C2H2 + HO2 => CH2O + HCO", [5.000000E+12, 0.000000E+00, 1.500000E+04]) + +# Reaction 319 +reaction( "CH2O + HCO <=> CH3 + CO2", [5.000000E+11, 0.000000E+00, 8.000000E+03]) + +# Reaction 320 +reaction( "CH3CHO + HCO => C2H5 + CO2", [2.000000E+11, 0.000000E+00, 8.000000E+03]) + +# Reaction 321 +reaction( "C2H3 + CH2O => C2H2 + 0.5 CH2OH + 0.5 CH3O", [5.000000E+11, 0.000000E+00, 6.000000E+03]) + +# Reaction 322 +reaction( "CH3O + CO <=> CH3 + CO2", [5.000000E+11, 0.000000E+00, 6.500000E+03]) + +# Reaction 323 +reaction( "C2H2 + O2 => CH2O + CO", [3.000000E+11, 0.000000E+00, 2.600000E+04]) + +# Reaction 324 +reaction( "C2H4 + O2 => 2 CH2O", [1.000000E+14, 0.000000E+00, 4.800000E+04]) + +# Reaction 325 +reaction( "C2H2 + O2 => 2 HCO", [3.000000E+11, 0.000000E+00, 2.700000E+04]) + +# Reaction 326 +reaction( "C2H4 + O2 => CH3O + HCO", [1.000000E+14, 0.000000E+00, 4.300000E+04]) + +# Reaction 327 +reaction( "CH2CHO + O2 => CH2O + CO + OH", [6.000000E+10, 0.000000E+00, 0.000000E+00]) + +# Reaction 328 +three_body_reaction( "CH3 + O + M => CH3O + M", [5.000000E+16, 0.000000E+00, 0.000000E+00]) + +# Reaction 329 +reaction( "C2H3 + O => CH2CHO", [2.500000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 330 +reaction( "C3H5-A + O => C2H3 + CH2O", [3.250000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 331 +reaction( "CH2CHO + O => CH2O + HCO", [5.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 332 +reaction( "C2H + OH => 0.7 C2H2 + 0.3 CH2CO + 0.7 O", [1.000000E+12, 0.000000E+00, 1.300000E+04]) + +# Reaction 333 +reaction( "C2H3 + OH => CH3CHO", [5.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 334 +reaction( "C2H3 + HO2 => CH2CHO + OH", [3.000000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 335 +reaction( "HCO + HO2 <=> CO + H2O2", [4.000000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 336 +reaction( "CH3O + OH => CH2O + H2O", [1.500000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 337 +reaction( "CH3O + HCO <=> 2 CH2O", [1.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 338 +reaction( "CH3O + HCO => CH3OH + CO", [1.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 339 +reaction( "CH2OH + CH3 => CH2O + CH4", [1.500000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 340 +reaction( "CH2CHO + H => CH3CHO", [6.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 341 +reaction( "CH2CHO + OH => CH2OH + HCO", [1.000000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 342 +reaction( "CH2CHO <=> CH3CO", [2.000000E+11, 0.000000E+00, 3.200000E+04]) + +# Reaction 343 +reaction( "C2H2 + OH => CH2CHO", [5.000000E+11, 0.000000E+00, 0.000000E+00]) + +# Reaction 344 +falloff_reaction( "C3H5-A + H (+M) <=> C3H6 (+M)", + kf = [1.000000E+14, 0.000000E+00, 0.000000E+00], + kf0 = [1.330000E+60, -1.200000E+01, 5.967800E+03], + efficiencies = "CH4:2.0 CO:1.5 CO2:2.0 H2:2.0 H2O:6.0", + falloff = Troe(A = 0.02, T3 = 1097.0, T1 = 10970.0, T2 = 6860.0) ) + +# Reaction 345 +reaction( "H2 + HCCO => CH2CO + H", [5.992000E+05, 2.000000E+00, 7.705880E+03]) + +# Reaction 346 +reaction( "CH3CO + CH4 => CH3 + CH3CHO", [9.450000E+05, 2.000000E+00, 2.169702E+04]) + +# Reaction 347 +reaction( "CH2CHO + CH4 => CH3 + CH3CHO", [1.610000E+05, 2.000000E+00, 1.883277E+04]) + +# Reaction 348 +reaction( "CH4 + HCCO => CH2CO + CH3", [2.996000E+05, 2.000000E+00, 1.027499E+04]) + +# Reaction 349 +reaction( "C2H2 + CH3 => C2H + CH4", [6.000000E+04, 2.000000E+00, 1.119653E+04]) + +# Reaction 350 +reaction( "C2H2 + C2H3 => C2H + C2H4", [1.356000E+05, 2.000000E+00, 9.832260E+03]) + +# Reaction 351 +reaction( "C2H2 + C2H5 => C2H + C2H6", [4.000000E+04, 2.000000E+00, 1.326538E+04]) + +# Reaction 352 +reaction( "C2H2 + C3H5-A => C2H + C3H6", [1.078000E+05, 2.000000E+00, 2.043290E+04]) + +# Reaction 353 +reaction( "C2H2 + O => C2H + OH", [4.700000E+06, 2.000000E+00, 8.057530E+03]) + +# Reaction 354 +reaction( "C2H2 + O2 => C2H + HO2", [3.400000E+06, 2.000000E+00, 5.483421E+04]) + +# Reaction 355 +reaction( "C2H2 + HO2 => C2H + H2O2", [1.600000E+06, 2.000000E+00, 2.409027E+04]) + +# Reaction 356 +reaction( "C2H2 + CH3O => C2H + CH3OH", [8.560000E+04, 2.000000E+00, 6.755270E+03]) + +# Reaction 357 +reaction( "C2H2 + CH2OH => C2H + CH3OH", [5.660000E+04, 2.000000E+00, 1.741623E+04]) + +# Reaction 358 +reaction( "C2H2 + HCO => C2H + CH2O", [2.520000E+05, 2.000000E+00, 1.985630E+04]) + +# Reaction 359 +reaction( "C2H2 + CH3CO => C2H + CH3CHO", [2.700000E+05, 2.000000E+00, 2.181072E+04]) + +# Reaction 360 +reaction( "C2H2 + CH2CHO => C2H + CH3CHO", [4.600000E+04, 2.000000E+00, 1.893041E+04]) + +# Reaction 361 +reaction( "C2H2 + HCCO => C2H + CH2CO", [8.560000E+04, 2.000000E+00, 1.144222E+04]) + +# Reaction 362 +reaction( "C2H3 + C2H6 => C2H4 + C2H5", [6.102000E+05, 2.000000E+00, 5.704860E+03]) + +# Reaction 363 +reaction( "C2H6 + CH2OH => C2H5 + CH3OH", [2.547000E+05, 2.000000E+00, 1.283500E+04]) + +# Reaction 364 +reaction( "C2H6 + HCO => C2H5 + CH2O", [1.134000E+06, 2.000000E+00, 1.540796E+04]) + +# Reaction 365 +reaction( "C2H6 + CH3CO => C2H5 + CH3CHO", [1.215000E+06, 2.000000E+00, 1.720829E+04]) + +# Reaction 366 +reaction( "C2H6 + CH2CHO => C2H5 + CH3CHO", [2.070000E+05, 2.000000E+00, 1.455831E+04]) + +# Reaction 367 +reaction( "C2H6 + HCCO => C2H5 + CH2CO", [3.852000E+05, 2.000000E+00, 7.127100E+03]) + +# Reaction 368 +reaction( "C2H4 + C2H5 => C2H3 + C2H6", [1.600000E+05, 2.000000E+00, 1.280486E+04]) + +# Reaction 369 +reaction( "C2H4 + C3H5-A => C2H3 + C3H6", [4.312000E+05, 2.000000E+00, 2.043290E+04]) + +# Reaction 370 +reaction( "C2H4 + O => C2H3 + OH", [1.880000E+07, 2.000000E+00, 8.057530E+03]) + +# Reaction 371 +reaction( "C2H4 + HO2 => C2H3 + H2O2", [6.400000E+06, 2.000000E+00, 2.488796E+04]) + +# Reaction 372 +reaction( "C2H4 + CH2OH => C2H3 + CH3OH", [2.264000E+05, 2.000000E+00, 1.695572E+04]) + +# Reaction 373 +reaction( "C2H4 + CH3CO => C2H3 + CH3CHO", [1.080000E+06, 2.000000E+00, 2.209032E+04]) + +# Reaction 374 +reaction( "C2H4 + CH2CHO => C2H3 + CH3CHO", [1.840000E+05, 2.000000E+00, 1.921001E+04]) + +# Reaction 375 +reaction( "C2H4 + HCCO => C2H3 + CH2CO", [3.424000E+05, 2.000000E+00, 1.027448E+04]) + +# Reaction 376 +reaction( "C2H3 + C3H6 => C2H4 + C3H5-A", [2.034000E+05, 2.000000E+00, 4.432900E+03]) + +# Reaction 377 +reaction( "C3H6 + CH2OH => C3H5-A + CH3OH", [8.490000E+04, 2.000000E+00, 1.041016E+04]) + +# Reaction 378 +reaction( "C3H6 + HCO => C3H5-A + CH2O", [3.780000E+05, 2.000000E+00, 1.217241E+04]) + +# Reaction 379 +reaction( "C3H6 + CH3CO => C3H5-A + CH3CHO", [4.050000E+05, 2.000000E+00, 1.387241E+04]) + +# Reaction 380 +reaction( "C3H6 + CH2CHO => C3H5-A + CH3CHO", [6.900000E+04, 2.000000E+00, 1.137241E+04]) + +# Reaction 381 +reaction( "C3H6 + HCCO => C3H5-A + CH2CO", [1.284000E+05, 2.000000E+00, 5.732900E+03]) + +# Reaction 382 +reaction( "H2O + HCCO => CH2CO + OH", [4.280000E+05, 2.000000E+00, 1.295785E+04]) + +# Reaction 383 +reaction( "C2H3 + H2O2 => C2H4 + HO2", [5.424000E+04, 2.000000E+00, 8.379600E+02]) + +# Reaction 384 +reaction( "CH2CHO + H2O2 => CH3CHO + HO2", [1.840000E+04, 2.000000E+00, 6.187190E+03]) + +# Reaction 385 +reaction( "H2O2 + HCCO => CH2CO + HO2", [3.424000E+04, 2.000000E+00, 1.926220E+03]) + +# Reaction 386 +reaction( "C2H5 + CH2O => C2H6 + HCO", [1.600000E+05, 2.000000E+00, 5.307960E+03]) + +# Reaction 387 +reaction( "C3H5-A + CH2O => C3H6 + HCO", [4.312000E+05, 2.000000E+00, 1.097241E+04]) + +# Reaction 388 +reaction( "CH2O + CH3CO => CH3CHO + HCO", [1.080000E+06, 2.000000E+00, 1.202057E+04]) + +# Reaction 389 +reaction( "CH2CHO + CH2O => CH3CHO + HCO", [1.840000E+05, 2.000000E+00, 9.611630E+03]) + +# Reaction 390 +reaction( "CH2O + HCCO => CH2CO + HCO", [3.424000E+05, 2.000000E+00, 4.161680E+03]) + +# Reaction 391 +reaction( "CH3CO + CH3OH => CH3CHO + CH3O", [1.350000E+05, 2.000000E+00, 1.752198E+04]) + +# Reaction 392 +reaction( "CH2CHO + CH3OH => CH3CHO + CH3O", [2.300000E+04, 2.000000E+00, 1.487200E+04]) + +# Reaction 393 +reaction( "CH3OH + HCCO => CH2CO + CH3O", [4.280000E+04, 2.000000E+00, 5.816990E+03]) + +# Reaction 394 +reaction( "C2H3 + CH3OH => C2H4 + CH2OH", [2.034000E+05, 2.000000E+00, 6.355720E+03]) + +# Reaction 395 +reaction( "C2H5 + CH3OH => C2H6 + CH2OH", [6.000000E+04, 2.000000E+00, 9.335000E+03]) + +# Reaction 396 +reaction( "C3H5-A + CH3OH => C3H6 + CH2OH", [1.617000E+05, 2.000000E+00, 1.581016E+04]) + +# Reaction 397 +reaction( "CH3CO + CH3OH => CH2OH + CH3CHO", [4.050000E+05, 2.000000E+00, 1.705245E+04]) + +# Reaction 398 +reaction( "CH2CHO + CH3OH => CH2OH + CH3CHO", [6.900000E+04, 2.000000E+00, 1.440247E+04]) + +# Reaction 399 +reaction( "CH3OH + HCCO => CH2CO + CH2OH", [1.284000E+05, 2.000000E+00, 7.777950E+03]) + +# Reaction 400 +reaction( "CH3 + CH3CHO => CH3CO + CH4", [1.800000E+05, 2.000000E+00, 4.197020E+03]) + +# Reaction 401 +reaction( "C2H3 + CH3CHO => C2H4 + CH3CO", [4.068000E+05, 2.000000E+00, 3.190320E+03]) + +# Reaction 402 +reaction( "C2H5 + CH3CHO => C2H6 + CH3CO", [1.200000E+05, 2.000000E+00, 5.408290E+03]) + +# Reaction 403 +reaction( "C3H5-A + CH3CHO => C3H6 + CH3CO", [3.234000E+05, 2.000000E+00, 1.097241E+04]) + +# Reaction 404 +reaction( "CH3CHO + CH3O => CH3CO + CH3OH", [2.568000E+05, 2.000000E+00, 5.219800E+02]) + +# Reaction 405 +reaction( "CH2OH + CH3CHO => CH3CO + CH3OH", [1.698000E+05, 2.000000E+00, 8.752450E+03]) + +# Reaction 406 +reaction( "CH3CHO + HCO => CH2O + CH3CO", [7.560000E+05, 2.000000E+00, 1.032057E+04]) + +# Reaction 407 +reaction( "CH2CHO + CH3CHO => CH3CHO + CH3CO", [1.380000E+05, 2.000000E+00, 9.550720E+03]) + +# Reaction 408 +reaction( "CH3CHO + HCCO => CH2CO + CH3CO", [2.568000E+05, 2.000000E+00, 4.416110E+03]) + +# Reaction 409 +reaction( "CH3 + CH3CHO => CH2CHO + CH4", [9.000000E+04, 2.000000E+00, 7.760150E+03]) + +# Reaction 410 +reaction( "C2H3 + CH3CHO => C2H4 + CH2CHO", [2.034000E+05, 2.000000E+00, 6.569890E+03]) + +# Reaction 411 +reaction( "C2H5 + CH3CHO => C2H6 + CH2CHO", [6.000000E+04, 2.000000E+00, 9.419460E+03]) + +# Reaction 412 +reaction( "C3H5-A + CH3CHO => C3H6 + CH2CHO", [1.617000E+05, 2.000000E+00, 1.581016E+04]) + +# Reaction 413 +reaction( "CH3CHO + O => CH2CHO + OH", [7.050000E+06, 2.000000E+00, 4.691700E+03]) + +# Reaction 414 +reaction( "CH3CHO + HO2 => CH2CHO + H2O2", [2.400000E+06, 2.000000E+00, 1.896483E+04]) + +# Reaction 415 +reaction( "CH3CHO + CH3O => CH2CHO + CH3OH", [1.284000E+05, 2.000000E+00, 3.702800E+03]) + +# Reaction 416 +reaction( "CH2OH + CH3CHO => CH2CHO + CH3OH", [8.490000E+04, 2.000000E+00, 1.317614E+04]) + +# Reaction 417 +reaction( "CH3CHO + HCO => CH2CHO + CH2O", [3.780000E+05, 2.000000E+00, 1.520084E+04]) + +# Reaction 418 +reaction( "CH3CHO + CH3CO => CH2CHO + CH3CHO", [4.050000E+05, 2.000000E+00, 1.700117E+04]) + +# Reaction 419 +reaction( "CH3CHO + HCCO => CH2CHO + CH2CO", [1.284000E+05, 2.000000E+00, 7.992130E+03]) + +# Reaction 420 +reaction( "CH2CO + H => H2 + HCCO", [2.400000E+07, 2.000000E+00, 9.455880E+03]) + +# Reaction 421 +reaction( "CH2CO + CH3 => CH4 + HCCO", [2.400000E+05, 2.000000E+00, 1.037499E+04]) + +# Reaction 422 +reaction( "C2H3 + CH2CO => C2H4 + HCCO", [5.424000E+05, 2.000000E+00, 8.974480E+03]) + +# Reaction 423 +reaction( "C2H5 + CH2CO => C2H6 + HCCO", [1.600000E+05, 2.000000E+00, 1.292709E+04]) + +# Reaction 424 +reaction( "C3H5-A + CH2CO => C3H6 + HCCO", [4.312000E+05, 2.000000E+00, 2.043290E+04]) + +# Reaction 425 +reaction( "CH2CO + O => HCCO + OH", [1.880000E+07, 2.000000E+00, 8.057530E+03]) + +# Reaction 426 +reaction( "CH2CO + O2 => HCCO + HO2", [1.360000E+07, 2.000000E+00, 5.483421E+04]) + +# Reaction 427 +reaction( "CH2CO + OH => H2O + HCCO", [1.200000E+10, 1.000000E+00, 2.307850E+03]) + +# Reaction 428 +reaction( "CH2CO + HO2 => H2O2 + HCCO", [6.400000E+06, 2.000000E+00, 2.467622E+04]) + +# Reaction 429 +reaction( "CH2CO + CH3O => CH3OH + HCCO", [3.424000E+05, 2.000000E+00, 6.416990E+03]) + +# Reaction 430 +reaction( "CH2CO + CH2OH => CH3OH + HCCO", [2.264000E+05, 2.000000E+00, 1.707795E+04]) + +# Reaction 431 +reaction( "CH2CO + HCO => CH2O + HCCO", [1.008000E+06, 2.000000E+00, 2.006168E+04]) + +# Reaction 432 +reaction( "CH2CO + CH3CO => CH3CHO + HCCO", [1.080000E+06, 2.000000E+00, 2.201611E+04]) + +# Reaction 433 +reaction( "CH2CHO + CH2CO => CH3CHO + HCCO", [1.840000E+05, 2.000000E+00, 1.913579E+04]) + +# Reaction 434 +reaction( "CH + O <=> CHO+ + E", [2.510000E+11, 0.000000E+00, 1.701720E+03]) + +# Reaction 435 +reaction( "CHO+ + E <=> CO + H", [7.400000E+18, -6.800000E-01, 0.000000E+00]) + +# Reaction 436 +reaction( "CHO+ + H2O <=> CO + H3O+", [1.510000E+15, 0.000000E+00, 0.000000E+00]) + +# Reaction 437 +reaction( "E + H3O+ <=> H + H2O", [2.290000E+18, -5.000000E-01, 0.000000E+00]) + +# Reaction 438 +reaction( "E + H3O+ <=> 2 H + OH", [7.950000E+21, -1.370000E+00, 0.000000E+00]) + +# Reaction 439 +reaction( "E + H3O+ <=> H2 + OH", [1.250000E+19, -5.000000E-01, 0.000000E+00]) + +# Reaction 440 +reaction( "E + H3O+ <=> H + H2 + O", [6.000000E+17, -3.000000E-01, 0.000000E+00]) + +# Reaction 441 +reaction( "C + H3O+ <=> CHO+ + H2", [6.020000E+12, 0.000000E+00, 0.000000E+00]) + +# Reaction 442 +reaction( "CH2CO + CHO+ <=> C2H3O+ + CO", [1.260000E+15, -5.000000E-02, 0.000000E+00]) + +# Reaction 443 +reaction( "CH3 + CHO+ <=> C2H3O+ + H", [7.760000E+14, -1.000000E-02, 0.000000E+00]) + +# Reaction 444 +reaction( "C2H3O+ + E <=> CH2CO + H", [2.290000E+18, -5.000000E-01, 0.000000E+00]) + +# Reaction 445 +reaction( "CH2CO + H3O+ <=> C2H3O+ + H2O", [1.200000E+15, 0.000000E+00, 0.000000E+00]) + +# Reaction 446 +reaction( "C2H3O+ + E <=> CH3 + CO", [2.400000E+17, -5.000000E-02, 0.000000E+00]) + +# Reaction 447 +reaction( "C2H3O+ + O <=> CH2O + CHO+", [2.000000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 448 +reaction( "CH3OH + CHO+ <=> CH5O+ + CO", [8.710000E+14, -6.000000E-02, 0.000000E+00]) + +# Reaction 449 +reaction( "CH3OH + H3O+ <=> CH5O+ + H2O", [1.510000E+15, 0.000000E+00, 0.000000E+00]) + +# Reaction 450 +reaction( "CH5O+ + E <=> CH3OH + H", [2.400000E+17, -5.000000E-02, 0.000000E+00]) + +# Reaction 451 +reaction( "CH2CO + CH5O+ <=> C2H3O+ + CH3OH", [1.490000E+15, -8.000000E-02, -8.365000E+01]) + +# Reaction 452 +reaction( "H2 + O2- <=> E + H2O2", [6.020000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 453 +reaction( "H + O2- <=> E + HO2", [7.230000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 454 +reaction( "O2- + OH <=> O2 + OH-", [6.020000E+13, 0.000000E+00, 0.000000E+00]) + +# Reaction 455 +reaction( "H + O2- <=> O + OH-", [1.080000E+15, 0.000000E+00, 0.000000E+00]) + +# Reaction 456 +reaction( "O + OH- <=> E + HO2", [1.200000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 457 +reaction( "H + OH- <=> E + H2O", [1.080000E+15, 0.000000E+00, 0.000000E+00]) + +# Reaction 458 +reaction( "CH + OH- <=> CH2O + E", [3.000000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 459 +reaction( "CH3 + OH- <=> CH3OH + E", [6.020000E+14, 0.000000E+00, 0.000000E+00]) + +# Reaction 460 +reaction( "E + O + O2 <=> O + O2-", [3.630000E+16, 0.000000E+00, 0.000000E+00]) + +# Reaction 461 +reaction( "E + 2 O2 <=> O2 + O2-", [1.520000E+21, -1.000000E+00, 1.192640E+03]) + +# Reaction 462 +reaction( "E + H2O + O2 <=> H2O + O2-", [5.080000E+18, 0.000000E+00, 0.000000E+00]) + +# Reaction 463 +reaction( "E + N2 + O2 <=> N2 + O2-", [3.590000E+21, -2.000000E+00, 1.386200E+02]) + +# Reaction 464 +three_body_reaction( "E + OH + M <=> OH- + M", [1.090000E+17, 0.000000E+00, 0.000000E+00]) + diff --git a/testcases/TaylorGreen2D/base.json b/testcases/TaylorGreen2D/base.json index 4e0d295..96fa3db 100644 --- a/testcases/TaylorGreen2D/base.json +++ b/testcases/TaylorGreen2D/base.json @@ -32,8 +32,10 @@ "cfl" : -1.0, "fixedDeltaTime" : 5.0e-4, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0 + } }, "BC" : { @@ -87,5 +89,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/TaylorGreen2D/postProc.py b/testcases/TaylorGreen2D/postProc.py index 1af0506..1f17d87 100644 --- a/testcases/TaylorGreen2D/postProc.py +++ b/testcases/TaylorGreen2D/postProc.py @@ -40,7 +40,7 @@ def process(case): yNum = data["Grid"]["yNum"] xWidth = data["Grid"]["xWidth"] yWidth = data["Grid"]["yWidth"] - constantVisc = data["Flow"]["viscosityModel"]["Visc"] + constantVisc = data["Flow"]["mixture"]["viscosityModel"]["Visc"] Area = xWidth*yWidth diff --git a/testcases/VortexAdvection2D/base.json b/testcases/VortexAdvection2D/base.json index ed41215..b805fe3 100644 --- a/testcases/VortexAdvection2D/base.json +++ b/testcases/VortexAdvection2D/base.json @@ -32,8 +32,10 @@ "cfl" : -1.0, "fixedDeltaTime" : 2.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0 + } }, "BC" : { @@ -82,5 +84,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/testcases/scalingTest/StrongScaling/base.json b/testcases/scalingTest/StrongScaling/base.json index 9450d2c..11fbd48 100644 --- a/testcases/scalingTest/StrongScaling/base.json +++ b/testcases/scalingTest/StrongScaling/base.json @@ -32,8 +32,10 @@ "cfl" : -0.8, "fixedDeltaTime" : 2.0e-11, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 1.0 + } }, "BC" : { @@ -89,6 +91,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/testcases/scalingTest/WeakScaling/base.json b/testcases/scalingTest/WeakScaling/base.json index 5a24916..fb5d1f0 100644 --- a/testcases/scalingTest/WeakScaling/base.json +++ b/testcases/scalingTest/WeakScaling/base.json @@ -40,8 +40,10 @@ "cfl" : -0.8, "fixedDeltaTime" : 2.0e-11, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 23e6 + "EulerScheme" : { + "type" : "Hybrid", + "vorticityScale" : 23e6 + } }, "BC" : { @@ -112,6 +114,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + "Efield" : { "type" : "Off" } } diff --git a/unitTests/averageTest/Makefile b/unitTests/averageTest/Makefile index e766e37..69cc2bd 100644 --- a/unitTests/averageTest/Makefile +++ b/unitTests/averageTest/Makefile @@ -1,103 +1,55 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif +###################################################### +# Include standard variables +###################################################### +include $(HTR_DIR)/Makefile.in -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif +###################################################### +# Rules +###################################################### +.PHONY: default all clean force -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src/ -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - -.PHONY: default all clean +default: averageTest.exec average1DTest.exec -MODULES= $(HTR_DIR)/src/AirMix.rg \ - $(HTR_DIR)/src/hdf_helper.rg \ +###################################################### +# Objects +###################################################### +MODULES= $(HTR_DIR)/src/hdf_helper.rg \ $(HTR_DIR)/src/prometeo_IO.rg \ $(HTR_DIR)/src/prometeo_const.rg \ $(HTR_DIR)/src/prometeo_macro.rg \ - $(HTR_DIR)/src/prometeo_average.rg - -default: averageTest.exec average1DTest.exec - + $(HTR_DIR)/src/prometeo_metric.rg \ + $(HTR_DIR)/src/prometeo_partitioner.rg \ + $(HTR_DIR)/src/prometeo_mixture.rg \ + $(HTR_DIR)/src/prometeo_average.rg \ + $(HTR_DIR)/src/prometeo_average_types.h + +###################################################### +# Recipes +###################################################### clean: $(RM) -r *.exec *.o *Averages -average1DTest.exec: average1DTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o +average1DTest.exec: average1DTest.o $(HTR_DIR)/src/prometeo_AirMix_cpu.a $(CXX) -o $@ $^ $(LINK_FLAGS) average1DTest.o: average1DTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg $(MODULES) - $(REGENT) average1DTest.rg $(REGENT_FLAGS) + EOS="AirMix" $(REGENT) average1DTest.rg $(REGENT_FLAGS) -averageTest.exec: averageTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o +averageTest.exec: averageTest.o $(HTR_DIR)/src/prometeo_AirMix_cpu.a $(CXX) -o $@ $^ $(LINK_FLAGS) averageTest.o: averageTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg $(MODULES) - $(REGENT) averageTest.rg $(REGENT_FLAGS) + EOS="AirMix" $(REGENT) averageTest.rg $(REGENT_FLAGS) + +$(HTR_DIR)/src/prometeo_AirMix_cpu.a: force + $(MAKE) -C $(HTR_DIR)/src prometeo_AirMix_cpu.a $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua - make -C $(HTR_DIR)/src config_schema.o + $(MAKE) -C $(HTR_DIR)/src config_schema.o json.o json.h: $(HTR_DIR)/src/json.c $(HTR_DIR)/src/json.h - make -C $(HTR_DIR)/src json.o + $(MAKE) -C $(HTR_DIR)/src json.o $(HTR_DIR)/src/util-desugared.rg: $(HTR_DIR)/src/util.rg - make -C $(HTR_DIR)/src util-desugared.rg + $(MAKE) -C $(HTR_DIR)/src util-desugared.rg diff --git a/unitTests/averageTest/average1DTest.rg b/unitTests/averageTest/average1DTest.rg index 518cdec..b0faea8 100644 --- a/unitTests/averageTest/average1DTest.rg +++ b/unitTests/averageTest/average1DTest.rg @@ -5,7 +5,9 @@ import "regent" local C = regentlib.c local fabs = regentlib.fabs(double) -local SCHEMA = terralib.includec("../../src/config_schema.h") +local sqrt = regentlib.sqrt(double) +local REGISTRAR = terralib.includec("prometeo_average.h") +local SCHEMA = terralib.includec("config_schema.h") local UTIL = require 'util-desugared' local format = require "std/format" @@ -13,41 +15,38 @@ local Config = SCHEMA.Config local CONST = require "prometeo_const" local MACRO = require "prometeo_macro" -local MIX = (require "AirMix")(SCHEMA) -local nSpec = MIX.nSpec -local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver local Primitives = CONST.Primitives local Properties = CONST.Properties -local struct Fluid_columns { - -- Grid point - centerCoordinates : double[3]; - cellWidth : double[3]; - -- Primitive variables - pressure : double; - temperature : double; - MassFracs : double[nSpec]; - MolarFracs : double[nSpec]; - velocity : double[3]; - -- Properties - rho : double; - mu : double; - lam : double; - Di : double[nSpec]; - SoS : double; - -- Gradients - velocityGradientX : double[3]; - velocityGradientY : double[3]; - velocityGradientZ : double[3]; - temperatureGradient : double[3]; - -- Conserved varaibles - Conserved : double[nEq]; -} +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +types_inc_flags:insert("-DAVERAGE_TEST") +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) +local nSpec = MIX.nSpec +local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver --External modules +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) +local PART = (require 'prometeo_partitioner')(SCHEMA, METRIC, Fluid_columns) local IO = (require 'prometeo_IO')(SCHEMA) -local AVG = (require 'prometeo_average')(SCHEMA, MIX, Fluid_columns) +local AVG = (require 'prometeo_average')(SCHEMA, MIX, TYPES, PART, ELECTRIC_FIELD) -- Test parameters local Npx = 16 @@ -63,7 +62,7 @@ local Nrz = 1 local fromCell = rexpr array( 1, 1, 1) end local uptoCell = rexpr array(Npx, Npy, Npz) end ---local R = rexpr 8.3144598 end +local R = rexpr 8.3144598 end local P = rexpr 101325.0 end local T = rexpr 5000.0 end local Xi = rexpr array(0.4, 0.2, 0.15, 0.15, 0.1) end @@ -71,14 +70,28 @@ local v = rexpr array(1.0, 2.0, 3.0) end local Tres = rexpr 500.0 end -- Expected properties -local eRho = rexpr 6.2899871101668e-02 end -local eMu = rexpr 1.2424467023580e-04 end -local eLam = rexpr 2.2727742147267e-01 end -local eDi = rexpr array(2.5146873480781e-03, 2.4389311883618e-03, 2.4550965167542e-03, 3.6168277168130e-03, 3.9165634179846e-03) end -local eSoS = rexpr 1.4518705966651e+03 end +local eRho = rexpr 6.2899525132668e-02 end +local eMu = rexpr 1.2424432854120e-04 end +local eLam = rexpr 2.4040406505225e-01 end +local eDi = rexpr array(2.5146942638910e-03, 2.4389378958326e-03, 2.4551032686824e-03, 3.6168376636972e-03, 3.9165741891924e-03) end +local eSoS = rexpr 1.4518745895533e+03 end -- Expected conserved variables -local eConserved = rexpr array(2.7311049167620e-02, 1.5598263689963e-02, 1.0970170602665e-02, 5.1208217189288e-03, 3.8995659224908e-03, 6.2899871101668e-02, 1.2579974220334e-01, 1.8869961330500e-01, 5.4092397631210e+05) end +local eConserved = rexpr array(2.3342371515176e-02, 1.3331617683677e-02, 9.3760512904744e-03, 4.3766946590956e-03, 3.3329044209192e-03, 1.8268107194243e-04, 3.6536214388485e-04, 5.4804321582728e-04, 5.3385045774457e+00) end + +-- Normalization quantities +local LRef = rexpr 1.0 end +local PRef = rexpr 101325.0 end +local TRef = rexpr 300.0 end +local YO2Ref = rexpr 0.22 end +local YN2Ref = rexpr 0.78 end +local MixWRef = rexpr 1.0/([YN2Ref]/28.0134e-3 + [YO2Ref]/(2*15.999e-3)) end +local rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end +local eRef = rexpr [PRef]/[rhoRef] end +local uRef = rexpr sqrt([PRef]/[rhoRef]) end +local muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end +local lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end +local DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end __demand(__inline) task InitializeCell(Fluid : region(ispace(int3d), Fluid_columns)) @@ -87,20 +100,22 @@ where do fill(Fluid.centerCoordinates, array(0.0, 0.0, 0.0)) fill(Fluid.cellWidth, array(0.0, 0.0, 0.0)) - fill(Fluid.pressure, [P]) - fill(Fluid.temperature, [T]) - fill(Fluid.MassFracs, [Xi]) + fill(Fluid.nType_x, CONST.Std_node) + fill(Fluid.nType_y, CONST.Std_node) + fill(Fluid.nType_z, CONST.Std_node) + fill(Fluid.pressure, [P]/[PRef]) + fill(Fluid.temperature, [T]/[TRef]) + fill(Fluid.MassFracs, [Xi]) fill(Fluid.MolarFracs, [Xi]) - fill(Fluid.velocity, [v]) - fill(Fluid.rho, [eRho]) - fill(Fluid.mu , [eMu]) - fill(Fluid.lam, [eLam]) - fill(Fluid.Di , [eDi]) - fill(Fluid.SoS, [eSoS]) + fill(Fluid.velocity, array([v][0]/[uRef], [v][1]/[uRef], [v][2]/[uRef])) + fill(Fluid.rho, [eRho]/[rhoRef]) + fill(Fluid.mu , [eMu]/[muRef]) + fill(Fluid.lam, [eLam]/[lamRef]) + fill(Fluid.Di , array([eDi][0]/[DiRef], [eDi][1]/[DiRef], [eDi][2]/[DiRef], [eDi][3]/[DiRef], [eDi][4]/[DiRef])) + fill(Fluid.SoS, [eSoS]/[uRef]) fill(Fluid.velocityGradientX, array(0.0, 0.0, 0.0)) fill(Fluid.velocityGradientY, array(0.0, 0.0, 0.0)) fill(Fluid.velocityGradientZ, array(0.0, 0.0, 0.0)) - fill(Fluid.temperatureGradient, array(0.0, 0.0, 0.0)) fill(Fluid.Conserved, [eConserved]) end @@ -121,9 +136,13 @@ local function checkAverages(XAverages, YAverages, ZAverages) ispace(int2d, { 1, Npz+2}) | ispace(int2d, { 1, Npz+2}, {Npy+1, 0})) do regentlib.assert(XAverages[int3d{c.x, c.y, 0}].weight == 0.0, "average1DTest: ERROR in XAverages") + regentlib.assert(XAverages[int3d{c.x, c.y, 0}].pressure_avg == 0.0, "average1DTest: ERROR in XAverages (Pavg)") + regentlib.assert(XAverages[int3d{c.x, c.y, 0}].pressure_rms == 0.0, "average1DTest: ERROR in XAverages (Prms)") end for c in ispace(int2d, {Npy, Npz}, {1, 1}) do - regentlib.assert(fabs(XAverages[int3d{c.x, c.y, 0}].weight/double(16.0*double(c.x)) - 1.0) < 1e-9, "averageTest: ERROR in XAverages") + regentlib.assert(fabs(XAverages[int3d{c.x, c.y, 0}].weight/double(16.0*double(c.x)) - 1.0) < 1e-9, "average1DTest: ERROR in XAverages") + regentlib.assert(fabs(XAverages[int3d{c.x, c.y, 0}].pressure_avg/double([P]/[PRef]*16.0*double(c.x)) - 1.0) < 1e-9, "average1DTest: ERROR in XAverages (Pavg)") + regentlib.assert(fabs(XAverages[int3d{c.x, c.y, 0}].pressure_rms/double([P]/[PRef]*[P]/[PRef]*16.0*double(c.x)) - 1.0) < 1e-9, "average1DTest: ERROR in XAverages (Prms)") end for c in (ispace(int2d, {Npx+2, 1}) | @@ -131,9 +150,13 @@ local function checkAverages(XAverages, YAverages, ZAverages) ispace(int2d, { 1, Npz+2}) | ispace(int2d, { 1, Npz+2}, {Npx+1, 0})) do regentlib.assert(YAverages[int3d{c.x, c.y, 0}].weight == 0.0, "average1DTest: ERROR in YAverages") + regentlib.assert(YAverages[int3d{c.x, c.y, 0}].pressure_avg == 0.0, "average1DTest: ERROR in YAverages (Pavg)") + regentlib.assert(YAverages[int3d{c.x, c.y, 0}].pressure_rms == 0.0, "average1DTest: ERROR in YAverages (Prms)") end for c in ispace(int2d, {Npx, Npz}, {1, 1}) do regentlib.assert(fabs(YAverages[int3d{c.x, c.y, 0}].weight/double(136.0) - 1.0) < 1e-9, "averageTest: ERROR in YAverages") + regentlib.assert(fabs(YAverages[int3d{c.x, c.y, 0}].pressure_avg/double([P]/[PRef]*136.0) - 1.0) < 1e-9, "average1DTest: ERROR in YAverages (Pavg)") + regentlib.assert(fabs(YAverages[int3d{c.x, c.y, 0}].pressure_rms/double([P]/[PRef]*[P]/[PRef]*136.0) - 1.0) < 1e-9, "average1DTest: ERROR in YAverages (Prms)") end for c in (ispace(int2d, {Npx+2, 1}) | @@ -141,9 +164,13 @@ local function checkAverages(XAverages, YAverages, ZAverages) ispace(int2d, { 1, Npy+2}) | ispace(int2d, { 1, Npy+2}, {Npy+1, 0})) do regentlib.assert(ZAverages[int3d{c.x, c.y, 0}].weight == 0.0, "average1DTest: ERROR in ZAverages") + regentlib.assert(ZAverages[int3d{c.x, c.y, 0}].pressure_avg == 0.0, "average1DTest: ERROR in ZAverages (Pavg)") + regentlib.assert(ZAverages[int3d{c.x, c.y, 0}].pressure_rms == 0.0, "average1DTest: ERROR in ZAverages (Prms)") end for c in ispace(int2d, {Npx, Npy}, {1, 1}) do regentlib.assert(fabs(ZAverages[int3d{c.x, c.y, 0}].weight/double(16.0*double(c.y)) - 1.0) < 1e-9, "averageTest: ERROR in ZAverages") + regentlib.assert(fabs(ZAverages[int3d{c.x, c.y, 0}].pressure_avg/double([P]/[PRef]*16.0*double(c.y)) - 1.0) < 1e-9, "average1DTest: ERROR in ZAverages (Pavg)") + regentlib.assert(fabs(ZAverages[int3d{c.x, c.y, 0}].pressure_rms/double([P]/[PRef]*[P]/[PRef]*16.0*double(c.y)) - 1.0) < 1e-9, "average1DTest: ERROR in ZAverages (Prms)") end end end @@ -168,10 +195,12 @@ local Grid = { numTilesOut = regentlib.newsymbol(), } +task zero() return 0.0 end + task main() -- Init config var config : Config - + config.Flow.initCase.type = SCHEMA.FlowInitCase_Restart format.snprint([&int8](config.Flow.initCase.u.Restart.restartDir), 256, ".") @@ -196,7 +225,17 @@ task main() -- Init the mixture config.Flow.mixture.type = SCHEMA.MixtureModel_AirMix - var Mix = MIX.InitMixture(config) + config.Flow.mixture.u.AirMix.LRef = [LRef] + config.Flow.mixture.u.AirMix.TRef = [TRef] + config.Flow.mixture.u.AirMix.PRef = [PRef] + config.Flow.mixture.u.AirMix.XiRef.Species.length = 2 + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[0].Name), 10, "O2") + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[1].Name), 10, "N2") + config.Flow.mixture.u.AirMix.XiRef.Species.values[0].MolarFrac = [MixWRef]*[YO2Ref]/(2*15.999e-3) + config.Flow.mixture.u.AirMix.XiRef.Species.values[1].MolarFrac = [MixWRef]*[YN2Ref]/28.0134e-3 + + -- Define mixture + var Mix = MIX.InitMixtureStruct(config); -- Define the domain var [Grid.xBnum] = 1 @@ -218,6 +257,7 @@ task main() y = config.Grid.yNum + 2*Grid.yBnum, z = config.Grid.zNum + 2*Grid.zBnum}) var Fluid = region(is_Fluid, Fluid_columns); + var Fluid_bounds = Fluid.bounds -- Partitioning domain var tiles = ispace(int3d, {Grid.NX, Grid.NY, Grid.NZ}) @@ -233,17 +273,23 @@ task main() InitGeometry(Fluid); + -- Initialize averages partitions + [AVG.InitPartitions(Averages, Grid, Fluid, p_Fluid, config)]; + -- Initialize averages [AVG.InitRakesAndPlanes(Averages)]; + var dt = double(0.1) + dt += zero() -- so it becomes a future + for i=0, 10 do - [AVG.AddAverages(Averages, rexpr double(0.1) end, config, Mix)]; + [AVG.AddAverages(Averages, Fluid_bounds, dt, config, Mix)]; end var SpeciesNames = MIX.GetSpeciesNames(Mix) var dirname = [&int8](C.malloc(256)) C.snprintf(dirname, 256, '.'); - [AVG.WriteAverages(Averages, tiles, dirname, IO, SpeciesNames, config)]; + [AVG.WriteAverages(0, Averages, tiles, dirname, IO, SpeciesNames, config)]; [checkAverages(Averages.XAverages, Averages.YAverages, Averages.ZAverages)]; __fence(__execution, __block) @@ -262,4 +308,4 @@ end -- COMPILATION CALL ------------------------------------------------------------------------------- -regentlib.saveobj(main, "average1DTest.o", "object") +regentlib.saveobj(main, "average1DTest.o", "object", REGISTRAR.register_average_tasks) diff --git a/unitTests/averageTest/averageTest.rg b/unitTests/averageTest/averageTest.rg index 6c1a801..c146bd1 100644 --- a/unitTests/averageTest/averageTest.rg +++ b/unitTests/averageTest/averageTest.rg @@ -5,7 +5,9 @@ import "regent" local C = regentlib.c local fabs = regentlib.fabs(double) -local SCHEMA = terralib.includec("../../src/config_schema.h") +local sqrt = regentlib.sqrt(double) +local REGISTRAR = terralib.includec("prometeo_average.h") +local SCHEMA = terralib.includec("config_schema.h") local UTIL = require "util-desugared" local format = require "std/format" @@ -13,41 +15,38 @@ local Config = SCHEMA.Config local CONST = require "prometeo_const" local MACRO = require "prometeo_macro" -local MIX = (require "AirMix")(SCHEMA) -local nSpec = MIX.nSpec -local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver local Primitives = CONST.Primitives local Properties = CONST.Properties -local struct Fluid_columns { - -- Grid point - centerCoordinates : double[3]; - cellWidth : double[3]; - -- Primitive variables - pressure : double; - temperature : double; - MassFracs : double[nSpec]; - MolarFracs : double[nSpec]; - velocity : double[3]; - -- Properties - rho : double; - mu : double; - lam : double; - Di : double[nSpec]; - SoS : double; - -- Gradients - velocityGradientX : double[3]; - velocityGradientY : double[3]; - velocityGradientZ : double[3]; - temperatureGradient : double[3]; - -- Conserved varaibles - Conserved : double[nEq]; -} +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +types_inc_flags:insert("-DAVERAGE_TEST") +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) +local nSpec = MIX.nSpec +local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver --External modules +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) +local PART = (require 'prometeo_partitioner')(SCHEMA, METRIC, Fluid_columns) local IO = (require 'prometeo_IO')(SCHEMA) -local AVG = (require 'prometeo_average')(SCHEMA, MIX, Fluid_columns) +local AVG = (require 'prometeo_average')(SCHEMA, MIX, TYPES, PART, ELECTRIC_FIELD) -- Test parameters local Npx = 16 @@ -67,7 +66,7 @@ local uptoCelly = rexpr array( 8, Npy, Npz) end local fromCellz = rexpr array( 8, 1, 1) end local uptoCellz = rexpr array( 8, Npy, Npz) end ---local R = rexpr 8.3144598 end +local R = rexpr 8.3144598 end local P = rexpr 101325.0 end local T = rexpr 5000.0 end local Xi = rexpr array(0.4, 0.2, 0.15, 0.15, 0.1) end @@ -75,14 +74,28 @@ local v = rexpr array(1.0, 2.0, 3.0) end local Tres = rexpr 500.0 end -- Expected properties -local eRho = rexpr 6.2899871101668e-02 end -local eMu = rexpr 1.2424467023580e-04 end -local eLam = rexpr 2.2727742147267e-01 end -local eDi = rexpr array(2.5146873480781e-03, 2.4389311883618e-03, 2.4550965167542e-03, 3.6168277168130e-03, 3.9165634179846e-03) end -local eSoS = rexpr 1.4518705966651e+03 end +local eRho = rexpr 6.2899525132668e-02 end +local eMu = rexpr 1.2424432854120e-04 end +local eLam = rexpr 2.4040406505225e-01 end +local eDi = rexpr array(2.5146942638910e-03, 2.4389378958326e-03, 2.4551032686824e-03, 3.6168376636972e-03, 3.9165741891924e-03) end +local eSoS = rexpr 1.4518745895533e+03 end -- Expected conserved variables -local eConserved = rexpr array(2.7311049167620e-02, 1.5598263689963e-02, 1.0970170602665e-02, 5.1208217189288e-03, 3.8995659224908e-03, 6.2899871101668e-02, 1.2579974220334e-01, 1.8869961330500e-01, 5.4092397631210e+05) end +local eConserved = rexpr array(2.3342371515176e-02, 1.3331617683677e-02, 9.3760512904744e-03, 4.3766946590956e-03, 3.3329044209192e-03, 1.8268107194243e-04, 3.6536214388485e-04, 5.4804321582728e-04, 5.3385045774457e+00) end + +-- Normalization quantities +local LRef = rexpr 1.0 end +local PRef = rexpr 101325.0 end +local TRef = rexpr 300.0 end +local YO2Ref = rexpr 0.22 end +local YN2Ref = rexpr 0.78 end +local MixWRef = rexpr 1.0/([YN2Ref]/28.0134e-3 + [YO2Ref]/(2*15.999e-3)) end +local rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end +local eRef = rexpr [PRef]/[rhoRef] end +local uRef = rexpr sqrt([PRef]/[rhoRef]) end +local muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end +local lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end +local DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end __demand(__inline) task InitializeCell(Fluid : region(ispace(int3d), Fluid_columns)) @@ -91,20 +104,22 @@ where do fill(Fluid.centerCoordinates, array(0.0, 0.0, 0.0)) fill(Fluid.cellWidth, array(0.0, 0.0, 0.0)) - fill(Fluid.pressure, [P]) - fill(Fluid.temperature, [T]) + fill(Fluid.nType_x, CONST.Std_node) + fill(Fluid.nType_y, CONST.Std_node) + fill(Fluid.nType_z, CONST.Std_node) + fill(Fluid.pressure, [P]/[PRef]) + fill(Fluid.temperature, [T]/[TRef]) fill(Fluid.MassFracs, [Xi]) fill(Fluid.MolarFracs, [Xi]) - fill(Fluid.velocity, [v]) - fill(Fluid.rho, [eRho]) - fill(Fluid.mu , [eMu]) - fill(Fluid.lam, [eLam]) - fill(Fluid.Di , [eDi]) - fill(Fluid.SoS, [eSoS]) + fill(Fluid.velocity, array([v][0]/[uRef], [v][1]/[uRef], [v][2]/[uRef])) + fill(Fluid.rho, [eRho]/[rhoRef]) + fill(Fluid.mu , [eMu]/[muRef]) + fill(Fluid.lam, [eLam]/[lamRef]) + fill(Fluid.Di , array([eDi][0]/[DiRef], [eDi][1]/[DiRef], [eDi][2]/[DiRef], [eDi][3]/[DiRef], [eDi][4]/[DiRef])) + fill(Fluid.SoS, [eSoS]/[uRef]) fill(Fluid.velocityGradientX, array(0.0, 0.0, 0.0)) fill(Fluid.velocityGradientY, array(0.0, 0.0, 0.0)) fill(Fluid.velocityGradientZ, array(0.0, 0.0, 0.0)) - fill(Fluid.temperatureGradient, array(0.0, 0.0, 0.0)) fill(Fluid.Conserved, [eConserved]) end @@ -121,22 +136,40 @@ end local function checkAverages(YZAverages, XZAverages, XYAverages) return rquote regentlib.assert(YZAverages[int2d{0,0}].weight == 0.0, "averageTest: ERROR in YZAverages") + regentlib.assert(YZAverages[int2d{0,0}].pressure_avg == 0.0, "averageTest: ERROR in YZAverages (Pavg)") + regentlib.assert(YZAverages[int2d{0,0}].pressure_rms == 0.0, "averageTest: ERROR in YZAverages (Prms)") for i=1, Npx+1 do regentlib.assert(fabs(YZAverages[int2d{i,0}].weight/double(128.0) - 1.0) < 1e-9, "averageTest: ERROR in YZAverages") + regentlib.assert(fabs(YZAverages[int2d{i,0}].pressure_avg/double([P]/[PRef]*128.0) - 1.0) < 1e-9, "averageTest: ERROR in YZAverages (Pavg)") + regentlib.assert(fabs(YZAverages[int2d{i,0}].pressure_rms/double([P]/[PRef]*[P]/[PRef]*128.0) - 1.0) < 1e-9, "averageTest: ERROR in YZAverages (Prms)") end regentlib.assert(YZAverages[int2d{Npx+1,0}].weight == 0.0, "averageTest: ERROR in YZAverages") + regentlib.assert(YZAverages[int2d{Npx+1,0}].pressure_avg == 0.0, "averageTest: ERROR in YZAverages (Pavg)") + regentlib.assert(YZAverages[int2d{Npx+1,0}].pressure_rms == 0.0, "averageTest: ERROR in YZAverages (Prms)") regentlib.assert(XZAverages[int2d{0,0}].weight == 0.0, "averageTest: ERROR in XZAverages") + regentlib.assert(XZAverages[int2d{0,0}].pressure_avg == 0.0, "averageTest: ERROR in XZAverages (Pavg)") + regentlib.assert(XZAverages[int2d{0,0}].pressure_rms == 0.0, "averageTest: ERROR in XZAverages (Prms)") for i=1, Npy+1 do regentlib.assert(fabs(XZAverages[int2d{i,0}].weight/double(i*Npz) - 1.0) < 1e-9, "averageTest: ERROR in XZAverages") + regentlib.assert(fabs(XZAverages[int2d{i,0}].pressure_avg/double([P]/[PRef]*i*Npz) - 1.0) < 1e-9, "averageTest: ERROR in XZAverages (Pavg)") + regentlib.assert(fabs(XZAverages[int2d{i,0}].pressure_rms/double([P]/[PRef]*[P]/[PRef]*i*Npz) - 1.0) < 1e-9, "averageTest: ERROR in XZAverages (Prms)") end regentlib.assert(XZAverages[int2d{Npy+1,0}].weight == 0.0, "averageTest: ERROR in XZAverages") + regentlib.assert(XZAverages[int2d{Npy+1,0}].pressure_avg == 0.0, "averageTest: ERROR in XZAverages (Pavg)") + regentlib.assert(XZAverages[int2d{Npy+1,0}].pressure_rms == 0.0, "averageTest: ERROR in XZAverages (Prms)") regentlib.assert(XYAverages[int2d{0,0}].weight == 0.0, "averageTest: ERROR in XYAverages") + regentlib.assert(XYAverages[int2d{0,0}].pressure_avg == 0.0, "averageTest: ERROR in XYAverages (Pavg)") + regentlib.assert(XYAverages[int2d{0,0}].pressure_rms == 0.0, "averageTest: ERROR in XYAverages (Prms)") for i=1, Npz+1 do regentlib.assert(fabs(XYAverages[int2d{i,0}].weight/double(136.0) - 1.0) < 1e-9, "averageTest: ERROR in XYAverages") + regentlib.assert(fabs(XYAverages[int2d{i,0}].pressure_avg/double([P]/[PRef]*136.0) - 1.0) < 1e-9, "averageTest: ERROR in XYAverages (Pavg)") + regentlib.assert(fabs(XYAverages[int2d{i,0}].pressure_rms/double([P]/[PRef]*[P]/[PRef]*136.0) - 1.0) < 1e-9, "averageTest: ERROR in XYAverages (Prms)") end regentlib.assert(XYAverages[int2d{Npz+1,0}].weight == 0.0, "averageTest: ERROR in XYAverages") + regentlib.assert(XYAverages[int2d{Npz+1,0}].pressure_avg == 0.0, "averageTest: ERROR in XYAverages (Pavg)") + regentlib.assert(XYAverages[int2d{Npz+1,0}].pressure_rms == 0.0, "averageTest: ERROR in XYAverages (Prms)") end end @@ -160,13 +193,15 @@ local Grid = { numTilesOut = regentlib.newsymbol(), } +task zero() return 0.0 end + task main() -- Init config var config : Config config.Flow.initCase.type = SCHEMA.FlowInitCase_Restart format.snprint([&int8](config.Flow.initCase.u.Restart.restartDir), 256, ".") - + config.Grid.xNum = Npx config.Grid.yNum = Npy config.Grid.zNum = Npz @@ -188,7 +223,17 @@ task main() -- Init the mixture config.Flow.mixture.type = SCHEMA.MixtureModel_AirMix - var Mix = MIX.InitMixture(config) + config.Flow.mixture.u.AirMix.LRef = [LRef] + config.Flow.mixture.u.AirMix.TRef = [TRef] + config.Flow.mixture.u.AirMix.PRef = [PRef] + config.Flow.mixture.u.AirMix.XiRef.Species.length = 2 + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[0].Name), 10, "O2") + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[1].Name), 10, "N2") + config.Flow.mixture.u.AirMix.XiRef.Species.values[0].MolarFrac = [MixWRef]*[YO2Ref]/(2*15.999e-3) + config.Flow.mixture.u.AirMix.XiRef.Species.values[1].MolarFrac = [MixWRef]*[YN2Ref]/28.0134e-3 + + -- Define mixture + var Mix = MIX.InitMixtureStruct(config); -- Define the domain var [Grid.xBnum] = 1 @@ -210,6 +255,7 @@ task main() y = config.Grid.yNum + 2*Grid.yBnum, z = config.Grid.zNum + 2*Grid.zBnum}) var Fluid = region(is_Fluid, Fluid_columns); + var Fluid_bounds = Fluid.bounds -- Partitioning domain var tiles = ispace(int3d, {Grid.NX, Grid.NY, Grid.NZ}) @@ -219,24 +265,30 @@ task main() [UTIL.mkPartitionByTile(int3d, int3d, Fluid_columns, "p_All")] (Fluid, tiles, int3d{Grid.xBnum,Grid.yBnum,Grid.zBnum}, int3d{0,0,0}); - [AVG.DeclSymbols(Averages, Grid, Fluid, p_Fluid, config, MAPPER)]; + [AVG.DeclSymbols(Averages, Grid, Fluid, p_Fluid, config, MAPPER)]; InitializeCell(Fluid) InitGeometry(Fluid); + -- Initialize averages partitions + [AVG.InitPartitions(Averages, Grid, Fluid, p_Fluid, config)]; + -- Initialize averages [AVG.InitRakesAndPlanes(Averages)]; + var dt = double(0.1) + dt += zero() -- so it becomes a future + for i=0, 10 do - [AVG.AddAverages(Averages, rexpr double(0.1) end, config, Mix)]; + [AVG.AddAverages(Averages, Fluid_bounds, dt, config, Mix)]; end var SpeciesNames = MIX.GetSpeciesNames(Mix) var dirname = [&int8](C.malloc(256)) format.snprint(dirname, 256, '.'); - [AVG.WriteAverages(Averages, tiles, dirname, IO, SpeciesNames, config)]; + [AVG.WriteAverages(0, Averages, tiles, dirname, IO, SpeciesNames, config)]; [checkAverages(Averages.YZAverages, Averages.XZAverages, Averages.XYAverages)]; __fence(__execution, __block) @@ -255,4 +307,4 @@ end -- COMPILATION CALL ------------------------------------------------------------------------------- -regentlib.saveobj(main, "averageTest.o", "object") +regentlib.saveobj(main, "averageTest.o", "object", REGISTRAR.register_average_tasks) diff --git a/unitTests/cflTest/Makefile b/unitTests/cflTest/Makefile index 3e3c1cb..2d33670 100644 --- a/unitTests/cflTest/Makefile +++ b/unitTests/cflTest/Makefile @@ -1,86 +1,35 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif +####################################################### +# Include standard variables +####################################################### +include $(HTR_DIR)/Makefile.in -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif +###################################################### +# Rules +###################################################### +.PHONY: default all clean force -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src/ -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - -.PHONY: default all clean +default: cflTest.exec -MODULES= $(HTR_DIR)/src/ConstPropMix.rg \ +###################################################### +# Objects +###################################################### +MODULES= $(HTR_DIR)/src/prometeo_mixture.rg \ $(HTR_DIR)/src/prometeo_cfl.rg -default: cflTest.exec - +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o -cflTest.exec: cflTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o +cflTest.exec: cflTest.o $(HTR_DIR)/src/prometeo_ConstPropMix_cpu.a $(CXX) -o $@ $^ $(LINK_FLAGS) cflTest.o: cflTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg $(MODULES) - $(REGENT) cflTest.rg $(REGENT_FLAGS) + EOS="ConstPropMix" $(REGENT) cflTest.rg $(REGENT_FLAGS) + +$(HTR_DIR)/src/prometeo_ConstPropMix_cpu.a: force + $(MAKE) -C $(HTR_DIR)/src prometeo_ConstPropMix_cpu.a $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua make -C $(HTR_DIR)/src config_schema.o diff --git a/unitTests/cflTest/cflTest.rg b/unitTests/cflTest/cflTest.rg index 8a7a654..af0a7c5 100644 --- a/unitTests/cflTest/cflTest.rg +++ b/unitTests/cflTest/cflTest.rg @@ -5,32 +5,35 @@ import "regent" local C = regentlib.c local fabs = regentlib.fabs(double) -local SCHEMA = terralib.includec("../../src/config_schema.h") +local SCHEMA = terralib.includec("config_schema.h") +local REGISTRAR = terralib.includec("prometeo_cfl.h") local UTIL = require 'util-desugared' local Config = SCHEMA.Config -MIX = (require "ConstPropMix")(SCHEMA) -local nSpec = MIX.nSpec +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end -local struct Fluid_columns { - -- Grid point - cellWidth : double[3]; - -- Primitive variables - temperature : double; - MassFracs : double[nSpec]; - MolarFracs : double[nSpec]; - velocity : double[3]; - -- Properties - rho : double; - mu : double; - lam : double; - Di : double[nSpec]; - SoS : double; -} +local types_inc_flags = terralib.newlist({"-DEOS=ConstPropMix"}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) +local nSpec = MIX.nSpec --External modules -local CFL = (require 'prometeo_cfl')(MIX, Fluid_columns) +local CFL = (require 'prometeo_cfl')(MIX, TYPES) __demand(__inline) task InitializeCell(Fluid : region(ispace(int3d), Fluid_columns)) @@ -57,39 +60,59 @@ task main() config.Flow.mixture.u.ConstPropMix.gasConstant = 1.0 config.Flow.mixture.u.ConstPropMix.gamma = 1.4 - var Mix = MIX.InitMixture(config) + var Mix = MIX.InitMixtureStruct(config) -- Define the domain - var is_Fluid = ispace(int3d, {1, 1, 1}) + var is_Fluid = ispace(int3d, {2, 2, 2}) var Fluid = region(is_Fluid, Fluid_columns) + var tiles = ispace(int3d, {2, 2, 2}) + var p_All = partition(equal, Fluid, tiles) InitializeCell(Fluid) -- Test acustic cfl fill(Fluid.velocity, array(1.0, 1.0, 1.0)) fill(Fluid.SoS, 10.0) - var s = CFL.CalculateMaxSpectralRadius(Fluid, Fluid, Mix) + var s = 0.0 + __demand(__index_launch) + for c in tiles do + s max= CFL.CalculateMaxSpectralRadius(p_All[c], p_All[c], Mix) + end regentlib.assert(fabs(s/11.0 - 1.0) < 1e-3, "cflTest: ERROR in acustic cfl calculation") fill(Fluid.velocity, array(0.0, 0.0, 0.0)) -- Test momentum diffusion cfl fill(Fluid.mu, 10.0) - s = CFL.CalculateMaxSpectralRadius(Fluid, Fluid, Mix) + s = 0.0 + __demand(__index_launch) + for c in tiles do + s max= CFL.CalculateMaxSpectralRadius(p_All[c], p_All[c], Mix) + end regentlib.assert(fabs(s/40.0 - 1.0) < 1e-3, "cflTest: ERROR in momentum diffusion cfl calculation") fill(Fluid.mu, 0.0) -- Test energy diffusion cfl fill(Fluid.lam, 10.0) - s = CFL.CalculateMaxSpectralRadius(Fluid, Fluid, Mix) + s = 0.0 + __demand(__index_launch) + for c in tiles do + s max= CFL.CalculateMaxSpectralRadius(p_All[c], p_All[c], Mix) + end regentlib.assert(fabs(s/11.42857 - 1.0) < 1e-3, "cflTest: ERROR in energy diffusion cfl calculation") fill(Fluid.lam, 0.0) -- Test species diffusion cfl fill(Fluid.Di, [UTIL.mkArrayConstant(nSpec, rexpr 10.0 end)]) - s = CFL.CalculateMaxSpectralRadius(Fluid, Fluid, Mix) + s = 0.0 + __demand(__index_launch) + for c in tiles do + s max= CFL.CalculateMaxSpectralRadius(p_All[c], p_All[c], Mix) + end regentlib.assert(fabs(s/40.0 - 1.0) < 1e-3, "cflTest: ERROR in species diffusion cfl calculation") fill(Fluid.Di, [UTIL.mkArrayConstant(nSpec, rexpr 0.0 end)]) + -- TODO: Test ion drift cfl condition + __fence(__execution, __block) C.printf("cflTest: TEST OK!\n") @@ -99,4 +122,4 @@ end -- COMPILATION CALL ------------------------------------------------------------------------------- -regentlib.saveobj(main, "cflTest.o", "object") +regentlib.saveobj(main, "cflTest.o", "object", REGISTRAR.register_cfl_tasks) diff --git a/unitTests/chemTest/Makefile b/unitTests/chemTest/Makefile index ad227d4..8091c26 100644 --- a/unitTests/chemTest/Makefile +++ b/unitTests/chemTest/Makefile @@ -1,93 +1,42 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif +####################################################### +# Include standard variables +####################################################### +include $(HTR_DIR)/Makefile.in -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif +###################################################### +# Rules +###################################################### +.PHONY: default all clean force -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src/ -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - -.PHONY: default all clean +default: chemTest.exec -MODULES= $(HTR_DIR)/src/AirMix.rg \ +###################################################### +# Objects +###################################################### +MODULES= $(HTR_DIR)/src/prometeo_mixture.rg \ $(HTR_DIR)/src/prometeo_chem.rg -default: chemTest.exec - +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o -chemTest.exec: chemTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o +chemTest.exec: chemTest.o $(HTR_DIR)/src/prometeo_AirMix_cpu.a $(CXX) -o $@ $^ $(LINK_FLAGS) chemTest.o: chemTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg $(MODULES) - $(REGENT) chemTest.rg $(REGENT_FLAGS) + EOS="AirMix" $(REGENT) chemTest.rg $(REGENT_FLAGS) + +$(HTR_DIR)/src/prometeo_AirMix_cpu.a: force + $(MAKE) -C $(HTR_DIR)/src prometeo_AirMix_cpu.a $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua - make -C $(HTR_DIR)/src config_schema.o + $(MAKE) -C $(HTR_DIR)/src config_schema.o json.o json.h: $(HTR_DIR)/src/json.c $(HTR_DIR)/src/json.h - make -C $(HTR_DIR)/src json.o + $(MAKE) -C $(HTR_DIR)/src json.o $(HTR_DIR)/src/util-desugared.rg: $(HTR_DIR)/src/util.rg - make -C $(HTR_DIR)/src util-desugared.rg + $(MAKE) -C $(HTR_DIR)/src util-desugared.rg diff --git a/unitTests/chemTest/chemTest.rg b/unitTests/chemTest/chemTest.rg index 6d13f58..8665060 100644 --- a/unitTests/chemTest/chemTest.rg +++ b/unitTests/chemTest/chemTest.rg @@ -5,32 +5,41 @@ import "regent" local C = regentlib.c local fabs = regentlib.fabs(double) +local sqrt = regentlib.sqrt(double) +--local format = require("std/format") local SCHEMA = terralib.includec("../../src/config_schema.h") +local REGISTRAR = terralib.includec("prometeo_chem.h") local UTIL = require 'util-desugared' local Config = SCHEMA.Config -MIX = (require "AirMix")(SCHEMA) +local CONST = require "prometeo_const" +local MACRO = require "prometeo_macro" + +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS=AirMix"}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) local nSpec = MIX.nSpec -local nEq = nSpec+4 - -local struct Fluid_columns { - -- Primitive variables - pressure : double; - temperature : double; - MassFracs : double[nSpec]; - MolarFracs : double[nSpec]; - velocity : double[3]; - -- Properties - rho : double; - -- Conserved varaibles - Conserved : double[nEq]; - Conserved_t : double[nEq]; - Conserved_t_old : double[nEq]; -} +local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver --External modules -local CHEM = (require 'prometeo_chem')(SCHEMA,MIX, Fluid_columns, true) +local CHEM = (require 'prometeo_chem')(SCHEMA, MIX, TYPES, true) local R = rexpr 8.3144598 end local P = rexpr 101325.0 end @@ -39,17 +48,27 @@ local Yi = rexpr array(0.78, 0.22, 1.0e-60, 1.0e-60, 1.0e-60) end local Eprod = rexpr array(-1.658328e-01,-1.445940e+03, 1.332770e-54, 1.658328e-01, 1.445940e+03, 0.0, 0.0, 0.0, 0.0) end local Cres = rexpr array( 5.460212e-02, 1.296359e-02, 2.994386e-04, 1.502734e-05, 2.321006e-03, 0.0, 0.0, 0.0, 3.141423e+05) end +local LRef = rexpr 1.0 end +local TRef = rexpr 300.0 end +local PRef = rexpr 101325.0 end +local YO2Ref = rexpr 0.22 end +local YN2Ref = rexpr 0.78 end +local MixWRef = rexpr 1.0/([YN2Ref]/28.0134e-3 + [YO2Ref]/(2*15.999e-3)) end +local rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end +local eRef = rexpr [PRef]/[rhoRef] end +local wiRef = rexpr sqrt([PRef]*[rhoRef])/[LRef] end + __demand(__inline) -task InitializeCell(Fluid : region(ispace(int3d), Fluid_columns), Mix : MIX.Mixture) +task InitializeCell(Fluid : region(ispace(int3d), TYPES.Fluid_columns), Mix : MIX.Mixture) where writes(Fluid) do var MixW = MIX.GetMolarWeightFromYi([Yi], Mix) - var Xi = MIX.GetMolarFractions(MixW, [Yi], Mix) - var e = MIX.GetInternalEnergy([T], [Yi], Mix) - var rho = MIX.GetRho([P], [T], MixW, Mix) - fill(Fluid.pressure, [P]) - fill(Fluid.temperature, [T]) + var Xi : double[nSpec]; MIX.GetMolarFractions(&Xi[0], MixW, [Yi], Mix) + var e = MIX.GetInternalEnergy([T]/[TRef], [Yi], Mix) + var rho = MIX.GetRho([P]/[PRef], [T]/[TRef], MixW, Mix) + fill(Fluid.pressure, [P]/[PRef]) + fill(Fluid.temperature, [T]/[TRef]) fill(Fluid.MassFracs, [Yi]) fill(Fluid.MolarFracs, Xi) fill(Fluid.velocity, array(0.0, 0.0, 0.0)) @@ -67,34 +86,60 @@ do fill(Fluid.Conserved_t_old, [UTIL.mkArrayConstant(nEq, rexpr 0.0 end)]) end +task zero() return 0.0 end + task main() -- Init the mixture var config : Config config.Flow.mixture.type = SCHEMA.MixtureModel_AirMix - var Mix = MIX.InitMixture(config) + config.Flow.mixture.u.AirMix.LRef = [LRef] + config.Flow.mixture.u.AirMix.TRef = [TRef] + config.Flow.mixture.u.AirMix.PRef = [PRef] + config.Flow.mixture.u.AirMix.XiRef.Species.length = 2 + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[0].Name), 10, "O2") + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[1].Name), 10, "N2") + config.Flow.mixture.u.AirMix.XiRef.Species.values[0].MolarFrac = [MixWRef]*[YO2Ref]/(2*15.999e-3) + config.Flow.mixture.u.AirMix.XiRef.Species.values[1].MolarFrac = [MixWRef]*[YN2Ref]/28.0134e-3 + var Mix = MIX.InitMixtureStruct(config) -- Define the domain - var is_Fluid = ispace(int3d, {1, 1, 1}) - var Fluid = region(is_Fluid, Fluid_columns) + var is_Fluid = ispace(int3d, {2, 2, 2}) + var Fluid = region(is_Fluid, TYPES.Fluid_columns) + var tiles = ispace(int3d, {2, 2, 2}) + var p_All = partition(equal, Fluid, tiles) InitializeCell(Fluid, Mix) -- Test explicit chem advancing - CHEM.AddChemistrySources(Fluid, Fluid, Mix) + __demand(__index_launch) + for c in tiles do + CHEM.AddChemistrySources(p_All[c], p_All[c], Mix) + end for c in Fluid do for i = 0, nEq do - var err = Fluid[c].Conserved_t[i] - [Eprod][i] + var err = Fluid[c].Conserved_t[i]*[wiRef] - [Eprod][i] if ( [Eprod][i] ~= 0) then err /= [Eprod][i] end regentlib.assert(fabs(err) < 1e-5, "chemTest: ERROR in explicit chem advancing") end end + var dt = 1e-6*sqrt([PRef]/[rhoRef])/[LRef] + dt += zero() -- so it becomes a future + -- Test implicit chem advancing - CHEM.UpdateChemistry(Fluid, Fluid, 1e-6, Mix) + __demand(__index_launch) + for c in tiles do + CHEM.UpdateChemistry(p_All[c], p_All[c], dt, Mix) + end for c in Fluid do for i = 0, nEq do - var err = Fluid[c].Conserved[i] - [Cres][i] + var err : double + if i == (nEq-1) then + err = Fluid[c].Conserved[i]*[rhoRef]*[eRef] - [Cres][i] + else + err = Fluid[c].Conserved[i]*[rhoRef] - [Cres][i] + end if ([Cres][i] ~= 0) then err /= [Cres][i] end regentlib.assert(fabs(err) < 1e-5, "chemTest: ERROR in implicit chem advancing") end @@ -109,4 +154,4 @@ end -- COMPILATION CALL ------------------------------------------------------------------------------- -regentlib.saveobj(main, "chemTest.o", "object") +regentlib.saveobj(main, "chemTest.o", "object", REGISTRAR.register_chem_tasks) diff --git a/unitTests/configTest/Makefile b/unitTests/configTest/Makefile index a7ee6f8..e5218d4 100644 --- a/unitTests/configTest/Makefile +++ b/unitTests/configTest/Makefile @@ -32,7 +32,7 @@ ifdef HDF_ROOT export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib endif REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 +REGENT_FLAGS := -fflow 0 -finner 1 -foffline 1 ifeq ($(DEBUG), 1) REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 CFLAGS += -g @@ -40,7 +40,7 @@ ifeq ($(DEBUG), 1) LINK_FLAGS += -g else ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 + REGENT_FLAGS += -fcuda 1 NVCC ?= $(CUDA_HOME)/bin/nvcc NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent else diff --git a/unitTests/configTest/configTest.rg b/unitTests/configTest/configTest.rg index d34e01b..87db216 100644 --- a/unitTests/configTest/configTest.rg +++ b/unitTests/configTest/configTest.rg @@ -52,8 +52,8 @@ task check(config : Config) regentlib.assert(config.Integrator.maxTime == 20.0, "configTest: ERROR on config.Integrator.maxTime") regentlib.assert(config.Integrator.cfl == 0.9, "configTest: ERROR on config.Integrator.cfl") regentlib.assert(config.Integrator.fixedDeltaTime == 4.0e-3, "configTest: ERROR on config.Integrator.fixedDeltaTime") - regentlib.assert(config.Integrator.hybridScheme == true, "configTest: ERROR on config.Integrator.hybridScheme") - regentlib.assert(config.Integrator.vorticityScale == 1.0, "configTest: ERROR on config.Integrator.vorticityScale") + regentlib.assert(config.Integrator.EulerScheme.type == SCHEMA.EulerSchemes_SkewSymmetric, + "configTest: ERROR on config.Integrator.EulerScheme.type") -- Flow section regentlib.assert(config.Flow.mixture.type == SCHEMA.MixtureModel_ConstPropMix, "configTest: ERROR on config.Flow.mixture.type") regentlib.assert(config.Flow.mixture.u.ConstPropMix.gasConstant == 287.15, "configTest: ERROR on config.Flow.mixture.gasConstant") @@ -83,6 +83,8 @@ task check(config : Config) regentlib.assert(config.IO.restartEveryTimeSteps == 10000, "configTest: ERROR on config.IO.restartEveryTimeSteps") regentlib.assert(config.IO.probesSamplingInterval == 1, "configTest: ERROR on config.IO.probesSamplingInterval") regentlib.assert(config.IO.AveragesSamplingInterval == 10, "configTest: ERROR on config.IO.AveragesSamplingInterval") + -- Efield section + regentlib.assert(config.Efield.type == SCHEMA.EFieldStruct_Off, "configTest: ERROR on config.Efield.type") return 1 end diff --git a/unitTests/configTest/test.json b/unitTests/configTest/test.json index d5049c6..f83c6f2 100644 --- a/unitTests/configTest/test.json +++ b/unitTests/configTest/test.json @@ -32,8 +32,7 @@ "cfl" : 0.9, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { "type" : "SkewSymmetric" } }, "BC" : { @@ -121,5 +120,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/unitTests/geometryTest/Makefile b/unitTests/geometryTest/Makefile index 608281e..328a5e5 100644 --- a/unitTests/geometryTest/Makefile +++ b/unitTests/geometryTest/Makefile @@ -1,90 +1,39 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif +####################################################### +# Include standard variables +####################################################### +include $(HTR_DIR)/Makefile.in -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif +###################################################### +# Rules +###################################################### +.PHONY: default all clean force -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - -.PHONY: default all clean +default: geometryTest.exec +###################################################### +# Objects +###################################################### MODULES= $(HTR_DIR)/src/prometeo_const.rg \ $(HTR_DIR)/src/prometeo_macro.rg \ $(HTR_DIR)/src/prometeo_metric.rg \ $(HTR_DIR)/src/prometeo_partitioner.rg \ $(HTR_DIR)/src/prometeo_grid.rg -default: geometryTest.exec - +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o -geometryTest.exec: geometryTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o +geometryTest.exec: geometryTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o $(HTR_DIR)/src/prometeo_metric_coeffs_cpu.o $(CXX) -o $@ $^ $(LINK_FLAGS) geometryTest.o: geometryTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg $(MODULES) EOS=ConstPropMix $(REGENT) geometryTest.rg $(REGENT_FLAGS) +$(HTR_DIR)/src/prometeo_metric_coeffs_cpu.o: force + $(MAKE) -C $(HTR_DIR)/src prometeo_metric_coeffs_cpu.o + $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua make -C $(HTR_DIR)/src config_schema.o diff --git a/unitTests/geometryTest/geometryTest.rg b/unitTests/geometryTest/geometryTest.rg index 192542c..012d18e 100644 --- a/unitTests/geometryTest/geometryTest.rg +++ b/unitTests/geometryTest/geometryTest.rg @@ -11,12 +11,28 @@ local UTIL = require 'util-desugared' local Config = SCHEMA.Config -local TYPES = terralib.includec("prometeo_types.h", {"-DEOS="..os.getenv("EOS")}) +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) local Fluid_columns = TYPES.Fluid_columns --External modules local MACRO = require "prometeo_macro" -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) local PART = (require 'prometeo_partitioner')(SCHEMA, METRIC, Fluid_columns) local GRID = (require 'prometeo_grid')(SCHEMA, Fluid_columns, PART.zones_partitions) diff --git a/unitTests/hdfTest/Makefile b/unitTests/hdfTest/Makefile index 53e14f0..8bc04a3 100644 --- a/unitTests/hdfTest/Makefile +++ b/unitTests/hdfTest/Makefile @@ -1,75 +1,18 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif - -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif - -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := . -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - +###################################################### +# Include standard variables +###################################################### +include $(HTR_DIR)/Makefile.in + +###################################################### +# Rules +###################################################### .PHONY: default all clean default: hdfTest.exec +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o *.hdf diff --git a/unitTests/hdfTest/hdfTest.rg b/unitTests/hdfTest/hdfTest.rg index d5363d1..de2aa0f 100644 --- a/unitTests/hdfTest/hdfTest.rg +++ b/unitTests/hdfTest/hdfTest.rg @@ -57,10 +57,10 @@ where reads(r1.[IOVars]) do for c in r0 do - regentlib.assert(r0[c].a == r1[c].a, "mathUtilsTest: ERROR on region") - regentlib.assert(r0[c].b[0] == r1[c].b[0], "mathUtilsTest: ERROR on region") - regentlib.assert(r0[c].b[1] == r1[c].b[1], "mathUtilsTest: ERROR on region") - regentlib.assert(r0[c].b[2] == r1[c].b[2], "mathUtilsTest: ERROR on region") + regentlib.assert(r0[c].a == r1[c].a, "hdfTest: ERROR on region") + regentlib.assert(r0[c].b[0] == r1[c].b[0], "hdfTest: ERROR on region") + regentlib.assert(r0[c].b[1] == r1[c].b[1], "hdfTest: ERROR on region") + regentlib.assert(r0[c].b[2] == r1[c].b[2], "hdfTest: ERROR on region") end end @@ -104,8 +104,8 @@ task main() simTime = HDF.read.simTime( 0, tiles, dirname, r1, p_r1) HDF.load(0, tiles, dirname, r1, r1_copy, p_r1, p_r1_copy) - regentlib.assert(timeStep == 12345, "mathUtilsTest: ERROR on timeStep") - regentlib.assert(simTime == 123.4567, "mathUtilsTest: ERROR on simTime") + regentlib.assert(timeStep == 12345, "hdfTest: ERROR on timeStep") + regentlib.assert(simTime == 123.4567, "hdfTest: ERROR on simTime") check(r0, r1) __fence(__execution, __block) diff --git a/unitTests/mathUtilsTest/CPPmathUtilsTest.cc b/unitTests/mathUtilsTest/CPPmathUtilsTest.cc new file mode 100644 index 0000000..b91def3 --- /dev/null +++ b/unitTests/mathUtilsTest/CPPmathUtilsTest.cc @@ -0,0 +1,67 @@ + +#include +#include +#include +#include "math_utils.hpp" + +void testLUdec() { + MyMatrix A; + A(0, 0) = 4.0; + A(0, 1) = 3.0; + A(0, 2) = 0.0; + A(1, 0) = 3.0; + A(1, 1) = 4.0; + A(1, 2) =-1.0; + A(2, 0) = 0.0; + A(2, 1) =-1.0; + A(2, 2) = 4.0; + LUdec<3> LU; + LU.ludcmp(A); + + MyArray b; + b[0] = 24.0; + b[1] = 30.0; + b[2] =-24.0; + LU.lubksb(b); + + assert(fabs(b[0] - 3.0) < 1e-12); + assert(fabs(b[1] - 4.0) < 1e-12); + assert(fabs(b[2] + 5.0) < 1e-12); +} + +// My implicit problem +class myProb : public Rosenbrock<3> { + inline void rhs(MyArray &r, const MyArray &x) { + r[0] = -0.013* x[0] - 1000.0*x[0]*x[2]; + r[1] = -2500.0*x[1]*x[2]; + r[2] = -0.013* x[0] - 1000.0*x[0]*x[2] - 2500.0*x[1]*x[2]; + }; +}; + +void testRosenbrock() { + myProb *p = new myProb; + MyArray x; + x[0] = 1.0; + x[1] = 1.0; + x[2] = 0.0; + + p->solve(x, 1.0e-3, 25.0); + + assert(fabs(1.0 - (x[0]/( 7.818640e-01))) < 1e-6); + assert(fabs(1.0 - (x[1]/( 1.218133e+00))) < 1e-6); + assert(fabs(1.0 - (x[2]/(-2.655799e-06))) < 1e-6); + + delete p; +} + +int main() { + + // LU decomposition + testLUdec(); + + // Rosenbrock implicit solver + testRosenbrock(); + + std::cout << "CPPmathUtilsTest: TEST OK!" << std::endl; + return 0; +} diff --git a/unitTests/mathUtilsTest/Makefile b/unitTests/mathUtilsTest/Makefile index de82444..8151666 100644 --- a/unitTests/mathUtilsTest/Makefile +++ b/unitTests/mathUtilsTest/Makefile @@ -1,80 +1,26 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif - -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif - -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := . -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -fbounds-checks 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - +####################################################### +# Include standard variables +####################################################### +include $(HTR_DIR)/Makefile.in + +###################################################### +# Rules +###################################################### .PHONY: default all clean -default: mathUtilsTest.exec +default: mathUtilsTest.exec CPPmathUtilsTest.exec +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o mathUtilsTest.exec: mathUtilsTest.o $(CXX) -o $@ $^ $(LINK_FLAGS) -mathUtilsTest.o: mathUtilsTest.rg $(HTR_DIR)/src/math_utils.rg +mathUtilsTest.o: mathUtilsTest.rg $(HTR_DIR)/src/Utils/math_utils.rg $(HTR_DIR)/src/Utils/math_utils.h $(REGENT) mathUtilsTest.rg $(REGENT_FLAGS) + +CPPmathUtilsTest.exec: CPPmathUtilsTest.cc $(HTR_DIR)/src/Utils/math_utils.hpp $(HTR_DIR)/src/Utils/math_utils.h + $(CXX) $(CXX_FLAGS) -o $@ $< diff --git a/unitTests/mathUtilsTest/test.py b/unitTests/mathUtilsTest/test.py index d535f1c..54aa074 100644 --- a/unitTests/mathUtilsTest/test.py +++ b/unitTests/mathUtilsTest/test.py @@ -5,8 +5,9 @@ import subprocess import testAll -class unitTest(unittest.TestCase, testAll.TestBase): +class unitTest(unittest.TestCase, testAll.MultiTestBase): name = "mathUtilsTest" + tests = ["mathUtilsTest", "CPPmathUtilsTest"] if __name__ == "__main__": unittest.main() diff --git a/unitTests/metricTest/Makefile b/unitTests/metricTest/Makefile index a925f68..ebbf63d 100644 --- a/unitTests/metricTest/Makefile +++ b/unitTests/metricTest/Makefile @@ -1,88 +1,33 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif - -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif - -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 #-fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - +###################################################### +# Include standard variables +###################################################### +include $(HTR_DIR)/Makefile.in + +###################################################### +# Rules +###################################################### .PHONY: default all clean force +default: operatorsTest_Periodic.exec operatorsTest_Staggered.exec operatorsTest_Collocated.exec \ + metricTest_Periodic.exec metricTest_Collocated.exec metricTest_Staggered.exec + +###################################################### +# Objects +###################################################### MODULES= $(HTR_DIR)/src/prometeo_const.rg \ $(HTR_DIR)/src/prometeo_macro.rg \ $(HTR_DIR)/src/prometeo_partitioner.rg \ $(HTR_DIR)/src/prometeo_grid.rg \ $(HTR_DIR)/src/prometeo_metric.rg -default: operatorsTest_Periodic.exec operatorsTest_Staggered.exec operatorsTest_Collocated.exec \ - metricTest_Periodic.exec metricTest_Collocated.exec metricTest_Staggered.exec - +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o operatorsTest_%.exec: operatorsTest_%.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o \ - $(HTR_DIR)/src/prometeo_metric_ConstPropMix_cpu.o \ - $(if $(filter $(strip $(USE_CUDA)), 1), $(HTR_DIR)/src/prometeo_metric_ConstPropMix_cpu.o) + $(HTR_DIR)/src/prometeo_metric_ConstPropMix_cpu.o $(HTR_DIR)/src/prometeo_metric_coeffs_cpu.o $(CXX) -o $@ $^ $(LINK_FLAGS) operatorsTest_%.o: operatorsTest_%.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg \ @@ -90,8 +35,7 @@ operatorsTest_%.o: operatorsTest_%.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/ EOS="ConstPropMix" $(REGENT) $^ $(REGENT_FLAGS) metricTest_%.exec: metricTest_%.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o \ - $(HTR_DIR)/src/prometeo_metric_ConstPropMix_cpu.o \ - $(if $(filter $(strip $(USE_CUDA)), 1), $(HTR_DIR)/src/prometeo_metric_ConstPropMix_cpu.o) + $(HTR_DIR)/src/prometeo_metric_ConstPropMix_cpu.o $(HTR_DIR)/src/prometeo_metric_coeffs_cpu.o $(CXX) -o $@ $^ $(LINK_FLAGS) metricTest_%.o: metricTest_%.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg \ @@ -101,6 +45,9 @@ metricTest_%.o: metricTest_%.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/ut $(HTR_DIR)/src/prometeo_metric_ConstPropMix_cpu.o: force $(MAKE) -C $(HTR_DIR)/src prometeo_metric_ConstPropMix_cpu.o +$(HTR_DIR)/src/prometeo_metric_coeffs_cpu.o: force + $(MAKE) -C $(HTR_DIR)/src prometeo_metric_coeffs_cpu.o + $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua $(MAKE) -C $(HTR_DIR)/src config_schema.o diff --git a/unitTests/metricTest/metricTest_Collocated.rg b/unitTests/metricTest/metricTest_Collocated.rg index c3a5942..ae0dfbc 100644 --- a/unitTests/metricTest/metricTest_Collocated.rg +++ b/unitTests/metricTest/metricTest_Collocated.rg @@ -19,12 +19,28 @@ local Ref_e = terralib.global(`arrayof(double, [r_e])) local Ref_d = terralib.global(`arrayof(double, [r_d])) local Ref_s = terralib.global(`arrayof(double, [r_s])) -local TYPES = terralib.includec("prometeo_types.h", {"-DEOS="..os.getenv("EOS")}) +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) local Fluid_columns = TYPES.Fluid_columns --External modules local MACRO = require "prometeo_macro" -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) local PART = (require 'prometeo_partitioner')(SCHEMA, METRIC, Fluid_columns) local GRID = (require 'prometeo_grid')(SCHEMA, Fluid_columns, PART.zones_partitions) @@ -135,7 +151,7 @@ task main() -- Create partitions to support stencils var Fluid_Ghosts = PART.PartitionGhost(Fluid, tiles, Fluid_Zones) - var {p_MetricGhosts, p_MetricGhostsX, p_MetricGhostsY, p_MetricGhostsZ} = Fluid_Ghosts + var {p_MetricGhosts} = Fluid_Ghosts __demand(__index_launch) for c in tiles do @@ -153,9 +169,6 @@ task main() __demand(__index_launch) for c in tiles do METRIC.InitializeMetric(p_MetricGhosts[c], - p_MetricGhostsX[c], - p_MetricGhostsY[c], - p_MetricGhostsZ[c], p_All[c], Fluid_bounds, xW, yW, zW); diff --git a/unitTests/metricTest/metricTest_Periodic.rg b/unitTests/metricTest/metricTest_Periodic.rg index 7b51d24..560a3a3 100644 --- a/unitTests/metricTest/metricTest_Periodic.rg +++ b/unitTests/metricTest/metricTest_Periodic.rg @@ -19,12 +19,28 @@ local Ref_e = terralib.global(`arrayof(double, [r_e])) local Ref_d = terralib.global(`arrayof(double, [r_d])) local Ref_s = terralib.global(`arrayof(double, [r_s])) -local TYPES = terralib.includec("prometeo_types.h", {"-DEOS="..os.getenv("EOS")}) +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) local Fluid_columns = TYPES.Fluid_columns --External modules local MACRO = require "prometeo_macro" -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) local PART = (require 'prometeo_partitioner')(SCHEMA, METRIC, Fluid_columns) local GRID = (require 'prometeo_grid')(SCHEMA, Fluid_columns, PART.zones_partitions) @@ -133,14 +149,11 @@ task main() -- Create partitions to support stencils var Fluid_Ghosts = PART.PartitionGhost(Fluid, tiles, Fluid_Zones) - var {p_MetricGhosts, p_MetricGhostsX, p_MetricGhostsY, p_MetricGhostsZ} = Fluid_Ghosts + var {p_MetricGhosts} = Fluid_Ghosts __demand(__index_launch) for c in tiles do METRIC.InitializeMetric(p_MetricGhosts[c], - p_MetricGhostsX[c], - p_MetricGhostsY[c], - p_MetricGhostsZ[c], p_All[c], Fluid_bounds, xW, yW, zW) diff --git a/unitTests/metricTest/metricTest_Staggered.rg b/unitTests/metricTest/metricTest_Staggered.rg index 5339ddb..4ad1cd7 100644 --- a/unitTests/metricTest/metricTest_Staggered.rg +++ b/unitTests/metricTest/metricTest_Staggered.rg @@ -19,12 +19,28 @@ local Ref_e = terralib.global(`arrayof(double, [r_e])) local Ref_d = terralib.global(`arrayof(double, [r_d])) local Ref_s = terralib.global(`arrayof(double, [r_s])) -local TYPES = terralib.includec("prometeo_types.h", {"-DEOS="..os.getenv("EOS")}) +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) local Fluid_columns = TYPES.Fluid_columns --External modules local MACRO = require "prometeo_macro" -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) local PART = (require 'prometeo_partitioner')(SCHEMA, METRIC, Fluid_columns) local GRID = (require 'prometeo_grid')(SCHEMA, Fluid_columns, PART.zones_partitions) @@ -146,7 +162,7 @@ task main() -- Create partitions to support stencils var Fluid_Ghosts = PART.PartitionGhost(Fluid, tiles, Fluid_Zones) - var {p_MetricGhosts, p_MetricGhostsX, p_MetricGhostsY, p_MetricGhostsZ} = Fluid_Ghosts + var {p_MetricGhosts} = Fluid_Ghosts -- Enforce BCs GRID.InitializeGhostGeometry(Fluid, tiles, Fluid_Zones, config) @@ -154,9 +170,6 @@ task main() __demand(__index_launch) for c in tiles do METRIC.InitializeMetric(p_MetricGhosts[c], - p_MetricGhostsX[c], - p_MetricGhostsY[c], - p_MetricGhostsZ[c], p_All[c], Fluid_bounds, xW, yW, zW); diff --git a/unitTests/metricTest/operatorsTest_Collocated.rg b/unitTests/metricTest/operatorsTest_Collocated.rg index 5b72aa4..4a92d42 100644 --- a/unitTests/metricTest/operatorsTest_Collocated.rg +++ b/unitTests/metricTest/operatorsTest_Collocated.rg @@ -25,31 +25,28 @@ local Stencil3 = CONST.Stencil3 local Stencil4 = CONST.Stencil4 local nStencils = CONST.nStencils -local struct Fluid_columns { - -- Grid point - centerCoordinates : double[3]; - cellWidth : double[3]; - -- Node types - nType_x : int; - nType_y : int; - nType_z : int; - -- Cell-center metrics for Euler fluxes - dcsi_e : double; - deta_e : double; - dzet_e : double; - -- Cell-center metrics for diffusion fluxes - dcsi_d : double; - deta_d : double; - dzet_d : double; - -- Staggered metrics - dcsi_s : double; - deta_s : double; - dzet_s : double; -} +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns --External modules local MACRO = require "prometeo_macro" -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) -- Test parameters local Npx = 32 diff --git a/unitTests/metricTest/operatorsTest_Periodic.rg b/unitTests/metricTest/operatorsTest_Periodic.rg index e69a838..3790970 100644 --- a/unitTests/metricTest/operatorsTest_Periodic.rg +++ b/unitTests/metricTest/operatorsTest_Periodic.rg @@ -20,31 +20,28 @@ local Stencil3 = CONST.Stencil3 local Stencil4 = CONST.Stencil4 local nStencils = CONST.nStencils -local struct Fluid_columns { - -- Grid point - centerCoordinates : double[3]; - cellWidth : double[3]; - -- Node types - nType_x : int; - nType_y : int; - nType_z : int; - -- Cell-center metrics for Euler fluxes - dcsi_e : double; - deta_e : double; - dzet_e : double; - -- Cell-center metrics for diffusion fluxes - dcsi_d : double; - deta_d : double; - dzet_d : double; - -- Staggered metrics - dcsi_s : double; - deta_s : double; - dzet_s : double; -} +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns --External modules local MACRO = require "prometeo_macro" -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) -- Test parameters local Npx = 32 diff --git a/unitTests/metricTest/operatorsTest_Staggered.rg b/unitTests/metricTest/operatorsTest_Staggered.rg index 2e3d1e6..eb51530 100644 --- a/unitTests/metricTest/operatorsTest_Staggered.rg +++ b/unitTests/metricTest/operatorsTest_Staggered.rg @@ -27,31 +27,28 @@ local Stencil3 = CONST.Stencil3 local Stencil4 = CONST.Stencil4 local nStencils = CONST.nStencils -local struct Fluid_columns { - -- Grid point - centerCoordinates : double[3]; - cellWidth : double[3]; - -- Node types - nType_x : int; - nType_y : int; - nType_z : int; - -- Cell-center metrics for Euler fluxes - dcsi_e : double; - deta_e : double; - dzet_e : double; - -- Cell-center metrics for diffusion fluxes - dcsi_d : double; - deta_d : double; - dzet_d : double; - -- Staggered metrics - dcsi_s : double; - deta_s : double; - dzet_s : double; -} +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns --External modules local MACRO = require "prometeo_macro" -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) -- Test parameters local Npx = 32 diff --git a/unitTests/mixTest/AirMix.json b/unitTests/mixTest/AirMix.json index 2cff231..e961984 100644 --- a/unitTests/mixTest/AirMix.json +++ b/unitTests/mixTest/AirMix.json @@ -32,8 +32,7 @@ "cfl" : 0.9, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { "type" : "SkewSymmetric" } }, "BC" : { @@ -47,7 +46,14 @@ "Flow" : { "mixture": { - "type" : "AirMix" + "type" : "AirMix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 1.01325e5, + "XiRef" : { + "Species" : [{"Name" : "N2", "MolarFrac" : 0.78 }, + {"Name" : "O2", "MolarFrac" : 0.22 }] + } }, "initCase" : { "type" : "Uniform", @@ -85,5 +91,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/unitTests/mixTest/BoivinMix.json b/unitTests/mixTest/BoivinMix.json new file mode 100644 index 0000000..c4a08b0 --- /dev/null +++ b/unitTests/mixTest/BoivinMix.json @@ -0,0 +1,96 @@ +{ + "Mapping" : { + "tiles" : [1,2,3], + "tilesPerRank" : [1,2,3], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 10000 + }, + + "Grid" : { + "xNum" : 400, + "yNum" : 100, + "zNum" : 1, + "origin" : [0.0, 4.0, 8.0], + "xWidth" : 1.0, + "yWidth" : 0.5, + "zWidth" : 0.1, + "xType" : "TanhMinus", + "yType" : "TanhMinus", + "zType" : "Uniform", + "xStretching" : 0.9, + "yStretching" : 0.9, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 200000, + "maxTime" : 20.0, + "cfl" : 0.9, + "fixedDeltaTime" : 4.0e-3, + "implicitChemistry" : false, + "EulerScheme" : { "type" : "SkewSymmetric" } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { "type" : "Periodic" }, + "yBCRight" : { "type" : "Periodic" }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture": { + "type" : "BoivinMix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 1.01325e5, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 1.0 }] + } + }, + "initCase" : { + "type" : "Uniform", + "pressure" : 1.01325e5, + "temperature" : 300.0, + "velocity" : [10.0, 20.0, 30.0], + "molarFracs" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + }, + "bodyForce" : [1.0, 2.0, 3.0], + "turbForcing" : { + "type" : "CHANNEL", + "Forcing" : 1000.0, + "RhoUbulk" : 20.0 + + } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 10000, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [] + }, + + "Efield" : { "type" : "Off" } +} diff --git a/unitTests/mixTest/CH41StMix.json b/unitTests/mixTest/CH41StMix.json index cf21d36..bdc28a1 100644 --- a/unitTests/mixTest/CH41StMix.json +++ b/unitTests/mixTest/CH41StMix.json @@ -32,8 +32,7 @@ "cfl" : 0.9, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { "type" : "SkewSymmetric" } }, "BC" : { @@ -46,7 +45,15 @@ }, "Flow" : { - "mixture": { "type" : "CH41StMix" }, + "mixture": { + "type" : "CH41StMix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 1.01325e5, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 1.0 }] + } + }, "initCase" : { "type" : "Uniform", "pressure" : 1.01325e5, @@ -83,5 +90,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/unitTests/mixTest/CH4_30SpMix.json b/unitTests/mixTest/CH4_30SpMix.json new file mode 100644 index 0000000..c280bc0 --- /dev/null +++ b/unitTests/mixTest/CH4_30SpMix.json @@ -0,0 +1,96 @@ +{ + "Mapping" : { + "tiles" : [1,2,3], + "tilesPerRank" : [1,2,3], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 10000 + }, + + "Grid" : { + "xNum" : 400, + "yNum" : 100, + "zNum" : 1, + "origin" : [0.0, 4.0, 8.0], + "xWidth" : 1.0, + "yWidth" : 0.5, + "zWidth" : 0.1, + "xType" : "TanhMinus", + "yType" : "TanhMinus", + "zType" : "Uniform", + "xStretching" : 0.9, + "yStretching" : 0.9, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 200000, + "maxTime" : 20.0, + "cfl" : 0.9, + "fixedDeltaTime" : 4.0e-3, + "implicitChemistry" : false, + "EulerScheme" : { "type" : "SkewSymmetric" } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { "type" : "Periodic" }, + "yBCRight" : { "type" : "Periodic" }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture": { + "type" : "CH4_30SpMix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 1.01325e5, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 1.0 }] + } + }, + "initCase" : { + "type" : "Uniform", + "pressure" : 1.01325e5, + "temperature" : 300.0, + "velocity" : [10.0, 20.0, 30.0], + "molarFracs" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + }, + "bodyForce" : [1.0, 2.0, 3.0], + "turbForcing" : { + "type" : "CHANNEL", + "Forcing" : 1000.0, + "RhoUbulk" : 20.0 + + } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 10000, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [] + }, + + "Efield" : { "type" : "Off" } +} diff --git a/unitTests/mixTest/CH4_43SpIonsMix.json b/unitTests/mixTest/CH4_43SpIonsMix.json new file mode 100644 index 0000000..0144d07 --- /dev/null +++ b/unitTests/mixTest/CH4_43SpIonsMix.json @@ -0,0 +1,96 @@ +{ + "Mapping" : { + "tiles" : [1,2,3], + "tilesPerRank" : [1,2,3], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 10000 + }, + + "Grid" : { + "xNum" : 400, + "yNum" : 100, + "zNum" : 1, + "origin" : [0.0, 4.0, 8.0], + "xWidth" : 1.0, + "yWidth" : 0.5, + "zWidth" : 0.1, + "xType" : "TanhMinus", + "yType" : "TanhMinus", + "zType" : "Uniform", + "xStretching" : 0.9, + "yStretching" : 0.9, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 200000, + "maxTime" : 20.0, + "cfl" : 0.9, + "fixedDeltaTime" : 4.0e-3, + "implicitChemistry" : false, + "EulerScheme" : { "type" : "SkewSymmetric" } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { "type" : "Periodic" }, + "yBCRight" : { "type" : "Periodic" }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture": { + "type" : "CH4_43SpIonsMix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 1.01325e5, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 1.0 }] + } + }, + "initCase" : { + "type" : "Uniform", + "pressure" : 1.01325e5, + "temperature" : 300.0, + "velocity" : [10.0, 20.0, 30.0], + "molarFracs" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + }, + "bodyForce" : [1.0, 2.0, 3.0], + "turbForcing" : { + "type" : "CHANNEL", + "Forcing" : 1000.0, + "RhoUbulk" : 20.0 + + } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 10000, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [] + }, + + "Efield" : { "type" : "Off" } +} diff --git a/unitTests/mixTest/ConstPropMix.json b/unitTests/mixTest/ConstPropMix.json index 930edd4..b24f656 100644 --- a/unitTests/mixTest/ConstPropMix.json +++ b/unitTests/mixTest/ConstPropMix.json @@ -32,8 +32,7 @@ "cfl" : 0.9, "fixedDeltaTime" : 4.0e-3, "implicitChemistry" : false, - "hybridScheme" : true, - "vorticityScale" : 1.0 + "EulerScheme" : { "type" : "SkewSymmetric" } }, "BC" : { @@ -92,5 +91,7 @@ "YAverages" : [], "ZAverages" : [], "volumeProbes" : [] - } + }, + + "Efield" : { "type" : "Off" } } diff --git a/unitTests/mixTest/FFCM1Mix.json b/unitTests/mixTest/FFCM1Mix.json new file mode 100644 index 0000000..bb62092 --- /dev/null +++ b/unitTests/mixTest/FFCM1Mix.json @@ -0,0 +1,96 @@ +{ + "Mapping" : { + "tiles" : [1,2,3], + "tilesPerRank" : [1,2,3], + "sampleId" : -1, + "outDir" : "", + "wallTime" : 10000 + }, + + "Grid" : { + "xNum" : 400, + "yNum" : 100, + "zNum" : 1, + "origin" : [0.0, 4.0, 8.0], + "xWidth" : 1.0, + "yWidth" : 0.5, + "zWidth" : 0.1, + "xType" : "TanhMinus", + "yType" : "TanhMinus", + "zType" : "Uniform", + "xStretching" : 0.9, + "yStretching" : 0.9, + "zStretching" : 1.0 + }, + + "Integrator" : { + "startIter" : 0, + "startTime" : 0.0, + "resetTime" : false, + "maxIter" : 200000, + "maxTime" : 20.0, + "cfl" : 0.9, + "fixedDeltaTime" : 4.0e-3, + "implicitChemistry" : false, + "EulerScheme" : { "type" : "SkewSymmetric" } + }, + + "BC" : { + "xBCLeft" : { "type" : "Periodic" }, + "xBCRight" : { "type" : "Periodic" }, + "yBCLeft" : { "type" : "Periodic" }, + "yBCRight" : { "type" : "Periodic" }, + "zBCLeft" : { "type" : "Periodic" }, + "zBCRight" : { "type" : "Periodic" } + }, + + "Flow" : { + "mixture": { + "type" : "FFCM1Mix", + "LRef" : 1.0, + "TRef" : 300.0, + "PRef" : 1.01325e5, + "XiRef" : { + "Species" : [{"Name" : "O2", "MolarFrac" : 1.0 }] + } + }, + "initCase" : { + "type" : "Uniform", + "pressure" : 1.01325e5, + "temperature" : 300.0, + "velocity" : [10.0, 20.0, 30.0], + "molarFracs" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + } + }, + "resetMixture" : false, + "initMixture" : { + "Species" : [{"Name" : "Mix", "MolarFrac" : 1.0 }] + }, + "bodyForce" : [1.0, 2.0, 3.0], + "turbForcing" : { + "type" : "CHANNEL", + "Forcing" : 1000.0, + "RhoUbulk" : 20.0 + + } + }, + + "IO" : { + "wrtRestart" : true, + "restartEveryTimeSteps" : 10000, + "probesSamplingInterval" : 1, + "probes" : [], + "AveragesSamplingInterval" : 10, + "ResetAverages" : false, + "YZAverages" : [], + "XZAverages" : [], + "XYAverages" : [], + "XAverages" : [], + "YAverages" : [], + "ZAverages" : [], + "volumeProbes" : [] + }, + + "Efield" : { "type" : "Off" } +} diff --git a/unitTests/mixTest/Makefile b/unitTests/mixTest/Makefile index 44ae8ab..c6ea6bb 100644 --- a/unitTests/mixTest/Makefile +++ b/unitTests/mixTest/Makefile @@ -1,92 +1,37 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif - -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif - -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src/ -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - -.PHONY: default all clean - -MIXS= $(HTR_DIR)/src/Species.rg \ - $(HTR_DIR)/src/Reaction.rg \ - $(HTR_DIR)/src/MultiComponent.rg \ - $(HTR_DIR)/src/ConstPropMix.rg \ - $(HTR_DIR)/src/IsentropicMix.rg \ - $(HTR_DIR)/src/AirMix.rg \ - $(HTR_DIR)/src/CH41StMix.rg - -default: mixTest_ConstPropMix.exec mixTest_AirMix.exec mixTest_CH41StMix.exec - +###################################################### +# Include standard variables +###################################################### +include $(HTR_DIR)/Makefile.in + +###################################################### +# Rules +###################################################### +.PHONY: default all clean force + +default: mixTest_ConstPropMix.exec mixTest_AirMix.exec mixTest_CH41StMix.exec \ + mixTest_CH4_30SpMix.exec mixTest_CH4_43SpIonsMix.exec mixTest_FFCM1Mix.exec \ + mixTest_BoivinMix.exec + +###################################################### +# Objects +###################################################### +MIXS= $(HTR_DIR)/src/prometeo_mixture.rg + +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o -mixTest_%.exec: mixTest_%.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o +mixTest_%.exec: mixTest_%.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o $(HTR_DIR)/src/prometeo_mixture_%_cpu.o $(CXX) -o $@ $^ $(LINK_FLAGS) mixTest_%.o: mixTest.rg $(HTR_DIR)/src/config_schema.h $(MIXS) EOS="$*" $(REGENT) mixTest.rg $(REGENT_FLAGS) +$(HTR_DIR)/src/prometeo_mixture_%_cpu.o: force + $(MAKE) -C $(HTR_DIR)/src prometeo_mixture_$*_cpu.o + $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua make -C $(HTR_DIR)/src config_schema.o diff --git a/unitTests/mixTest/mixTest.rg b/unitTests/mixTest/mixTest.rg index 1c17cfe..cb7f7c4 100644 --- a/unitTests/mixTest/mixTest.rg +++ b/unitTests/mixTest/mixTest.rg @@ -6,19 +6,43 @@ import "regent" local C = regentlib.c local fabs = regentlib.fabs(double) local sqrt = regentlib.sqrt(double) -local SCHEMA = terralib.includec("../../src/config_schema.h") +local SCHEMA = terralib.includec("config_schema.h") local Config = SCHEMA.Config +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local REGISTRAR = terralib.includec("prometeo_mixture.h") +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) + function mktestMixture() local testMixture local config = regentlib.newsymbol() + local R = 8.3144598 + local Na = 6.02214086e23 + local eCrg = 1.60217662e-19 + local eps_0 = 8.8541878128e-12 + local T = 750.0 local P = 101325.0 local name - local MIX local ENames local EYi local EXi @@ -34,15 +58,36 @@ function mktestMixture() local Egamma local Esos local Edif + local Emob + local Erhoq + local ESi local Eprod local Edpde local Edpdrho + -- Normalization quantities + local LRef + local PRef + local TRef + local MixWRef + local rhoRef + local eRef + local uRef + local CpRef + local muRef + local lamRef + local DiRef + local KiRef + local rhoqRef + local wiRef + local dpdeRef + local dpdrhoiRef + local Eps0 + if (os.getenv("EOS") == "ConstPropMix") then local R = 287.15 local Pr = 0.71 name = "ConstPropMix" - MIX = (require 'ConstPropMix')(SCHEMA) ENames = rexpr array("MIX") end EYi = rexpr array( 1.0 ) end EXi = rexpr array( 1.0 ) end @@ -58,12 +103,32 @@ function mktestMixture() Egamma = rexpr 1.4 end Esos = rexpr sqrt([Egamma]*[R]*[T]) end Edif = rexpr array( 0.0e0 ) end + Erhoq = rexpr 0.0 end + ESi = rexpr array( 0 ) end Eprod = rexpr array( 0.0e0 ) end Edpde = rexpr [Erho]*([Egamma] - 1.0) end Edpdrho = rexpr array( [R]*[T] ) end + + -- Normalization quantities + LRef = rexpr 1.0 end + PRef = rexpr 1.0 end + TRef = rexpr 1.0 end + MixWRef = rexpr 1.0 end + rhoRef = rexpr 1.0 end + eRef = rexpr 1.0 end + uRef = rexpr 1.0 end + CpRef = rexpr 1.0 end + muRef = rexpr 1.0 end + lamRef = rexpr 1.0 end + DiRef = rexpr 1.0 end + rhoqRef = rexpr 1.0 end + wiRef = rexpr 1.0 end + dpdeRef = rexpr 1.0 end + dpdrhoiRef = rexpr 1.0 end + Eps0 = rexpr 1.0 end + elseif (os.getenv("EOS") == "AirMix") then name = "AirMix" - MIX = (require 'AirMix')(SCHEMA) local R = 8.3144598 ENames = rexpr array( "N2", "O2", "NO", "N", "O") end EYi = rexpr array( 0.2, 0.2, 0.2, 0.2, 0.2) end @@ -80,13 +145,33 @@ function mktestMixture() Egamma = rexpr 1.476782e+00 end Esos = rexpr 6.567317e+02 end Edif = rexpr array( 1.192983e-04, 1.174019e-04, 1.162986e-04, 1.820668e-04, 1.882347e-04) end + Erhoq = rexpr 0.0 end + ESi = rexpr array( 0, 0, 0, 0, 0) end Eprod = rexpr array( 3.413124e+07, 2.664566e+04,-3.578332e+07,-1.742776e+07, 1.905320e+07) end Edpde = rexpr [Erho]*([Egamma] - 1.0) end Edpdrho = rexpr array( 5.206698e+06, 5.184248e+06, 3.742883e+06,-1.064452e+07,-2.029053e+06) end + + -- Normalization quantities + LRef = rexpr 1.0 end + PRef = rexpr 101325.0 end + TRef = rexpr 300.0 end + MixWRef = rexpr 2.889018800000000e-02 end + rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end + eRef = rexpr [PRef]/[rhoRef] end + uRef = rexpr sqrt([PRef]/[rhoRef]) end + CpRef = rexpr [R]/[MixWRef] end + muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end + lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end + DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end + KiRef = rexpr sqrt([rhoRef]/[PRef])*[Na]*[eCrg]*[LRef]/[MixWRef] end + rhoqRef = rexpr Na*eCrg*[rhoRef]/[MixWRef] end + wiRef = rexpr sqrt([PRef]*[rhoRef])/[LRef] end + dpdeRef = rexpr [rhoRef] end + dpdrhoiRef = rexpr [eRef] end + Eps0 = rexpr [PRef]*[MixWRef]*[MixWRef]/([rhoRef]*[rhoRef]*[Na]*[Na]*[eCrg]*[eCrg]*[LRef]*[LRef]) end + elseif (os.getenv("EOS") == "CH41StMix") then name = "CH41StMix" - MIX = (require 'CH41StMix')(SCHEMA) - local R = 8.3144598 ENames = rexpr array( "CH4", "O2", "CO2", "H2O") end EYi = rexpr array( 0.25, 0.25, 0.25, 0.25) end EXi = rexpr array( 3.628018e-01, 1.818846e-01, 1.322462e-01, 3.230675e-01) end @@ -101,10 +186,406 @@ function mktestMixture() Elam = rexpr 8.767210e-02 end Egamma = rexpr 1.213177e+00 end Esos = rexpr 5.700526e+02 end - Edif = rexpr array( 1.349310e-04, 1.009838e-04, 7.790111e-05, 1.363336e-04) end + Edif = rexpr array( 1.343289e-04, 1.007327e-04, 7.760974e-05, 1.350278e-04) end + Erhoq = rexpr 0.0 end + ESi = rexpr array( 0, 0, 0, 0) end Eprod = rexpr array(-2.658098e+00,-1.060412e+01, 7.292178e+00, 5.970037e+00) end Edpde = rexpr [Erho]*([Egamma] - 1.0) end Edpdrho = rexpr array(-1.550405e+05,-1.186804e+06, 6.509754e+05, 1.762304e+06) end + + -- Normalization quantities + LRef = rexpr 1.0 end + PRef = rexpr 101325.0 end + TRef = rexpr 300.0 end + MixWRef = rexpr 3.1998800000000e-02 end + rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end + eRef = rexpr [PRef]/[rhoRef] end + uRef = rexpr sqrt([PRef]/[rhoRef]) end + CpRef = rexpr [R]/[MixWRef] end + muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end + lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end + DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end + KiRef = rexpr sqrt([rhoRef]/[PRef])*[Na]*[eCrg]*[LRef]/[MixWRef] end + rhoqRef = rexpr Na*eCrg*[rhoRef]/[MixWRef] end + wiRef = rexpr sqrt([PRef]*[rhoRef])/[LRef] end + dpdeRef = rexpr [rhoRef] end + dpdrhoiRef = rexpr [eRef] end + Eps0 = rexpr [PRef]*[MixWRef]*[MixWRef]/([rhoRef]*[rhoRef]*[Na]*[Na]*[eCrg]*[eCrg]*[LRef]*[LRef]) end + + elseif (os.getenv("EOS") == "CH4_30SpMix") then + name = "CH4_30SpMix" + local R = 8.3144598 + T = 1500 + ENames = rexpr array( "H2", "H", "O", "O2", "OH", + "H2O", "HO2", "H2O2", "C", "CH", + "CH2", "CH2(S)", "CH3", "CH4", "CO", + "CO2", "HCO", "CH2O", "CH2OH", "CH3O", + "CH3OH", "C2H2", "C2H3", "C2H4", "C2H5", + "C2H6", "HCCO", "CH2CO", "CH2CHO", "N2") end + + EYi = rexpr array( 5.44971e-04, 1e-60, 1e-60, 2.15391e-01, 1e-60, + 5.62779e-03, 2.33245e-05, 1e-60, 1e-60, 1e-60, + 1e-60, 1e-60, 1e-60, 5.27455e-02, 1.49287e-03, + 5.98395e-04, 1e-60, 6.19628e-05, 1e-60, 1e-60, + 1.23090e-05, 1e-60, 1e-60, 1.22500e-05, 1e-60, + 3.12909e-05, 1e-60, 1e-60, 1e-60, 7.23443e-01) end + EXi = rexpr array( 7.407618e-03, 2.718537e-59, 1.712470e-60, 1.844254e-01, 1.610990e-60, + 8.559107e-03, 1.936145e-05, 8.054952e-61, 2.281174e-60, 2.104575e-60, + 1.953355e-60, 1.953355e-60, 1.822409e-60, 9.008491e-02, 1.460273e-03, + 3.725361e-04, 9.441918e-61, 5.654101e-05, 8.828651e-61, 8.828651e-61, + 1.052537e-05, 1.052288e-60, 1.013074e-60, 1.196430e-05, 9.428057e-61, + 2.851241e-05, 6.677896e-61, 6.517791e-61, 6.365184e-61, 7.075633e-01) end + EMixW = rexpr 2.739850e-02 end + Erho = rexpr [P]*[EMixW]/([R]*[T]) end + Ecp = rexpr 1.4689114e+03 end + Eh = rexpr 1.2239974e+06 end + Ehsp = rexpr array( 1.800606e+07, 2.410888e+08, 1.715512e+07, 1.268862e+06, 4.479985e+06, + -1.074720e+07, 2.033562e+06,-1.907952e+06, 6.175101e+07, 4.882339e+07, + 3.165640e+07, 3.427167e+07, 1.419724e+07, 3.381412e+05,-2.559395e+06, + -7.539517e+06, 3.328419e+06,-1.340443e+06, 2.331136e+06, 3.246672e+06, + -3.224028e+06, 1.172948e+07, 1.434182e+07, 5.510683e+06, 8.117429e+06, + 1.607184e+06, 6.263048e+06, 1.127859e+06, 3.089845e+06, 1.370973e+06) end + EWi = rexpr array( 2.015680e-03, 1.007840e-03, 1.599940e-02, 3.199880e-02, 1.700724e-02, + 1.801508e-02, 3.300664e-02, 3.401448e-02, 1.201070e-02, 1.301854e-02, + 1.402638e-02, 1.402638e-02, 1.503422e-02, 1.604206e-02, 2.801010e-02, + 4.400950e-02, 2.901794e-02, 3.002578e-02, 3.103362e-02, 3.103362e-02, + 3.204146e-02, 2.603708e-02, 2.704492e-02, 2.805276e-02, 2.906060e-02, + 3.006844e-02, 4.102864e-02, 4.203648e-02, 4.304432e-02, 2.801340e-02) end + Ee = rexpr Eh - [P]/[Erho] end + Emu = rexpr 5.4245594e-05 end + Elam = rexpr 1.1047398e-01 end + Egamma = rexpr 1.2603842e+00 end + Esos = rexpr 7.5744434e+02 end + Edif = rexpr array( 1.159092e-03, 1.919946e-03, 4.970050e-04, 3.137183e-04, 4.876624e-04, + 4.248935e-04, 3.228673e-04, 3.206944e-04, 4.671199e-04, 5.315370e-04, + 3.640265e-04, 3.640265e-04, 3.559047e-04, 3.673578e-04, 3.204063e-04, + 2.611356e-04, 2.816701e-04, 2.793719e-04, 2.738767e-04, 2.738767e-04, + 2.732409e-04, 2.720047e-04, 2.694003e-04, 2.693776e-04, 2.473667e-04, + 2.453524e-04, 4.018125e-04, 2.370506e-04, 2.359528e-04, 3.184521e-04) end + Erhoq = rexpr 0.0 end + ESi = rexpr array( 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0) end + Eprod = rexpr array(-2.619665e-04, 8.087728e-04, 7.719551e-05,-3.682853e-03, 2.440982e-03, + -7.018117e-04,-4.101689e-02, 4.255061e-02,-1.594798e-53,-3.276723e-53, + 1.364118e-53, 1.622366e-05, 3.088778e-02,-2.795221e-02,-2.962707e-03, + 4.701255e-03, 3.466719e-03,-3.706367e-03, 9.079769e-05, 3.080949e-08, + -8.255169e-05, 2.713261e-05, 4.723409e-08,-3.162484e-05, 1.908141e-05, + -4.687643e-03,-8.071670e-55, 1.091095e-54, 2.449082e-55, 0.000000e+00) end + Edpde = rexpr [Erho]*([Egamma] - 1.0) end + Edpdrho = rexpr array( 3.310111e+06,-4.697869e+07,-3.284257e+06, 3.610331e+05,-4.207291e+04, + 3.871137e+06, 1.469175e+05, 1.159114e+06,-1.457004e+07,-1.130521e+07, + -6.921959e+06,-7.602934e+06,-2.450997e+06, 1.092006e+06, 1.427804e+06, + 2.520530e+06,-1.247804e+05, 1.072735e+06, 9.971174e+04,-1.386793e+05, + 1.530256e+06,-2.250267e+06,-2.952978e+06,-6.743695e+05,-1.372558e+06, + 3.044764e+05,-1.047489e+06, 2.804470e+05,-2.391786e+05, 4.043327e+05) end + + -- Normalization quantities + LRef = rexpr 1.0 end + PRef = rexpr 101325.0 end + TRef = rexpr 300.0 end + MixWRef = rexpr 3.1998800000000e-02 end + rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end + eRef = rexpr [PRef]/[rhoRef] end + uRef = rexpr sqrt([PRef]/[rhoRef]) end + CpRef = rexpr [R]/[MixWRef] end + muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end + lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end + DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end + KiRef = rexpr sqrt([rhoRef]/[PRef])*[Na]*[eCrg]*[LRef]/[MixWRef] end + rhoqRef = rexpr Na*eCrg*[rhoRef]/[MixWRef] end + wiRef = rexpr sqrt([PRef]*[rhoRef])/[LRef] end + dpdeRef = rexpr [rhoRef] end + dpdrhoiRef = rexpr [eRef] end + Eps0 = rexpr [PRef]*[MixWRef]*[MixWRef]/([rhoRef]*[rhoRef]*[Na]*[Na]*[eCrg]*[eCrg]*[LRef]*[LRef]) end + + elseif (os.getenv("EOS") == "CH4_43SpIonsMix") then + name = "CH4_43SpIonsMix" + local R = 8.3144598 + T = 1500 + ENames = rexpr array( "N2", "H2", "H", "O2", "O", + "H2O", "OH", "H2O2", "HO2", "CO", + "CO2", "CH4", "CH3", "CH2", "CH2(S)", + "C", "CH", "CH3O2", "CH3OH", "CH3O", + "CH2OH", "CH2O", "HCO", "C2H6", "C2H5", + "C2H4", "C2H3", "C2H2", "C2H", "CH3CHO", + "CH3CO", "CH2CHO", "CH2CO", "HCCO", "C3H6", + "C3H5-A", "CHO+", "C2H3O+", "CH5O+", "H3O+", + "OH-", "O2-", "E") end + + EYi = rexpr array( 7.247482e-01, 2.873951e-04, 1.856406e-05, 7.026078e-03, 1.762206e-04, + 1.201430e-01, 2.318436e-03, 8.314211e-08, 7.900423e-07, 9.834666e-03, + 1.354466e-01, 1.795259e-17, 4.100397e-17, 5.867168e-18, 3.613851e-19, + 1.006555e-17, 2.050666e-18, 8.261078e-23, 4.987982e-18, 3.400659e-18, + 7.269760e-17, 1.677910e-11, 1.264227e-09, 7.743355e-33, 3.302831e-32, + 3.662615e-27, 3.704750e-27, 3.582896e-22, 1.861185e-24, 1.773601e-25, + 2.905161e-24, 8.931894e-25, 1.047018e-19, 3.546749e-20, 6.441795e-42, + 7.670481e-41, 6.179356e-20, 7.138074e-31, 1.604438e-32, 1.388858e-16, + 5.764229e-13, 1.908847e-14, 3.996186e-16) end + EXi = rexpr array( 7.088565e-01, 3.906026e-03, 5.046134e-04, 6.016396e-03, 3.017937e-04, + 1.827302e-01, 3.735199e-03, 6.697452e-08, 6.558488e-07, 9.620392e-03, + 8.432819e-02, 3.066110e-17, 7.472548e-17, 1.146067e-17, 7.059138e-19, + 2.296174e-17, 4.315823e-18, 4.812606e-23, 4.265319e-18, 3.002421e-18, + 6.418427e-17, 1.531149e-11, 1.193724e-09, 7.055731e-33, 3.113918e-32, + 3.577196e-27, 3.753204e-27, 3.770274e-22, 2.037394e-24, 1.103130e-25, + 1.849242e-24, 5.685480e-25, 6.824468e-20, 2.368568e-20, 4.194374e-42, + 5.116965e-41, 5.834857e-20, 4.543705e-31, 1.330163e-32, 2.000496e-16, + 9.286365e-13, 1.634508e-14, 1.995961e-11) end + EMixW = rexpr 2.739973e-02 end + Erho = rexpr [P]*[EMixW]/([R]*[T]) end + Ecp = rexpr 1.423258e+03 end + Eh = rexpr -1.313672e+06 end + Ehsp = rexpr array( 1.369611e+06, 1.799586e+07, 2.410452e+08, 1.269012e+06, 1.715846e+07, + -1.075009e+07, 4.372157e+06,-1.881761e+06, 2.045765e+06,-2.560159e+06, + -7.540188e+06, 3.376548e+05, 1.417744e+07, 3.155339e+07, 3.418885e+07, + 6.174649e+07, 4.873545e+07, 2.496426e+06,-3.247268e+06, 3.583998e+06, + 2.231564e+06,-1.362676e+06, 3.347733e+06, 1.594587e+06, 8.147544e+06, + 5.502544e+06, 1.417021e+07, 1.172661e+07, 2.513873e+07,-9.915910e+05, + 2.228818e+06, 2.860186e+06, 1.103988e+06, 6.320237e+06, 4.308916e+06, + 7.828647e+06, 3.065696e+07, 1.778748e+07, 2.068148e+07, 3.471418e+07, + -6.267846e+06,-1.683196e+05, 4.553796e+10) end + EWi = rexpr array( 2.801400e-02, 2.016000e-03, 1.008000e-03, 3.199800e-02, 1.599900e-02, + 1.801500e-02, 1.700700e-02, 3.401400e-02, 3.300600e-02, 2.801000e-02, + 4.400900e-02, 1.604300e-02, 1.503500e-02, 1.402700e-02, 1.402700e-02, + 1.201100e-02, 1.301900e-02, 4.703300e-02, 3.204200e-02, 3.103400e-02, + 3.103400e-02, 3.002600e-02, 2.901800e-02, 3.007000e-02, 2.906200e-02, + 2.805400e-02, 2.704600e-02, 2.603800e-02, 2.503000e-02, 4.405300e-02, + 4.304500e-02, 4.304500e-02, 4.203700e-02, 4.102900e-02, 4.208100e-02, + 4.107300e-02, 2.901745e-02, 4.304445e-02, 3.304945e-02, 1.902245e-02, + 1.700755e-02, 3.199855e-02, 5.485799e-07) end + Ee = rexpr Eh - [P]/[Erho] end + Emu = rexpr 5.519658e-05 end + Elam = rexpr 1.137426e-01 end + Egamma = rexpr 1.270976e+00 end + Esos = rexpr 7.605937e+02 end + if ELECTRIC_FIELD then + Edif = rexpr array( 3.328026e-04, 1.179778e-03, 1.967375e-03, 3.289734e-04, 5.061709e-04, + 4.414854e-04, 4.967148e-04, 3.247798e-04, 3.269961e-04, 3.243026e-04, + 2.557088e-04, 3.581979e-04, 3.598466e-04, 3.680755e-04, 3.680755e-04, + 4.743545e-04, 5.414407e-04, 2.534395e-04, 2.745194e-04, 2.753915e-04, + 2.753915e-04, 2.806731e-04, 2.829947e-04, 2.441959e-04, 2.462103e-04, + 3.140928e-04, 2.946066e-04, 2.974666e-04, 3.005252e-04, 2.357087e-04, + 2.367718e-04, 2.367718e-04, 2.378805e-04, 4.086740e-04, 2.349290e-04, + 2.306210e-04, 1.793319e-04, 1.510798e-04, 1.628573e-04, 2.014434e-04, + 1.856256e-04, 1.648010e-04, 1.034067e-01) end + else + Edif = rexpr array( 3.328026e-04, 1.179778e-03, 1.967375e-03, 3.289734e-04, 5.061709e-04, + 4.414854e-04, 4.967148e-04, 3.247798e-04, 3.269961e-04, 3.243026e-04, + 2.557088e-04, 3.581979e-04, 3.598466e-04, 3.680755e-04, 3.680755e-04, + 4.743545e-04, 5.414407e-04, 2.534395e-04, 2.745194e-04, 2.753915e-04, + 2.753915e-04, 2.806731e-04, 2.829947e-04, 2.441959e-04, 2.462103e-04, + 3.140928e-04, 2.946066e-04, 2.974666e-04, 3.005252e-04, 2.357087e-04, + 2.367718e-04, 2.367718e-04, 2.378805e-04, 4.086740e-04, 2.349290e-04, + 2.306210e-04, 4.282862e-04, 2.366133e-04, 2.502591e-04, 4.139949e-04, + 4.952764e-04, 3.349915e-04, 1.140070e-05) end + end + Emob = rexpr array( 1.387374e-03, 1.168806e-03, 1.259921e-03, 1.558436e-03, 1.436065e-03, + 1.274958e-03, 7.999900e-01) end + Erhoq = rexpr -1.638665e-05 end + ESi = rexpr array( 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, + -1, -1, -1) end + Eprod = rexpr array( 0.000000e+00,-6.386433e+00, 4.321756e+00, 1.820241e+01, 2.207037e+01, + 9.280903e+01,-1.412370e+02, 7.461174e-01, 1.680463e-01,-1.630321e+01, + 2.559621e+01,-1.812313e-13, 6.962300e-15, 3.815141e-12,-7.151828e-12, + -8.280009e-12,-3.509156e-12, 1.754485e-14, 1.681078e-12, 1.347153e-10, + 8.504105e-10,-1.651398e-06, 1.267184e-02, 5.119513e-26, 2.917562e-24, + -1.039674e-22, 8.265570e-20,-4.668084e-18,-2.273024e-18, 5.750472e-19, + 3.487055e-16, 1.107550e-17, 7.137457e-14,-1.555412e-14, 2.547253e-35, + -5.293791e-36,-2.894192e-11,-2.447041e-26, 2.378219e-24, 1.943284e-11, + -5.760147e-07, 1.563686e-06,-8.228268e-12) end + Edpde = rexpr [Erho]*([Egamma] - 1.0) end + Edpdrho = rexpr array(-2.846256e+05, 2.506754e+06,-5.007171e+07,-3.278145e+05,-4.138104e+06, + 3.313571e+06,-7.320436e+05, 4.966088e+05,-5.534242e+05, 7.803281e+05, + 1.924069e+06, 4.172128e+05,-3.266794e+06,-7.899497e+06,-8.613643e+06, + -1.589143e+07,-1.246793e+07,-8.187682e+05, 8.953083e+05,-9.397323e+05, + -5.732552e+05, 4.178437e+05,-8.402259e+05,-3.842757e+05,-2.141686e+06, + -1.405357e+06,-3.733028e+06,-3.048183e+06,-6.658027e+06, 1.491979e+05, + -7.150295e+05,-8.861150e+05,-4.013977e+05,-1.805612e+06,-1.270250e+06, + -2.214768e+06,-8.240358e+06,-4.931046e+06,-5.603885e+06,-9.052749e+06, + 2.151111e+06, 6.165926e+04, 1.655411e+10) end + + -- Normalization quantities + LRef = rexpr 1.0 end + PRef = rexpr 101325.0 end + TRef = rexpr 300.0 end + MixWRef = rexpr 3.1998800000000e-02 end + rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end + eRef = rexpr [PRef]/[rhoRef] end + uRef = rexpr sqrt([PRef]/[rhoRef]) end + CpRef = rexpr [R]/[MixWRef] end + muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end + lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end + DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end + KiRef = rexpr sqrt([rhoRef]/[PRef])*[Na]*[eCrg]*[LRef]/[MixWRef] end + rhoqRef = rexpr Na*eCrg*[rhoRef]/[MixWRef] end + wiRef = rexpr sqrt([PRef]*[rhoRef])/[LRef] end + dpdeRef = rexpr [rhoRef] end + dpdrhoiRef = rexpr [eRef] end + Eps0 = rexpr [PRef]*[MixWRef]*[MixWRef]/([rhoRef]*[rhoRef]*[Na]*[Na]*[eCrg]*[eCrg]*[LRef]*[LRef]) end + + elseif (os.getenv("EOS") == "FFCM1Mix") then + name = "FFCM1Mix" + local R = 8.3144598 + T = 1500 + ENames = rexpr array( "H2", "H", "O", "O2", "OH", + "H2O", "HO2", "H2O2", "CO", "CO2", + "C", "CH", "CH2", "CH2(S)", "CH3", + "CH4", "HCO", "CH2O", "CH2OH", "CH3O", + "CH3OH", "C2H", "C2H2", "C2H3", "C2H4", + "C2H5", "C2H6", "HCCO", "CH2CO", "CH2CHO", + "CH3CHO", "CH3CO", "H2CC") end + + EYi = rexpr array( 7.247482e-01, 2.873951e-04, 1.856406e-05, 7.026078e-03, 1.762206e-04, + 1.201430e-01, 2.318436e-03, 8.314211e-08, 7.900423e-07, 9.834666e-03, + 1.354466e-01, 1.795259e-17, 4.100397e-17, 5.867168e-18, 3.613851e-19, + 1.006555e-17, 2.050666e-18, 8.261078e-23, 4.987982e-18, 3.400659e-18, + 7.269760e-17, 1.677910e-11, 1.264227e-09, 7.743355e-33, 3.302831e-32, + 3.662615e-27, 3.704750e-27, 3.582896e-22, 1.861185e-24, 1.773601e-25, + 2.905161e-24, 8.931894e-25, 1.047018e-19) end + EXi = rexpr array( 9.504213e-01, 7.537692e-04, 3.067043e-06, 5.804033e-04, 2.738883e-05, + 1.762840e-02, 1.856711e-04, 6.461120e-09, 7.455663e-08, 5.906957e-04, + 2.980921e-02, 3.645150e-18, 7.727356e-18, 1.105690e-18, 6.353894e-20, + 1.658548e-18, 1.868009e-19, 7.272656e-24, 4.248573e-19, 2.896552e-19, + 5.997336e-18, 1.772032e-12, 1.283463e-10, 7.568226e-34, 3.112156e-33, + 3.331481e-28, 3.256856e-28, 2.308329e-23, 1.170345e-25, 1.089157e-26, + 1.743226e-25, 5.485021e-26, 1.062949e-20) end + EMixW = rexpr 2.643325e-03 end + Erho = rexpr [P]*[EMixW]/([R]*[T]) end + Ecp = rexpr 1.221597e+04 end + Eh = rexpr 2.014642e+07 end + Ehsp = rexpr array( 1.802545e+07, 2.410888e+08, 1.715523e+07, 1.267783e+06, 4.360915e+06, + -1.074573e+07, 2.025579e+06,-1.907797e+06,-2.560687e+06,-7.541346e+06, + 6.174925e+07, 4.870763e+07, 3.155535e+07, 3.419105e+07, 1.417898e+07, + 3.368382e+05, 3.363581e+06,-1.364939e+06, 2.238138e+06, 3.581165e+06, + -3.245722e+06, 2.514006e+07, 1.172721e+07, 1.417113e+07, 5.503073e+06, + 8.148775e+06, 1.596368e+06, 6.320454e+06, 1.104006e+06, 2.864517e+06, + -9.908961e+05, 2.229502e+06, 1.860033e+07) end + EWi = rexpr array( 2.015680e-03, 1.007840e-03, 1.599940e-02, 3.199880e-02, 1.700724e-02, + 1.801508e-02, 3.300664e-02, 3.401448e-02, 2.801010e-02, 4.400950e-02, + 1.201070e-02, 1.301854e-02, 1.402638e-02, 1.402638e-02, 1.503422e-02, + 1.604206e-02, 2.901794e-02, 3.002578e-02, 3.103362e-02, 3.103362e-02, + 3.204146e-02, 2.502924e-02, 2.603708e-02, 2.704492e-02, 2.805276e-02, + 2.906060e-02, 3.006844e-02, 4.102864e-02, 4.203648e-02, 4.304432e-02, + 4.405216e-02, 4.304432e-02, 2.603708e-02) end + Ee = rexpr Eh - [P]/[Erho] end + Emu = rexpr 2.923605e-05 end + Elam = rexpr 5.427472e-01 end + Egamma = rexpr 1.346778e+00 end + Esos = rexpr 2.520782e+03 end + Edif = rexpr array( 7.670583e-03, 3.157698e-03, 1.486029e-03, 1.095894e-03, 1.479138e-03, + 1.215229e-03, 1.098170e-03, 1.098570e-03, 1.052285e-03, 9.206180e-04, + 1.177592e-03, 1.511316e-03, 1.020942e-03, 1.020942e-03, 1.015194e-03, + 1.027881e-03, 9.370184e-04, 9.354684e-04, 9.198897e-04, 9.198897e-04, + 9.250296e-04, 8.728572e-04, 8.710027e-04, 8.692742e-04, 8.789467e-04, + 8.059938e-04, 8.046712e-04, 1.469029e-03, 8.329268e-04, 8.322119e-04, + 8.315274e-04, 8.322119e-04, 8.710027e-04) end + Erhoq = rexpr 0.000000e+00 end + ESi = rexpr array( 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, 0, 0) end + Eprod = rexpr array(-5.472850e+02, 2.758325e+02, 9.735398e+02,-1.950592e+03,-1.523697e+02, + 1.357990e+02,-2.340542e+01, 2.368916e+00, 1.786184e+03,-2.702424e-02, + -3.934252e+03, 3.434207e+03, 1.276174e-09,-8.077703e-11, 3.925789e-10, + 3.075621e-15, 7.910172e-08, 2.818611e-12,-1.409102e-13,-2.310325e-12, + 1.364451e-13,-1.021105e-04, 1.061451e-04, 4.230531e-08, 8.855515e-15, + -8.237674e-22, 4.559531e-23, 1.497008e-08, 1.791127e-09,-1.411255e-20, + -1.930851e-21,-8.465273e-18, 3.384368e-10) end + Edpde = rexpr [Erho]*([Egamma] - 1.0) end + Edpdrho = rexpr array( 7.432314e+06,-6.158820e+07, 4.509459e+05, 5.435450e+06, 4.825521e+06, + 1.000892e+07, 5.156635e+06, 6.505565e+06, 6.837828e+06, 8.347008e+06, + -1.466464e+07,-1.025036e+07,-4.395027e+06,-5.309030e+06, 1.550439e+06, + 6.280403e+06, 4.762595e+06, 6.382913e+06, 5.115277e+06, 4.649545e+06, + 6.999936e+06,-2.696767e+06, 1.928540e+06, 1.057001e+06, 4.040581e+06, + 3.102344e+06, 5.355203e+06, 3.567768e+06, 5.366903e+06, 4.747041e+06, + 6.075086e+06, 4.967250e+06,-4.549095e+05) end + + -- Normalization quantities + LRef = rexpr 1.0 end + PRef = rexpr 101325.0 end + TRef = rexpr 300.0 end + MixWRef = rexpr 3.1998800000000e-02 end + rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end + eRef = rexpr [PRef]/[rhoRef] end + uRef = rexpr sqrt([PRef]/[rhoRef]) end + CpRef = rexpr [R]/[MixWRef] end + muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end + lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end + DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end + KiRef = rexpr sqrt([rhoRef]/[PRef])*[Na]*[eCrg]*[LRef]/[MixWRef] end + rhoqRef = rexpr Na*eCrg*[rhoRef]/[MixWRef] end + wiRef = rexpr sqrt([PRef]*[rhoRef])/[LRef] end + dpdeRef = rexpr [rhoRef] end + dpdrhoiRef = rexpr [eRef] end + Eps0 = rexpr [PRef]*[MixWRef]*[MixWRef]/([rhoRef]*[rhoRef]*[Na]*[Na]*[eCrg]*[eCrg]*[LRef]*[LRef]) end + + elseif (os.getenv("EOS") == "BoivinMix") then + name = "BoivinMix" + local R = 8.3144598 + T = 1500 + ENames = rexpr array( "H2", "H", "O2", "OH", "O", + "H2O", "HO2", "H2O2", "N2") end + + EYi = rexpr array( 1.000000e-01, 1.000000e-01, 1.000000e-01, 1.000000e-01, 1.000000e-01, + 1.000000e-01, 1.000000e-01, 1.000000e-01, 2.000000e-01) end + EXi = rexpr array( 2.714636e-01, 5.429271e-01, 1.710327e-02, 3.217914e-02, 3.420655e-02, + 3.037860e-02, 1.658094e-02, 1.608957e-02, 3.907122e-02) end + EMixW = rexpr 5.472706e-03 end + Erho = rexpr [P]*[EMixW]/([R]*[T]) end + Ecp = rexpr 4.976572e+03 end + Eh = rexpr 2.739300e+07 end + Ehsp = rexpr array( 1.799911e+07, 2.410449e+08, 1.269205e+06, 4.357695e+06, 1.715499e+07, + -1.074735e+07, 2.017681e+06,-1.907971e+06, 1.370865e+06) end + EWi = rexpr array( 2.016000e-03, 1.008000e-03, 3.199800e-02, 1.700700e-02, 1.599900e-02, + 1.801500e-02, 3.300600e-02, 3.401400e-02, 2.801400e-02) end + Ee = rexpr Eh - [P]/[Erho] end + Emu = rexpr 5.007584e-05 end + Elam = rexpr 5.577378e-01 end + Egamma = rexpr 1.439418e+00 end + Esos = rexpr 1.811130e+03 end + Edif = rexpr array( 2.922287e-03, 5.405200e-03, 9.675580e-04, 1.390704e-03, 1.408131e-03, + 1.239050e-03, 9.631715e-04, 9.588918e-04, 9.004806e-04) end + Erhoq = rexpr 0.000000e+00 end + ESi = rexpr array( 0, 0, 0, 0, 0, + 0, 0, 0, 0) end + Eprod = rexpr array( 1.137198e+04,-4.437493e+04, 2.812263e+05, 1.220565e+06, 2.572854e+03, + 6.879408e+04,-1.540088e+06,-6.713723e+01, 0.000000e+00) end + Edpde = rexpr [Erho]*([Egamma] - 1.0) end + Edpdrho = rexpr array( 1.203101e+07,-7.707478e+07, 1.103892e+07, 1.017630e+07, 4.619445e+06, + 1.675467e+07, 1.069290e+07, 1.240178e+07, 1.107404e+07) end + + -- Normalization quantities + LRef = rexpr 1.0 end + PRef = rexpr 101325.0 end + TRef = rexpr 300.0 end + MixWRef = rexpr 3.1998800000000e-02 end + rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end + eRef = rexpr [PRef]/[rhoRef] end + uRef = rexpr sqrt([PRef]/[rhoRef]) end + CpRef = rexpr [R]/[MixWRef] end + muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end + lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end + DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end + KiRef = rexpr sqrt([rhoRef]/[PRef])*[Na]*[eCrg]*[LRef]/[MixWRef] end + rhoqRef = rexpr Na*eCrg*[rhoRef]/[MixWRef] end + wiRef = rexpr sqrt([PRef]*[rhoRef])/[LRef] end + dpdeRef = rexpr [rhoRef] end + dpdrhoiRef = rexpr [eRef] end + Eps0 = rexpr [PRef]*[MixWRef]*[MixWRef]/([rhoRef]*[rhoRef]*[Na]*[Na]*[eCrg]*[eCrg]*[LRef]*[LRef]) end + elseif (os.getenv("EOS") == nil) then error ("You must define EOS enviromnment variable") end @@ -112,9 +593,13 @@ function mktestMixture() __demand(__inline) task testMixture(config : Config) + var r = region(ispace(int3d, {1,1,1}), TYPES.Fluid_columns) + var t = ispace(int3d, {1,1,1}) + var p_r = partition(equal, r, t) + -- Init the mixture SCHEMA.parse_Config(&config, [name..".json"]); - var Mix = MIX.InitMixture(config) + var Mix = MIX.InitMixture(r, t, p_r, config) -- check GetSpeciesNames for i = 0, MIX.nSpec do @@ -126,7 +611,7 @@ function mktestMixture() regentlib.assert(fabs((MixW/([EMixW])) - 1.0) < 1e-3, ["mixTest: ERROR in GetMolarWeightFromYi of " .. name]) -- check GetMolarFractions - var Xi = MIX.GetMolarFractions(MixW, [EYi], Mix) + var Xi : double[MIX.nSpec]; MIX.GetMolarFractions(&Xi[0], MixW, [EYi], Mix) for i = 0, MIX.nSpec do regentlib.assert(fabs((Xi[i]/([EXi][i])) - 1.0) < 1e-3, ["mixTest: ERROR in GetMolarFractions of " .. name]) end @@ -136,39 +621,38 @@ function mktestMixture() regentlib.assert(fabs((MixW2/MixW) - 1.0) < 1e-3, ["mixTest: ERROR in GetMolarWeightFromXi of " .. name]) -- check GetMassFractions - var Yi = MIX.GetMassFractions(MixW, Xi, Mix) + var Yi : double[MIX.nSpec]; MIX.GetMassFractions(&Yi[0], MixW, Xi, Mix) for i = 0, MIX.nSpec do regentlib.assert(fabs((Yi[i]/([EYi][i])) - 1.0) < 1e-3, ["mixTest: ERROR in GetMassFractions of " .. name]) end -- check GetRho - var rho = MIX.GetRho([P], [T], MixW, Mix) + var rho = MIX.GetRho([P]/[PRef], [T]/[TRef], MixW, Mix)*[rhoRef] regentlib.assert(fabs((rho/([Erho])) - 1.0) < 1e-3, ["mixTest: ERROR in GetRho of " .. name]) - -- check GetRhoYiFromYi - var rhoYi = MIX.GetRhoYiFromYi(rho, Yi) + var rhoYi : double[MIX.nSpec]; MIX.GetRhoYiFromYi(&rhoYi[0], rho, Yi, Mix) for i = 0, MIX.nSpec do regentlib.assert(fabs((rhoYi[i]/([Erho]*[EYi][i])) - 1.0) < 1e-3, ["mixTest: ERROR in GetRhoYiFromYi of " .. name]) end -- check GetYi - var Yi2 = MIX.GetYi(rho, rhoYi) + var Yi2 : double[MIX.nSpec]; MIX.GetYi(&Yi2[0], rho, rhoYi, Mix) for i = 0, MIX.nSpec do regentlib.assert(fabs((Yi2[i]/([EYi][i])) - 1.0) < 1e-3, ["mixTest: ERROR in GetYi of " .. name]) end -- check GetHeatCapacity - var cp = MIX.GetHeatCapacity([T], Yi, Mix) + var cp = MIX.GetHeatCapacity([T]/[TRef], Yi, Mix)*[CpRef] regentlib.assert(fabs((cp/([Ecp])) - 1.0) < 1e-3, ["mixTest: ERROR in GetHeatCapacity of " .. name]) -- check GetEnthalpy - var h = MIX.GetEnthalpy([T], Yi, Mix) + var h = MIX.GetEnthalpy([T]/[TRef], Yi, Mix)*[eRef] regentlib.assert(fabs((h/([Eh])) - 1.0) < 1e-3, ["mixTest: ERROR in GetEnthalpy of " .. name]) -- check GetSpeciesEnthalpy for i = 0, MIX.nSpec do - var hsp = MIX.GetSpeciesEnthalpy(i, [T], Mix) + var hsp = MIX.GetSpeciesEnthalpy(i, [T]/[TRef], Mix)*[eRef] regentlib.assert(fabs((hsp/([Ehsp][i])) - 1.0) < 1e-3, ["mixTest: ERROR in GetSpeciesEnthalpy of " .. name]) end @@ -179,55 +663,75 @@ function mktestMixture() end -- check GetInternalEnergy - var e = MIX.GetInternalEnergy([T], Yi, Mix) + var e = MIX.GetInternalEnergy([T]/[TRef], Yi, Mix)*[eRef] regentlib.assert(fabs((e/([Ee])) - 1.0) < 1e-3, ["mixTest: ERROR in GetInternalEnergy of " .. name]) -- check GetTFromInternalEnergy - var T1 = MIX.GetTFromInternalEnergy(e, [T]+100.0, Yi, Mix) + var T1 = MIX.GetTFromInternalEnergy(e/[eRef], ([T]+100.0)/[TRef], Yi, Mix)*[TRef] regentlib.assert(fabs((T1/([T])) - 1.0) < 1e-3, ["mixTest: ERROR in GetTFromInternalEnergy of " .. name]) -- check isValidInternalEnergy - regentlib.assert(MIX.isValidInternalEnergy(e , Yi, Mix) == true, ["mixTest: ERROR in isValidInternalEnergy of " .. name]) - regentlib.assert(MIX.isValidInternalEnergy(-1.0e60, Yi, Mix) == false, ["mixTest: ERROR in isValidInternalEnergy of " .. name]) + regentlib.assert(MIX.isValidInternalEnergy(e/[eRef], Yi, Mix) == true, ["mixTest: ERROR in isValidInternalEnergy of " .. name]) + regentlib.assert(MIX.isValidInternalEnergy(-1.0e60, Yi, Mix) == false, ["mixTest: ERROR in isValidInternalEnergy of " .. name]) -- check GetTFromRhoAndP - regentlib.assert(fabs((MIX.GetTFromRhoAndP(rho, MixW, P)/([T])) - 1.0) < 1e-3, ["mixTest: ERROR in GetTFromRhoAndP of " .. name]) + regentlib.assert(fabs((MIX.GetTFromRhoAndP(rho/[rhoRef], MixW, P/[PRef], Mix)*[TRef]/([T])) - 1.0) < 1e-3, ["mixTest: ERROR in GetTFromRhoAndP of " .. name]) -- check GetPFromRhoAndT - regentlib.assert(fabs((MIX.GetPFromRhoAndT(rho, MixW, T)/([P])) - 1.0) < 1e-3, ["mixTest: ERROR in GetPFromRhoAndT of " .. name]) + regentlib.assert(fabs((MIX.GetPFromRhoAndT(rho/[rhoRef], MixW, T/[TRef], Mix)*[PRef]/([P])) - 1.0) < 1e-3, ["mixTest: ERROR in GetPFromRhoAndT of " .. name]) -- check GetViscosity - regentlib.assert(fabs((MIX.GetViscosity(T, Xi, Mix)/([Emu])) - 1.0) < 1e-3, ["mixTest: ERROR in GetViscosity of " .. name]) + regentlib.assert(fabs((MIX.GetViscosity(T/[TRef], Xi, Mix)*[muRef]/([Emu])) - 1.0) < 1e-3, ["mixTest: ERROR in GetViscosity of " .. name]) -- check GetHeatConductivity - regentlib.assert(fabs((MIX.GetHeatConductivity(T, Xi, Mix)/([Elam])) - 1.0) < 1e-3, ["mixTest: ERROR in GetHeatConductivity of " .. name]) + regentlib.assert(fabs((MIX.GetHeatConductivity(T/[TRef], Xi, Mix)*[lamRef]/([Elam])) - 1.0) < 1e-3, ["mixTest: ERROR in GetHeatConductivity of " .. name]) -- check GetGamma - var gamma = MIX.GetGamma(T, MixW, Yi, Mix) + var gamma = MIX.GetGamma(T/[TRef], MixW, Yi, Mix) regentlib.assert(fabs((gamma/([Egamma])) - 1.0) < 1e-3, ["mixTest: ERROR in GetGamma of " .. name]) -- check GetSpeedOfSound - regentlib.assert(fabs((MIX.GetSpeedOfSound(T, gamma, MixW, Mix)/([Esos])) - 1.0) < 1e-3, ["mixTest: ERROR in GetSpeedOfSound of " .. name]) + regentlib.assert(fabs((MIX.GetSpeedOfSound(T/[TRef], gamma, MixW, Mix)*[uRef]/([Esos])) - 1.0) < 1e-3, ["mixTest: ERROR in GetSpeedOfSound of " .. name]) -- check GetDiffusivity - var dif = MIX.GetDiffusivity([P], [T], MixW, Xi, Mix) + var dif : double[MIX.nSpec]; MIX.GetDiffusivity(&dif[0], [P]/[PRef], [T]/[TRef], MixW, Xi, Mix) for i = 0, MIX.nSpec do - regentlib.assert(fabs((dif[i] - [Edif][i])/([Edif][i] + 1e-60)) < 1e-3, ["mixTest: ERROR in GetDiffusivity of " .. name]) + regentlib.assert(fabs((dif[i]*[DiRef] - [Edif][i])/([Edif][i] + 1e-60)) < 1e-3, ["mixTest: ERROR in GetDiffusivity of " .. name]) end - -- check GetMolarFractions - var prod = MIX.GetProductionRates(rho, [P], [T], Yi, Mix) + [(function() local __quotes = terralib.newlist() + if (MIX.nIons > 0) then __quotes:insert(rquote + -- check GetElectricMobility + var mob : double[MIX.nIons]; MIX.GetElectricMobility(&mob[0], [P]/[PRef], [T]/[TRef], Xi, Mix) + for i = 0, MIX.nIons do + regentlib.assert(fabs((mob[i]*[KiRef] - [Emob][i])/([Emob][i] + 1e-60)) < 1e-3, ["mixTest: ERROR in GetElectricMobility of " .. name]) + end + end) end return __quotes end)()]; + + -- check GetElectricChargeDensity + regentlib.assert(fabs((MIX.GetElectricChargeDensity(rho/[rhoRef], MixW, Xi, Mix)*[rhoqRef] - [Erhoq])/([Erhoq] + 1e-60)) < 1e-3, ["mixTest: ERROR in GetElectricChargeDensity of " .. name]) + + -- check GetSpeciesChargeNumnber + for i = 0, MIX.nSpec do + regentlib.assert(MIX.GetSpeciesChargeNumber(i, Mix) == ESi[i], ["mixTest: ERROR in GetSpeciesChargeNumnber of " .. name]) + end + + -- check GetDielectricPermittivity + regentlib.assert(fabs((MIX.GetDielectricPermittivity(Mix)/[Eps0] - [eps_0])/([eps_0] + 1e-60)) < 1e-3, ["mixTest: ERROR in GetDielectricPermittivity of " .. name]) + + -- check GetProductionRates + var prod : double[MIX.nSpec]; MIX.GetProductionRates(&prod[0], rho/[rhoRef], [P]/[PRef], [T]/[TRef], Yi, Mix) for i = 0, MIX.nSpec do - regentlib.assert(fabs((prod[i] - [Eprod][i])/([Eprod][i] + 1e-60)) < 1e-3, ["mixTest: ERROR in GetProductionRates of " .. name]) + regentlib.assert(fabs((prod[i]*[wiRef] - [Eprod][i])/([Eprod][i] + 1e-60)) < 1e-3, ["mixTest: ERROR in GetProductionRates of " .. name]) end -- check Getdpdrhoi - regentlib.assert(fabs((MIX.Getdpde(rho, gamma, Mix)/([Edpde])) - 1.0) < 1e-3, ["mixTest: ERROR in Getdpde of " .. name]) + regentlib.assert(fabs((MIX.Getdpde(rho/[rhoRef], gamma, Mix)*[dpdeRef]/([Edpde])) - 1.0) < 1e-3, ["mixTest: ERROR in Getdpde of " .. name]) -- check Getdpdrhoi - var dpdrhoi = MIX.Getdpdrhoi(gamma, [T], Yi, Mix) + var dpdrhoi : double[MIX.nSpec]; MIX.Getdpdrhoi(&dpdrhoi[0], gamma, [T]/[TRef], Yi, Mix) for i = 0, MIX.nSpec do - regentlib.assert(fabs((dpdrhoi[i] - [Edpdrho][i])/([Edpdrho][i] + 1e-60)) < 1e-3, ["mixTest: ERROR in Getdpdrhoi of " .. name]) + regentlib.assert(fabs((dpdrhoi[i]*[dpdrhoiRef] - [Edpdrho][i])/([Edpdrho][i] + 1e-60)) < 1e-3, ["mixTest: ERROR in Getdpdrhoi of " .. name]) end end @@ -244,4 +748,4 @@ end -- COMPILATION CALL ------------------------------------------------------------------------------- -regentlib.saveobj(main, "mixTest_"..os.getenv("EOS")..".o", "object") +regentlib.saveobj(main, "mixTest_"..os.getenv("EOS")..".o", "object", REGISTRAR.register_mixture_tasks) diff --git a/unitTests/mixTest/test.py b/unitTests/mixTest/test.py index 67fc20a..fcab76a 100644 --- a/unitTests/mixTest/test.py +++ b/unitTests/mixTest/test.py @@ -7,7 +7,9 @@ class unitTest(unittest.TestCase, testAll.MultiTestBase): name = "mixTest" - tests = ["mixTest_ConstPropMix", "mixTest_AirMix", "mixTest_CH41StMix"] + tests = ["mixTest_ConstPropMix", "mixTest_AirMix", "mixTest_CH41StMix", + "mixTest_CH4_30SpMix", "mixTest_CH4_43SpIonsMix", "mixTest_FFCM1Mix", + "mixTest_BoivinMix"] if __name__ == "__main__": unittest.main() diff --git a/unitTests/poissonTest/Makefile b/unitTests/poissonTest/Makefile new file mode 100644 index 0000000..2538eed --- /dev/null +++ b/unitTests/poissonTest/Makefile @@ -0,0 +1,59 @@ +###################################################### +# Include standard variables +###################################################### +include $(HTR_DIR)/Makefile.in + +###################################################### +# Rules +###################################################### +.PHONY: default all clean force + +default: poissonTest.exec + +###################################################### +# Objects +###################################################### +MODULES= $(HTR_DIR)/src/prometeo_const.rg \ + $(HTR_DIR)/src/prometeo_macro.rg \ + $(HTR_DIR)/src/prometeo_partitioner.rg \ + $(HTR_DIR)/src/prometeo_grid.rg \ + $(HTR_DIR)/src/prometeo_metric.rg \ + $(HTR_DIR)/src/Poisson/Poisson.rg + +###################################################### +# Recipes +###################################################### +clean: + $(RM) *.exec *.o *.a + +poissonTest.exec: poissonTest.o registrar.o libtest.a + $(CXX) -o $@ $^ $(LINK_FLAGS) + +poissonTest.o: poissonTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg \ + $(MODULES) + EOS="IsentropicMix" $(REGENT) $< $(REGENT_FLAGS) + +libtest.a: $(HTR_DIR)/src/prometeo_IsentropicMix_cpu.a \ + $(if $(filter $(strip $(USE_CUDA)), 1), $(HTR_DIR)/src/prometeo_IsentropicMix_gpu.a) + $(AR) rcT $@ $^ + +registrar.o: registrar.cc registrar.h $(HTR_DIR)/src/prometeo_metric.h $(HTR_DIR)/src/prometeo_mixture.h \ + $(HTR_DIR)/src/Poisson/Poisson.h + $(call getRecipe) + $(CXX) $(CXX_FLAGS) -c -o $@ $< + +$(HTR_DIR)/src/prometeo_IsentropicMix_cpu.a: force + $(MAKE) -C $(HTR_DIR)/src prometeo_IsentropicMix_cpu.a + +$(HTR_DIR)/src/prometeo_IsentropicMix_gpu.a: force + $(MAKE) -C $(HTR_DIR)/src prometeo_IsentropicMix_gpu.a + +$(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua + $(MAKE) -C $(HTR_DIR)/src config_schema.o + +json.o json.h: $(HTR_DIR)/src/json.c $(HTR_DIR)/src/json.h + $(MAKE) -C $(HTR_DIR)/src json.o + +$(HTR_DIR)/src/util-desugared.rg: $(HTR_DIR)/src/util.rg + $(MAKE) -C $(HTR_DIR)/src util-desugared.rg + diff --git a/unitTests/poissonTest/__init__.py b/unitTests/poissonTest/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/unitTests/poissonTest/poissonTest.rg b/unitTests/poissonTest/poissonTest.rg new file mode 100644 index 0000000..ec17bf1 --- /dev/null +++ b/unitTests/poissonTest/poissonTest.rg @@ -0,0 +1,294 @@ +import "regent" +------------------------------------------------------------------------------- +-- IMPORTS +------------------------------------------------------------------------------- + +local C = regentlib.c +local fabs = regentlib.fabs(double) +local sqrt = regentlib.sqrt(double) +local cos = regentlib.cos( double) +local sin = regentlib.sin( double) +local sqrt = regentlib.sqrt(double) + +local SCHEMA = terralib.includec("config_schema.h") +local REGISTRAR = terralib.includec("registrar.h") +local UTIL = require 'util-desugared' +local CONST = require "prometeo_const" + +local MAPPER = { + SAMPLE_ID_TAG = 1234 +} + +--local TYPES = terralib.includec("Poisson.h", include_dirs) + +local PI = CONST.PI + +------------------------------------------------------------------------------- +-- Load data types +------------------------------------------------------------------------------- +local types_inc_flags = terralib.newlist({"-DEOS=IsentropicMix", "-DELECTRIC_FIELD"}) +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns + +------------------------------------------------------------------------------- +--External modules +------------------------------------------------------------------------------- +local MACRO = require "prometeo_macro" +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) +local PART = (require 'prometeo_partitioner')(SCHEMA, METRIC, Fluid_columns) +local GRID = (require 'prometeo_grid')(SCHEMA, Fluid_columns, PART.zones_partitions) +local POISSON = (require "Poisson")(SCHEMA, MIX, TYPES, Fluid_columns, + terralib.newlist({"rho"}), TYPES.TID_performDirFFTFromField, + "electricPotential", + "dcsi_d", "deta_d", "dzet_d", "deta_s", "nType_y") + +------------------------------------------------------------------------------- +-- Test parameters +------------------------------------------------------------------------------- +local Amp = 10 +local WN = 1 + +local Phi_bc = 100 + +local Ng = 1 +local Npx = 32 +local Npy = 256 +local Npz = 32 + +local xO = 0.0 +local yO = 0.0 +local zO = 0.0 + +local xW = 1.0 +local yW = 1.0 +local zW = 1.0 + +local Nx = 4 +local Ny = 4 +local Nz = 4 + +__demand(__inline) +task InitializeCell(Fluid : region(ispace(int3d), Fluid_columns)) +where + writes(Fluid) +do + fill(Fluid.centerCoordinates, array(0.0, 0.0, 0.0)) + fill(Fluid.cellWidth, array(0.0, 0.0, 0.0)) + fill(Fluid.nType_x, 0) + fill(Fluid.nType_y, 0) + fill(Fluid.nType_z, 0) + fill(Fluid.dcsi_e, 0.0) + fill(Fluid.deta_e, 0.0) + fill(Fluid.dzet_e, 0.0) + fill(Fluid.dcsi_d, 0.0) + fill(Fluid.deta_d, 0.0) + fill(Fluid.dzet_d, 0.0) + fill(Fluid.dcsi_s, 0.0) + fill(Fluid.deta_s, 0.0) + fill(Fluid.dzet_s, 0.0) + fill(Fluid.rho, 0.0) + fill(Fluid.electricPotential, 0.0) +end + +__demand(__leaf) +task setRHS(r : region(ispace(int3d), Fluid_columns), + A : double) +where + reads(r.centerCoordinates), + writes(r.rho) +do + var Nx = r.bounds.hi.x - r.bounds.lo.x + 1 + -- Add BCs + for c in r do + r[c].rho = A*sin(WN*2*PI*r[c].centerCoordinates[1]/xW) + end +end + +__demand(__leaf) +task CheckSolution_noRHS(r : region(ispace(int3d), Fluid_columns)) +where + reads(r.{centerCoordinates, rho, electricPotential}) +do + for c in r do + var err = r[c].electricPotential/Phi_bc - r[c].centerCoordinates[1] + regentlib.assert(fabs(err) < 1e-8, "poissonTest: ERROR in solution without RHS") + end +end + +__demand(__leaf) +task CheckSolution_RHS(r : region(ispace(int3d), Fluid_columns)) +where + reads(r.{centerCoordinates, rho, electricPotential}) +do + var fact = WN*2*PI*WN*2*PI + for c in r do + var err = (r[c].rho + r[c].electricPotential*fact)/Amp + --if ((c.x == 0) and (c.z == 0)) then + -- C.printf("%10.4e %10.4e %10.4e %10.4e\n", r[c].centerCoordinates[1], r[c].rho, r[c].electricPotential, err) + --end + regentlib.assert(fabs(err) < 1e-4, "poissonTest: ERROR in solution with RHS") + end +end + +__demand(__leaf) +task printResults(r : region(ispace(int3d), Fluid_columns), + s : region(ispace(int3d), complex64)) +where + reads(r.{centerCoordinates, rho, electricPotential}), + reads(s) +do + C.printf("Solution:\n") + for i=r.bounds.lo.y, r.bounds.hi.y+1 do + var c = int3d({0,i,0}) + C.printf("%d %10.4e %10.4e %10.4e %10.4e\n", i, r[c].centerCoordinates[1], r[c].rho, r[c].electricPotential, s[c].real) + end +end + +local PoissonData = POISSON.DataList +local Grid = { + xBnum = regentlib.newsymbol(), + yBnum = regentlib.newsymbol(), + zBnum = regentlib.newsymbol(), + NX = regentlib.newsymbol(), + NY = regentlib.newsymbol(), + NZ = regentlib.newsymbol(), + numTiles = regentlib.newsymbol(), +} + +task main() + + C.printf("poissonTest: run...\n") + + var config : SCHEMA.Config + config.BC.xBCLeft.type = SCHEMA.FlowBC_Periodic + config.BC.xBCRight.type = SCHEMA.FlowBC_Periodic + config.BC.yBCLeft.type = SCHEMA.FlowBC_NSCBC_Outflow + config.BC.yBCRight.type = SCHEMA.FlowBC_NSCBC_Outflow + config.BC.zBCLeft.type = SCHEMA.FlowBC_Periodic + config.BC.zBCRight.type = SCHEMA.FlowBC_Periodic + + config.Grid.xType = SCHEMA.GridType_Uniform + config.Grid.yType = SCHEMA.GridType_Cosine + config.Grid.yType = SCHEMA.GridType_Uniform + config.Grid.zType = SCHEMA.GridType_Uniform + + config.Efield.type = SCHEMA.EFieldStruct_Ybc + + config.Flow.mixture.type = SCHEMA.MixtureModel_IsentropicMix + config.Flow.mixture.u.IsentropicMix.gasConstant = 1.0 + config.Flow.mixture.u.IsentropicMix.gasConstant = 1.4 + + var [Grid.xBnum] = 0 + var [Grid.yBnum] = 1 + var [Grid.zBnum] = 0 + + var [Grid.NX] = Nx + var [Grid.NY] = Ny + var [Grid.NZ] = Nz + var [Grid.numTiles] = Nx*Ny*Nz + + -- Define the domain + var is_Fluid = ispace(int3d, {x = Npx + 2*Grid.xBnum, + y = Npy + 2*Grid.yBnum, + z = Npz + 2*Grid.zBnum}) + var Fluid = region(is_Fluid, Fluid_columns) + var Fluid_bounds = Fluid.bounds + + -- Partitioning domain + var tiles = ispace(int3d, {Nx, Ny, Nz}) + + -- Fluid Partitioning + var Fluid_Zones = PART.PartitionZones(Fluid, tiles, config, Grid.xBnum, Grid.yBnum, Grid.zBnum) + var {p_All} = Fluid_Zones + + -- Init the mixture + var Mix = MIX.InitMixture(Fluid, tiles, Fluid_Zones.p_All, config); + + -- Declare Poisson solver + [POISSON.DeclSymbols(PoissonData, Fluid, tiles, Fluid_Zones, Grid, config, MAPPER)]; + + -- Fill Fluid + InitializeCell(Fluid) + + -- Initialize operators + METRIC.InitializeOperators(Fluid, tiles, p_All) + + -- Enforce BCs on the operators + __demand(__index_launch) + for c in tiles do [METRIC.mkCorrectGhostOperators("x")](p_All[c], Fluid_bounds, config.BC.xBCLeft.type, config.BC.xBCRight.type, Grid.xBnum, Npx) end + __demand(__index_launch) + for c in tiles do [METRIC.mkCorrectGhostOperators("y")](p_All[c], Fluid_bounds, config.BC.yBCLeft.type, config.BC.yBCRight.type, Grid.yBnum, Npy) end + __demand(__index_launch) + for c in tiles do [METRIC.mkCorrectGhostOperators("z")](p_All[c], Fluid_bounds, config.BC.zBCLeft.type, config.BC.zBCRight.type, Grid.zBnum, Npz) end + + -- Create partitions to support stencils + var Fluid_Ghosts = PART.PartitionGhost(Fluid, tiles, Fluid_Zones) + var {p_MetricGhosts} = Fluid_Ghosts + + __demand(__index_launch) + for c in tiles do + GRID.InitializeGeometry(p_All[c], + config.Grid.xType, config.Grid.yType, config.Grid.zType, + 1.0, 1.0, 1.0, + Grid.xBnum, Npx, xO, xW, + Grid.yBnum, Npy, yO, yW, + Grid.zBnum, Npz, zO, zW) + end + + -- Enforce BCs + GRID.InitializeGhostGeometry(Fluid, tiles, Fluid_Zones, config) + + -- Init Metrics + __demand(__index_launch) + for c in tiles do + METRIC.InitializeMetric(p_MetricGhosts[c], + p_All[c], + Fluid_bounds, + xW, yW, zW); + end + + -- Enforce BCs on the metric + __demand(__index_launch) + for c in tiles do [METRIC.mkCorrectGhostMetric("x")](p_All[c]) end + __demand(__index_launch) + for c in tiles do [METRIC.mkCorrectGhostMetric("y")](p_All[c]) end + __demand(__index_launch) + for c in tiles do [METRIC.mkCorrectGhostMetric("z")](p_All[c]) end + + -- Init Poisson solver + [POISSON.Init(PoissonData, tiles, Grid, config)]; + + -- Solve without RHS + -- SetBCs + config.Efield.u.Ybc.Phi_bottom = 0.0 + config.Efield.u.Ybc.Phi_top = Phi_bc + -- SetRHS + setRHS(Fluid, 0.0); + -- Solve Poisson without RHS + [POISSON.Solve(PoissonData, tiles, Mix, config)]; + -- Check + CheckSolution_noRHS(Fluid) + + -- Solve with RHS + -- SetBCs + config.Efield.u.Ybc.Phi_bottom = 0.0 + config.Efield.u.Ybc.Phi_top = 0.0 + -- SetRHS + setRHS(Fluid, Amp); + -- Solve + [POISSON.Solve(PoissonData, tiles, Mix, config)]; + -- Check + CheckSolution_RHS(Fluid); + + -- Cleanup + [POISSON.Cleanup(PoissonData, tiles, config)]; + + __fence(__execution, __block) + + C.printf("poissonTest: TEST OK\n") + +end + +--regentlib.start(main) +regentlib.saveobj(main, "poissonTest.o", "object", REGISTRAR.register_tasks) diff --git a/unitTests/poissonTest/registrar.cc b/unitTests/poissonTest/registrar.cc new file mode 100644 index 0000000..21e69cf --- /dev/null +++ b/unitTests/poissonTest/registrar.cc @@ -0,0 +1,39 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "registrar.h" + +void register_tasks() { + // Register task for the mixture + register_mixture_tasks(); + // Register task for the metric + register_metric_tasks(); + // Register task for the Poisson solver + register_poisson_tasks(); +} diff --git a/unitTests/poissonTest/registrar.h b/unitTests/poissonTest/registrar.h new file mode 100644 index 0000000..713f014 --- /dev/null +++ b/unitTests/poissonTest/registrar.h @@ -0,0 +1,47 @@ +// Copyright (c) "2019, by Stanford University +// Developer: Mario Di Renzo +// Affiliation: Center for Turbulence Research, Stanford University +// URL: https://ctr.stanford.edu +// Citation: Di Renzo, M., Lin, F., and Urzay, J. (2020). +// HTR solver: An open-source exascale-oriented task-based +// multi-GPU high-order code for hypersonic aerothermodynamics. +// Computer Physics Communications 255, 107262" +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef __PROMETEO_REGISTRAR_H__ +#define __PROMETEO_REGISTRAR_H__ + +#include "prometeo_mixture.h" +#include "prometeo_metric.h" +#include "Poisson.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void register_tasks(); + +#ifdef __cplusplus +} +#endif + +#endif // __PROMETEO_REGISTRAR_H__ diff --git a/unitTests/poissonTest/test.py b/unitTests/poissonTest/test.py new file mode 100644 index 0000000..90f3def --- /dev/null +++ b/unitTests/poissonTest/test.py @@ -0,0 +1,12 @@ +import os +import sys +sys.path.insert(1, os.path.expandvars("$HTR_DIR/unitTests/")) +import unittest +import subprocess +import testAll + +class unitTest(unittest.TestCase, testAll.TestBase): + name = "poissonTest" + +if __name__ == "__main__": + unittest.main() diff --git a/unitTests/probeTest/Makefile b/unitTests/probeTest/Makefile index 07f6882..45bc913 100644 --- a/unitTests/probeTest/Makefile +++ b/unitTests/probeTest/Makefile @@ -1,97 +1,46 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif +###################################################### +# Include standard variables +###################################################### +include $(HTR_DIR)/Makefile.in -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif +###################################################### +# Rules +###################################################### +.PHONY: default all clean force -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src/ -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - -.PHONY: default all clean +default: probeTest.exec -MODULES= $(HTR_DIR)/src/AirMix.rg \ - $(HTR_DIR)/src/hdf_helper.rg \ +###################################################### +# Objects +###################################################### +MODULES= $(HTR_DIR)/src/hdf_helper.rg \ $(HTR_DIR)/src/prometeo_IO.rg \ $(HTR_DIR)/src/prometeo_const.rg \ $(HTR_DIR)/src/prometeo_macro.rg \ + $(HTR_DIR)/src/prometeo_mixture.rg \ $(HTR_DIR)/src/prometeo_probe.rg -default: probeTest.exec - +###################################################### +# Recipes +###################################################### clean: $(RM) -r *.exec *.o *csv -probeTest.exec: probeTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o +probeTest.exec: probeTest.o $(HTR_DIR)/src/prometeo_AirMix_cpu.a $(CXX) -o $@ $^ $(LINK_FLAGS) probeTest.o: probeTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg $(MODULES) - $(REGENT) probeTest.rg $(REGENT_FLAGS) + EOS="AirMix" $(REGENT) probeTest.rg $(REGENT_FLAGS) + +$(HTR_DIR)/src/prometeo_AirMix_cpu.a: force + $(MAKE) -C $(HTR_DIR)/src prometeo_AirMix_cpu.a $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua - make -C $(HTR_DIR)/src config_schema.o + $(MAKE) -C $(HTR_DIR)/src config_schema.o json.o json.h: $(HTR_DIR)/src/json.c $(HTR_DIR)/src/json.h - make -C $(HTR_DIR)/src json.o + $(MAKE) -C $(HTR_DIR)/src json.o $(HTR_DIR)/src/util-desugared.rg: $(HTR_DIR)/src/util.rg - make -C $(HTR_DIR)/src util-desugared.rg + $(MAKE) -C $(HTR_DIR)/src util-desugared.rg diff --git a/unitTests/probeTest/probeTest.rg b/unitTests/probeTest/probeTest.rg index 408fb00..dd3963e 100644 --- a/unitTests/probeTest/probeTest.rg +++ b/unitTests/probeTest/probeTest.rg @@ -5,41 +5,38 @@ import "regent" local C = regentlib.c local fabs = regentlib.fabs(double) -local SCHEMA = terralib.includec("../../src/config_schema.h") +local SCHEMA = terralib.includec("config_schema.h") local UTIL = require 'util-desugared' local Config = SCHEMA.Config local CONST = require "prometeo_const" local MACRO = require "prometeo_macro" -local MIX = (require "AirMix")(SCHEMA) -local nSpec = MIX.nSpec -local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver local Primitives = CONST.Primitives local Properties = CONST.Properties -local struct Fluid_columns { - cellWidth : double[3]; - -- Primitive variables - pressure : double; - temperature : double; - MolarFracs : double[nSpec]; - velocity : double[3]; - -- Properties - rho : double; - mu : double; - lam : double; - Di : double[nSpec]; - SoS : double; - -- Gradients - velocityGradientX : double[3]; - velocityGradientY : double[3]; - velocityGradientZ : double[3]; - temperatureGradient : double[3]; - -- Conserved varaibles - Conserved : double[nEq]; -} +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) +local Fluid_columns = TYPES.Fluid_columns +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) +local nSpec = MIX.nSpec +local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver --External modules local IO = (require 'prometeo_IO')(SCHEMA) @@ -102,7 +99,7 @@ local Grid = { task main() -- Init config var config : Config - + config.Grid.xNum = Npx config.Grid.yNum = Npy config.Grid.zNum = Npz diff --git a/unitTests/testAll.py b/unitTests/testAll.py index 51d0499..49a9592 100644 --- a/unitTests/testAll.py +++ b/unitTests/testAll.py @@ -53,5 +53,10 @@ def test(self): if __name__ == "__main__": suite = unittest.TestLoader().discover(os.path.expandvars("$HTR_DIR/unitTests/"), pattern = "test.py") + # Remove tests that are not appropriate for our configuration + for group in suite: + for test in group: + if (os.path.expandvars("$ELECTRIC_FIELD") != "1"): + if (test._tests[0].name == "poissonTest"): suite._tests.remove(group) result = 0 if unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful() else 1 sys.exit(result) diff --git a/unitTests/variablesTest/Makefile b/unitTests/variablesTest/Makefile index 61ce256..5fc75fd 100644 --- a/unitTests/variablesTest/Makefile +++ b/unitTests/variablesTest/Makefile @@ -1,86 +1,32 @@ -# Required paths -ifndef LEGION_DIR - $(error LEGION_DIR is not set) -endif -ifndef HTR_DIR - $(error HTR_DIR is not set) -endif - -# OS-specific options -ifeq ($(shell uname),Darwin) - DYNLINK_PATH := DYLD_LIBRARY_PATH -else - DYNLINK_PATH := LD_LIBRARY_PATH -endif - -# CUDA options -USE_CUDA ?= 1 - -# HDF options -export USE_HDF ?= 1 -export HDF_HEADER ?= hdf5.h -HDF_LIBNAME ?= hdf5 - -# C compiler options -CFLAGS += -O2 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -CXXFLAGS += -std=c++11 -O3 -Wall -Werror -fno-strict-aliasing -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent - -# Regent options -export TERRA_PATH := ?.rg;$(HTR_DIR)/src/?.rg -export INCLUDE_PATH := .;$(HTR_DIR)/src/ -ifdef HDF_ROOT - export INCLUDE_PATH := $(INCLUDE_PATH);$(HDF_ROOT)/include - export $(DYNLINK_PATH) := $($(DYNLINK_PATH)):$(HDF_ROOT)/lib -endif -REGENT := $(LEGION_DIR)/language/regent.py -REGENT_FLAGS := -fflow 0 -finner 1 -ifeq ($(DEBUG), 1) - REGENT_FLAGS += -g -fcuda 0 -fbounds-checks 1 - CFLAGS += -g - CXXFLAGS += -g -DBOUNDS_CHECKS -DPRIVILEGE_CHECKS - LINK_FLAGS += -g -else -ifeq ($(USE_CUDA), 1) - REGENT_FLAGS += -fcuda 1 -fcuda-offline 1 - NVCC ?= $(CUDA_HOME)/bin/nvcc - NVCCFLAGS += -std=c++11 -O3 -I$(LEGION_DIR)/runtime -I$(LEGION_DIR)/bindings/regent -else - REGENT_FLAGS += -fcuda 0 -endif -endif -ifeq ($(USE_OPENMP), 1) - CFLAGS += -fopenmp - CXXFLAGS += -fopenmp - REGENT_FLAGS += -fopenmp 1 -else - REGENT_FLAGS += -fopenmp 0 -endif - -# Link flags -LINK_FLAGS += -L$(LEGION_DIR)/bindings/regent -lregent -ifdef HDF_ROOT - LINK_FLAGS += -L$(HDF_ROOT)/lib -endif -ifeq ($(USE_HDF), 1) - LINK_FLAGS += -l$(HDF_LIBNAME) -endif -LINK_FLAGS += -lm - +###################################################### +# Include standard variables +###################################################### +include $(HTR_DIR)/Makefile.in + +###################################################### +# Rules +###################################################### .PHONY: default all clean force -MODULES= $(HTR_DIR)/src/AirMix.rg \ - $(HTR_DIR)/src/prometeo_const.rg \ +default: variablesTest.exec + +###################################################### +# Objects +###################################################### +MODULES= $(HTR_DIR)/src/prometeo_const.rg \ $(HTR_DIR)/src/prometeo_macro.rg \ $(HTR_DIR)/src/prometeo_metric.rg \ + $(HTR_DIR)/src/prometeo_mixture.rg \ $(HTR_DIR)/src/prometeo_variables.rg \ $(HTR_DIR)/src/prometeo_variables.h -default: variablesTest.exec - +###################################################### +# Recipes +###################################################### clean: $(RM) *.exec *.o -variablesTest.exec: variablesTest.o $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/json.o $(HTR_DIR)/src/prometeo_variables_AirMix_cpu.o +variablesTest.exec: variablesTest.o $(HTR_DIR)/src/prometeo_AirMix_cpu.a $(CXX) -o $@ $^ $(LINK_FLAGS) variablesTest.o: variablesTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/util-desugared.rg $(MODULES) @@ -89,8 +35,8 @@ variablesTest.o: variablesTest.rg $(HTR_DIR)/src/config_schema.h $(HTR_DIR)/src/ $(HTR_DIR)/src/config_schema.o $(HTR_DIR)/src/config_schema.h: $(HTR_DIR)/src/process_schema.rg $(HTR_DIR)/src/config_schema.lua make -C $(HTR_DIR)/src config_schema.o -$(HTR_DIR)/src/prometeo_variables_AirMix_cpu.o: force - $(MAKE) -C $(HTR_DIR)/src prometeo_variables_AirMix_cpu.o +$(HTR_DIR)/src/prometeo_AirMix_cpu.a: force + $(MAKE) -C $(HTR_DIR)/src prometeo_AirMix_cpu.a json.o json.h: $(HTR_DIR)/src/json.c $(HTR_DIR)/src/json.h make -C $(HTR_DIR)/src json.o diff --git a/unitTests/variablesTest/variablesTest.rg b/unitTests/variablesTest/variablesTest.rg index 21483d8..54d7893 100644 --- a/unitTests/variablesTest/variablesTest.rg +++ b/unitTests/variablesTest/variablesTest.rg @@ -5,6 +5,7 @@ import "regent" local C = regentlib.c local fabs = regentlib.fabs(double) +local sqrt = regentlib.sqrt(double) local SCHEMA = terralib.includec("../../src/config_schema.h") local REGISTRAR = terralib.includec("prometeo_variables.h") local UTIL = require 'util-desugared' @@ -13,19 +14,35 @@ local Config = SCHEMA.Config local CONST = require "prometeo_const" local MACRO = require "prometeo_macro" -local MIX = (require "AirMix")(SCHEMA) -local nSpec = MIX.nSpec -local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver local Primitives = CONST.Primitives local Properties = CONST.Properties -local TYPES = terralib.includec("prometeo_types.h", {"-DEOS="..os.getenv("EOS")}) +------------------------------------------------------------------------------- +-- ACTIVATE ELECTRIC FIELD SOLVER +------------------------------------------------------------------------------- + +local ELECTRIC_FIELD = false +if os.getenv("ELECTRIC_FIELD") == "1" then + ELECTRIC_FIELD = true + print("#############################################################################") + print("WARNING: You are compiling with electric field solver.") + print("#############################################################################") +end + +local types_inc_flags = terralib.newlist({"-DEOS="..os.getenv("EOS")}) +if ELECTRIC_FIELD then + types_inc_flags:insert("-DELECTRIC_FIELD") +end +local TYPES = terralib.includec("prometeo_types.h", types_inc_flags) local Fluid_columns = TYPES.Fluid_columns +local MIX = (require 'prometeo_mixture')(SCHEMA, TYPES) +local nSpec = MIX.nSpec +local nEq = CONST.GetnEq(MIX) -- Total number of unknowns for the implicit solver --External modules -local METRIC = (require 'prometeo_metric')(SCHEMA, Fluid_columns) -local VARS = (require 'prometeo_variables')(SCHEMA, MIX, METRIC, Fluid_columns) +local METRIC = (require 'prometeo_metric')(SCHEMA, TYPES, Fluid_columns) +local VARS = (require 'prometeo_variables')(SCHEMA, MIX, METRIC, TYPES, ELECTRIC_FIELD) -- Test parameters local Npx = 16 @@ -35,7 +52,7 @@ local Nx = 2 local Ny = 2 local Nz = 2 ---local R = rexpr 8.3144598 end +local R = rexpr 8.3144598 end local P = rexpr 101325.0 end local T = rexpr 5000.0 end local Xi = rexpr array(0.4, 0.2, 0.15, 0.15, 0.1) end @@ -43,14 +60,28 @@ local v = rexpr array(1.0, 2.0, 3.0) end local Tres = rexpr 500.0 end -- Expected properties -local eRho = rexpr 6.2899871101668e-02 end -local eMu = rexpr 1.2424467023580e-04 end -local eLam = rexpr 2.4040340390246e-01 end -local eDi = rexpr array(2.5146873480781e-03, 2.4389311883618e-03, 2.4550965167542e-03, 3.6168277168130e-03, 3.9165634179846e-03) end -local eSoS = rexpr 1.4518705966651e+03 end +local eRho = rexpr 6.2899525132668e-02 end +local eMu = rexpr 1.2424432854120e-04 end +local eLam = rexpr 2.4040406505225e-01 end +local eDi = rexpr array(2.5146942638910e-03, 2.4389378958326e-03, 2.4551032686824e-03, 3.6168376636972e-03, 3.9165741891924e-03) end +local eSoS = rexpr 1.4518745895533e+03 end -- Expected conserved variables -local eConserved = rexpr array(2.7311049167620e-02, 1.5598263689963e-02, 1.0970170602665e-02, 5.1208217189288e-03, 3.8995659224908e-03, 6.2899871101668e-02, 1.2579974220334e-01, 1.8869961330500e-01, 5.4092397631210e+05) end +local eConserved = rexpr array(2.3342371515176e-02, 1.3331617683677e-02, 9.3760512904744e-03, 4.3766946590956e-03, 3.3329044209192e-03, 1.8268107194243e-04, 3.6536214388485e-04, 5.4804321582728e-04, 5.3385045774457e+00) end + +-- Normalization quantities +local LRef = rexpr 1.0 end +local PRef = rexpr 101325.0 end +local TRef = rexpr 300.0 end +local YO2Ref = rexpr 0.22 end +local YN2Ref = rexpr 0.78 end +local MixWRef = rexpr 1.0/([YN2Ref]/28.0134e-3 + [YO2Ref]/(2*15.999e-3)) end +local rhoRef = rexpr [PRef]*[MixWRef]/([R]*[TRef]) end +local eRef = rexpr [PRef]/[rhoRef] end +local uRef = rexpr sqrt([PRef]/[rhoRef]) end +local muRef = rexpr sqrt([PRef]*[rhoRef])*[LRef] end +local lamRef = rexpr sqrt([PRef]*[rhoRef])*[LRef]*[R]/[MixWRef] end +local DiRef = rexpr sqrt([PRef]/[rhoRef])*[LRef] end __demand(__inline) task InitializeCell(Fluid : region(ispace(int3d), Fluid_columns)) @@ -71,11 +102,11 @@ do fill(Fluid.dcsi_s, 0.0) fill(Fluid.deta_s, 0.0) fill(Fluid.dzet_s, 0.0) - fill(Fluid.pressure, [P]) - fill(Fluid.temperature, [T]) + fill(Fluid.pressure, [P]/[PRef]) + fill(Fluid.temperature, [T]/[TRef]) fill(Fluid.MassFracs, [UTIL.mkArrayConstant(nSpec, rexpr 0.0 end)]) fill(Fluid.MolarFracs, [Xi]) - fill(Fluid.velocity, [v]) + fill(Fluid.velocity, array([v][0]/[uRef], [v][1]/[uRef], [v][2]/[uRef])) fill(Fluid.rho, 0.0) fill(Fluid.mu , 0.0) fill(Fluid.lam, 0.0) @@ -84,7 +115,7 @@ do fill(Fluid.velocityGradientX, array(0.0, 0.0, 0.0)) fill(Fluid.velocityGradientY, array(0.0, 0.0, 0.0)) fill(Fluid.velocityGradientZ, array(0.0, 0.0, 0.0)) - fill(Fluid.temperatureGradient, array(0.0, 0.0, 0.0)) +-- fill(Fluid.temperatureGradient, array(0.0, 0.0, 0.0)) fill(Fluid.Conserved, [UTIL.mkArrayConstant(nEq, rexpr 0.0 end)]) end @@ -94,13 +125,13 @@ where reads(Fluid.[Properties]) do for c in Fluid do - regentlib.assert(fabs((Fluid[c].rho/[eRho]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (rho)") - regentlib.assert(fabs((Fluid[c].mu /[eMu ]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (mu)") - regentlib.assert(fabs((Fluid[c].lam/[eLam]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (lam)") + regentlib.assert(fabs((Fluid[c].rho*[rhoRef]/[eRho]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (rho)") + regentlib.assert(fabs((Fluid[c].mu *[ muRef]/[eMu ]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (mu)") + regentlib.assert(fabs((Fluid[c].lam*[lamRef]/[eLam]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (lam)") for i=0, nSpec do - regentlib.assert(fabs((Fluid[c].Di[i]/[eDi][i]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (Di)") + regentlib.assert(fabs((Fluid[c].Di[i]*[DiRef]/[eDi][i]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (Di)") end - regentlib.assert(fabs((Fluid[c].SoS/[eSoS]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (SoS)") + regentlib.assert(fabs((Fluid[c].SoS*[uRef]/[eSoS]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePropertiesFromPrimitive (SoS)") end end @@ -150,22 +181,22 @@ do for c in Fluid do var interior = MACRO.in_interior(c, 1, Npx, 1, Npy, 1, Npz) if interior then - regentlib.assert(fabs((Fluid[c].pressure/[P]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved") - regentlib.assert(fabs((Fluid[c].temperature/[T]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved") + regentlib.assert(fabs((Fluid[c].pressure*[PRef]/[P]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved (P)") + regentlib.assert(fabs((Fluid[c].temperature*[TRef]/[T]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved (T)") for i=0, nSpec do - regentlib.assert(fabs((Fluid[c].MolarFracs[i]/[Xi][i]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved") + regentlib.assert(fabs((Fluid[c].MolarFracs[i]/[Xi][i]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved (Xi)") end for i=0, 3 do - regentlib.assert(fabs((Fluid[c].velocity[i]/[v][i]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved") + regentlib.assert(fabs((Fluid[c].velocity[i]*[uRef]/[v][i]) - 1.0) < 1e-8, "variablesTest: ERROR in UpdatePrimitiveFromConserved (v)") end else - regentlib.assert(Fluid[c].pressure == 0.0, "variablesTest: ERROR in UpdatePrimitiveFromConserved") - regentlib.assert(Fluid[c].temperature == [Tres], "variablesTest: ERROR in UpdatePrimitiveFromConserved") + regentlib.assert(Fluid[c].pressure == 0.0, "variablesTest: ERROR in UpdatePrimitiveFromConserved (P)") + regentlib.assert(Fluid[c].temperature*[TRef] == [Tres], "variablesTest: ERROR in UpdatePrimitiveFromConserved (T)") for i=0, nSpec do - regentlib.assert(Fluid[c].MolarFracs[i] == 0.0, "variablesTest: ERROR in UpdatePrimitiveFromConserved") + regentlib.assert(Fluid[c].MolarFracs[i] == 0.0, "variablesTest: ERROR in UpdatePrimitiveFromConserved (Xi)") end for i=0, 3 do - regentlib.assert(Fluid[c].velocity[i] == 0.0, "variablesTest: ERROR in UpdatePrimitiveFromConserved") + regentlib.assert(Fluid[c].velocity[i] == 0.0, "variablesTest: ERROR in UpdatePrimitiveFromConserved (v)") end end end @@ -176,7 +207,15 @@ task main() -- Init the mixture var config : Config config.Flow.mixture.type = SCHEMA.MixtureModel_AirMix - var Mix = MIX.InitMixture(config) + config.Flow.mixture.u.AirMix.LRef = [LRef] + config.Flow.mixture.u.AirMix.TRef = [TRef] + config.Flow.mixture.u.AirMix.PRef = [PRef] + config.Flow.mixture.u.AirMix.XiRef.Species.length = 2 + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[0].Name), 10, "O2") + C.snprintf([&int8](config.Flow.mixture.u.AirMix.XiRef.Species.values[1].Name), 10, "N2") + config.Flow.mixture.u.AirMix.XiRef.Species.values[0].MolarFrac = [MixWRef]*[YO2Ref]/(2*15.999e-3) + config.Flow.mixture.u.AirMix.XiRef.Species.values[1].MolarFrac = [MixWRef]*[YN2Ref]/28.0134e-3 + var Mix = MIX.InitMixtureStruct(config) -- Define the domain var xBnum = 1 @@ -236,7 +275,7 @@ task main() -- Test UpdatePrimitiveFromConserved fill(Fluid.pressure, 0.0) - fill(Fluid.temperature, [Tres]) + fill(Fluid.temperature, [Tres]/[TRef]) fill(Fluid.MolarFracs, [UTIL.mkArrayConstant(nSpec, rexpr 0.0 end)]) fill(Fluid.velocity, array(0.0, 0.0, 0.0)) __demand(__index_launch)