pseudo_solid_collapsible_channel.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "solid.h"
#include "constitutive.h"
#include "meshes/collapsible_channel_mesh.h"

Classes

class  ElasticRefineableCollapsibleChannelMesh< ELEMENT >
 Upgrade mesh to solid mesh. More...
 
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.

994 {
995 
996  // Store command line arguments
997  CommandLineArgs::setup(argc,argv);
998 
999  // Reduction in resolution for validation run?
1000  unsigned coarsening_factor=1;
1001  if (CommandLineArgs::Argc>1)
1002  {
1003  coarsening_factor=4;
1004  }
1005 
1006  // Number of elements in the domain
1007  unsigned nup=20/coarsening_factor;
1008  unsigned ncollapsible=40/coarsening_factor;
1009  unsigned ndown=40/coarsening_factor;
1010  unsigned ny=16/coarsening_factor;
1011 
1012  // Length of the domain
1013  double lup=5.0;
1014  double lcollapsible=10.0;
1015  double ldown=10.0;
1016  double ly=1.0;
1017 
1018  // Initial amplitude of the wall deformation
1019  double amplitude=1.0e-2; // ADJUST
1020 
1021  // Period of oscillation
1022  double period=0.45;
1023 
1024  // Pressure/applied traction on the left boundary: This is consistent with
1025  // steady Poiseuille flow
1026  Global_Physical_Variables::P_up=12.0*(lup+lcollapsible+ldown);
1027 
1028 
1029  //Set output directory
1030  DocInfo doc_info;
1031  doc_info.set_directory("RESLT");
1032 
1033  // Open a trace file
1034  ofstream trace_file;
1035  char filename[100];
1036  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
1037  trace_file.open(filename);
1038 
1039  // Build the problem with Crouzeix Raviart Elements
1044  > >
1045  problem(nup, ncollapsible, ndown, ny,
1046  lup, lcollapsible, ldown, ly,
1047  amplitude,period);
1048 
1049 
1050  // Number of timesteps per period
1051  unsigned nsteps_per_period=40;
1052 
1053  // Number of periods
1054  unsigned nperiod=3;
1055 
1056  // Number of timesteps (reduced for validation)
1057  unsigned nstep=nsteps_per_period*nperiod;
1058  if (CommandLineArgs::Argc>1)
1059  {
1060  nstep=3;
1061  }
1062 
1063  //Timestep:
1064  double dt=period/double(nsteps_per_period);
1065 
1066  // Start time
1067  double t_min=0.0;
1068 
1069  // Initialise timestep and set initial conditions
1070  problem.time_pt()->time()=t_min;
1071  problem.initialise_dt(dt);
1072  problem.set_initial_condition();
1073 
1074  // Output the initial solution
1075  problem.doc_solution(doc_info, trace_file);
1076 
1077  // Step number
1078  doc_info.number()++;
1079 
1080 
1081  // Set targets for spatial adaptivity
1082  problem.bulk_mesh_pt()->max_permitted_error()=1.0e-3;
1083  problem.bulk_mesh_pt()->min_permitted_error()=1.0e-5;
1084 
1085  // Overwrite with reduced targets for validation run to force
1086  // some refinement during the first few timesteps
1087  if (CommandLineArgs::Argc>1)
1088  {
1089  problem.bulk_mesh_pt()->max_permitted_error()=1.0e-4;
1090  problem.bulk_mesh_pt()->min_permitted_error()=1.0e-6;
1091  }
1092 
1093 
1094  // First timestep: We may re-assign the initial condition
1095  // following any mesh adaptation.
1096  bool first=true;
1097 
1098  // Max. number of adaptations during first timestep
1099  unsigned max_adapt=10;
1100 
1101  // Timestepping loop
1102  for (unsigned istep=0;istep<nstep;istep++)
1103  {
1104  // Solve the problem
1105  problem.unsteady_newton_solve(dt, max_adapt, first);
1106 
1107  // Outpt the solution
1108  problem.doc_solution(doc_info, trace_file);
1109 
1110  // Step number
1111  doc_info.number()++;
1112 
1113  // We've done one step: Don't re-assign the initial conditions
1114  // and limit the number of adaptive mesh refinements to one
1115  // per timestep.
1116  first=false;
1117  max_adapt=1;
1118  }
1119 
1120  trace_file.close();
1121 
1122 } //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
Refineable version of the PseudoSolidNodeUpdateELement.
Definition: pseudosolid_node_update_elements.h:585
Class for refineable QPVDElement elements.
Definition: refineable_solid_elements.h:181
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