|
| NSE (const MPI_Comm COMMUNICATOR, const std::string &simulation_name) |
|
| ~NSE () |
|
int | initialize (void) |
| Initialize DNS.
|
|
int | step (void) |
|
int | finalize (void) |
|
int | Euler_step (void) |
|
int | Heun_step (void) |
|
int | ShuOsher (void) |
| Time step with Shu Osher method.
|
|
int | add_field_band (field< rnumber, FFTW, THREE > *dst, field< rnumber, FFTW, THREE > *src, const double k0, const double k1, const double prefactor) |
|
virtual int | add_nonlinear_term (const field< rnumber, FFTW, THREE > *vel, field< rnumber, FFTW, THREE > *dst) |
|
int | add_forcing_term (field< rnumber, FFTW, THREE > *vel, field< rnumber, FFTW, THREE > *dst) |
|
int | impose_forcing (field< rnumber, FFTW, THREE > *vel) |
|
virtual int | read_parameters (void) |
|
int | write_checkpoint (void) |
|
int | do_stats (void) |
| Compute standard statistics for velocity and vorticity fields.
|
|
| direct_numerical_simulation (const MPI_Comm COMMUNICATOR, const std::string &simulation_name) |
|
virtual | ~direct_numerical_simulation () noexcept(false) |
|
int | main_loop (void) |
|
int | read_iteration (void) |
|
int | write_iteration (void) |
|
int | grow_file_datasets (void) |
|
int | update_checkpoint (void) |
| Basic computation of current checkpoint.
|
|
const std::string | get_current_fname () |
|
| code_base (const MPI_Comm COMMUNICATOR, const std::string &simulation_name) |
|
virtual | ~code_base () noexcept(false) |
|
int | check_stopping_condition (void) |
|
int | start_simple_timer (void) |
|
int | print_simple_timer (const std::string operation_name) |
|
MPI_Comm | get_communicator () const |
|
int | get_nx () const |
|
int | get_ny () const |
|
int | get_nz () const |
|
template<typename rnumber>
class NSE< rnumber >
Navier-Stokes solver.
Solves the Navier Stokes equation.
Allocates fields and a kspace object.
template<typename rnumber >
int NSE< rnumber >::do_stats |
( |
void | | ) |
|
|
virtual |
Compute standard statistics for velocity and vorticity fields.
IMPORTANT: at the end of this subroutine, this->fs->cvelocity
contains the Fourier space representation of the velocity field, and this->tmp_vec_field
contains the real space representation of the velocity field. This behavior is relied upon in the NSEparticles
class, so please don't break it.
Implements direct_numerical_simulation.
template<typename rnumber >
int NSE< rnumber >::ShuOsher |
( |
void | | ) |
|
Time step with Shu Osher method.
The Navier Stokes equations are integrated with a third-order Runge-Kutta method [shu1988jcp]_, which is an explicit Runge-Kutta method with the Butcher tableau
| | | |
0 | | | |
1 | 1 | | |
1/2 | 1/4 | 1/4 | |
| 1/6 | 1/6 | 2/3 |
In addition to the stability properties described in [shu1988jcp]_, this method has the advantage that it is memory-efficient, requiring only two additional field allocations, as can be seen from
\begin{eqnarray*}
\hat{\boldsymbol w}_1(\boldsymbol k) &= {\hat{\boldsymbol u}}(\boldsymbol k, t)e^{-\nu k^2 h} + h \textrm{NL}[\hat{\boldsymbol u}(\boldsymbol k, t)]e^{-\nu k^2 h}, \\
\hat{\boldsymbol w}_2(\boldsymbol k) &= \frac{3}{4}\hat{\boldsymbol u}( \boldsymbol k, t)e^{-\nu k^2 h/2}
+
\frac{1}{4}(\hat{\boldsymbol w}_1(\boldsymbol k) + h \textrm{NL}[\hat{\boldsymbol w}_1(\boldsymbol k)])e^{\nu k^2 h/2}, \\
\hat{\boldsymbol u}(\boldsymbol k, t+h) &= \frac{1}{3}\hat{\boldsymbol u}(\boldsymbol k, t)e^{-\nu k^2 h} +
\frac{2}{3}(\hat{\boldsymbol w}_2(\boldsymbol k) + h \textrm{NL}[\hat{\boldsymbol w}_2(\boldsymbol k)])e^{-\nu k^2 h/2},
\end{eqnarray*}