////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// Driver for two-layer rotating cylinder problem, where we directly simulate the instability by kicking off the base and perturbed state problems together and watching to see whether the perturbation grows or decays.
1368 const double dt = 0.05;
1371 const unsigned base_n_r = 10;
1372 const unsigned perturbed_n_r = 10;
1375 const unsigned base_n_z1 = 10;
1376 const unsigned perturbed_n_z1 = 10;
1379 const unsigned base_n_z2 = 10;
1380 const unsigned perturbed_n_z2 = 10;
1383 const double h1 = 1.0;
1386 const double h2 = 1.0;
1398 for(
int i=0;
i<3;
i++)
1411 base_problem(base_n_r,base_n_z1,base_n_z2,h1,h2);
1414 const unsigned n_perturbed_problems =
1422 BDF<2> >* > perturbed_problem_pt(n_perturbed_problems);
1425 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1427 perturbed_problem_pt[
i] =
new
1431 BDF<2> > (perturbed_n_r,perturbed_n_z1,perturbed_n_z2,h1,h2,
1432 base_problem.bulk_mesh_pt(),
1438 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1440 perturbed_problem_pt[
i]->create_interface_elements();
1444 base_problem.rebuild_global_mesh();
1445 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1447 perturbed_problem_pt[
i]->rebuild_global_mesh();
1451 base_problem.assign_eqn_numbers();
1452 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1454 perturbed_problem_pt[
i]->assign_eqn_numbers();
1458 std::sort(base_problem.mesh_pt()->element_pt().begin(),
1459 base_problem.mesh_pt()->element_pt().end(),
1463 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1465 std::sort(perturbed_problem_pt[
i]->mesh_pt()->element_pt().begin(),
1466 perturbed_problem_pt[
i]->mesh_pt()->element_pt().
end(),
1471 cout <<
"Number of elements:" << endl;
1472 cout <<
" - base, bulk = "
1473 << base_problem.bulk_mesh_pt()->nelement() << endl;
1474 cout <<
" - base, surface = "
1475 << base_problem.surface_mesh_pt()->nelement() << endl;
1476 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1478 cout <<
" - perturbed (" <<
i+1 <<
" of "
1479 << n_perturbed_problems <<
"), bulk = "
1480 << perturbed_problem_pt[
i]->bulk_mesh_pt()->nelement() << endl;
1481 cout <<
" - perturbed (" <<
i+1 <<
" of "
1482 << n_perturbed_problems <<
"), surface = "
1483 << perturbed_problem_pt[
i]->surface_mesh_pt()->nelement() << endl;
1496 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1498 perturbed_problem_pt[
i]->create_trace_file(doc_info_pt);
1502 base_problem.initialise_dt(dt);
1503 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1505 perturbed_problem_pt[
i]->initialise_dt(dt);
1509 base_problem.set_initial_condition();
1510 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1512 perturbed_problem_pt[
i]->set_initial_condition();
1517 char info_filename[100];
1518 sprintf(info_filename,
"%s/info.dat",doc_info_pt->
directory().c_str());
1519 info_file.open(info_filename);
1523 base_problem.doc_solution(doc_info_pt);
1526 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1528 perturbed_problem_pt[
i]->doc_solution(doc_info_pt,
true);
1535 const unsigned n_timestep =
unsigned(t_max/dt);
1538 for(
unsigned t=0;
t<n_timestep;
t++)
1541 cout <<
" Timestep " <<
t <<
" of " << n_timestep
1542 <<
"; Time is " << perturbed_problem_pt[0]->time_pt()->time()
1546 oomph_info <<
"================================"
1547 <<
"==============================\n"
1548 <<
" Timestep " <<
t <<
" of " << n_timestep
1549 <<
"; Time is " << perturbed_problem_pt[0]->time_pt()->time()
1550 <<
"\n=============================="
1551 <<
"================================"
1555 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1557 oomph_info <<
"\nPerturbed problem (" <<
i+1 <<
" of "
1558 << n_perturbed_problems
1559 <<
"):\n-----------------------------\n" << endl;
1560 perturbed_problem_pt[
i]->unsteady_newton_solve(dt);
1564 base_problem.doc_solution(doc_info_pt);
1565 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1567 perturbed_problem_pt[
i]->doc_solution(doc_info_pt,
true);
1576 for(
unsigned i=0;
i<n_perturbed_problems;
i++)
1578 perturbed_problem_pt[
i]->close_trace_file();
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Base state problem class for Tuckerman counter-rotating lids problem.
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:93
Function-type-object to perform comparison of elements.
Definition: elastic_bretherton.cc:317
Definition: demo_drivers/axisym_navier_stokes/counter_rotating_disks/multi_domain_linearised_axisym_navier_stokes_elements.h:186
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:371
Definition: axisym_navier_stokes_elements.h:1234
Definition: oomph_utilities.h:499
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Definition: perturbed_spines.h:395
Definition: oomph-lib/src/generic/Vector.h:58
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
Vector< int > Vector_of_azimuthal_mode_numbers
Vector of azimuthal mode numbers to investigate.
Definition: two_layer_interface_nonaxisym_perturbations.cc:98
double St
Strouhal number.
Definition: linearised_axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:62
double Re
Reynolds number.
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:61
Vector< double > G(3)
Direction of gravity.
double ReSt
Product of Reynolds and Strouhal numbers.
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:64
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
t
Definition: plotPSD.py:36