AMR-Wind
v0.1.0
CFD solver for wind plant simulations
|
Time manager for simulations. More...
#include <SimTime.H>
Public Member Functions | |
SimTime ()=default | |
~SimTime ()=default | |
bool | new_timestep () |
Advance to a new time state and update internal time states. More... | |
bool | continue_simulation () const |
Return true if simulation should continue. More... | |
bool | do_regrid () const |
Return true if mesh refinement should be performed at this timestep. More... | |
bool | write_plot_file () const |
Return true if plot files should be written at this timestep. More... | |
bool | write_checkpoint () const |
Return true if checkpoint files should be written at this timestep. More... | |
bool | write_last_plot_file () const |
Return true if plot files should be written at this timestep. More... | |
bool | write_last_checkpoint () const |
Return true if checkpoint files should be written at this timestep. More... | |
void | set_current_cfl (const amrex::Real conv_cfl, const amrex::Real diff_cfl, const amrex::Real src_cfl) |
Set current CFL and update timestep based on CFL components. More... | |
void | set_restart_time (int tidx, amrex::Real time) |
Set start time and index based on checkpoint/restart file. More... | |
AMREX_FORCE_INLINE amrex::Real | deltaT () const |
AMREX_FORCE_INLINE amrex::Real & | deltaT () |
AMREX_FORCE_INLINE amrex::Real | deltaTNm1 () const |
AMREX_FORCE_INLINE amrex::Real | deltaTNm2 () const |
AMREX_FORCE_INLINE amrex::Real & | deltaTNm1 () |
AMREX_FORCE_INLINE amrex::Real & | deltaTNm2 () |
AMREX_FORCE_INLINE amrex::Real | current_time () const |
AMREX_FORCE_INLINE amrex::Real & | current_time () |
AMREX_FORCE_INLINE amrex::Real | new_time () const |
AMREX_FORCE_INLINE amrex::Real | max_cfl () const |
AMREX_FORCE_INLINE int | time_index () const |
AMREX_FORCE_INLINE int & | time_index () |
AMREX_FORCE_INLINE bool | adaptive_timestep () const |
AMREX_FORCE_INLINE bool | use_force_cfl () const |
AMREX_FORCE_INLINE int | regrid_interval () const |
AMREX_FORCE_INLINE amrex::Real | start_time () const |
AMREX_FORCE_INLINE amrex::Real | stop_time () const |
AMREX_FORCE_INLINE int | start_time_index () const |
AMREX_FORCE_INLINE int | stop_time_index () const |
AMREX_FORCE_INLINE int | chkpt_interval () const |
void | parse_parameters () |
Read user defined options from input file. More... | |
Static Public Attributes | |
static constexpr int | max_time_states = 3 |
Private Attributes | |
amrex::Vector< amrex::Real > | m_dt |
Timestep sizes. More... | |
amrex::Real | m_cur_time {0.0} |
Current simulation time. More... | |
amrex::Real | m_new_time {0.0} |
Time where a new timestep will advance to. More... | |
amrex::Real | m_start_time {0.0} |
Starting simulation time (to track restart) More... | |
amrex::Real | m_stop_time {-1.0} |
Max time for simulation. More... | |
amrex::Real | m_max_cfl {0.5} |
Maximum CFL constraint. More... | |
amrex::Real | m_fixed_dt {-1.0} |
Fixed deltaT indicated by user. More... | |
amrex::Real | m_initial_dt {-1.0} |
Initial deltaT indicated by user. More... | |
amrex::Real | m_current_cfl {0.0} |
Current CFL. More... | |
amrex::Real | m_init_shrink {0.1} |
Initial reduction in timestep size for startup. More... | |
amrex::Real | m_dt_growth {0.1} |
Maximum growth of dt between timesteps. More... | |
amrex::Real | m_chkpt_t_interval {-1.0} |
Time interval for writing checkpoint/restart files. More... | |
amrex::Real | m_chkpt_t_delay {0.0} |
Time delay for checkpoint/restart output. More... | |
amrex::Real | m_chkpt_t_tol {1e-8} |
Relative (to dt) tolerance for checkpoint time interval output. More... | |
amrex::Real | m_force_chkpt_tol {1e-3} |
Relative (to chkpt_t_interval) tolerance for enforcing dt. More... | |
amrex::Real | m_plt_t_interval {-1.0} |
Time interval for plot file output. More... | |
amrex::Real | m_plt_t_delay {0.0} |
Time delay for plot file output. More... | |
amrex::Real | m_plt_t_tol {1e-8} |
Relative (to dt) tolerance for plot time interval output. More... | |
amrex::Real | m_force_plt_tol {1e-3} |
Relative (to plt_t_interval) tolerance for enforcing dt. More... | |
int | m_time_index {0} |
Counter for the number of timesteps since start of simulation. More... | |
int | m_start_time_index {0} |
Initial starting time index. More... | |
int | m_chkpt_start_index {0} |
Initial starting time index for generating checkpoint files. More... | |
int | m_plt_start_index {0} |
Initial starting time index for generating output files. More... | |
int | m_regrid_start_index {0} |
Initial starting time index for regriding. More... | |
int | m_stop_time_index {-1} |
Maximum timesteps for simulation. More... | |
int | m_chkpt_interval {-1} |
Time step interval for writing checkpoint/restart files. More... | |
int | m_chkpt_delay {0} |
Time step delay for checkpoint/restart output (this means that output only happens after the delay) More... | |
int | m_plt_interval {-1} |
Time step interval for plot file output. More... | |
int | m_plt_delay {0} |
Time step delay for plot file output. More... | |
int | m_regrid_interval {-1} |
Time interval for regridding. More... | |
int | m_verbose {0} |
Verbosity. More... | |
bool | m_adaptive {false} |
Flag indicating whether timestep is adaptive. More... | |
bool | m_is_init {true} |
Flag indicating if this is initialization. More... | |
bool | m_use_force_cfl {true} |
Flag indicating if forcing should be included in CFL calculation. More... | |
bool | m_force_chkpt_dt {false} |
Bool for if checkpoint time interval should be forced. More... | |
bool | m_force_plt_dt {false} |
Bool for if plt time interval should be forced. More... | |
Time manager for simulations.
|
default |
|
default |
|
inline |
|
inline |
bool amr_wind::SimTime::continue_simulation | ( | ) | const |
Return true if simulation should continue.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool amr_wind::SimTime::do_regrid | ( | ) | const |
Return true if mesh refinement should be performed at this timestep.
|
inline |
|
inline |
bool amr_wind::SimTime::new_timestep | ( | ) |
Advance to a new time state and update internal time states.
Return a boolean flag indicating if the simulation should continue.
void amr_wind::SimTime::parse_parameters | ( | ) |
Read user defined options from input file.
|
inline |
void amr_wind::SimTime::set_current_cfl | ( | const amrex::Real | conv_cfl, |
const amrex::Real | diff_cfl, | ||
const amrex::Real | src_cfl | ||
) |
Set current CFL and update timestep based on CFL components.
void amr_wind::SimTime::set_restart_time | ( | int | tidx, |
amrex::Real | time | ||
) |
Set start time and index based on checkpoint/restart file.
tidx | Time index from checkpoint file |
time | Time read from checkpoint file |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool amr_wind::SimTime::write_checkpoint | ( | ) | const |
Return true if checkpoint files should be written at this timestep.
bool amr_wind::SimTime::write_last_checkpoint | ( | ) | const |
Return true if checkpoint files should be written at this timestep.
bool amr_wind::SimTime::write_last_plot_file | ( | ) | const |
Return true if plot files should be written at this timestep.
bool amr_wind::SimTime::write_plot_file | ( | ) | const |
Return true if plot files should be written at this timestep.
|
private |
Flag indicating whether timestep is adaptive.
|
private |
Time step delay for checkpoint/restart output (this means that output only happens after the delay)
|
private |
Time step interval for writing checkpoint/restart files.
|
private |
Initial starting time index for generating checkpoint files.
|
private |
Time delay for checkpoint/restart output.
|
private |
Time interval for writing checkpoint/restart files.
|
private |
Relative (to dt) tolerance for checkpoint time interval output.
|
private |
Current simulation time.
|
private |
Current CFL.
|
private |
Timestep sizes.
|
private |
Maximum growth of dt between timesteps.
|
private |
Fixed deltaT indicated by user.
|
private |
Bool for if checkpoint time interval should be forced.
|
private |
Relative (to chkpt_t_interval) tolerance for enforcing dt.
|
private |
Bool for if plt time interval should be forced.
|
private |
Relative (to plt_t_interval) tolerance for enforcing dt.
|
private |
Initial reduction in timestep size for startup.
|
private |
Initial deltaT indicated by user.
|
private |
Flag indicating if this is initialization.
|
private |
Maximum CFL constraint.
|
private |
Time where a new timestep will advance to.
|
private |
Time step delay for plot file output.
|
private |
Time step interval for plot file output.
|
private |
Initial starting time index for generating output files.
|
private |
Time delay for plot file output.
|
private |
Time interval for plot file output.
|
private |
Relative (to dt) tolerance for plot time interval output.
|
private |
Time interval for regridding.
|
private |
Initial starting time index for regriding.
|
private |
Starting simulation time (to track restart)
|
private |
Initial starting time index.
|
private |
Max time for simulation.
|
private |
Maximum timesteps for simulation.
|
private |
Counter for the number of timesteps since start of simulation.
|
private |
Flag indicating if forcing should be included in CFL calculation.
|
private |
Verbosity.
|
staticconstexpr |