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
Add dimensional analysis documentation to equations reference
Add Section 1b to equations.md documenting how MFC handles dimensions:
unit-agnostic flow solver, non-dimensional bubble dynamics, reference
scales, non-dimensionalization formulas for all bub_pp parameters, the
two different viscosity parameters (fluid_pp%Re vs bub_pp%mu_l), and a
worked example.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/documentation/equations.md
+141Lines changed: 141 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,147 @@ The parameter `model_eqns` (1, 2, 3, or 4) selects the governing equation set.
29
29
30
30
---
31
31
32
+
## 1b. Units, Dimensions, and Non-Dimensionalization
33
+
34
+
### Dimensional Handling in the Flow Solver
35
+
36
+
The main flow solver (Navier-Stokes equations, Riemann solvers, viscous stress, body forces, surface tension, etc.) is **unit-agnostic**: whatever units the user provides for the initial and boundary conditions, the solver preserves them throughout the computation. If the user inputs SI units, the outputs are in SI units. If the user inputs CGS, the outputs are in CGS. No internal non-dimensionalization is performed by the flow solver.
37
+
38
+
This means that for simulations **without** sub-grid bubble models, the user can work in any consistent unit system without additional effort.
39
+
40
+
### Non-Dimensional Bubble Dynamics
41
+
42
+
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:
These groups are computed in `src/common/m_helper.fpp` (lines 143--194). Because the bubble equations use these dimensionless numbers directly, **all**`bub_pp%` parameters must be provided in non-dimensional form by the user. The code does not perform any internal non-dimensionalization of these inputs.
56
+
57
+
### Reference Scales
58
+
59
+
When using bubble models, the user must choose reference scales and non-dimensionalize **all** inputs (flow and bubble) consistently. The standard convention used in the MFC examples is:
MFC has two conceptually distinct viscosity-related parameters that serve different physical roles:
116
+
117
+
1.**`fluid_pp(i)%Re(1)`** — Used for the **macroscopic flow viscous stress tensor** (Navier-Stokes equations). This is \f$1/\mu\f$ in dimensional simulations, or \f$\rho_0 x_0 u_0 / \mu\f$ (a Reynolds number) when non-dimensionalized. It appears as a **divisor** in the viscous stress computation:
Stored in the `physical_parameters` derived type (`src/common/m_derived_types.fpp`).
120
+
121
+
2.**`bub_pp%mu_l`** — Used for **microscale bubble wall viscous damping** (Rayleigh-Plesset / Keller-Miksis equations). This is the non-dimensional liquid viscosity \f$\mu_l / (\rho_0 x_0 u_0)\f$. It appears as a **multiplier** in the bubble wall pressure:
Stored in the `subgrid_bubble_physical_parameters` derived type (`src/common/m_derived_types.fpp`).
124
+
125
+
These two parameters represent viscous effects at fundamentally different scales — bulk flow dissipation vs. single-bubble-wall damping — and are stored in separate derived types with separate code paths. They are **not** interchangeable: `fluid_pp%Re(1)` is an inverse viscosity while `bub_pp%mu_l` is a viscosity (non-dimensionalized).
126
+
127
+
### Example: Non-Dimensionalizing a Bubble Case
128
+
129
+
A typical bubble case setup in `case.py` follows this pattern:
130
+
131
+
```python
132
+
import math
133
+
134
+
# Physical properties (SI units)
135
+
rho_l =1.0e03# liquid density [kg/m³]
136
+
mu_l =1.002e-03# liquid viscosity [kg/(m·s)]
137
+
ss =0.07275# surface tension [kg/s²]
138
+
pv =2.3388e03# vapor pressure [Pa]
139
+
gam_l =7.15# liquid stiffened gas gamma
140
+
pi_inf =306.0e06# liquid stiffened gas pi_inf [Pa]
Note the inverse relationship: `fluid_pp%Re(1) = 1 / bub_pp%mu_l` when both use the same reference scales and the same physical viscosity. This is expected — they encode the same physical viscosity but in reciprocal forms for their respective equations.
0 commit comments