flow_past_oscillating_cylinder.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "meshes/rectangle_with_moving_cylinder_mesh.h"
#include <limits>

Classes

class  oomph::MyRefineableQTaylorHoodElement
 Overloaded element that allows projection of use as PML element. More...
 
class  oomph::PMLLayerElement< MyRefineableQTaylorHoodElement >
 Policy class defining the elements to be used in the PML layers. Same! More...
 
class  oomph::FaceGeometry< MyRefineableQTaylorHoodElement >
 
class  OscillatingCylinder
 Oscillating cylinder class. More...
 
class  FlowAroundCylinderProblem< ELEMENT >
 Flow around a cylinder in rectangular domain. More...
 

Namespaces

 oomph
 DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
 
 GlobalParameters
 Global parameters.
 

Functions

double GlobalParameters::calculate_strouhal_number (const double &re)
 
void GlobalParameters::update_simulation_parameters ()
 
void GlobalParameters::doc_navier_stokes_parameters ()
 Document the value of the Reynolds number and Womersley number. More...
 
void GlobalParameters::doc_maximum_central_box_deformation ()
 Document the maximum deformation inside the central box. More...
 
double GlobalParameters::round (const double &d)
 ---------------------------------------—DOCUMENTATION HELPERS---— More...
 
int main (int argc, char **argv)
 Driver. More...
 

Variables

double GlobalParameters::Period_ratio =1.0
 The ratio T_e/T_s. More...
 
double GlobalParameters::Re_target =20.0
 Reynolds number for unsteady run. More...
 
double GlobalParameters::St =1.0
 The default Strouhal number (overloaded with input value if given) More...
 
double GlobalParameters::ReSt =Re*St
 The Womersley number. More...
 
unsigned GlobalParameters::N_period_unsteady =1
 ------------------------------------—NAVIER-STOKES PARAMETERS---— More...
 
unsigned GlobalParameters::N_step_per_period_unsteady =100
 Number of timesteps per period for unsteady run. More...
 
double GlobalParameters::Height =20.0
 Height of domain. More...
 
double GlobalParameters::X_left =-10.0
 X-coordinate of upstream end of domain. More...
 
double GlobalParameters::X_right =40.0
 X-coordinate of downstream end of domain. More...
 
double GlobalParameters::Length_of_central_box =10.0
 Side-length of the square box in the mesh surrounding the cylinder. More...
 
unsigned GlobalParameters::N_plot_point =2
 -------------------------------------------—DOMAIN PROPERTIES---— More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver.

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

925 {
926 #ifdef OOMPH_HAS_MPI
927  // Initialise MPI
928  MPI_Helpers::init(argc,argv);
929 
930  // Switch off output modifier
932 
933  // Switch off oomph_info output for all processors but rank 0
934  if (MPI_Helpers::communicator_pt()->my_rank()!=0)
935  {
937  OomphLibWarning::set_stream_pt(&oomph_nullstream);
938  OomphLibError::set_stream_pt(&oomph_nullstream);
939  }
940  else
941  {
942  oomph_info << "\n\n====================================================\n"
943  << "Number of processors: "
944  << MPI_Helpers::communicator_pt()->nproc()
945  << "\n====================================================\n"
946  << std::endl;
947  }
948 #endif
949 
950  // Start the timer
951  double timer_s=TimingHelpers::timer();
952 
953  // Generic update function that calls all the appropriate update functions
955 
956  // Output directory
958 
959  // Build the problem
961 
962  // Refine the problem a couple of times
964  {
965  // Refine uniformly
966  problem.refine_uniformly();
967  }
968 
969  // Number of steps to increment the Reynolds number to the target value
970  unsigned n_re_step=1;
971 
972  // Calculate the increment required to get to the Reynolds number
973  double re_increment=GlobalParameters::Re_target/n_re_step;
974 
975  //-----------------------------
976  // Crank up the Reynolds number
977  //-----------------------------
978  // Loop over the Reynolds increments
979  for (unsigned i=0; i<n_re_step+1; i++)
980  {
981  // Calculate the Reynolds number
982  GlobalParameters::Re=double(i)*re_increment;
983 
984  // Update the Womersley number
986 
987  // Output the current N.St. parameter values
989 
990  // Solve the problem
991  problem.newton_solve();
992  }
993 
994  // Document the solution
995  problem.doc_solution();
996 
997  //------------------------------
998  // Start the unsteady simulation
999  //------------------------------
1000  // Run the simulation
1001  problem.unsteady_simulation();
1002 
1003  // Document the solution
1004  problem.doc_solution(true);
1005 
1006  // Tell the user we're done and how long the whole thing took
1007  oomph_info << "\nUnsteady simulation complete!"
1008  << "\nTotal time for full simulation [sec]: "
1009  << TimingHelpers::timer()-timer_s << "\n" << std::endl;
1010 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Flow around a cylinder in rectangular domain.
Definition: adaptive_hopf.cc:1042
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
std::ostream *& stream_pt()
Access function for the stream pointer.
Definition: oomph_definitions.h:464
OutputModifier *& output_modifier_pt()
Access function for the output modifier pointer.
Definition: oomph_definitions.h:476
void update_simulation_parameters()
Definition: flow_past_oscillating_cylinder.cc:281
void doc_navier_stokes_parameters()
Document the value of the Reynolds number and Womersley number.
Definition: flow_past_oscillating_cylinder.cc:291
double Re
Reynolds number.
Definition: extrude_triangle_generated_mesh.cc:48
unsigned N_uniform_refinement_before_solve
Number of uniform refinements before any solve.
Definition: extrude_with_macro_element_representation.cc:268
DocInfo Doc_info
Helper for documenting.
Definition: extrude_triangle_generated_mesh.cc:57
double Re_target
Reynolds number for unsteady run.
Definition: flow_past_oscillating_cylinder.cc:220
Nullstream oomph_nullstream
Single (global) instantiation of the Nullstream.
Definition: oomph_definitions.cc:313
OutputModifier default_output_modifier
Single global instatiation of the default output modifier.
Definition: oomph_definitions.cc:325
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
double timer
Definition: oomph_metis_from_parmetis_3.1.1/struct.h:210
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::default_output_modifier, GlobalParameters::Doc_info, GlobalParameters::doc_navier_stokes_parameters(), i, GlobalParameters::N_uniform_refinement_before_solve, oomph::oomph_info, oomph::oomph_nullstream, oomph::OomphInfo::output_modifier_pt(), problem, GlobalParameters::Re, GlobalParameters::Re_target, oomph::DocInfo::set_directory(), oomph::OomphInfo::stream_pt(), and GlobalParameters::update_simulation_parameters().