FlowAroundCylinderProblem< ELEMENT > Class Template Reference

Flow around a cylinder in rectangular domain. More...

+ Inheritance diagram for FlowAroundCylinderProblem< ELEMENT >:

Public Member Functions

Problemmake_copy ()
 Make a copy for using in bifurcation tracking. More...
 
 FlowAroundCylinderProblem (GeomObject *cylinder_pt, const double &length, const double &height)
 Constructor. More...
 
 ~FlowAroundCylinderProblem ()
 Destructor: clean up the memory. More...
 
void set_boundary_conditions ()
 
void actions_after_newton_solve ()
 Update the problem specs after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void actions_before_newton_solve ()
 
void actions_after_adapt ()
 After adaptation: Unpin pressure and pin redudant pressure dofs. More...
 
RefineableRectangleWithHoleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
Mesh *& mesh_pt (const unsigned &num)
 
 FlowAroundCylinderProblem (GeomObject *cylinder_pt, const double &length, const double &height)
 
 ~FlowAroundCylinderProblem ()
 Destructor: clean up the memory. More...
 
void set_boundary_conditions ()
 
void actions_after_newton_solve ()
 Update the problem specs after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void actions_before_newton_solve ()
 
void actions_after_adapt ()
 After adaptation: Unpin pressure and pin redudant pressure dofs. More...
 
RefineableRectangleWithHoleMesh< BASE_ELEMENT > * base_flow_mesh_pt ()
 Access function for the specific mesh. More...
 
RefineableRectangleWithHoleMesh< PERTURBED_ELEMENT > * eigenproblem_mesh_pt ()
 Return a pointer to the specific mesh used. More...
 
void add_eigenproblem ()
 
void set_eigenvalue (const double &real, const double &imag)
 
void pin_all_base_flow_dofs ()
 
void unpin_all_base_flow_dofs ()
 
void transfer_eigenfunction_as_initial_condition (DoubleVector &real, DoubleVector &imaginary)
 
void doc_solution ()
 
 FlowAroundCylinderProblem (GeomObject *cylinder_pt, const double &length, const double &height)
 
void actions_after_newton_solve ()
 Update the problem specs after solve (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_adapt ()
 After adaptation: Unpin pressure and pin redudant pressure dofs. More...
 
RefineableRectangleWithHoleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
 FlowAroundCylinderProblem ()
 Constructor: More...
 
 ~FlowAroundCylinderProblem ()
 Destructor: delete all dynamically allocated data. More...
 
void apply_boundary_conditions ()
 Apply boundary conditions. More...
 
void set_up_solver_and_preconditioner ()
 Set the chosen solver and preconditioner. More...
 
void unsteady_simulation ()
 Timestep the problem. More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve. More...
 
void actions_after_newton_solve ()
 Update the problem specs after solve (empty) More...
 
void actions_before_adapt ()
 Actions before adapt: empty. More...
 
void actions_after_adapt ()
 After adaptation: Unpin pressure and pin redundant pressure dofs. More...
 
void actions_before_implicit_timestep ()
 
void doc_solution (const bool &in_unsteady=false)
 Doc the solution. More...
 
void doc_trace_node_velocities_and_pressure ()
 
void dump_problem (char *filename) const
 Dump the entire problem. More...
 
void read_problem (char *restart_file)
 Read the entire problem. More...
 
- Public Member Functions inherited from oomph::Problem
virtual void debug_hook_fct (const unsigned &i)
 
void set_analytic_dparameter (double *const &parameter_pt)
 
void unset_analytic_dparameter (double *const &parameter_pt)
 
bool is_dparameter_calculated_analytically (double *const &parameter_pt)
 
void set_analytic_hessian_products ()
 
void unset_analytic_hessian_products ()
 
bool are_hessian_products_calculated_analytically ()
 
void set_pinned_values_to_zero ()
 
bool distributed () const
 
OomphCommunicatorcommunicator_pt ()
 access function to the oomph-lib communicator More...
 
const OomphCommunicatorcommunicator_pt () const
 access function to the oomph-lib communicator, const version More...
 
 Problem ()
 
 Problem (const Problem &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Problem &)=delete
 Broken assignment operator. More...
 
virtual ~Problem ()
 Virtual destructor to clean up memory. More...
 
Mesh *& mesh_pt ()
 Return a pointer to the global mesh. More...
 
Mesh *const & mesh_pt () const
 Return a pointer to the global mesh (const version) More...
 
Mesh *& mesh_pt (const unsigned &imesh)
 
Mesh *const & mesh_pt (const unsigned &imesh) const
 Return a pointer to the i-th submesh (const version) More...
 
unsigned nsub_mesh () const
 Return number of submeshes. More...
 
unsigned add_sub_mesh (Mesh *const &mesh_pt)
 
void flush_sub_meshes ()
 
void build_global_mesh ()
 
void rebuild_global_mesh ()
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
LinearSolver *& mass_matrix_solver_for_explicit_timestepper_pt ()
 
LinearSolvermass_matrix_solver_for_explicit_timestepper_pt () const
 
EigenSolver *& eigen_solver_pt ()
 Return a pointer to the eigen solver object. More...
 
EigenSolver *const & eigen_solver_pt () const
 Return a pointer to the eigen solver object (const version) More...
 
Time *& time_pt ()
 Return a pointer to the global time object. More...
 
Timetime_pt () const
 Return a pointer to the global time object (const version). More...
 
doubletime ()
 Return the current value of continuous time. More...
 
double time () const
 Return the current value of continuous time (const version) More...
 
TimeStepper *& time_stepper_pt ()
 
const TimeSteppertime_stepper_pt () const
 
TimeStepper *& time_stepper_pt (const unsigned &i)
 Return a pointer to the i-th timestepper. More...
 
ExplicitTimeStepper *& explicit_time_stepper_pt ()
 Return a pointer to the explicit timestepper. More...
 
unsigned long set_timestepper_for_all_data (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data=false)
 
virtual void shift_time_values ()
 Shift all values along to prepare for next timestep. More...
 
AssemblyHandler *& assembly_handler_pt ()
 Return a pointer to the assembly handler object. More...
 
AssemblyHandler *const & assembly_handler_pt () const
 Return a pointer to the assembly handler object (const version) More...
 
doubleminimum_dt ()
 Access function to min timestep in adaptive timestepping. More...
 
doublemaximum_dt ()
 Access function to max timestep in adaptive timestepping. More...
 
unsignedmax_newton_iterations ()
 Access function to max Newton iterations before giving up. More...
 
void problem_is_nonlinear (const bool &prob_lin)
 Access function to Problem_is_nonlinear. More...
 
doublemax_residuals ()
 
booltime_adaptive_newton_crash_on_solve_fail ()
 Access function for Time_adaptive_newton_crash_on_solve_fail. More...
 
doublenewton_solver_tolerance ()
 
void add_time_stepper_pt (TimeStepper *const &time_stepper_pt)
 
void set_explicit_time_stepper_pt (ExplicitTimeStepper *const &explicit_time_stepper_pt)
 
void initialise_dt (const double &dt)
 
void initialise_dt (const Vector< double > &dt)
 
Data *& global_data_pt (const unsigned &i)
 Return a pointer to the the i-th global data object. More...
 
void add_global_data (Data *const &global_data_pt)
 
void flush_global_data ()
 
LinearAlgebraDistribution *const & dof_distribution_pt () const
 Return the pointer to the dof distribution (read-only) More...
 
unsigned long ndof () const
 Return the number of dofs. More...
 
unsigned ntime_stepper () const
 Return the number of time steppers. More...
 
unsigned nglobal_data () const
 Return the number of global data values. More...
 
unsigned self_test ()
 Self-test: Check meshes and global data. Return 0 for OK. More...
 
void enable_store_local_dof_pt_in_elements ()
 
void disable_store_local_dof_pt_in_elements ()
 
unsigned long assign_eqn_numbers (const bool &assign_local_eqn_numbers=true)
 
void describe_dofs (std::ostream &out= *(oomph_info.stream_pt())) const
 
void enable_discontinuous_formulation ()
 
void disable_discontinuous_formulation ()
 
void get_dofs (DoubleVector &dofs) const
 
void get_dofs (const unsigned &t, DoubleVector &dofs) const
 Return vector of the t'th history value of all dofs. More...
 
void set_dofs (const DoubleVector &dofs)
 Set the values of the dofs. More...
 
void set_dofs (const unsigned &t, DoubleVector &dofs)
 Set the history values of the dofs. More...
 
void set_dofs (const unsigned &t, Vector< double * > &dof_pt)
 
void add_to_dofs (const double &lambda, const DoubleVector &increment_dofs)
 Add lambda x incremenet_dofs[l] to the l-th dof. More...
 
doubleglobal_dof_pt (const unsigned &i)
 
doubledof (const unsigned &i)
 i-th dof in the problem More...
 
double dof (const unsigned &i) const
 i-th dof in the problem (const version) More...
 
double *& dof_pt (const unsigned &i)
 Pointer to i-th dof in the problem. More...
 
doubledof_pt (const unsigned &i) const
 Pointer to i-th dof in the problem (const version) More...
 
virtual void get_inverse_mass_matrix_times_residuals (DoubleVector &Mres)
 
virtual void get_dvaluesdt (DoubleVector &f)
 
virtual void get_residuals (DoubleVector &residuals)
 Get the total residuals Vector for the problem. More...
 
virtual void get_jacobian (DoubleVector &residuals, DenseDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CRDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CCDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, SumOfMatrices &jacobian)
 
void get_fd_jacobian (DoubleVector &residuals, DenseMatrix< double > &jacobian)
 Get the full Jacobian by finite differencing. More...
 
void get_derivative_wrt_global_parameter (double *const &parameter_pt, DoubleVector &result)
 
void get_hessian_vector_products (DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &steady=true)
 Solve the eigenproblem. More...
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, const bool &steady=true)
 
virtual void get_eigenproblem_matrices (CRDoubleMatrix &mass_matrix, CRDoubleMatrix &main_matrix, const double &shift=0.0)
 
void assign_eigenvector_to_dofs (DoubleVector &eigenvector)
 Assign the eigenvector passed to the function to the dofs. More...
 
void add_eigenvector_to_dofs (const double &epsilon, const DoubleVector &eigenvector)
 
void store_current_dof_values ()
 Store the current values of the degrees of freedom. More...
 
void restore_dof_values ()
 Restore the stored values of the degrees of freedom. More...
 
void enable_jacobian_reuse ()
 
void disable_jacobian_reuse ()
 Disable recycling of Jacobian in Newton iteration. More...
 
bool jacobian_reuse_is_enabled ()
 Is recycling of Jacobian in Newton iteration enabled? More...
 
booluse_predictor_values_as_initial_guess ()
 
void newton_solve ()
 Use Newton method to solve the problem. More...
 
void enable_globally_convergent_newton_method ()
 enable globally convergent Newton method More...
 
void disable_globally_convergent_newton_method ()
 disable globally convergent Newton method More...
 
void newton_solve (unsigned const &max_adapt)
 
void steady_newton_solve (unsigned const &max_adapt=0)
 
void copy (Problem *orig_problem_pt)
 
virtual void read (std::ifstream &restart_file, bool &unsteady_restart)
 
virtual void read (std::ifstream &restart_file)
 
virtual void dump (std::ofstream &dump_file) const
 
void dump (const std::string &dump_file_name) const
 
void delete_all_external_storage ()
 
virtual void symmetrise_eigenfunction_for_adaptive_pitchfork_tracking ()
 
doublebifurcation_parameter_pt () const
 
void get_bifurcation_eigenfunction (Vector< DoubleVector > &eigenfunction)
 
void activate_fold_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const DoubleVector &normalisation, const bool &block_solve=true)
 
void activate_pitchfork_tracking (double *const &parameter_pt, const DoubleVector &symmetry_vector, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const double &omega, const DoubleVector &null_real, const DoubleVector &null_imag, const bool &block_solve=true)
 
void deactivate_bifurcation_tracking ()
 
void reset_assembly_handler_to_default ()
 Reset the system to the standard non-augemented state. More...
 
double arc_length_step_solve (double *const &parameter_pt, const double &ds, const unsigned &max_adapt=0)
 
double arc_length_step_solve (Data *const &data_pt, const unsigned &data_index, const double &ds, const unsigned &max_adapt=0)
 
void reset_arc_length_parameters ()
 
intsign_of_jacobian ()
 
void explicit_timestep (const double &dt, const bool &shift_values=true)
 Take an explicit timestep of size dt. More...
 
void unsteady_newton_solve (const double &dt)
 
void unsteady_newton_solve (const double &dt, const bool &shift_values)
 
void unsteady_newton_solve (const double &dt, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const unsigned &suppress_resolve_after_spatial_adapt_flag, const bool &first, const bool &shift=true)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon, const bool &shift_values)
 
void assign_initial_values_impulsive ()
 
void assign_initial_values_impulsive (const double &dt)
 
void calculate_predictions ()
 Calculate predictions. More...
 
void enable_mass_matrix_reuse ()
 
void disable_mass_matrix_reuse ()
 
bool mass_matrix_reuse_is_enabled ()
 Return whether the mass matrix is being reused. More...
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly (DocInfo &doc_info)
 
void refine_uniformly_and_prune (DocInfo &doc_info)
 
void refine_uniformly ()
 
void refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform refinement for submesh i_mesh with documentation. More...
 
void refine_uniformly (const unsigned &i_mesh)
 Do uniform refinement for submesh i_mesh without documentation. More...
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly (DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (DocInfo &doc_info)
 
void p_refine_uniformly ()
 
void p_refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-refinement for submesh i_mesh with documentation. More...
 
void p_refine_uniformly (const unsigned &i_mesh)
 Do uniform p-refinement for submesh i_mesh without documentation. More...
 
void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void refine_selected_elements (const Vector< Vector< RefineableElement * >> &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< Vector< PRefineableElement * >> &elements_to_be_refined_pt)
 
unsigned unrefine_uniformly ()
 
unsigned unrefine_uniformly (const unsigned &i_mesh)
 
void p_unrefine_uniformly (DocInfo &doc_info)
 
void p_unrefine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-unrefinement for submesh i_mesh without documentation. More...
 
void adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void adapt ()
 
void p_adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void p_adapt ()
 
void adapt_based_on_error_estimates (unsigned &n_refined, unsigned &n_unrefined, Vector< Vector< double >> &elemental_error)
 
void adapt_based_on_error_estimates (Vector< Vector< double >> &elemental_error)
 
void get_all_error_estimates (Vector< Vector< double >> &elemental_error)
 
void doc_errors (DocInfo &doc_info)
 Get max and min error for all elements in submeshes. More...
 
void doc_errors ()
 Get max and min error for all elements in submeshes. More...
 
void enable_info_in_newton_solve ()
 
void disable_info_in_newton_solve ()
 Disable the output of information when in the newton solver. More...
 
- Public Member Functions inherited from oomph::ExplicitTimeSteppableObject
 ExplicitTimeSteppableObject ()
 Empty constructor. More...
 
 ExplicitTimeSteppableObject (const ExplicitTimeSteppableObject &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeSteppableObject &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeSteppableObject ()
 Empty destructor. More...
 
virtual void actions_before_explicit_stage ()
 
virtual void actions_after_explicit_stage ()
 

Private Types

enum  {
  Lower_wall_boundary_id =0 , Outflow_boundary_id =1 , Upper_wall_boundary_id =2 , Inflow_boundary_id =3 ,
  Cylinder_surface_boundary_id =4
}
 

Private Attributes

double Domain_height
 Height of the domain. More...
 
double Domain_length
 Length of the domain. More...
 
GeomObjectCylinder_pt
 The geometric cylinder. More...
 
bool Eigenproblem_flag
 
MeshBase_flow_mesh_pt
 
MeshEigenproblem_mesh_pt
 
MeshNormalisation_mesh_pt
 
RefineableQuadMeshWithMovingCylinder< ELEMENT > * Bulk_mesh_pt
 Pointer to the mesh with oscillating cylinder. More...
 
IterativeLinearSolverSolver_pt
 Oomph-lib iterative linear solver. More...
 
NavierStokesSchurComplementPreconditionerPrec_pt
 LSC Preconditioner for the linear solve. More...
 
PreconditionerF_matrix_preconditioner_pt
 Inexact solver for F block. More...
 

Additional Inherited Members

- Public Types inherited from oomph::Problem
typedef void(* SpatialErrorEstimatorFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error)
 Function pointer for spatial error estimator. More...
 
typedef void(* SpatialErrorEstimatorWithDocFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error, DocInfo &doc_info)
 Function pointer for spatial error estimator with doc. More...
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 
- Static Public Attributes inherited from oomph::Problem
static bool Suppress_warning_about_actions_before_read_unstructured_meshes
 
- Protected Types inherited from oomph::Problem
enum  Assembly_method {
  Perform_assembly_using_vectors_of_pairs , Perform_assembly_using_two_vectors , Perform_assembly_using_maps , Perform_assembly_using_lists ,
  Perform_assembly_using_two_arrays
}
 Enumerated flags to determine which sparse assembly method is used. More...
 
- Protected Member Functions inherited from oomph::Problem
unsigned setup_element_count_per_dof ()
 
virtual void sparse_assemble_row_or_column_compressed (Vector< int * > &column_or_row_index, Vector< int * > &row_or_column_start, Vector< double * > &value, Vector< unsigned > &nnz, Vector< double * > &residual, bool compressed_row_flag)
 
virtual void actions_before_newton_step ()
 
virtual void actions_after_newton_step ()
 
virtual void actions_after_implicit_timestep ()
 
virtual void actions_after_implicit_timestep_and_error_estimation ()
 
virtual void actions_before_explicit_timestep ()
 Actions that should be performed before each explicit time step. More...
 
virtual void actions_after_explicit_timestep ()
 Actions that should be performed after each explicit time step. More...
 
virtual void actions_before_read_unstructured_meshes ()
 
virtual void actions_after_read_unstructured_meshes ()
 
virtual void actions_after_change_in_global_parameter (double *const &parameter_pt)
 
virtual void actions_after_change_in_bifurcation_parameter ()
 
virtual void actions_after_parameter_increase (double *const &parameter_pt)
 
doubledof_derivative (const unsigned &i)
 
doubledof_current (const unsigned &i)
 
virtual void set_initial_condition ()
 
virtual double global_temporal_error_norm ()
 
unsigned newton_solve_continuation (double *const &parameter_pt)
 
unsigned newton_solve_continuation (double *const &parameter_pt, DoubleVector &z)
 
void calculate_continuation_derivatives (double *const &parameter_pt)
 
void calculate_continuation_derivatives (const DoubleVector &z)
 
void calculate_continuation_derivatives_fd (double *const &parameter_pt)
 
bool does_pointer_correspond_to_problem_data (double *const &parameter_pt)
 
void set_consistent_pinned_values_for_continuation ()
 
- Protected Attributes inherited from oomph::Problem
Vector< Problem * > Copy_of_problem_pt
 
std::map< double *, boolCalculate_dparameter_analytic
 
bool Calculate_hessian_products_analytic
 
LinearAlgebraDistributionDof_distribution_pt
 
Vector< double * > Dof_pt
 Vector of pointers to dofs. More...
 
DoubleVectorWithHaloEntries Element_count_per_dof
 
double Relaxation_factor
 
double Newton_solver_tolerance
 
unsigned Max_newton_iterations
 Maximum number of Newton iterations. More...
 
unsigned Nnewton_iter_taken
 
Vector< doubleMax_res
 Maximum residuals at start and after each newton iteration. More...
 
double Max_residuals
 
bool Time_adaptive_newton_crash_on_solve_fail
 
bool Jacobian_reuse_is_enabled
 Is re-use of Jacobian in Newton iteration enabled? Default: false. More...
 
bool Jacobian_has_been_computed
 
bool Problem_is_nonlinear
 
bool Pause_at_end_of_sparse_assembly
 
bool Doc_time_in_distribute
 
unsigned Sparse_assembly_method
 
unsigned Sparse_assemble_with_arrays_initial_allocation
 
unsigned Sparse_assemble_with_arrays_allocation_increment
 
Vector< Vector< unsigned > > Sparse_assemble_with_arrays_previous_allocation
 
double Numerical_zero_for_sparse_assembly
 
double FD_step_used_in_get_hessian_vector_products
 
bool Mass_matrix_reuse_is_enabled
 
bool Mass_matrix_has_been_computed
 
bool Discontinuous_element_formulation
 
double Minimum_dt
 Minimum desired dt: if dt falls below this value, exit. More...
 
double Maximum_dt
 Maximum desired dt. More...
 
double DTSF_max_increase
 
double DTSF_min_decrease
 
double Minimum_dt_but_still_proceed
 
bool Scale_arc_length
 Boolean to control whether arc-length should be scaled. More...
 
double Desired_proportion_of_arc_length
 Proportion of the arc-length to taken by the parameter. More...
 
double Theta_squared
 
int Sign_of_jacobian
 Storage for the sign of the global Jacobian. More...
 
double Continuation_direction
 
double Parameter_derivative
 Storage for the derivative of the global parameter wrt arc-length. More...
 
double Parameter_current
 Storage for the present value of the global parameter. More...
 
bool Use_continuation_timestepper
 Boolean to control original or new storage of dof stuff. More...
 
unsigned Dof_derivative_offset
 
unsigned Dof_current_offset
 
Vector< doubleDof_derivative
 Storage for the derivative of the problem variables wrt arc-length. More...
 
Vector< doubleDof_current
 Storage for the present values of the variables. More...
 
double Ds_current
 Storage for the current step value. More...
 
unsigned Desired_newton_iterations_ds
 
double Minimum_ds
 Minimum desired value of arc-length. More...
 
bool Bifurcation_detection
 Boolean to control bifurcation detection via determinant of Jacobian. More...
 
bool Bisect_to_find_bifurcation
 Boolean to control wheter bisection is used to located bifurcation. More...
 
bool First_jacobian_sign_change
 Boolean to indicate whether a sign change has occured in the Jacobian. More...
 
bool Arc_length_step_taken
 Boolean to indicate whether an arc-length step has been taken. More...
 
bool Use_finite_differences_for_continuation_derivatives
 
OomphCommunicatorCommunicator_pt
 The communicator for this problem. More...
 
bool Always_take_one_newton_step
 
double Timestep_reduction_factor_after_nonconvergence
 
bool Keep_temporal_error_below_tolerance
 
- Static Protected Attributes inherited from oomph::Problem
static ContinuationStorageScheme Continuation_time_stepper
 Storage for the single static continuation timestorage object. More...
 

Detailed Description

template<class ELEMENT>
class FlowAroundCylinderProblem< ELEMENT >

Flow around a cylinder in rectangular domain.

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

Member Enumeration Documentation

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private
Enumerator
Lower_wall_boundary_id 
Outflow_boundary_id 
Upper_wall_boundary_id 
Inflow_boundary_id 
Cylinder_surface_boundary_id 
491  {
497  };
@ Outflow_boundary_id
Definition: flow_past_oscillating_cylinder.cc:493
@ Cylinder_surface_boundary_id
Definition: flow_past_oscillating_cylinder.cc:496
@ Upper_wall_boundary_id
Definition: flow_past_oscillating_cylinder.cc:494
@ Lower_wall_boundary_id
Definition: flow_past_oscillating_cylinder.cc:492
@ Inflow_boundary_id
Definition: flow_past_oscillating_cylinder.cc:495

Constructor & Destructor Documentation

◆ FlowAroundCylinderProblem() [1/4]

template<class ELEMENT >
FlowAroundCylinderProblem< ELEMENT >::FlowAroundCylinderProblem ( GeomObject cylinder_pt,
const double length,
const double height 
)

Constructor.

Constructor: Pass geometric object that represents central cylinder, and length and height of domain.

1183  :
1184  Domain_height(height), Domain_length(length), Cylinder_pt(cylinder_pt)
1185 
1186 {
1187  //Increase the maximum residuals so that we can get convergence on
1188  //the coarsest mesh
1189  Max_residuals = 100.0;
1190 
1192  {
1193  this->eigen_solver_pt() = new ARPACK;
1194  static_cast<ARPACK*>(eigen_solver_pt())->set_shift(50.0);
1195  static_cast<ARPACK*>(eigen_solver_pt())->narnoldi() = 70;
1196  }
1197 
1198  // Build mesh
1199  Problem::mesh_pt()=
1200  new RefineableRectangleWithHoleMesh<ELEMENT>(cylinder_pt,length,height);
1201 
1202  // Set error estimator
1204  mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
1205 
1206  // Pin redudant pressure dofs
1208  pin_redundant_nodal_pressures(mesh_pt()->element_pt());
1209 
1210  //Make the problem conventional form, so
1211  //that the natural boundary condition is pseudo-traction-free
1214 
1215  using namespace Global_Parameters;
1216 
1217  // Pass pointer to Reynolds number to elements
1218  unsigned nelem=mesh_pt()->nelement();
1219  for (unsigned e=0;e<nelem;e++)
1220  {
1221  dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e))->re_pt()= &Re;
1222  dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e))->re_st_pt()=&Re;
1223  }
1224 }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double Domain_height
Height of the domain.
Definition: adaptive_hopf.cc:1164
GeomObject * Cylinder_pt
The geometric cylinder.
Definition: adaptive_hopf.cc:1170
RefineableRectangleWithHoleMesh< ELEMENT > * mesh_pt()
Access function for the specific mesh.
Definition: adaptive_hopf.cc:1150
double Domain_length
Length of the domain.
Definition: adaptive_hopf.cc:1167
Class for the ARPACK eigensolver.
Definition: eigen_solver.h:104
Definition: navier_stokes_elements.h:395
EigenSolver *& eigen_solver_pt()
Return a pointer to the eigen solver object.
Definition: problem.h:1492
double Max_residuals
Definition: problem.h:610
Definition: refineable_navier_stokes_elements.h:322
Definition: rectangle_with_hole_mesh.template.h:257
Definition: error_estimator.h:266
Namespace for global parameters.
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:44
bool Read_in_eigenfunction_from_disk
Definition: adaptive_hopf.cc:65
double Re
reynolds number
Definition: adaptive_hopf.cc:54
double height(const double &x)
Height of domain.
Definition: simple_spine_channel.cc:429
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190

References e(), oomph::Problem::eigen_solver_pt(), MeshRefinement::error_estimator_pt, Global_Physical_Variables::height(), oomph::Problem::Max_residuals, FlowAroundCylinderProblem< ELEMENT >::mesh_pt(), Global_Parameters::Re, and Global_Parameters::Read_in_eigenfunction_from_disk.

◆ ~FlowAroundCylinderProblem() [1/3]

template<class ELEMENT >
FlowAroundCylinderProblem< ELEMENT >::~FlowAroundCylinderProblem

Destructor: clean up the memory.

The destructor. Delete all dynamically allocated data.

Destructor clean up all memory allocated in the problem.

1231 {
1232  //Delete the error estimator
1233  delete mesh_pt()->spatial_error_estimator_pt();
1234  //Delete the mesh
1235  delete Problem::mesh_pt();
1236 }

References FlowAroundCylinderProblem< ELEMENT >::mesh_pt().

◆ FlowAroundCylinderProblem() [2/4]

template<class ELEMENT >
FlowAroundCylinderProblem< ELEMENT >::FlowAroundCylinderProblem ( GeomObject cylinder_pt,
const double length,
const double height 
)

Constructor: Pass geometric object that represents central cylinder, and length and height of domain.

◆ ~FlowAroundCylinderProblem() [2/3]

template<class ELEMENT >
FlowAroundCylinderProblem< ELEMENT >::~FlowAroundCylinderProblem ( )

Destructor: clean up the memory.

◆ FlowAroundCylinderProblem() [3/4]

template<class ELEMENT >
FlowAroundCylinderProblem< ELEMENT >::FlowAroundCylinderProblem ( GeomObject cylinder_pt,
const double length,
const double height 
)

Constructor: Pass geometric object that represents central cylinder, and length and height of domain.

◆ FlowAroundCylinderProblem() [4/4]

template<class ELEMENT >
FlowAroundCylinderProblem< ELEMENT >::FlowAroundCylinderProblem

Constructor:

Constructor.

505  :
506  Bulk_mesh_pt(0),
507  Solver_pt(0),
508  Prec_pt(0),
510 {
511  // Use BDF2
513 
514  // Indicate that we're solving a steady problem
516 
517  //-----------------
518  // Set up the mesh:
519  //-----------------
520  // Create a OscillatingCylinder object to define the cylinder motion
524  time_pt());
525 
526  // Make a new mesh and assign its pointer
534  time_stepper_pt());
535 
536  // Now assign its pointer
537  Problem::mesh_pt()=Bulk_mesh_pt;
538 
539  // Set the error estimator: incase we want to use adaptive mesh refinement
540  Bulk_mesh_pt->spatial_error_estimator_pt()=new Z2ErrorEstimator;
541 
542  // No limit on the number of refinements
543  Bulk_mesh_pt->max_refinement_level()=100;
544 
545  // Set the maximum error bound
546  Bulk_mesh_pt->max_permitted_error()=1.0e-04;
547 
548  // Set the minimum error bound
549  Bulk_mesh_pt->min_permitted_error()=1.0e-08;
550 
551  //-----------------------------
552  // Set the boundary conditions:
553  //-----------------------------
554  // Apply the boundary conditions
556 
557  //-----------------------------------------------------------------
558  // Complete the build of all elements so they are fully functional:
559  //-----------------------------------------------------------------
560  // Make it pseudo-traction-free
563 
564  // Pin redundant pressure dofs
567 
568  // How many elements are there in the mesh?
569  unsigned n_element=Bulk_mesh_pt->nelement();
570 
571  // Loop over the elements in the mesh
572  for (unsigned e=0; e<n_element; e++)
573  {
574  // Upcast the e-th element in the mesh
575  ELEMENT* el_pt=dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(e));
576 
577  // Set the Reynolds number pointer
578  el_pt->re_pt()=&GlobalParameters::Re;
579 
580  // Set the Womersley number (same as Re since St=1) pointer
581  el_pt->re_st_pt()=&GlobalParameters::ReSt;
582  }
583 
584  // Attach the boundary conditions to the mesh
585  oomph_info << "Number of equations: " << assign_eqn_numbers() << std::endl;
586 } // End of FlowAroundCylinderProblem
Preconditioner * F_matrix_preconditioner_pt
Inexact solver for F block.
Definition: flow_past_oscillating_cylinder.cc:487
RefineableQuadMeshWithMovingCylinder< ELEMENT > * Bulk_mesh_pt
Pointer to the mesh with oscillating cylinder.
Definition: flow_past_oscillating_cylinder.cc:478
IterativeLinearSolver * Solver_pt
Oomph-lib iterative linear solver.
Definition: flow_past_oscillating_cylinder.cc:481
void apply_boundary_conditions()
Apply boundary conditions.
Definition: flow_past_oscillating_cylinder.cc:649
NavierStokesSchurComplementPreconditioner * Prec_pt
LSC Preconditioner for the linear solve.
Definition: flow_past_oscillating_cylinder.cc:484
Oscillating cylinder class.
Definition: extrude_with_macro_element_representation.cc:46
void add_time_stepper_pt(TimeStepper *const &time_stepper_pt)
Definition: problem.cc:1545
Time *& time_pt()
Return a pointer to the global time object.
Definition: problem.h:1504
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
TimeStepper *& time_stepper_pt()
Definition: problem.h:1524
My Mesh.
Definition: rectangle_with_moving_cylinder_mesh.template.h:322
void make_steady()
Definition: timesteppers.h:374
double Height
Height of domain.
Definition: flow_past_oscillating_cylinder.cc:316
double Annular_region_radius
The radius of the annular region surrounding the cylinder.
Definition: extrude_with_macro_element_representation.cc:271
double Radius
Radius of the cylinder.
Definition: extrude_with_macro_element_representation.cc:251
OscillatingCylinder * Cylinder_pt
---------------------------------—TIME-INTEGRATION PARAMETERS---—
Definition: extrude_with_macro_element_representation.cc:248
double Amplitude
Amplitude of the cylinder motion.
Definition: extrude_with_macro_element_representation.cc:254
double X_left
X-coordinate of upstream end of domain.
Definition: flow_past_oscillating_cylinder.cc:319
double Re
Reynolds number.
Definition: extrude_triangle_generated_mesh.cc:48
double ReSt
The Womersley number.
Definition: flow_past_oscillating_cylinder.cc:226
double Length_of_central_box
Side-length of the square box in the mesh surrounding the cylinder.
Definition: flow_past_oscillating_cylinder.cc:325
double X_right
X-coordinate of downstream end of domain.
Definition: flow_past_oscillating_cylinder.cc:322
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References oomph::Problem::add_time_stepper_pt(), GlobalParameters::Amplitude, GlobalParameters::Annular_region_radius, FlowAroundCylinderProblem< ELEMENT >::apply_boundary_conditions(), oomph::Problem::assign_eqn_numbers(), FlowAroundCylinderProblem< ELEMENT >::Bulk_mesh_pt, GlobalParameters::Cylinder_pt, e(), GlobalParameters::Height, GlobalParameters::Length_of_central_box, oomph::TimeStepper::make_steady(), oomph::oomph_info, GlobalParameters::Radius, GlobalParameters::Re, GlobalParameters::ReSt, oomph::Problem::time_pt(), oomph::Problem::time_stepper_pt(), GlobalParameters::X_left, and GlobalParameters::X_right.

◆ ~FlowAroundCylinderProblem() [3/3]

template<class ELEMENT >
FlowAroundCylinderProblem< ELEMENT >::~FlowAroundCylinderProblem ( )

Destructor: delete all dynamically allocated data.

Member Function Documentation

◆ actions_after_adapt() [1/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_adapt
inlinevirtual

After adaptation: Unpin pressure and pin redudant pressure dofs.

Actions after adaptation. Upin pressure dofs, pin all redundant pressure dofs, apply boundary conditions and pin the smoothed vorticity in any newly created elements.

Reimplemented from oomph::Problem.

1122  {
1123  //Pin both velocities at all boundaries
1124  //This is required in case the automatic stuff goes wrong
1125  unsigned num_bound = mesh_pt()->nboundary();
1126  for(unsigned ibound=0;ibound<num_bound;ibound++)
1127  {
1128  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
1129  for (unsigned inod=0;inod<num_nod;inod++)
1130  {
1131  // Parallel, axially traction free outflow at downstream end
1132  if (ibound != 1)
1133  {
1134  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
1135  mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
1136  }
1137  }
1138  }
1139 
1140  // Unpin all pressure dofs
1142  unpin_all_pressure_dofs(mesh_pt()->element_pt());
1143 
1144  // Pin redundant pressure dofs
1146  pin_redundant_nodal_pressures(mesh_pt()->element_pt());
1147  }

References oomph::RefineableNavierStokesEquations< DIM >::pin_redundant_nodal_pressures(), and oomph::RefineableNavierStokesEquations< DIM >::unpin_all_pressure_dofs().

◆ actions_after_adapt() [2/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_adapt ( )
inlinevirtual

After adaptation: Unpin pressure and pin redudant pressure dofs.

Reimplemented from oomph::Problem.

1209  {
1210  //Pin both velocities at all boundaries
1211  //This is required in case the automatic stuff goes wrong
1212  unsigned num_bound = Base_flow_mesh_pt->nboundary();
1213  for(unsigned ibound=0;ibound<num_bound;ibound++)
1214  {
1215  unsigned num_nod= Base_flow_mesh_pt->nboundary_node(ibound);
1216  for (unsigned inod=0;inod<num_nod;inod++)
1217  {
1218  // Parallel, axially traction free outflow at downstream end
1219  if (ibound != 1)
1220  {
1221  Base_flow_mesh_pt->boundary_node_pt(ibound,inod)->pin(0);
1222  Base_flow_mesh_pt->boundary_node_pt(ibound,inod)->pin(1);
1223  }
1224  }
1225  }
1226 
1227  // Unpin all pressure dofs
1230 
1231  // Pin redundant pressure dofs
1234 
1235  if(Eigenproblem_flag)
1236  {
1237  // Unpin all pressure dofs
1238  RefineableLinearisedNavierStokesEquations::
1239  unpin_all_pressure_dofs(Eigenproblem_mesh_pt->element_pt());
1240 
1241  // Pin redudant pressure dofs
1242  RefineableLinearisedNavierStokesEquations::
1243  pin_redundant_nodal_pressures(Eigenproblem_mesh_pt->element_pt());
1244 
1245  // First interaction (base state velocities)
1246  Multi_domain_functions::
1247  setup_multi_domain_interaction<BASE_ELEMENT>
1249 
1250  // Second interaction (base state velocity derivatives w.r.t. space)
1251  Multi_domain_functions::
1252  setup_multi_domain_interaction<BASE_ELEMENT>
1254 
1255  //Reset the boundary conditions to be safe
1256  this->set_boundary_conditions();
1257 
1258  //Loop over all the (fluid) elements
1259  unsigned n_element = Eigenproblem_mesh_pt->nelement();
1260  for(unsigned e=0;e<n_element;e++)
1261  {
1262  //Cast to the particular element type, this is necessary because
1263  //the base elements don't have the member functions that we're about
1264  //to call!
1265  PERTURBED_ELEMENT *el_pt =
1266  dynamic_cast<PERTURBED_ELEMENT*>(Eigenproblem_mesh_pt->element_pt(e));
1267 
1268  //Pin the pressure normalisation dofs (can't be handled automatically
1269  //because it's a choice we've made)
1270  el_pt->pin_pressure_normalisation_dofs();
1271  }
1272 
1273  {
1274  //Pull out a pointer to the Reynolds number
1275  double* local_re_pt = Normalisation_mesh_pt->element_pt(0)
1276  ->internal_data_pt(0)->value_pt(2);
1277 
1278  // Pass pointer to Reynolds number to elements
1279  unsigned nelem=Base_flow_mesh_pt->nelement();
1280  for (unsigned e=0;e<nelem;e++)
1281  {
1282  BASE_ELEMENT* el_pt =
1283  dynamic_cast<BASE_ELEMENT*>(Base_flow_mesh_pt->element_pt(e));
1284 
1285  //Set the Reynolds number for each element
1286  //(yes we could have different Reynolds number in each element!!)
1287  el_pt->re_pt() = local_re_pt;//&Re;
1288 
1289  //Set the product of Reynolds and Strouhal numbers
1290  el_pt->re_st_pt() = local_re_pt; //&Re;
1291 
1292  //and add as external data
1293  el_pt->add_external_data(
1295  }
1296  }
1297  }
1298 
1299  }
bool Eigenproblem_flag
Definition: adaptive_hopf_with_separate_meshes.cc:1088
Mesh * Normalisation_mesh_pt
Definition: adaptive_hopf_with_separate_meshes.cc:1711
void set_boundary_conditions()
Definition: adaptive_hopf.cc:1065
Mesh * Eigenproblem_mesh_pt
Definition: adaptive_hopf_with_separate_meshes.cc:1709
Mesh * Base_flow_mesh_pt
Definition: adaptive_hopf_with_separate_meshes.cc:1707
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
double * value_pt(const unsigned &i) const
Definition: nodes.h:324
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition: mesh.h:833
unsigned nboundary() const
Return number of boundaries.
Definition: mesh.h:827
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Definition: mesh.h:493
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590

References e(), oomph::RefineableLinearisedNavierStokesEquations::pin_redundant_nodal_pressures(), oomph::RefineableNavierStokesEquations< DIM >::pin_redundant_nodal_pressures(), oomph::RefineableLinearisedNavierStokesEquations::unpin_all_pressure_dofs(), and oomph::RefineableNavierStokesEquations< DIM >::unpin_all_pressure_dofs().

◆ actions_after_adapt() [3/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_adapt ( )
inlinevirtual

After adaptation: Unpin pressure and pin redudant pressure dofs.

Reimplemented from oomph::Problem.

996  {
997  // Unpin all pressure dofs
999  unpin_all_pressure_dofs(mesh_pt()->element_pt());
1000 
1001  // Pin redundant pressure dofs
1003  pin_redundant_nodal_pressures(mesh_pt()->element_pt());
1004 
1005  // Now set the first pressure dof in the last element to 0.0
1006  dynamic_cast<ELEMENT*>(mesh_pt()->element_pt((mesh_pt()->nelement())-1))->
1007  fix_pressure(0,0.0);
1008 
1009  // update the parabolic tangential inflow velocity
1010  //double height=0.41/0.1;
1011  unsigned ibound=3;
1012  double ycoord,uy;
1013  double um = 0.3;
1014  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
1015  for (unsigned inod=0;inod<num_nod;inod++)
1016  {
1017  ycoord = mesh_pt()->boundary_node_pt(ibound,inod)->x(1);
1018  uy = 1./0.2*4.0*um*ycoord*(Domain_height-ycoord)/
1020 
1021  // Tangential flow
1022  mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,uy);
1023  }
1024 
1025 
1026  } // end_of_actions_after_adapt

◆ actions_after_adapt() [4/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_adapt ( )
virtual

After adaptation: Unpin pressure and pin redundant pressure dofs.

Reimplemented from oomph::Problem.

◆ actions_after_newton_solve() [1/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_newton_solve ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

1110 {}

◆ actions_after_newton_solve() [2/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_newton_solve ( )
inlinevirtual

Update the problem specs after solve (empty)

Report the eigenvalue

Reimplemented from oomph::Problem.

1182  {
1183  //Dump out the eigenvalue
1184  if(Eigenproblem_flag)
1185  {
1187  std::cout << "Eigenvalue is " <<
1189  << " + " <<
1191  << "I\n";
1192 
1193  std::cout << "Critical Reynolds number is " <<
1195  << "\n";
1196  }
1197  }
double value(const unsigned &i) const
Definition: nodes.h:293

◆ actions_after_newton_solve() [3/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_newton_solve ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

986 {}

◆ actions_after_newton_solve() [4/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_after_newton_solve ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

449 {}

◆ actions_before_adapt()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_adapt ( )
inlinevirtual

Actions before adapt: empty.

Reimplemented from oomph::Problem.

452 {}

◆ actions_before_implicit_timestep()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_implicit_timestep
virtual

Actions to complete before an implicit timestep: Provide a perturbation to the solution

Actions before implicit timestep: Update the nodal positions and update the no-slip condition on the cylinder boundary

Reimplemented from oomph::Problem.

842 {
843  // Update the domain shape
844  Bulk_mesh_pt->node_update();
845 
846  // ID of the cylinder boundary
847  unsigned b=4;
848 
849  // Find the number of nodes on the cylinder boundary
850  unsigned num_nod=Bulk_mesh_pt->nboundary_node(b);
851 
852  // Cylinder boundary: No slip; this implies that the velocity needs to be
853  // updated in response to wall motion
854  for (unsigned n=0; n<num_nod; n++)
855  {
856  // Which node are we dealing with?
857  Node* node_pt=Bulk_mesh_pt->boundary_node_pt(b,n);
858 
859  // Apply no slip
861  }
862 } // End of actions_before_implicit_timestep()
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Scalar * b
Definition: benchVecAdd.cpp:17
Definition: nodes.h:906
void apply_no_slip_on_moving_wall(Node *node_pt)
Definition: fsi.cc:48

References oomph::FSI_functions::apply_no_slip_on_moving_wall(), b, and n.

◆ actions_before_newton_convergence_check() [1/2]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_newton_convergence_check ( )
inlinevirtual

Any actions that are to be performed before the residual is checked in the Newton method, e.g. update any boundary conditions that depend upon variables of the problem; update any ‘dependent’ variables; or perform an update of the nodal positions in SpineMeshes etc. CAREFUL: This step should (and if the FD-based LinearSolver FD_LU is used, must) only update values that are pinned!

Reimplemented from oomph::Problem.

◆ actions_before_newton_convergence_check() [2/2]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_newton_convergence_check ( )
inlinevirtual

Any actions that are to be performed before the residual is checked in the Newton method, e.g. update any boundary conditions that depend upon variables of the problem; update any ‘dependent’ variables; or perform an update of the nodal positions in SpineMeshes etc. CAREFUL: This step should (and if the FD-based LinearSolver FD_LU is used, must) only update values that are pinned!

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [1/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_newton_solve ( )
inlinevirtual

Update the problem specs before solve (empty; all prescribed velocities are constant along their respective boundares, therefore their FE interpolation onto the newly created nodes is sufficiently accurate)

Reimplemented from oomph::Problem.

1118 {}

◆ actions_before_newton_solve() [2/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_newton_solve ( )
inlinevirtual

Update the problem specs before solve (empty; all prescribed velocities are constant along their respective boundares, therefore their FE interpolation onto the newly created nodes is sufficiently accurate)

Reimplemented from oomph::Problem.

1205 {}

◆ actions_before_newton_solve() [3/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_newton_solve ( )
inlinevirtual

Update the problem specs before solve (empty; all prescribed velocities are constant along their respective boundares, therefore their FE interpolation onto the newly created nodes is sufficiently accurate)

Reimplemented from oomph::Problem.

992 {}

◆ actions_before_newton_solve() [4/4]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::actions_before_newton_solve ( )
inlinevirtual

Update the problem specs before solve.

Reimplemented from oomph::Problem.

446 {}

◆ add_eigenproblem()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::add_eigenproblem ( )
inline
1315  {
1316  Eigenproblem_flag = true;
1317  using namespace Global_Parameters;
1318 
1319  GeomObject* cylinder_pt = base_flow_mesh_pt()->domain_pt()->cylinder_pt();
1320  double length = base_flow_mesh_pt()->length();
1321  double height = base_flow_mesh_pt()->height();
1322 
1323  // Build mesh
1326  length,height);
1327 
1328  // Set error estimator (not sure this will work with the peturbed problem)
1330  eigenproblem_mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
1331 
1332  // Maximum number of refinements (increase this if you want a finer mesh)
1333  //eigenproblem_mesh_pt()->max_refinement_level() = max_refinement_level;
1334 
1335  // Error targets for adaptive refinement
1336  //eigenproblem_mesh_pt()->max_permitted_error() = max_error_target;
1337  //eigenproblem_mesh_pt()->min_permitted_error() = min_error_target;
1338 
1339  eigenproblem_mesh_pt()->max_refinement_level() = 10;
1340 
1341  //that the natural boundary condition is pseudo-traction-free
1344 
1345  //Sort out normalisation
1346  using namespace Global_Parameters;
1347 
1349  normalisation_element_pt =
1352 
1354  Normalisation_mesh_pt->add_element_pt(normalisation_element_pt);
1355 
1356  //Pull out a pointer to the Reynolds number
1357  double* local_re_pt = Normalisation_mesh_pt->element_pt(0)
1358  ->internal_data_pt(0)->value_pt(2);
1359  //Set the value
1360  *local_re_pt = Re;
1361 
1362  //Need to set the parameters in the elements in the base mesh
1363  unsigned n_element = Eigenproblem_mesh_pt->nelement();
1364  for(unsigned e=0;e<n_element;e++)
1365  {
1366  //Cast to the particular element type, this is necessary because
1367  //the base elements don't have the member functions that we're about
1368  //to call!
1369  PERTURBED_ELEMENT *el_pt =
1370  dynamic_cast<PERTURBED_ELEMENT*>(Eigenproblem_mesh_pt->element_pt(e));
1371 
1372  //There is no need for ALE
1373  el_pt->disable_ALE();
1374 
1375  //Set the Reynolds number for each element
1376  //(yes we could have different Reynolds number in each element!!)
1377  el_pt->re_pt() = local_re_pt;//&Re;
1378 
1379  //Set the product of Reynolds and Strouhal numbers
1380  el_pt->re_st_pt() = local_re_pt; //&Re;
1381 
1382  //Set the eigenfunction normalisation element
1383  el_pt->set_eigenfunction_normalisation_element(normalisation_element_pt);
1384  }
1385 
1386 
1387  //Also set the Reynolds number in the original elements to be variable
1388  {
1389  // Pass pointer to Reynolds number to elements
1390  unsigned nelem=Base_flow_mesh_pt->nelement();
1391  for (unsigned e=0;e<nelem;e++)
1392  {
1393  BASE_ELEMENT* el_pt =
1394  dynamic_cast<BASE_ELEMENT*>(Base_flow_mesh_pt->element_pt(e));
1395 
1396  //Set the Reynolds number for each element
1397  //(yes we could have different Reynolds number in each element!!)
1398  el_pt->re_pt() = local_re_pt;//&Re;
1399 
1400  //Set the product of Reynolds and Strouhal numbers
1401  el_pt->re_st_pt() = local_re_pt; //&Re;
1402 
1403  //and add as external data
1404  el_pt->add_external_data(
1406 
1407  }
1408  }
1409 
1410  //Refine as the other mesh
1412  ->refine_base_mesh_as_in_reference_mesh(
1413  dynamic_cast<TreeBasedRefineableMeshBase*>
1414  (Base_flow_mesh_pt));
1415 
1416 
1417  //Set the boundary conditions (no slip on the walls)
1418  //Loop over the nodes on the (only) mesh boundary
1419  unsigned n_boundary = Eigenproblem_mesh_pt->nboundary();
1420  for(unsigned b=0;b<n_boundary;++b)
1421  {
1422  unsigned n_boundary_node = Eigenproblem_mesh_pt->nboundary_node(b);
1423  for(unsigned n=0;n<n_boundary_node;n++)
1424  {
1425  if(b!=1)
1426  {
1427  //Pin all four (two real, two imaginary) velocity components on the
1428  //same boundaries as the base flow problem
1429  for(unsigned i=0;i<4;i++)
1430  {
1432  }
1433  }
1434  }
1435  }
1436 
1437  //Pin all normalisation degrees of freedom
1438  unsigned n_node = Eigenproblem_mesh_pt->nnode();
1439  for(unsigned n=0;n<n_node;++n)
1440  {
1441  for(unsigned i=0;i<4;++i)
1442  {
1444  }
1445  }
1446 
1447  //Loop over all the (fluid) elements
1448  {unsigned n_element = Eigenproblem_mesh_pt->nelement();
1449  for(unsigned e=0;e<n_element;e++)
1450  {
1451  //Cast to the particular element type, this is necessary because
1452  //the base elements don't have the member functions that we're about
1453  //to call!
1454  PERTURBED_ELEMENT *el_pt =
1455  dynamic_cast<PERTURBED_ELEMENT*>(Eigenproblem_mesh_pt->element_pt(e));
1456 
1457  //There is no need for ALE
1458  el_pt->disable_ALE();
1459 
1460  //Set the Reynolds number for each element
1461  //(yes we could have different Reynolds number in each element!!)
1462  el_pt->re_pt() = local_re_pt;//&Re;
1463 
1464  //Set the product of Reynolds and Strouhal numbers
1465  el_pt->re_st_pt() = local_re_pt; //&Re;
1466 
1467  //Set the eigenfunction normalisation element
1468  el_pt->set_eigenfunction_normalisation_element(normalisation_element_pt);
1469 
1470  //Pin the pressure normalisation dofs
1471  el_pt->pin_pressure_normalisation_dofs();
1472  }
1473  }
1474 
1475 
1476 // Pin redudant pressure dofs
1477  RefineableLinearisedNavierStokesEquations::
1478  pin_redundant_nodal_pressures(Eigenproblem_mesh_pt->element_pt());
1479 
1480  //The setup of the interaction uses a binning approach that
1481  //works best if there are a reasonably large number of bins
1482  //in each direction. If there are ever problems, increasing
1483  //these numbers tends to fix them.
1484 
1485  // Change default number of bins in each dimension
1486  //Multi_domain_functions::Nx_bin=500;
1487  //Multi_domain_functions::Ny_bin=500;
1488 
1489  // Don't compute extreme bin coordinates
1490  //Multi_domain_functions::Compute_extreme_bin_coordinates=false;
1491 
1492  // Specify extreme bin coordinates directly
1493  //Multi_domain_functions::X_min= 1.0/Delta - 1.0;
1494  //Multi_domain_functions::X_max= 1.0/Delta + 1.0;
1495  //Multi_domain_functions::Y_min = -1.0;
1496  //Multi_domain_functions::Y_max= + 1.0;
1497 
1498  // First interaction (base state velocities)
1499  Multi_domain_functions::
1500  setup_multi_domain_interaction<BASE_ELEMENT>
1502 
1503  // Second interaction (base state velocity derivatives w.r.t. space)
1504  Multi_domain_functions::
1505  setup_multi_domain_interaction<BASE_ELEMENT>
1507 
1508  //Build the global mesh
1511  this->rebuild_global_mesh();
1512 
1514 
1515  //Setup all the equation numbering and look-up schemes
1516  std::cout << assign_eqn_numbers() << std::endl;
1517  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
RefineableRectangleWithHoleMesh< PERTURBED_ELEMENT > * eigenproblem_mesh_pt()
Return a pointer to the specific mesh used.
Definition: adaptive_hopf_with_separate_meshes.cc:1309
RefineableRectangleWithHoleMesh< BASE_ELEMENT > * base_flow_mesh_pt()
Access function for the specific mesh.
Definition: adaptive_hopf_with_separate_meshes.cc:1302
Definition: geom_objects.h:101
Definition: linearised_navier_stokes_eigenvalue_elements.h:52
Definition: mesh.h:67
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Definition: mesh.h:617
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
unsigned add_sub_mesh(Mesh *const &mesh_pt)
Definition: problem.h:1330
void rebuild_global_mesh()
Definition: problem.cc:1533
Base class for tree-based refineable meshes.
Definition: refineable_mesh.h:376
double Re
Reynolds number.
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:61
double Gamma
Aspect ratio (cylinder height / cylinder radius)
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:70
std::complex< double > Eigenfunction_normalisation(1.0, 0.0)

References oomph::Mesh::add_element_pt(), b, e(), Global_Parameters::Eigenfunction_normalisation(), MeshRefinement::error_estimator_pt, oomph::LinearisedNavierStokesEquations::Gamma, Global_Physical_Variables::height(), i, n, oomph::Mesh::nboundary(), oomph::RefineableLinearisedNavierStokesEquations::pin_redundant_nodal_pressures(), and GlobalPhysicalVariables::Re.

◆ apply_boundary_conditions()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::apply_boundary_conditions

Apply boundary conditions.

Apply boundary conditions (BX = boundary X): – Pin both velocities on the cylinder (B4) and the inlet (B3). – Zero vertical velocity on the upper (B2) and lower (B0) boundaries. – Do nothing (non-stress divergence form) on the outlet (B1):

650 {
651  // Get the number of boundaries in the mesh
652  unsigned n_boundary=Bulk_mesh_pt->nboundary();
653 
654  // Loop over the boundaries
655  for (unsigned b=0; b<n_boundary; b++)
656  {
657  // Find the number of nodes on the b-th boundary
658  unsigned n_boundary_node=Bulk_mesh_pt->nboundary_node(b);
659 
660  // Inlet and side walls (tow-tank conditions)
661  if ((b==Lower_wall_boundary_id)||
663  (b==Inflow_boundary_id)||
665  {
666  // Loop over the nodes
667  for (unsigned n=0; n<n_boundary_node; n++)
668  {
669  // Pointer to the boundary node
670  Node* boundary_node_pt=Bulk_mesh_pt->boundary_node_pt(b,n);
671 
672  // Pin the horizontal velocity
673  boundary_node_pt->pin(0);
674 
675  // Pin the vertical velocity
676  boundary_node_pt->pin(1);
677 
678  // Cylinder surface: enforce a no-slip condition
679  // NOTE: the no-slip condition will be updated before each timestep in
680  // response to the cylinder motion using the FSI helpers.
682  {
683  // Set horizontal velocity to zero
684  boundary_node_pt->set_value(0,0.0);
685 
686  // Set the vertical velocity to zero too
687  boundary_node_pt->set_value(1,0.0);
688  }
689  // Inflow and sidewalls: enforce tow-tank boundary conditions
690  else
691  {
692  // Tangential inflow
693  boundary_node_pt->set_value(0,1.0);
694 
695  // No vertical velocity
696  boundary_node_pt->set_value(1,0.0);
697  }
698  } // for (unsigned b=0;b<n_boundary_node;b++)
699  } // if ((b==Lower_wall_boundary_id)||...
700  } // for (unsigned b=0; b<n_boundary; b++)
701 } // End of apply_boundary_conditions
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271

References b, n, oomph::Data::pin(), and oomph::Data::set_value().

Referenced by FlowAroundCylinderProblem< ELEMENT >::FlowAroundCylinderProblem().

◆ base_flow_mesh_pt()

template<class ELEMENT >
RefineableRectangleWithHoleMesh<BASE_ELEMENT>* FlowAroundCylinderProblem< ELEMENT >::base_flow_mesh_pt ( )
inline

Access function for the specific mesh.

1303  {
1304  return dynamic_cast<RefineableRectangleWithHoleMesh<BASE_ELEMENT>*>
1306  }

◆ doc_solution() [1/2]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::doc_solution ( )
inline

Report the eigenvalue

1688  {
1689  Base_flow_mesh_pt->output("final_base_flow.dat",5);
1690  //Output the eigenproblem
1691  Eigenproblem_mesh_pt->output("final_eigenfunction.dat",5);
1693  std::cout << "Eigenvalue is " <<
1695  << " + " <<
1697  << "I\n";
1698 
1699  std::cout << "Critical Reynolds number is " <<
1701  << "\n";
1702  }
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027

◆ doc_solution() [2/2]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::doc_solution ( const bool in_unsteady = false)

Doc the solution.

Document the solution.

870 {
871  // Tell the user
872  oomph_info << "Documentation step: " << GlobalParameters::Doc_info.number()
873  << std::endl;
874 
875  // Only output on root processor
876  if (this->communicator_pt()->my_rank()==0)
877  {
878  // Create an output stream
879  std::ofstream some_file;
880 
881  // Allocate space for the filename
882  char filename[10000];
883 
884  // Number of plot points
885  unsigned n_plot=GlobalParameters::N_plot_point;
886 
887  // If we're in the unsteady simulation
888  if (in_unsteady)
889  {
890  // Output solution
891  sprintf(filename,"%s/unsteady%i.dat",
892  GlobalParameters::Doc_info.directory().c_str(),
893  GlobalParameters::Doc_info.number());
894  }
895  else
896  {
897  // Output solution
898  sprintf(filename,"%s/soln%i.dat",
899  GlobalParameters::Doc_info.directory().c_str(),
900  GlobalParameters::Doc_info.number());
901  }
902 
903  // Open a file with the formed filename
904  some_file.open(filename);
905 
906  // Output solution
907  Bulk_mesh_pt->output(some_file,n_plot);
908 
909  // Close the file
910  some_file.close();
911  } // if (this->communicator_pt()->my_rank()==0)
912 
913  // Increment the documentation number
915 } // End of doc_solution
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
Definition: problem.h:1246
unsigned N_plot_point
-------------------------------------------—DOMAIN PROPERTIES---—
Definition: flow_past_oscillating_cylinder.cc:342
DocInfo Doc_info
Helper for documenting.
Definition: extrude_triangle_generated_mesh.cc:57
string filename
Definition: MergeRestartFiles.py:39

References GlobalParameters::Doc_info, MergeRestartFiles::filename, GlobalParameters::N_plot_point, oomph::DocInfo::number(), and oomph::oomph_info.

◆ doc_trace_node_velocities_and_pressure()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::doc_trace_node_velocities_and_pressure ( )

Output the velocity components at a point on the centerline to observe the oscillating behaviour without having to output all the data (i.e. V1, V2 etc.):

◆ dump_problem()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::dump_problem ( char filename) const

Dump the entire problem.

◆ eigenproblem_mesh_pt()

template<class ELEMENT >
RefineableRectangleWithHoleMesh<PERTURBED_ELEMENT>* FlowAroundCylinderProblem< ELEMENT >::eigenproblem_mesh_pt ( )
inline

Return a pointer to the specific mesh used.

1311  (this->Eigenproblem_mesh_pt);}

◆ make_copy()

template<class ELEMENT >
Problem* FlowAroundCylinderProblem< ELEMENT >::make_copy ( )
inlinevirtual

Make a copy for using in bifurcation tracking.

Reimplemented from oomph::Problem.

1047  {
1048  //Make a copy based on the current parameters
1051  }
Flow around a cylinder in rectangular domain.
Definition: adaptive_hopf.cc:1042

References GlobalParameters::Cylinder_pt.

◆ mesh_pt() [1/3]

template<class ELEMENT >
RefineableRectangleWithHoleMesh<ELEMENT>* FlowAroundCylinderProblem< ELEMENT >::mesh_pt ( )
inline

Access function for the specific mesh.

1151  {
1152  return dynamic_cast<RefineableRectangleWithHoleMesh<ELEMENT>*>
1153  (Problem::mesh_pt());
1154  }

References oomph::Problem::mesh_pt().

Referenced by FlowAroundCylinderProblem< ELEMENT >::FlowAroundCylinderProblem(), and FlowAroundCylinderProblem< ELEMENT >::~FlowAroundCylinderProblem().

◆ mesh_pt() [2/3]

template<class ELEMENT >
RefineableRectangleWithHoleMesh<ELEMENT>* FlowAroundCylinderProblem< ELEMENT >::mesh_pt ( )
inline

Access function for the specific mesh.

1031  {
1032  return dynamic_cast<RefineableRectangleWithHoleMesh<ELEMENT>*>
1033  (Problem::mesh_pt());
1034  }

◆ mesh_pt() [3/3]

template<class ELEMENT >
Mesh* & FlowAroundCylinderProblem< ELEMENT >::mesh_pt ( const unsigned num)
inline
1157  {
1158  return Problem::mesh_pt(num);
1159  }

References oomph::Problem::mesh_pt().

◆ pin_all_base_flow_dofs()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::pin_all_base_flow_dofs ( )
inline
1529  {
1530  const unsigned n_node = Base_flow_mesh_pt->nnode();
1531  for(unsigned n=0;n<n_node;++n)
1532  {
1533  Node* nod_pt = Base_flow_mesh_pt->node_pt(n);
1534  unsigned n_value = nod_pt->nvalue();
1535  for(unsigned i=0;i<n_value;++i)
1536  {
1537  if(!nod_pt->is_constrained(i))
1538  {
1539  nod_pt->pin(i);
1540  }
1541  }
1542  }
1543  const unsigned n_element = Base_flow_mesh_pt->nelement();
1544  for(unsigned e=0;e<n_element;++e)
1545  {
1547  unsigned n_internal = el_pt->ninternal_data();
1548  for(unsigned i=0;i<n_internal;++i)
1549  {
1550  Data* data_pt = el_pt->internal_data_pt(i);
1551  unsigned n_value = data_pt->nvalue();
1552  for(unsigned j=0;j<n_value;++j)
1553  {
1554  if(!data_pt->is_constrained(j))
1555  {
1556  data_pt->pin(j);
1557  }
1558  }
1559  }
1560  }
1561  }
Definition: nodes.h:86
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
bool is_constrained(const unsigned &i)
Definition: nodes.h:472
Definition: elements.h:73
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:823
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References e(), i, oomph::GeneralisedElement::internal_data_pt(), oomph::Data::is_constrained(), j, n, oomph::GeneralisedElement::ninternal_data(), oomph::Data::nvalue(), and oomph::Data::pin().

◆ read_problem()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::read_problem ( char restart_file)

Read the entire problem.

◆ set_boundary_conditions() [1/2]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::set_boundary_conditions ( )
inline

Set the boundary conditions on the cylinder and at the inlet

1066  {
1067  using namespace Global_Parameters;
1068 
1069  //Set the boundary conditions on the cylinder
1070  unsigned ibound=4;
1071  unsigned n_node = mesh_pt()->nboundary_node(ibound);
1072  for(unsigned n=0;n<n_node;n++)
1073  {
1074  double x = mesh_pt()->boundary_node_pt(ibound,n)->x(0);
1075  double y = mesh_pt()->boundary_node_pt(ibound,n)->x(1);
1076 
1077  //Now find the vector distance to the centre
1078  double len_x = x - mesh_pt()->domain_pt()->centre_x();
1079  double len_y = y - mesh_pt()->domain_pt()->centre_y();
1080 
1081  //Calculate the angle and radius
1082  double theta = atan2(len_y,len_x);
1083 
1084  double u_x = -Alpha*sin(theta);
1085  double u_y = Alpha*cos(theta);
1086 
1087  //Now set the velocities
1088  mesh_pt()->boundary_node_pt(ibound,n)->set_value(0,u_x);
1089  mesh_pt()->boundary_node_pt(ibound,n)->set_value(1,u_y);
1090  }
1091 
1092  // update the parabolic tangential inflow velocity
1093  ibound=3;
1094  double ycoord,uy;
1095  n_node = mesh_pt()->nboundary_node(ibound);
1096  double um = 1.0/12.0 - 0.25*Domain_height*Domain_height;
1097  for (unsigned n=0;n<n_node;n++)
1098  {
1099  ycoord = mesh_pt()->boundary_node_pt(ibound,n)->x(1);
1100  uy = (ycoord*ycoord - 0.25*Domain_height*Domain_height)/um;
1101 
1102  // Tangential flow
1103  mesh_pt()->boundary_node_pt(ibound,n)->set_value(0,uy);
1104  //No penetration
1105  mesh_pt()->boundary_node_pt(ibound,n)->set_value(1,0.0);
1106  }
1107  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:139
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
Scalar * y
Definition: level1_cplx_impl.h:128
double theta
Definition: two_d_biharmonic.cc:236
double Alpha
Peakiness parameter for pressure load.
Definition: adaptive_hopf.cc:60
list x
Definition: plotDoE.py:28

References Global_Parameters::Alpha, atan2(), cos(), n, sin(), BiharmonicTestFunctions2::theta, plotDoE::x, and y.

◆ set_boundary_conditions() [2/2]

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::set_boundary_conditions ( )
inline

Set the boundary conditions on the cylinder and at the inlet

1104  {
1105  using namespace Global_Parameters;
1106 
1107  //Set the boundary conditions on the cylinder
1108  unsigned ibound=4;
1109  unsigned n_node = Base_flow_mesh_pt->nboundary_node(ibound);
1110  for(unsigned n=0;n<n_node;n++)
1111  {
1112  double x = Base_flow_mesh_pt->boundary_node_pt(ibound,n)->x(0);
1113  double y = Base_flow_mesh_pt->boundary_node_pt(ibound,n)->x(1);
1114 
1115  //Now find the vector distance to the centre
1116  double len_x = x - base_flow_mesh_pt()->domain_pt()->centre_x();
1117  double len_y = y - base_flow_mesh_pt()->domain_pt()->centre_y();
1118 
1119  //Calculate the angle and radius
1120  double theta = atan2(len_y,len_x);
1121 
1122  double u_x = -Alpha*sin(theta);
1123  double u_y = Alpha*cos(theta);
1124 
1125  //Now set the velocities
1126  Base_flow_mesh_pt->boundary_node_pt(ibound,n)->set_value(0,u_x);
1127  Base_flow_mesh_pt->boundary_node_pt(ibound,n)->set_value(1,u_y);
1128  }
1129 
1130  // update the parabolic tangential inflow velocity
1131  ibound=3;
1132  double ycoord,uy;
1133  n_node = Base_flow_mesh_pt->nboundary_node(ibound);
1134  double um = 1.0/12.0 - 0.25*Domain_height*Domain_height;
1135  for (unsigned n=0;n<n_node;n++)
1136  {
1137  ycoord = Base_flow_mesh_pt->boundary_node_pt(ibound,n)->x(1);
1138  uy = (ycoord*ycoord - 0.25*Domain_height*Domain_height)/um;
1139 
1140  // Tangential flow
1142  //No penetration
1143  Base_flow_mesh_pt->boundary_node_pt(ibound,n)->set_value(1,0.0);
1144  }
1145 
1146  if(Eigenproblem_flag)
1147  {
1148 
1149  unsigned n_boundary = Eigenproblem_mesh_pt->nboundary();
1150  for(unsigned b=0;b<n_boundary;++b)
1151  {
1152  unsigned n_boundary_node = Eigenproblem_mesh_pt->nboundary_node(b);
1153  for(unsigned n=0;n<n_boundary_node;n++)
1154  {
1155  if(b!=1)
1156  {
1157  //Pin all four (two real, two imaginary) velocity components on the
1158  //same boundaries as the base flow problem
1159  for(unsigned i=0;i<4;i++)
1160  {
1163  }
1164  }
1165  }
1166  }
1167 
1168  //Pin all normalisation degrees of freedom
1169  unsigned n_node = Eigenproblem_mesh_pt->nnode();
1170  for(unsigned n=0;n<n_node;++n)
1171  {
1172  for(unsigned i=0;i<4;++i)
1173  {
1175  }
1176  }
1177  }
1178  }
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
double Alpha
Parameter for steepness of step.
Definition: two_d_adv_diff_adapt.cc:53

References TanhSolnForAdvectionDiffusion::Alpha, atan2(), b, cos(), i, n, sin(), BiharmonicTestFunctions2::theta, plotDoE::x, and y.

◆ set_eigenvalue()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::set_eigenvalue ( const double real,
const double imag 
)
inline
1521  {
1522  Data* dat_pt =
1524  dat_pt->set_value(0,real);
1525  dat_pt->set_value(1,imag);
1526  }
Definition: main.h:116
Definition: main.h:115

References oomph::Data::set_value().

◆ set_up_solver_and_preconditioner()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::set_up_solver_and_preconditioner

Set the chosen solver and preconditioner.

Set up the linear solver and preconditioner.

709 {
710  // Use GMRES
712 
713  // Set linear solver
715 
716  // Create and assign the Navier-Stokes preconditioner
718 
719  // Pass the Navier-Stokes mesh to the preconditioner
721 
722  // Pass the preconditioner to the solver
724 
725  // By default, the LSC Preconditioner uses SuperLU as an exact
726  // preconditioner (i.e. a solver) for the momentum and Schur complement
727  // blocks. Can overwrite this by passing pointers to other preconditioners
728  // that perform the (approximate) solves of these blocks:
729 
730  // Create internal preconditioners used on momentum block
732 
733  // Assign the subsidiary preconditioner to the linear solver preconditioner
735 } // End of set_up_solver_and_preconditioner
Definition: general_purpose_block_preconditioners.h:321
The GMRES method.
Definition: iterative_linear_solver.h:1227
Preconditioner *& preconditioner_pt()
Access function to preconditioner.
Definition: iterative_linear_solver.h:95
Definition: navier_stokes_preconditioners.h:607
void set_f_preconditioner(Preconditioner *new_f_preconditioner_pt)
Function to set a new momentum matrix preconditioner (inexact solver)
Definition: navier_stokes_preconditioners.h:769
void set_navier_stokes_mesh(Mesh *mesh_pt, const bool &allow_multiple_element_type_in_navier_stokes_mesh=false)
Definition: navier_stokes_preconditioners.h:732
LinearSolver *& linear_solver_pt()
Return a pointer to the linear solver object.
Definition: problem.h:1466

◆ transfer_eigenfunction_as_initial_condition()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::transfer_eigenfunction_as_initial_condition ( DoubleVector real,
DoubleVector imaginary 
)
inline
1605  {
1606  this->pin_all_base_flow_dofs();
1607 
1608  //Pin the eigenvalues
1610 
1611  //Pin everything apart from the real part of the eigenfunction
1612  unsigned n_element = Eigenproblem_mesh_pt->nelement();
1613  for(unsigned e=0;e<n_element;++e)
1614  {
1615  PERTURBED_ELEMENT* el_pt = dynamic_cast<PERTURBED_ELEMENT*>
1617 
1618  //Pin the imaginary parts
1619  el_pt->pin_real_or_imag(1);
1620  }
1621 
1622 
1623  //Reassign the equation numbers
1624  std::cout << "Assigning real part" << this->assign_eqn_numbers()
1625  << std::endl;
1626 
1627  //Transfer it over
1628  this->assign_eigenvector_to_dofs(real);
1629  Eigenproblem_mesh_pt->output("E1.dat",5);
1630 
1631 
1632  //Pin everything apart from the imaginary part of the eigenfunction
1633  for(unsigned e=0;e<n_element;++e)
1634  {
1635  PERTURBED_ELEMENT* el_pt = dynamic_cast<PERTURBED_ELEMENT*>
1637 
1638  el_pt->unpin_real_or_imag(1);
1639  //Pin the real parts
1640  el_pt->pin_real_or_imag(0);
1641  }
1642 
1643  //Reapply the boundary conditions
1644  this->set_boundary_conditions();
1645 
1646  //Reassign the equation numbers
1647  std::cout << "Assigning imaginary part" << this->assign_eqn_numbers()
1648  << std::endl;
1649 
1650  //Transfer it over
1651  this->assign_eigenvector_to_dofs(imaginary);
1652 
1653  //Now we convert things over to the normalisation function
1654  //Pin everything apart from the imaginary part of the eigenfunction
1655  for(unsigned e=0;e<n_element;++e)
1656  {
1657  PERTURBED_ELEMENT* el_pt = dynamic_cast<PERTURBED_ELEMENT*>
1659  //Unpin the real part
1660  el_pt->unpin_real_or_imag(0);
1661  //Transfer the normalisation
1662  el_pt->copy_efunction_to_normalisation();
1663  }
1664 
1665  //Reapply the boundary conditions
1666  this->set_boundary_conditions();
1667 
1668  //Unpin the eigenvalues
1670  //Pin the Reynolds number
1671  //Normalisation_mesh_pt->element_pt(0)->internal_data_pt(0)->pin(2);
1672 
1674  this->actions_after_adapt();
1675 
1676  //Reassign the equation numbers
1677  std::cout << "Re-assigning the equation numbers"
1678  << this->assign_eqn_numbers()
1679  << std::endl;
1680 
1681  //Let's output
1682  Eigenproblem_mesh_pt->output("Initial_mesh.dat",5);
1683 
1684 
1685  }
void actions_after_adapt()
After adaptation: Unpin pressure and pin redudant pressure dofs.
Definition: adaptive_hopf.cc:1121
void pin_all_base_flow_dofs()
Definition: adaptive_hopf_with_separate_meshes.cc:1528
void unpin_all_base_flow_dofs()
Definition: adaptive_hopf_with_separate_meshes.cc:1563
void pin_all()
Pin all the stored variables.
Definition: nodes.h:397
void unpin_all()
Unpin all the stored variables.
Definition: nodes.h:407
void assign_eigenvector_to_dofs(DoubleVector &eigenvector)
Assign the eigenvector passed to the function to the dofs.
Definition: problem.cc:8716

References e().

◆ unpin_all_base_flow_dofs()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::unpin_all_base_flow_dofs ( )
inline
1564  {
1565  const unsigned n_node = Base_flow_mesh_pt->nnode();
1566  for(unsigned n=0;n<n_node;++n)
1567  {
1568  Node* nod_pt = Base_flow_mesh_pt->node_pt(n);
1569  unsigned n_value = nod_pt->nvalue();
1570  for(unsigned i=0;i<n_value;++i)
1571  {
1572  if(!nod_pt->is_constrained(i))
1573  {
1574  nod_pt->unpin(i);
1575  }
1576  }
1577  }
1578  const unsigned n_element = Base_flow_mesh_pt->nelement();
1579  for(unsigned e=0;e<n_element;++e)
1580  {
1582  unsigned n_internal = el_pt->ninternal_data();
1583  for(unsigned i=0;i<n_internal;++i)
1584  {
1585  Data* data_pt = el_pt->internal_data_pt(i);
1586  unsigned n_value = data_pt->nvalue();
1587  for(unsigned j=0;j<n_value;++j)
1588  {
1589  if(!data_pt->is_constrained(j))
1590  {
1591  data_pt->unpin(j);
1592  }
1593  }
1594  }
1595  }
1596  }
void unpin(const unsigned &i)
Unpin the i-th stored variable.
Definition: nodes.h:391

References e(), i, oomph::GeneralisedElement::internal_data_pt(), oomph::Data::is_constrained(), j, n, oomph::GeneralisedElement::ninternal_data(), oomph::Data::nvalue(), and oomph::Data::unpin().

◆ unsteady_simulation()

template<class ELEMENT >
void FlowAroundCylinderProblem< ELEMENT >::unsteady_simulation

Timestep the problem.

743 {
744  // The FSI_Functions namespace enforces the no-slip condition on the
745  // cylinder boundary as the nodes on this boundary move with time. This
746  // requires a handle to the Strouhal number value, so set it here
748 
749  // Make the problem unsteady again
751 
752  // Set the period (working on the non-dimensionalised time)
753  double period=1.0;
754 
755  // Timestep
757 
758  // Initialise the timestep value
759  initialise_dt(dt);
760 
761  // Doc the number of timesteps per period and timestep size
762  oomph_info << "\nTimestepping with "
764  << " steps per period, corresponding to a timestep of "
765  << dt << std::endl;
766 
767  // Make the problem unsteady again
769 
770  // Assign history values for an impulsive start
772 
773  // Reset the documentation counter so the file indexing (re)starts from zero
775 
776  // Set up the solver and preconditioner
778 
779  // Make sure that the Reynolds number is exactly equal to our target value
781 
782  // Document the Reynolds number and Womersley number
784 
785  // Initialise the number of timesteps
786  unsigned n_timestep=
788 
789  // Tell the user
790  oomph_info << "\nTotal number of timesteps: " << n_timestep << std::endl;
791 
792  // Target global temporal error
793  double epsilon_t=1.0e-04;
794 
795  // Max. number of spatial adaptations
796  unsigned max_adapt=0;
797 
798  // Inform the user
799  oomph_info << "\nRunning until time: " << GlobalParameters::N_period_unsteady
800  << std::endl;
801 
802  // Loop over the timesteps
803  for (unsigned t=1; t<=n_timestep; t++)
804  {
805  // Run the bastard...
806  doubly_adaptive_unsteady_newton_solve(dt,epsilon_t,max_adapt,false);
807 
808  // Tell the user
809  oomph_info << "Obtained solution at timestep " << t
810  << " out of " << n_timestep << "." << std::endl;
811  }
812 } // End of unsteady_simulation
void set_up_solver_and_preconditioner()
Set the chosen solver and preconditioner.
Definition: flow_past_oscillating_cylinder.cc:708
void initialise_dt(const double &dt)
Definition: problem.cc:13231
double doubly_adaptive_unsteady_newton_solve(const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
Definition: problem.h:2471
void assign_initial_values_impulsive()
Definition: problem.cc:11499
virtual void undo_make_steady()
Definition: timesteppers.h:482
void doc_navier_stokes_parameters()
Document the value of the Reynolds number and Womersley number.
Definition: flow_past_oscillating_cylinder.cc:291
double St
The default Strouhal number (overloaded with input value if given)
Definition: flow_past_oscillating_cylinder.cc:223
unsigned N_period_unsteady
------------------------------------—NAVIER-STOKES PARAMETERS---—
Definition: flow_past_oscillating_cylinder.cc:305
double round(const double &d)
---------------------------------------—DOCUMENTATION HELPERS---—
Definition: flow_past_oscillating_cylinder.cc:410
double Re_target
Reynolds number for unsteady run.
Definition: flow_past_oscillating_cylinder.cc:220
unsigned N_step_per_period_unsteady
Number of timesteps per period for unsteady run.
Definition: flow_past_oscillating_cylinder.cc:308
double Strouhal_for_no_slip
Definition: fsi.cc:39
t
Definition: plotPSD.py:36

References GlobalParameters::Doc_info, GlobalParameters::doc_navier_stokes_parameters(), GlobalParameters::N_period_unsteady, GlobalParameters::N_step_per_period_unsteady, oomph::DocInfo::number(), oomph::oomph_info, GlobalParameters::Re, GlobalParameters::Re_target, GlobalParameters::round(), GlobalParameters::St, oomph::FSI_functions::Strouhal_for_no_slip, and plotPSD::t.

Member Data Documentation

◆ Base_flow_mesh_pt

template<class ELEMENT >
Mesh* FlowAroundCylinderProblem< ELEMENT >::Base_flow_mesh_pt
private

◆ Bulk_mesh_pt

template<class ELEMENT >
RefineableQuadMeshWithMovingCylinder<ELEMENT>* FlowAroundCylinderProblem< ELEMENT >::Bulk_mesh_pt
private

Pointer to the mesh with oscillating cylinder.

Referenced by FlowAroundCylinderProblem< ELEMENT >::FlowAroundCylinderProblem().

◆ Cylinder_pt

template<class ELEMENT >
GeomObject * FlowAroundCylinderProblem< ELEMENT >::Cylinder_pt
private

The geometric cylinder.

◆ Domain_height

template<class ELEMENT >
double FlowAroundCylinderProblem< ELEMENT >::Domain_height
private

Height of the domain.

◆ Domain_length

template<class ELEMENT >
double FlowAroundCylinderProblem< ELEMENT >::Domain_length
private

Length of the domain.

◆ Eigenproblem_flag

template<class ELEMENT >
bool FlowAroundCylinderProblem< ELEMENT >::Eigenproblem_flag
private

◆ Eigenproblem_mesh_pt

template<class ELEMENT >
Mesh* FlowAroundCylinderProblem< ELEMENT >::Eigenproblem_mesh_pt
private

◆ F_matrix_preconditioner_pt

template<class ELEMENT >
Preconditioner* FlowAroundCylinderProblem< ELEMENT >::F_matrix_preconditioner_pt
private

Inexact solver for F block.

◆ Normalisation_mesh_pt

template<class ELEMENT >
Mesh* FlowAroundCylinderProblem< ELEMENT >::Normalisation_mesh_pt
private

◆ Prec_pt

template<class ELEMENT >
NavierStokesSchurComplementPreconditioner* FlowAroundCylinderProblem< ELEMENT >::Prec_pt
private

LSC Preconditioner for the linear solve.

◆ Solver_pt

template<class ELEMENT >
IterativeLinearSolver* FlowAroundCylinderProblem< ELEMENT >::Solver_pt
private

Oomph-lib iterative linear solver.


The documentation for this class was generated from the following files: