Skip to content

Commit 61b0ec3

Browse files
authored
Merge pull request #138 from wilfonba/singlePrecisionFix
2 parents 7e48c50 + bda0837 commit 61b0ec3

File tree

39 files changed

+139
-392
lines changed

39 files changed

+139
-392
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ examples/*/binary
4040
examples/*/fort.1
4141
examples/*/*.sh
4242
examples/*/*.err
43+
*.mod

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake")
7171
# === Compiler Flags
7272
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
7373
add_compile_options(
74-
$<$<COMPILE_LANGUAGE:Fortran>:-fdefault-real-8>
7574
$<$<COMPILE_LANGUAGE:Fortran>:-ffree-line-length-none>
76-
$<$<COMPILE_LANGUAGE:Fortran>:-fdefault-double-8>
7775
)
7876

7977
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -108,9 +106,7 @@ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
108106
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-free>)
109107
elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI"))
110108
add_compile_options(
111-
$<$<COMPILE_LANGUAGE:Fortran>:-r8>
112109
$<$<COMPILE_LANGUAGE:Fortran>:-Mfreeform>
113-
$<$<COMPILE_LANGUAGE:Fortran>:-Mr8intrinsics>
114110
$<$<COMPILE_LANGUAGE:Fortran>:-cpp>
115111
-Minfo=accel
116112
)

docs/documentation/case.md

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,8 @@ Definition of the parameters is described in the following subsections.
7575

7676
| Parameter | Type | Description |
7777
| ---: | :----: | :--- |
78-
| `case_dir` | String | Case script directory |
7978
| `run_time_info` | Logical | Output run-time information |
8079

81-
- `case_dir` specifies the directory where the python input file is located.
82-
8380
- `run_time_info` generates a text file that includes run-time information including the CFL number(s) at each time-step.
8481

8582
### 2. Computational Domain
@@ -91,6 +88,7 @@ Definition of the parameters is described in the following subsections.
9188
| `a_x[y,z]` | Real | Rate at which the grid is stretched in the $x$[y,z]-direction |
9289
| `x[y,z]_a` | Real | Beginning of the stretching in the negative $x$[y,z]-direction |
9390
| `x[y,z]_b` | Real | Beginning of the stretching in the positive $x$[y,z]-direction |
91+
| `loops_x[y,z]` | Integer | Number of times to recursively apply grid stretching |
9492
| `cyl_coord` | Logical | Cylindrical coordinates (2D: Axisymmetric, 3D: Cylindrical) |
9593
| `m` | Integer | Number of grid cells in the $x$-coordinate direction |
9694
| `n` | Integer | Number of grid cells in the $y$-coordinate direction |
@@ -118,7 +116,8 @@ The grid is gradually stretched such that the domain boundaries are pushed away
118116

119117
$$ x_{cb,stretch} = x_{cb} + \frac{x_{cb}}{a_x} \Bigg[ \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_{cb}-x_a)}{L} \right) \right] + \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_{cb}-x_b)}{L} \right) \right] -2 \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_b-x_a)}{2L} \right) \right] \Bigg] $$
120118

121-
where `x_cb` and `x_[cb,stretch]` are the coordinates of a cell boundary at the original and stretched domains, respectively. `L` is the domain length along the `x` axis: `L`=`x_domain%end`-`x_domain%beg`. Crudely speaking, `x_a` and `x_b` define the coordinates at which the grid begins to get stretched in the negative and positive directions along the $x$ axis, respectively. $a_x$ defines the smoothness of the stretching. Stretching along the $y$ and $z$ axes follows the same logistics. Optimal choice of the parameters for grid stretching is case-dependent and left to the user.
119+
where `x_cb` and `x_[cb,stretch]` are the coordinates of a cell boundary at the original and stretched domains, respectively. `L` is the domain length along the `x` axis: `L`=`x_domain%end`-`x_domain%beg`. Crudely speaking, `x_a` and `x_b` define the coordinates at which the grid begins to get stretched in the negative and positive directions along the $x$ axis, respectively. $a_x$ defines the smoothness of the stretching. Stretching along the $y$ and $z$ axes follows the same logistics. Optimal choice of the parameters for grid stretching is case-dependent and left to the user. `loops_x[y,z]` defines the number of times
120+
the grid stretching funciton is applied and has a default value of one.
122121

123122
- `cyl_coord` activates cylindrical coordinates. The domain is defined in $x$-$y$-$z$ cylindrical coordinates, instead of Cartesian coordinates. Domain discritization is accordingly conducted along the axes of cylindrical coordinates. Wnen $p=0$, the domain is defined on $x$-$y$ axi-symmetric coordinates. In both Coordinates, mesh stretching can be defined along the $x$- and $y$-axes. MPI topology is automatically optimized to maximize the parallel efficiency for given choice of coordinate systems.
124123

@@ -203,24 +202,15 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
203202
| `adv_alphan` | Logical | Equations for all $N$ volume fractions (instead of $N-1$) |
204203
| `mpp_lim` | Logical | Mixture physical parameters limits |
205204
| `mixture_err` | Logical | Mixture properties correction |
206-
| `time_stepper` | Integer | Runge--Kutta order [1--5] |
207-
| `weno_vars` | Integer | WENO reconstruction on [1] Conservative; [2] Primitive variables |
205+
| `time_stepper` | Integer | Runge--Kutta order [1--3] |
208206
| `weno_order` | Integer | WENO order [1,3,5] |
209207
| `weno_eps` | Real | WENO perturbation (avoid division by zero) |
210-
| `char_decomp` | Logical | Characteristic decomposition |
211208
| `mapped_weno` | Logical | WENO with mapping of nonlinear weights |
212209
| `null_weights` | Logical | Null WENO weights at boundaries |
213210
| `mp_weno` | Logical | Monotonicity preserving WENO |
214211
| `riemann_solver` | Integer | Riemann solver algorithm: [1] HLL*; [2] HLLC; [3] Exact* |
215212
| `avg_state` | Integer | Averaged state evaluation method: [1] Roe averagen*; [2] Arithmetic mean |
216213
| `wave_speeds` | Integer | Wave-speed estimation: [1] Direct (Batten et al. 1997); [2] Pressure-velocity* (Toro 1999) |
217-
| `commute_err`* | Logical | Commutative error correction via cell-interior quadrature |
218-
| `split_err`* | Logical | Dimensional splitting error correction via cell-boundary |
219-
| `reg_eps` * | Real | Interface thickness parameter for regularization terms |
220-
| `flux_lim` * | Integer | Choice of flux limiter: [1] Minmod; [2] MC; [3] Ospre; [4] Superbee; [5] Sweby; [6] van Albada; [7] van Leer. |
221-
| `tvd_rhs_flux` * | Logical | Apply TVD flux limiter to intercell fluxes outside Riemann solver |
222-
| `tvd_riemann_flux` * | Logical | Apply TVD flux limiter to cell edges inside Riemann solver |
223-
| `tvd_wave_speeds` * | Logical | TVD wave-speeds for flux computation inside Riemann solver |
224214

225215
- \* Options that work only with `model_eqns` $=2$.
226216
- † Options that work only with `cyl_coord` $=$ `False`.
@@ -252,16 +242,10 @@ where $\alpha_i$ is the void fraction of $i$-th component. When a single-compone
252242
- `time_stepper` specifies the order of the Runge-Kutta (RK) time integration scheme that is used for temporal integration in simulation, from the 1st to 5th order by corresponding integer.
253243
Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD), third order RK scheme ([Gottlieb and Shu, 1998](references.md#Gottlieb98)).
254244

255-
- `weno_vars` specifies the choice of state variables that are reconstructed using a WENO scheme by an integer of 1 or 2.
256-
257-
- `weno_vars` $=$ 1 and 2 correspond to conservative variables and primitive variables, respectively.
258-
259245
- `weno_order` specifies the order of WENO scheme that is used for spatial reconstruction of variables by an integer of 1, 3, and 5, that correspond to the 1st, 3rd, and 5th order, respectively.
260246

261247
- `weno_eps` specifies the lower bound of the WENO nonlinear weights. Practically, `weno_eps` $<10^{-6}$ is used.
262248

263-
- `char_decomp` activates projection of the state variables onto characteristic fields prior to WENO reconstruction.
264-
265249
- `mapped_weno` activates mapping of the nonlinear WENO weights to the more accurate nonlinear weights in order to reinstate the optimal order of accuracy of the reconstruction in the proximity of critical points ([Henrick et al., 2005](references.md#Henrick05)).
266250

267251
- `null_weights` activates nullification of the nonlinear WENO weights at the buffer regions outside the domain boundaries when the Riemann extrapolation boundary condition is specified (`bc_[x,y,z]\%beg[end]}` $=-4$).
@@ -275,19 +259,6 @@ Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD),
275259
- `wave_speeds` specifies the choice of the method to compute the left, right, and middle wave speeds in the Riemann solver by an integer of 1 and 2.
276260
`wave_speeds` $=$ 1 and 2 correspond to the direct method ([Batten et al., 1997](references.md#Batten97)), and indirect method that approximates the pressures and velocity ([Toro, 2013](references.md#Toro13)), respectively.
277261

278-
- `commute_err` activates WENO reconstruction of the cell-averaged variables at the cell-interior Gaussian quadrature points, following the two-point, fourth order Gaussian quadrature rule ([Titarev and Toro, 2004](references.md#Titarev04)).
279-
280-
- `split_err` activates numerical approximation of the left or right cell-boundary integral-average of the given variables by getting the arithmetic mean of their WENO-reconstructed values at the cell-boundary Gaussian quadrature points, following the two-point, fourth order Gaussian quadrature rule ([Titarev and Toro, 2004](references.md#Titarev04)). When `commute_err` and `split_err` are set `True` and the 5th-order WENO is used, the global order of accuracy of the spatial integration of the governing equations becomes fourth order ([Coralic and Colonius, 2014](references.md#Coralic14)).
281-
282-
- `reg_eps` specifies the magnitude of interface regularization for two-component flows that prevents diffusion of the phase interface ([Tiwari et al., 2013](references.md#Tiwari13)). The default value of `reg_eps` is unity. When `reg_eps` is undefined, interface regularization is not used. Details of implementation and assessment are addressed in [Meng (2016)](references.md#Meng16); [Schmidmayer et al. (2019)](references.md#Schmidmayer19).
283-
284-
- `flux_lim` specifies the choice of flux limiter that is used in simulation by an integer from 1 through 7 as listed in table [Flux Limiters](#flux-limiters). When `flux_lim` is undefined, flux limiter is not applied. Details of the limiters and their implementations in MFC can be found in [Meng (2016)](references.md#Meng16).
285-
286-
- `tvd_rhs_flux` activates a specified flux limiter to inte-rcell fluxes outside Riemann solver.
287-
288-
- `tvd_riemann_flux` activate a specified flux limiter to cell edges inside the Riemann solver. `tvd_rhs_flux` and `tvd_riemann_flux` are mutually exclusive.
289-
290-
- `tvd_wave_speeds` activates the use of the TVD wave speeds for flux computation inside the Riemann solver when `tvd_riemann_flux` is set `True`.
291262

292263
### 6. Formatted Output
293264

@@ -298,8 +269,7 @@ Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD),
298269
| `parallel_io` | Logical | Parallel I/O |
299270
| `cons_vars_wrt` | Logical | Write conservative variables |
300271
| `prim_vars_wrt` | Logical | Write primitive variables |
301-
| `fourier_decomp` | Logical | Apply a spatial Fourier decomposition to the output variables |
302-
| `alpha_rho_wrt(i)` | Logical | Add the partial density of the fluid $i$ to the database |
272+
| `alpha_rho_wrt(i)` | Logical | Add the partial density of the fluid $i$ to the database \|
303273
| `rho_wrt` | Logical | Add the mixture density to the database |
304274
| `mom_wrt(i)` | Logical | Add the $i$-direction momentum to the database |
305275
| `vel_wrt(i)` | Logical | Add the $i$-direction velocity to the database |
@@ -319,8 +289,6 @@ Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD),
319289
| `probe_wrt` | Logical | Write the flow chosen probes data files for each time step |
320290
| `num_probes` | Integer | Number of probes |
321291
| `probe(i)%[x,y,z]` | Real | Coordinates of probe $i$ |
322-
| `com_wrt(i)` | Logical | Add the center of mass of fluid $i$ to the database |
323-
| `cb_wrt(i)` | Logical | Add coherent body data of fluid $i$ to the database |
324292

325293
The table lists formatted database output parameters. The parameters define variables that are outputted from simulation and file types and formats of data as well as options for post-processing.
326294

@@ -342,10 +310,6 @@ Parallel I/O enables the use of different number of processors in each of the pr
342310

343311
- `probe_wrt` activates output of state variables at coordinates specified by `probe(i)%[x;y,z]`.
344312

345-
- `com_wrt(i)` activates output of the center of mass of $i$-th fluid component into the database.
346-
347-
- `cb_wrt(i)` activates output of the coherent body mass of $i$-th fluid component in the domain into the database.
348-
349313

350314
### 7. Acoustic Source
351315

@@ -468,7 +432,7 @@ The table lists velocity field parameters. The parameters are optionally used to
468432
| -2 | Normal | Reflective |
469433
| -3 | Normal | Ghost cell extrapolation |
470434
| -4 | Normal | Riemann extrapolation |
471-
| -5 | Normal | Slip wall |
435+
| -5 | Characteristic | Slip wall |
472436
| -6 | Characteristic | Non-reflecting subsonic buffer |
473437
| -7 | Characteristic | Non-reflecting subsonic inflow |
474438
| -8 | Characteristic | Non-reflecting subsonic outflow |
@@ -511,20 +475,6 @@ corresponds to the input value in `input.py` labeled `patch_icpp(j)%geometry` w
511475
$j$ is the patch index. Each patch requires a different set of parameters, which are
512476
also listed in this table.
513477

514-
### Flux limiters
515-
516-
| # | Description |
517-
| ---: | :---- |
518-
| 1 | Minmod |
519-
| 2 | MC |
520-
| 3 | Ospre |
521-
| 4 | Superbee |
522-
| 5 | Sweby |
523-
| 6 | van Albada |
524-
| 7 | van Leer |
525-
526-
The flux limiters supported by the MFC are listed in table [Flux Limiters](#flux-limiters). Each limiter can be specified by specifying the value of `flux_lim`. Details of their implementations can be found in [Meng (2016)](references.md#Meng16).
527-
528478
### Monopole supports
529479

530480
| # | Description |

examples/0D_qbmm/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
'mpp_lim' : 'F',
8484
'mixture_err' : 'F',
8585
'time_stepper' : 1,
86-
'weno_vars' : 2,
8786
'weno_order' : 3,
8887
'weno_eps' : 1.E-16,
8988
'mapped_weno' : 'T',

examples/1D_bubblescreen/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
'mpp_lim' : 'F',
100100
'mixture_err' : 'F',
101101
'time_stepper' : 3,
102-
'weno_vars' : 2,
103102
'weno_order' : 5,
104103
'weno_eps' : 1.E-16,
105104
'mapped_weno' : 'T',

examples/1D_exp_bubscreen/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
'mpp_lim' : 'F',
113113
'mixture_err' : 'F',
114114
'time_stepper' : 3,
115-
'weno_vars' : 2,
116115
'weno_order' : 5,
117116
'weno_eps' : 1.E-16,
118117
'mapped_weno' : 'T',

examples/1D_hypo_2materials/case.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
'adv_alphan' : 'T',
3838
'mpp_lim' : 'F',
3939
'mixture_err' : 'F',
40-
'time_stepper' : 3,
41-
'weno_vars' : 2,
40+
'time_stepper' : 3,
4241
'weno_order' : 3,
4342
'weno_eps' : 1.E-16,
4443
'mapped_weno' : 'F',

examples/1D_impact/case.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
'adv_alphan' : 'T',
3838
'mpp_lim' : 'F',
3939
'mixture_err' : 'F',
40-
'time_stepper' : 3,
41-
'weno_vars' : 2,
40+
'time_stepper' : 3,
4241
'weno_order' : 3,
4342
'weno_eps' : 1.E-16,
4443
'mapped_weno' : 'F',

examples/1D_kapilashocktube/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
'mpp_lim' : 'F',
2828
'mixture_err' : 'F',
2929
'time_stepper' : 3,
30-
'weno_vars' : 2,
3130
'weno_order' : 5,
3231
'weno_eps' : 1.E-16,
3332
'mapped_weno' : 'T',

examples/1D_poly_bubscreen/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
'mpp_lim' : 'F',
105105
'mixture_err' : 'F',
106106
'time_stepper' : 1,
107-
'weno_vars' : 2,
108107
'weno_order' : 1,
109108
'weno_eps' : 1.E-16,
110109
'mapped_weno' : 'F',

0 commit comments

Comments
 (0)