fsi_pseudo_solid_collapsible_channel.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "beam.h"
#include "solid.h"
#include "constitutive.h"
#include "meshes/one_d_lagrangian_mesh.h"
#include "meshes/collapsible_channel_mesh.h"

Classes

class  ElasticCollapsibleChannelMesh< ELEMENT >
 Upgrade mesh to solid mesh. More...
 
class  UndeformedWall
 
class  FSICollapsibleChannelProblem< ELEMENT >
 Problem class. More...
 

Namespaces

 BL_Squash
 
 Global_Physical_Variables
 Global variables.
 

Functions

double BL_Squash::squash_fct (const double &s)
 
void Global_Physical_Variables::prescribed_traction (const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
 Traction applied on the fluid at the left (inflow) boundary. More...
 
void Global_Physical_Variables::load (const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
 Load function: Apply a constant external pressure to the beam. More...
 
int main (int argc, char *argv[])
 

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 timesteps.

1018 {
1019 
1020  // Store command line arguments
1021  CommandLineArgs::setup(argc,argv);
1022 
1023  // Reduction in resolution for validation run?
1024  unsigned coarsening_factor=4;
1025  if (CommandLineArgs::Argc>1)
1026  {
1027  coarsening_factor=4;
1028  }
1029 
1030  // Number of elements in the domain
1031  unsigned nup=20/coarsening_factor;
1032  unsigned ncollapsible=40/coarsening_factor;
1033  unsigned ndown=40/coarsening_factor;
1034  unsigned ny=16/coarsening_factor;
1035 
1036  // Length of the domain
1037  double lup=5.0;
1038  double lcollapsible=10.0;
1039  double ldown=10.0;
1040  double ly=1.0;
1041 
1042  // Set external pressure (on the wall stiffness scale).
1044 
1045  // Pressure on the left boundary: This is consistent with steady
1046  // Poiseuille flow
1047  Global_Physical_Variables::P_up=12.0*(lup+lcollapsible+ldown);
1048 
1049 
1050 #ifdef TAYLOR_HOOD
1051 
1052  // Build the problem with QtaylorHoodElements
1056  QPVDElement<2,3> > >
1057  problem(nup, ncollapsible, ndown, ny,
1058  lup, lcollapsible, ldown, ly);
1059 
1060 #else
1061 
1062  // Build the problem with QCrouzeixRaviartElements
1066  QPVDElement<2,3> > >
1067  problem(nup, ncollapsible, ndown, ny,
1068  lup, lcollapsible, ldown, ly);
1069 
1070 #endif
1071 
1072  // Timestep. Note: Preliminary runs indicate that the period of
1073  // the oscillation is about 1 so this gives us 40 steps per period.
1074  double dt=1.0/40.0;
1075 
1076  // Initial time for the simulation
1077  double t_min=0.0;
1078 
1079  // Maximum time for simulation
1080  double t_max=3.5;
1081 
1082  // Initialise timestep
1083  problem.time_pt()->time()=t_min;
1084  problem.initialise_dt(dt);
1085 
1086  // Apply initial condition
1087  problem.set_initial_condition();
1088 
1089  //Set output directory
1090  DocInfo doc_info;
1091  doc_info.set_directory("RESLT");
1092 
1093  // Open a trace file
1094  ofstream trace_file;
1095  char filename[100];
1096  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
1097  trace_file.open(filename);
1098 
1099  // Output the initial condition
1100  problem.doc_solution(doc_info, trace_file);
1101 
1102  // Increment step number
1103  doc_info.number()++;
1104 
1105  // Find number of timesteps (reduced for validation)
1106  unsigned nstep = unsigned((t_max-t_min)/dt);
1107  if (CommandLineArgs::Argc>1)
1108  {
1109  nstep=3;
1110  }
1111 
1112  // Timestepping loop
1113  for (unsigned istep=0;istep<nstep;istep++)
1114  {
1115  // Solve the problem
1116  problem.unsteady_newton_solve(dt);
1117 
1118  // Outpt the solution
1119  problem.doc_solution(doc_info, trace_file);
1120 
1121  // Step number
1122  doc_info.number()++;
1123  }
1124 
1125  // Close trace file.
1126  trace_file.close();
1127 
1128 }//end of main
Problem class.
Definition: fsi_chan_problem.h:315
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: pseudosolid_node_update_elements.h:58
Definition: navier_stokes_elements.h:1749
Definition: solid_elements.h:608
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
double P_ext
External pressure.
Definition: fibre.cc:64
double P_up
Default pressure on the left boundary.
Definition: fsi_collapsible_channel.cc:183
string filename
Definition: MergeRestartFiles.py:39
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