Skip to content
Snippets Groups Projects
Commit 407d3044 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add comment on seeding the random numbers for the kraichnan field

parent a11e94f0
No related branches found
No related tags found
No related merge requests found
Pipeline #64580 passed
......@@ -136,12 +136,19 @@ int kraichnan_field<rnumber>::generate_random_velocity(void)
make_gaussian_random_field(
this->kk,
this->velocity,
this->iteration, // not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration
this->iteration, // not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration. See note below
this->spectrum_slope,
this->spectrum_k_cutoff,
this->spectrum_coefficient * 3./2.); // incompressibility projection factor
// this->velocity is now in Fourier space
// project divfree, requires field in Fourier space
// Note on the choice of random seed:
// If in the future the simulation will continue with a smaller number of total threads (number of processes times number of threads per process),
// then during that run some of the threads will be seeded with a seed that has already been used for a previous iteration.
// So some sequences of Fourier modes will be identical to sequences of Fourier modes that occured in the past.
// Also see implementation of "make_gaussian_random_field".
// One work-around would be to multiply "this->iteration" with 10 or so ---
// it is unlikely the simulation will be continued with less than 0.1 of the initial total number of threads.
DEBUG_MSG("L2Norm before: %g\n",
this->velocity->L2norm(this->kk));
this->kk->template project_divfree<rnumber>(this->velocity->get_cdata());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment