Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ There are multiple sets of parameters that must be specified in the python input
6. [Formatted Database and Structure Parameters](#6-formatted-output)
7. [(Optional) Acoustic Source Parameters](#7-acoustic-source)
8. [(Optional) Ensemble-Averaged Bubble Model Parameters](#8-ensemble-averaged-bubble-model)
9. [(Optional) Velocity Field Setup Parameters](#9-velocity-field-setup)

Items 7 and 8 are optional sets of parameters that activate the acoustic source model and ensemble-averaged bubble model, respectively.
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.
Definition of the parameters is described in the following subsections.

### 1. Runtime
Expand Down Expand Up @@ -295,10 +296,10 @@ Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD),
| `format` | Integer | Output format. [1]: Silo-HDF5; [2] Binary |
| `precision` | Integer | [1] Single; [2] Double |
| `parallel_io` | Logical | Parallel I/O |
| `cons_vars_wrt` | Logical | Write conservative variables \|
| `cons_vars_wrt` | Logical | Write conservative variables |
| `prim_vars_wrt` | Logical | Write primitive variables |
| `fourier_decomp` | Logical | Apply a spatial Fourier decomposition to the output variables |
| `alpha_rho_wrt(i)` | Logical | Add the partial density of the fluid $i$ to the database \|
| `alpha_rho_wrt(i)` | Logical | Add the partial density of the fluid $i$ to the database |
| `rho_wrt` | Logical | Add the mixture density to the database |
| `mom_wrt(i)` | Logical | Add the $i$-direction momentum to the database |
| `vel_wrt(i)` | Logical | Add the $i$-direction velocity to the database |
Expand All @@ -307,11 +308,12 @@ Note that `time_stepper` $=$ 3 specifies the total variation diminishing (TVD),
| `alpha_wrt(i)` | Logical | Add the volume fraction of fluid $i$ to the database |
| `gamma_wrt` | Logical | Add the specific heat ratio function to the database |
| `heat_ratio_wrt` | Logical | Add the specific heat ratio to the database |
| `pi_inf_wrt` | Logical | Add the liquid stiffness function to the database \|
| `pi_inf_wrt` | Logical | Add the liquid stiffness function to the database |
| `pres_inf_wrt` | Logical | Add the liquid stiffness to the formatted database |
| `c_wrt` | Logical | Add the sound speed to the database |
| `omega_wrt(i)` | Logical | Add the $i$-direction vorticity to the database |
| `schlieren_wrt` | Logical | Add the numerical schlieren to the database|
| `qm_wrt` | Logical | Add the Q-criterion to the database|
| `fd_order` | Integer | Order of finite differences for computing the vorticity and the numerical Schlieren function [1,2,4] |
| `schlieren_alpha(i)` | Real | Intensity of the numerical Schlieren computed via `alpha(i)` |
| `probe_wrt` | Logical | Write the flow chosen probes data files for each time step |
Expand Down Expand Up @@ -433,6 +435,29 @@ When `polytropic` is set `False`, the gas compression is modeled as non-polytrop
`gamma_v`, `M_v`, `mu_v`, and `k_v` specify the specific heat ratio, molecular weight, viscosity, and thermal conductivity of a chosen component.
Implementation of the parameterse into the model follow [Ando (2010)](references.md#Ando10).

### 9. Velocity Field Setup

| Parameter | Type | Description |
| ---: | :----: | :--- |
| `perturb_flow` | Logical | Perturb the initlal velocity field by random noise |
| `perturb_sph` | Logical | Perturb the initial partial density by random noise |
| `perturb_sph_fluid` | Integer | Fluid component whose partial density to be perturbed |
| `vel_profile` | Logical | Set the mean streamwise velocity to hyperbolic tangent profile |
| `instability_wave` | Logical | Perturb the initial velocity field by instability waves |

The table lists velocity field parameters. The parameters are optionally used to define initial velocity profiles and perturbations.

- `perturb_flow` activates the perturbation of initial velocity by random noise.

- `perturb_sph` activates the perturbation of intial partial density by random noise.

- `perturb_sph_fluid` specifies the fluid component whose the partial density to be perturbed.

- `vel_profile` activates setting the mean streamwise velocity to hyperbolic tangent profile. This option works only for 2D and 3D cases.

- `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.


## Enumerations

### Boundary conditions
Expand Down
136 changes: 136 additions & 0 deletions examples/3D_turb_mixing/case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#!/usr/bin/env python3

import math
import json

# SURROUNDING FLOW =============================================================
# Nondimensional parameters
Re0 = 50. # Reynolds number
M0 = 0.2 # Mach number

# Fluid properties
gamma = 1.4
pi_inf = 0.

# Free stream velocity & pressure
u0 = 1.
pres0 = 1./(gamma*M0**2)

# Domain size
Lx = 59.0
Ly = 59.0
Lz = 59.0

# Number of grid cells
Nx = 255
Ny = 255
Nz = 255

# Grid spacing
dx = Lx/float(Nx)
dy = Ly/float(Ny)
dz = Lz/float(Nz)

# Time advancement
cfl = 0.1
T = 100.
dt = cfl*dx/u0
Ntfinal = int(T/dt)
Ntstart = 0
Nfiles = 100
t_save = int(math.ceil((Ntfinal-0)/float(Nfiles)))
Nt = t_save*Nfiles
t_step_start = Ntstart
t_step_stop = int(Nt)

# ==============================================================================


# Configuring case dictionary
print(json.dumps({
# Logistics ================================================================
# 'case_dir' : '\'.\'',
'run_time_info' : 'T',
# ==========================================================================

# Computational Domain Parameters ==========================================
'x_domain%beg' : 0.,
'x_domain%end' : Lx,
'y_domain%beg' : -Ly/2.,
'y_domain%end' : Ly/2.,
'z_domain%beg' : 0.,
'z_domain%end' : Lz,
'm' : Nx,
'n' : Ny,
'p' : Nz,
'dt' : dt,
't_step_start' : t_step_start,
't_step_stop' : t_step_stop,
't_step_save' : t_save,
# ==========================================================================

# Simulation Algorithm Parameters ==========================================
'num_patches' : 1,
'model_eqns' : 2,
'num_fluids' : 1,
'adv_alphan' : 'T',
'time_stepper' : 3,
'weno_vars' : 2,
'weno_order' : 5,
'weno_eps' : 1.E-16,
'weno_Re_flux' : 'T',
'mapped_weno' : 'T',
'riemann_solver' : 2,
'wave_speeds' : 1,
'avg_state' : 2,
'bc_x%beg' : -1,
'bc_x%end' : -1,
'bc_y%beg' : -5,
'bc_y%end' : -5,
'bc_z%beg' : -1,
'bc_z%end' : -1,
# ==========================================================================

# Formatted Database Files Structure Parameters ============================
'format' : 1,
'precision' : 2,
'cons_vars_wrt' :'T',
'prim_vars_wrt' :'T',
'parallel_io' :'T',
'fd_order' : 1,
'omega_wrt(1)' :'T',
'omega_wrt(2)' :'T',
'omega_wrt(3)' :'T',
'qm_wrt' :'T',
# ==========================================================================

# Patch 1 ==================================================================
'patch_icpp(1)%geometry' : 9,
'patch_icpp(1)%x_centroid' : Lx/2.,
'patch_icpp(1)%y_centroid' : 0.,
'patch_icpp(1)%z_centroid' : Lz/2.,
'patch_icpp(1)%length_x' : Lx,
'patch_icpp(1)%length_y' : Ly,
'patch_icpp(1)%length_z' : Lz,
'patch_icpp(1)%alpha_rho(1)' : 1.,
'patch_icpp(1)%alpha(1)' : 1.,
'patch_icpp(1)%vel(1)' : u0,
'patch_icpp(1)%vel(2)' : 0.,
'patch_icpp(1)%vel(3)' : 0.,
'patch_icpp(1)%pres' : pres0,
# ==========================================================================

# Mixing layer =============================================================
'vel_profile' : 'T',
'instability_wave' : 'T',
# ==========================================================================

# Fluids Physical Parameters ===============================================
# Surrounding liquid
'fluid_pp(1)%gamma' : 1./(gamma-1.),
'fluid_pp(1)%pi_inf' : 0.,
'fluid_pp(1)%Re(1)' : Re0,
# =========================================================================
}))

# ==============================================================================
Loading