# Surface Slice Output [Python only]

Visualize flow field variables along the intersection lines between slice planes and selected surfaces. This is particularly useful for examining boundary layer profiles, wake structures, or flow features at specific surface locations.


# 📋 Available Options

Option Description Unit
Name A descriptive name for the output
Slices Define one or more slice planes by specifying their origin and normal vector length (e.g., m)
Target Surfaces Select the surfaces that the slices will intersect with
Output Fields Select the flow variables to include in the output
Output Format Format for the output files (currently only "paraview" is supported)
Frequency How often to save outputs, in number of physical time steps steps
Frequency Offset The time step at which to start the output animation steps

# 🔍 Detailed Descriptions

# Name

A unique identifier for this specific output.

  • Example: "wing_slices"
  • Notes: Choose a descriptive name that helps identify the purpose of this output.

# Slices

A list of slice definitions, each containing name, origin, and normal.

  • Default: None (must be specified)
  • Example:
    Name: "Midspan"
    Origin: (0, 5, 0)
    Normal: (0, 1, 0)
    
  • Notes: Each slice requires a name, origin point (3D coordinates), and normal vector (does not need to be normalized).

# Target Surfaces

The surfaces that the slices will intersect with.

  • Default: None (must be specified)
  • Example: ["wing", "tail"]
  • Notes: Must reference boundary names from your mesh.

# Output Fields

The flow variables to include in the output.

  • Default: ["Cp", "Mach"]
  • Example: ["Cp", "velocity_m_per_s", "pressure_pa"]
  • Notes: See the Available Output Fields section below for a complete list.

# Output Format

The format used for the output files.

  • Default: "paraview"
  • Notes: Currently only "paraview" format is supported.

# Frequency

How often to save outputs during an unsteady simulation.

  • Default: -1 (only at the end of simulation)
  • Example: 100 (save every 100 time steps)
  • Notes: Only applicable for unsteady simulations.

# Frequency Offset

The time step at which to start the output animation.

  • Default: 0 (beginning of simulation)
  • Example: 1000 (start at time step 1000)
  • Notes: Useful when you want to skip initial transient behavior.

# 📊 Available Output Fields

# Universal Variables

  • Cp - Coefficient of pressure (non-dimensional)
  • Cpt - Coefficient of total pressure (non-dimensional)
  • gradW - Gradient of primitive solution (non-dimensional)
  • kOmega - k and omega (non-dimensional)
  • Mach - Mach number (non-dimensional)
  • mut - Turbulent viscosity (non-dimensional)
  • mutRatio - Turbulent viscosity and freestream dynamic viscosity ratio (non-dimensional)
  • nuHat - Spalart-Almaras variable (non-dimensional)
  • primitiveVars - Density, velocities (u,v,w), and pressure (non-dimensional)
  • qcriterion - Q criterion (non-dimensional)
  • residualNavierStokes - N-S residual (non-dimensional)
  • residualTransition - Transition residual (non-dimensional)
  • residualTurbulence - Turbulence residual (non-dimensional)
  • s - Entropy (non-dimensional)
  • solutionNavierStokes - N-S solution (non-dimensional)
  • solutionTransition - Transition solution (non-dimensional)
  • solutionTurbulence - Turbulence solution (non-dimensional)
  • T - Temperature (non-dimensional)
  • velocity - Velocity vector (non-dimensional)
  • velocity_x - X-component of velocity (non-dimensional)
  • velocity_y - Y-component of velocity (non-dimensional)
  • velocity_z - Z-component of velocity (non-dimensional)
  • velocity_magnitude - Magnitude of velocity vector (non-dimensional)
  • pressure - Pressure (non-dimensional)
  • vorticity - Vorticity (non-dimensional)
  • vorticityMagnitude - Vorticity Magnitude (non-dimensional)
  • wallDistance - Wall distance (non-dimensional)
  • numericalDissipationFactor - NumericalDissipationFactor sensor (non-dimensional)
  • residualHeatSolver - Heat equation residual (non-dimensional)
  • VelocityRelative - Velocity with respect to non-inertial frame (non-dimensional)
  • lowMachPreconditionerSensor - Low-Mach preconditioner factor (non-dimensional)

# Dimensioned Variables

  • velocity_m_per_s - Velocity vector (in m/s)
  • velocity_x_m_per_s - X-component of velocity (in m/s)
  • velocity_y_m_per_s - Y-component of velocity (in m/s)
  • velocity_z_m_per_s - Z-component of velocity (in m/s)
  • velocity_magnitude_m_per_s - Magnitude of velocity vector (in m/s)
  • pressure_pa - Pressure (in Pa)

# Surface-Specific Variables

  • CfVec - Skin friction coefficient vector (non-dimensional)
  • Cf - Magnitude of skin friction coefficient (non-dimensional)
  • heatFlux - Non-dimensional heat flux (non-dimensional)
  • nodeNormals - Wall normals (non-dimensional)
  • nodeForcesPerUnitArea - Forces per unit area (non-dimensional)
  • yPlus - Non-dimensional wall distance (non-dimensional)
  • wallFunctionMetric - Wall function metrics (non-dimensional)
  • heatTransferCoefficientStaticTemperature - Surface heat transfer coefficient (static temperature as reference) (non-dimensional)
  • heatTransferCoefficientTotalTemperature - Surface heat transfer coefficient (total temperature as reference) (non-dimensional)
  • wall_shear_stress_magnitude - Wall shear stress magnitude (non-dimensional)
  • wall_shear_stress_magnitude_pa - Wall shear stress magnitude (in Pa)

💡 Tips

# Key Applications

Surface Slice Output is particularly useful for:

  1. Airfoil Analysis: Extract pressure and skin friction distributions at specific spanwise locations
  2. Wing-Body Junctions: Examine flow structures at the intersection of components
  3. Heat Transfer Analysis: Examine temperature and heat flux along specific cross-sections

# Visualization Techniques

  1. Combine Surface Slice Output with standard Slice Output to see both surface and volume data along the same slice plane
  2. Use multiple slices to capture 3D effects (e.g., spanwise variations along a wing)
  3. For rotating machinery, consider using slices aligned with the rotation axis or perpendicular to it at different radial positions

❓ Frequently Asked Questions

  • How does Surface Slice Output differ from regular Slice Output?

    Regular Slice Output creates a planar cut through the entire volume domain, while Surface Slice Output only creates lines where the slice plane intersects with specified surface boundaries. Surface Slice Output is much more lightweight and is ideal for examining surface properties along specific paths.

  • Is there a limit to how many surface slices I can define?

    There is no hard limit, but each additional slice increases the output file size. For best performance, focus on key areas of interest rather than creating a large number of slices.

  • Can I generate time-averaged Surface Slice Output?

    Yes, for unsteady simulations you can create time-averaged data by using the TimeAverageSurfaceSliceOutput instead of the standard SurfaceSliceOutput. This allows you to analyze statistical properties of unsteady flows along surface intersections.

  • What happens if my slice plane doesn't intersect with any of the target surfaces?

    If no intersection is found, no data will be generated for that particular slice. The simulation will continue to run normally, but the output file will not contain data for that slice.

  • Can I use Surface Slice Output to extract boundary layer profiles?

    Surface Slice Output only provides data directly on the surface where the slice plane intersects. To capture full boundary layer profiles extending into the volume, you should use regular Slice Output with slices positioned near and perpendicular to the surface.


🐍 Python Example Usage

import flow360 as fl
from flow360 import u


# Define surface slice output
params = fl.SimulationParams(
    # ...other simulation parameters...
    outputs=[
        fl.SurfaceSliceOutput(
            name="wing_sections",
            entities=[
                fl.Slice(
                    name="root",
                    origin=(0, 0, 0),
                    normal=(0, 1, 0)
                ),
                fl.Slice(
                    name="mid_span",
                    origin=(0, 5, 0) * u.m,
                    normal=(0, 1, 0)
                ),
                fl.Slice(
                    name="tip",
                    origin=(0, 10, 0) * u.m,
                    normal=(0, 1, 0)
                )
            ],
            target_surfaces=[
                volume_mesh["wing_upper"], 
                volume_mesh["wing_lower"]
            ],
            output_fields=["Cp", "Mach", "velocity_m_per_s"],
            frequency=100,  # Save every 100 time steps
        )
    ]
)