aPriori Documentation
  • 👋Welcome to aPriori
  • Getting started
    • What is aPriori?
    • Installation
    • Quickstart
  • Fundamentals and usage
    • aPriori Fundamentals
      • Data Formatting
      • Cut a 3D scalar
      • Filter a 3D scalar field
      • Initialize a DNS field
      • Data visualization
      • Cut a DNS field
      • Filter a DNS field
    • Machine Learning Tutorials
      • Data-Driven Closure for Turbulence-Chemistry interaction
      • Dynamic Data-Driven Smagorinky Closure for LES
  • API guide
    • Field3D
      • Field3D.build_attributes_list
      • Field3D.check_valid_attribute
      • Field3D.compute_chemical_timescale
      • Field3D.compute_kinetic_energy
      • Field3D.compute_mixing_timescale
      • Field3D.compute_residual_kinetic_energy
      • Field3D.compute_residual_dissipation_rate
      • Field3D.compute_reaction_rates
      • Field3D.compute_reaction_rates_batch
      • Field3D.compute_strain_rate
      • Field3D.compute_tau_r
      • Field3D.compute_velocity_module
      • Field3D.cut
      • Field3D.filter_favre
      • Field3D.filter
      • Field3D.find_path
      • Field3D.plot_x_midplane
      • Field3D.plot_y_midplane
      • Field3D.plot_z_midplane
      • Field3D.print_attributes
      • Field3D.update
    • Scalar3D
      • Scalar3D.is_light_mode
      • Scalar3D.reshape_3d
      • Scalar3D.reshape_column
      • Scalar3D.reshape_line
      • Scalar3D.cut
      • Scalar3D.filter_gauss
      • Scalar3D.plot_x_midplane
      • Scalar3D.plot_y_midplane
      • Scalar3D.plot_z_midplane
    • Mesh3D
  • BIBLIOGRAPHY
Powered by GitBook
On this page
  • Field3D.compute_reaction_rates(self, n_chunks = 5000):
  • Description
  • Parameters
  • Returns
  • Raises
  • Note
  1. API guide
  2. Field3D

Field3D.compute_reaction_rates

PreviousField3D.compute_residual_dissipation_rateNextField3D.compute_reaction_rates_batch

Last updated 1 year ago

Field3D.compute_reaction_rates(self, n_chunks = 5000):


Description

Computes the source terms for a given chemical reaction system.

This function performs several steps:

  1. Checks that all the mass fractions are in the folder.

  2. Determines if the reaction rates to be computed are in DNS or LFR mode based on the filter size.

  3. Builds a list with reaction rates paths and one with the species' Mass fractions paths.

  4. Checks that the files of the reaction rates do not exist yet. If they do, asks the user if they want to overwrite them.

  5. Computes the reaction rates in chunks to handle large data sets efficiently.

  6. Saves the computed reaction rates, heat release rate, and dynamic viscosity to files.

  7. Updates the object's state.

Parameters

  • n_chunks (int, optional): The number of chunks to divide the data into for efficient computation. Default is 5000.

Returns

None

Raises

  • SystemExit: If the user chooses not to overwrite existing reaction rate files, or if there is a mismatch in the number of species and the length of the species paths list.

Note

This function uses the Cantera library to compute the reaction rates, heat release rate, and dynamic viscosity. It assumes that the object has the following attributes: attr_list, bool_list, folder_path, filter_size, species, shape, kinetic_mechanism, T, P, and paths_list. It also assumes that the object has the following methods: find_path and update.