Skip to content

Commit 0616ade

Browse files
sbryngelsonclaude
andcommitted
Document stored parameter conventions and common material values
Add documentation for non-bubble users explaining that fluid_pp%gamma, pi_inf, and Re use transformed stored forms (1/(γ-1), γπ∞/(γ-1), 1/μ). Includes a common materials reference table and worked examples. Also fixes misleading EOS section that implied raw γ/π∞ are input directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ce4dc84 commit 0616ade

1 file changed

Lines changed: 53 additions & 1 deletion

File tree

docs/documentation/equations.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,58 @@ The main flow solver (Navier-Stokes equations, Riemann solvers, viscous stress,
3737

3838
This means that for simulations **without** sub-grid bubble models, the user can work in any consistent unit system without additional effort.
3939

40+
### Stored Parameter Conventions
41+
42+
Several EOS and transport parameters use **transformed stored forms** that differ from the standard physical values. This is the most common source of input errors:
43+
44+
| Parameter | Physical quantity | What MFC expects (stored form) |
45+
|---|---|---|
46+
| `fluid_pp(i)%gamma` | Heat capacity ratio \f$\gamma\f$ | \f$\Gamma = \dfrac{1}{\gamma - 1}\f$ |
47+
| `fluid_pp(i)%pi_inf` | Stiffness pressure \f$\pi_\infty\f$ [Pa] | \f$\Pi_\infty = \dfrac{\gamma\,\pi_\infty}{\gamma - 1}\f$ [Pa] |
48+
| `fluid_pp(i)%Re(1)` | Dynamic viscosity \f$\mu\f$ | \f$1/\mu\f$ (inverse viscosity) |
49+
| `fluid_pp(i)%Re(2)` | Bulk viscosity \f$\mu_b\f$ | \f$1/\mu_b\f$ (inverse bulk viscosity) |
50+
51+
These transformations arise because MFC internally solves the energy equation using the transformed variables \f$\Gamma\f$ and \f$\Pi_\infty\f$ (see Section 3.1), and the viscous stress is computed by dividing by `Re` rather than multiplying by \f$\mu\f$.
52+
53+
**Common mistake:** setting `fluid_pp(1)%gamma = 1.4` for air. The correct value is `1.0 / (1.4 - 1.0) = 2.5`. Setting `gamma = 1.4` corresponds to a physical \f$\gamma \approx 1.71\f$, which is not a standard gas.
54+
55+
### Common Material Values
56+
57+
Pre-computed stored-form values for common fluids (SI units):
58+
59+
| Material | \f$\gamma\f$ | \f$\pi_\infty\f$ [Pa] | `gamma` (stored) | `pi_inf` (stored) [Pa] |
60+
|---|---|---|---|---|
61+
| Air | 1.4 | 0 | 2.5 | 0 |
62+
| Helium | 5/3 | 0 | 1.5 | 0 |
63+
| Water (Tait) | 4.4 | 6.0e8 | 0.2941 | 7.76e8 |
64+
| Water (\cite LeMetayer04) | 6.12 | 3.43e8 | 0.1953 | 4.10e8 |
65+
66+
Example for an air-water simulation:
67+
68+
```python
69+
# Air (fluid 1)
70+
gam_a = 1.4
71+
"fluid_pp(1)%gamma": 1.0 / (gam_a - 1.0), # = 2.5
72+
"fluid_pp(1)%pi_inf": 0.0,
73+
74+
# Water (fluid 2)
75+
gam_w = 4.4
76+
pi_w = 6.0e8 # Pa
77+
"fluid_pp(2)%gamma": 1.0 / (gam_w - 1.0), # ≈ 0.294
78+
"fluid_pp(2)%pi_inf": gam_w * pi_w / (gam_w - 1.0), # ≈ 7.76e8
79+
```
80+
81+
For viscous cases, provide the **reciprocal** of the dynamic viscosity:
82+
83+
```python
84+
mu = 1.002e-3 # water viscosity [Pa·s]
85+
"fluid_pp(1)%Re(1)": 1.0 / mu, # ≈ 998
86+
```
87+
88+
### Unit Consistency
89+
90+
The solver does not check or convert units. All inputs must use the **same consistent unit system** (e.g., all SI or all CGS). Mixing units — for example, pressures in atmospheres with densities in kg/m³ — will produce silently incorrect results.
91+
4092
### Non-Dimensional Bubble Dynamics
4193

4294
The sub-grid bubble models (`bubbles_euler = .true.` or `bubbles_lagrange = .true.`) solve the bubble wall dynamics in **non-dimensional form**. The bubble wall pressure equation as implemented is:
@@ -281,7 +333,7 @@ The pressure is recovered from the total energy as:
281333

282334
\f[\frac{1}{\rho\,c^2} = \sum_k \frac{\alpha_k}{\rho_k\,c_k^2}\f]
283335

284-
Input parameters per fluid: `gamma` (\f$\gamma_k\f$), `pi_inf` (\f$\pi_{\infty,k}\f$), `cv` (\f$c_{v,k}\f$), `qv` (\f$q_{v,k}\f$), `qvp` (\f$q'_{v,k}\f$).
336+
Input parameters per fluid: `gamma` (\f$\Gamma_k = 1/(\gamma_k - 1)\f$), `pi_inf` (\f$\Pi_{\infty,k} = \gamma_k\,\pi_{\infty,k}/(\gamma_k - 1)\f$), `cv` (\f$c_{v,k}\f$), `qv` (\f$q_{v,k}\f$), `qvp` (\f$q'_{v,k}\f$). Note that `gamma` and `pi_inf` are stored in transformed form, not as the raw physical values (see Section 1b).
285337

286338
### 3.2 Ideal Gas EOS (Chemistry, `chemistry = .true.`)
287339

0 commit comments

Comments
 (0)