You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li>MFC uses <b>non-unity lower bounds</b> (e.g., <spanclass="tt">idwbuff(1)beg:idwbuff(1)end</span> with negative ghost-cell indices). Always verify loop bounds match array declarations.</li>
282
+
<li>MFC uses <b>non-unity lower bounds</b> (e.g., <spanclass="tt">idwbuff(1)%beg:idwbuff(1)%end</span> with negative ghost-cell indices). Always verify loop bounds match array declarations.</li>
283
283
<li><b>Riemann solver indexing:</b> Left states at <spanclass="tt">j</span>, right states at <spanclass="tt">j+1</span>. Off-by-one here corrupts fluxes.</li>
<li><b>Pressure formula</b> must match <spanclass="tt">model_eqns</span> value. Model 2/3 (multi-fluid), model 4 (bubbles), MHD, and hypoelastic each use different EOS formulations. Wrong formula = wrong physics.</li>
312
312
<li><b>Conservative-primitive conversion:</b> Density recovery, kinetic energy, and pressure each have model-specific paths. Verify the correct branch is taken.</li>
313
313
<li><b>Volume fractions</b> must sum to 1. <spanclass="tt">alpha_rho_K</span> must be non-negative. Species mass fractions should be clipped to [0,1].</li>
314
-
<li><b>Boundary conditions:</b> Periodic BCs must match at both ends (<spanclass="tt">bc_xbeg</span> and <spanclass="tt">bc_xend</span>). Cylindrical coordinates have special requirements (<spanclass="tt">bc_ybeg = -14</span> for axis in 3D).</li>
314
+
<li><b>Boundary conditions:</b> Periodic BCs must match at both ends (<spanclass="tt">bc_x%beg</span> and <spanclass="tt">bc_x%end</span>). Cylindrical coordinates have special requirements (<spanclass="tt">bc_y%beg = -14</span> for axis in 3D).</li>
315
315
<li><b>Parameter constraints:</b> New parameters or physics features must be validated in <spanclass="tt">toolchain/mfc/case_validator.py</span>. New features should add corresponding validation.</li>
<divclass="line"> self.errors.append(<spanclass="stringliteral">"my_param requires other_param to be set"</span>)</div>
398
-
</div><!-- fragment --><p><b>Step 5: Declare in Fortran</b> (<spanclass="tt">src/<target>/m_global_parameters.fpp</span>)</p>
398
+
</div><!-- fragment --><p>If your check enforces a physics constraint, also add a <spanclass="tt">PHYSICS_DOCS</span> entry (see <aclass="el" href="#how-to-document-physics-constraints" title="How to Document Physics Constraints">How to Document Physics Constraints</a> below).</p>
399
+
<p><b>Step 5: Declare in Fortran</b> (<spanclass="tt">src/<target>/m_global_parameters.fpp</span>)</p>
399
400
<p>Add the variable declaration in the appropriate target's global parameters module. Choose the target(s) where the parameter is used:</p>
<p>When adding a new <spanclass="tt">check_</span> method to <spanclass="tt">case_validator.py</span>, document its physics by adding an entry to the <spanclass="tt">PHYSICS_DOCS</span> dict at the top of the file:</p>
<divclass="line"><spanclass="stringliteral">"category"</span>: <spanclass="stringliteral">"Thermodynamic Constraints"</span>, <spanclass="comment"># Required: groups the constraint in docs</span></div>
684
+
<divclass="line"><spanclass="stringliteral">"explanation"</span>: <spanclass="stringliteral">"Why this constraint exists."</span>, <spanclass="comment"># Required: plain English</span></div>
<divclass="line"><spanclass="stringliteral">"references"</span>: [<spanclass="stringliteral">"Wilfong26"</span>], <spanclass="comment"># Optional: BibTeX keys from references.bib</span></div>
687
+
<divclass="line"><spanclass="stringliteral">"exceptions"</span>: [<spanclass="stringliteral">"IBM cases"</span>], <spanclass="comment"># Optional: when constraint doesn't apply</span></div>
688
+
<divclass="line"> },</div>
689
+
<divclass="line">}</div>
690
+
</div><!-- fragment --><p>The <aclass="el" href="physics_constraints.html" title="Physics Constraints">Physics Constraints</a> page is <b>auto-generated</b> — run <spanclass="tt">./mfc.sh generate</span> to rebuild it. The generator merges your <spanclass="tt">PHYSICS_DOCS</span> entry with the AST-extracted <spanclass="tt">prohibit()</span>/<spanclass="tt">warn()</span> calls, so stage, severity, and parameter information appear automatically.</p>
<tdclass="markdownTableBodyNone"><spanclass="tt">explanation</span></td><tdclass="markdownTableBodyNone">Yes </td><tdclass="markdownTableBodyNone">Plain English description of the physics </td></tr>
701
+
<trclass="markdownTableRowEven">
702
+
<tdclass="markdownTableBodyNone"><spanclass="tt">math</span></td><tdclass="markdownTableBodyNone">No </td><tdclass="markdownTableBodyNone">LaTeX formula (rendered by Doxygen's MathJax) </td></tr>
703
+
<trclass="markdownTableRowOdd">
704
+
<tdclass="markdownTableBodyNone"><spanclass="tt">references</span></td><tdclass="markdownTableBodyNone">No </td><tdclass="markdownTableBodyNone">List of BibTeX cite keys from <spanclass="tt">docs/references.bib</span></td></tr>
705
+
<trclass="markdownTableRowEven">
706
+
<tdclass="markdownTableBodyNone"><spanclass="tt">exceptions</span></td><tdclass="markdownTableBodyNone">No </td><tdclass="markdownTableBodyNone">List of cases where the constraint doesn't apply </td></tr>
707
+
</table>
708
+
<p><b>Categories:</b> Thermodynamic Constraints, Mixture Constraints, Domain and Geometry, Velocity and Dimensional Consistency, Model Equations, Boundary Conditions, Bubble Physics, Feature Compatibility, Numerical Schemes, Acoustic Sources, Post-Processing.</p>
0 commit comments