fsi_driven_cavity_driver.cc File Reference

Functions

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.

39 {
40 
41  // Store command line arguments
42  CommandLineArgs::setup(argc,argv);
43 
44  // Number of elements in the domain (W. Wall standard resolution)
45  unsigned nx=16; //32;
46  unsigned ny=16; //32;
47 
48  // Length of the domain
49  double lx=1.0;
50  double ly=1.0;
51 
52  // Fractional height of the gap next to the moving lid
53  double gap_fraction=1.0/16.0;
54 
55  // Period of lid oscillation
56  double period=5.0;
57 
58  // Build the problem
61  problem(nx, ny, lx, ly, gap_fraction, period);
62 
63 
64  // Timestep.
65  double dt=period/40.0;
66 
67  // Maximum time for simulation
68  double t_max=50.0;
69 
70  // Initialise timestep
71  problem.initialise_dt(dt);
72 
73  // Apply initial condition
74  problem.set_initial_condition();
75 
76  //Set output directory
77  DocInfo doc_info;
78  doc_info.set_directory("RESLT");
79 
80  // Open a trace file
81  ofstream trace_file;
82  char filename[100];
83  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
84  trace_file.open(filename);
85 
86  // Output the initial solution
87  problem.doc_solution(doc_info, trace_file);
88 
89  // Increment step number
90  doc_info.number()++;
91 
92  // Find number of timesteps (reduced for validation)
93  unsigned nstep = unsigned(t_max/dt);
95  {
96  nstep=3;
97  }
98 
99  // Timestepping loop
100  for (unsigned istep=0;istep<nstep;istep++)
101  {
102  // Solve the problem
103  problem.unsteady_newton_solve(dt);
104 
105  // Outpt the solution
106  problem.doc_solution(doc_info, trace_file);
107 
108  // Step number
109  doc_info.number()++;
110  }
111 
112 
113  // Close trace file.
114  trace_file.close();
115 
116 }//end of main
Problem class.
Definition: fsi_driven_cavity_problem.h:160
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
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
string filename
Definition: MergeRestartFiles.py:39
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const double lx
Definition: ConstraintElementsUnitTest.cpp:33
const unsigned nx
Definition: ConstraintElementsUnitTest.cpp:30
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::lx, Mesh_Parameters::ly, oomph::DocInfo::number(), Mesh_Parameters::nx, Mesh_Parameters::ny, problem, oomph::DocInfo::set_directory(), and Flag_definition::setup().