Skip to content

Boundary Conditions in AortaCFD

This page covers the practical configuration of inlet, outlet, and wall boundary conditions in AortaCFD. For the underlying theory, see Boundary Conditions: Concepts. For research directions not yet implemented, see Advanced Boundary Condition Methods.


1. Inlet Boundary Conditions

Configuration

AortaCFD reads CSV data files and applies velocity profiles across the inlet cross-section with automatic inlet geometry detection and orientation:

{
  "inlet": {
    "type": "TIMEVARYING",
    "csv_file": "BPM75.csv",
    "data_type": "velocity",
    "profile": "womersley",
    "orientation": "auto"
  }
}

Available Inlet Types and Profiles

Inlet Types

Type Description Required Config
CONSTANT Steady flow cardiac_output, flowrate, or velocity
TIMEVARYING Pulsatile from CSV csv_file with time-flow columns
WOMERSLEY Analytical pulsatile Computed from flow waveform
MRI Patient-specific 4D flow Pre-processed OpenFOAM boundary data

Velocity profiles: plug, parabolic, womersley, wall_distance

The wall_distance profile computes a velocity distribution based on the distance from the nearest wall, providing a smooth blending between plug and parabolic shapes suitable for non-circular inlet cross-sections.

Input Data Format

Create a CSV file with time series data:

Time,Value
0.00,0.12
0.05,0.25
0.10,0.42
0.15,0.35
0.20,0.22
0.30,0.15
0.40,0.10
0.60,0.08
0.80,0.12

Orientation Detection

{
  "inlet": {
    "orientation": "auto"  // Automatic detection using outlet positions
    // or manually specify: "in" or "out"
  }
}

Womersley Profile Implementation

AortaCFD provides a Womersley profile implementation suitable for most cardiovascular applications:

# From AortaCFD-app/src/aortacfd_lib/inlet_mapping.py
def womersley_profile(self, r, t, omega, alpha):
    """
    Womersley profile for pulsatile cardiovascular simulations
    """
    R = self.radius
    z = 1j**1.5 * alpha * r / R
    z0 = 1j**1.5 * alpha
    bessel_ratio = jv(0, z) / jv(0, z0)
    v_r_t = (1 - bessel_ratio) * np.exp(1j * omega * t)
    return np.real(v_r_t)

AortaCFD Profile Options

The application supports three inlet velocity profiles: - Plug flow: Uniform velocity across cross-section - Parabolic: Poiseuille-like profile for steady flow - Womersley: Pulsatile profile with frequency-dependent shape

Patient-Specific Data Processing

From Doppler Ultrasound

import numpy as np
import pandas as pd

def process_doppler_data(doppler_file, cardiac_period=0.8):
    """
    Convert Doppler ultrasound measurements to OpenFOAM format
    """
    data = pd.read_csv(doppler_file)
    time = np.linspace(0, cardiac_period, len(data))

    # Apply calibration factor (typically 0.5 for mean from max velocity)
    mean_velocity = data['velocity_max'] * 0.5

    with open('inletVelocity.dat', 'w') as f:
        f.write('(\n')
        for t, v in zip(time, mean_velocity):
            f.write(f'    {t:.3f}    (0 0 {v:.3f})\n')
        f.write(')\n')

2. Outlet Boundary Conditions

3-Element Windkessel Configuration

{
  "outlets": {
    "type": "3EWINDKESSEL",
    "windkessel_settings": {
      "systolic_pressure": 120,
      "diastolic_pressure": 80,
      "methodology": "murray_law_automatic",
      "enable_stabilization": true,
      "betaT": 0.3,
      "betaN": 0.0
    }
  }
}

AortaCFD computes all Windkessel parameters (R, C, Z) automatically from the blood pressure settings and outlet geometry using Murray's law. See Windkessel Theory for the mathematical derivation.

Zero-Gradient Outlets

For stability testing and initial validation:

{
  "outlets": {
    "type": "ZEROGRADIENT",
    "outlet_settings": {
      "outlet1": {"type": "fixedValue", "pressure": 0},
      "outlet2": {"type": "zeroGradient"}
    }
  }
}

Multiple Outlet Flow Monitoring

For aortic branches, use Murray's law for flow distribution:

// In system/controlDict
functions
{
    outletFlowDistribution
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");

        writeControl    timeStep;
        writeInterval   1;

        regionType      patch;
        name            outlet_1;

        operation       sum;
        fields          (phi);
    }
}

3. Wall Boundary Conditions

AortaCFD uses standard no-slip boundary conditions for vessel walls:

// From U.tpl template
{{ wall_patch }}
{
    type            fixedValue;
    value           uniform (0 0 0);
}
// From p.tpl template
{{ wall_patch }}
{
    type            zeroGradient;
}

Troubleshooting

Common Configuration Issues

Typical Problems

Problem: Simulation fails to start

  • Check CSV file format (comma-separated, no extra spaces)
  • Verify STL file units match scale_factor setting
  • Ensure orientation setting matches geometry

Problem: Unphysical results

  • Validate pressure ranges (systolic 110-140, diastolic 60-90 mmHg)
  • Check Murray's law flow distribution makes sense
  • Verify inlet flow rate is physiologically realistic

Performance Tips

  • Start with coarse mesh refinement for initial validation
  • Use plug profile for faster testing, upgrade to womersley for final results
  • Try ZEROGRADIENT outlets first, then upgrade to 3EWINDKESSEL once stable

Quick Reference

AortaCFD File Structure

AortaCFD automatically generates all necessary OpenFOAM files from the JSON configuration:

Input Files (You Provide):

  • config.json -- Main case configuration file
  • inlet.stl, outlet1.stl, etc. -- Geometry files
  • BPM75.csv -- Inlet waveform data (CSV format)

Auto-Generated Files:

  • 0/U -- Generated from inlet profile and outlet settings
  • 0/p -- Generated from outlet pressure conditions
  • 0/k, 0/omega -- Generated for RANS simulations
  • constant/boundaryData/*/points -- Inlet geometry mapping
  • constant/boundaryData/*/[time]/U -- Time-varying inlet data
  • system/controlDict -- Generated with monitoring functions
  • system/fvSchemes -- Generated based on simulation profile
  • system/fvSolution -- Generated with appropriate solvers

Configuration Parameters

Parameter Default/Typical Range Notes
Systolic pressure (mmHg) 120 110-140 Used in Windkessel calculation
Diastolic pressure (mmHg) 80 60-90 Used in Windkessel calculation
Murray's law exponent 2.7 2.5-3.0 Flow distribution calculation
Profile type "womersley" plug, parabolic, womersley Inlet velocity profile
Orientation "auto" auto, in, out Automatic detection recommended
Scale factor 0.001 - STL units to metres conversion
Cardiac period (s) 0.8 0.6-1.0 75 BPM default

Example Configuration

{
  "inlet": {
    "profile": "womersley",
    "orientation": "auto"
  },
  "outlets": {
    "type": "3EWINDKESSEL",
    "windkessel_settings": {
      "systolic_pressure": 120,
      "diastolic_pressure": 80
    }
  }
}

Further Reading

Found an issue or have a suggestion for this page?

Open a GitHub issue