adaptive_bubble_in_channel.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "solid.h"
#include "constitutive.h"
#include "fluid_interface.h"
#include "meshes/triangle_mesh.h"

Classes

class  oomph::MyTaylorHoodElement< DIM >
 Overload TaylorHood element to modify output. More...
 
class  oomph::FaceGeometry< MyTaylorHoodElement >
 
class  oomph::FaceGeometry< FaceGeometry< MyTaylorHoodElement > >
 
class  BubbleInChannelProblem< ELEMENT >
 Problem class to simulate inviscid bubble propagating along 2D channel. More...
 

Namespaces

 oomph
 DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
 
 Problem_Parameter
 Namespace for Problem Parameter.
 

Functions

int main (int argc, char **argv)
 Driver code for moving bubble problem. More...
 

Variables

double Problem_Parameter::Radius = 0.25
 Initial radius of bubble. More...
 
double Problem_Parameter::Volume = -MathematicalConstants::Pi*Radius*Radius
 
double Problem_Parameter::Inflow_veloc_magnitude = 0.0
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver code for moving bubble problem.

1273 {
1274 
1275  // Store command line arguments
1276  CommandLineArgs::setup(argc,argv);
1277 
1278  // Define possible command line arguments and parse the ones that
1279  // were actually specified
1280 
1281  // Validation?
1283 
1284  // Parse command line
1286 
1287  // Doc what has actually been specified on the command line
1289 
1290  // Create generalised Hookean constitutive equations
1293 
1294  // Open trace file
1295  Problem_Parameter::Trace_file.open("RESLT/trace.dat");
1296 
1297  // Increase precision of output
1298  Problem_Parameter::Trace_file.precision(20);
1299 
1300  // Open norm file
1301  Problem_Parameter::Norm_file.open("RESLT/norm.dat");
1302 
1303 
1304  // Create problem in initial configuration
1306  problem;
1307 
1308 
1309  // Output the problem's state with the bubble in its
1310  // initial polygonal representation
1311  problem.doc_solution();
1312 
1313  // Before starting the time-integration we want to "inflate" it to form
1314  // a proper circular bubble. We do this by setting the inflow to zero
1315  // and doing a steady solve (with one adaptation)
1317 
1318  problem.steady_newton_solve(1);
1319 
1320  // If all went well, this should show us a nice circular bubble
1321  // in a stationary fluid
1322  problem.doc_solution();
1323 
1324  // Initialise timestepper
1325  double dt=0.025;
1326  problem.initialise_dt(dt);
1327 
1328  // Perform impulsive start from current state
1329  problem.assign_initial_values_impulsive();
1330 
1331 
1332  // Now switch on the inflow and re-assign the boundary conditions
1333  // (Call to complete_problem_setup() is a bit expensive given that we
1334  // we only want to set the inflow velocity but who cares -- it's just
1335  // a one off.
1337  problem.complete_problem_setup();
1338 
1339 
1340  // Solve problem on fixed mesh
1341  unsigned nstep=6;
1343  {
1344  nstep=2;
1345  oomph_info << "Remeshing after every second step during validation\n";
1346  }
1347  for (unsigned i=0;i<nstep;i++)
1348  {
1349  // Solve the problem
1350  problem.unsteady_newton_solve(dt);
1351  problem.doc_solution();
1352  } // done solution on fixed mesh
1353 
1354 
1355  // Now do a proper loop, doing nstep timesteps before adapting/remeshing
1356  // and repeating the lot ncycle times
1357  unsigned ncycle=1000;
1359  {
1360  ncycle=1;
1361  oomph_info << "Only doing one cycle during validation\n";
1362  }
1363 
1364  // Do the cycles
1365  for(unsigned j=0;j<ncycle;j++)
1366  {
1367  // Allow up to one level of refinement for next solve
1368  unsigned max_adapt=1;
1369 
1370  //Solve problem a few times
1371  for (unsigned i=0;i<nstep;i++)
1372  {
1373  // Solve the problem
1374  problem.unsteady_newton_solve(dt,max_adapt,false);
1375 
1376 
1377  // Build the label for doc and output solution
1378  std::stringstream label;
1379  label << "Adaptation " <<j << " Step "<< i;
1380  problem.doc_solution(label.str());
1381 
1382  // No more refinement for the next nstep steps
1383  max_adapt=0;
1384  }
1385 
1386  }
1387 
1388 
1389 } //End of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Problem class to simulate inviscid bubble propagating along 2D channel.
Definition: adaptive_bubble_in_channel.cc:425
Definition: constitutive_laws.h:699
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
ofstream Norm_file
Definition: refineable_two_layer_interface.cc:341
ofstream Trace_file
Trace file.
Definition: refineable_two_layer_interface.cc:335
double Inflow_veloc_magnitude
Definition: adaptive_bubble_in_channel.cc:392
ConstitutiveLaw * Constitutive_law_pt
Constitutive law used to determine the mesh deformation.
Definition: jeffery_orbit.cc:82
double Nu
Pseudo-solid (mesh) Poisson ratio.
Definition: jeffery_orbit.cc:75
label
Definition: UniformPSDSelfTest.py:24
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::CommandLineArgs::command_line_flag_has_been_set(), Problem_Parameter::Constitutive_law_pt, oomph::CommandLineArgs::doc_specified_flags(), i, Problem_Parameter::Inflow_veloc_magnitude, j, UniformPSDSelfTest::label, Problem_Parameter::Norm_file, Problem_Parameter::Nu, oomph::oomph_info, oomph::CommandLineArgs::parse_and_assign(), problem, Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), and Problem_Parameter::Trace_file.