Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New example and improved examples doc page #774

Merged
merged 4 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/examples.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

set -e
MAX_HEIGHT=400

set -e -x

examples_md="$1/docs/documentation/examples.md"
rm "$examples_md" || true
Expand All @@ -11,11 +13,11 @@ for casedir in $(find "$1/examples/" -mindepth 1 -maxdepth 1 -type d); do
casename="$(basename "$casedir")"

if [ -f "$casedir/README.md" ]; then
sed -e "s/\.png/-$casename-example\.png/g" "$casedir/README.md" | sed 's/^#/##/g' >> "$examples_md"
sed -e "s/\.png/-$casename-example\.png/g" "$casedir/README.md" | sed 's/^#/##/g' | sed "s/MAX_HEIGHT/$MAX_HEIGHT/g" >> "$examples_md"
echo '' >> "$examples_md"

for png in $(find "$casedir" -maxdepth 1 -name '*.png'); do
cp "$png" "$1/docs/documentation/$(basename "$png" | sed s/\.png//g)-$casename-example.png"
done
fi
done
done
6 changes: 3 additions & 3 deletions examples/1D_inert_shocktube/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 1D Multi-Component Inert Shock Tube

References:
Reference:
> P. J. Martínez Ferrer, R. Buttay, G. Lehnasch, and A. Mura, “A detailed verification procedure for compressible reactive multicomponent Navier–Stokes solvers”, Comput. & Fluids, vol. 89, pp. 88–110, Jan. 2014. Accessed: Oct. 13, 2024. [Online]. Available: https://doi.org/10.1016/j.compfluid.2013.10.014

## Initial Condition

![Initial Condition](initial.png)
<img src="initial.png" height="MAX_HEIGHT"/>

## Results

![Results](result.png)
<img src="result.png" height="MAX_HEIGHT"/>
7 changes: 4 additions & 3 deletions examples/1D_laxshocktube/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Lax shock tube problem (1D)

Reference: P. D. Lax, Weak solutions of nonlinear hyperbolic equations and their numerical computation, Communications on pure and applied mathematics 7 (1) (1954) 159–193.
Reference:
> P. D. Lax, Weak solutions of nonlinear hyperbolic equations and their numerical computation, Communications on pure and applied mathematics 7 (1) (1954) 159–193.

## Initial Condition

![Initial Condition](initial.png)
<img src="initial.png" height="MAX_HEIGHT"/>

## Result

![Result](result.png)
<img src="result.png" height="MAX_HEIGHT"/>
4 changes: 2 additions & 2 deletions examples/1D_reactive_shocktube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ References:

## Initial Condition

![Initial Condition](initial.png)
<img src="initial.png" height="MAX_HEIGHT"/>

## Results

![Results](result.png)
<img src="result.png" height="MAX_HEIGHT"/>
7 changes: 4 additions & 3 deletions examples/1D_shuosher_old/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Shu-Osher problem (1D)

Reference: C. W. Shu, S. Osher, Efficient implementation of essentially non-oscillatory shock-capturing schemes, Journal of Computational Physics 77 (2) (1988) 439–471. doi:10.1016/0021-9991(88)90177-5.
Reference:
> C. W. Shu, S. Osher, Efficient implementation of essentially non-oscillatory shock-capturing schemes, Journal of Computational Physics 77 (2) (1988) 439–471. doi:10.1016/0021-9991(88)90177-5.

## Initial Condition

![Initial Condition](initial.png)
<img src="initial.png" height="MAX_HEIGHT"/>

## Result

![Result](result.png)
<img src="result.png" height="MAX_HEIGHT"/>
7 changes: 4 additions & 3 deletions examples/1D_titarevtorro/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Titarev-Toro problem (1D)

Reference: V. A. Titarev, E. F. Toro, Finite-volume WENO schemes for three-dimensional conservation laws, Journal of Computational Physics 201 (1) (2004) 238–260.
Reference:
> V. A. Titarev, E. F. Toro, Finite-volume WENO schemes for three-dimensional conservation laws, Journal of Computational Physics 201 (1) (2004) 238–260.

## Initial Condition

![Initial Condition](initial.png)
<img src="initial.png" heiht="MAX_HEIGHT"/>

## Result

![Result](result.png)
<img src="result.png" heiht="MAX_HEIGHT"/>
9 changes: 3 additions & 6 deletions examples/2D_hardcodied_ic/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# 2D Hardcodied IC Example

## Initial Condition
## Initial Condition and Result

![Initial Condition](initial.png)

## Result

![Result](result.png)
<img src="initial.png" width="45%"/>
<img src="result.png" width="45%"/>
2 changes: 1 addition & 1 deletion examples/2D_ibm_cfl_dt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Result

![Result](result.png)
<img src="result.png" height="MAX_HEIGHT"/>
7 changes: 4 additions & 3 deletions examples/2D_isentropicvortex/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Isentropic vortex problem (2D)

Reference: Coralic, V., & Colonius, T. (2014). Finite-volume Weno scheme for viscous compressible multicomponent flows. Journal of Computational Physics, 274, 95–121. https://doi.org/10.1016/j.jcp.2014.06.003
Reference:
> Coralic, V., & Colonius, T. (2014). Finite-volume Weno scheme for viscous compressible multicomponent flows. Journal of Computational Physics, 274, 95–121. https://doi.org/10.1016/j.jcp.2014.06.003

## Density

![Density](alpha_rho1.png)
<img src="alpha_rho1.png" height="MAX_HEIGHT"/>

## Density Norms

![Density Norms](density_norms.png)
<img src="density_norms.png" height="MAX_HEIGHT"/>
9 changes: 5 additions & 4 deletions examples/2D_lid_driven_cavity/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Lid-Driven Cavity Problem (2D)

Reference: Bezgin, D. A., & Buhendwa A. B., & Adams N. A. (2022). JAX-FLUIDS: A fully-differentiable high-order computational fluid dynamics solver for compressible two-phase flows. arXiv:2203.13760
Reference:
> Bezgin, D. A., & Buhendwa A. B., & Adams N. A. (2022). JAX-FLUIDS: A fully-differentiable high-order computational fluid dynamics solver for compressible two-phase flows. arXiv:2203.13760

Reference: Ghia, U., & Ghia, K. N., & Shin, C. T. (1982). High-re solutions for incompressible flow
> Ghia, U., & Ghia, K. N., & Shin, C. T. (1982). High-re solutions for incompressible flow
using the Navier-Stokes equations and a multigrid method. Journal of Computational Physics, 48, 387-411

Video: https://youtube.com/shorts/JEP28scZrBM?feature=share

## Final Condition

![Final Condition](final_condition.png)
<img src="final_condition.png" height="MAX_HEIGHT"/>

## Centerline Velocities

![Centerline Velocities](centerline_velocities.png)
<img src="centerline_velocities.png" height="MAX_HEIGHT"/>
10 changes: 3 additions & 7 deletions examples/2D_rayleigh_taylor/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Rayleigh-Taylor Instability (2D)

## Final Condition

![Final Condition](final_condition.png)

## Centerline Velocities

![Linear Theory Comparison](linear_theory.jpg)
## Final Condition and Linear Theory
<img src='final_condition.png' height='MAX_HEIGHT'/>
<img src='linear_theory.png' height='MAX_HEIGHT'/>
Binary file modified examples/2D_rayleigh_taylor/final_condition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/2D_rayleigh_taylor/linear_theory.jpg
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 5 additions & 7 deletions examples/2D_riemann_test/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# 2D Riemann Test (2D)

Reference: Chamarthi, A., & Hoffmann, N., & Nishikawa, H., & Frankel S. (2023). Implicit gradients based conservative numerical scheme for compressible flows. arXiv:2110.05461
Reference:
> Chamarthi, A., & Hoffmann, N., & Nishikawa, H., & Frankel S. (2023). Implicit gradients based conservative numerical scheme for compressible flows. arXiv:2110.05461

## Density Initial Condition
## Density Initial and Final Conditions

![Density](alpha_rho1_initial.png)

## Density Final Condition

![Density Norms](alpha_rho1_final.png)
<img src="alpha_rho1_initial.png" width="45%"/>
<img src="alpha_rho1_final.png" width="45%"/>
7 changes: 4 additions & 3 deletions examples/2D_shockdroplet/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Shock Droplet (2D)

Reference: Panchal et. al., A Seven-Equation Diffused Interface Method for Resolved Multiphase Flows, JCP, 475 (2023)
Reference:
> Panchal et. al., A Seven-Equation Diffused Interface Method for Resolved Multiphase Flows, JCP, 475 (2023)

## Initial Condition

![Initial Condition](initial.png)
<img src="initial.png" height="MAX_HEIGHT"/>

## Result

![Result](result.png)
<img src="result.png" height="MAX_HEIGHT"/>
9 changes: 9 additions & 0 deletions examples/2D_triple_point/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 2D Triple Point (2D)

Reference:
> Trojak, W., & Dzanic, T. Positivity-preserving discoutinous spectral element method for compressible multi-species flows. arXiv:2308.02426

## Numerical Schlieren at Final Time

<img src="final.png" height="MAX_HEIGHT"/>

117 changes: 117 additions & 0 deletions examples/2D_triple_point/case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/usr/bin/env python3
import math
import json

eps = 1e-8
Nx = 699
Ny = 299

print(json.dumps({
# Logistics ================================================
'run_time_info' : 'F',
# ==========================================================

# Computational Domain Parameters ==========================
'x_domain%beg' : 0,
'x_domain%end' : 7,
'y_domain%beg' : 0,
'y_domain%end' : 3,
'm' : int(Nx),
'n' : int(Ny),
'p' : 0,
'cfl_adap_dt' : 'T',
'cfl_target' : 0.8,
'n_start' : 0,
't_stop' : 4.0,
't_save' : 0.04,
# ==========================================================

# Simulation Algorithm Parameters ==========================
'num_patches' : 3,
'model_eqns' : 2,
'alt_soundspeed' : 'F',
'num_fluids' : 2,
'mpp_lim' : 'T',
'mixture_err' : 'T',
'time_stepper' : 3,
'weno_order' : 7,
'weno_eps' : 1.E-16,
'weno_Re_flux' : 'F',
'weno_avg' : 'F',
'mapped_weno' : 'T',
'null_weights' : 'F',
'mp_weno' : 'F',
'riemann_solver' : 2,
'wave_speeds' : 1,
'avg_state' : 2,
'bc_x%beg' : -3,#11,
'bc_x%end' : -3,#12
'bc_y%beg' : -3,
'bc_y%end' : -3,
# ==========================================================

# Formatted Database Files Structure Parameters ============
'format' : 1,
'precision' : 2,
'prim_vars_wrt' :'T',
'schlieren_wrt' :'T',
'fd_order' : 4,
'schlieren_alpha(1)' : 0.5,
'schlieren_alpha(2)' : 0.5,
'parallel_io' :'T',
# ==========================================================

# Patch 1: Left state ====================================
'patch_icpp(1)%geometry' : 3,
'patch_icpp(1)%x_centroid' : 0.5,
'patch_icpp(1)%y_centroid' : 3,
'patch_icpp(1)%length_x' : 1,
'patch_icpp(1)%length_y' : 6,
'patch_icpp(1)%vel(1)' : 0.,
'patch_icpp(1)%vel(2)' : 0.,
'patch_icpp(1)%pres' : 1.,
'patch_icpp(1)%alpha_rho(1)' : (1 - eps)*1.,
'patch_icpp(1)%alpha_rho(2)' : eps,
'patch_icpp(1)%alpha(1)' : 1 - eps,
'patch_icpp(1)%alpha(2)' : eps,
# ==========================================================

# Patch 2: Top right state ================================
'patch_icpp(2)%geometry' : 3,
'patch_icpp(2)%alter_patch(1)' : 'T',
'patch_icpp(2)%x_centroid' : 4,
'patch_icpp(2)%y_centroid' : 2.25,
'patch_icpp(2)%length_x' : 6,
'patch_icpp(2)%length_y' : 1.5,
'patch_icpp(2)%vel(1)' : 0.,
'patch_icpp(2)%vel(2)' : 0.,
'patch_icpp(2)%pres' : 0.1,
'patch_icpp(2)%alpha_rho(1)' : (1-eps)*0.125,
'patch_icpp(2)%alpha_rho(2)' : eps,
'patch_icpp(2)%alpha(1)' : 1 - eps,
'patch_icpp(2)%alpha(2)' : eps,
# ==========================================================

# Patch 3: Bottom right state =============================
'patch_icpp(3)%geometry' : 3,
'patch_icpp(3)%alter_patch(1)' : 'T',
'patch_icpp(3)%x_centroid' : 4,
'patch_icpp(3)%y_centroid' : 0.75,
'patch_icpp(3)%length_x' : 6,
'patch_icpp(3)%length_y' : 1.5,
'patch_icpp(3)%vel(1)' : 0.,
'patch_icpp(3)%vel(2)' : 0.,
'patch_icpp(3)%pres' : 0.1,
'patch_icpp(3)%alpha_rho(1)' : eps,
'patch_icpp(3)%alpha_rho(2)' : (1 - eps)*1.,
'patch_icpp(3)%alpha(1)' : eps,# 0.95
'patch_icpp(3)%alpha(2)' : 1 - eps,#0.05,
# ==========================================================

# Fluids Physical Parameters ===============================
'fluid_pp(1)%gamma' : 1./(1.5 - 1.),
'fluid_pp(1)%pi_inf' : 0,
'fluid_pp(2)%gamma' : 1./(1.4 - 1.),
'fluid_pp(2)%pi_inf' : 0.,
# ==========================================================
}))
Binary file added examples/2D_triple_point/final.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions examples/3D_TaylorGreenVortex/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Taylor-Green Vortex (3D)

Reference: Hillewaert, K. (2013). TestCase C3.5 - DNS of the transition of the Taylor-Green vortex, Re=1600 - Introduction and result summary. 2nd International Workshop on high-order methods for CFD.
Reference:
> Hillewaert, K. (2013). TestCase C3.5 - DNS of the transition of the Taylor-Green vortex, Re=1600 - Introduction and result summary. 2nd International Workshop on high-order methods for CFD.

## Final Condition
This figure shows the isosurface with zero q-criterion.
![Density](result.png)

<img src="result.png" height="MAX_HEIGHT"/>

2 changes: 1 addition & 1 deletion examples/3D_ibm_bowshock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

## Final Condition

![Density](result.png)
<img src="result.png" height="MAX_HEIGHT">

9 changes: 3 additions & 6 deletions examples/3D_rayleigh_taylor/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Rayleigh-Taylor Instability (3D)

## Final Condition
## Final Condition and Linear Theory

![Final Condition](final_condition.png)

## Centerline Velocities

![Linear Theory Comparison](linear_theory.png)
<img src="final_condition.png" height="MAX_HEIGHT"/>
<img src="linear_theory.png" height="MAX_HEIGHT"/>
5 changes: 3 additions & 2 deletions examples/nD_perfect_reactor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Perfectly Stirred Reactor

Reference: G. B. Skinner and G. H. Ringrose, “Ignition Delays of a Hydrogen—Oxygen—Argon Mixture at Relatively Low Temperatures”, J. Chem. Phys., vol. 42, no. 6, pp. 2190–2192, Mar. 1965. Accessed: Oct. 13, 2024. [Online]. Available: https://doi.org/10.1063/1.1696266.
Reference:
> G. B. Skinner and G. H. Ringrose, “Ignition Delays of a Hydrogen—Oxygen—Argon Mixture at Relatively Low Temperatures”, J. Chem. Phys., vol. 42, no. 6, pp. 2190–2192, Mar. 1965. Accessed: Oct. 13, 2024. [Online]. Available: https://doi.org/10.1063/1.1696266.

```bash
$ python3 analyze.py
Expand All @@ -10,4 +11,4 @@ Induction Times ([OH] >= 1e-6):
+ (Che)MFC: 5.130e-05 s
```

![Result](result.png)
<img src="result.png" height="MAX_HEIGHT"/>
2 changes: 1 addition & 1 deletion toolchain/mfc/test/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ def foreach_example():
continue

# # List of currently broken examples -> currently attempting to fix!
brokenCases = ["2D_ibm_cfl_dt", "1D_sodHypo", "2D_viscous", "2D_laplace_pressure_jump", "2D_bubbly_steady_shock", "2D_advection", "2D_hardcodied_ic", "2D_ibm_multiphase", "2D_acoustic_broadband", "1D_inert_shocktube", "1D_reactive_shocktube", "2D_ibm_steady_shock", "3D_performance_test", "3D_ibm_stl_ellipsoid", "3D_sphbubcollapse", "2D_ibm_stl_wedge", "3D_ibm_stl_pyramid", "3D_ibm_bowshock", "3D_turb_mixing", "2D_mixing_artificial_Ma", "3D_lagrange_bubblescreen"]
brokenCases = ["2D_ibm_cfl_dt", "1D_sodHypo", "2D_viscous", "2D_laplace_pressure_jump", "2D_bubbly_steady_shock", "2D_advection", "2D_hardcodied_ic", "2D_ibm_multiphase", "2D_acoustic_broadband", "1D_inert_shocktube", "1D_reactive_shocktube", "2D_ibm_steady_shock", "3D_performance_test", "3D_ibm_stl_ellipsoid", "3D_sphbubcollapse", "2D_ibm_stl_wedge", "3D_ibm_stl_pyramid", "3D_ibm_bowshock", "3D_turb_mixing", "2D_mixing_artificial_Ma", "3D_lagrange_bubblescreen", "2D_triple_point"]
if path in brokenCases:
continue
name = f"{path.split('_')[0]} -> Example -> {'_'.join(path.split('_')[1:])}"
Expand Down
Loading