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_batch(self, n_chunks = 5000, tau_c='SFR', tau_m='Kolmo'):
  • Description
  • Parameters
  • Raises
  • Workflow
  • Returns
  • Example
  1. API guide
  2. Field3D

Field3D.compute_reaction_rates_batch

PreviousField3D.compute_reaction_ratesNextField3D.compute_strain_rate

Last updated 1 year ago

Field3D.compute_reaction_rates_batch(self, n_chunks = 5000, tau_c='SFR', tau_m='Kolmo'):


Description

Computes the reaction rates in batches for a filtered field.

This method calculates reaction rates in chunks for a filtered field, suitable for large datasets. The reaction rates can be computed in different modes specified by tau_c and tau_m.

Parameters

  • n_chunks (int, optional): Number of chunks to divide the field into for batch processing. Default is 5000.

  • tau_c (str, optional): Mode for computing the chemical timescale. Default is 'SFR'.

  • tau_m (str, optional): Mode for computing the mixing timescale. Default is 'Kolmo'.

Raises

  • ValueError: If the field is not filtered or if the species' molar concentrations and reaction rates are not in the data folder.

  • AttributeError: If required attributes (attr_list, bool_list, folder_path) are not defined.

Workflow

  1. Validation:

    • Ensures all mass fractions are in the folder.

    • Confirms the field is filtered and sets the mode to 'Batch'.

  2. Paths Preparation:

    • Builds lists for reaction rates paths and species' mass fractions paths.

    • Checks if the reaction rates files already exist and prompts the user for confirmation to overwrite them.

  3. Reaction Rates Computation:

    • Initializes chunk generators for temperature, pressure, density, and timescales.

    • Computes reaction rates and heat release rates in chunks using the Cantera library.

    • Saves computed chunks to respective files.

Returns

None

Example

>>> field = Field3D('your_folder_path')
>>> field.compute_reaction_rates_batch(n_chunks=5000, tau_c='SFR', tau_m='Kolmo')