26 #ifndef OOMPH_BRETHERTON_SPINE_MESH_HEADER
27 #define OOMPH_BRETHERTON_SPINE_MESH_HEADER
44 template<
class ELEMENT,
class INTERFACE_ELEMENT>
69 const unsigned& nhalf,
73 const double& zeta_start,
74 const double& zeta_transition_start,
75 const double& zeta_transition_end,
76 const double& zeta_end,
122 const double& zeta_lo_transition_end,
123 const double& zeta_up_transition_start,
124 const double& zeta_up_transition_end);
130 unsigned n_spine = this->
nspine();
131 for (
unsigned i = 0;
i < n_spine;
i++)
174 std::ostringstream error_message;
175 error_message <<
"Incorrect spine update id " <<
id << std::endl;
178 OOMPH_CURRENT_FUNCTION,
179 OOMPH_EXCEPTION_LOCATION);
211 double w = spine_node_pt->
fraction();
213 double h = spine_node_pt->
h();
224 spine_node_pt->
x(0) = r_wall_lo[0];
225 spine_node_pt->
x(1) = r_wall_lo[1] + w * h;
234 double w = spine_node_pt->
fraction();
236 double h = spine_node_pt->
h();
258 spine_centre[0] = 0.5 * (r_transition_lo[0] + r_transition_up[0]);
266 N[0] = spine_centre[0] - r_wall_lo[0];
267 N[1] = spine_centre[1] - r_wall_lo[1];
268 double inv_length = 1.0 / sqrt(
N[0] *
N[0] +
N[1] *
N[1]);
270 spine_node_pt->
x(0) = r_wall_lo[0] + w * h *
N[0] * inv_length;
271 spine_node_pt->
x(1) = r_wall_lo[1] + w * h *
N[1] * inv_length;
280 double w = spine_node_pt->
fraction();
282 double h = spine_node_pt->
h();
299 S0[0] = r_lo[0] + vertical_fraction * (r_up[0] - r_lo[0]);
300 S0[1] = r_lo[1] + vertical_fraction * (r_up[1] - r_lo[1]);
315 spine_centre[0] = 0.5 * (r_transition_lo[0] + r_transition_up[0]);
323 N[0] = spine_centre[0] - S0[0];
324 N[1] = spine_centre[1] - S0[1];
326 double inv_length = 1.0 / sqrt(
N[0] *
N[0] +
N[1] *
N[1]);
328 spine_node_pt->
x(0) = S0[0] + w * h *
N[0] * inv_length;
329 spine_node_pt->
x(1) = S0[1] + w * h *
N[1] * inv_length;
338 double w = spine_node_pt->
fraction();
340 double h = spine_node_pt->
h();
357 S0[0] = r_lo[0] + vertical_fraction * (r_up[0] - r_lo[0]);
358 S0[1] = r_lo[1] + vertical_fraction * (r_up[1] - r_lo[1]);
373 spine_centre[0] = 0.5 * (r_transition_lo[0] + r_transition_up[0]);
381 N[0] = spine_centre[0] - S0[0];
382 N[1] = spine_centre[1] - S0[1];
384 double inv_length = 1.0 / sqrt(
N[0] *
N[0] +
N[1] *
N[1]);
386 spine_node_pt->
x(0) = S0[0] + w * h *
N[0] * inv_length;
387 spine_node_pt->
x(1) = S0[1] + w * h *
N[1] * inv_length;
396 double w = spine_node_pt->
fraction();
398 double h = spine_node_pt->
h();
420 spine_centre[0] = 0.5 * (r_transition_lo[0] + r_transition_up[0]);
428 N[0] = spine_centre[0] - r_wall_up[0];
429 N[1] = spine_centre[1] - r_wall_up[1];
430 double inv_length = 1.0 / sqrt(
N[0] *
N[0] +
N[1] *
N[1]);
433 spine_node_pt->
x(0) = r_wall_up[0] + w * h *
N[0] * inv_length;
434 spine_node_pt->
x(1) = r_wall_up[1] + w * h *
N[1] * inv_length;
443 double w = spine_node_pt->
fraction();
445 double h = spine_node_pt->
h();
456 spine_node_pt->
x(0) = r_wall_up[0];
457 spine_node_pt->
x(1) = r_wall_up[1] - w * h;
467 double w = spine_node_pt->
fraction();
480 spine_node_pt->
x(0) = r_lo[0] + w * (r_up[0] - r_lo[0]);
481 spine_node_pt->
x(1) = r_lo[1] + w * (r_up[1] - r_lo[1]);
Mesh for 2D Bretherton problem – based on single layer mesh. Templated by spine-ified Navier-Stokes e...
void spine_node_update_film_lower(SpineNode *spine_node_pt)
Update function for the deposited film region in the lower part of the domain: Vertical spines.
GeomObject * Lower_wall_pt
Pointer to geometric object that represents the lower wall.
void spine_node_update_horizontal_transition_lower(SpineNode *spine_node_pt)
Update function for the horizontal transitition region in the lower part of the domain: Spine points ...
void reposition_spines(const double &zeta_lo_transition_start, const double &zeta_lo_transition_end, const double &zeta_up_transition_start, const double &zeta_up_transition_end)
Reposition the spines in response to changes in geometry.
BrethertonSpineMesh(const unsigned &nx1, const unsigned &nx2, const unsigned &nx3, const unsigned &nh, const unsigned &nhalf, const double &h, GeomObject *lower_wall_pt, GeomObject *upper_wall_pt, const double &zeta_start, const double &zeta_transition_start, const double &zeta_transition_end, const double &zeta_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Arguments:
double Zeta_start
Start coordinate on wall.
double Zeta_transition_end
Wall coordinate of end of transition region.
unsigned Nhalf
Number of elements in vertical transition region (there are twice as many elements across the channel...
GeomObject * Upper_wall_pt
Pointer to geometric object that represents the upper wall.
Vector< FiniteElement * > Bulk_element_pt
Vector of pointers to element in the fluid layer.
unsigned Nx2
Number of elements along wall in horizontal transition region.
unsigned Nx3
Number of elements along wall in channel region.
double Default_spine_centre_fraction
Default spine fraction.
void set_spine_centre_fraction_pt(double *const &fraction_pt)
Set the pointer to the spine centre's vertial fraction.
void spine_node_update_film_upper(SpineNode *spine_node_pt)
Update function for the deposited film region in the upper part of the domain: Vertical spines.
double H
Thickness of deposited film.
unsigned long nbulk() const
Number of elements in bulk.
unsigned Nh
Number of elements across the deposited film.
void pin_all_spines()
Pin all spines so the mesh can be used for computation without free surfaces.
void initial_element_reorder()
Initial reordering elements of the elements – before the channel mesh is added. Vertical stacks of el...
void spine_node_update_channel(SpineNode *spine_node_pt)
Update function for the nodes in the channel region ahead of the finger tip: Nodes are evenly distrib...
double spine_centre_fraction() const
Read the value of the spine centre's vertical fraction.
void spine_node_update_vertical_transition_upper(SpineNode *spine_node_pt)
Update function for the vertical transitition region in the upper part of the domain: Spine points to...
Vector< FiniteElement * > Interface_element_pt
Vector of pointers to interface elements.
ELEMENT * Control_element_pt
Pointer to control element (just under the symmetry line near the bubble tip; the bubble tip is locat...
FiniteElement *& interface_element_pt(const unsigned long &i)
Access functions for pointers to interface elements.
FiniteElement *& bulk_element_pt(const unsigned long &i)
Access functions for pointers to elements in bulk.
void spine_node_update(SpineNode *spine_node_pt)
General node update function implements pure virtual function defined in SpineMesh base class and per...
ELEMENT * control_element_pt()
Pointer to control element (just under the symmetry line near the bubble tip, so the bubble tip is lo...
void spine_node_update_vertical_transition_lower(SpineNode *spine_node_pt)
Update function for the vertical transitition region in the lower part of the domain: Spine points to...
void spine_node_update_horizontal_transition_upper(SpineNode *spine_node_pt)
Update function for the horizontal transitition region in the upper part of the domain: Spine points ...
double Zeta_end
Wall coordinate of end of liquid filled region (inflow)
double find_distance_to_free_surface(GeomObject *const &fs_geom_object_pt, Vector< double > &initial_zeta, const Vector< double > &spine_base, const Vector< double > &spine_end)
Recalculate the spine lengths after repositioning.
unsigned nfree_surface_spines()
Number of free-surface spines (i.e. excluding the dummy spines in the channel region)
unsigned long ninterface_element() const
Number of elements on interface.
double * Spine_centre_fraction_pt
Pointer to vertical fraction of the spine centre.
unsigned Nx1
Number of elements along wall in deposited film region.
double Zeta_transition_start
Wall coordinate of start of the transition region.
void pin(const unsigned &i)
Pin the i-th stored variable.
A general Finite Element class.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
/////////////////////////////////////////////////////////////////////
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
double & x(const unsigned &i)
Return the i-th nodal coordinate.
An OomphLibError object which should be thrown when an run-time error is encountered....
Single-layer spine mesh class derived from standard 2D mesh. The mesh contains a layer of spinified f...
unsigned long nspine() const
Return the number of spines in the mesh.
Spine *& spine_pt(const unsigned long &i)
Return the i-th spine in the mesh.
Class for nodes that live on spines. The assumption is that each Node lies at a fixed fraction on a s...
double & h()
Access function to spine height.
Spine *& spine_pt()
Access function to spine.
unsigned & node_update_fct_id()
Access function to ID of node update function (within specific mesh)
double & fraction()
Set reference to fraction along spine.
GeomObject *& geom_object_pt(const unsigned &i)
Return i-th geometric object that is involved in the node update operations for this Spine.
double & geom_parameter(const unsigned &i)
Return i-th geometric parameter that is involved in the node update operations for this Spine.
Data *& spine_height_pt()
Access function to Data object that stores the spine height.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...