# Inflow Boundary Condition

# 📝 Inflow Boundary

The Inflow boundary condition specifies flow entering the computational domain, allowing you to define inlet conditions for internal flow simulations or when inlet conditions differ from the global freestream.


# 📋 Available Options

Option Description Unit
Entities Geometric boundaries to apply the inflow condition
Total Temperature Stagnation temperature at the inlet temperature (e.g., K)
Inflow Specification Method to specify the inflow various
Total Pressure Stagnation pressure at the inlet pressure (e.g., Pa)
Mass Flow Rate Mass flow through the inlet mass flow (e.g., kg/s)
Ramp Steps [python only] Number of steps to gradually apply mass flow rate dimensionless
Turbulence Quantities Specification of turbulence parameters various

# 🔍 Detailed Descriptions

# Entities

Specifies the geometric boundaries to which the inflow boundary condition is applied.

  • Accepted types: Surface
  • Example: entities=volume_mesh["fluid/inlet"]
  • Notes: Can reference surfaces by name or pattern using the mesh or geometry.

# Total Temperature

The stagnation (total) temperature of the flow at the inlet boundary.

  • Default: None (must be specified)
  • Example: 300 K
  • Notes: This is the temperature the flow would have if brought to rest adiabatically.

# Inflow Specification

Method used to specify the inflow conditions.

  • Options:
    • Total Pressure
    • Mass Flow Rate
  • Default: None (one must be selected)
  • Notes: Choose the method that best matches your known boundary conditions.

# Total Pressure

The stagnation (total) pressure of the flow at the inlet boundary. Available when Inflow Specification is set to "Total Pressure".

  • Default: None (must be specified)
  • Example: 101325 Pa
  • Notes: This is the pressure the flow would have if brought to rest isentropically.

# Mass Flow Rate

The mass flow rate through the inlet boundary. Available when Inflow Specification is set to "Mass Flow Rate".

  • Default: None (must be specified)
  • Example: 10 kg/s
  • Notes: The solver will adjust the inlet velocity to achieve the specified mass flow rate.

# Ramp Steps [Python only]

The number of pseudo time steps over which to gradually increase the mass flow rate to the specified value.

  • Default: None (full mass flow rate applied immediately)
  • Example: 100
  • Notes:
    • Only available when using Mass Flow Rate specification
    • Helps with simulation stability for high flow rates
    • The flow rate increases linearly from zero to the target value over the specified number of steps

# Turbulence Quantities

Optional specification of turbulence parameters at the boundary.

  • Options: Various parameter combinations
  • Default: Uses global defaults based on turbulence model
  • Example: Turbulence Intensity = 0.05, Turbulent Length Scale = 0.01 m
  • Notes:

💡 Tips

# Choosing Inflow Specification Method

  • Total Pressure: This specification is often best suited when:

    • You know the pressure at the inlet (e.g., atmospheric conditions).
    • Flow rate should be a calculated result rather than an input.
    • You are modeling external aerodynamics applications.
  • Mass Flow Rate: This specification is often best suited when:

    • You know the precise flow rate (e.g., from a pump or fan).
    • You are modeling HVAC, engine inlets, or other applications with known flow rates.
    • You need to match experimental flow conditions.

# Inlet Placement

  • Place inlets where flow conditions are known and relatively uniform
  • Allow sufficient distance upstream of complex geometry (5-10 characteristic lengths)
  • Avoid placing inlets immediately upstream of sharp turns or area changes

# Convergence Strategies

  • Start with a lower mass flow rate and gradually increase it
  • Monitor residuals and mass conservation to ensure proper convergence
  • For challenging cases, first converge a simpler solution and then introduce the inlet

# Turbulence Specification

For recommendations on turbulence parameter values for various flow conditions, see the Turbulence Quantities documentation.


❓ Frequently Asked Questions

  • Should I use Total Pressure or Mass Flow Rate specification?

    Use Total Pressure when you know the driving pressure but not the exact flow rate. Use Mass Flow Rate when you need to ensure a specific flow rate regardless of the pressure required.

  • What happens if my inlet is too close to an obstacle?

    Placing an inlet too close to obstacles can cause unrealistic flow patterns and convergence issues. Try to maintain at least 5 characteristic lengths of straight, uniform flow upstream of complex geometry.

  • How does the solver handle Mass Flow Rate specifications?

    The solver adjusts the inlet velocity profile to achieve the specified mass flow rate while maintaining the specified total temperature and computed static pressure distribution.

  • What inlet turbulence values should I use?

    For common internal flows:

    • Fully developed pipe flow: Intensity ~5%, Length scale ~7% of diameter
    • Flow from nozzles: Intensity 1-5%, Length scale based on nozzle dimensions
    • HVAC ducts: Intensity 5-10%, Length scale based on hydraulic diameter
  • When should I use the Ramp Steps option? [python only]

    Use Ramp Steps when:

    • Simulating high flow rates that might cause initialization issues
    • Encountering convergence problems with immediate application of the full flow rate
    • Starting from an existing solution and significantly changing the flow conditions

🐍 Python Example Usage

# Example of an inlet with total pressure specification
pressure_inlet = fl.Inflow(
    name="pressure_inlet",
    entities=[volume_mesh["fluid/inlet"]],
    total_temperature=300 * fl.u.K,
    spec=fl.TotalPressure(
        value=101325 * fl.u.Pa,
        velocity_direction=(1.0, 0.0, 0.0)  # Flow in x-direction
    )
)

# Example of an inlet with mass flow specification
mass_flow_inlet = fl.Inflow(
    name="mass_flow_inlet",
    entities=[volume_mesh["fluid/inlet"]],
    total_temperature=350 * fl.u.K,
    spec=fl.MassFlowRate(
        value=5 * fl.u.kg / fl.u.s,
        ramp_steps=100
    )
)

# Example with turbulence specifications for k-ω SST model
turbulent_inlet = fl.Inflow(
    name="turbulent_inlet",
    entities=[volume_mesh["fluid/inflow"]],
    total_temperature=300 * fl.u.K,
    spec=fl.TotalPressure(
        value=200000 * fl.u.Pa
    ),
    turbulence_quantities=fl.TurbulenceQuantities(
        turbulent_intensity=0.05,  # 5% turbulence intensity
        turbulent_length_scale=0.02 * fl.u.m
    )
)

# Example for Spalart-Allmaras model
sa_inlet = fl.Inflow(
    name="sa_inlet",
    entities=[volume_mesh["fluid/inflow"]],
    total_temperature=300 * fl.u.K,
    spec=fl.MassFlowRate(
        value=10 * fl.u.kg / fl.u.s
    ),
    turbulence_quantities=fl.TurbulenceQuantities(
        modified_viscosity_ratio=5.0
    )
)