Skip to content

Commit cd0286b

Browse files
authored
Merge branch 'master' into dimension
2 parents 357f1b5 + b104aea commit cd0286b

24 files changed

Lines changed: 1227 additions & 402 deletions

File tree

.github/workflows/lint-toolchain.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,21 @@ jobs:
4242

4343
- name: Validate example cases
4444
run: |
45-
./mfc.sh validate examples/1D_sodshocktube/case.py
46-
./mfc.sh validate examples/2D_shockbubble/case.py
45+
failed=0
46+
passed=0
47+
for case in examples/*/case.py; do
48+
[ -f "$case" ] || continue
49+
output=$(./mfc.sh validate "$case" 2>&1)
50+
if [ $? -eq 0 ]; then
51+
passed=$((passed + 1))
52+
else
53+
echo "FAIL: $case"
54+
echo "$output"
55+
failed=$((failed + 1))
56+
fi
57+
done
58+
echo ""
59+
echo "Results: $passed passed, $failed failed"
60+
if [ "$failed" -ne 0 ]; then
61+
exit 1
62+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ docs/*/result*
4444
docs/documentation/*-example.png
4545
docs/documentation/examples.md
4646
docs/documentation/case_constraints.md
47+
docs/documentation/physics_constraints.md
4748

4849
examples/*batch/*/
4950
examples/**/D/*

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,16 +660,19 @@ if (MFC_DOCUMENTATION)
660660
VERBATIM
661661
)
662662

663-
# Generate case_constraints.md from case_validator.py and examples/
663+
# Generate case_constraints.md and physics_constraints.md together.
664+
# Both are produced by gen_constraints.sh, so a single command avoids races.
664665
add_custom_command(
665666
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/case_constraints.md"
667+
"${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/physics_constraints.md"
666668
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/mfc/gen_case_constraints_docs.py"
669+
"${CMAKE_CURRENT_SOURCE_DIR}/toolchain/mfc/gen_physics_docs.py"
667670
"${CMAKE_CURRENT_SOURCE_DIR}/toolchain/mfc/case_validator.py"
668671
"${CMAKE_CURRENT_SOURCE_DIR}/toolchain/mfc/params/definitions.py"
669672
"${examples_DOCs}"
670673
COMMAND "bash" "${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_constraints.sh"
671674
"${CMAKE_CURRENT_SOURCE_DIR}"
672-
COMMENT "Generating case_constraints.md"
675+
COMMENT "Generating case_constraints.md and physics_constraints.md"
673676
VERBATIM
674677
)
675678

@@ -732,11 +735,13 @@ if (MFC_DOCUMENTATION)
732735

733736
set(opt_example_dependency "")
734737
set(opt_constraints_dependency "")
738+
set(opt_physics_dependency "")
735739
set(opt_cli_reference_dependency "")
736740
set(opt_parameters_dependency "")
737741
if (${target} STREQUAL documentation)
738742
set(opt_example_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/examples.md")
739743
set(opt_constraints_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/case_constraints.md")
744+
set(opt_physics_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/physics_constraints.md")
740745
set(opt_cli_reference_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/cli-reference.md")
741746
set(opt_parameters_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/parameters.md")
742747
endif()
@@ -749,6 +754,7 @@ if (MFC_DOCUMENTATION)
749754
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${target}-Doxyfile"
750755
"${opt_example_dependency}"
751756
"${opt_constraints_dependency}"
757+
"${opt_physics_dependency}"
752758
"${opt_cli_reference_dependency}"
753759
"${opt_parameters_dependency}"
754760
"${${target}_SRCs}" "${${target}_DOCs}"

docs/custom.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
* Overrides for doxygen-awesome theme
44
*/
55

6+
/* Seamless split <code> tags for Fortran % struct accessors.
7+
* Doxygen consumes %<word> even inside code spans, so we split around %
8+
* into adjacent <code> elements and remove internal borders/padding. */
9+
code.f90l {
10+
border-right: 0;
11+
border-top-right-radius: 0;
12+
border-bottom-right-radius: 0;
13+
padding-right: 0;
14+
}
15+
code.f90r {
16+
border-left: 0;
17+
border-top-left-radius: 0;
18+
border-bottom-left-radius: 0;
19+
padding-left: 0;
20+
}
21+
622
/* Fix inline code visibility in colored admonition blocks (warning, attention, important, note, etc.) */
723

824
/* Warning/Attention/Important blocks (red/pink background) */

docs/documentation/case.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ To run such a case, use the following format:
6565
For example, to run the `scaling` case in "weak-scaling" mode:
6666

6767
```shell
68-
./mfc.sh run examples/scaling/case.py -t pre_process -j 8 -- --scaling weak
68+
./mfc.sh run examples/scaling/benchmark.py -t pre_process -j 8 -- --scaling weak
6969
```
7070

7171
## Parameters
@@ -281,12 +281,12 @@ For instance, in a 2D simulation, when a cylindrical `patch(2)` is immersed in a
281281

282282
- `smoothen` activates smoothening of the boundary of the patch that alters the existing patch.
283283
When smoothening occurs, fluids of the two patches are mixed in the region of the boundary.
284-
For instance, in the aforementioned case of the cylindrical patch immersed in the rectangular patch, smoothening occurs when ``patch_icpp(2)smoothen = 'T'``.
284+
For instance, in the aforementioned case of the cylindrical patch immersed in the rectangular patch, smoothening occurs when ``patch_icpp(2)%%smoothen = 'T'``.
285285
`smooth_coeff` controls the thickness of the region of smoothening (sharpness of the mixture region).
286286
The default value of `smooth_coeff` is unity. The region of smoothening is thickened with decreasing the value.
287287
Optimal choice of the value of `smooth_coeff` is case-dependent and left to the user.
288288

289-
- `patch_icpp(j)alpha(i)`, `patch_icpp(j)alpha_rho(i)`, `patch_icpp(j)pres`, and `patch_icpp(j)vel(i)` define for $j$-th patch the void fraction of `fluid(i)`, partial density of `fluid(i)`, the pressure, and the velocity in the $i$-th coordinate direction.
289+
- `patch_icpp(j)%%alpha(i)`, `patch_icpp(j)%%alpha_rho(i)`, `patch_icpp(j)%%pres`, and `patch_icpp(j)%%vel(i)` define for $j$-th patch the void fraction of `fluid(i)`, partial density of `fluid(i)`, the pressure, and the velocity in the $i$-th coordinate direction.
290290
These physical parameters must be consistent with fluid material's parameters defined in the next subsection.
291291

292292
- `model_filepath` defines the root directory of the STL or OBJ model file.
@@ -297,7 +297,7 @@ These physical parameters must be consistent with fluid material's parameters de
297297

298298
#### Elliptic Smoothing
299299

300-
Initial conditions in which not all patches support the `patch_icpp(j)%smoothen` parameter can still be smoothed by applying iterations of the heat equation to the initial condition.
300+
Initial conditions in which not all patches support the `patch_icpp(j)%%smoothen` parameter can still be smoothed by applying iterations of the heat equation to the initial condition.
301301
This is enabled by adding `'elliptic_smoothing': "T",` and `'elliptic_smoothing_iters': N,` to the case dictionary, where `N` is the number of smoothing iterations to apply.
302302

303303
### 4. Immersed Boundary Patches {#sec-immersed-boundary-patches}
@@ -463,10 +463,10 @@ Boundary condition patches can be used with non-characteristic boundary conditio
463463
Their use is detailed in [Boundary Condition Patches](#boundary-condition-patches).
464464

465465
- `bc_[x,y,z]%%vb[1,2,3]` specifies the velocity in the (x,1), (y,2), (z,3) direction applied to `bc_[x,y,z]%%beg` when using `bc_[x,y,z]%%beg = -16`.
466-
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%beg = -16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `\bc_[x,y,z]%%end = -16` to work properly.
466+
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%beg = -16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `bc_[x,y,z]%%end = -16` to work properly.
467467

468468
- `bc_[x,y,z]%%ve[1,2,3]` specifies the velocity in the (x,1), (y,2), (z,3) direction applied to `bc_[x,y,z]%%beg` when using `bc_[x,y,z]%%end = -16`.
469-
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%end = 16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `\bc_[x,y,z]%%end = -16` to work properly.
469+
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%end = 16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `bc_[x,y,z]%%end = -16` to work properly.
470470

471471
- `model_eqns` specifies the choice of the multi-component model that is used to formulate the dynamics of the flow using integers from 1 through 3.
472472
`model_eqns = 1`, `2`, and `3` correspond to \f$\Gamma\f$-\f$\Pi_\infty\f$ model (\cite Johnsen08), 5-equation model (\cite Allaire02), and 6-equation model (\cite Saurel09), respectively.
@@ -531,7 +531,7 @@ If this option is false, velocity gradient is computed using finite difference s
531531
- `weno_avg` it activates the arithmetic average of the left and right, WENO-reconstructed, cell-boundary values.
532532
This option requires `weno_Re_flux` to be true because cell boundary values are only utilized when employing the scalar divergence method in the computation of velocity gradients.
533533

534-
- `surface_tension` activates surface tension when set to ``'T'``. Requires `sigma` to be set and `num_fluids`. The color function in each patch should be assigned such that `patch_icpp(i)%cf_val = 1` in patches where `patch_icpp(i)%alpha = 1 - eps` and `patch_icpp(i)%cf_val = 0` in patches where `patch_icpp(i)%alpha = eps`.
534+
- `surface_tension` activates surface tension when set to ``'T'``. Requires `sigma` to be set and `num_fluids`. The color function in each patch should be assigned such that `patch_icpp(i)%%cf_val = 1` in patches where `patch_icpp(i)%%alpha = 1 - eps` and `patch_icpp(i)%%cf_val = 0` in patches where `patch_icpp(i)%%alpha = eps`.
535535

536536
- `viscous` activates viscosity when set to ``'T'``. Requires `Re(1)` and `Re(2)` to be set.
537537

@@ -620,8 +620,8 @@ To restart the simulation from $k$-th time step, see @ref running "Restarting Ca
620620
| `num_probes` | Integer | Number of probes |
621621
| `probe(i)%[x,y,z]` | Real | Coordinates of probe $i$ |
622622
| `output_partial_domain` | Logical | Output part of the domain |
623-
| `[x,y,z]_output%beg` | Real | Beginning of the output domain in the [x,y,z]-direction |
624-
| `[x,y,z]_output%end` | Real | End of the output domain in the [x,y,z]-direction |
623+
| `[x,y,z]_output%%beg` | Real | Beginning of the output domain in the [x,y,z]-direction |
624+
| `[x,y,z]_output%%end` | Real | End of the output domain in the [x,y,z]-direction |
625625
| `lag_txt_wrt` | Logical | Write Lagrangian bubble data to `.dat` files |
626626
| `lag_header` | Logical | Write header to Lagrangian bubble `.dat` files |
627627
| `lag_db_wrt` | Logical | Write Lagrangian bubble data to silo/hdf5 database files |
@@ -667,7 +667,7 @@ If `file_per_process` is true, then pre_process, simulation, and post_process mu
667667

668668
- `probe_wrt` activates the output of state variables at coordinates specified by `probe(i)%[x;y,z]`.
669669

670-
- `output_partial_domain` activates the output of part of the domain specified by `[x,y,z]_output%beg` and `[x,y,z]_output%end`.
670+
- `output_partial_domain` activates the output of part of the domain specified by `[x,y,z]_output%%beg` and `[x,y,z]_output%%end`.
671671
This is useful for large domains where only a portion of the domain is of interest.
672672
It is not supported when `precision = 1` and `format = 1`.
673673
It also cannot be enabled with `flux_wrt`, `heat_ratio_wrt`, `pres_inf_wrt`, `c_wrt`, `omega_wrt`, `ib`, `schlieren_wrt`, `qm_wrt`, or 'liutex_wrt'.
@@ -991,30 +991,30 @@ Note: For relativistic flow, the conservative and primitive densities are differ
991991

992992
When ``cyl_coord = 'T'`` is set in 3D the following constraints must be met:
993993

994-
- `bc_y%beg = -14` enables the axis boundary condition
994+
- `bc_y%%beg = -14` enables the axis boundary condition
995995

996-
- `bc_z%beg = bc_z%end = -1` enables periodic boundary conditions in the azimuthal direction
996+
- `bc_z%%beg = bc_z%%end = -1` enables periodic boundary conditions in the azimuthal direction
997997

998-
- `z_domain%beg = 0` sets the azimuthal starting point to 0
998+
- `z_domain%%beg = 0` sets the azimuthal starting point to 0
999999

1000-
- `z_domain%end = 2*math.pi` to set the azimuthal ending point to \f$2\pi\f$ (note, requires `import math` in the case file)
1000+
- `z_domain%%end = 2*math.pi` to set the azimuthal ending point to \f$2\pi\f$ (note, requires `import math` in the case file)
10011001

10021002
When ``cyl_coord = 'T'`` is set in 2D the following constraints must be met:
10031003

1004-
- `bc_y%beg = -2` to enable reflective boundary conditions
1004+
- `bc_y%%beg = -2` to enable reflective boundary conditions
10051005

10061006
### 17. Chemistry
10071007

10081008
| Parameter | Type | Description |
10091009
| ---: | :---: | :--- |
10101010
| `chemistry` | Logical | Enable chemistry simulation |
1011-
| `chem_params%diffusion` | Logical | Enable multispecies diffusion |
1012-
| `chem_params%reactions` | Logical | Enable chemical reactions |
1013-
| `chem_params%gamma_method` | Integer | Methodology for calculating the heat capacity ratio |
1014-
| `chem_params%transport_model` | Integer | Methodology for calculating the diffusion coefficients |
1011+
| `chem_params%%diffusion` | Logical | Enable multispecies diffusion |
1012+
| `chem_params%%reactions` | Logical | Enable chemical reactions |
1013+
| `chem_params%%gamma_method` | Integer | Methodology for calculating the heat capacity ratio |
1014+
| `chem_params%%transport_model` | Integer | Methodology for calculating the diffusion coefficients |
10151015
| `cantera_file` | String | Cantera-format mechanism file (e.g., .yaml) |
10161016

1017-
- `chem_params%transport_model` specifies the methodology for calculating diffusion coefficients and other transport properties, `1` for mixture-average, `2` for Unity-Lewis
1017+
- `chem_params%%transport_model` specifies the methodology for calculating diffusion coefficients and other transport properties, `1` for mixture-average, `2` for Unity-Lewis
10181018

10191019
- `cantera_file` specifies the chemical mechanism file. If the file is part of the standard Cantera library, only the filename is required. Otherwise, the file must be located in the same directory as your `case.py` file
10201020

@@ -1051,15 +1051,15 @@ The entries labeled "Characteristic." are characteristic boundary conditions bas
10511051

10521052
| Parameter | Type | Description |
10531053
| ---: | :----: | :--- |
1054-
| `bc_[x,y,z]%grcbc_in` | Logical | Enable grcbc for subsonic inflow |
1055-
| `bc_[x,y,z]%grcbc_out` | Logical | Enable grcbc for subsonic outflow (pressure)|
1056-
| `bc_[x,y,z]%grcbc_vel_out` | Logical | Enable grcbc for subsonic outflow (pressure + normal velocity) |
1057-
| `bc_[x,y,z]%vel_in` | Real Array | Inflow velocities in x, y and z directions |
1058-
| `bc_[x,y,z]%vel_out` | Real Array | Outflow velocities in x, y and z directions |
1059-
| `bc_[x,y,z]%pres_in` | Real | Inflow pressure |
1060-
| `bc_[x,y,z]%pres_out` | Real | Outflow pressure |
1061-
| `bc_[x,y,z]%alpha_rho_in` | Real Array | Inflow density |
1062-
| `bc_[x,y,z]%alpha_in` | Real Array | Inflow void fraction |
1054+
| `bc_[x,y,z]%%grcbc_in` | Logical | Enable grcbc for subsonic inflow |
1055+
| `bc_[x,y,z]%%grcbc_out` | Logical | Enable grcbc for subsonic outflow (pressure)|
1056+
| `bc_[x,y,z]%%grcbc_vel_out` | Logical | Enable grcbc for subsonic outflow (pressure + normal velocity) |
1057+
| `bc_[x,y,z]%%vel_in` | Real Array | Inflow velocities in x, y and z directions |
1058+
| `bc_[x,y,z]%%vel_out` | Real Array | Outflow velocities in x, y and z directions |
1059+
| `bc_[x,y,z]%%pres_in` | Real | Inflow pressure |
1060+
| `bc_[x,y,z]%%pres_out` | Real | Outflow pressure |
1061+
| `bc_[x,y,z]%%alpha_rho_in` | Real Array | Inflow density |
1062+
| `bc_[x,y,z]%%alpha_in` | Real Array | Inflow void fraction |
10631063

10641064
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 \cite Pirozzoli13. This enables to provide inflow and outflow conditions outside the computational domain.
10651065

0 commit comments

Comments
 (0)