fsi_channel_with_leaflet_precond.cc File Reference
#include "generic.h"
#include "beam.h"
#include "navier_stokes.h"
#include "multi_physics.h"
#include "constitutive.h"
#include "solid.h"
#include "meshes/channel_with_leaflet_mesh.h"
#include "meshes/one_d_lagrangian_mesh.h"

Classes

class  oomph::PseudoElasticBulkElement< ELEMENT >
 
class  oomph::FaceGeometry< PseudoElasticBulkElement< ELEMENT > >
 FaceGeometry of wrapped element is the same as the underlying element. More...
 
class  UndeformedLeaflet
 GeomObject: Undeformed straight, vertical leaflet. More...
 
class  FSIChannelWithLeafletProblem< ELEMENT >
 FSI leaflet in channel. More...
 

Namespaces

 oomph
 DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
 
 Global_Parameters
 Namespace for global parameters.
 

Functions

double Global_Parameters::flux (const double &t)
 Flux: Pulsatile flow. More...
 
int main (int argc, char **argv)
 Driver code. More...
 

Variables

double Global_Parameters::Leaflet_x0 = 1.0
 x-position of root of leaflet More...
 
double Global_Parameters::Leaflet_height =0.5
 height of leaflet More...
 
double Global_Parameters::Fluid_length_left =1.0
 length of fluid mesh to left of leaflet More...
 
double Global_Parameters::Fluid_length_right =3.0
 length of fluid mesh to right of leaflet More...
 
double Global_Parameters::Fluid_height =1.0
 height of fluid mesh More...
 
unsigned Global_Parameters::Mesh_nleft =4
 Num elements to left of leaflet in coarse mesh. More...
 
unsigned Global_Parameters::Mesh_nright =12
 Num elements to right of leaflet in coarse mesh. More...
 
unsigned Global_Parameters::Mesh_ny1 =2
 Num elements in fluid mesh in y dirn adjacent to leaflet. More...
 
unsigned Global_Parameters::Mesh_ny2 =2
 Num elements in fluid mesh in y dirn above leaflet. More...
 
double Global_Parameters::ReSt =50.0
 Womersley number: Product of Reynolds and Strouhal numbers. More...
 
double Global_Parameters::U_base =1.0
 Min. flux. More...
 
double Global_Parameters::U_perturbation =0.5
 Max. flux. More...
 
double Global_Parameters::Lambda_sq_beam =0.0
 Beam mass density. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver code.

1069 {
1070 #ifdef OOMPH_HAS_MPI
1071  MPI_Helpers::init(argc,argv);
1072 #endif
1073 
1074  // Switch off output modifier
1076 
1077  // Store command line arguments
1078  CommandLineArgs::setup(argc,argv);
1079 
1080  // Multiplier for number of elements in coordinate directions.
1081  // Used for uniform mesh refinement studies.
1082  unsigned mesh_multiplier = 2;
1083  CommandLineArgs::specify_command_line_flag("--mesh_multiplier",
1084  &mesh_multiplier);
1085 
1086  // Suppress use of LSC preconditioner for Navier Stokes block
1088 
1089  // Use direct solver (SuperLU)
1090  CommandLineArgs::specify_command_line_flag("--use_direct_solver");
1091 
1092  // Use SuperLU for all block solves
1093  CommandLineArgs::specify_command_line_flag("--superlu_for_blocks");
1094 
1095  // Validation only?
1097 
1098  // Parse command line
1100 
1101  // Doc what has actually been specified on the command line
1103 
1104  //Set up the problem
1108  problem_pt = new
1112  (mesh_multiplier);
1113 
1114  // Initialise timestep
1115  problem_pt->initialise_dt(Global_Parameters::Dt);
1116 
1117  // Label for output
1118  DocInfo doc_info;
1119  doc_info.set_directory("RESLT");
1120 
1121 
1122  // Define processor-labeled output file for all on-screen stuff
1123  std::ofstream output_stream;
1124  char filename[1000];
1125 #ifdef OOMPH_HAS_MPI
1126  sprintf(filename,"%s/OUTPUT_STEADY.%i",doc_info.directory().c_str(),
1127  MPI_Helpers::communicator_pt()->my_rank());
1128 #else
1129  sprintf(filename,"%s/OUTPUT_STEADY.%i",doc_info.directory().c_str(),0);
1130 #endif
1131 
1132  output_stream.open(filename);
1133  oomph_info.stream_pt() = &output_stream;
1134  OomphLibWarning::set_stream_pt(&output_stream);
1135  OomphLibError::set_stream_pt(&output_stream);
1136 
1137 
1138  // Output initial configuration
1139  problem_pt->doc_solution(doc_info);
1140  doc_info.number()++;
1141 
1142  // Switch to iterative solver?
1143  if (!CommandLineArgs::command_line_flag_has_been_set("--use_direct_solver"))
1144  {
1145  problem_pt->set_iterative_solver();
1146  }
1147 
1148 
1149  // Steady solves
1150  //--------------
1151 
1152  // Increment Re and Womersley numbers in increments of 25.
1153  double target_re = Global_Parameters::Re;
1154  Global_Parameters::Re=25.0;
1156  while (Global_Parameters::Re<target_re)
1157  {
1158  problem_pt->steady_newton_solve();
1159  problem_pt->doc_parameters();
1160  Global_Parameters::Re+=25.0;
1162  problem_pt->doc_solution(doc_info);
1163  doc_info.number()++;
1164  }
1165 
1166  // Do final solve at desired Re
1167  Global_Parameters::Re=target_re;
1168  Global_Parameters::ReSt=target_re;
1169  problem_pt->steady_newton_solve();
1170  problem_pt->doc_parameters();
1171  problem_pt->doc_solution(doc_info);
1172  doc_info.number()++;
1173 
1174  // Unsteady solves
1175  //----------------
1176 
1177  // Define processor-labeled output file for all on-screen stuff
1178  output_stream.close();
1179 #ifdef OOMPH_HAS_MPI
1180  sprintf(filename,"%s/OUTPUT_UNSTEADY.%i",doc_info.directory().c_str(),
1181  MPI_Helpers::communicator_pt()->my_rank());
1182 #else
1183  sprintf(filename,"%s/OUTPUT_UNSTEADY.%i",doc_info.directory().c_str(),0);
1184 #endif
1185  output_stream.open(filename);
1186  oomph_info.stream_pt() = &output_stream;
1187  OomphLibWarning::set_stream_pt(&output_stream);
1188  OomphLibError::set_stream_pt(&output_stream);
1189 
1190  // Loop over timesteps for specified number of periods of fluctuating
1191  // inflow
1192  unsigned n_period=1;
1193 
1194  unsigned nstep=unsigned(double(n_period)
1196 
1198  {
1199  nstep=3;
1200  }
1201  for (unsigned r = 0; r < nstep; r++)
1202  {
1203  problem_pt->unsteady_newton_solve(Global_Parameters::Dt);
1204  problem_pt->doc_parameters();
1205  problem_pt->doc_solution(doc_info);
1206  doc_info.number()++;
1207  }
1208 
1209  // clean up
1210  delete problem_pt;
1211 
1212  // Shut down
1213  oomph_info << "Done\n";
1214 
1215 #ifdef OOMPH_HAS_MPI
1216  MPI_Helpers::finalize();
1217 #endif
1218 
1219 } // end_of_main
FSI leaflet in channel.
Definition: interaction/fsi_channel_with_leaflet/fsi_channel_with_leaflet.cc:165
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
std::ostream *& stream_pt()
Access function for the stream pointer.
Definition: oomph_definitions.h:464
OutputModifier *& output_modifier_pt()
Access function for the output modifier pointer.
Definition: oomph_definitions.h:476
Definition: interaction/pseudo_solid_collapsible_tube/pseudo_solid_collapsible_tube.cc:55
Definition: pseudosolid_node_update_elements.h:58
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
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
double Dt
Timestep.
Definition: interaction/pseudo_solid_collapsible_tube/pseudo_solid_collapsible_tube.cc:415
double T
Period of periodic variation in inflow pressure.
Definition: interaction/pseudo_solid_collapsible_tube/pseudo_solid_collapsible_tube.cc:412
string filename
Definition: MergeRestartFiles.py:39
r
Definition: UniformPSDSelfTest.py:20
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
OutputModifier default_output_modifier
Single global instatiation of the default output modifier.
Definition: oomph_definitions.cc:325
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References oomph::CommandLineArgs::command_line_flag_has_been_set(), oomph::default_output_modifier, oomph::DocInfo::directory(), oomph::CommandLineArgs::doc_specified_flags(), Global_Parameters::Dt, MergeRestartFiles::filename, oomph::DocInfo::number(), oomph::oomph_info, oomph::OomphInfo::output_modifier_pt(), oomph::CommandLineArgs::parse_and_assign(), UniformPSDSelfTest::r, Global_Parameters::Re, Global_Parameters::ReSt, oomph::DocInfo::set_directory(), Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), oomph::OomphInfo::stream_pt(), and Global_Parameters::T.