dd_convection.cc File Reference

Classes

class  ConvectionProblem< NST_ELEMENT, AD_ELEMENT >
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

int main (int argc, char **argv)
 Driver code for 2D Boussinesq convection problem. More...
 

Variables

double Global_Physical_Variables::Lewis = 10.0
 The Lewis number. More...
 
Vector< doubleGlobal_Physical_Variables::Diff (2, 1.0) = 1.0/Pe
 Double relative diffusivities. More...
 
double Global_Physical_Variables::Rayleigh_T = 1800.0
 
double Global_Physical_Variables::Rayleigh_S = -1000
 Solutal Rayleigh number. More...
 
double Global_Physical_Variables::Lambda = 1.414
 Length of domain. More...
 
Vector< doubleGlobal_Physical_Variables::Direction_of_gravity (2)
 Gravity vector. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Driver code for 2D Boussinesq convection problem.

363 {
364 
365  // Set the direction of gravity
368 
369  //Set the diffusivity of the solute to be the inverse Lewis number
371 
372  //Construct our problem
374 
375  // Apply the boundary condition at time zero
376  problem.set_boundary_conditions(0.0);
377 
378  //Perform a single steady Newton solve
379  problem.steady_newton_solve();
380 
381  //Document the solution
382  problem.doc_solution();
383 
384  //Start a trace file
385  ofstream trace("RESLT/trace.dat");
386  //Local variables for the kinetic energy and its rate of change
387  double E=0.0, Edot = 0.0;
388 
389 
390  //Output to the trace file
391  problem.get_kinetic_energy(E,Edot);
392  trace << problem.time_pt()->time() << " "
393  << problem.mesh_pt()->boundary_node_pt(1,8)->value(1) << " "
394  << E << " " << Edot << std::endl;
395 
396 
397  //Set the timestep
398  double dt = 0.01;
399 
400  //Initialise the value of the timestep and set an impulsive start
401  problem.assign_initial_values_impulsive(dt);
402 
403  //Set the number of timesteps to our default value
404  unsigned n_steps = 2000;
405 
406  //If we have a command line argument, perform fewer steps
407  //(used for self-test runs)
408  if(argc > 1) {n_steps = 5;}
409 
410  //Perform n_steps timesteps
411  for(unsigned i=0;i<n_steps;++i)
412  {
413  problem.unsteady_newton_solve(dt);
414  //Document the solution
415  problem.doc_solution();
416  //Output to the trace file
417  problem.get_kinetic_energy(E,Edot);
418  trace << problem.time_pt()->time() << " "
419  << problem.mesh_pt()->boundary_node_pt(1,8)->value(1) << " "
420  << E << " " << Edot << std::endl;
421 
422  }
423 
424  trace.close();
425 } // end of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: mpi/multi_domain/boussinesq_convection/multi_domain_boussinesq_convection.cc:75
double E
Elastic modulus.
Definition: TwenteMeshGluing.cpp:68
Vector< double > Diff(2, 1.0)
Double relative diffusivities.
Definition: rayleigh_instability_soluble_surfactant.cc:116
Vector< double > Direction_of_gravity(2)
Gravity vector.
double Lewis
The Lewis number.
Definition: dd_convection.cc:52
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References Global_Physical_Variables::Diff, oomph::Global_Physical_Variables::Direction_of_gravity, Global_Physical_Variables::E, i, Global_Physical_Variables::Lewis, and problem.