fsi_collapsible_channel.cc File Reference
#include <iostream>
#include "generic.h"
#include "navier_stokes.h"
#include "beam.h"
#include "meshes/one_d_lagrangian_mesh.h"
#include "meshes/collapsible_channel_mesh.h"

Classes

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[])
 

Variables

double Global_Physical_Variables::P_up =0.0
 Default pressure on the left boundary. 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 timesteps.

812 {
813 
814  // Store command line arguments
815  CommandLineArgs::setup(argc,argv);
816 
817  // Reduction in resolution for validation run?
818  unsigned coarsening_factor=1;
819  if (CommandLineArgs::Argc>1)
820  {
821  coarsening_factor=4;
822  }
823 
824  // Number of elements in the domain
825  unsigned nup=20/coarsening_factor;
826  unsigned ncollapsible=40/coarsening_factor;
827  unsigned ndown=40/coarsening_factor;
828  unsigned ny=16/coarsening_factor;
829 
830  // Length of the domain
831  double lup=5.0;
832  double lcollapsible=10.0;
833  double ldown=10.0;
834  double ly=1.0;
835 
836  // Set external pressure (on the wall stiffness scale).
838 
839  // Pressure on the left boundary: This is consistent with steady
840  // Poiseuille flow
841  Global_Physical_Variables::P_up=12.0*(lup+lcollapsible+ldown);
842 
843 #ifdef MACRO_ELEMENT_NODE_UPDATE
844 
845 #ifdef TAYLOR_HOOD
846 
847  // Build the problem with QTaylorHoodElements
850  problem(nup, ncollapsible, ndown, ny,
851  lup, lcollapsible, ldown, ly);
852 
853 #else
854 
855  // Build the problem with QCrouzeixRaviartElements
858  problem(nup, ncollapsible, ndown, ny,
859  lup, lcollapsible, ldown, ly);
860 
861 #endif
862 
863 #else
864 
865 #ifdef TAYLOR_HOOD
866 
867  // Build the problem with QCrouzeixRaviartElements
870  problem(nup, ncollapsible, ndown, ny,
871  lup, lcollapsible, ldown, ly);
872 
873 #else
874 
875  // Build the problem with QCrouzeixRaviartElements
878  problem(nup, ncollapsible, ndown, ny,
879  lup, lcollapsible, ldown, ly);
880 
881 #endif
882 
883 #endif
884  // Timestep. Note: Preliminary runs indicate that the period of
885  // the oscillation is about 1 so this gives us 40 steps per period.
886  double dt=1.0/40.0;
887 
888  // Initial time for the simulation
889  double t_min=0.0;
890 
891  // Maximum time for simulation
892  double t_max=3.5;
893 
894  // Initialise timestep
895  problem.time_pt()->time()=t_min;
896  problem.initialise_dt(dt);
897 
898  // Apply initial condition
899  problem.set_initial_condition();
900 
901  //Set output directory
902  DocInfo doc_info;
903  doc_info.set_directory("RESLT");
904 
905  // Open a trace file
906  ofstream trace_file;
907  char filename[100];
908  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
909  trace_file.open(filename);
910 
911  // Output the initial solution
912  problem.doc_solution(doc_info, trace_file);
913 
914  // Increment step number
915  doc_info.number()++;
916 
917  // Find number of timesteps (reduced for validation)
918  unsigned nstep = unsigned((t_max-t_min)/dt);
919  if (CommandLineArgs::Argc>1)
920  {
921  nstep=3;
922  }
923 
924  // Timestepping loop
925  for (unsigned istep=0;istep<nstep;istep++)
926  {
927  // Solve the problem
928  problem.unsteady_newton_solve(dt);
929 
930  // Outpt the solution
931  problem.doc_solution(doc_info, trace_file);
932 
933  // Step number
934  doc_info.number()++;
935  }
936 
937 
938  // Close trace file.
939  trace_file.close();
940 
941 }//end of main
Problem class.
Definition: fsi_chan_problem.h:315
Definition: algebraic_elements.h:540
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: macro_element_node_update_element.h:265
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

References oomph::CommandLineArgs::Argc, oomph::DocInfo::directory(), MergeRestartFiles::filename, Mesh_Parameters::ly, oomph::DocInfo::number(), Mesh_Parameters::ny, Global_Physical_Variables::P_ext, Global_Physical_Variables::P_up, problem, oomph::DocInfo::set_directory(), and Flag_definition::setup().