Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haowu80s/cantera
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ChemCharlesX_AdaptiveChem
Choose a base ref
...
head repository: IhmeGroup/cantera
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ChemCharlesX_AdaptiveChem
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Mar 20, 2018

  1. compile_script_cert_intel.bash added

    Peter Ma committed Mar 20, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1250942 View commit details
  2. compile_script_osx.bash added

    Peter Ma committed Mar 20, 2018
    Copy the full SHA
    5ab0954 View commit details

Commits on Oct 19, 2018

  1. Copy the full SHA
    e5cba03 View commit details

Commits on Jan 28, 2019

  1. [bugfix] Getting rid of "printf double root"

    This printf output was slowing down the CharlesX output and making
    it unreadable.
    qdouasbin committed Jan 28, 2019
    Copy the full SHA
    6e6b7e9 View commit details

Commits on Jan 29, 2019

  1. Merge pull request #1 from IhmeGroup/bugfix_remove_double_root_output

    [bugfix] Getting rid of "printf double root"
    qdouasbin authored Jan 29, 2019
    Copy the full SHA
    266a32e View commit details

Commits on Jul 16, 2019

  1. add PR support for 1D python interface

    Wai Tong Chung authored and Wai Tong Chung committed Jul 16, 2019
    Copy the full SHA
    d771690 View commit details
  2. added ch4 and co crit data from nist

    Wai Tong Chung authored and Wai Tong Chung committed Jul 16, 2019
    Copy the full SHA
    8527e58 View commit details
  3. set Tmin to 75K

    Wai Tong Chung authored and Wai Tong Chung committed Jul 16, 2019
    Copy the full SHA
    dfe72f9 View commit details
  4. added thermodata for CO2,ethane,ethene'

    Wai Tong Chung authored and Wai Tong Chung committed Jul 16, 2019
    Copy the full SHA
    dd9efd0 View commit details
  5. hardcode ch4 major and minor species for ChungTransport

    Wai Tong Chung authored and Wai Tong Chung committed Jul 16, 2019
    Copy the full SHA
    e609a76 View commit details
  6. debug newly added species

    Wai Tong Chung authored and Wai Tong Chung committed Jul 16, 2019
    Copy the full SHA
    5539a6f View commit details

Commits on Jul 17, 2019

  1. Create intel compile script for NERSC

    This is compatible with finite rate chemistry on NERSC-Cori
    danmohad authored Jul 17, 2019
    Copy the full SHA
    48dc293 View commit details

Commits on Jul 19, 2019

  1. Update to fix negative diffusivity issue

    system eigen must be 'n' i.e. the git-shipped version of eigen must be used. This must be used in conjunction with Eigen3.2.9 for CharlesX in order for finite rate chemistry to work. IF you do not do this, the code may compile, may run, and may even give results but there will be GARBAGE in the results due to miscalculation of the diffusive quantities by Cantera.
    danmohad authored Jul 19, 2019
    Copy the full SHA
    4b21f51 View commit details

Commits on Aug 7, 2019

  1. Copy the full SHA
    e3f7412 View commit details
  2. Merge pull request #2 from danmohad/ChemCharlesX_AdaptiveChem

    Added capability to get QSS species concentrations from kinetics
    danmohad authored Aug 7, 2019
    Copy the full SHA
    fdcee7a View commit details

Commits on Aug 21, 2019

  1. Copy the full SHA
    2d116e7 View commit details

Commits on Sep 6, 2019

  1. Fix for NERSC install

    Sometimes, NERSC's scons looks for python3, even when python has been specified as none! This fixes that.
    danmohad authored Sep 6, 2019
    Copy the full SHA
    0166a77 View commit details

Commits on Feb 1, 2020

  1. Copy the full SHA
    843efb3 View commit details

Commits on May 4, 2020

  1. Copy the full SHA
    c6b68fc View commit details

Commits on Nov 2, 2021

  1. Create compile_script_sherlock_intel.bash

    used for installing Cantera on Sherlock cluster
    jguo96 authored Nov 2, 2021
    Copy the full SHA
    593792e View commit details
  2. Merge pull request #3 from jguo96/patch-1

    Create compile_script_sherlock_intel.bash
    MatthewBonanni authored Nov 2, 2021
    Copy the full SHA
    5289b68 View commit details

Commits on Jan 26, 2022

  1. Copy the full SHA
    08c5ea7 View commit details

Commits on Feb 1, 2022

  1. Copy the full SHA
    a448e02 View commit details

Commits on Jun 14, 2022

  1. Copy the full SHA
    8fec7d9 View commit details
  2. Polynomials for collision diamaters are stored as degree 6 polynomial…

    …s but were evaluated as degree 5 polynomials (Cantera@6d2760b)
    g3bk47 committed Jun 14, 2022
    Copy the full SHA
    021bb7c View commit details

Commits on Aug 5, 2022

  1. Copy the full SHA
    690afad View commit details

Commits on Sep 21, 2022

  1. Copy the full SHA
    1de43ee View commit details

Commits on Jun 23, 2023

  1. add crit prop

    waitong94 committed Jun 23, 2023
    Copy the full SHA
    2b433d6 View commit details
19 changes: 19 additions & 0 deletions compile_script_cert_intel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)
export CANTERA_DIR=~/local/cantera/2.4.0/
export SUN_INCLUDE=~/local/sundials/2.7.0/include
export SUN_LIB=~/local/sundials/2.7.0/lib
export BOOST_DIR=/share/apps/lib/boost/1.63.0/mvapich2-2.2b-intel-16/include
export EIGEN_INCLUDE=~/local/eigen/3.2.9/eigen/

scons -j24 build prefix=$CANTERA_DIR \
CXX=icpc CC=icc FORTRAN=ifort python_package=full \
optimize_flags='-O3 -ip' \
env_vars='all' \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_DIR f90_interface=y system_eigen=y \
extra_inc_dirs=$EIGEN_INCLUDE
if [ -z "SCONS_TEST" ]; then
scons -j24 test
fi
scons -j24 install
19 changes: 19 additions & 0 deletions compile_script_mustang_intel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)
export CANTERA_DIR=~/local/cantera/2.4.0/
export SUN_INCLUDE=~/local/sundials/2.7.0/include
export SUN_LIB=~/local/sundials/2.7.0/lib
export BOOST_INCLUDE=~/local/boost/1.55.0/build/include
export EIGEN_INCLUDE=~/local/eigen/3.2.9

scons -j24 build prefix=$CANTERA_DIR \
CXX=g++ CC=gcc FORTRAN=gfortran python_package=none \
optimize_flags='-O3' \
env_vars='all' \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_INCLUDE f90_interface=y system_eigen=y \
extra_inc_dirs=$EIGEN_INCLUDE
if [ -z "SCONS_TEST" ]; then
scons -j24 test
fi
scons -j24 install
24 changes: 24 additions & 0 deletions compile_script_nersc_intel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)
# Need to have configured programming environment to 'intel' (see CharlesX/EnvironmentSetup for NERSC)
# MUST build Cantera using git-shipped Eigen version, and build CharlesX with a local version 3.2.9
export CANTERA_DIR=$UTILITIES_ROOT/Cantera/2.4.0
export SUN_INCLUDE=$UTILITIES_ROOT/Sundials/sundials-2.7.0/include
export SUN_LIB=$UTILITIES_ROOT/Sundials/sundials-2.7.0/lib
export BOOST_DIR=$UTILITIES_ROOT/boost/1.55.0

scons -j20 build prefix=$CANTERA_DIR \
CXX=CC CC=cc FORTRAN=ftn python_package=none python3_package='n'\
optimize_flags='-O3' \
thread_flags='' \
warning_flags='-Wall' \
env_vars='all' \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_DIR/include f90_interface=n system_eigen=n \
renamed_shared_libraries=n
# above line necessary for -lcantera_shared error in scons test

if [ -z "SCONS_TEST" ]; then
scons -j20 test
fi
scons -j20 install
20 changes: 20 additions & 0 deletions compile_script_onyx_gnu.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)
export CANTERA_DIR=/p/home/mbonanni/local/cantera/2.4.0
export SUN_INCLUDE=/p/home/mbonanni/local/sundials/2.7.0/include
export SUN_LIB=/p/home/mbonanni/local/sundials/2.7.0/lib
export BOOST_DIR=/p/home/mbonanni/local/boost/1.55.0/include
export EIGEN_INCLUDE=/p/home/mbonanni/local/eigen/3.2.9

export NUMPY_INCLUDE=/p/home/mbonanni/local/miniconda3/envs/charlesx/lib/python2.7/site-packages/numpy/core/include

scons -j44 build prefix=$CANTERA_DIR \
CXX=g++ CC=gcc FORTRAN=gfortran python_package=full \
optimize_flags='-O3 -march=broadwell' \
env_vars='all' \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_DIR f90_interface=y system_eigen=n extra_inc_dirs=$EIGEN_INCLUDE:$NUMPY_INCLUDE
if [ -z "SCONS_TEST" ]; then
scons -j44 test
fi
scons -j44 install
25 changes: 25 additions & 0 deletions compile_script_osx.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)

#export CANTERA_DIR=/Users/wuhao/Codes/Cantera_Chemistry/Cantera/merge_test
#export SUN_INCLUDE=/Users/wuhao/Codes/tools/sundials/2.6.2/include
#export SUN_LIB=/Users/wuhao/Codes/tools/sundials/2.6.2/lib
#export BOOST_DIR=/usr/local/Cellar/boost/1.62.0/include
#export EIGEN_INCLUDE=/usr/local/Cellar/eigen/3.2.8/include/eigen3
#
#scons -j5 build prefix=$CANTERA_DIR CXX=clang++ CC=clang python_package=full \
# sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB matlab_path=/Applications/MATLAB_R2014b.app/ \
# boost_inc_dir=$BOOST_DIR f90_interface=n system_eigen=y extra_inc_dirs=$EIGEN_INCLUDE

export CANTERA_DIR=/Users/peterma/local/cantera/2.4.0
export SUN_INCLUDE=/usr/local/Cellar/sundials/2.7.0_1/include
export SUN_LIB=/usr/local/Cellar/sundials/2.7.0_1/lib
export BOOST_DIR=/usr/local/Cellar/boost/1.63.0/include
export EIGEN_INCLUDE=/usr/local/Cellar/eigen/3.3.1/include/eigen3

scons -j4 build prefix=$CANTERA_DIR CXX=clang++ CC=clang python_package=full \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_DIR f90_interface=n system_eigen=y extra_inc_dirs=$EIGEN_INCLUDE

# scons test
scons -j4 install
20 changes: 20 additions & 0 deletions compile_script_quartz_intel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)
export CANTERA_DIR=~/local/cantera/2.4.0/
export SUN_INCLUDE=~/local/sundials/2.7.0/include
export SUN_LIB=~/local/sundials/2.7.0/lib
export BOOST_INCLUDE=~/local/boost/1.77.0/build/include
export EIGEN_INCLUDE=~/local/eigen/3.2.9

source ~/envs/charlesx_py27/bin/activate
scons -j8 build prefix=$CANTERA_DIR \
CXX=icpc CC=icc FORTRAN=ifort python_package=none \
optimize_flags='-O3 -ip' \
env_vars='all' \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_INCLUDE f90_interface=y system_eigen=y \
extra_inc_dirs=$EIGEN_INCLUDE
if [ -z "SCONS_TEST" ]; then
scons -j8 test
fi
scons -j8 install
21 changes: 21 additions & 0 deletions compile_script_sherlock_intel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)
export CANTERA_DIR=~/local/cantera/2.4.0/
export SUN_INCLUDE=~/local/sundials/2.7.0/include
export SUN_LIB=~/local/sundials/2.7.0/lib
export BOOST_INCLUDE=~/tools/boost_1_55_0/installationDir/include
export EIGEN_INCLUDE=~/local/eigen/3.2.9/eigen/

ml py-numpy/1.14.3_py27

scons -j4 build prefix=$CANTERA_DIR \
CXX=mpiicpc CC=mpiicc FORTRAN=ifort python_package=none python3_package='n' \
optimize_flags='-O3' \
env_vars='all' \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_INCLUDE f90_interface=y system_eigen=n \
extra_inc_dirs=$EIGEN_INCLUDE
if [ -z "SCONS_TEST" ]; then
scons -j4 test
fi
scons -j4 install
15 changes: 15 additions & 0 deletions compile_script_ubuntu.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)

export CANTERA_DIR=$HOME/local/cantera/2.4.0
export SUN_INCLUDE=$HOME/local/sundials/2.7.0/include
export SUN_LIB=$HOME/local/sundials/2.7.0/lib
export BOOST_DIR=${HOME}/local/boost_1_46_1/include
export EIGEN_INCLUDE=$HOME/local/eigen/3.2.9/eigen

scons -j4 build prefix=$CANTERA_DIR CXX=c++ CC=c python_package=full \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_DIR f90_interface=n system_eigen=y extra_inc_dirs=$EIGEN_INCLUDE

# scons test
scons -j4 install
19 changes: 19 additions & 0 deletions compile_script_yell_intel.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash
# Need to build SUNDIALS with -fPIC and set(CMAKE_MACOSX_RPATH 1)
export CANTERA_DIR=~/local/cantera/2.4.0/
export SUN_INCLUDE=~/local/sundials/2.7.0/include
export SUN_LIB=~/local/sundials/2.7.0/lib
export BOOST_INCLUDE=~/tools/boost_1_55_0/installationDir/include
export EIGEN_INCLUDE=~/local/eigen/3.2.9/eigen/

scons -j24 build prefix=$CANTERA_DIR \
CXX=icpc CC=icc FORTRAN=ifort python_package=full \
optimize_flags='-O3 -ip' \
env_vars='all' \
sundials_include=$SUN_INCLUDE sundials_libdir=$SUN_LIB \
boost_inc_dir=$BOOST_INCLUDE f90_interface=y system_eigen=y \
extra_inc_dirs=$EIGEN_INCLUDE
if [ -z "SCONS_TEST" ]; then
scons -j24 test
fi
scons -j24 install
1 change: 1 addition & 0 deletions include/cantera/base/FactoryBase.h
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
#include <vector>
#include <mutex>
#include <unordered_map>
#include <functional>
#include "cantera/base/ctexceptions.h"

namespace Cantera
3 changes: 3 additions & 0 deletions include/cantera/kinetics/GasQSSKinetics.h
Original file line number Diff line number Diff line change
@@ -86,6 +86,9 @@ class GasQSSKinetics : public GasKinetics

//! Calculate concentration for QSS species
virtual void calc_conc_QSS(doublereal* conc_qss);

//! Get concentration for QSS species
virtual void getConcQSS(doublereal* conc_qss);

//! Update rate for QSS
virtual void update_ROP_QSS(const doublereal* conc_qss);
4 changes: 2 additions & 2 deletions interfaces/cython/cantera/onedim.pyx
Original file line number Diff line number Diff line change
@@ -473,8 +473,8 @@ cdef class _FlowBase(Domain1D):


cdef CxxIdealGasPhase* getIdealGasPhase(ThermoPhase phase) except *:
if pystr(phase.thermo.type()) != "IdealGas":
raise TypeError('ThermoPhase object is not an IdealGasPhase')
if pystr(phase.thermo.type()) != "IdealGas" and pystr(phase.thermo.type()) != "PengRobinsonGas":
raise TypeError('ThermoPhase object is not an IdealGasPhase or PengRobinsonGasPhase')
return <CxxIdealGasPhase*>(phase.thermo)


9 changes: 9 additions & 0 deletions src/kinetics/GasQSSKinetics.cpp
Original file line number Diff line number Diff line change
@@ -486,6 +486,15 @@ void GasQSSKinetics::calc_conc_QSS(doublereal* conc_qss)
m_QSS_ok = true;
}

void GasQSSKinetics::getConcQSS(doublereal* conc_qss){
Map<VectorXd>(conc_qss, m_nSpeciesQSS) =
Map<const VectorXd>(m_conc.data() + m_start[1], m_nSpeciesQSS);
// this is hopefully faster than the corresponding for-loop:
// for (int i = 0; i < m_nSpeciesQSS; i++){
// conc_qss[i] = m_conc[i + m_start[1]];
// }
}

void GasQSSKinetics::update_ROP_QSS(const doublereal* conc_qss)
{
for (size_t i = 0; i < m_nSpeciesQSS; i++) {
2 changes: 1 addition & 1 deletion src/oneD/StFlow.cpp
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ StFlow::StFlow(IdealGasPhase* ph, size_t nsp, size_t points) :
//-------------- default solution bounds --------------------
setBounds(0, -1e20, 1e20); // no bounds on u
setBounds(1, -1e20, 1e20); // V
setBounds(2, 200.0, 1e9); // temperature bounds
setBounds(2, 75.0, 1e9); // temperature bounds
setBounds(3, -1e20, 1e20); // lambda should be negative

// mass fraction bounds
203 changes: 200 additions & 3 deletions src/thermo/PengRobinsonGasPhase.cpp
Original file line number Diff line number Diff line change
@@ -414,6 +414,206 @@ void PengRobinsonGasPhase::ReadCriticalProperties() const
omega[k] = 0.57639;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "CH4") {
IsCrit[k] = 1;
Tcrit[k] = 190.564; // K
Pcrit[k] = 4.5992e+6; // Pa
Vcrit[k] = 98.6291e-3; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.01142;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "CO") {
IsCrit[k] = 1;
Tcrit[k] = 132.86; // K
Pcrit[k] = 3.4935e+6; // Pa
Vcrit[k] = 92.1659e-3; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.05;
sigma[k] = 0.0;
dipole[k] = 0.1;
} else if (speciesName(k) == "CO2") {
IsCrit[k] = 1;
Tcrit[k] = 304.1282; // K
Pcrit[k] = 7.3773e+6; // Pa
Vcrit[k] = 94.1185e-3; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.22394;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "C2H6") {
IsCrit[k] = 1;
Tcrit[k] = 305.33; // K
Pcrit[k] = 4.8718e+6; // Pa
Vcrit[k] = 145.5604e-3; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.0993;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "C2H4") {
IsCrit[k] = 1;
Tcrit[k] = 282.35; // K
Pcrit[k] = 5.0418e+6; // Pa
Vcrit[k] = 130.9414e-3; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.0866;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "CH3OH") { // from here
IsCrit[k] = 1;
Tcrit[k] = 513; // K
Pcrit[k] = 8.01e+06; // Pa
Vcrit[k] = 0.1179; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.556;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "C2H2") {
IsCrit[k] = 1;
Tcrit[k] = 309.2; // K
Pcrit[k] = 6.25e+06; // Pa
Vcrit[k] = 0.1129; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.19;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "AC3H4") {
IsCrit[k] = 1;
Tcrit[k] = 385.4; // K
Pcrit[k] = 5.32e+06; // Pa
Vcrit[k] = 0.162; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.313;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "C2H5CHO") {
IsCrit[k] = 1;
Tcrit[k] = 515.3; // K
Pcrit[k] = 6.33e+06; // Pa
Vcrit[k] = 0.176; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.313;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "NC4H8") {
IsCrit[k] = 1;
Tcrit[k] = 419.6; // K
Pcrit[k] = 4.02e+06; // Pa
Vcrit[k] = 0.240; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.191;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "C4H6") {
IsCrit[k] = 1;
Tcrit[k] = 443.7; // K
Pcrit[k] = 4.49e+06; // Pa
Vcrit[k] = 0.219; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.255;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "C3H6") {
IsCrit[k] = 1;
Tcrit[k] = 365.0; // K
Pcrit[k] = 4.61e+06; // Pa
Vcrit[k] = 0.1813; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.144;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "NC5H10") {
IsCrit[k] = 1;
Tcrit[k] = 464.7; // K
Pcrit[k] = 3.55e+06; // Pa
Vcrit[k] = 0.3026; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.233;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "NC7H14") {
IsCrit[k] = 1;
Tcrit[k] = 537.2; // K
Pcrit[k] = 2.85e+06; // Pa
Vcrit[k] = 0.4389; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.358;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "NC10H20") {
IsCrit[k] = 1;
Tcrit[k] = 615.0; // K
Pcrit[k] = 2.2e+06; // Pa
Vcrit[k] = 0.650; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.491;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "C3H7CHO") {
IsCrit[k] = 1;
Tcrit[k] = 545.4; // K
Pcrit[k] = 5.38e+06; // Pa
Vcrit[k] = 0.2176; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.352;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "NO") {
IsCrit[k] = 1;
Tcrit[k] = 180.0; // K
Pcrit[k] = 6.48e+06; // Pa
Vcrit[k] = 0.058; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.582;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "N2O") {
IsCrit[k] = 1;
Tcrit[k] = 309.6; // K
Pcrit[k] = 7.255e+06; // Pa
Vcrit[k] = 0.097; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.165;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "NH3") {
IsCrit[k] = 1;
Tcrit[k] = 405.5; // K
Pcrit[k] = 11.35e+06; // Pa
Vcrit[k] = 0.0725; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.250;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else if (speciesName(k) == "NO2") {
IsCrit[k] = 1;
Tcrit[k] = 431.4; // K
Pcrit[k] = 1.013e+06; // Pa
Vcrit[k] = 0.169; // m3/kmol
rhocrit[k] = molecularWeight(k) / Vcrit[k]; // kg/m3
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.0;
sigma[k] = 0.0;
dipole[k] = 0.0;
} else {
IsCrit[k] = 0;
Tcrit[k] = 126.19; // K
@@ -609,10 +809,7 @@ doublereal PengRobinsonGasPhase::GetCubicRoots(doublereal a0, doublereal a1,
signArg = (arg>0)?1.0:-1.0;
v = signArg*pow(fabs(arg), 1.0/3.0);
Z = -a2/3.0 + u + v;
// printf ("single root %e of %e %e %e \n",Z, a0, a1,a2);
//printf("Z+= %f\n", Z);
} else if (fabs(Det) <= eps) {
printf ("double root \n");
arg = -q/2.0;
signArg = (arg>0)?1.0:-1.0;
u = signArg*pow(fabs(arg), 1.0/3.0);
45 changes: 45 additions & 0 deletions src/transport/ChungTransport.cpp
Original file line number Diff line number Diff line change
@@ -121,6 +121,51 @@ void ChungTransport::ReadCriticalProperties()
omega[k] = 0.0372;
dipole[k] = 0.0;
kappa[k] = 0.0;
} else if (m_thermo->speciesName(k) == "CH4") {
IsCrit[k] = 1;
Tcrit[k] = 190.564; // K
Pcrit[k] = 4.5992e+6; // Pa
Vcrit[k] = 98.6291e-3; // m3/kmol
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.01142;
dipole[k] = 0.0;
kappa[k] = 0.0;
} else if (m_thermo->speciesName(k) == "CO") {
IsCrit[k] = 1;
Tcrit[k] = 132.86; // K
Pcrit[k] = 3.4935e+6; // Pa
Vcrit[k] = 92.1659e-3; // m3/kmol
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.05;
dipole[k] = 0.1;
kappa[k] = 0.0;
} else if (m_thermo->speciesName(k) == "CO2") {
IsCrit[k] = 1;
Tcrit[k] = 304.1282; // K
Pcrit[k] = 7.3773e+6; // Pa
Vcrit[k] = 94.1185e-3; // m3/kmol
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.22394;
dipole[k] = 0.0;
kappa[k] = 0.0;
} else if (m_thermo->speciesName(k) == "C2H6") {
IsCrit[k] = 1;
Tcrit[k] = 305.33; // K
Pcrit[k] = 4.8718e+6; // Pa
Vcrit[k] = 145.5604e-3; // m3/kmol
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.0993;
dipole[k] = 0.0;
kappa[k] = 0.0;
} else if (m_thermo->speciesName(k) == "C2H4") {
IsCrit[k] = 1;
Tcrit[k] = 282.35; // K
Pcrit[k] = 5.0418e+6; // Pa
Vcrit[k] = 130.9414e-3; // m3/kmol
Zcrit[k] = (Pcrit[k] * Vcrit[k]) / (GasConstant * Tcrit[k]);
omega[k] = 0.0866;
dipole[k] = 0.0;
kappa[k] = 0.0;
} else {
cout << " Unknown or non-major species : " << m_thermo->speciesName(k)
<< ". All critical properties were set to zero." << endl;
12 changes: 10 additions & 2 deletions src/transport/GasTransport.cpp
Original file line number Diff line number Diff line change
@@ -531,13 +531,19 @@ void GasTransport::fitProperties(MMCollisionInt& integrals)
double T_save = m_thermo->temperature();
const vector_fp& mw = m_thermo->molecularWeights();
for (size_t k = 0; k < m_nsp; k++) {
double tstar = Boltzmann * 298.0 / m_eps[k];
// Scaling factor for temperature dependence of z_rot. [Kee2003] Eq.
// 12.112 or [Kee2017] Eq. 11.115
double fz_298 = 1.0 + pow(Pi, 1.5) / sqrt(tstar) * (0.5 + 1.0 / tstar) +
(0.25 * Pi * Pi + 2) / tstar;

for (size_t n = 0; n < np; n++) {
double t = m_thermo->minTemp() + dt*n;
m_thermo->setTemperature(t);
vector_fp cp_R_all(m_thermo->nSpecies());
m_thermo->getCp_R_ref(&cp_R_all[0]);
double cp_R = cp_R_all[k];
double tstar = Boltzmann * t/ m_eps[k];
tstar = Boltzmann * t / m_eps[k];
double sqrt_T = sqrt(t);
double om22 = integrals.omega22(tstar, m_delta(k,k));
double om11 = integrals.omega11(tstar, m_delta(k,k));
@@ -555,7 +561,9 @@ void GasTransport::fitProperties(MMCollisionInt& integrals)
double f_int = mw[k]/(GasConstant * t) * diffcoeff/visc;
double cv_rot = m_crot[k];
double A_factor = 2.5 - f_int;
double B_factor = m_zrot[k] + 2.0/Pi * (5.0/3.0 * cv_rot + f_int);
double fz_tstar = 1.0 + pow(Pi, 1.5) / sqrt(tstar) * (0.5 + 1.0 / tstar) +
(0.25 * Pi * Pi + 2) / tstar;
double B_factor = m_zrot[k] * fz_298 / fz_tstar + 2.0/Pi * (5.0/3.0 * cv_rot + f_int);
double c1 = 2.0/Pi * A_factor/B_factor;
double cv_int = cp_R - 2.5 - cv_rot;
double f_rot = f_int * (1.0 + c1);
16 changes: 8 additions & 8 deletions src/transport/MMCollisionInt.cpp
Original file line number Diff line number Diff line change
@@ -336,7 +336,7 @@ doublereal MMCollisionInt::omega22(double ts, double deltastar)
if (deltastar == 0.0) {
values[i-i1] = omega22_table[8*i];
} else {
values[i-i1] = poly5(deltastar, m_o22poly[i].data());
values[i-i1] = poly6(deltastar, m_o22poly[i].data());
}
}
return quadInterp(log(ts), &m_logTemp[i1], values.data());
@@ -359,7 +359,7 @@ doublereal MMCollisionInt::astar(double ts, double deltastar)
if (deltastar == 0.0) {
values[i-i1] = astar_table[8*(i + 1)];
} else {
values[i-i1] = poly5(deltastar, m_apoly[i].data());
values[i-i1] = poly6(deltastar, m_apoly[i].data());
}
}
return quadInterp(log(ts), &m_logTemp[i1], values.data());
@@ -382,7 +382,7 @@ doublereal MMCollisionInt::bstar(double ts, double deltastar)
if (deltastar == 0.0) {
values[i-i1] = bstar_table[8*(i + 1)];
} else {
values[i-i1] = poly5(deltastar, m_bpoly[i].data());
values[i-i1] = poly6(deltastar, m_bpoly[i].data());
}
}
return quadInterp(log(ts), &m_logTemp[i1], values.data());
@@ -405,7 +405,7 @@ doublereal MMCollisionInt::cstar(double ts, double deltastar)
if (deltastar == 0.0) {
values[i-i1] = cstar_table[8*(i + 1)];
} else {
values[i-i1] = poly5(deltastar, m_cpoly[i].data());
values[i-i1] = poly6(deltastar, m_cpoly[i].data());
}
}
return quadInterp(log(ts), &m_logTemp[i1], values.data());
@@ -422,7 +422,7 @@ void MMCollisionInt::fit_omega22(int degree, doublereal deltastar,
if (deltastar == 0.0) {
values[i] = omega22_table[8*(i + m_nmin)];
} else {
values[i] = poly5(deltastar, m_o22poly[i+m_nmin].data());
values[i] = poly6(deltastar, m_o22poly[i+m_nmin].data());
}
}
w[0]= -1.0;
@@ -444,7 +444,7 @@ void MMCollisionInt::fit(int degree, doublereal deltastar,
if (deltastar == 0.0) {
values[i] = astar_table[8*(i + m_nmin + 1)];
} else {
values[i] = poly5(deltastar, m_apoly[i+m_nmin].data());
values[i] = poly6(deltastar, m_apoly[i+m_nmin].data());
}
}
w[0]= -1.0;
@@ -454,7 +454,7 @@ void MMCollisionInt::fit(int degree, doublereal deltastar,
if (deltastar == 0.0) {
values[i] = bstar_table[8*(i + m_nmin + 1)];
} else {
values[i] = poly5(deltastar, m_bpoly[i+m_nmin].data());
values[i] = poly6(deltastar, m_bpoly[i+m_nmin].data());
}
}
w[0]= -1.0;
@@ -464,7 +464,7 @@ void MMCollisionInt::fit(int degree, doublereal deltastar,
if (deltastar == 0.0) {
values[i] = cstar_table[8*(i + m_nmin + 1)];
} else {
values[i] = poly5(deltastar, m_cpoly[i+m_nmin].data());
values[i] = poly6(deltastar, m_cpoly[i+m_nmin].data());
}
}
w[0]= -1.0;
28 changes: 14 additions & 14 deletions test_problems/mixGasTransport/output_blessed.txt
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
N 0.00056491
NH 0.00067404
NH2 0.00066041
NH3 0.00050222
NH3 0.00050198
NNH 0.00040495
NO 0.00041226
NO2 0.00037026
@@ -58,7 +58,7 @@
O 7.2846e-05
O2 6.232e-05
OH 7.5106e-05
H2O 5.3252e-05
H2O 5.3233e-05
HO2 6.3294e-05
H2O2 6.4253e-05
C 4.4565e-05
@@ -86,7 +86,7 @@
N 4.8126e-05
NH 7.5995e-05
NH2 7.8504e-05
NH3 4.7175e-05
NH3 4.7178e-05
NNH 5.2243e-05
NO 5.5922e-05
NO2 6.636e-05
@@ -161,16 +161,16 @@
CH2CHO 0
CH3CHO 0
Viscosity and thermal Cond vs. T
400 1.976e-05 0.0641
500 2.357e-05 0.07635
600 2.714e-05 0.08832
700 3.049e-05 0.1002
800 3.368e-05 0.112
900 3.673e-05 0.1237
1000 3.966e-05 0.1355
1100 4.247e-05 0.1471
1200 4.52e-05 0.1586
1300 4.784e-05 0.1701
400 1.982e-05 0.06442
500 2.362e-05 0.07679
600 2.717e-05 0.08886
700 3.051e-05 0.1008
800 3.369e-05 0.1128
900 3.673e-05 0.1246
1000 3.965e-05 0.1365
1100 4.246e-05 0.1482
1200 4.518e-05 0.1599
1300 4.782e-05 0.1715
Binary Diffusion Coefficients H2 vs species
H2 - H2 0.001688 0.001688
H2 - H 0.002572 0.002572
@@ -259,7 +259,7 @@ Binary Diffusion Coefficients H2 vs species
N 0.003975
NH 0.004742
NH2 0.004643
NH3 0.003503
NH3 0.003502
NNH 0.002849
NO 0.002899
NO2 0.002599
22 changes: 11 additions & 11 deletions test_problems/multiGasTransport/output_blessed.txt
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@
O 7.285e-05
O2 6.232e-05
OH 7.511e-05
H2O 5.325e-05
H2O 5.323e-05
HO2 6.329e-05
H2O2 6.425e-05
C 4.457e-05
@@ -161,16 +161,16 @@
CH2CHO 0
CH3CHO 0
Viscosity and thermal Cond vs. T
400 1.976e-05 0.06337
500 2.357e-05 0.07589
600 2.714e-05 0.08783
700 3.049e-05 0.0997
800 3.368e-05 0.1118
900 3.673e-05 0.1239
1000 3.966e-05 0.1354
1100 4.247e-05 0.1473
1200 4.52e-05 0.1591
1300 4.784e-05 0.1708
400 1.982e-05 0.06336
500 2.362e-05 0.07587
600 2.717e-05 0.08779
700 3.051e-05 0.09965
800 3.369e-05 0.1117
900 3.673e-05 0.1238
1000 3.965e-05 0.1353
1100 4.246e-05 0.1472
1200 4.518e-05 0.159
1300 4.782e-05 0.1707
Binary Diffusion Coefficients H2 vs species
H2 - H2 0.001688 0.001688
H2 - H 0.002572 0.002572