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
4 changes: 3 additions & 1 deletion docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
| `mixture_err` | Logical | Mixture properties correction |
| `time_stepper` | Integer | Runge--Kutta order [1-3] |
| `adap_dt` | Logical | Strang splitting scheme with adaptive time stepping |
| `adap_dt_tol` | Real | Tolerance for adaptive time stepping in Strang splitting scheme|
| `adap_dt_max_iters` | Integer | Max iteration for adaptive time stepping in Strang splitting scheme |
| `weno_order` | Integer | WENO order [1,3,5] |
| `weno_eps` | Real | WENO perturbation (avoid division by zero) |
| `mapped_weno` | Logical | WENO-M (WENO with mapping of nonlinear weights) |
Expand Down Expand Up @@ -453,7 +455,7 @@ The effect and use of the source term are assessed by [Schmidmayer et al., 2019]
- `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.
Note that `time_stepper = 3` specifies the total variation diminishing (TVD), third order RK scheme ([Gottlieb and Shu, 1998](references.md)).

- `adap_dt` activates the Strang operator splitting scheme which splits flux and source terms in time marching, and an adaptive time stepping strategy is implemented for the source term. It requires ``bubbles_euler = 'T'``, ``polytropic = 'T'``, ``adv_n = 'T'`` and `time_stepper = 3`. Additionally, it can be used with ``bubbles_lagrange = 'T'`` and `time_stepper = 3`
- `adap_dt` activates the Strang operator splitting scheme which splits flux and source terms in time marching, and an adaptive time stepping strategy is implemented for the source term. It requires ``bubbles_euler = 'T'``, ``polytropic = 'T'``, ``adv_n = 'T'`` and `time_stepper = 3`. Additionally, it can be used with ``bubbles_lagrange = 'T'`` and `time_stepper = 3`. `adap_dt_tol` and `adap_dt_max_iters` are 1e-4 and 100, respectively, by default.

- `weno_order` specifies the order of WENO scheme that is used for spatial reconstruction of variables by an integer of 1, 3, 5, and 7, that correspond to the 1st, 3rd, 5th, and 7th order, respectively.

Expand Down
1 change: 1 addition & 0 deletions examples/0D_bubblecollapse_adap/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"adv_n": "T",
# adap_dt
"adap_dt": "T",
"adap_dt_max_iters": 200,
# Gas compression model
"polytropic": "T",
"thermal": 1,
Expand Down
3 changes: 2 additions & 1 deletion src/common/m_constants.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ module m_constants

! Strang Splitting constants
real(wp), parameter :: dflt_adap_dt_tol = 1.e-4_wp !< Default tolerance for adaptive step size
integer, parameter :: adap_dt_max_iters = 100 !< Maximum number of iterations
integer, parameter :: dflt_adap_dt_max_iters = 100 !< Default max iteration for adaptive step size

! Constants of the algorithm described by Heirer, E. Hairer S.P.Nørsett G. Wanner, Solving Ordinary Differential Equations I, Chapter II.4
! to choose the initial time step size for the adaptive time stepping routine
real(wp), parameter :: threshold_first_guess = 1.e-5_wp
Expand Down
6 changes: 4 additions & 2 deletions src/simulation/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ module m_global_parameters
logical :: adv_n !< Solve the number density equation and compute alpha from number density
logical :: adap_dt !< Adaptive step size control
real(wp) :: adap_dt_tol !< Tolerance to control adaptive step size
$:GPU_DECLARE(create='[adv_n,adap_dt,adap_dt_tol]')
integer :: adap_dt_max_iters !< Maximum number of iterations
$:GPU_DECLARE(create='[adv_n,adap_dt,adap_dt_tol,adap_dt_max_iters]')

integer :: bubble_model !< Gilmore or Keller--Miksis bubble model
integer :: thermal !< Thermal behavior. 1 = adiabatic, 2 = isotherm, 3 = transfer
Expand Down Expand Up @@ -672,6 +673,7 @@ contains
adv_n = .false.
adap_dt = .false.
adap_dt_tol = dflt_real
adap_dt_max_iters = dflt_adap_dt_max_iters

pi_fac = 1._wp

Expand Down Expand Up @@ -1243,7 +1245,7 @@ contains
$:GPU_UPDATE(device='[momxb,momxe,advxb,advxe,contxb,contxe, &
& bubxb,bubxe,intxb,intxe,sys_size,buff_size,E_idx, &
& alf_idx,n_idx,adv_n,adap_dt,pi_fac,strxb,strxe, &
& chemxb,chemxe,c_idx]')
& chemxb,chemxe,c_idx,adap_dt_tol,adap_dt_max_iters]')
$:GPU_UPDATE(device='[b_size,xibeg,xiend,tensor_size]')

$:GPU_UPDATE(device='[species_idx]')
Expand Down
4 changes: 2 additions & 2 deletions src/simulation/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ contains
& 'wave_speeds', 'avg_state', 'precision', 'bc_x%beg', 'bc_x%end', &
& 'bc_y%beg', 'bc_y%end', 'bc_z%beg', 'bc_z%end', 'fd_order', &
& 'num_probes', 'num_integrals', 'bubble_model', 'thermal', &
& 'num_source', 'relax_model', 'num_ibs', 'n_start', &
& 'num_bc_patches', 'num_igr_iters', 'num_igr_warm_start_iters']
& 'num_source','relax_model','num_ibs','n_start','num_igr_iters', &
& 'num_bc_patches','num_igr_warm_start_iters','adap_dt_max_iters' ]
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
#:endfor

Expand Down
4 changes: 2 additions & 2 deletions src/simulation/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ contains
relax, relax_model, &
palpha_eps, ptgalpha_eps, &
file_per_process, sigma, &
pi_fac, adv_n, adap_dt, adap_dt_tol, &
pi_fac, adv_n, adap_dt, adap_dt_tol, adap_dt_max_iters, &
bf_x, bf_y, bf_z, &
k_x, k_y, k_z, w_x, w_y, w_z, p_x, p_y, p_z, &
g_x, g_y, g_z, n_start, t_save, t_stop, &
Expand Down Expand Up @@ -1415,7 +1415,7 @@ contains
$:GPU_UPDATE(device='[nb,R0ref,Ca,Web,Re_inv,weight,R0, &
& bubbles_euler,polytropic,polydisperse,qbmm, &
& ptil,bubble_model,thermal,poly_sigma,adv_n,adap_dt, &
& adap_dt_tol,n_idx,pi_fac,low_Mach]')
& adap_dt_tol,adap_dt_max_iters,n_idx,pi_fac,low_Mach]')
$:GPU_UPDATE(device='[R_n,R_v,phi_vn,phi_nv,Pe_c,Tw,pv,M_n, &
& M_v,k_n,k_v,pb0,mass_n0,mass_v0,Pe_T,Re_trans_T, &
& Re_trans_c,Im_trans_T,Im_trans_c,omegaN,mul0,ss, &
Expand Down
1 change: 1 addition & 0 deletions toolchain/mfc/run/case_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def analytic(self):
'pi_fac': ParamType.REAL,
'adap_dt': ParamType.LOG,
'adap_dt_tol': ParamType.REAL,
'adap_dt_max_iters': ParamType.INT,
'ib': ParamType.LOG,
'num_ibs': ParamType.INT,
'n_start': ParamType.INT,
Expand Down
Loading