Skip to main content

Python utilities for DUST pre- and postprocessing

Project description

PyDUST Utils

PyPI version Python 3.9+ License: MIT

Python utilities for DUST pre- and post-processing.

Features

  • Mesh Generation: Create pointwise and parametric meshes for DUST simulations
  • C81 Airfoil Data: Generate aerodynamic tables using NeuralFoil/AeroSandbox
  • Post-Processing: Parse and analyze DUST output files (sectional loads, probes, integral forces)
  • Type-Safe: Full type hints with mypy compliance
  • Well-Tested: 95% test coverage with 111+ tests

Installation

Simple installation from PyPI:

pip install pydust-utils

For development:

git clone git@gitlab.com:Alecocco.1994/dust-private.git
cd dust-private/pydust_utils
pip install -e ".[dev,docs]"

Quick Start

Mesh Generation

from pydust_utils.build_mesh import Point, Line, MeshConfig, PointwiseMesh

# Create mesh configuration
config = MeshConfig(
    title='Wing Mesh',
    el_type='v',  # vortex-lattice
    nelem_chord=20,
    type_chord='cosine_le'
)

# Define wing geometry with points
points = [
    Point(1, [0.0, 0.0, 0.0], 1.0, 0.0, 'naca0012', 'naca0012'),
    Point(2, [0.0, 5.0, 0.5], 0.8, -2.0, 'naca0012', 'naca0012'),
]

# Connect points with lines
lines = [
    Line('spline', 10, [1, 2], 'uniform')
]

# Generate mesh file
mesh = PointwiseMesh(config, points, lines)
mesh.write('wing.in')

C81 Airfoil Data Generation

from pydust_utils.c81generator import generate_airfoil_data

# Generate C81 aerodynamic table
airfoil = generate_airfoil_data(
    file_name='naca0012',
    pathprofile='airfoils/',
    reynolds=1e6,
    mach_range=(0.0, 0.3),
    n_mach=10,
    mbdynformat=False  # Use DUST format
)

Post-Processing

from pydust_utils import read_sectional, read_probes, read_integral

# Read sectional loads
sectional_data = read_sectional('sectional_loads.dat')
print(sectional_data.sec.shape)  # (n_time, n_sec)

# Read probe velocities
probe_data = read_probes('probes_velocity.dat')
print(probe_data.velocities.shape)  # (n_time, n_probes, 3)

# Read integral loads
integral_data = read_integral('integral_loads.dat')
lift = integral_data.forces[:, 2]  # Extract lift force

Available Features

Mesh Generation (build_mesh)

  • Pointwise meshes: Define geometry with specific control points
  • Parametric meshes: Use sections and regions for automatic interpolation
  • Multiple element types: Vortex-lattice ('v'), lifting-line ('l'), panel ('p')
  • Advanced distributions: Uniform, cosine, geometric series with refinement options

Airfoil Data (c81generator)

  • C81 table generation: Create aerodynamic coefficient tables
  • NeuralFoil integration: Use neural networks for predictions
  • Multiple Reynolds numbers: Support for Re-dependent tables
  • DUST and MBDyn formats: Compatible with multiple solvers

Post-Processing (parse_postpro_files)

  • read_sectional - Sectional aerodynamic loads
  • read_probes - Velocity probe data
  • read_chordwise - Chordwise pressure distributions
  • read_integral - Integral loads and forces
  • read_hinge - Hinge loads for control surfaces

Documentation

Build documentation locally:

cd pydust_utils
pip install -e ".[docs]"
sphinx-build -b html docs/source docs/build/html

Running Tests

pip install -e ".[dev]"
pytest tests/

Current Status: 111 tests, 95% coverage ✅

Contributing

This package is developed and maintained by the DUST team at Politecnico di Milano.

Publishing

Build and upload to PyPI (maintainers only):

# Build distribution
pip install build
python -m build

# Upload to PyPI
pip install twine
twine upload dist/*

Links

License

MIT License - Copyright (c) 2025 Alessandro Cocco, Politecnico di Milano


Made with ❤️ by the DUST team at Politecnico di Milano

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydust_utils-0.1.5.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydust_utils-0.1.5-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file pydust_utils-0.1.5.tar.gz.

File metadata

  • Download URL: pydust_utils-0.1.5.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydust_utils-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6c614b333d809588d9d8b99a45900968f5440b75526945adc0ebdf7d032ac729
MD5 5f3ec772175c9e25664e0201bd86a668
BLAKE2b-256 96748b479710fd9b95127d1a9cd002d5bcfbd3110ee43529b1013b92e1c77704

See more details on using hashes here.

File details

Details for the file pydust_utils-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pydust_utils-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pydust_utils-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3351a5f1be24dd57a2933a7a0a43eba0ba13088deac64a4121803108755679d6
MD5 87070284ce6211df28df3dcf56efc0a3
BLAKE2b-256 2de0a1cea84cb70d51a45f11615ac2f3bf2a385a846cb3ce79617af766345c5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page