Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ restart data being resumed from. Pass `-t pre_process` explicitly (as in the res

- `cfl_const_dt` enables constant `dt` time-stepping where `dt` results in a specified CFL for the initial condition

- `cfl_target` specifies the target CFL value
- `cfl_target` specifies the target CFL value. It bounds the acoustic number in each direction, and the diffusive numbers \f$D\,\Delta t\sum_d \Delta x_d^{-2}\f$ of viscosity (`VCFL`, \f$D = (4\mu/3 + \mu_b)/\rho\f$) and conduction (`TCFL`, \f$D = k/(\rho c_v)\f$). RK3 remains stable up to about 0.63 (0.5 for RK1 and RK2)

- `ramp_ratio` limits how much the adaptive time step can grow from one time step to the next: `dt` is capped at `ramp_ratio` times the previous `dt`. Must be at least 1. When unset, the time step growth is unlimited.

Expand Down
2 changes: 2 additions & 0 deletions src/common/m_constants.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ module m_constants
integer, parameter :: amr_restart_blk_own_ints = 4
!> color function gradient magnitude at which to apply the surface tension fluxes
real(wp), parameter :: capillary_cutoff = 1.e-6
!> Volume fraction below which a phase counts as absent for the capillary time-step limit
real(wp), parameter :: capillary_alpha_min = 1.e-3_wp
!> Spatial support width of acoustic source, used in s_source_spatial
real(wp), parameter :: acoustic_spatial_support_width = 2.5_wp
real(wp), parameter :: dflt_vcfl_dt = 100._wp !< value of vcfl_dt when viscosity is off for computing adaptive timestep size
Expand Down
70 changes: 25 additions & 45 deletions src/simulation/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,12 @@ contains

write (3, '(A)') ''; write (3, '(A)') ''

write (3, '(13X,A9,13X,A10,13X,A10,13X,A10)', advance="no") trim('Time-step'), trim('dt'), trim('Time'), trim('ICFL Max')

if (surface_tension) then
write (3, '(13X,A10)', advance="no") trim('CCFL Max')
end if

if (heat_conduction) then
write (3, '(13X,A10)', advance="no") trim('TCFL Max')
end if

if (viscous) then
write (3, '(13X,A10,13X,A16)', advance="no") trim('VCFL Max'), trim('Rc Min')
end if

if (bubbles_lagrange) then
write (3, '(13X,A10)', advance="no") trim('N Bubbles')
end if
! Columns two blanks apart; reals to four significant digits (ES10.3), counts exact
write (3, '(A9,3(2X,A10))', advance="no") 'Time-step', 'dt', 'Time', 'ICFL Max'
if (surface_tension) write (3, '(2X,A10)', advance="no") 'CCFL Max'
if (heat_conduction) write (3, '(2X,A10)', advance="no") 'TCFL Max'
if (viscous) write (3, '(2X,A10,2X,A10)', advance="no") 'VCFL Max', 'Rc Min'
if (bubbles_lagrange) write (3, '(2X,A10)', advance="no") 'N Bubbles'

write (3, *) ! new line

Expand Down Expand Up @@ -182,6 +171,7 @@ contains
real(wp) :: qv !< Cell-avg. internal energy reference value
real(wp) :: c !< Cell-avg. sound speed
real(wp), dimension(2) :: Re !< Cell-avg. Reynolds numbers
real(wp) :: Dth !< Cell thermal diffusivity
integer :: j, k, l
real(wp) :: icfl_max_loc, icfl_max_glb !< ICFL stability extrema on local and global grids
real(wp) :: vcfl_max_loc, vcfl_max_glb !< VCFL stability extrema on local and global grids
Expand All @@ -208,10 +198,10 @@ contains
Re_size_loc1 = Re_size(1); Re_size_loc2 = Re_size(2)
pw1 = amr_cfl_pow(1); pw2 = amr_cfl_pow(2); pw3 = amr_cfl_pow(3); amr_on = amr
! Computing Stability Criteria at Current Time-step
$:GPU_PARALLEL_LOOP(collapse=3, private='[j, k, l, vel, alpha, alpha_rho, Re, rho, vel_sum, pres, gamma, pi_inf, c, qv, &
& icfl, vcfl, Rc, ccfl, tcfl, fl, mu_frac, include_cell]', reduction='[[icfl_max_loc, vcfl_max_loc, &
& ccfl_max_loc, tcfl_max_loc, mu_frac_max_loc], [Rc_min_loc]]', reductionOp='[max, min]', &
& firstprivate='[Re_size_loc1, Re_size_loc2, pw1, pw2, pw3, amr_on]')
$:GPU_PARALLEL_LOOP(collapse=3, private='[j, k, l, vel, alpha, alpha_rho, Re, Dth, rho, vel_sum, pres, gamma, pi_inf, c, &
& qv, icfl, vcfl, Rc, ccfl, tcfl, fl, mu_frac, include_cell]', reduction='[[icfl_max_loc, &
& vcfl_max_loc, ccfl_max_loc, tcfl_max_loc, mu_frac_max_loc], [Rc_min_loc]]', reductionOp='[max, &
& min]', firstprivate='[Re_size_loc1, Re_size_loc2, pw1, pw2, pw3, amr_on]')
do l = 0, p
do k = 0, n
do j = 0, m
Expand Down Expand Up @@ -250,7 +240,9 @@ contains
Re(1) = 1._wp/max(Re(1), sgm_eps)
end if

call s_compute_stability_from_dt(vel, c, rho, Re, alpha, alpha_rho, j, k, l, icfl, vcfl, Rc, ccfl, tcfl)
call s_compute_cell_diffusivity(alpha, alpha_rho, Dth)
call s_compute_stability_from_dt(vel, c, rho, Re, alpha, alpha_rho, Dth, j, k, l, icfl, vcfl, Rc, ccfl, &
& tcfl)
if (amr_on) call s_amr_scale_stability(amr_cfl_rf(j, k, l), pw1, pw2, pw3, icfl, vcfl, Rc, ccfl, tcfl)

icfl_max_loc = max(icfl_max_loc, icfl)
Expand Down Expand Up @@ -310,23 +302,11 @@ contains
call s_mpi_barrier() ! ensure diagnostic output above is flushed before any rank aborts below

if (proc_rank == 0) then
write (3, '(13X,I9,13X,ES10.3,13X,ES10.3,13X,F10.6)', advance="no") t_step, dt, mytime, icfl_max_glb

if (surface_tension) then
write (3, '(13X,F10.6)', advance="no") ccfl_max_glb
end if

if (heat_conduction) then
write (3, '(13X,F10.6)', advance="no") tcfl_max_glb
end if

if (viscous) then
write (3, '(13X,F10.6,13X,ES16.6)', advance="no") vcfl_max_glb, Rc_min_glb
end if

if (bubbles_lagrange) then
write (3, '(13X,I10)', advance="no") n_el_bubs_glb
end if
write (3, '(I9,3(2X,ES10.3))', advance="no") t_step, dt, mytime, icfl_max_glb
if (surface_tension) write (3, '(2X,ES10.3)', advance="no") ccfl_max_glb
if (heat_conduction) write (3, '(2X,ES10.3)', advance="no") tcfl_max_glb
if (viscous) write (3, '(2X,ES10.3,2X,ES10.3)', advance="no") vcfl_max_glb, Rc_min_glb
if (bubbles_lagrange) write (3, '(2X,I10)', advance="no") n_el_bubs_glb

write (3, *) ! new line

Expand Down Expand Up @@ -413,7 +393,7 @@ contains
Re(1) = 1._wp/max(Re(1), sgm_eps)
end if

call s_compute_stability_from_dt(vel, c, rho, Re, alpha, alpha_rho, j, k, l, icfl, vcfl, Rc, ccfl, tcfl)
call s_compute_stability_from_dt(vel, c, rho, Re, alpha, alpha_rho, 0._wp, j, k, l, icfl, vcfl, Rc, ccfl, tcfl)
if (amr) call s_amr_scale_stability(amr_cfl_rf(j, k, l), amr_cfl_pow(1), amr_cfl_pow(2), amr_cfl_pow(3), &
& icfl, vcfl, Rc, ccfl, tcfl)

Expand Down Expand Up @@ -1963,11 +1943,11 @@ contains
write (3, '(A)') ' '
write (3, '(A)') ''

write (3, '(A,F9.6)') 'ICFL Max: ', icfl_max
if (surface_tension) write (3, '(A,F9.6)') 'CCFL Max: ', ccfl_max
if (heat_conduction) write (3, '(A,F9.6)') 'TCFL Max: ', tcfl_max
if (viscous) write (3, '(A,F9.6)') 'VCFL Max: ', vcfl_max
if (viscous) write (3, '(A,ES16.6)') 'Rc Min: ', Rc_min
write (3, '(A,ES10.3)') 'ICFL Max: ', icfl_max
if (surface_tension) write (3, '(A,ES10.3)') 'CCFL Max: ', ccfl_max
if (heat_conduction) write (3, '(A,ES10.3)') 'TCFL Max: ', tcfl_max
if (viscous) write (3, '(A,ES10.3)') 'VCFL Max: ', vcfl_max
if (viscous) write (3, '(A,ES10.3)') 'Rc Min: ', Rc_min

call cpu_time(run_time)

Expand Down
Loading
Loading