interface_elements.h
Go to the documentation of this file.
1 // LIC// ====================================================================
2 // LIC// This file forms part of oomph-lib, the object-oriented,
3 // LIC// multi-physics finite-element library, available
4 // LIC// at http://www.oomph-lib.org.
5 // LIC//
6 // LIC// Copyright (C) 2006-2024 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 // Header file for (one-dimensional) free surface elements
27 // Include guards, to prevent multiple includes
28 #ifndef OOMPH_INTERFACE_ELEMENTS_HEADER
29 #define OOMPH_INTERFACE_ELEMENTS_HEADER
30 
31 // Config header generated by autoconfig
32 #ifdef HAVE_CONFIG_H
33 #include <oomph-lib-config.h>
34 #endif
35 
36 #include "../generic/elements.h"
37 #include "../generic/spines.h"
38 #include "../generic/shape.h"
39 #include "../generic/hijacked_elements.h"
40 
41 namespace oomph
42 {
43  //========================================================================
44  /// Base class for elements at the boundary of free surfaces or interfaces,
45  /// used typically to impose contact angle boundary conditions.
46  /// The elemental dimensions are one less than those of the
47  /// surface elements, or two less than those of the original bulk elements.
48  /// Thus in two-dimensional and axi-symmetric problems, are points,
49  /// but in three-dimensional problems, they are lines.
50  /// These boundaries may be in contact with a solid surface, in which case
51  /// the normal to that surface must be provided.
52  //=========================================================================
53  class FluidInterfaceBoundingElement : public virtual FaceElement
54  {
55  private:
56  /// Function pointer to a wall unit normal function. Returns the
57  /// unit normal on the wall, at the specified Eulerian coordinate.
58  typedef void (*WallUnitNormalFctPt)(const Vector<double>& x,
59  Vector<double>& unit_normal);
60 
61  /// Pointer to a wall normal function that returns
62  /// the wall unit normal as a function of position in global
63  /// Eulerian coordinates.
65 
66  /// Pointer to the desired value of the contact angle (if any)
68 
69  /// Pointer to the desired value of the capillary number
70  double* Ca_pt;
71 
72  protected:
73  /// Flag used to determine whether the contact angle is to be
74  /// used (0 if not), and whether it will be applied weakly as a force term
75  /// in the momentum equations (1) or by hijacking the kinematic
76  /// condition (2).
78 
79  /// Index at which the i-th velocity component is stored in the
80  /// element's nodes
81  Vector<unsigned> U_index_interface_boundary;
82 
83  /// Function that is used to determine the local equation number of
84  /// the kinematic equation associated with the nodes of the element
85  /// This must be overloaded depending on the node update scheme
86  virtual int kinematic_local_eqn(const unsigned& n) = 0;
87 
88  /// Function that returns the unit normal of the bounding wall
89  /// directed out of the fluid
90  void wall_unit_normal(const Vector<double>& x, Vector<double>& normal)
91  {
92 #ifdef PARANOID
94  {
95 #endif
96  (*Wall_unit_normal_fct_pt)(x, normal);
97 #ifdef PARANOID
98  }
99  else
100  {
101  throw OomphLibError("Wall unit normal fct has not been set",
102  "FluidInterfaceBoundingElement::wall_unit_normal()",
103  OOMPH_EXCEPTION_LOCATION);
104  }
105 #endif
106  }
107 
108  /// The geometric data of the parent element is included as
109  /// external data and so a (bulk) node update must take place after
110  /// the variation of any of this external data
111  inline void update_in_external_fd(const unsigned& i)
112  {
113  // Update the bulk element
114  bulk_element_pt()->node_update();
115  }
116 
117  /// The only external data are these geometric data so
118  /// We can omit the reset function (relying on the next update
119  // function to take care of the remesh)
120  inline void reset_in_external_fd(const unsigned& i) {}
121 
122  /// We require a final node update in the bulk element
123  /// after all finite differencing
125  {
126  // Update the bulk element
127  bulk_element_pt()->node_update();
128  }
129 
130  public:
131  /// Constructor
134  Contact_angle_pt(0),
135  Ca_pt(0),
137  {
138  }
139 
140  /// Access function: Pointer to wall unit normal function
142  {
144  }
145 
146  /// Access function: Pointer to wall unit normal function. Const version
148  {
150  }
151 
152  /// Access for nodal index at which the velocity components are stored
153  Vector<unsigned>& u_index_interface_boundary()
154  {
156  }
157 
158  /// Set a pointer to the desired contact angle. Optional boolean
159  /// (defaults to true)
160  /// chooses strong imposition via hijacking (true) or weak imposition
161  /// via addition to momentum equation (false). The default strong imposition
162  /// is appropriate for static contact angle problems.
163  void set_contact_angle(double* const& angle_pt, const bool& strong = true);
164 
165  /// Access function to the pointer specifying the prescribed contact angle
166  double*& contact_angle_pt()
167  {
168  return Contact_angle_pt;
169  }
170 
171  /// Access function to the pointer specifying the capillary number
172  double*& ca_pt()
173  {
174  return Ca_pt;
175  }
176 
177  /// Return the value of the capillary number
178  double ca()
179  {
180 #ifdef PARANOID
181  if (Ca_pt != 0)
182  {
183 #endif
184  return *Ca_pt;
185 #ifdef PARANOID
186  }
187  else
188  {
189  throw OomphLibError("Capillary number has not been set",
190  "FluidInterfaceBoundingElement::ca()",
191  OOMPH_EXCEPTION_LOCATION);
192  }
193 #endif
194  }
195 
196 
197  /// Return value of the contact angle
198  double& contact_angle()
199  {
200 #ifdef PARANOID
201  if (Contact_angle_pt == 0)
202  {
203  std::string error_message = "Contact angle not set\n";
204  error_message +=
205  "Please use FluidInterfaceBoundingElement::set_contact_angle()\n";
206  throw OomphLibError(
207  error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
208  }
209 #endif
210  return *Contact_angle_pt;
211  }
212 
213  /// Calculate the residuals
214  void fill_in_contribution_to_residuals(Vector<double>& residuals)
215  {
216  // Add the residual contributions using a dummy matrix
218  residuals, GeneralisedElement::Dummy_matrix, 0);
219  }
220 
221  /// Calculate the generic residuals contribution
223  Vector<double>& residuals,
224  DenseMatrix<double>& jacobian,
225  unsigned flag) = 0;
226 
227 
228  /// Empty helper function to calculate the additional contributions
229  /// arising from the node update strategy to the Jacobian within the
230  /// integration loop. This will be overloaded by elements that require
231  /// contributions to their underlying equations from boundary integrals.
232  /// The shape functions, their derivatives w.r.t. to the local coordinates,
233  /// the unit normal and integral weight are passed in so that they do not
234  /// have to be recalculated.
236  Vector<double>& residuals,
237  DenseMatrix<double>& jacobian,
238  const unsigned& flag,
239  const Shape& psif,
240  const DShape& dpsifds,
241  const Vector<double>& interpolated_n,
242  const double& W)
243  {
244  }
245 
246  /// Overload the output function
247  void output(std::ostream& outfile)
248  {
249  FiniteElement::output(outfile);
250  }
251 
252  /// Output function
253  void output(std::ostream& outfile, const unsigned& n_plot)
254  {
255  FiniteElement::output(outfile, n_plot);
256  }
257 
258  /// Overload the C-style output function
259  void output(FILE* file_pt)
260  {
261  FiniteElement::output(file_pt);
262  }
263 
264  /// C-style Output function
265  void output(FILE* file_pt, const unsigned& n_plot)
266  {
267  FiniteElement::output(file_pt, n_plot);
268  }
269  };
270 
271 
272  //==========================================================================
273  /// Specialisation of the interface boundary constraint to a point
274  //==========================================================================
277  {
278  protected:
279  /// Overload the helper function to calculate the residuals and
280  /// (if flag==1) the Jacobian -- this function only deals with
281  /// the part of the Jacobian that can be handled generically.
282  /// Specific additional contributions may be provided in
283  /// add_additional_residual_contributions_interface_boundary(...)
285  Vector<double>& residuals, DenseMatrix<double>& jacobian, unsigned flag);
286 
287  public:
288  /// Constructor
290  };
291 
292 
293  //==========================================================================
294  /// Specialisation of the interface boundary constraint to a line
295  //==========================================================================
297  {
298  protected:
299  /// Overload the helper function to calculate the residuals and
300  /// (if flag==true) the Jacobian -- this function only deals with
301  /// the part of the Jacobian that can be handled generically.
302  /// Specific additional contributions may be provided in
303  /// add_additional_residual_contributions_interface_boundary()
305  Vector<double>& residuals, DenseMatrix<double>& jacobian, unsigned flag);
306 
307  public:
308  /// Constructor
310  };
311 
312 
313  //=======================================================================
314  /// Base class establishing common interfaces and functions for all
315  /// Navier-Stokes-like fluid
316  /// interface elements. Namely, elements that represent either a free
317  /// surface or an interface between two fluids that have distinct
318  /// momentum-like equation for each velocity component.
319  //======================================================================
320  class FluidInterfaceElement : public virtual FaceElement
321  {
322  // Make the bounding element class a friend
324 
325  private:
326  /// Pointer to the Capillary number
327  double* Ca_pt;
328 
329  /// Pointer to the Strouhal number
330  double* St_pt;
331 
332  /// Default value for physical constants
334 
335 
336  protected:
337  /// Nodal index at which the i-th velocity component is stored.
338  Vector<unsigned> U_index_interface;
339 
340  /// The Data that contains the external pressure is stored
341  /// as external Data for the element. Which external Data item is it?
342  /// (int so it can be initialised to -1, indicating that external
343  /// pressure hasn't been set).
345 
346  /// Pointer to the Data item that stores the external pressure
348 
349  /// Which of the values in Pext_data_pt stores the external pressure
351 
352  /// Access function that returns the local equation number
353  /// for the (scalar) kinematic equation associated with the j-th local
354  /// node. This must be overloaded by specific interface elements
355  /// and depends on the method for handing the free-surface deformation.
356  virtual int kinematic_local_eqn(const unsigned& n) = 0;
357 
358  /// Access function for the local equation number that
359  /// corresponds to the external pressure.
361  {
362 #ifdef PARANOID
364  {
365  throw OomphLibError("No external pressure has been set\n",
366  OOMPH_CURRENT_FUNCTION,
367  OOMPH_EXCEPTION_LOCATION);
368  }
369 #endif
370  return external_local_eqn(External_data_number_of_external_pressure,
372  }
373 
374  /// Helper function to calculate the residuals and
375  /// (if flag==1) the Jacobian of the equations.
376  /// This is implemented generically using the surface
377  /// divergence information that is overloaded in each element
378  /// i.e. axisymmetric, two- or three-dimensional.
380  Vector<double>& residuals, DenseMatrix<double>& jacobian, unsigned flag);
381 
382  /// Compute the surface gradient and surface divergence
383  /// operators given the shape functions, derivatives,
384  /// tangent vectors and position. All derivatives and
385  /// tangent vectors should be formed
386  /// with respect to the local coordinates.
387  ///
388  /// Return the jacobian of the surface, as well
389  /// as the dpsidS, and dpsidS_div objects.
390  ///
391  /// This is the only
392  /// function that needs to be overloaded to specify
393  /// different geometries.
394  ///
395  /// In order to compute the surface gradient of a scalar
396  /// function one needs only compute the sum over the nodes
397  /// of dpsidS(l,i) * nodal_value(l,scalar_index)
398  /// To compute the surface divergence of a vector quantity
399  /// one computes a sum over nodes and coordinate directions
400  /// dpsidS_div(l,i) * nodal_value(l,vector_index[i])
401  /// In Cartesian cordinates the two surface derivatives are the
402  /// same, but in Axisymmetric coordinates they are not!
404  const Shape& psi,
405  const DShape& dpsids,
406  const DenseMatrix<double>& interpolated_t,
407  const Vector<double>& interpolated_x,
408  DShape& dpsidS,
409  DShape& dpsidS_div) = 0;
410 
411  /// Helper function to calculate the additional contributions
412  /// to the resisuals and Jacobian that arise from specific node update
413  /// strategies. This is called within the integration loop over the
414  /// element (for efficiency) and therefore requires a fairly large
415  /// number of input parameters:
416  /// - the velocity shape functions and their derivatives w.r.t.
417  /// the local coordinates
418  /// - the surface gradient and divergence of the velocity shape
419  /// functions
420  /// - The local and Eulerian coordinates,
421  /// - the outer unit normal,
422  /// - the integration weight from the integration scheme
423  /// - the Jacobian of the mapping between the local and global coordinates
424  /// along the element. (Note that in the axisymmmetric case this
425  /// includes the r term)!
427  Vector<double>& residuals,
428  DenseMatrix<double>& jacobian,
429  const unsigned& flag,
430  const Shape& psif,
431  const DShape& dpsifds,
432  const DShape& dpsifdS,
433  const DShape& dpsifdS_div,
434  const Vector<double>& s,
435  const Vector<double>& interpolated_x,
436  const Vector<double>& interpolated_n,
437  const double& W,
438  const double& J)
439  {
440  }
441 
442  public:
443  /// Constructor, set the default values of the booleans and pointers (null)
445  {
446  // Initialise pointer to capillary number
447  Ca_pt = 0;
448 
449  // Set the Strouhal number to the default value
451  }
452 
453  /// Virtual function that specifies the non-dimensional
454  /// surface tension as a function of local position within the element.
455  /// The default behaviour is a constant surface tension of value 1.0
456  /// This function can be overloaded in more specialised elements to
457  /// incorporate variations in surface tension.
458  virtual double sigma(const Vector<double>& s_local)
459  {
460  return 1.0;
461  }
462 
463  /// Calculate the residuals by calling the generic residual contribution.
464  void fill_in_contribution_to_residuals(Vector<double>& residuals)
465  {
466  // Add the residual contributions
468  residuals, GeneralisedElement::Dummy_matrix, 0);
469  }
470 
471 
472  /// The value of the Capillary number
473  const double& ca() const
474  {
475 #ifdef PARANOID
476  if (Ca_pt != 0)
477  {
478 #endif
479  return *Ca_pt;
480 #ifdef PARANOID
481  }
482  else
483  {
484  throw OomphLibError("Capillary number has not been set",
485  "FluidInterfaceElement::ca()",
486  OOMPH_EXCEPTION_LOCATION);
487  }
488 #endif
489  }
490 
491  /// Pointer to the Capillary number
492  double*& ca_pt()
493  {
494  return Ca_pt;
495  }
496 
497  /// The value of the Strouhal number
498  const double& st() const
499  {
500  return *St_pt;
501  }
502 
503  /// The pointer to the Strouhal number
504  double*& st_pt()
505  {
506  return St_pt;
507  }
508 
509  /// Return the i-th velocity component at local node j.
510  double u(const unsigned& j, const unsigned& i)
511  {
512  return node_pt(j)->value(U_index_interface[i]);
513  }
514 
515  /// Calculate the i-th velocity component at the local coordinate s.
516  double interpolated_u(const Vector<double>& s, const unsigned& i);
517 
518  /// Return the value of the external pressure
519  double pext() const
520  {
521  // If the external pressure has not been set, then return a
522  // default value of zero.
523  if (Pext_data_pt == 0)
524  {
525  return 0.0;
526  }
527  // Otherwise return the appropriate value
528  else
529  {
531  }
532  }
533 
534  /// Set the Data that contains the single pressure value
535  /// that specifies the "external pressure" for the
536  /// interface/free-surface. Setting this only makes sense
537  /// if the interface is, in fact, a free surface (well,
538  /// an interface to another inviscid fluid if you want to be picky).
539  void set_external_pressure_data(Data* external_pressure_data_pt)
540  {
541 #ifdef PARANOID
542  if (external_pressure_data_pt->nvalue() != 1)
543  {
544  std::ostringstream error_message;
545  error_message
546  << "External pressure Data must only contain a single value!\n"
547  << "This one contains " << external_pressure_data_pt->nvalue()
548  << std::endl;
549 
550  throw OomphLibError(error_message.str(),
551  OOMPH_CURRENT_FUNCTION,
552  OOMPH_EXCEPTION_LOCATION);
553  }
554 #endif
555 
556  // Store pointer explicitly
557  Pext_data_pt = external_pressure_data_pt;
558 
559  // Add the external pressure to the element's external Data?
560  // But do not finite-difference with respect to it
561  this->add_external_data(Pext_data_pt, false);
562 
563  // The external pressure has just been promoted to become
564  // external Data of this element -- what is its number?
565  External_data_number_of_external_pressure = this->nexternal_data() - 1;
566 
567  // Index of pressure value in Data object
569  }
570 
571  /// Set the Data that contains the pressure value
572  /// that specifies the "external pressure" for the
573  /// interface/free-surface. Setting this only makes sense
574  /// if the interface is, in fact, a free surface (well,
575  /// an interface to another inviscid fluid if you want to be picky).
576  /// Second argument specifies the index of the pressure
577  /// value within the Data object.
579  Data* external_pressure_data_pt,
580  const unsigned& index_of_external_pressure_value)
581  {
582  // Index of pressure value in Data object
583  Index_of_external_pressure_value = index_of_external_pressure_value;
584 
585 #ifdef PARANOID
586  if (index_of_external_pressure_value >=
587  external_pressure_data_pt->nvalue())
588  {
589  std::ostringstream error_message;
590  error_message << "External pressure Data only contains "
591  << external_pressure_data_pt->nvalue() << " values\n"
592  << "You have declared value "
593  << index_of_external_pressure_value
594  << " to be the value representing the pressure\n"
595  << std::endl;
596  throw OomphLibError(error_message.str(),
597  OOMPH_CURRENT_FUNCTION,
598  OOMPH_EXCEPTION_LOCATION);
599  }
600 #endif
601 
602  // Store pointer explicitly
603  Pext_data_pt = external_pressure_data_pt;
604 
605  // Add the external pressure to the element's external Data?
606  // But do not finite-difference with respect to it
607  this->add_external_data(Pext_data_pt, false);
608 
609  // The external pressure has just been promoted to become
610  // external Data of this element -- what is its number?
611  External_data_number_of_external_pressure = this->nexternal_data() - 1;
612  }
613 
614 
615  /// Create a bounding element e.g. to apply a contact angle boundary
616  /// condition
618  const int& face_index)
619  {
620  throw OomphLibError("Virtual function not yet implemented",
621  OOMPH_CURRENT_FUNCTION,
622  OOMPH_EXCEPTION_LOCATION);
623  return 0;
624  }
625 
626 
627  /// Hijack the kinematic condition at the node numbers passed in
628  /// the vector. The node numbers correspond to the local numbers of
629  /// nodes in the associated bulk element.
630  /// This is required so that contact-angle conditions can be applied
631  /// by the FluidInterfaceBoundingElements.
633  const Vector<unsigned>& bulk_node_number) = 0;
634 
635  /// Overload the output function
636  void output(std::ostream& outfile)
637  {
638  FiniteElement::output(outfile);
639  }
640 
641  /// Output function
642  void output(std::ostream& outfile, const unsigned& n_plot);
643 
644  /// Overload the C-style output function
645  void output(FILE* file_pt)
646  {
647  FiniteElement::output(file_pt);
648  }
649 
650  /// C-style Output function
651  void output(FILE* file_pt, const unsigned& n_plot);
652  };
653 
654 
655  //=============================================================
656  /// Class that establishes the surface derivative functions for
657  /// LineElements. These are defined in a separate class so that
658  /// they can be used by other interface equation-type classes.
659  //=============================================================
661  {
662  public:
663  // Empty Constructor
665 
666  protected:
667  /// Fill in the specific surface derivative calculations
669  const Shape& psi,
670  const DShape& dpsids,
671  const DenseMatrix<double>& interpolated_t,
672  const Vector<double>& interpolated_x,
673  DShape& surface_gradient,
674  DShape& surface_divergence);
675  };
676 
677 
678  //=============================================================
679  /// Class that establishes the surface derivative functions for
680  /// AxisymmetricInterfaceElements.
681  /// These are defined in a separate class so that
682  /// they can be used by other interface equation-type classes.
683  //=============================================================
685  {
686  public:
687  // Empty Constructor
689 
690  protected:
691  /// Fill in the specific surface derivative calculations
693  const Shape& psi,
694  const DShape& dpsids,
695  const DenseMatrix<double>& interpolated_t,
696  const Vector<double>& interpolated_x,
697  DShape& surface_gradient,
698  DShape& surface_divergence);
699  };
700 
701 
702  //=============================================================
703  /// Class that establishes the surface derivative functions for
704  /// SurfaceInterfaceElements (2D surfaces in 3D space)
705  /// These are defined in a separate class so that
706  /// they can be used by other interface equation-type classes.
707  //=============================================================
709  {
710  public:
711  // Empty Constructor
713 
714  protected:
715  /// Fill in the specific surface derivative calculations
717  const Shape& psi,
718  const DShape& dpsids,
719  const DenseMatrix<double>& interpolated_t,
720  const Vector<double>& interpolated_x,
721  DShape& surface_gradient,
722  DShape& surface_divergence);
723  };
724 
725 
726 } // namespace oomph
727 
728 #endif
Class that establishes the surface derivative functions for AxisymmetricInterfaceElements....
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations.
Base class for elements at the boundary of free surfaces or interfaces, used typically to impose cont...
double *& contact_angle_pt()
Access function to the pointer specifying the prescribed contact angle.
Vector< unsigned > U_index_interface_boundary
Index at which the i-th velocity component is stored in the element's nodes.
void(* WallUnitNormalFctPt)(const Vector< double > &x, Vector< double > &unit_normal)
Function pointer to a wall unit normal function. Returns the unit normal on the wall,...
virtual int kinematic_local_eqn(const unsigned &n)=0
Function that is used to determine the local equation number of the kinematic equation associated wit...
void wall_unit_normal(const Vector< double > &x, Vector< double > &normal)
Function that returns the unit normal of the bounding wall directed out of the fluid.
double * Contact_angle_pt
Pointer to the desired value of the contact angle (if any)
WallUnitNormalFctPt wall_unit_normal_fct_pt() const
Access function: Pointer to wall unit normal function. Const version.
WallUnitNormalFctPt & wall_unit_normal_fct_pt()
Access function: Pointer to wall unit normal function.
virtual void add_additional_residual_contributions_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag, const Shape &psif, const DShape &dpsifds, const Vector< double > &interpolated_n, const double &W)
Empty helper function to calculate the additional contributions arising from the node update strategy...
double & contact_angle()
Return value of the contact angle.
virtual void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)=0
Calculate the generic residuals contribution.
void reset_after_external_fd()
We require a final node update in the bulk element after all finite differencing.
void reset_in_external_fd(const unsigned &i)
The only external data are these geometric data so We can omit the reset function (relying on the nex...
double *& ca_pt()
Access function to the pointer specifying the capillary number.
void output(std::ostream &outfile)
Overload the output function.
void set_contact_angle(double *const &angle_pt, const bool &strong=true)
Set a pointer to the desired contact angle. Optional boolean (defaults to true) chooses strong imposi...
void output(FILE *file_pt)
Overload the C-style output function.
void update_in_external_fd(const unsigned &i)
The geometric data of the parent element is included as external data and so a (bulk) node update mus...
WallUnitNormalFctPt Wall_unit_normal_fct_pt
Pointer to a wall normal function that returns the wall unit normal as a function of position in glob...
double * Ca_pt
Pointer to the desired value of the capillary number.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Calculate the residuals.
Vector< unsigned > & u_index_interface_boundary()
Access for nodal index at which the velocity components are stored.
double ca()
Return the value of the capillary number.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
unsigned Contact_angle_flag
Flag used to determine whether the contact angle is to be used (0 if not), and whether it will be app...
Base class establishing common interfaces and functions for all Navier-Stokes-like fluid interface el...
virtual double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &dpsidS, DShape &dpsidS_div)=0
Compute the surface gradient and surface divergence operators given the shape functions,...
virtual void add_additional_residual_contributions_interface(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag, const Shape &psif, const DShape &dpsifds, const DShape &dpsifdS, const DShape &dpsifdS_div, const Vector< double > &s, const Vector< double > &interpolated_x, const Vector< double > &interpolated_n, const double &W, const double &J)
Helper function to calculate the additional contributions to the resisuals and Jacobian that arise fr...
const double & st() const
The value of the Strouhal number.
double *& ca_pt()
Pointer to the Capillary number.
unsigned Index_of_external_pressure_value
Which of the values in Pext_data_pt stores the external pressure.
int External_data_number_of_external_pressure
The Data that contains the external pressure is stored as external Data for the element....
virtual FluidInterfaceBoundingElement * make_bounding_element(const int &face_index)
Create a bounding element e.g. to apply a contact angle boundary condition.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Calculate the residuals by calling the generic residual contribution.
FluidInterfaceElement()
Constructor, set the default values of the booleans and pointers (null)
double u(const unsigned &j, const unsigned &i)
Return the i-th velocity component at local node j.
double *& st_pt()
The pointer to the Strouhal number.
virtual int kinematic_local_eqn(const unsigned &n)=0
Access function that returns the local equation number for the (scalar) kinematic equation associated...
Vector< unsigned > U_index_interface
Nodal index at which the i-th velocity component is stored.
void set_external_pressure_data(Data *external_pressure_data_pt)
Set the Data that contains the single pressure value that specifies the "external pressure" for the i...
double pext() const
Return the value of the external pressure.
virtual double sigma(const Vector< double > &s_local)
Virtual function that specifies the non-dimensional surface tension as a function of local position w...
virtual void hijack_kinematic_conditions(const Vector< unsigned > &bulk_node_number)=0
Hijack the kinematic condition at the node numbers passed in the vector. The node numbers correspond ...
void set_external_pressure_data(Data *external_pressure_data_pt, const unsigned &index_of_external_pressure_value)
Set the Data that contains the pressure value that specifies the "external pressure" for the interfac...
double interpolated_u(const Vector< double > &s, const unsigned &i)
Calculate the i-th velocity component at the local coordinate s.
Data * Pext_data_pt
Pointer to the Data item that stores the external pressure.
void output(std::ostream &outfile)
Overload the output function.
const double & ca() const
The value of the Capillary number.
int pext_local_eqn()
Access function for the local equation number that corresponds to the external pressure.
void output(FILE *file_pt)
Overload the C-style output function.
double * Ca_pt
Pointer to the Capillary number.
static double Default_Physical_Constant_Value
Default value for physical constants.
double * St_pt
Pointer to the Strouhal number.
virtual void fill_in_generic_residual_contribution_interface(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Helper function to calculate the residuals and (if flag==1) the Jacobian of the equations....
Class that establishes the surface derivative functions for LineElements. These are defined in a sepa...
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations.
Specialisation of the interface boundary constraint to a line.
void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Overload the helper function to calculate the residuals and (if flag==true) the Jacobian – this funct...
Specialisation of the interface boundary constraint to a point.
void fill_in_generic_residual_contribution_interface_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Overload the helper function to calculate the residuals and (if flag==1) the Jacobian – this function...
Class that establishes the surface derivative functions for SurfaceInterfaceElements (2D surfaces in ...
double compute_surface_derivatives(const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
Fill in the specific surface derivative calculations.