From cd2f96aa92f094e772c40554722c7ca702106c5f Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 29 Sep 2023 08:49:53 -0600 Subject: [PATCH] fixes --- Docs/sphinx/Doc_COVO.tex | 6 +++--- Docs/sphinx/Introduction.rst | 2 +- Docs/sphinx/QSS.rst | 2 +- Docs/sphinx/Transport.rst | 4 ++-- Docs/sphinx/Utility.rst | 2 +- Eos/SRK.H | 4 ++-- README.md | 2 +- Reactions/ReactorCvode.cpp | 12 ++++++------ Reactions/ReactorCvodeUtils.H | 2 +- Support/Mechanism/Models/HP_DME/mechanism.H | 2 +- .../Models/ethylene_af/CANTERA/Cantera_UPF_Global.py | 2 +- Support/ceptr/ceptr/qssa.py | 2 +- Support/ceptr/ceptr/qssa_converter.py | 10 +++++----- Support/ceptr/ceptr/qssa_reduction.py | 2 +- Support/ceptr/ceptr/symbolic_math.py | 2 +- Utility/Diagnostics/DiagFramePlane.cpp | 2 +- 16 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Docs/sphinx/Doc_COVO.tex b/Docs/sphinx/Doc_COVO.tex index f3d32c1c5..c651dbc0d 100644 --- a/Docs/sphinx/Doc_COVO.tex +++ b/Docs/sphinx/Doc_COVO.tex @@ -80,7 +80,7 @@ \subsection{Objectives and State-Of-the-Art} \begin{itemize} \item ODE equations solved (\textit{reactor type}) \item Default solver settings chosen (tolerances/order/...) -\item Linear solvers available, along with exemples of performance +\item Linear solvers available, along with examples of performance \item Changes in PelePhysics run settings \item Induced changes in the relying codes (such as PeleC) \end{itemize} @@ -112,7 +112,7 @@ \subsection{What's new chemistry-wise (in a nutshell)} %========================================= \section{Introduction to CVODE} %========================================= -Cvode is part of a software family called sundials for SUite of Nonlinear and DIfferential/ALgebraic equation Solvers~\cite{hindmarsh2005sundials}. Currently, Cvode development version is v5.0.0, while the stable release version is v4.1.0. The version used with PelePhysics is v4.0.2. Cvode can be downladed off of \href{https://computation.llnl.gov/projects/sundials/sundials-software}{the internet}. In the following, details pertaining to the methods implemented in PelePhysics are provided. The interested user is referred to the very exhaustive Cvode User-guide~\cite{CVODE:2019} for more information. +Cvode is part of a software family called sundials for SUite of Nonlinear and DIfferential/ALgebraic equation Solvers~\cite{hindmarsh2005sundials}. Currently, Cvode development version is v5.0.0, while the stable release version is v4.1.0. The version used with PelePhysics is v4.0.2. Cvode can be downloaded off of \href{https://computation.llnl.gov/projects/sundials/sundials-software}{the internet}. In the following, details pertaining to the methods implemented in PelePhysics are provided. The interested user is referred to the very exhaustive Cvode User-guide~\cite{CVODE:2019} for more information. \textit{Most of this section is adapted from the v4.1.0 Cvode Documentation.} @@ -262,7 +262,7 @@ \subsubsection{Preliminary step: Cvode and SuiteSparse} \textbf{The user is in charge of installing the proper Cvode version, as well as installing and properly linking the KLU library if sparsity features are needed.} As previously said, the \textbf{Cvode version} employed to perform all tests presented in this document is \textbf{v4.0.2}. Cvode can be downloaded by following \href{https://computation.llnl.gov/projects/sundials/sundials-software}{this link}. \\ -An "INSTALL_GUIDE.pdf" will be present in the source files, explaining how to properly install and build the needed librairies. If the KLU library is to be used, then the proper flags should be set. With the version sub-mentioned, those are "-DKLU_ENABLE" (should be set to "ON") "-DKLU_INCLUDE_DIR" (should point to the location where your "klu.h" file is) and "-DKLU_LIBRARY_DIR" (which should point to the location where your KLU library was generated). +An "INSTALL_GUIDE.pdf" will be present in the source files, explaining how to properly install and build the needed libraries. If the KLU library is to be used, then the proper flags should be set. With the version sub-mentioned, those are "-DKLU_ENABLE" (should be set to "ON") "-DKLU_INCLUDE_DIR" (should point to the location where your "klu.h" file is) and "-DKLU_LIBRARY_DIR" (which should point to the location where your KLU library was generated). The \textbf{KLU library is part of the \textit{SuiteSparse} distribution}~\cite{SuiteSparse:2019} that can be downloaded~\href{http://faculty.cse.tamu.edu/davis/suitesparse.html}{following this link}. The SuiteSparse version used for all tests presented in this document is \textbf{v4.5.0}, and we do not guarantee that the linking will properly work with subsequent releases. A "README" file will explain how to generate the KLU library. diff --git a/Docs/sphinx/Introduction.rst b/Docs/sphinx/Introduction.rst index 7bdfde9a0..bafaab84d 100644 --- a/Docs/sphinx/Introduction.rst +++ b/Docs/sphinx/Introduction.rst @@ -44,7 +44,7 @@ The objective of this user-guide is to document the CVODE-based chemistry integr - ODE equations (`reactor type`) - Default settings (tolerances/order/...) -- Linear solvers available --along with exemples of performance +- Linear solvers available --along with examples of performance - Setting-up a `PelePhysics` test case - ... diff --git a/Docs/sphinx/QSS.rst b/Docs/sphinx/QSS.rst index 2c4fd437f..e83e8d6eb 100644 --- a/Docs/sphinx/QSS.rst +++ b/Docs/sphinx/QSS.rst @@ -137,7 +137,7 @@ The formatting options are the following * ``remove_pow`` **(boolean)** will convert expressions of the type ``pow(xxx,n)`` into multiplications or division. The conversion occurs for ``n<=3`` and ``n>=-3`` consistent with optimCuda_ * ``remove_pow10`` **(boolean)** will convert expressions of the type ``pow(10,xxx)`` into ``exp(ln(10)*xxx)``, consistent with optimCuda_ * ``min_op_count`` **(integer)** counts number operations used to construct each common subexpression and replace the common subexpression if the number of operations is less or equal to ``n`` -* ``min_op_count_all`` **(integer)** is similar to ``min_op_count`` but also counts how many times that common subexpression is used later. The meaning of ``n`` is different than for ``min_op_count`` as it refers to how many more operations will be done if the common subexpression is eliminated. This option should be prefered to ``min_op_count`` as it tends to only marginally increase the file size (therefore compile time), while still being memory efficient. +* ``min_op_count_all`` **(integer)** is similar to ``min_op_count`` but also counts how many times that common subexpression is used later. The meaning of ``n`` is different than for ``min_op_count`` as it refers to how many more operations will be done if the common subexpression is eliminated. This option should be preferred to ``min_op_count`` as it tends to only marginally increase the file size (therefore compile time), while still being memory efficient. * ``gradual_op_count`` **(boolean)** is useful if ``min_op_count`` or ``min_op_count_all`` are active. It loops from 1 to ``n`` and gradually eliminate the common subexpressions. This has the advantage of ensuring that the memory footprint is strictly monotonically decreasing as `n` is increased. * ``store_in_jacobian`` **(boolean)** will use the Jacobian array as a temporary space to store intermediate variables. In particular, the last row of the Jacobian (dependence with respect to temperature) is done by finite difference which requires storing intermediate variables (production rate, forward and backward reactions). When the option is active, the ``productionRate`` function used to compute the finite difference is replaced with a ``productionRate_light`` functions where references to different parts of the Jacobian are used in place of allocating new arrays. * ``round_decimals`` **(boolean)** will round floats printed by ``sympy`` when possible to minimize character count in the ``mechanism.H`` file. diff --git a/Docs/sphinx/Transport.rst b/Docs/sphinx/Transport.rst index 6a85fb502..2394746da 100644 --- a/Docs/sphinx/Transport.rst +++ b/Docs/sphinx/Transport.rst @@ -6,7 +6,7 @@ Transport ********* -PelePhysics supports computation of several transport coefficients: dyanmic viscosity (:math:`\mu`), bulk viscosity (:math:`\xi`), thermal conductivity (:math:`\lambda`), mixture-averaged species diffusion coefficients (:math:`D_i`), and Soret coefficients/thermal diffusion ratio (:math:`\chi_i`). There are three choices of model for computing these transport coefficients: +PelePhysics supports computation of several transport coefficients: dynamic viscosity (:math:`\mu`), bulk viscosity (:math:`\xi`), thermal conductivity (:math:`\lambda`), mixture-averaged species diffusion coefficients (:math:`D_i`), and Soret coefficients/thermal diffusion ratio (:math:`\chi_i`). There are three choices of model for computing these transport coefficients: * ``Constant`` with user-specified values * ``Sutherland``, adding a simple temperature dependence to user-specified values @@ -44,7 +44,7 @@ This is another minimal model, based on the temperature dependence of viscosity \mu = \mu_{ref} \left(\frac{T}{T_{ref}} \right)^{3/2} \frac{T_{ref} + S} {T + S}, -where :math:`\mu_{ref}` is the dynamic viscosity at a reference temeprature :math:`T_{ref}` and :math:`S` is a constant. In the PelePhysics implementation, the thermal conductivity is then computed based on a user-specified Prandtl number, :math:`\lambda = \mu c_p / Pr`, where the heat capacity :math:`c_p` is evaluated using the EOS model. The user may specify constant values for the bulk viscosity and diffusvity (a single value for all species). Soret effects are not supported for this Transport model (:math:`\chi_i = 0`). +where :math:`\mu_{ref}` is the dynamic viscosity at a reference temperature :math:`T_{ref}` and :math:`S` is a constant. In the PelePhysics implementation, the thermal conductivity is then computed based on a user-specified Prandtl number, :math:`\lambda = \mu c_p / Pr`, where the heat capacity :math:`c_p` is evaluated using the EOS model. The user may specify constant values for the bulk viscosity and diffusvity (a single value for all species). Soret effects are not supported for this Transport model (:math:`\chi_i = 0`). For Sutherland transport, there are several runtime parameters that may be specified in the input file: :: diff --git a/Docs/sphinx/Utility.rst b/Docs/sphinx/Utility.rst index ec70b407e..57d173acf 100644 --- a/Docs/sphinx/Utility.rst +++ b/Docs/sphinx/Utility.rst @@ -18,7 +18,7 @@ This section provides relevant notes on using these utilities across the Pele fa Premixed Flame Initialization ============================= -Pre-computed profiles from 1D freely propogating premixed flames are used to initialize a wrinkled `flamesheet `_ in PeleLMeX, among other problems. Right now, this capability is not used in PeleC, but similar code that accomplishes the same task using data files of the same format is applied in PeleC. The code has two parts, a data container defined in ``PMFData.{H,cpp}`` that loads and stores data from the pre-computed profile, and a function defined in ``PMF.H`` that, when provided this data structure and ther bounds of a cell of interest, returns temperature, velocity, and mole fractions from that location. +Pre-computed profiles from 1D freely propagating premixed flames are used to initialize a wrinkled `flamesheet `_ in PeleLMeX, among other problems. Right now, this capability is not used in PeleC, but similar code that accomplishes the same task using data files of the same format is applied in PeleC. The code has two parts, a data container defined in ``PMFData.{H,cpp}`` that loads and stores data from the pre-computed profile, and a function defined in ``PMF.H`` that, when provided this data structure and the bounds of a cell of interest, returns temperature, velocity, and mole fractions from that location. This code has two runtime parameters that may be set in the input file: :: diff --git a/Eos/SRK.H b/Eos/SRK.H index e4a82841e..1cf59eafc 100644 --- a/Eos/SRK.H +++ b/Eos/SRK.H @@ -279,7 +279,7 @@ struct SRK Fomega[ii] * sqrtAsti[ii] * sqrtOneOverTc[ii]; // *-0.5*oneOverT*sqrtT } - // intialize sums to 0 + // initialize sums to 0 am = 0.0; dAmdT = 0.0; d2AmdT2 = 0.0; @@ -527,7 +527,7 @@ struct SRK CKMMWY(Y, wbar); Rm = Constants::RU / wbar; - // Use ideal gas to get an inital guess + // Use ideal gas to get an initial guess T = P * tau / Rm; MixingRuleAmBm(T, Y, am, bm); diff --git a/README.md b/README.md index 34f059931..b379d2c88 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # PelePhysics -*A respository of physics databases and implementation code for use with the `Pele` suite of of codes* +*A repository of physics databases and implementation code for use with the `Pele` suite of of codes* ## CEPTR diff --git a/Reactions/ReactorCvode.cpp b/Reactions/ReactorCvode.cpp index e2ef495d2..2156b9542 100644 --- a/Reactions/ReactorCvode.cpp +++ b/Reactions/ReactorCvode.cpp @@ -65,7 +65,7 @@ ReactorCvode::initCvode( int flag = CVodeSetUserData(a_cvode_mem, static_cast(a_udata)); // Call CVodeInit to initialize the integrator memory and specify the user's - // right hand side function, the inital time, and initial dependent variable + // right hand side function, the initial time, and initial dependent variable // vector a_y. flag = CVodeInit(a_cvode_mem, cF_RHS, a_time, a_y); if (utils::check_flag(&flag, "CVodeInit", 1)) { @@ -100,7 +100,7 @@ ReactorCvode::initCvode( } #else amrex::Abort( - "Shoudn't be there. solve_type sparse_direct only available with CUDA"); + "Shouldn't be there. solve_type sparse_direct only available with CUDA"); #endif } else if (a_udata->solve_type == cvode::customDirect) { #if defined(AMREX_USE_CUDA) @@ -120,7 +120,7 @@ ReactorCvode::initCvode( } #else amrex::Abort( - "Shoudn't be there. solve_type custom_direct only available with CUDA"); + "Shouldn't be there. solve_type custom_direct only available with CUDA"); #endif } else if (a_udata->solve_type == cvode::magmaDirect) { #ifdef PELE_USE_MAGMA @@ -136,7 +136,7 @@ ReactorCvode::initCvode( } #else amrex::Abort( - "Shoudn't be there. solve_type magma_direct only available with " + "Shouldn't be there. solve_type magma_direct only available with " "PELE_USE_MAGMA = TRUE"); #endif } else if (a_udata->solve_type == cvode::GMRES) { @@ -242,7 +242,7 @@ ReactorCvode::initCvode( } // Call CVodeInit to initialize the integrator memory and specify the user's - // right hand side function, the inital time, and initial dependent variable + // right hand side function, the initial time, and initial dependent variable // vector a_y. flag = CVodeInit(a_cvode_mem, cF_RHS, a_time, a_y); if (utils::check_flag(&flag, "CVodeInit", 1) != 0) { @@ -633,7 +633,7 @@ ReactorCvode::checkCvodeOptions( #endif } - // Print additionnal information + // Print additional information if (a_precond_type == cvode::sparseSimpleAJac) { int nJdata = 0; const int HP = diff --git a/Reactions/ReactorCvodeUtils.H b/Reactions/ReactorCvodeUtils.H index fee6db4d3..9a1614945 100644 --- a/Reactions/ReactorCvodeUtils.H +++ b/Reactions/ReactorCvodeUtils.H @@ -46,7 +46,7 @@ struct CVODEUserData amrex::Real* rhoesrc_ext = nullptr; // External energy forcing amrex::Real* rYsrc_ext = nullptr; // External species forcing int* mask = - nullptr; // Masking tagging cells where integration should not be perfomed + nullptr; // Masking tagging cells where integration should not be performed int* FCunt = nullptr; // Number of RHS evaluations (not used on GPU) amrex::Real gamma; // System Chem. jacobian coefficient int nbBlocks; // GPU kernel launch parameter diff --git a/Support/Mechanism/Models/HP_DME/mechanism.H b/Support/Mechanism/Models/HP_DME/mechanism.H index 53dc4df9a..7025991fa 100644 --- a/Support/Mechanism/Models/HP_DME/mechanism.H +++ b/Support/Mechanism/Models/HP_DME/mechanism.H @@ -11952,7 +11952,7 @@ CKMMWC(amrex::Real* c, amrex::Real* wtm) for (id = 0; id < 130; ++id) { sumC += c[id]; } - /* CK provides no guard against divison by zero */ + /* CK provides no guard against division by zero */ *wtm = W / sumC; return; diff --git a/Support/Mechanism/Models/ethylene_af/CANTERA/Cantera_UPF_Global.py b/Support/Mechanism/Models/ethylene_af/CANTERA/Cantera_UPF_Global.py index 1db1c0e11..e6081393c 100644 --- a/Support/Mechanism/Models/ethylene_af/CANTERA/Cantera_UPF_Global.py +++ b/Support/Mechanism/Models/ethylene_af/CANTERA/Cantera_UPF_Global.py @@ -109,7 +109,7 @@ H_W = 0.001 O_W = 0.016 N_W = 0.014 -#Bilger coefs pour formule +#Bilger coefs pour formula Bilger_coefs = np.zeros(4,'d') Bilger_coefs[0] = 2.0 / C_W Bilger_coefs[1] = 1.0 / ( 2.0 * H_W ) diff --git a/Support/ceptr/ceptr/qssa.py b/Support/ceptr/ceptr/qssa.py index 5d5afbfb9..d018caa8f 100644 --- a/Support/ceptr/ceptr/qssa.py +++ b/Support/ceptr/ceptr/qssa.py @@ -22,7 +22,7 @@ def process_qss(fname, nqssa, visualize, method): # Species with open(nqssa) as f: f_non_qssa_species = yaml.safe_load(f) - # Make sure the species are not interepreted as boolean + # Make sure the species are not interpreted as boolean if ( False in f_non_qssa_species["species"] or True in f_non_qssa_species["species"] diff --git a/Support/ceptr/ceptr/qssa_converter.py b/Support/ceptr/ceptr/qssa_converter.py index 8b67e83e2..e1e7973cb 100644 --- a/Support/ceptr/ceptr/qssa_converter.py +++ b/Support/ceptr/ceptr/qssa_converter.py @@ -463,11 +463,11 @@ def get_qssa_groups(mechanism, species_info, reaction_info): this includes two-way dependencies: (s1 needs s2) and (s2 needs s1) => group and cyclical dependencies: (s1 needs s2) and (s2 needs s3) and (s3 needs s1) => group - This function along with find_closed_cycle is an implmentation of: + This function along with find_closed_cycle is an implementation of: Tarjan's Strongly Connected Components Algorithm (1972) - where node "index" is stored implictly via the location of the + where node "index" is stored implicitly via the location of the node in the lowest_link OrderedDict and boolean "onStack" information is stored implicitly by checking for node existence in potential_group @@ -606,7 +606,7 @@ def find_closed_cycle(mechanism, species_info, species): # Since the child has been discovered already during this # search, that means it is in the group but still in the # recursion process, Update the parent's lowest link value - # with this childs discovery order + # with this child's discovery order species_info.qssa_info.lowest_link[parent] = min( species_info.qssa_info.lowest_link[parent], list(species_info.qssa_info.lowest_link.keys()).index(child), @@ -733,7 +733,7 @@ def update_group_needs(mechanism, species_info, reaction_info): not_in_group = True # for the other groups for other_group in other_groups: - # if the other group hasn't alredy been accounted + # if the other group hasn't already been accounted # for and the species is in that group, then that # other group depends on a species in the current # group @@ -793,7 +793,7 @@ def update_group_needs(mechanism, species_info, reaction_info): def update_group_dependencies(mechanism, species_info, reaction_info): - """Update solo species dependendent on group members with group names. + """Update solo species dependent on group members with group names. species needs member -> species needs group species is needed by group member -> species is needed by group diff --git a/Support/ceptr/ceptr/qssa_reduction.py b/Support/ceptr/ceptr/qssa_reduction.py index ba4f8aada..81cac8938 100644 --- a/Support/ceptr/ceptr/qssa_reduction.py +++ b/Support/ceptr/ceptr/qssa_reduction.py @@ -65,7 +65,7 @@ def remove_quadratic_method_0(mechanism, qssa_species): # Alphabetize, remove smallest set, break ties based on number of length of species name [x.sort() for x in qssa_remove_proposal] for x in qssa_remove_proposal: - print(f"Canditate QSSA species for removal: {x}") + print(f"Candidate QSSA species for removal: {x}") ordered = sorted( qssa_remove_proposal, key=lambda x: (len(x), sum([len(y) for y in x])) ) diff --git a/Support/ceptr/ceptr/symbolic_math.py b/Support/ceptr/ceptr/symbolic_math.py index cc857cfe4..140a91bb6 100644 --- a/Support/ceptr/ceptr/symbolic_math.py +++ b/Support/ceptr/ceptr/symbolic_math.py @@ -712,7 +712,7 @@ def recycle_cse_post( if ind_cse: # This is the symbol we would like to replace target_replace = ind_cse[-1] - # Make sure that we havent replaced it already + # Make sure that we haven't replaced it already while ( target_replace < n_cse and common_expr_lhs[target_replace] in to_replace diff --git a/Utility/Diagnostics/DiagFramePlane.cpp b/Utility/Diagnostics/DiagFramePlane.cpp index ad2e0a1d7..1c5f05cd7 100644 --- a/Utility/Diagnostics/DiagFramePlane.cpp +++ b/Utility/Diagnostics/DiagFramePlane.cpp @@ -47,7 +47,7 @@ DiagFramePlane::init(const std::string& a_prefix, std::string_view a_diagName) amrex::ParmParse pp(a_prefix); - // Outputed variables + // Outputted variables int nOutFields = pp.countval("field_names"); AMREX_ASSERT(nOutFields > 0); m_fieldNames.resize(nOutFields);