channel_with_leaflet.cc File Reference

Classes

class  Leaflet
 
class  ChannelWithLeafletProblem< ELEMENT >
 Problem class. More...
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

//////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Driver code – pass a command line argument if you want to run the code in validation mode where it only performs a few steps

Initialise timestep

Set max. number of adaptations (reduced for validation)

Output steady solution

Reduce the max number of adaptations for time-dependent simulation

387 {
388 
389  // Store command line arguments
390  CommandLineArgs::setup(argc,argv);
391 
392  // Set up doc info
393  DocInfo doc_info;
394  doc_info.set_directory("RESLT");
395  doc_info.number()=0;
396 
397  // Parameters for the leaflet
398  //----------------------------
399 
400  // Height
401  double h_leaflet = 0.5;
402 
403 
404  // Tip deflection
405  double d_x = 0.25;
406  double d_y = -0.05;
407 
408  // x-positon of root
409  double x_0 = 3.0;
410 
411  // Period of the oscillation on the natural timescale of the flow
412  double period = 20.0;
413 
414 
415  //Parameters for the domain
416  //-------------------------
417 
418  // Length of the mesh to right and left of the leaflet
419  double l_left =2.0;
420  double l_right= 3.0;
421 
422  // Total height of domain (unity because lengths have been scaled on it)
423  double h_tot=1.0;
424 
425  // Initial number of element rows/columns in various mesh regions
426  unsigned nleft=8;
427  unsigned nright=12;
428  unsigned ny1=2;
429  unsigned ny2=2;
430 
431  //Build the problem
433  problem(l_left, l_right, h_leaflet,
434  h_tot,nleft, nright,ny1,ny2,
435  d_x, d_y, x_0,
436  period);
437 
438 
439  // Number of timesteps per period
440  unsigned nsteps_per_period=40;
441 
442  // Number of periods
443  unsigned nperiod=3;
444 
445  // Number of timesteps (reduced for validation)
446  unsigned nstep=nsteps_per_period*nperiod;
447  if (CommandLineArgs::Argc>1)
448  {
449  nstep=3;
450  }
451 
452  //Timestep:
453  double dt=period/double(nsteps_per_period);
454 
456  problem.initialise_dt(dt);
457 
458 
460  unsigned max_adapt=5;
461  if (CommandLineArgs::Argc>1)
462  {
463  max_adapt=2;
464  }
465 
466  // Do steady solve first -- this also sets the history values
467  // to those corresponding to an impulsive start from the
468  // steady solution
469  problem.steady_newton_solve(max_adapt);
470 
472  problem.doc_solution(doc_info);
473  doc_info.number()++;
474 
475 
477  max_adapt=1;
478 
479  // We don't want to re-assign the initial condition
480  bool first=false;
481 
482 // Timestepping loop
483  for (unsigned istep=0;istep<nstep;istep++)
484  {
485  // Solve the problem
486  problem.unsteady_newton_solve(dt,max_adapt,first);
487 
488  // Output the solution
489  problem.doc_solution(doc_info);
490 
491  // Step number
492  doc_info.number()++;
493 
494  }
495 
496 
497 }//end of main
Problem class.
Definition: channel_with_leaflet.cc:148
Definition: oomph_utilities.h:499
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
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::CommandLineArgs::Argc, oomph::DocInfo::number(), problem, oomph::DocInfo::set_directory(), and Flag_definition::setup().