29#include "navier_stokes.h"
32#include "constitutive.h"
48template <
class ELEMENT>
51 public virtual SolidMesh
60 const unsigned& ncollapsible,
61 const unsigned& ndown,
69 &Mesh::Default_TimeStepper) :
262 for(
unsigned i=0;
i<2;
i++)
282template <
class ELEMENT>
291 const unsigned& ncollapsible,
292 const unsigned& ndown,
347 FSI_functions::apply_no_slip_on_moving_wall(
node_pt);
437template <
class ELEMENT>
440 const unsigned& ncollapsible,
441 const unsigned& ndown,
460 Problem::Max_residuals=1000.0;
493 (nup, ncollapsible, ndown,
ny,
504 Bulk_mesh_pt->set_lagrangian_nodal_coordinates();
506 if (CommandLineArgs::Argc>1)
509 Bulk_mesh_pt->refine_uniformly();
515 Applied_fluid_traction_mesh_pt =
new Mesh;
519 create_traction_elements(5,Bulk_mesh_pt,Applied_fluid_traction_mesh_pt);
523 Lagrange_multiplier_mesh_pt=
new SolidMesh;
524 create_lagrange_multiplier_elements();
548 unsigned n_element=Bulk_mesh_pt->nelement();
562 el_pt->constitutive_law_pt() = Constitutive_law_pt;
585 for(
unsigned i=0;
i<2;
i++)
587 bulk_mesh_pt()->boundary_node_pt(
ibound,
inod)->pin(
i);
597 for(
unsigned i=0;
i<2;
i++)
599 bulk_mesh_pt()->boundary_node_pt(
ibound,
inod)->pin(
i);
609 bulk_mesh_pt()->boundary_node_pt(
ibound,
inod)->pin(1);
619 bulk_mesh_pt()->boundary_node_pt(
ibound,
inod)->pin(1);
632 for(
unsigned i=0;
i<2;
i++)
634 dynamic_cast<SolidNode*
>(bulk_mesh_pt()->
643 unsigned nnod=bulk_mesh_pt()->nnode();
649 for(
unsigned i=0;
i<2;
i++)
662 unsigned n_el=Applied_fluid_traction_mesh_pt->nelement();
668 Applied_fluid_traction_mesh_pt->element_pt(
e));
705 elem_pt->set_normal_pointing_out_of_fluid();
716 for(
unsigned b=0;
b<2;
b++)
719 wall_mesh_pt()->boundary_node_pt(
b,0)->pin_position(0);
720 wall_mesh_pt()->boundary_node_pt(
b,0)->pin_position(1);
742 num_nod= wall_mesh_pt()->nnode();
759 bulk_mesh_pt()->boundary_node_pt(
ibound,
inod)->
761 FSI_functions::apply_no_slip_on_moving_wall);
768 FSI_functions::setup_fluid_load_info_for_solid_elements<ELEMENT,2>
769 (
this,3,Bulk_mesh_pt,Wall_mesh_pt);
783template <
class ELEMENT>
817 unsigned n_elem=wall_mesh_pt()->nelement();
830 << Wall_node_pt->x(1) <<
" "
831 << Left_node_pt->value(0) <<
" "
832 << Right_node_pt->value(0) <<
" "
845template <
class ELEMENT>
851 unsigned n_element = bulk_mesh_pt->nboundary_element(
b);
858 (bulk_mesh_pt->boundary_element_pt(
b,
e));
861 int face_index = bulk_mesh_pt->face_index_at_boundary(
b,
e);
879template<
class ELEMENT>
902template<
class ELEMENT>
910 unsigned n_element = bulk_mesh_pt()->nboundary_element(
b);
917 bulk_mesh_pt()->boundary_element_pt(
b,
e));
920 int face_index = bulk_mesh_pt()->face_index_at_boundary(
b,
e);
923 Lagrange_multiplier_mesh_pt->add_element_pt(
931 n_element=Lagrange_multiplier_mesh_pt->nelement();
937 (Lagrange_multiplier_mesh_pt->element_pt(
i));
942 el_pt->set_boundary_shape_geom_object_pt(Wall_geom_object_pt,
b);
951 if ((
nod_pt->is_on_boundary(2))||(
nod_pt->is_on_boundary(4)))
976template<
class ELEMENT>
981 unsigned n_element = Lagrange_multiplier_mesh_pt->nelement();
987 delete Lagrange_multiplier_mesh_pt->element_pt(
e);
991 Lagrange_multiplier_mesh_pt->flush_element_and_node_storage();
1000template <
class ELEMENT>
1007 error_stream <<
"Timestepper has to be from the BDF family!\n"
1008 <<
"You have specified a timestepper from the "
1017 unsigned num_nod = bulk_mesh_pt()->nnode();
1022 x[0]=bulk_mesh_pt()->node_pt(
n)->x(0);
1023 x[1]=bulk_mesh_pt()->node_pt(
n)->x(1);
1026 bulk_mesh_pt()->node_pt(
n)->set_value(0,6.0*(x[1]/Ly)*(1.0-(x[1]/Ly)));
1027 bulk_mesh_pt()->node_pt(
n)->set_value(1,0.0);
1031 bulk_mesh_pt()->assign_initial_values_impulsive();
1032 wall_mesh_pt()->assign_initial_values_impulsive();
1043template<
class ELEMENT>
1047 delete_traction_elements(Applied_fluid_traction_mesh_pt);
1050 delete_lagrange_multiplier_elements();
1062template<
class ELEMENT>
1067 create_traction_elements(5,Bulk_mesh_pt,Applied_fluid_traction_mesh_pt);
1072 create_lagrange_multiplier_elements();
1087 unsigned n_element=Applied_fluid_traction_mesh_pt->nelement();
1093 Applied_fluid_traction_mesh_pt->element_pt(
e));
1116 bulk_mesh_pt()->boundary_node_pt(
ibound,
inod)->
1118 FSI_functions::apply_no_slip_on_moving_wall);
1129 FSI_functions::setup_fluid_load_info_for_solid_elements<ELEMENT,2>
1130 (
this,3,Bulk_mesh_pt,Wall_mesh_pt);
1148 if (CommandLineArgs::Argc>1)
1180 problem(nup, ncollapsible, ndown, ny,
1190 problem(nup, ncollapsible, ndown, ny,
1210 problem.set_initial_condition();
1230 if (CommandLineArgs::Argc>1)
1237 problem.bulk_mesh_pt()->max_permitted_error()=1.0e-3;
1238 problem.bulk_mesh_pt()->min_permitted_error()=1.0e-5;
1241 if (CommandLineArgs::Argc>1)
1244 problem.bulk_mesh_pt()->max_permitted_error()=0.5e-2;
1245 problem.bulk_mesh_pt()->min_permitted_error()=0.5e-4;
Upgrade mesh to solid mesh.
Mesh * Applied_fluid_traction_mesh_pt
Pointer to the "surface" mesh that applies the traction at the inflow.
double Ldown
x-length in the downstream part of the channel
Node * Left_node_pt
Pointer to the left control node.
Node * Right_node_pt
Pointer to right control node.
unsigned Nup
Number of elements in the x direction in the upstream part of the channel.
OneDLagrangianMesh< FSIHermiteBeamElement > * Wall_mesh_pt
Pointer to the "wall" mesh.
void create_lagrange_multiplier_elements()
Create elements that enforce prescribed boundary motion by Lagrange multiplilers.
SolidMesh * Lagrange_multiplier_mesh_pt
Pointers to mesh of Lagrange multiplier elements.
unsigned Ncollapsible
Number of elements in the x direction in the collapsible part of the channel.
void actions_after_newton_solve()
Update the problem after solve (empty)
ConstitutiveLaw * Constitutive_law_pt
Constitutive law used to determine the mesh deformation.
unsigned Ny
Number of elements across the channel.
unsigned Ndown
Number of elements in the x direction in the downstream part of the channel.
ElasticRefineableCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt()
Access function for the specific bulk (fluid) mesh.
double Lup
x-length in the upstream part of the channel
MeshAsGeomObject * Wall_geom_object_pt
Geometric object incarnation of the wall mesh.
void actions_before_adapt()
Actions before adapt: Wipe the mesh of prescribed traction elements.
MacroElementNodeUpdateCollapsibleChannelMesh< ELEMENT > * Bulk_mesh_pt
Pointer to the "bulk" mesh.
void delete_lagrange_multiplier_elements()
Delete elements that enforce prescribed boundary motion by Lagrange multiplilers.
~FSICollapsibleChannelProblem()
Destructor (empty)
ElasticRefineableCollapsibleChannelMesh< ELEMENT > * Bulk_mesh_pt
Pointer to the "bulk" mesh.
void actions_before_newton_convergence_check()
Update no slip before Newton convergence check.
void actions_before_newton_solve()
Update the problem specs before solve (empty)
Node * Wall_node_pt
Pointer to control node on the wall.
double Ly
Transverse length.
void actions_after_adapt()
Actions after adapt: Rebuild the mesh of prescribed traction elements and reset FSI.
double Lcollapsible
x-length in the collapsible part of the channel
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt()
Access function for the wall mesh.
MacroElementNodeUpdateCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt()
Access function for the specific bulk (fluid) mesh.
void delete_traction_elements(Mesh *const &traction_mesh_pt)
Delete prescribed traction elements from the surface mesh.
void create_traction_elements(const unsigned &b, Mesh *const &bulk_mesh_pt, Mesh *const &traction_mesh_pt)
Create the prescribed traction elements on boundary b.
void set_initial_condition()
Apply initial conditions.
FSICollapsibleChannelProblem(const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly)
Constructor: The arguments are the number of elements and the lengths of the domain.
void doc_solution(DocInfo &doc_info, ofstream &trace_file)
Doc the solution.
GeomObject *& wall_pt()
Access function to GeomObject representing wall.
unsigned Ncollapsible
Number of element columns in collapsible part.
unsigned Nup
Number of element columns in upstream part.
unsigned Ndown
Number of element columns in downstream part.
unsigned Ny
Number of element rows across channel.
Collapsible channel mesh with MacroElement-based node update. The collapsible segment is represented ...
Refineable collapsible channel mesh. The mesh is derived from the SimpleRectangularQuadMesh so it's n...
const unsigned & ny() const
Access function for number of elements in y directions.
int main(int argc, char *argv[])
Driver code for a collapsible channel problem with FSI. Presence of command line arguments indicates ...
Namespace to define the mapping [0,1] -> [0,1] that re-distributes nodal points across the channel wi...
double squash_fct(const double &s)
Mapping [0,1] -> [0,1] that re-distributes nodal points across the channel width.
double Delta
Boundary layer width.
double Fract_in_BL
Fraction of points in boundary layer.
Namespace for phyical parameters.
double P_ext
External pressure.
double ReSt
Womersley = Reynolds times Strouhal.
void prescribed_traction(const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Traction applied on the fluid at the left (inflow) boundary.
void load(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Load function: Apply a constant external pressure to the wall. Note: This is the load without the flu...
double Nu
Pseudo-solid Poisson ratio.
double Sigma0
2nd Piola Kirchhoff pre-stress. As in Jensen & Heil (2003) paper.
double Q
Fluid structure interaction parameter: Ratio of stresses used for non-dimensionalisation of fluid to ...
double Lambda_sq
Pseudo-solid mass density.
double Re
Reynolds number.
double P_up
Default pressure on the left boundary.
double H
Non-dimensional wall thickness. As in Jensen & Heil (2003) paper.