32 #include "navier_stokes.h" 34 #include "multi_physics.h" 37 #include "meshes/one_d_lagrangian_mesh.h" 40 #include "meshes/collapsible_channel_mesh.h" 45 using namespace oomph;
89 template <
class ELEMENT>
92 public virtual SegregatableFSIProblem
101 const unsigned& ncollapsible,
102 const unsigned& ndown,
105 const double& lcollapsible,
108 const bool& displ_control,
109 const bool& steady_flag);
119 void identify_fluid_and_solid_dofs(Vector<Data*>& fluid_data_pt,
120 Vector<Data*>& solid_data_pt,
121 Mesh*& fluid_mesh_pt,
122 Mesh*& solid_mesh_pt);
139 if(Solve_type!=Fluid_solve) {this->Bulk_mesh_pt->node_update();}
153 this->Bulk_mesh_pt->node_update();
159 void doc_solution(DocInfo& doc_info);
170 template <
class ELEMENT>
173 const unsigned& ncollapsible,
174 const unsigned& ndown,
177 const double& lcollapsible,
180 const bool& displ_control,
181 const bool& steady_flag) :
197 assess_convergence_based_on_max_global_residual(
202 assess_convergence_based_on_absolute_solid_change(
207 assess_convergence_based_on_relative_solid_change(
216 this->enable_pointwise_aitken();
220 this->disable_pointwise_aitken();
229 this->enable_irons_and_tuck_extrapolation();
233 this->disable_irons_and_tuck_extrapolation();
246 template <
class ELEMENT>
249 Vector<Data*>& solid_data_pt,
250 Mesh*& fluid_mesh_pt,
251 Mesh*& solid_mesh_pt)
258 fluid_data_pt.clear();
263 for(
unsigned e=0;e<n_fluid_elem;e++)
265 GeneralisedElement* el_pt=this->
bulk_mesh_pt()->element_pt(e);
266 unsigned n_internal=el_pt->ninternal_data();
267 for(
unsigned i=0;i<n_internal;i++)
269 fluid_data_pt.push_back(el_pt->internal_data_pt(i));
276 for (
unsigned n=0;n<n_fluid_node;n++)
278 fluid_data_pt.push_back(this->
bulk_mesh_pt()->node_pt(n));
289 solid_data_pt.clear();
294 for(
unsigned n=0;n<n_solid_node;n++)
296 solid_data_pt.push_back(
297 this->
wall_mesh_pt()->node_pt(n)->variable_position_pt());
305 Vector<Mesh*> s_mesh_pt(1);
321 solid_mesh_pt =
new Mesh(s_mesh_pt);
329 template <
class ELEMENT>
341 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
343 some_file.open(filename);
348 sprintf(filename,
"%s/beam%i.dat",doc_info.directory().c_str(),
350 some_file.open(filename);
362 template <
class ELEMENT>
376 doc_info.set_directory(
"RESLT");
405 setup_segregated_solver();
414 (void)steady_segregated_solve();
420 steady_newton_solve();
460 double lcollapsible=5.0;
465 bool steady_flag=
true;
467 bool displ_control=
true;
471 <AlgebraicElement<QTaylorHoodElement<2> > >
472 problem(nup, ncollapsible, ndown, ny,
473 lup, lcollapsible, ldown, ly, displ_control,
477 problem.steady_run();
Extend namespace for control flags.
unsigned Nsteps
Number of steps in parameter study.
double Convergence_tolerance
Convergence tolerance.
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt()
Access function for the wall mesh.
unsigned Use_pointwise_aitken
Use pointwise Aitken extrapolation (1) or not (0)
double Yprescr
Current prescribed vertical position of control point (only used for displacement control) ...
void set_initial_condition()
Apply initial conditions.
SegregatedFSICollapsibleChannelProblem(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, const bool &displ_control, const bool &steady_flag)
Constructor: The arguments are the same as the original (non-segregated) problem, namely...
void actions_before_newton_convergence_check()
Update nodal positions in the fluid mesh in response to changes in the wall displacement field after ...
double Pmax
Max. pressure. Only used in steady runs during parameter incrementation. Use 2.0 for Re=250; 3...
AlgebraicCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt()
Access function for the specific bulk (fluid) mesh.
double Omega_under_relax
Under-relaxation parameter (1.0: no under-relaxation; 0.0: freeze)
void identify_fluid_and_solid_dofs(Vector< Data *> &fluid_data_pt, Vector< Data *> &solid_data_pt, Mesh *&fluid_mesh_pt, Mesh *&solid_mesh_pt)
Identify the fluid and solid Data and meshes that contain only elements involved in the respective su...
~SegregatedFSICollapsibleChannelProblem()
Empty Destructor.
double Pmin
Min. pressure. Only used in steady runs during parameter incrementation. Use 1.5 for values of Re to ...
unsigned Resolution_factor
Resolution factor (multiplier for number of elements across channel)
unsigned Convergence_criterion
Convergence criterion: 0: global resmax; 1: abs. change; 2: rel. change.
Data * P_ext_data_pt
Pointer to Data object that stores external pressure.
void doc_solution(DocInfo &doc_info)
Document the solution.
unsigned Use_irons_and_tuck_extrapolation
Use Irons and Tuck extrapolation (1) or not (0)
void steady_run()
Perform a steady run.
unsigned Use_segregated_solver
Use Newton solver (0) or segregated solver (1)?
Mesh * Displ_control_mesh_pt
Pointer to the mesh that contains the displacement control element.
bool Displ_control
Use displacement control?
void actions_before_segregated_convergence_check()
int main()
Driver code for a segregated collapsible channel problem with FSI.