Skip to content

Commit bda0837

Browse files
authored
Merge branch 'master' into singlePrecisionFix
2 parents 77fed24 + 7e48c50 commit bda0837

File tree

11 files changed

+1383
-8
lines changed

11 files changed

+1383
-8
lines changed

docs/documentation/case.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ There are multiple sets of parameters that must be specified in the python input
6666
6. [Formatted Database and Structure Parameters](#6-formatted-output)
6767
7. [(Optional) Acoustic Source Parameters](#7-acoustic-source)
6868
8. [(Optional) Ensemble-Averaged Bubble Model Parameters](#8-ensemble-averaged-bubble-model)
69+
9. [(Optional) Velocity Field Setup Parameters](#9-velocity-field-setup)
6970

70-
Items 7 and 8 are optional sets of parameters that activate the acoustic source model and ensemble-averaged bubble model, respectively.
71+
Items 7, 8, and 9 are optional sets of parameters that activate the acoustic source model, ensemble-averaged bubble model, and initial velocity field setup, respectively.
7172
Definition of the parameters is described in the following subsections.
7273

7374
### 1. Runtime
@@ -266,7 +267,7 @@ Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD),
266267
| `format` | Integer | Output format. [1]: Silo-HDF5; [2] Binary |
267268
| `precision` | Integer | [1] Single; [2] Double |
268269
| `parallel_io` | Logical | Parallel I/O |
269-
| `cons_vars_wrt` | Logical | Write conservative variables \|
270+
| `cons_vars_wrt` | Logical | Write conservative variables |
270271
| `prim_vars_wrt` | Logical | Write primitive variables |
271272
| `alpha_rho_wrt(i)` | Logical | Add the partial density of the fluid $i$ to the database \|
272273
| `rho_wrt` | Logical | Add the mixture density to the database |
@@ -277,11 +278,12 @@ Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD),
277278
| `alpha_wrt(i)` | Logical | Add the volume fraction of fluid $i$ to the database |
278279
| `gamma_wrt` | Logical | Add the specific heat ratio function to the database |
279280
| `heat_ratio_wrt` | Logical | Add the specific heat ratio to the database |
280-
| `pi_inf_wrt` | Logical | Add the liquid stiffness function to the database \|
281+
| `pi_inf_wrt` | Logical | Add the liquid stiffness function to the database |
281282
| `pres_inf_wrt` | Logical | Add the liquid stiffness to the formatted database |
282283
| `c_wrt` | Logical | Add the sound speed to the database |
283284
| `omega_wrt(i)` | Logical | Add the $i$-direction vorticity to the database |
284285
| `schlieren_wrt` | Logical | Add the numerical schlieren to the database|
286+
| `qm_wrt` | Logical | Add the Q-criterion to the database|
285287
| `fd_order` | Integer | Order of finite differences for computing the vorticity and the numerical Schlieren function [1,2,4] |
286288
| `schlieren_alpha(i)` | Real | Intensity of the numerical Schlieren computed via `alpha(i)` |
287289
| `probe_wrt` | Logical | Write the flow chosen probes data files for each time step |
@@ -397,6 +399,29 @@ When `polytropic` is set `False`, the gas compression is modeled as non-polytrop
397399
`gamma_v`, `M_v`, `mu_v`, and `k_v` specify the specific heat ratio, molecular weight, viscosity, and thermal conductivity of a chosen component.
398400
Implementation of the parameterse into the model follow [Ando (2010)](references.md#Ando10).
399401

402+
### 9. Velocity Field Setup
403+
404+
| Parameter | Type | Description |
405+
| ---: | :----: | :--- |
406+
| `perturb_flow` | Logical | Perturb the initlal velocity field by random noise |
407+
| `perturb_sph` | Logical | Perturb the initial partial density by random noise |
408+
| `perturb_sph_fluid` | Integer | Fluid component whose partial density to be perturbed |
409+
| `vel_profile` | Logical | Set the mean streamwise velocity to hyperbolic tangent profile |
410+
| `instability_wave` | Logical | Perturb the initial velocity field by instability waves |
411+
412+
The table lists velocity field parameters. The parameters are optionally used to define initial velocity profiles and perturbations.
413+
414+
- `perturb_flow` activates the perturbation of initial velocity by random noise.
415+
416+
- `perturb_sph` activates the perturbation of intial partial density by random noise.
417+
418+
- `perturb_sph_fluid` specifies the fluid component whose the partial density to be perturbed.
419+
420+
- `vel_profile` activates setting the mean streamwise velocity to hyperbolic tangent profile. This option works only for 2D and 3D cases.
421+
422+
- `instability_wave` activates the perturbation of initial velocity by instability waves obtained from linear stability analysis for a mixing layer with hyperbolic tangent mean streamwise velocity profile. This option only works for 2D and 3D cases, together with `vel_profile`=TRUE.
423+
424+
400425
## Enumerations
401426

402427
### Boundary conditions

examples/3D_turb_mixing/case.py

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
#!/usr/bin/env python3
2+
3+
import math
4+
import json
5+
6+
# SURROUNDING FLOW =============================================================
7+
# Nondimensional parameters
8+
Re0 = 50. # Reynolds number
9+
M0 = 0.2 # Mach number
10+
11+
# Fluid properties
12+
gamma = 1.4
13+
pi_inf = 0.
14+
15+
# Free stream velocity & pressure
16+
u0 = 1.
17+
pres0 = 1./(gamma*M0**2)
18+
19+
# Domain size
20+
Lx = 59.0
21+
Ly = 59.0
22+
Lz = 59.0
23+
24+
# Number of grid cells
25+
Nx = 255
26+
Ny = 255
27+
Nz = 255
28+
29+
# Grid spacing
30+
dx = Lx/float(Nx)
31+
dy = Ly/float(Ny)
32+
dz = Lz/float(Nz)
33+
34+
# Time advancement
35+
cfl = 0.1
36+
T = 100.
37+
dt = cfl*dx/u0
38+
Ntfinal = int(T/dt)
39+
Ntstart = 0
40+
Nfiles = 100
41+
t_save = int(math.ceil((Ntfinal-0)/float(Nfiles)))
42+
Nt = t_save*Nfiles
43+
t_step_start = Ntstart
44+
t_step_stop = int(Nt)
45+
46+
# ==============================================================================
47+
48+
49+
# Configuring case dictionary
50+
print(json.dumps({
51+
# Logistics ================================================================
52+
# 'case_dir' : '\'.\'',
53+
'run_time_info' : 'T',
54+
# ==========================================================================
55+
56+
# Computational Domain Parameters ==========================================
57+
'x_domain%beg' : 0.,
58+
'x_domain%end' : Lx,
59+
'y_domain%beg' : -Ly/2.,
60+
'y_domain%end' : Ly/2.,
61+
'z_domain%beg' : 0.,
62+
'z_domain%end' : Lz,
63+
'm' : Nx,
64+
'n' : Ny,
65+
'p' : Nz,
66+
'dt' : dt,
67+
't_step_start' : t_step_start,
68+
't_step_stop' : t_step_stop,
69+
't_step_save' : t_save,
70+
# ==========================================================================
71+
72+
# Simulation Algorithm Parameters ==========================================
73+
'num_patches' : 1,
74+
'model_eqns' : 2,
75+
'num_fluids' : 1,
76+
'adv_alphan' : 'T',
77+
'time_stepper' : 3,
78+
'weno_vars' : 2,
79+
'weno_order' : 5,
80+
'weno_eps' : 1.E-16,
81+
'weno_Re_flux' : 'T',
82+
'mapped_weno' : 'T',
83+
'riemann_solver' : 2,
84+
'wave_speeds' : 1,
85+
'avg_state' : 2,
86+
'bc_x%beg' : -1,
87+
'bc_x%end' : -1,
88+
'bc_y%beg' : -5,
89+
'bc_y%end' : -5,
90+
'bc_z%beg' : -1,
91+
'bc_z%end' : -1,
92+
# ==========================================================================
93+
94+
# Formatted Database Files Structure Parameters ============================
95+
'format' : 1,
96+
'precision' : 2,
97+
'cons_vars_wrt' :'T',
98+
'prim_vars_wrt' :'T',
99+
'parallel_io' :'T',
100+
'fd_order' : 1,
101+
'omega_wrt(1)' :'T',
102+
'omega_wrt(2)' :'T',
103+
'omega_wrt(3)' :'T',
104+
'qm_wrt' :'T',
105+
# ==========================================================================
106+
107+
# Patch 1 ==================================================================
108+
'patch_icpp(1)%geometry' : 9,
109+
'patch_icpp(1)%x_centroid' : Lx/2.,
110+
'patch_icpp(1)%y_centroid' : 0.,
111+
'patch_icpp(1)%z_centroid' : Lz/2.,
112+
'patch_icpp(1)%length_x' : Lx,
113+
'patch_icpp(1)%length_y' : Ly,
114+
'patch_icpp(1)%length_z' : Lz,
115+
'patch_icpp(1)%alpha_rho(1)' : 1.,
116+
'patch_icpp(1)%alpha(1)' : 1.,
117+
'patch_icpp(1)%vel(1)' : u0,
118+
'patch_icpp(1)%vel(2)' : 0.,
119+
'patch_icpp(1)%vel(3)' : 0.,
120+
'patch_icpp(1)%pres' : pres0,
121+
# ==========================================================================
122+
123+
# Mixing layer =============================================================
124+
'vel_profile' : 'T',
125+
'instability_wave' : 'T',
126+
# ==========================================================================
127+
128+
# Fluids Physical Parameters ===============================================
129+
# Surrounding liquid
130+
'fluid_pp(1)%gamma' : 1./(gamma-1.),
131+
'fluid_pp(1)%pi_inf' : 0.,
132+
'fluid_pp(1)%Re(1)' : Re0,
133+
# =========================================================================
134+
}))
135+
136+
# ==============================================================================

0 commit comments

Comments
 (0)