fsi_pseudo_solid_collapsible_channel_adapt.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  ElasticRefineableCollapsibleChannelMesh< 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.

1142 {
1143  // Store command line arguments
1144  CommandLineArgs::setup(argc,argv);
1145 
1146  // Reduction in resolution for validation run?
1147  unsigned coarsening_factor=4;
1148  if (CommandLineArgs::Argc>1)
1149  {
1150  coarsening_factor=4;
1151  }
1152 
1153  // Number of elements in the domain
1154  unsigned nup=20/coarsening_factor;
1155  unsigned ncollapsible=40/coarsening_factor;
1156  unsigned ndown=40/coarsening_factor;
1157  unsigned ny=16/coarsening_factor;
1158 
1159  // Length of the domain
1160  double lup=5.0;
1161  double lcollapsible=10.0;
1162  double ldown=10.0;
1163  double ly=1.0;
1164 
1165  // Set external pressure (on the wall stiffness scale).
1167 
1168  // Pressure on the left boundary: This is consistent with steady
1169  // Poiseuille flow
1170  Global_Physical_Variables::P_up=12.0*(lup+lcollapsible+ldown);
1171 
1172 
1173 #ifdef TAYLOR_HOOD
1174 
1175  // Build the problem with QtaylorHoodElements
1180  problem(nup, ncollapsible, ndown, ny,
1181  lup, lcollapsible, ldown, ly);
1182 
1183 #else
1184 
1185  // Build the problem with QCrouzeixRaviartElements
1190  problem(nup, ncollapsible, ndown, ny,
1191  lup, lcollapsible, ldown, ly);
1192 
1193 #endif
1194 
1195  // Timestep. Note: Preliminary runs indicate that the period of
1196  // the oscillation is about 1 so this gives us 40 steps per period.
1197  double dt=1.0/40.0;
1198 
1199  // Initial time for the simulation
1200  double t_min=0.0;
1201 
1202  // Maximum time for simulation
1203  double t_max=3.5;
1204 
1205  // Initialise timestep
1206  problem.time_pt()->time()=t_min;
1207  problem.initialise_dt(dt);
1208 
1209  // Apply initial condition
1210  problem.set_initial_condition();
1211 
1212  //Set output directory
1213  DocInfo doc_info;
1214  doc_info.set_directory("RESLT");
1215 
1216  // Open a trace file
1217  ofstream trace_file;
1218  char filename[100];
1219  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
1220  trace_file.open(filename);
1221 
1222  // Output the initial condition
1223  problem.doc_solution(doc_info, trace_file);
1224 
1225  // Increment step number
1226  doc_info.number()++;
1227 
1228  // Find number of timesteps (reduced for validation)
1229  unsigned nstep = unsigned((t_max-t_min)/dt);
1230  if (CommandLineArgs::Argc>1)
1231  {
1232  nstep=3;
1233  }
1234 
1235 
1236  // Set targets for spatial adaptivity
1237  problem.bulk_mesh_pt()->max_permitted_error()=1.0e-3;
1238  problem.bulk_mesh_pt()->min_permitted_error()=1.0e-5;
1239 
1240  // Overwrite for validation run
1241  if (CommandLineArgs::Argc>1)
1242  {
1243  // Set targets for spatial adaptivity
1244  problem.bulk_mesh_pt()->max_permitted_error()=0.5e-2;
1245  problem.bulk_mesh_pt()->min_permitted_error()=0.5e-4;
1246  }
1247 
1248  // When performing the first timestep, we can adapt the mesh as many times
1249  // as we want because the initial condition can be re-set
1250  unsigned max_adapt=3;
1251  bool first=true;
1252 
1253  // Timestepping loop
1254  for (unsigned istep=0;istep<nstep;istep++)
1255  {
1256  // Solve the problem
1257  problem.unsteady_newton_solve(dt,max_adapt,first);
1258 
1259  // Outpt the solution
1260  problem.doc_solution(doc_info, trace_file);
1261 
1262  // Step number
1263  doc_info.number()++;
1264 
1265  // We've done the first step
1266  first=false;
1267  max_adapt=1;
1268  }
1269 
1270  // Close trace file.
1271  trace_file.close();
1272 
1273 }//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
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_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