Skip to main content

PRs Welcome Code style: black

1D shocktube caculator

This tool provides 1D Shock Tube solutions. You may output analytic solutions, or numeric solutions backed by CESE method, Sin-Chung Chang, “The Method of Space-Time Conservation Element and Solution Element – A New Approach for Solving the Navier-Stokes and Euler Equations”, Journal of Computational Physics, Volume 119, Issue 2, July 1995, Pages 295-324. doi: 10.1006/jcph.1995.1137.

Getting Started

Prerequisites

Usage

Analytic Solution

from shocktube1dcalc import solver_analytic

# by default it will create a the shock tube based on Sod's classic condition.
shocktube = solver_analytic.ShockTube()

import numpy as np
mesh = np.linspace(-0.5, 0.5, 50)

analytic_solution = shocktube.get_analytic_solution(
    mesh, t=0.4
)

You may customize the physical status of the shocktube via:

shocktube = solver_analytic.ShockTube(rho_left=1.0, u_left=0.0, p_left=1.0, rho_right=0.125, u_right=0.0, p_right=0.1)

Numeric Solution

from shocktube1dcalc import cese

elapsed_time = 0.4
cese_grid_size_t = 0.004
# multiply 2 for half grids, so total iteration number should be double
# the iteration number is always less than 1 by the grid number
iteration_number = round(elapsed_time / cese_grid_size_t * 2) - 1

shocktube = cese.ShockTube(iteration=iteration_number, grid_size_t=cese_grid_size_t)
shocktube.run_cese_iteration()

numeric_solution = shocktube.data.solution

Contributing

See Contributing

Authors

Taihsiang Ho (tai271828) tai271828@solvcon.net

Created from Lee-W/cookiecutter-python-template version 0.7.1

Release files for shocktube1dcalc 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shocktube1dcalc 1.0.2
File Size Uploaded
shocktube1dcalc-1.0.2.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shocktube1dcalc 1.0.2
File Interpreter ABI Platform
shocktube1dcalc-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.1 kB

Release files / shocktube1dcalc-1.0.2.tar.gz

Download URL shocktube1dcalc-1.0.2.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b8584a478af2749937461fc7d5fbc1fbd361a98ca61147113a7e0229aa6c96ac
BLAKE2b-256 checksum
How to use checksums
a05c8587a663c36ad87dfe0d72aa8168e50f75d423e09cef8c3e78c02acf043d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.6.9 Linux/5.4.0-86-generic

Release files / shocktube1dcalc-1.0.2-py3-none-any.whl

Download URL shocktube1dcalc-1.0.2-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3928f77885909377e06fa5e8e120038039e91863d6346ce060a0e1a957adfe04
BLAKE2b-256 checksum
How to use checksums
0099d75d6e332525f078a1928873d882bc19fcb89e67706707d0e52e60165d43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.6.9 Linux/5.4.0-86-generic

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page