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_strain_rate(self, save_derivatives=False, save_tensor=True, verbose=False):
  • Description
  • Parameters
  • Returns
  • Raises
  • Workflow
  • Example
  1. API guide
  2. Field3D

Field3D.compute_strain_rate

PreviousField3D.compute_reaction_rates_batchNextField3D.compute_tau_r

Last updated 1 year ago

Field3D.compute_strain_rate(self, save_derivatives=False, save_tensor=True, verbose=False):


Description

Computes the strain rate or the derivatives of the velocity components (U, V, W) over a 3D mesh.

Parameters

  • save_derivatives (bool, optional): If True, saves the derivatives of the velocity components as files in the main folder. Defaults to False.

  • save_tensor (bool, optional): If True, saves the strain rate tensor as a file in the main folder. Defaults to True.

  • verbose (bool, optional): If True, prints out progress information. Defaults to False.

Returns

None

Raises

  • TypeError: If U, V, W are not instances of Scalar3D or if mesh is not an instance of Mesh3D.

  • ValueError: If U, V, W and mesh do not have the same shape.

Workflow

  1. Preprocess:

    • Sets the closure type based on the filter size.

    • Retrieves necessary attributes and initializes variables.

  2. Compute Derivatives:

    • Computes derivatives of the velocity components in all three directions.

    • Saves derivatives as files if save_derivatives is True.

  3. Compute Strain Rate Tensor:

    • Computes the strain rate tensor components by averaging appropriate velocity component derivatives.

    • Saves the strain rate tensor as a file if save_tensor is True.

Example

>>> field = Field3D('your_folder_path')
>>> field.compute_strain_rate(save_derivatives=True, save_tensor=True, verbose=True)