28 #include "navier_stokes.h"
30 #include "multi_physics.h"
33 #include "meshes/one_d_lagrangian_mesh.h"
36 #include "meshes/collapsible_channel_mesh.h"
41 using namespace oomph;
85 template <
class ELEMENT>
88 public virtual SegregatableFSIProblem
97 const unsigned& ncollapsible,
98 const unsigned& ndown,
101 const double& lcollapsible,
104 const bool& displ_control,
105 const bool& steady_flag);
115 void identify_fluid_and_solid_dofs(Vector<Data*>& fluid_data_pt,
116 Vector<Data*>& solid_data_pt,
117 Mesh*& fluid_mesh_pt,
118 Mesh*& solid_mesh_pt);
135 if(Solve_type!=Fluid_solve) {this->Bulk_mesh_pt->node_update();}
149 this->Bulk_mesh_pt->node_update();
155 void doc_solution(DocInfo& doc_info);
166 template <
class ELEMENT>
169 const unsigned& ncollapsible,
170 const unsigned& ndown,
173 const double& lcollapsible,
176 const bool& displ_control,
177 const bool& steady_flag) :
193 assess_convergence_based_on_max_global_residual(
198 assess_convergence_based_on_absolute_solid_change(
203 assess_convergence_based_on_relative_solid_change(
212 this->enable_pointwise_aitken();
216 this->disable_pointwise_aitken();
225 this->enable_irons_and_tuck_extrapolation();
229 this->disable_irons_and_tuck_extrapolation();
242 template <
class ELEMENT>
245 Vector<Data*>& solid_data_pt,
246 Mesh*& fluid_mesh_pt,
247 Mesh*& solid_mesh_pt)
254 fluid_data_pt.clear();
257 unsigned n_fluid_elem=this->bulk_mesh_pt()->nelement();
259 for(
unsigned e=0;e<n_fluid_elem;e++)
261 GeneralisedElement* el_pt=this->bulk_mesh_pt()->element_pt(e);
262 unsigned n_internal=el_pt->ninternal_data();
263 for(
unsigned i=0;i<n_internal;i++)
265 fluid_data_pt.push_back(el_pt->internal_data_pt(i));
270 unsigned n_fluid_node=this->bulk_mesh_pt()->nnode();
272 for (
unsigned n=0;n<n_fluid_node;n++)
274 fluid_data_pt.push_back(this->bulk_mesh_pt()->node_pt(n));
278 fluid_mesh_pt = this->bulk_mesh_pt();
285 solid_data_pt.clear();
288 unsigned n_solid_node=this->wall_mesh_pt()->nnode();
290 for(
unsigned n=0;n<n_solid_node;n++)
292 solid_data_pt.push_back(
293 this->wall_mesh_pt()->node_pt(n)->variable_position_pt());
301 Vector<Mesh*> s_mesh_pt(1);
304 s_mesh_pt[0]=this->wall_mesh_pt();
307 if (this->Displ_control)
313 s_mesh_pt.push_back(this->Displ_control_mesh_pt);
317 solid_mesh_pt =
new Mesh(s_mesh_pt);
325 template <
class ELEMENT>
337 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
339 some_file.open(filename);
340 this->bulk_mesh_pt()->output(some_file,npts);
344 sprintf(filename,
"%s/beam%i.dat",doc_info.directory().c_str(),
346 some_file.open(filename);
347 this->wall_mesh_pt()->output(some_file,npts);
358 template <
class ELEMENT>
368 set_initial_condition();
372 doc_info.set_directory(
"RESLT");
375 doc_solution(doc_info);
401 setup_segregated_solver();
410 (void)steady_segregated_solve();
416 steady_newton_solve();
420 doc_solution(doc_info);
427 if (this->Displ_control)
456 double lcollapsible=5.0;
461 bool steady_flag=
true;
463 bool displ_control=
true;
467 <AlgebraicElement<QTaylorHoodElement<2> > >
468 problem(nup, ncollapsible, ndown, ny,
469 lup, lcollapsible, ldown, ly, displ_control,
473 problem.steady_run();
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void doc_solution(DocInfo &doc_info)
Document the solution.
void actions_before_newton_convergence_check()
Update nodal positions in the fluid mesh in response to changes in the wall displacement field after ...
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...
void actions_before_segregated_convergence_check()
Update nodal positions in the fluid mesh in response to any changes in the wall displacement field af...
void steady_run()
Perform a steady run.
~SegregatedFSICollapsibleChannelProblem()
Empty Destructor.
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,...
Extend namespace for control flags.
unsigned Use_segregated_solver
Use Newton solver (0) or segregated solver (1)?
double Convergence_tolerance
Convergence tolerance.
double Omega_under_relax
Under-relaxation parameter (1.0: no under-relaxation; 0.0: freeze)
unsigned Resolution_factor
Resolution factor (multiplier for number of elements across channel)
unsigned Nsteps
Number of steps in parameter study.
unsigned Use_irons_and_tuck_extrapolation
Use Irons and Tuck extrapolation (1) or not (0)
unsigned Use_pointwise_aitken
Use pointwise Aitken extrapolation (1) or not (0)
unsigned Convergence_criterion
Convergence criterion: 0: global resmax; 1: abs. change; 2: rel. change.
double Pmax
Max. pressure. Only used in steady runs during parameter incrementation. Use 2.0 for Re=250; 3....
Data * P_ext_data_pt
Pointer to Data object that stores external pressure.
double Pmin
Min. pressure. Only used in steady runs during parameter incrementation. Use 1.5 for values of Re to ...
double Yprescr
Current prescribed vertical position of control point (only used for displacement control)
int main()
Driver code for a segregated collapsible channel problem with FSI.