Mathematical Equations

Conceptual Overview

The multi_equations module is the mathematical heart of the OpenFLASH package. It contains the Python implementations of the core analytical functions required for the Matched Eigenfunction Expansion Method (MEEM), including radial and vertical eigenfunctions, their derivatives, coupling integrals, and terms for constructing the final linear system.

Warning

Most functions in this module are low-level mathematical components used internally by the MEEMEngine. The average user will typically only need to interact with the User-Facing Utility Functions listed below. The other sections are provided for developers and researchers interested in the underlying mathematical theory.

User-Facing Utility Functions

These are high-level helper functions that you may need to use when setting up a simulation.

openflash.multi_equations.omega(m0, h, g)[source]
openflash.multi_equations.wavenumber(omega, h)[source]

Core Mathematical Components

This section details the core mathematical building blocks of the MEEM formulation. These functions are primarily called by the MEEMEngine during the matrix assembly process.

Wavenumber Computations

These functions determine the wavenumbers for the exterior fluid domain.

openflash.multi_equations.m_k_entry(k, m0, h)[source]
openflash.multi_equations.lambda_ni(n, i, h, d)[source]

Coupling Integrals

These functions compute the integrals that couple the vertical eigenfunctions at the boundaries between adjacent fluid regions.

openflash.multi_equations.I_nm(n, m, i, d, h)[source]
openflash.multi_equations.I_mk(m, k, i, d, m0, h, m_k_arr, N_k_arr)[source]

Radial Eigenfunctions

These functions define the radial variation of the potential in each type of fluid domain. They include the functions themselves, their derivatives, and optimized vectorized versions used for post-processing.

Interior Regions (Bessel I)

openflash.multi_equations.R_1n(n, r, i, h, d, a)[source]
openflash.multi_equations.diff_R_1n(n, r, i, h, d, a)[source]
openflash.multi_equations.R_1n_vectorized(n, r, i, h, d, a)[source]

Vectorized version of the R_1n radial eigenfunction. FIXED: Handles i!=0 case for n=0 to match scalar R_1n.

openflash.multi_equations.diff_R_1n_vectorized(n, r, i, h, d, a)[source]

Vectorized derivative of the diff_R_1n radial function. FIXED: Handles i!=0 case for n=0 to match scalar version.

Intermediate Regions (Bessel K)

openflash.multi_equations.R_2n(n, r, i, a, h, d)[source]
openflash.multi_equations.diff_R_2n(n, r, i, h, d, a)[source]
openflash.multi_equations.R_2n_vectorized(n, r, i, a, h, d)[source]

Vectorized version of the R_2n radial eigenfunction. LEGACY MODE: Anchored at Outer Radius (a[i]).

openflash.multi_equations.diff_R_2n_vectorized(n, r, i, h, d, a)[source]

Exterior Region (Hankel & Bessel K)

openflash.multi_equations.Lambda_k(k, r, m0, a, m_k_arr)[source]
openflash.multi_equations.diff_Lambda_k(k, r, m0, a, m_k_arr)[source]
openflash.multi_equations.Lambda_k_vectorized(k, r, m0, a, m_k_arr)[source]

Vectorized version of the exterior region radial eigenfunction Lambda_k.

openflash.multi_equations.diff_Lambda_k_vectorized(k, r, m0, a, m_k_arr)[source]

Vectorized derivative of the exterior region radial function Lambda_k.

Vertical Eigenfunctions

These functions define the vertical variation of the potential in each type of fluid domain.

Interior & Intermediate Regions

openflash.multi_equations.Z_n_i(n, z, i, h, d)[source]
openflash.multi_equations.diff_Z_n_i(n, z, i, h, d)[source]
openflash.multi_equations.Z_n_i_vectorized(n, z, i, h, d)[source]

Vectorized version of the i-region vertical eigenfunction Z_n_i.

openflash.multi_equations.diff_Z_n_i_vectorized(n, z, i, h, d)[source]

Vectorized derivative of the Z_n_i vertical function.

Exterior Region

openflash.multi_equations.N_k_multi(k, m0, h, m_k_arr)[source]
openflash.multi_equations.Z_k_e(k, z, m0, h, NMK, m_k_arr)[source]
openflash.multi_equations.diff_Z_k_e(k, z, m0, h, NMK, m_k_arr)[source]
openflash.multi_equations.Z_k_e_vectorized(k, z, m0, h, m_k_arr, N_k_arr)[source]

Vectorized version of the e-region vertical eigenfunction Z_k_e. This version uses pre-calculated m_k_arr and N_k_arr for efficiency.

openflash.multi_equations.diff_Z_k_e_vectorized(k, z, m0, h, m_k_arr, N_k_arr)[source]

Vectorized derivative of the e-region vertical eigenfunction Z_k_e. This version uses pre-calculated m_k_arr and N_k_arr for efficiency.

Particular Solution & Hydrodynamic Terms

These functions are related to the non-homogeneous parts of the solution and the final calculation of physical coefficients.

openflash.multi_equations.phi_p_i(d, r, z, h)[source]
openflash.multi_equations.diff_r_phi_p_i(d, r, h)[source]
openflash.multi_equations.diff_z_phi_p_i(d, z, h)[source]
openflash.multi_equations.int_R_1n(i, n, a, h, d)[source]
openflash.multi_equations.int_R_2n(i, n, a, h, d)[source]

Computes the integral of R_2n(r) * r dr from inner_r to outer_r. LEGACY MODE: Matches old_assembly.py (Outer Radius Anchor).

openflash.multi_equations.excitation_force(damping, m0, h)[source]