Implementations and continuation of some standard computational fluid dynamics problems using the finite volume method.
Project description
TransiFlow
TransiFlow is a Python package that implements several standard test cases in computational fluid dynamics using the finite volume method. We provide an interface to compute a right-hand side, Jacobian matrix, and mass matrix for these problems, which allows us to perform time integration, or a continuation to compute a bifurcation diagram for the problem at hand.
Continuation
We provide a pseudo-arclength continuation method with adaptive arclength step size. Given a continuation parameters and a target value, the continuation can be called as follows
# Define the problem
parameters = {'Reynolds Number': 0, 'Problem Type': 'Lid-driven cavity'}
interface = Interface(parameters, nx, ny, nz)
# Instantiate the continuation
continuation = Continuation(interface)
# Compute an initial guess
x0 = interface.vector()
x0 = continuation.newton(x0)
# Perform the continuation. x will be the state at the target Reynolds number.
x, mu = continuation.continuation(x0, 'Reynolds Number', start, target, ds)
Eigenvalue computation
For the computation of eigenvalues, which can be used for the detection of bifurcation points, we provide an interface to JaDaPy.
JaDaPy has to be installed or included in the PYTHONPATH to use it.
An example of how to perform a continuation and compute eigenvalues can be found in examples/ldc.py.
Installation
TransiFlow is available on PyPi, and can be installed by running
pip install transiflow
TransiFlow is best installed in a virtual environment. We state the most common steps for creating and using a virtual environment here. Refer to the documentation for more details.
To create a virtual environment run
python3 -m venv /path/to/new/virtual/environment
and to activate the virtual environment, run
source /path/to/new/virtual/environment/bin/activate
After this, we can install TransiFlow from PyPi as described above, or from this source repository, to allow for easy modifications of the code. To clone the TransiFlow git repository and install TransiFlow in editable mode from the transiflow source directory, one can perform the following commands
git clone https://github.com/BIMAU/transiflow.git
cd transiflow
pip install -e .
This will also install all of the dependencies. The same can be done for JaDaPy in the same virtual environment.
Now one should be able to run an example.
python examples/ldc.py
If the example fails with
ldc.py:64: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()
this means that tkinter is not available.
You can either just save the image to the disk, or install e.g. python3-tk or python3-matplotlib on Debian-based Linux distributions.
Optional dependencies
To use the optional computational backends, you can install the following:
- HYMLS: Install Trilinos with PyTrilinos enabled, then install HYMLS.
- Epetra: Install Trilinos with PyTrilinos enabled. This is enough to use the backend, but since there is no preconditioner, this may not be very useful.
- PETSc: Run
PETSC_CONFIGURE_OPTIONS='--download-mumps --download-scalapack' pip install mpi4py petsc4py. This is enough to use the backend, but since there is no preconditioner yet, this may not be very useful.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file transiflow-1.0.1.tar.gz.
File metadata
- Download URL: transiflow-1.0.1.tar.gz
- Upload date:
- Size: 63.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5722fd48d4f420e9defc8e9adec8a4b9ae5ee934c29b721e334d65dfa6416cc
|
|
| MD5 |
b50334d043953241a04866b4339415d3
|
|
| BLAKE2b-256 |
ecf7848e84c76f9e5b4256ff722adffccbed7b1d1a1b021f10c3b65015cf3c7f
|
Provenance
The following attestation bundles were made for transiflow-1.0.1.tar.gz:
Publisher:
cd.yml on BIMAU/transiflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
transiflow-1.0.1.tar.gz -
Subject digest:
b5722fd48d4f420e9defc8e9adec8a4b9ae5ee934c29b721e334d65dfa6416cc - Sigstore transparency entry: 1066548552
- Sigstore integration time:
-
Permalink:
BIMAU/transiflow@7280d2f30f626be883ad21b523e65d57bfdc8f30 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/BIMAU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7280d2f30f626be883ad21b523e65d57bfdc8f30 -
Trigger Event:
release
-
Statement type:
File details
Details for the file transiflow-1.0.1-py3-none-any.whl.
File metadata
- Download URL: transiflow-1.0.1-py3-none-any.whl
- Upload date:
- Size: 56.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e8f26f603ae72916c38bc1c03ceb0e33c4cf3feef7115eede7fb1eec935856c
|
|
| MD5 |
0985c76534a59fa3a18de01d8ea5acca
|
|
| BLAKE2b-256 |
16035cdcb3d2278ccd8b071824a2dde3818c873e244c28a8839e43ddf0237c0e
|
Provenance
The following attestation bundles were made for transiflow-1.0.1-py3-none-any.whl:
Publisher:
cd.yml on BIMAU/transiflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
transiflow-1.0.1-py3-none-any.whl -
Subject digest:
6e8f26f603ae72916c38bc1c03ceb0e33c4cf3feef7115eede7fb1eec935856c - Sigstore transparency entry: 1066548558
- Sigstore integration time:
-
Permalink:
BIMAU/transiflow@7280d2f30f626be883ad21b523e65d57bfdc8f30 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/BIMAU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7280d2f30f626be883ad21b523e65d57bfdc8f30 -
Trigger Event:
release
-
Statement type: