Skip to main content

Enhanced Multi-block solvER for turbomachinery computational fluid dynamics

Project description

ember

An 'Enhanced Multi-Block solvER' for turbomachinery computational fluid dynamics, written by James Brind of the Whittle Laboratory at the University of Cambridge. Solves the compressible Reynolds-averaged Navier-Stokes equations on multi-block structured meshes, using an evolution of the fast and robust Denton algorithms. Pre- and post-processing is handled through a numpy-like Python interface, while the heavy computations run through compiled Fortran for speed.

See the manual for full documentation

Installation

ember requires Python 3.12 or newer. Install it from the Python Package Index under the distribution name ember-cfd, not the import name ember:

pip install ember-cfd

Precompiled wheels are published for Linux (x86_64), so no Fortran compiler is needed there. On other platforms pip falls back to building from source, which requires a Fortran toolchain. See the installation guide for more information on source builds and performance tuning the build for your CPU.

Example usage

Solve the flow through a straight annular duct:

import numpy as np

import ember.block
import ember.fluid
import ember.grid
import ember.patch
import ember.solver

# Generate coordinates for a straight annular duct
ni, nj, nk = 25, 17, 17
L = 0.1  # Span [m]
r_hub = 0.45  # Hub radius [m]
Nb = 60  # Number of blades [-]
pitch = 2 * np.pi / Nb  # Theta periodicity [rad]
x = np.linspace(0.0, 2*L, ni)
r = np.linspace(0.0, L, nj) + r_hub
t = np.linspace(-pitch, pitch, nk) / 2
xrt = np.stack(np.meshgrid(x, r, t, indexing="ij"), axis=-1)

# Allocate a block and set up geometry
block = ember.block.Block(shape=(ni, nj, nk))
block.set_xrt(xrt)
block.set_Nb(Nb)

# Set working fluid to a perfect gas
fluid = ember.fluid.PerfectFluid(cp=1005.0, gamma=1.4, mu=1e-5, Pr=0.72)
block.set_fluid(fluid)

# Define inlet boundary conditions at i=0 face
# Fixed stagnation pressure and temperature, no swirl
Po1 = 1e5  # [Pa]
To1 = 300.0  # [K]
block.patches["inlet"] = ember.patch.InletPatch(i=0)
block.patches["inlet"].set_Po_To_Alpha_Beta(Po1, To1, 0.0, 0.0)

# Define outlet boundary conditions at i=-1 face
# Fixed static pressure
P2 = 0.9e5  # [Pa]
block.patches["outlet"] = ember.patch.OutletPatch(i=-1)
block.patches["outlet"].set_P(P2)

# Initial conditions: uniform axial flow
block.set_P_T(P2, To1)
Vx_guess = 100.0  # [m/s]
block.set_Vx(Vx_guess)
block.set_Vr(0.0)
block.set_Vt(0.0)

# Create a single-block grid, set wall distance for turbulence model
grid = ember.grid.Grid([block])
grid.calculate_wdist()

# Choose solver settings and run
conf = ember.solver.SolverConfig(n_step=500, cfl=3.0, n_stage=4, n_levels=3)
ember.solver.run(grid, conf)

The example gallery works through the block interface, and demonstrates the capabilities of the processing interface.

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

ember_cfd-0.1.0a1.tar.gz (933.8 kB view details)

Uploaded Source

Built Distributions

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

ember_cfd-0.1.0a1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

ember_cfd-0.1.0a1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

ember_cfd-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file ember_cfd-0.1.0a1.tar.gz.

File metadata

  • Download URL: ember_cfd-0.1.0a1.tar.gz
  • Upload date:
  • Size: 933.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ember_cfd-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 d439a5babab47b0dca982ebaf90b2e6d266d7f0e3333a788ebb593631edfd847
MD5 373b89ca8b9672a4f5299003e8c37386
BLAKE2b-256 44973701cf87817c0b601477eaa65a41759b354cc00a6ba49a8c1d56a98feb1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ember_cfd-0.1.0a1.tar.gz:

Publisher: wheels.yml on jb753/ember

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ember_cfd-0.1.0a1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ember_cfd-0.1.0a1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a999561ccb3110e6a258d26fb93e44fa0239ce23b71e3c8af4c78df46f422a40
MD5 17b1de77a1b6935e8278d0906faa4572
BLAKE2b-256 2208eca3c0f85e7c054c01d08e768090efd6df600545a11f9c60700aae5cf80c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ember_cfd-0.1.0a1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on jb753/ember

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ember_cfd-0.1.0a1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ember_cfd-0.1.0a1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 277e371e8be88ff2913d27d0ca09ce8f67152b379f100ef999439e1b6249dc9e
MD5 e465f3be7aa7942973cba9ae6b9d44cf
BLAKE2b-256 478e9639d4430246944eda55838d4c44aecf871f4d4fe114c57bc9f9ea258350

See more details on using hashes here.

Provenance

The following attestation bundles were made for ember_cfd-0.1.0a1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on jb753/ember

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ember_cfd-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ember_cfd-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d127c235c337f9454fc52784c80624aa9ff7a8ce2bfdccdca2978d82caeaf9ac
MD5 9743a18ab18d4563fbcfcef8e9eaf1c9
BLAKE2b-256 a64aa52e093cd7b7419c7f35b48e8eff8e3e039afde52d5118eac387aff1d482

See more details on using hashes here.

Provenance

The following attestation bundles were made for ember_cfd-0.1.0a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on jb753/ember

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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