optimisation/disable_ALE/navier_stokes/rayleigh_channel.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "meshes/rectangular_quadmesh.h"

Classes

class  RayleighProblem< ELEMENT, TIMESTEPPER >
 

Namespaces

 Global_Parameters
 Namespace for global parameters.
 
 ExactSoln
 Namespace for exact solution.
 

Functions

void ExactSoln::get_exact_u (const double &t, const Vector< double > &x, Vector< double > &u)
 Exact solution of the problem as a vector. More...
 
void ExactSoln::get_exact_u (const double &t, const double &y, double &u)
 Exact solution of the problem as a scalar. More...
 
int main (int argc, char *argv[])
 Driver code for Rayleigh channel problem. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code for Rayleigh channel problem.

Convert command line arguments (if any) into flags:

Flag for impulsive start

535 {
536 
538  if (argc==1)
539  {
540  cout << "No command line arguments specified -- using defaults." << std::endl;
541  }
542  else if (argc==3)
543  {
544  cout << "Two command line arguments specified:" << std::endl;
545  // Flag for long run
546  Global_Parameters::Long_run_flag=atoi(argv[1]);
549  }
550  else
551  {
552  std::string error_message =
553  "Wrong number of command line arguments. Specify none or two.\n";
554  error_message +=
555  "Arg1: Long_run_flag [0/1]\n";
556  error_message +=
557  "Arg2: Impulsive_start_flag [0/1]\n";
558 
559  throw OomphLibError(error_message,
562  }
563  cout << "Long run flag: "
564  << Global_Parameters::Long_run_flag << std::endl;
565  cout << "Impulsive start flag: "
567 
568 
569  // Set physical parameters:
570 
571  // Womersley number = Reynolds number (St = 1)
574 
575  //Horizontal length of domain
576  double lx = 1.0;
577 
578  //Vertical length of domain
579  double ly = 1.0;
580 
581  // Number of elements in x-direction
582  unsigned nx=5;
583 
584  // Number of elements in y-direction
585  unsigned ny=10;
586 
587  // Loop over run with/without ALE
588  for (unsigned ale_flag=0;ale_flag<2;ale_flag++)
589  {
590 
591  bool use_ale=true;
592  if (ale_flag==1) use_ale=false;
593 
594  // Solve with Crouzeix-Raviart elements
595  {
596  // Set up doc info
597  DocInfo doc_info;
598  doc_info.number()=0;
599  if (ale_flag==0)
600  {
601  doc_info.set_directory("RESLT_CR");
602  }
603  else
604  {
605  doc_info.set_directory("RESLT_CR_ALE");
606  }
607 
608  //Set up problem
610  problem(nx,ny,lx,ly,use_ale);
611 
612  // Run the unsteady simulation
613  problem.unsteady_run(doc_info);
614  }
615 
616  // Solve with Taylor-Hood elements
617  {
618  // Set up doc info
619  DocInfo doc_info;
620  doc_info.number()=0;
621  if (ale_flag==0)
622  {
623  doc_info.set_directory("RESLT_TH");
624  }
625  else
626  {
627  doc_info.set_directory("RESLT_TH_ALE");
628  }
629 
630  //Set up problem
632  problem(nx,ny,lx,ly,use_ale);
633 
634  // Run the unsteady simulation
635  problem.unsteady_run(doc_info);
636  }
637  }
638 
639 } // end of main
Definition: navier_stokes/rayleigh_channel/rayleigh_channel.cc:121
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
Definition: oomph_definitions.h:222
unsigned Long_run_flag
Flag for long/short run: Default = perform long run.
Definition: navier_stokes/rayleigh_channel/rayleigh_channel.cc:52
double ReSt
Womersley number: Product of Reynolds and Strouhal numbers.
Definition: fsi_channel_with_leaflet_precond.cc:225
double Re
reynolds number
Definition: adaptive_hopf.cc:54
unsigned Impulsive_start_flag
Definition: navier_stokes/rayleigh_channel/rayleigh_channel.cc:56
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const double lx
Definition: ConstraintElementsUnitTest.cpp:33
const unsigned nx
Definition: ConstraintElementsUnitTest.cpp:30
const unsigned ny
Definition: ConstraintElementsUnitTest.cpp:31
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References Global_Parameters::Impulsive_start_flag, Global_Parameters::Long_run_flag, Mesh_Parameters::lx, Mesh_Parameters::ly, oomph::DocInfo::number(), Mesh_Parameters::nx, Mesh_Parameters::ny, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, Global_Parameters::Re, Global_Parameters::ReSt, oomph::DocInfo::set_directory(), and oomph::Global_string_for_annotation::string().