-
Notifications
You must be signed in to change notification settings - Fork 133
MTHINC #1303
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
base: master
Are you sure you want to change the base?
MTHINC #1303
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -433,8 +433,8 @@ See @ref equations "Equations" for the mathematical models these parameters cont | |||||
| | `mp_weno` | Logical | Monotonicity preserving WENO | | ||||||
| | `muscl_order` | Integer | MUSCL order [1,2] | | ||||||
| | `muscl_lim` | Integer | MUSCL Slope Limiter: [1] minmod; [2] monotonized central; [3] Van Albada; [4] Van Leer; [5] SUPERBEE | | ||||||
| | `int_comp` | Integer | Interface Compression [1] THINC [2] MTHINC | | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document all three valid states for The table entry only lists values [1] and [2], but according to the PR objectives, 📝 Suggested documentation fix-| `int_comp` | Integer | Interface Compression [1] THINC [2] MTHINC |
+| `int_comp` | Integer | Interface Compression: [0] Off; [1] THINC; [2] MTHINC |📝 Committable suggestion
Suggested change
|
||||||
| | `flux_lim` | Integer | Flux limiter for post-process: [1] minmod; [2] MUSCL; [3] OSPRE; [4] SUPERBEE | | ||||||
| | `int_comp` | Logical | THINC Interface Compression | | ||||||
| | `ic_eps` | Real | Interface compression threshold (default: 1e-4) | | ||||||
| | `ic_beta` | Real | Interface compression sharpness parameter (default: 1.6) | | ||||||
| | `riemann_solver` | Integer | Riemann solver algorithm: [1] HLL*; [2] HLLC; [3] Exact*; [4] HLLD (only for MHD) | | ||||||
|
|
@@ -530,7 +530,7 @@ It is recommended to set `weno_eps` to $10^{-6}$ for WENO-JS, and to $10^{-40}$ | |||||
| - `muscl_lim` specifies the slope limiter that is used in 2nd order MUSCL Reconstruction by an integer from 1 through 5. | ||||||
| `muscl_lim = 1`, `2`, `3`, `4`, and `5` correspond to minmod, monotonized central, Van Albada, Van Leer, and SUPERBEE, respectively. | ||||||
|
|
||||||
| - `int_comp` activates interface compression using THINC used in MUSCL Reconstruction, with control parameters (`ic_eps`, and `ic_beta`). | ||||||
| - `int_comp` activates interface compression using [1] THINC or [2] MTHINC used in variable reconstruction, with control parameters (`ic_eps`, and `ic_beta`). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify all three states and the behavior when The description states " 📝 Suggested documentation improvement-- `int_comp` activates interface compression using [1] THINC or [2] MTHINC used in variable reconstruction, with control parameters (`ic_eps`, and `ic_beta`).
+- `int_comp` controls interface compression in variable reconstruction with control parameters (`ic_eps`, and `ic_beta`). `int_comp = 0` disables interface compression; `int_comp = 1` enables THINC compression; `int_comp = 2` enables MTHINC compression.Based on learnings, modifications to public parameters affect downstream users. This parameter changed from boolean to integer semantics, so complete documentation of all states is essential for users migrating from the previous boolean interface. |
||||||
|
|
||||||
| - `riemann_solver` specifies the choice of the Riemann solver that is used in simulation by an integer from 1 through 4. | ||||||
| `riemann_solver = 1`, `2`, and `3` correspond to HLL, HLLC, and Exact Riemann solver, respectively (\cite Toro09). | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,7 @@ module m_rhs | |||||||||||||||||||||
| use m_body_forces | ||||||||||||||||||||||
| use m_chemistry | ||||||||||||||||||||||
| use m_igr | ||||||||||||||||||||||
| use m_thinc | ||||||||||||||||||||||
| use m_pressure_relaxation | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| implicit none | ||||||||||||||||||||||
|
|
@@ -641,6 +642,12 @@ contains | |||||||||||||||||||||
| call nvtxEndRange | ||||||||||||||||||||||
| end if | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (int_comp == 2 .and. n > 0) then | ||||||||||||||||||||||
| call nvtxStartRange("RHS-COMPRESSION-NORMALS") | ||||||||||||||||||||||
| call s_compute_mthinc_normals(q_prim_qp%vf) | ||||||||||||||||||||||
| call nvtxEndRange | ||||||||||||||||||||||
| end if | ||||||||||||||||||||||
|
Comment on lines
+645
to
+649
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the same THINC enablement guard here as in startup.
Minimal fix- if (int_comp == 2 .and. n > 0) then
+ if (int_comp == 2 .and. n > 0 .and. (.not. igr .or. dummy)) then
call nvtxStartRange("RHS-COMPRESSION-NORMALS")
call s_compute_mthinc_normals(q_prim_qp%vf)
call nvtxEndRange
end if📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ! Loop over coordinate directions for dimensional splitting | ||||||||||||||||||||||
| do id = 1, num_dims | ||||||||||||||||||||||
| if (igr .or. dummy) then | ||||||||||||||||||||||
|
|
@@ -675,7 +682,7 @@ contains | |||||||||||||||||||||
| if ((.not. igr) .or. dummy) then ! Finite volume solve | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ! Reconstructing Primitive/Conservative Variables | ||||||||||||||||||||||
| call nvtxStartRange("RHS-WENO") | ||||||||||||||||||||||
| call nvtxStartRange("RHS-RECONSTRUCTION") | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (.not. surface_tension) then | ||||||||||||||||||||||
| if (all(Re_size == 0)) then | ||||||||||||||||||||||
|
|
@@ -1661,6 +1668,13 @@ contains | |||||||||||||||||||||
| call s_${SCHEME}$ (v_vf(iv%beg:iv%end), vL_x(:,:,:,iv%beg:iv%end), vL_y(:,:,:,:), vL_z(:,:,:,:), vR_x(:,:,:, & | ||||||||||||||||||||||
| & iv%beg:iv%end), vR_y(:,:,:,:), vR_z(:,:,:,:), recon_dir, is1, is2, is3) | ||||||||||||||||||||||
| end if | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if (int_comp > 0 .and. iv%beg <= advxb .and. iv%end >= advxe) then | ||||||||||||||||||||||
| ! Only run interface compression when the volume fractions are in the reconstructed variables | ||||||||||||||||||||||
| call nvtxStartRange("RHS-RECONSTRUCTION-COMPRESSION") | ||||||||||||||||||||||
| call s_thinc_compression(q_prim_qp%vf, vL_x, vL_y, vL_z, vR_x, vR_y, vR_z, recon_dir, is1, is2, is3) | ||||||||||||||||||||||
| call nvtxEndRange() | ||||||||||||||||||||||
| end if | ||||||||||||||||||||||
| end if | ||||||||||||||||||||||
| #:endfor | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ module m_start_up | |
| use m_variables_conversion | ||
| use m_weno | ||
| use m_muscl | ||
| use m_thinc | ||
| use m_riemann_solvers | ||
| use m_cbc | ||
| use m_boundary_common | ||
|
|
@@ -926,6 +927,7 @@ contains | |
| else if (recon_type == MUSCL_TYPE) then | ||
| call s_initialize_muscl_module() | ||
| end if | ||
| if (int_comp > 0) call s_initialize_thinc_module() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mirror THINC finalization with the initialization predicate. Initialization happens inside As per coding guidelines, Also applies to: 1304-1304 |
||
| call s_initialize_cbc_module() | ||
| call s_initialize_riemann_solvers_module() | ||
| end if | ||
|
|
@@ -1097,6 +1099,7 @@ contains | |
| else if (recon_type == MUSCL_TYPE) then | ||
| call s_finalize_muscl_module() | ||
| end if | ||
| if (int_comp > 0) call s_finalize_thinc_module() | ||
| end if | ||
| call s_finalize_variables_conversion_module() | ||
| if (grid_geometry == 3) call s_finalize_fftw_module | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter table entry for
int_compwas updated to an integer but no longer documents the0=offvalue (it currently only lists[1] THINC [2] MTHINC). This can confuse users and contradicts other docs/tooling that treat0as the default/off value. Please update the table text to include0explicitly.