surfactant_transport_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-2023 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 specific (two-dimensional) fluid free surface elements
27 
28 // Include guards, to prevent multiple includes
29 #ifndef OOMPH_SURFACTANT_TRANSPORT_ELEMENTS_HEADER
30 #define OOMPH_SURFACTANT_TRANSPORT_ELEMENTS_HEADER
31 
32 
33 // Config header generated by autoconfig
34 #ifdef HAVE_CONFIG_H
35 #include <oomph-lib-config.h>
36 #endif
37 
38 // OOMPH-LIB headers
40 
41 namespace oomph
42 {
43  //==================================================================
44  /// Generic surfactant transport equations implemented
45  /// independently of the dimension and then specialised using
46  /// the generic mechanisms introduce in the FluidInterfaceElements
47  //=================================================================
49  {
50  private:
51  /// Pointer to an Elasticity number
52  double* Beta_pt;
53 
54  /// Pointer to Surface Peclet number
55  double* Peclet_S_pt;
56 
57  /// Pointer to the surface Peclect Strouhal number
59 
60  protected:
61  /// Index at which the surfactant concentration is stored at the
62  /// nodes
64 
65 
66  /// Default value of the physical constants
68 
69  /// Get the surfactant concentration
70  double interpolated_C(const Vector<double>& s);
71 
72  /// The time derivative of the surface concentration
73  double dcdt_surface(const unsigned& l) const;
74 
75  /// The surface tension function is linear in the
76  /// concentration with constant of proportionality equal
77  /// to the elasticity number.
78  double sigma(const Vector<double>& s);
79 
80  /// Return the derivative of sigma with respect to C
81  /// For use in computing the Jacobian
82  virtual double dsigma_dC(const Vector<double>& s)
83  {
84  return -this->beta();
85  }
86 
87  /// Overload the Helper function to calculate the residuals and
88  /// jacobian entries. This particular function ensures that the
89  /// additional entries are calculated inside the integration loop
91  Vector<double>& residuals,
92  DenseMatrix<double>& jacobian,
93  const unsigned& flag,
94  const Shape& psif,
95  const DShape& dpsifds,
96  const DShape& dpsifdS,
97  const DShape& dpsifdS_div,
98  const Vector<double>& s,
100  const Vector<double>& interpolated_n,
101  const double& W,
102  const double& J);
103 
104 
105  /// Add the element's contribution to its residuals vector,
106  /// jacobian matrix and mass matrix
108  Vector<double>& residuals,
109  DenseMatrix<double>& jacobian,
110  DenseMatrix<double>& mass_matrix)
111  {
112  // Add the contribution to the jacobian
113  this->fill_in_contribution_to_jacobian(residuals, jacobian);
114  // No mass matrix terms, but should probably do kinematic bit here
115  }
116 
117  public:
118  /// Constructor that passes the bulk element and face index down
119  /// to the underlying
121  {
122  // Initialise the values
126  }
127 
128  // Set the c_index
129  inline void set_c_index(const Vector<unsigned>& c_index)
130  {
131  this->C_index = c_index;
132  }
133 
134  /// Return the Elasticity number
135  double beta()
136  {
137  return *Beta_pt;
138  }
139 
140  /// Return the surface peclect number
141  double peclet_s()
142  {
143  return *Peclet_S_pt;
144  }
145 
146  /// Return the surface peclect strouhal number
148  {
149  return *Peclet_Strouhal_S_pt;
150  }
151 
152  /// Access function for pointer to the Elasticity number
153  double*& beta_pt()
154  {
155  return Beta_pt;
156  }
157 
158  /// Access function for pointer to the surface Peclet number
159  double*& peclet_s_pt()
160  {
161  return Peclet_S_pt;
162  }
163 
164  /// Access function for pointer to the surface Peclet x Strouhal number
166  {
167  return Peclet_Strouhal_S_pt;
168  }
169 
170 
171  /// Overload the output function
172  void output(std::ostream& outfile)
173  {
174  FiniteElement::output(outfile);
175  }
176 
177  void output(std::ostream& outfile, const unsigned& n_plot);
178 
179  /// Overload the C-style output function
180  void output(FILE* file_pt)
181  {
182  FiniteElement::output(file_pt);
183  }
184 
185  /// C-style Output function
186  void output(FILE* file_pt, const unsigned& n_plot)
187  {
188  FiniteElement::output(file_pt, n_plot);
189  }
190 
191  /// Compute the concentration intergated over the surface area
192  double integrate_c();
193  };
194 
195 
196  /// =============================================================================
197  /// This is the policy class for the surfactanttransport equations which
198  /// require one additional value for the surface concentration
199  //=============================================================================
200  template<>
202  {
203  public:
205 
206  inline unsigned nadditional_values(const unsigned& n)
207  {
208  return 1;
209  }
210 
212  SurfactantTransportInterfaceElement* const& element_pt,
213  const unsigned& id)
214  {
215  const unsigned n_node = element_pt->nnode();
216  Vector<unsigned> c_index(n_node);
217  for (unsigned n = 0; n < n_node; n++)
218  {
219  c_index[n] = dynamic_cast<BoundaryNodeBase*>(element_pt->node_pt(n))
220  ->index_of_first_value_assigned_by_face_element(id);
221  }
222 
223  element_pt->set_c_index(c_index);
224  }
225  };
226 
227 
228  //-------------------------------GEOMETRIC SPECIALISATIONS----------------
229 
230  /// Specialise to the Line geometry
231  template<class ELEMENT>
234  SurfactantTransportInterfaceElement,
235  LineDerivatives,
236  ELEMENT>
237  {
238  public:
240  FiniteElement* const& element_pt, const int& face_index)
243  ELEMENT>(element_pt, face_index)
244  {
245  }
246  };
247 
248 
249  // Define the bounding element type for the line elements
250  template<class ELEMENT>
254  ELEMENT>>
256  {
257  public:
261  ELEMENT>>()
263  {
264  }
265  };
266 
267 
268  /// Specialise to the Axisymmetric geometry
269  template<class ELEMENT>
272  SurfactantTransportInterfaceElement,
273  AxisymmetricDerivatives,
274  ELEMENT>
275  {
276  public:
278  FiniteElement* const& element_pt, const int& face_index)
281  ELEMENT>(element_pt, face_index)
282  {
283  }
284  };
285 
286 
287  // Define the bounding element type for the axisymmetric surface
288  template<class ELEMENT>
292  ELEMENT>>
294  {
295  public:
299  ELEMENT>>()
301  {
302  }
303  };
304 
305  /// Specialise to the Axisymmetric geometry
306  template<class ELEMENT>
309  SurfactantTransportInterfaceElement,
310  AxisymmetricDerivatives,
311  ELEMENT>
312  {
313  public:
315  FiniteElement* const& element_pt, const int& face_index)
318  ELEMENT>(element_pt, face_index)
319  {
320  }
321  };
322 
323 
324  // Define the bounding element type for the axisymmetric surface
325  template<class ELEMENT>
329  ELEMENT>>
331  {
332  public:
336  ELEMENT>>()
338  {
339  }
340  };
341 
342 
343  /// Specialise to surface geometry
344  template<class ELEMENT>
347  SurfactantTransportInterfaceElement,
348  SurfaceDerivatives,
349  ELEMENT>
350  {
351  public:
353  FiniteElement* const& element_pt, const int& face_index)
356  ELEMENT>(element_pt, face_index)
357  {
358  }
359  };
360 
361 
362  // Define the bounding element type for the 2D surface
363  template<class ELEMENT>
367  ELEMENT>>
369  {
370  public:
374  ELEMENT>>()
376  {
377  }
378  };
379 
380 
381 } // namespace oomph
382 
383 #endif
static char t char * s
Definition: cfortran.h:568
Class that establishes the surface derivative functions for AxisymmetricInterfaceElements....
A class that contains the information required by Nodes that are located on Mesh boundaries....
Definition: nodes.h:1996
This policy class is used to associate specific bounding elements with specific FluidInterface elemen...
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Definition: shape.h:278
ElasticAxisymmetricSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
Pseudo-elasticity version of the PointFluidInterfaceBoundingElement.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
Definition: elements.h:4626
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
Definition: elements.h:4528
A general Finite Element class.
Definition: elements.h:1313
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this funct...
Definition: elements.h:1735
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
Definition: elements.h:3050
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
============================================================================= This is the policy clas...
void setup_equation_indices(SurfactantTransportInterfaceElement *const &element_pt, const unsigned &id)
This policy class is used to allow additional values to be added to the nodes from new surface equati...
Base class establishing common interfaces and functions for all Navier-Stokes-like fluid interface el...
Class that establishes the surface derivative functions for LineElements. These are defined in a sepa...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
Definition: shape.h:76
SpineAxisymmetricSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
Spine version of the LineFluidInterfaceBoundingElement.
SpineLineSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
Spine version of the PointFluidInterfaceBoundingElement.
SpineSurfaceSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
Generic Spine node update interface template class that can be combined with a given surface equation...
Class that establishes the surface derivative functions for SurfaceInterfaceElements (2D surfaces in ...
Generic surfactant transport equations implemented independently of the dimension and then specialise...
double sigma(const Vector< double > &s)
The surface tension function is linear in the concentration with constant of proportionality equal to...
double *& peclet_s_pt()
Access function for pointer to the surface Peclet number.
Vector< unsigned > C_index
Index at which the surfactant concentration is stored at the nodes.
void output(std::ostream &outfile)
Overload the output function.
void output(FILE *file_pt)
Overload the C-style output function.
virtual double dsigma_dC(const Vector< double > &s)
Return the derivative of sigma with respect to C For use in computing the Jacobian.
double * Peclet_Strouhal_S_pt
Pointer to the surface Peclect Strouhal number.
double *& beta_pt()
Access function for pointer to the Elasticity number.
double * Peclet_S_pt
Pointer to Surface Peclet number.
double integrate_c()
Compute the concentration intergated over the surface area.
double dcdt_surface(const unsigned &l) const
The time derivative of the surface concentration.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
double *& peclet_strouhal_s_pt()
Access function for pointer to the surface Peclet x Strouhal number.
SurfactantTransportInterfaceElement()
Constructor that passes the bulk element and face index down to the underlying.
double interpolated_C(const Vector< double > &s)
Get the surfactant concentration.
void set_c_index(const Vector< unsigned > &c_index)
double * Beta_pt
Pointer to an Elasticity number.
double peclet_s()
Return the surface peclect number.
double peclet_strouhal_s()
Return the surface peclect strouhal number.
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
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)
Overload the Helper function to calculate the residuals and jacobian entries. This particular functio...
static double Default_Physical_Constant_Value
Default value of the physical constants.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...