Porous Media

Turn an undefined part into a porous medium and define its characteristics for simulation purposes.

  1. On the Fluids ribbon, select the Porous Media tool.

  2. Select one or more undefined parts as porous media.
  3. In the microdialog, define the characteristics of the porous medium.
    Option Description
    Porosity Direction Choose between isotropic or unidirectional permeability.
    Flow Direction Click the button, then select a face on the porous medium to indicate the fluid flow direction.
    Note: This control is active only when unidirectional porosity is selected.
    Move Click the button, then use the move tool to change the angle of the fluid flow through the porous medium.
    Note: This control is active only when unidirectional porosity is selected.
    Specific Heat Enter the specific heat of the porous medium.
    Conductivity Enter the conductivity of the porous medium.
    Porosity Enter the porosity of the porous medium.
    Viscous Resistance Enter the viscous resistance coefficient for the porous medium.
    Inertial Resistance Enter the inertial resistance coefficient for the porous medium.
  4. Optional: If you don't already know the viscous resistance and the inertial resistance of your porous medium, you can calculate them with a Python script.
    1. In the ribbon menu, select View > Python Window, or, type fn+F4 on your keyboard.
      The Python window opens.
    2. In the Python window, enter the following code to run a pressure loss based calculation:
      import numpy as np
      import matplotlib.pyplot as plt
      
      ########## Begin User Inputs ##########
      fluid_viscosity    = 1.781e-5  # dynamic viscosity of the fluid [N·s/m2]
      fluid_density      = 1.225     # density of the fluid [kg/m^3]
      porous_zone_length = 0.1       # length of the porous zone [m]
      
      # Pressure Vs Velocity Data
      velocity = np.array([0.0, 0.1, 0.2, 0.3])          # fluid velocity u [m/s]
      pressure_loss = np.array([0.0, 0.01, 0.02, 0.04])  # pressure difference ΔP [N/m2] across the porous zone
      
      ########## End User Inputs ##########
      
      # Parabolic curve-fit with ΔP = A * u + B * u^2
      coefficients = np.polyfit(velocity, pressure_loss, 2)
      B = coefficients[0]
      A = coefficients[1]
      
      delta_p_fit = A * velocity + B * velocity**2
      plt.scatter(velocity, pressure_loss, color='red', label='data')
      plt.plot(velocity, delta_p_fit, label=f'fitting: ΔP = {A:.4f} * u + {B:.4f} * u^2', color='blue')
      
      plt.xlabel('Velocity u [m/s]')
      plt.ylabel('Pressure Loss ΔP [Pa]')
      plt.title('Pressure Loss vs. Velocity')
      plt.legend()
      plt.grid(True)
      plt.show()
      
      # Limit A to positive value while calculating d
      d = max(0, A) / (fluid_viscosity * porous_zone_length)
      f = 2 * B / (fluid_density * porous_zone_length)
      
      # Print coefficients
      print(f"Curve-fit Coefficients A = {A:.4f}, B = {B:.4f}")
      print(f"Viscous  Resistance = {d:.6f} 1/m^{2}")
      print(f"Inertial Resistance = {f:.6f} 1/m")
      Then, substitute your own data for fluid_viscosity, fluid_density, porous_zone_length, the velocity = np.array series, and the pressure_loss = np.array series.

      OR

      Enter the following code to run a perforated plate based calculation:
      import numpy as np
      
      ########## Begin User Inputs ##########
      
      # physical parameters of the perforated plate
      porosity              = 0.8  # porosity, dimensionless, 0 < eps <= 1. Do not use 0.
      hole_diameter         = 0.003  # circular hole diameter [m]
      porous_zone_thickness = 0.025  # thickness of porous zone [m]
      
      ########## End User Inputs ##########
      
      K = porosity * hole_diameter * hole_diameter * porous_zone_thickness / (32 * porous_zone_thickness + 15 * hole_diameter)
      
      laminar_flow = True
      if (laminar_flow):
        # If the flow is laminar
        alpha = 3 * (1 - porosity) / (4 * porosity * porosity * porous_zone_thickness)
      else:
        # If the flow is turbulent
        delta_over_D = porous_zone_thickness / hole_diameter
        alpha = 9 * (6 * delta_over_D - 5 * delta_over_D * delta_over_D) / (40 * porosity * porosity * porous_zone_thickness)
      
      viscous_resistance = 1 / K
      inertial_resistance = 2 * max(0, alpha)
      
      # Print coefficients
      print(f"Coefficients K = {K:.8f}, alpha = {alpha:.8f}")
      print(f"Viscous Resistance = {viscous_resistance:.6f} 1/m^{2}")
      print(f"Inertial Resistance = {inertial_resistance:.6f} 1/m")
      Then, substitute your own data for porosity, hole_diameter, and porous_zone_thickness.
    3. Press the Enter key.
    4. Copy the result for viscous resistance and inertial resistance into their respective fields in the microdialog.
    For more information on Python scripts and Inspire, see Inspire Python API.