fsi_chan_seg_driver.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "beam.h"
#include "multi_physics.h"
#include "meshes/one_d_lagrangian_mesh.h"
#include "meshes/collapsible_channel_mesh.h"
#include "fsi_chan_problem.h"

Classes

class  SegregatedFSICollapsibleChannelProblem< ELEMENT >
 

Namespaces

 Flags
 Extend namespace for flags.
 

Functions

void Flags::segregated_doc_flags ()
 Doc flags for extended namespace. More...
 
int main (int argc, char *argv[])
 

Variables

unsigned Flags::Use_segregated_solver =1
 Use Newton solver (0) or segregated solver (1)? More...
 
unsigned Flags::Use_pointwise_aitken =0
 Use pointwise Aitken extrapolation (1) or not (0) More...
 
double Flags::Omega_under_relax =1.0
 Under-relaxation parameter (1.0: no under-relaxation; 0.0: freeze) More...
 
unsigned Flags::Use_irons_and_tuck_extrapolation =0
 Use Irons and Tuck extrapolation (1) or not (0) More...
 
unsigned Flags::Convergence_criterion =0
 Convergence criterion: 0: global resmax; 1: abs. change; 2: rel. change. More...
 
double Flags::Convergence_tolerance =1.0e-9
 Convergence tolerance. More...
 
double Flags::Dt =0.1
 Timestep. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

//////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// Driver code for a collapsible channel problem with FSI. Presence of command line arguments indicates validation run with coarse resolution and small number of steps.

Resolution factor

Use Newton solver (0) or segregated solver (1)?

Use pointwise Aitken extrapolation (1) or not (0)

Under-relaxation parameter

Use Irons and Tuck extrapolation

Use displacement control (1) or not (0)

Min. y coordinate for parameter study with displacement control

Steady (1) or unsteady (0) run

Convergence criterion: 0: global resmax; 1: abs. change; 2: rel. change

Convergence tolerance

Number of steps

Reynolds number

Womersley number

FSI parameter

Timestep

1444 {
1445 
1446  // Store command line arguments
1447  CommandLineArgs::setup(argc,argv);
1448 
1449  if (CommandLineArgs::Argc==1)
1450  {
1451  std::cout << "Using default settings for flags" << std::endl;
1452  }
1453  else if ((CommandLineArgs::Argc==15)||(CommandLineArgs::Argc==17))
1454  {
1456  Flags::Resolution_factor=atoi(argv[1]);
1457 
1459  Flags::Use_segregated_solver=atoi(argv[2]);
1460 
1462  Flags::Use_pointwise_aitken=atoi(argv[3]);
1463 
1465  Flags::Omega_under_relax=atof(argv[4]);
1466 
1469 
1471  Flags::Use_displ_control=atoi(argv[6]);
1472 
1475 
1477  Flags::Steady_flag=atoi(argv[8]);
1478 
1480  Flags::Convergence_criterion=atoi(argv[9]);
1481 
1483  Flags::Convergence_tolerance=atof(argv[10]);
1484 
1486  Flags::Nsteps=atoi(argv[11]);
1487 
1489  Global_Physical_Variables::Re=double(atof(argv[12]));
1490 
1493 
1495  Global_Physical_Variables::Q=double(atof(argv[13]));
1496 
1498  Flags::Dt=double(atof(argv[14]));
1499 
1500  // Restart?
1501  if (CommandLineArgs::Argc==17)
1502  {
1503  // Name of restart file
1504  Flags::Restart_file_name=argv[15];
1505 
1506  // Jump in pressure
1507  Global_Physical_Variables::P_step=double(atof(argv[16]));
1508  }
1509  }
1510  else
1511  {
1512  std::cout
1513  << "\n\n\n\n\n"
1514  << "Wrong number of command line args: Specify none, fourteen or sixteen:"
1515  << std::endl
1516  << "- resolution factor [1,2,...]" << std::endl
1517  << "- use_segregated_solver [0/1]"<< std::endl
1518  << "- use_pointwise_aitken [0/1]" << std::endl
1519  << "- under-relaxation parameter" << std::endl
1520  << "- use_irons_and_tuck_extrapolation [0/1]" << std::endl
1521  << "- use_displ_control [0/1]" << std::endl
1522  << "- min. y-coordinate of control point when using displ control"
1523  << std::endl
1524  << "- steady_flag [0/1]" << std::endl
1525  << "- convergence criterion [0/1/2]" << std::endl
1526  << "- convergence tolerance " << std::endl
1527  << "- number of steps " << std::endl
1528  << "- Reynolds number" << std::endl
1529  << "- FSI parameter Q" << std::endl
1530  << "- Timestep dt" << std::endl
1531  << "- restart file name [optional] " << std::endl
1532  << "- jump in pressure P_step [optional] " << std::endl
1533  << "You specified " << CommandLineArgs::Argc-1 << " command line arg[s]"
1534  << "\n\n\n\n\n" << std::endl;
1535  abort();
1536  }
1537  Flags::doc_flags();
1539 
1540 
1541  // Number of elements in the domain
1542  unsigned nup=4*Flags::Resolution_factor;
1543  unsigned ncollapsible=20*Flags::Resolution_factor;
1544  unsigned ndown=40*Flags::Resolution_factor;
1545  unsigned ny=4*Flags::Resolution_factor;
1546 
1547 
1548  // Length of the domain
1549  double lup=1.0;
1550  double lcollapsible=5.0;
1551  double ldown=10.0;
1552  double ly=1.0;
1553 
1554 
1555  // Use displacement control?
1556  bool displ_control=false;
1557  if (Flags::Use_displ_control==1) displ_control=true;
1558 
1559  // Steady run?
1560  bool steady_flag=false;
1561  if (Flags::Steady_flag==1) steady_flag=true;
1562 
1563  // Build the problem with QTaylorHoodElements
1566  problem(nup, ncollapsible, ndown, ny,
1567  lup, lcollapsible, ldown, ly, displ_control,
1568  steady_flag);
1569 
1570  if (Flags::Steady_flag)
1571  {
1572  problem.steady_run();
1573  }
1574  else
1575  {
1576  problem.unsteady_run();
1577  }
1578 
1579 }//end of main
Definition: fsi_chan_seg_driver.cc:216
Definition: algebraic_elements.h:540
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
unsigned Use_segregated_solver
Use Newton solver (0) or segregated solver (1)?
Definition: fsi_chan_seg_driver.cc:60
string Restart_file_name
Name of restart file.
Definition: fsi_chan_problem.h:251
double Convergence_tolerance
Convergence tolerance.
Definition: fsi_chan_seg_driver.cc:75
double Omega_under_relax
Under-relaxation parameter (1.0: no under-relaxation; 0.0: freeze)
Definition: fsi_chan_seg_driver.cc:66
unsigned Resolution_factor
Resolution factor (multiplier for number of elements across channel)
Definition: fsi_chan_problem.h:236
double Dt
Timestep.
Definition: fsi_chan_seg_driver.cc:78
unsigned Nsteps
Number of steps in parameter study.
Definition: fsi_chan_problem.h:245
unsigned Steady_flag
Steady run (1) or unsteady run (0)
Definition: fsi_chan_problem.h:242
unsigned Use_irons_and_tuck_extrapolation
Use Irons and Tuck extrapolation (1) or not (0)
Definition: fsi_chan_seg_driver.cc:69
void doc_flags()
Doc flags.
Definition: fsi_chan_problem.h:254
unsigned Use_pointwise_aitken
Use pointwise Aitken extrapolation (1) or not (0)
Definition: fsi_chan_seg_driver.cc:63
unsigned Convergence_criterion
Convergence criterion: 0: global resmax; 1: abs. change; 2: rel. change.
Definition: fsi_chan_seg_driver.cc:72
void segregated_doc_flags()
Doc flags for extended namespace.
Definition: fsi_chan_seg_driver.cc:81
unsigned Use_displ_control
Use displacement control (1) or not (0)
Definition: fsi_chan_problem.h:239
double ReSt
Womersley number.
Definition: rayleigh_instability.cc:56
double Q
Ratio of scales.
Definition: elastic_bretherton.cc:131
double P_step
Definition: fsi_chan_problem.h:62
double Re
Reynolds number.
Definition: fibre.cc:55
double Yprescr_min
Definition: fsi_chan_problem.h:71
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const unsigned ny
Definition: ConstraintElementsUnitTest.cpp:31
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, Flags::Convergence_criterion, Flags::Convergence_tolerance, Flags::doc_flags(), Flags::Dt, Mesh_Parameters::ly, Flags::Nsteps, Mesh_Parameters::ny, Flags::Omega_under_relax, Global_Physical_Variables::P_step, problem, Global_Physical_Variables::Q, Global_Physical_Variables::Re, Flags::Resolution_factor, Global_Physical_Variables::ReSt, Flags::Restart_file_name, Flags::segregated_doc_flags(), Flag_definition::setup(), Flags::Steady_flag, Flags::Use_displ_control, Flags::Use_irons_and_tuck_extrapolation, Flags::Use_pointwise_aitken, Flags::Use_segregated_solver, and Global_Physical_Variables::Yprescr_min.