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

updates NSE initiialization

parent 9f97a990
No related branches found
No related tags found
1 merge request!138Bugfix/nse initial condition
Pipeline #253919 passed
...@@ -56,31 +56,43 @@ int NSE<rnumber>::initialize(void) ...@@ -56,31 +56,43 @@ int NSE<rnumber>::initialize(void)
/* initialize field */ /* initialize field */
this->velocity->real_space_representation = false; this->velocity->real_space_representation = false;
if ((this->iteration == 0) if (this->iteration == 0) {
&& (this->field_random_seed != 0)) { if (!hdf5_tools::field_exists(
TIMEZONE("NSE::initialize::generate_initial_condition"); this->get_current_fname(),
// generate initial condition "velocity",
make_gaussian_random_field( "complex",
this->kk, 0)) {
this->velocity, TIMEZONE("NSE::initialize::generate_initial_condition");
this->field_random_seed, // generate initial condition
this->injection_rate, make_gaussian_random_field(
1.0, // Lint this->kk,
1.5 / this->kk->kM, // etaK this->velocity,
6.78, this->field_random_seed,
0.40, this->injection_rate,
3./2.); 1.0, // Lint
this->kk->template low_pass<rnumber, THREE>( 1.5 / this->kk->kM, // etaK
this->velocity->get_cdata(), 6.78,
this->kk->kM); 0.40,
this->kk->template project_divfree<rnumber>( 3./2.);
this->velocity->get_cdata()); this->kk->template low_pass<rnumber, THREE>(
this->velocity->symmetrize(); this->velocity->get_cdata(),
this->velocity->io( this->kk->kM);
this->get_current_fname(), this->kk->template project_divfree<rnumber>(
"velocity", this->velocity->get_cdata());
this->iteration, this->velocity->symmetrize();
false); this->velocity->io(
this->get_current_fname(),
"velocity",
this->iteration,
false);
} else {
TIMEZONE("NSE::initialize::read_initial_condition");
this->velocity->io(
this->get_current_fname(),
"velocity",
this->iteration,
true);
}
} else { } else {
TIMEZONE("NSE::initialize::read_initial_condition"); TIMEZONE("NSE::initialize::read_initial_condition");
this->velocity->io( this->velocity->io(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment