Skip to content

Commit c1d1a9c

Browse files
committed
Merge branch 'prcode' of github.com:ComputationalFlowGroup/MFC into prcode
2 parents 152cb7b + 9b782f8 commit c1d1a9c

File tree

31 files changed

+1635
-52
lines changed

31 files changed

+1635
-52
lines changed

.github/workflows/docs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,14 @@ jobs:
4747
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
4848
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
4949
50+
- name: Linkcheck - Lychee
51+
uses: lycheeverse/lychee-action@v2
52+
with:
53+
args: -c .lychee.toml build/install/docs/mfc/
54+
fail: false
55+
5056
- name: Publish Documentation
51-
if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && ( github.event_name == 'cron' || github.event_name == 'workflow_dispatch' )
57+
if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' )
5258
run: |
5359
set +e
5460
git ls-remote "${{ secrets.DOC_PUSH_URL }}" -q

.github/workflows/links.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/lint-source.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint Source Code
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
lint:
7+
name: Lint Source Code
8+
runs-on: macos-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install Fortitude
14+
run: pip install fortitude-lint ansi2txt
15+
16+
- name: Lint the source code
17+
run: fortitude check --ignore=E001,S001,S101,M011,F001,S041,T001 ./src/*/* &> lint.txt || true
18+
19+
- name: Sanitize
20+
run: cat lint.txt | ansi2txt > lint2.txt
21+
22+
- name: Output Summary
23+
run: cat lint2.txt << EOF > $GITHUB_STEP_SUMMARY

.link_config.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

.lychee.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Maximum number of allowed retries before a link is declared dead.
2+
max_retries = 5
3+
4+
# Don't show interactive progress bar while checking links.
5+
no_progress = true
6+
7+
# Website timeout from connect to response finished.
8+
timeout = 20
9+
10+
# Minimum wait time in seconds between retries of failed requests.
11+
retry_wait_time = 4
12+
13+
# Comma-separated list of accepted status codes for valid links.
14+
# accept = ["200", "206", "403", "429"]
15+
accept = ["200", "429"]
16+
17+
verbose = "error"

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ They are organized below. Just click the drop-downs!
111111
* Low Mach number treatment available
112112
* Multi- and single-component
113113
* 4, 5, and 6 equation models for multi-component/phase features
114-
* Kapila and Allaire models
114+
* Kapila and Allaire models 5-equation models
115115
* Multi- and single-phase
116116
* Phase change via p, pT, and pTg schemes
117117
* Grids
118118
* 1-3D Cartesian, cylindrical, axisymmetric.
119119
* Arbitrary grid stretching for multiple domain regions.
120-
* Complex/arbitrary geometries via immersed boundary methods
120+
* Complex/arbitrary geometries via immersed boundary method
121121
* STL geometry files supported
122122
* Surface tension for multiphase cases
123123
* Sub-grid Euler-Euler multiphase models for bubble dynamics and similar
@@ -135,9 +135,13 @@ They are organized below. Just click the drop-downs!
135135
* WENO reconstructions of order 3, 5, and 7
136136
* WENO variants: WENO-JS, WENO-M, WENO-Z, TENO
137137
* Monotonicity-preserving reconstructions
138-
* Reliable handling of high density ratios
138+
* Reliable handling of large density ratios
139139
* Exact and approximate (e.g., HLL, HLLC) Riemann solvers
140-
* Boundary conditions: Periodic, reflective, extrapolation/Neumann, slip/no-slip, non-reflecting characteristic buffers, inflows, outflows, and more
140+
* Boundary conditions
141+
* Periodic, reflective, extrapolation/Neumann
142+
* Slip and no-slip
143+
* Thompson-based characteristic BCs: non-reflecting sub/supersonic buffers, inflows, outflows
144+
* Generalized characteristic relaxation boundary conditions
141145
* Runge-Kutta orders 1-3 (SSP TVD)
142146
* Interface sharpening (THINC-like)
143147
</details>
@@ -158,7 +162,7 @@ They are organized below. Just click the drop-downs!
158162

159163
* [Fypp](https://fypp.readthedocs.io/en/stable/fypp.html) metaprogramming for code readability, performance, and portability
160164
* Continuous Integration (CI)
161-
* \>100 Regression tests with each PR.
165+
* \>250 Regression tests with each PR.
162166
* Performed with GNU (GCC), Intel, Cray (CCE), and NVIDIA (NVHPC) compilers on NVIDIA and AMD GPUs.
163167
* Line-level test coverage reports via [Codecov](https://app.codecov.io/gh/MFlowCode/MFC) and `gcov`
164168
* Benchmarking to avoid performance regressions and identify speed-ups

docs/documentation/case.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,22 @@ The boundary condition supported by the MFC are listed in table [Boundary Condit
815815
Their number (`#`) corresponds to the input value in `input.py` labeled `bc_[x,y,z]%[beg,end]` (see table [Simulation Algorithm Parameters](#5-simulation-algorithm)).
816816
The entries labeled "Characteristic." are characteristic boundary conditions based on [Thompson (1987)](references.md#Thompson87) and [Thompson (1990)](references.md#Thompson90).
817817

818+
### Generalized Characteristic Boundary conditions
819+
820+
| Parameter | Type | Description |
821+
| ---: | :----: | :--- |
822+
| `bc_[x,y,z]%grcbc_in` | Logical | Enable grcbc for subsonic inflow |
823+
| `bc_[x,y,z]%grcbc_out` | Logical | Enable grcbc for subsonic outflow (pressure)|
824+
| `bc_[x,y,z]%grcbc_vel_out` | Logical | Enable grcbc for subsonic outflow (pressure + normal velocity) |
825+
| `bc_[x,y,z]%vel_in` | Real Array | Inflow velocities in x, y and z directions |
826+
| `bc_[x,y,z]%vel_out` | Real Array | Outflow velocities in x, y and z directions |
827+
| `bc_[x,y,z]%pres_in` | Real | Inflow pressure |
828+
| `bc_[x,y,z]%pres_out` | Real | Outflow pressure |
829+
| `bc_[x,y,z]%alpha_rho_in` | Real Array | Inflow density |
830+
| `bc_[x,y,z]%alpha_in` | Real Array | Inflow void fraction |
831+
832+
This boundary condition can be used for subsonic inflow (`bc_[x,y,z]%[beg,end]` = -7) and subsonic outflow (`bc_[x,y,z]%[beg,end]` = -8) characteristic boundary conditions. These are based on [Pirozzoli (2013)](references.md#Pirozzoli13). This enables to provide inflow and outflow conditions outside the computational domain.
833+
818834
### Patch types
819835

820836
| # | Name | Dim. | Smooth | Description |

docs/documentation/references.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
- <a id="Meng16">Meng, J. C. C. (2016). Numerical simulations of droplet aerobreakup. PhD thesis, California Institute of Technology.</a>
3434

35+
- <a id="Pirozzoli13">Pirozzoli, S., and Colonius, T. (2013). Generalized characteristic relaxation boundary conditions for unsteady compressible flow simulations. Journal of Computational Physics, 248:109-126.</a>
36+
3537
- <a id="Preston07">Preston, A., Colonius, T., and Brennen, C. (2007). A reduced-order model of diffusive effects on the dynamics of bubbles. Physics of Fluids, 19(12):123302.</a>
3638

3739
- <a id="Saurel09">Saurel, R., Petitpas, F., and Berry, R. A. (2009). Simple and efficient relaxation methods for interfaces separating compressible fluids, cavitating flows and shocks in multiphase mixtures. journal of Computational Physics, 228(5):1678–1712</a>

examples/2D_acoustic_pulse/case.py

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import math
2+
import json
3+
4+
# Numerical setup
5+
Nx = 99
6+
Ny = 99
7+
dx = 8./(1.*(Nx+1))
8+
9+
alf_st = 0.4
10+
11+
p_inf = 101325
12+
rho_inf = 1
13+
gam = 1.4
14+
15+
c = math.sqrt(gam*(p_inf) / rho_inf)
16+
cfl = 0.3
17+
mydt = cfl * dx / c
18+
Tfinal = 80*1 / c
19+
Nt = int(Tfinal/mydt)
20+
21+
# Configuring case dictionary
22+
print(json.dumps({
23+
# Logistics ================================================================
24+
'run_time_info' : 'T',
25+
# ==========================================================================
26+
27+
# Computational Domain Parameters ==========================================
28+
'x_domain%beg' : -4,
29+
'x_domain%end' : 4,
30+
'y_domain%beg' : -4,
31+
'y_domain%end' : 4,
32+
'm' : Nx,
33+
'n' : Ny,
34+
'p' : 0,
35+
'dt' : mydt,
36+
't_step_start' : 0,
37+
't_step_stop' : Nt,
38+
't_step_save' : int(Nt/100),
39+
# ==========================================================================
40+
41+
# Simulation Algorithm Parameters ==========================================
42+
'num_patches' : 2,
43+
'model_eqns' : 2,
44+
'alt_soundspeed' : 'F',
45+
'num_fluids' : 1,
46+
'mpp_lim' : 'F',
47+
'mixture_err' : 'F',
48+
'time_stepper' : 3,
49+
'weno_order' : 5,
50+
'weno_eps' : 1.E-16,
51+
'mapped_weno' : 'T',
52+
'null_weights' : 'F',
53+
'mp_weno' : 'F',
54+
'riemann_solver' : 2,
55+
'wave_speeds' : 1,
56+
'avg_state' : 2,
57+
'bc_x%beg' : -8,
58+
'bc_x%end' : -8,
59+
'bc_y%beg' : -8,
60+
'bc_y%end' : -8,
61+
# ==========================================================================
62+
63+
# Formatted Database Files Structure Parameters ============================
64+
'format' : 1,
65+
'precision' : 2,
66+
'prim_vars_wrt' :'T',
67+
'parallel_io' :'T',
68+
'omega_wrt(3)' :'T',
69+
'fd_order' : 2,
70+
# ==========================================================================
71+
72+
# Patch 1 ==================================================================
73+
'patch_icpp(1)%geometry' : 3,
74+
'patch_icpp(1)%x_centroid' : 0,
75+
'patch_icpp(1)%y_centroid' : 0,
76+
'patch_icpp(1)%length_x' : 8.,
77+
'patch_icpp(1)%length_y' : 8.,
78+
'patch_icpp(1)%vel(1)' : 0,
79+
'patch_icpp(1)%vel(2)' : 0,
80+
'patch_icpp(1)%pres' : p_inf,
81+
'patch_icpp(1)%alpha_rho(1)' : rho_inf,
82+
'patch_icpp(1)%alpha(1)' : 1.,
83+
# ==========================================================================
84+
85+
# Patch 2 ==================================================================
86+
'patch_icpp(2)%geometry' : 2,
87+
'patch_icpp(2)%x_centroid' : 0,
88+
'patch_icpp(2)%y_centroid' : 0,
89+
'patch_icpp(2)%radius' : 1.,
90+
'patch_icpp(2)%vel(1)' : 0,
91+
'patch_icpp(2)%vel(2)' : 0,
92+
'patch_icpp(2)%pres' : f"{p_inf}*(1 - 0.5*({gam} - 1)*({alf_st})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**({gam} / ({gam} - 1))",
93+
'patch_icpp(2)%alpha_rho(1)' : f"{rho_inf}*(1 - 0.5*({gam} - 1)*({alf_st})**2*exp(0.5*(1 - sqrt(x**2 + y**2))))**(1 / ({gam} - 1))",
94+
'patch_icpp(2)%alpha(1)' : 1.,
95+
'patch_icpp(2)%alter_patch(1)' : 'T',
96+
# ==========================================================================
97+
98+
# CBC Inflow / Outflow ========================================
99+
'bc_x%grcbc_in' : 'F',
100+
'bc_x%grcbc_out' : 'T',
101+
'bc_x%grcbc_vel_out' : 'F',
102+
'bc_x%pres_out' : p_inf,
103+
'bc_y%grcbc_in' : 'F',
104+
'bc_y%grcbc_out' : 'T',
105+
'bc_y%grcbc_vel_out' : 'F',
106+
'bc_y%pres_out' : p_inf,
107+
# # ========================================================================
108+
109+
# Fluids Physical Parameters ===============================================
110+
'fluid_pp(1)%gamma' : 1.E+00/(gam-1.E+00),
111+
'fluid_pp(1)%pi_inf' : 0.0,
112+
# ==========================================================================
113+
}))
114+
115+
# ==============================================================================

0 commit comments

Comments
 (0)