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
Copy file name to clipboardExpand all lines: docs/documentation/case.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -298,7 +298,7 @@ These physical parameters must be consistent with fluid material's parameters de
298
298
#### Elliptic Smoothing
299
299
300
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.
301
-
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.
301
+
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.
@@ -387,6 +387,14 @@ Details of implementation of viscosity in MFC can be found in \cite Coralic15.
387
387
388
388
-`fluid_pp(i)%%G` is required for `hypoelasticity`.
389
389
390
+
> **Stored-form parameters:** The values `gamma`, `pi_inf`, and `Re(1)`/`Re(2)` are **not** the raw physical quantities. MFC expects transformed stored forms:
391
+
> -`gamma` = \f$1/(\gamma-1)\f$, not \f$\gamma\f$ itself
See @ref equations "Equations" for the mathematical models these parameters control.
@@ -658,7 +666,7 @@ If `file_per_process` is true, then pre_process, simulation, and post_process mu
658
666
659
667
-`cons_vars_wrt` and `prim_vars_wrt` activate the output of conservative and primitive state variables into the database.
660
668
661
-
-`[variable's name]_wrt` activates the output of each specified variable into the database.
669
+
-``[variable's name]_wrt`` activates the output of each specified variable into the database.
662
670
663
671
-`schlieren_alpha(i)` specifies the intensity of the numerical Schlieren of $i$-th component.
664
672
@@ -898,11 +906,11 @@ The parameters are optionally used to define initial velocity profiles and pertu
898
906
899
907
-`mixlayer_vel_profile` activates setting the mean streamwise velocity to a hyperbolic tangent profile. This option works only for `n > 0`.
900
908
901
-
-`mixlayer_vel_coef` is a parameter for the hyperbolic tangent profile of a mixing layer when `mixlayer_vel_profile = 'T'`. The mean streamwise velocity profile is given as:
909
+
-`mixlayer_vel_coef` is a parameter for the hyperbolic tangent profile of a mixing layer when ``mixlayer_vel_profile = 'T'``. The mean streamwise velocity profile is given as:
902
910
903
911
\f[ u = \text{patch\_icpp(1)\%vel(1)} \cdot \tanh( y_{cc} \cdot \text{mixlayer\_vel\_coef}) \f]
904
912
905
-
-`mixlayer_perturb` activates the velocity perturbation for a temporal mixing layer with hyperbolic tangent mean streamwise velocity profile, using an inverter version of the spectrum-based synthetic turbulence generation method proposed by \cite Guo23. This option only works for `p > 0` and `mixlayer_vel_profile = 'T'`.
913
+
-`mixlayer_perturb` activates the velocity perturbation for a temporal mixing layer with hyperbolic tangent mean streamwise velocity profile, using an inverter version of the spectrum-based synthetic turbulence generation method proposed by \cite Guo23. This option only works for `p > 0` and ``mixlayer_vel_profile = 'T'``.
Copy file name to clipboardExpand all lines: docs/documentation/equations.md
+203-1Lines changed: 203 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,208 @@ 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 {#sec-units-dimensions}
33
+
34
+
### General Users: Dimensional Handling {#sec-dimensional-handling}
35
+
36
+
#### Dimensions In = Dimensions Out {#sec-dimensions-in-out}
37
+
38
+
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.
39
+
40
+
This means that for simulations **without** sub-grid bubble models, the user can work in any consistent unit system without additional effort.
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:
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$.
54
+
55
+
**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.
56
+
57
+
#### Common Material Values {#sec-material-values}
58
+
59
+
Pre-computed stored-form values for common fluids (SI units):
For viscous cases, provide the **reciprocal** of the dynamic viscosity:
84
+
85
+
```python
86
+
mu =1.002e-3# water viscosity [Pa·s]
87
+
"fluid_pp(1)%Re(1)": 1.0/ mu, # ≈ 998
88
+
```
89
+
90
+
#### Unit Consistency {#sec-unit-consistency}
91
+
92
+
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.
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:
Here \f$R\f$ and \f$R_0\f$ are non-dimensional radii (scaled by \f$x_0\f$), and \f$\dot{R}\f$ is a non-dimensional wall speed (scaled by \f$u_0\f$); the entire bubble ODE is solved in non-dimensional variables.
103
+
104
+
The dimensionless groups are:
105
+
106
+
| Dimensionless group | Definition | Code variable | Computed from |
Because the bubble equations use these dimensionless numbers directly, all `bub_pp%%` inputs are interpreted by the code as **already non-dimensional**. The code does **not** non-dimensionalize bubble quantities internally. Therefore, when bubbles are enabled, the simulation must be run in a **fully non-dimensional** form: **all** inputs — flow ICs/BCs, EOS parameters, domain lengths, `dt`, and `bub_pp%%` values — must be scaled with the same \f$(x_0, p_0, \rho_0, u_0, t_0, T_0)\f$ reference quantities, or the coupled solution will be physically incorrect.
114
+
115
+
#### Reference Scales {#sec-reference-scales}
116
+
117
+
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:
#### Two Different Viscosity Parameters {#sec-two-viscosities}
173
+
174
+
MFC has two conceptually distinct viscosity-related parameters that serve different physical roles:
175
+
176
+
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`).
179
+
180
+
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`).
183
+
184
+
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).
185
+
186
+
### Worked Examples {#sec-nondim-example}
187
+
188
+
#### Example: Non-Dimensionalizing a Bubble Case {#sec-bubble-example}
189
+
190
+
A typical bubble case setup in `case.py` follows this pattern:
191
+
192
+
```python
193
+
import math
194
+
195
+
# Physical properties (SI units)
196
+
rho_l =1.0e03# liquid density [kg/m³]
197
+
mu_l =1.002e-03# liquid viscosity [kg/(m·s)]
198
+
ss =0.07275# surface tension [kg/s²]
199
+
pv =2.3388e03# vapor pressure [Pa]
200
+
gam_l =7.15# liquid stiffened gas gamma
201
+
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.
231
+
232
+
---
233
+
32
234
## 2. Governing PDEs
33
235
34
236
### 2.1 Five-Equation Model (`model_eqns = 2`)
@@ -137,7 +339,7 @@ The pressure is recovered from the total energy as:
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).
141
343
142
344
### 3.2 Ideal Gas EOS (Chemistry, `chemistry = .true.`)
Copy file name to clipboardExpand all lines: docs/documentation/getting-started.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,12 @@ MFC has example cases in the `examples` folder. You can run such a case interact
198
198
199
199
Please refer to the @ref running "Running" document for more information on `case.py` files and how to run them.
200
200
201
+
## Units and Dimensions
202
+
203
+
MFC is **unit-agnostic**: the solver performs no internal unit conversions. Whatever units you provide for initial conditions, boundary conditions, and material properties, the same units appear in the output.
204
+
205
+
The only requirement is **consistency** — all inputs must use the same unit system. Note that some parameters use **transformed stored forms** rather than standard physical values (e.g., `gamma` expects \f$1/(\gamma-1)\f$, not \f$\gamma\f$ itself). See @ref sec-stored-forms for details.
Copy file name to clipboardExpand all lines: docs/documentation/testing.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ To test the post-processing code, append the `-a` or `--test-all` option:
99
99
./mfc.sh test -a -j 8
100
100
```
101
101
102
-
This argument will re-run the test stack with `parallel_io='T'`, which generates silo_hdf5 files.
102
+
This argument will re-run the test stack with ``parallel_io='T'``, which generates silo_hdf5 files.
103
103
It will also turn most write parameters (`*_wrt`) on.
104
104
Then, it searches through the silo files using `h5dump` to ensure that there are no `NaN`s or `Infinity`s.
105
105
Although adding this option does not guarantee that accurate `.silo` files are generated, it does ensure that the post-process code does not fail or produce malformed data.
0 commit comments