A Python package to build reduced-order models for Rayleigh-Benard convection
Project description
Construct ROMs
Construct ROMs is a Python package that builds distinguished reduced-order models (ROMs) that approximate the dynamics of 2D Rayleigh–Bénard convection. The model domain is a horizontally periodic domain with stress-free, isothermal walls at top and bottom. ROMs are built using Galerkin expansion with Fourier basis functions.
Model equations:
Features:
- ROMs can be printed to the consoles in LaTeX format or printed to a MATLAB or Python ODE file for further analysis
- Models can be selected from the HK hierarchy or the user can input them manually
- Include scale factors for easier SDP scaling
- Can check certain conservation properties (energy and vorticity balance)
Package Requirements
- numpy (Version 1.5 or later)
- sympy (Version 1.6 or later)
Installation
To install the package, download or clone this repository and use from constructROM import construct_roms
from the directory containing the package.
Instructions
To construct a system of ROMs, use the command construct_roms(*args)
. Options can be passed as function arguments as detailed below.
Options:
mode_sel
: Method of mode selection. Current options:- "hk" : select model from hk hierarchy
- "input" : input list of modes manually (as p_modes, t_modes arguments)
p_modes
: List of psi modes, represented as a list of tuples. Only necessary ifmode_type="input"
t_modes
: List of theta modes, formatted as a list of tuples. Same format asp_modes
hier_num
: Number in the HK hierarchy (e.g.hier_num = 1
denotes the first model)print_to
: Specify where to print output data. Options:- "console" : prints ODEs to console in LaTeX format
- "matlab" : creates Matlab ODE file (.m)
- "python" : creates Python ODE file (.py)
- "none:" : don't print ROMs as output
out_dir
: Name of directory to print outputscaling
: Variable scaling used in model. Options:- "unit cube" : psi -> R^(1/2)*psi, t -> R^(-1/2)*t, useful for SDP computations
- "standard" : standard scaling of Rayleigh-Benard
- "normalize theta" : theta -> theta/R, used in some prior ROM studies
scale_factors
: If True, includes individual scale factors for each variable (True/False)check_conserv
: If True, verifies that certain conservation laws are satisfied
Examples:
construct_roms(mode_sel="hk", hier_num=1, print_to="console" scale factors=False)
Generates the first model in the HK hierarchy (Lorenz model plus one shear mode) without scale factors and prints output to the console
construct_roms(mode_sel="hk", hier_num=2, print_to="matlab", out_dir="HK8_model")
Generates Matlab ODE file for the HK8 model with scale factors to folder "HK8_model"
construct_roms(model_sel="input", p_modes=[(1,1)], t_modes=[(0,2), (1,1)], print_to="none", check_conserv=True)
Checks energy and vorticity balance laws for the Lorenz equations
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
File details
Details for the file construct_roms-1.0.tar.gz
.
File metadata
- Download URL: construct_roms-1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 483f36b48feeea211f01672d9d4eb9cdd5941ab14574f3416ce3eb6696096145 |
|
MD5 | 88e5f8a3361951cbe54f57591b78b536 |
|
BLAKE2b-256 | e2a310e1b4816780491ba31562bb562584d7459514705f5697681c6386dc4722 |
File details
Details for the file construct_roms-1.0-py3-none-any.whl
.
File metadata
- Download URL: construct_roms-1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b51ef425ff46648d72f35dd6c39a4d5bd49eba1749937022c1fdfcb16c5824e |
|
MD5 | 3eab1932721e9d7472129fa9aafa342f |
|
BLAKE2b-256 | 0e33b918808a86037e5ffafc137e1f1d4255ab1d4fe431ec80acf5eaa34934d7 |