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

Classes

class  OscillatingWall
 
class  CollapsibleChannelProblem< 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...
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code for an unsteady adaptive collapsible channel problem with prescribed wall motion. Presence of command line arguments indicates validation run with coarse resolution and small number of timesteps.

773 {
774 
775  // Store command line arguments
776  CommandLineArgs::setup(argc,argv);
777 
778  // Reduction in resolution for validation run?
779  unsigned coarsening_factor=1;
780  if (CommandLineArgs::Argc>1)
781  {
782  coarsening_factor=4;
783  }
784 
785  // Number of elements in the domain
786  unsigned nup=20/coarsening_factor;
787  unsigned ncollapsible=40/coarsening_factor;
788  unsigned ndown=40/coarsening_factor;
789  unsigned ny=16/coarsening_factor;
790 
791  // Length of the domain
792  double lup=5.0;
793  double lcollapsible=10.0;
794  double ldown=10.0;
795  double ly=1.0;
796 
797  // Initial amplitude of the wall deformation
798  double amplitude=1.0e-2; // ADJUST
799 
800  // Period of oscillation
801  double period=0.45;
802 
803  // Pressure/applied traction on the left boundary: This is consistent with
804  // steady Poiseuille flow
805  Global_Physical_Variables::P_up=12.0*(lup+lcollapsible+ldown);
806 
807 
808  //Set output directory
809  DocInfo doc_info;
810  doc_info.set_directory("RESLT");
811 
812  // Open a trace file
813  ofstream trace_file;
814  char filename[100];
815  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
816  trace_file.open(filename);
817 
818  // Build the problem with Crouzeix Raviart Elements
820  problem(nup, ncollapsible, ndown, ny,
821  lup, lcollapsible, ldown, ly,
822  amplitude,period);
823 
824 
825  // Number of timesteps per period
826  unsigned nsteps_per_period=40;
827 
828  // Number of periods
829  unsigned nperiod=3;
830 
831  // Number of timesteps (reduced for validation)
832  unsigned nstep=nsteps_per_period*nperiod;
833  if (CommandLineArgs::Argc>1)
834  {
835  nstep=3;
836  }
837 
838  //Timestep:
839  double dt=period/double(nsteps_per_period);
840 
841  // Start time
842  double t_min=0.0;
843 
844  // Initialise timestep and set initial conditions
845  problem.time_pt()->time()=t_min;
846  problem.initialise_dt(dt);
847  problem.set_initial_condition();
848 
849  // Output the initial solution
850  problem.doc_solution(doc_info, trace_file);
851 
852  // Step number
853  doc_info.number()++;
854 
855 
856  // Set targets for spatial adaptivity
857  problem.bulk_mesh_pt()->max_permitted_error()=1.0e-3;
858  problem.bulk_mesh_pt()->min_permitted_error()=1.0e-5;
859 
860  // Overwrite with reduced targets for validation run to force
861  // some refinement during the first few timesteps
862  if (CommandLineArgs::Argc>1)
863  {
864  problem.bulk_mesh_pt()->max_permitted_error()=1.0e-4;
865  problem.bulk_mesh_pt()->min_permitted_error()=1.0e-6;
866  }
867 
868 
869  // First timestep: We may re-assign the initial condition
870  // following any mesh adaptation.
871  bool first=true;
872 
873  // Max. number of adaptations during first timestep
874  unsigned max_adapt=10;
875 
876  // Timestepping loop
877  for (unsigned istep=0;istep<nstep;istep++)
878  {
879  // Solve the problem
880  problem.unsteady_newton_solve(dt, max_adapt, first);
881 
882 
883  // Outpt the solution
884  problem.doc_solution(doc_info, trace_file);
885 
886  // Step number
887  doc_info.number()++;
888 
889  // We've done one step: Don't re-assign the initial conditions
890  // and limit the number of adaptive mesh refinements to one
891  // per timestep.
892  first=false;
893  max_adapt=1;
894  }
895 
896  trace_file.close();
897 
898 } //end of driver code
Problem class.
Definition: collapsible_channel.cc:236
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
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_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_up, problem, oomph::DocInfo::set_directory(), and Flag_definition::setup().