diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index a909bde..81587c0 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -4,7 +4,14 @@ on: push: branches: - master - - "release/v[0-9].[0-9].[0-9]" + - 'release/v[0-9]+\.[0-9]+\.[0-9]+' + - "feature/**" + pull_request: + types: + - opened + - synchronize + branches: + - 'release/v[0-9]+\.[0-9]+\.[0-9]+' - "feature/**" # Manual trigger workflow_dispatch: diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..31c2580 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,28 @@ +name: Spell check + +on: + push: + branches: + - master + - 'release/v[0-9]+\.[0-9]+\.[0-9]+' + - "feature/**" + pull_request: + types: + - opened + - synchronize + branches: + - 'release/v[0-9]+\.[0-9]+\.[0-9]+' + - "feature/**" + # Manual trigger + workflow_dispatch: + +jobs: + check: + name: Codespell + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + with: + check_filenames: true + skip: "**/*.svg" diff --git a/CMakeLists.txt b/CMakeLists.txt index cf8c905..e9d1e48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ if(NOT DEFINED LIB_PATH) message(FATAL_ERROR "Path to dependencies must be specified." " All dependencies must be available in the same directory." - " Use -DLIB_PATH=/path/to/dependenices to set this path." + " Use -DLIB_PATH=/path/to/dependencies to set this path." ) else() list(APPEND CMAKE_PREFIX_PATH ${LIB_PATH}) diff --git a/README.md b/README.md index 09c77f9..156e2f1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ # ChemTools + ChemTools is a collection of thermochemical tools for certain chemical and combustion applications. ## Status + This project is currently in the early stages of development. All the necessary infrastructure is in place though. The work on the core applications is in progress. ## Description + Ultimately, the following applications will become available: + - Chemical reactor with one or two properties held constant: - pressure, - volume, @@ -14,31 +18,36 @@ Ultimately, the following applications will become available: - Chemical reactor with user-defined Python scripts providing functions for: - the volume and its time derivative as a function of time, or - the temperature and pressure as a function of time. -- One-dimensional premixed flames. +- One-dimensional premixed flames. - Flamelet library generator using: - the β-PDF approach, or - the Presumed Mapping Function approach. ## Language, build configuration and testing + ChemTools: + - is written in C++14, - has CMake support, and - includes automated unit tests. ## How to build + - To build the code: - mkdir build && cd build - - cmake -DLIB_PATH=/path/to/dependcies /path/to//ChemTools/ + - cmake -DLIB_PATH=/path/to/dependencies /path/to//ChemTools/ - To build the tests (in-source possible for now because some tests use relative paths): - cd path/to//ChemTools/ - mkdir build - - cmake -DLIB_PATH=/path/to/dependcies -DTEST_VERBOSE=ON ../tests -Notes: + - cmake -DLIB_PATH=/path/to/dependencies -DTEST_VERBOSE=ON ../tests + Notes: - Option LIB_PATH adds the specified path to CMAKE_PREFIX_PATH. Please refer to the next section for a complete list of dependencies. - Option TEST_VERBOSE is used to log some tests results to standard output. By default it is set to OFF. ## Dependencies + ChemTools relies on a number of excellent third-party libraries: + - [Cantera](https://github.com/Cantera/cantera) for the computation of thermodynamic and transport properties, and chemical kinetics, - [Sundials](https://github.com/LLNL/sundials) for the numerical solution of systems of ordinary differential equations, - [eigen](https://gitlab.com/libeigen/eigen) for numerical linear algebra computations, @@ -52,10 +61,13 @@ ChemTools relies on a number of excellent third-party libraries: - various Boost libraries. ## Platforms + Chemtools is developed and tested under Linux. Build tested with GCC versions 7.3.0 and 11.2.0 and CMake version 3.20.2. ## Documentation + Documentation will be made available as soon some basic applications are published. ## License + ChemTools is distributed under the MIT license. diff --git a/include/embedded_python/helper.hpp b/include/embedded_python/helper.hpp index fdd0122..5f96209 100644 --- a/include/embedded_python/helper.hpp +++ b/include/embedded_python/helper.hpp @@ -10,7 +10,7 @@ namespace CppPy { /* - Initialises and finalises the Python interprete + Initialises and finalises the Python interpreter When needed, a single instance should be created during initialisation */ diff --git a/include/input/parser.hpp b/include/input/parser.hpp index bcc179f..e2f4f69 100644 --- a/include/input/parser.hpp +++ b/include/input/parser.hpp @@ -15,7 +15,7 @@ namespace Input // YAML parser void Parse(); - // vaildation of parsed input + // validation of parsed input void Validate() const; public: diff --git a/include/results/hdf5_writer.hpp b/include/results/hdf5_writer.hpp index 34293ac..eb9cdd1 100644 --- a/include/results/hdf5_writer.hpp +++ b/include/results/hdf5_writer.hpp @@ -36,7 +36,7 @@ namespace Results // opens the results file void OpenFile(); - // creates gropus of registered variables + // creates groups of registered variables void CreateGroups(); // creates scalar datasets in groups diff --git a/include/results/observer.hpp b/include/results/observer.hpp index e76c069..398d7d5 100644 --- a/include/results/observer.hpp +++ b/include/results/observer.hpp @@ -21,7 +21,7 @@ namespace Results virtual void Update(class Subject&) = 0; }; - // Meta of registerd variables + // Meta of registered variables class Meta { public: diff --git a/scripts/dependencies_installer/BoostInstaller.psm1 b/scripts/dependencies_installer/BoostInstaller.psm1 index 126ade3..01af281 100644 --- a/scripts/dependencies_installer/BoostInstaller.psm1 +++ b/scripts/dependencies_installer/BoostInstaller.psm1 @@ -67,7 +67,7 @@ class BoostInstaller { } } - hidden [void] Downlaod() { + hidden [void] Download() { $VersionUnderScore = $this.Tag.Replace('.', '_') $this.Stem = $this.Name + '_' + $VersionUnderScore $FileName = $this.Stem + ($Global:IsLinux ? '.tar.gz' : '.zip') @@ -108,7 +108,7 @@ class BoostInstaller { Start-Process -FilePath ('./bootstrap' + ($Global:IsLinux ? '.sh' : '.bat')) -Wait -NoNewWindow $ExitCode = $LASTEXITCODE if ( $ExitCode -ne 0 ) { - throw ('Failed to boostrap boost.') + throw ('Failed to bootstrap boost.') } Pop-Location } @@ -148,7 +148,7 @@ class BoostInstaller { [void] Run() { if ($this.DoInstall) { Utilities\PrintDecoratedMessage $this.Name "Start" - $this.Downlaod() + $this.Download() $this.Extract() $this.Bootstrap() $this.Install() diff --git a/scripts/dependencies_installer/InstallDependencies.ps1 b/scripts/dependencies_installer/InstallDependencies.ps1 index bd0cb30..d102f4c 100644 --- a/scripts/dependencies_installer/InstallDependencies.ps1 +++ b/scripts/dependencies_installer/InstallDependencies.ps1 @@ -293,7 +293,7 @@ catch { } Write-Host ( ` - "`nAll dependncies are now installed!`n" ` + "`nAll dependencies are now installed!`n" ` + "`nYou must now either:`n" ` + (" - add {0} to your path before building, or`n" -f $Global:InstallDir) ` + (" - configure the build with -DCMAKE_PREFIX_PATH={0}." -f $Global:InstallDir) ` diff --git a/src/input_parser.cpp b/src/input_parser.cpp index 59e27c1..ca4e1cd 100644 --- a/src/input_parser.cpp +++ b/src/input_parser.cpp @@ -272,7 +272,7 @@ namespace Input { throw std::runtime_error(fmt::format("Input error: found invalid species: [{}].\n", invalid_species)); } - } // existance scope + } // existence scope // check if species are positive { diff --git a/src/results/hdf5_writer.cpp b/src/results/hdf5_writer.cpp index 21ed3fb..8224965 100644 --- a/src/results/hdf5_writer.cpp +++ b/src/results/hdf5_writer.cpp @@ -139,7 +139,7 @@ namespace Results void HDF5Writer::CreateGroups() { std::vector const& scalars = subject.results_meta.scalars; - // extract unique group names and and cerate groups + // extract unique group names and and create groups std::unordered_set unique_groups; // scalar for (auto it_scalars = scalars.begin(); it_scalars != scalars.end(); ++it_scalars) diff --git a/src/sundials/cvode/interface.cpp b/src/sundials/cvode/interface.cpp index bd7c4f2..a7f6a24 100644 --- a/src/sundials/cvode/interface.cpp +++ b/src/sundials/cvode/interface.cpp @@ -246,7 +246,7 @@ namespace SUNDIALS } // initialize the integrator memory and specify the user's - // right hand side function in u'= f(t,u), the inital time, + // right hand side function in u'= f(t,u), the initial time, // and the initial dependent variable vector u ret_code = CVodeInit(memory, Client::RightHandSideCallback, @@ -399,7 +399,7 @@ namespace SUNDIALS return ret_code; } - // set the maximum number of nonlinear iteartions + // set the maximum number of nonlinear iterations ret_code = CVodeSetMaxNonlinIters(memory, solver_ctrl.max_nonlin_iters); if (ret_code != CV_SUCCESS) { @@ -449,7 +449,7 @@ namespace SUNDIALS This method returns a success, warning or failure code to the client code. The client code must: - decide what to do in case of failure - - assess the impact of warnings when they occurr + - assess the impact of warnings when they occur */ int IStrategy::Integrate(realtype const time_target) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 93f7c39..577932c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -60,7 +60,7 @@ if(NOT DEFINED LIB_PATH) message(FATAL_ERROR "Path to dependencies must be specified." " All dependencies must be available in the same directory." - " Use -DLIB_PATH=/path/to/dependenices to set this path." + " Use -DLIB_PATH=/path/to/dependencies to set this path." ) else() list(APPEND CMAKE_PREFIX_PATH ${LIB_PATH})