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// Version 1.0; svn revision $LastChangedRevision: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //Header file for specific (two-dimensional) fluid free surface elements
31 
32 //Include guards, to prevent multiple includes
33 #ifndef OOMPH_SURFACTANT_TRANSPORT_ELEMENTS_HEADER
34 #define OOMPH_SURFACTANT_TRANSPORT_ELEMENTS_HEADER
35 
36 
37 // Config header generated by autoconfig
38 #ifdef HAVE_CONFIG_H
39  #include <oomph-lib-config.h>
40 #endif
41 
42 //OOMPH-LIB headers
44 
45 namespace oomph
46 {
47 
48 //==================================================================
49 /// Generic surfactant transport equations implemented
50 /// independently of the dimension and then specialised using
51 /// the generic mechanisms introduce in the FluidInterfaceElements
52 //=================================================================
55 {
56 private:
57  /// Pointer to an Elasticity number
58  double *Beta_pt;
59 
60  /// Pointer to Surface Peclet number
61  double *Peclet_S_pt;
62 
63  /// Pointer to the surface Peclect Strouhal number
65 
66 protected:
67 
68  /// Index at which the surfactant concentration is stored at the
69  /// nodes
70  Vector<unsigned> C_index;
71 
72 
73  /// Default value of the physical constants
75 
76  ///Get the surfactant concentration
77  double interpolated_C(const Vector<double> &s);
78 
79  /// The time derivative of the surface concentration
80  double dcdt_surface(const unsigned &l) const;
81 
82  /// The surface tension function is linear in the
83  /// concentration with constant of proportionality equal
84  /// to the elasticity number.
85  double sigma(const Vector<double> &s);
86 
87  ///Return the derivative of sigma with respect to C
88  ///For use in computing the Jacobian
89  double dsigma_dC(const Vector<double> &s)
90  {return -this->beta();}
91 
92  /// \short Overload the Helper function to calculate the residuals and
93  /// jacobian entries. This particular function ensures that the
94  /// additional entries are calculated inside the integration loop
96  Vector<double> &residuals, DenseMatrix<double> &jacobian,
97  const unsigned &flag,const Shape &psif, const DShape &dpsifds,
98  const DShape &dpsifdS, const DShape &dpsifdS_div,
99  const Vector<double> &s,
100  const Vector<double> &interpolated_x, const Vector<double> &interpolated_n,
101  const double &W,const double &J);
102 
103 
104  /// Add the element's contribution to its residuals vector,
105  /// jacobian matrix and mass matrix
107  Vector<double> &residuals, DenseMatrix<double> &jacobian,
108  DenseMatrix<double> &mass_matrix)
109  {
110  //Add the contribution to the jacobian
111  this->fill_in_contribution_to_jacobian(residuals,jacobian);
112  //No mass matrix terms, but should probably do kinematic bit here
113  }
114 
115  public:
116 
117  ///Constructor that passes the bulk element and face index down
118  ///to the underlying
120  {
121  //Initialise the values
125  }
126 
127  //Set the c_index
128  inline void set_c_index(const Vector<unsigned> &c_index) {this->C_index = c_index;}
129 
130  ///Return the Elasticity number
131  double beta() {return *Beta_pt;}
132 
133  ///Return the surface peclect number
134  double peclet_s() {return *Peclet_S_pt;}
135 
136  ///Return the surface peclect strouhal number
138 
139  ///Access function for pointer to the Elasticity number
140  double* &beta_pt() {return Beta_pt;}
141 
142  ///Access function for pointer to the surface Peclet number
143  double* &peclet_s_pt() {return Peclet_S_pt;}
144 
145  ///Access function for pointer to the surface Peclet x Strouhal number
147 
148 
149  ///Overload the output function
150  void output(std::ostream &outfile) {FiniteElement::output(outfile);}
151 
152  void output(std::ostream &outfile, const unsigned &n_plot);
153 
154  ///Overload the C-style output function
155  void output(FILE* file_pt) {FiniteElement::output(file_pt);}
156 
157  ///C-style Output function
158  void output(FILE* file_pt, const unsigned &n_plot)
159  {FiniteElement::output(file_pt,n_plot);}
160 
161  /// \short Compute the concentration intergated over the surface area
162  double integrate_c();
163 
164 };
165 
166 
167 ///=============================================================================
168 ///This is the policy class for the surfactanttransport equations which require
169 ///one additional value for the surface concentration
170 //=============================================================================
171 template<>
173  {
174  public:
176 
177  inline unsigned nadditional_values(const unsigned &n) {return 1;}
178 
180  SurfactantTransportInterfaceElement* const &element_pt,
181  const unsigned &id)
182  {
183  const unsigned n_node = element_pt->nnode();
184  Vector<unsigned> c_index(n_node);
185  for(unsigned n=0;n<n_node;n++)
186  {
187  c_index[n] =
188  dynamic_cast<BoundaryNodeBase*>(element_pt->node_pt(n))
189  ->index_of_first_value_assigned_by_face_element(id);
190  }
191 
192  element_pt->set_c_index(c_index);
193  }
194 
195  };
196 
197 
198 //-------------------------------GEOMETRIC SPECIALISATIONS----------------
199 
200 ///Specialise to the Line geometry
201 template<class ELEMENT>
203  public SpineUpdateFluidInterfaceElement<SurfactantTransportInterfaceElement,
204  LineDerivatives,ELEMENT>
205  {
206  public:
207 
209  FiniteElement* const &element_pt,
210  const int &face_index) :
212  LineDerivatives,ELEMENT>(element_pt,face_index) {}
213  };
214 
215 
216 //Define the bounding element type for the line elements
217 template<class ELEMENT>
221  {
222  public:
223 
227  };
228 
229 
230 ///Specialise to the Axisymmetric geometry
231 template<class ELEMENT>
233  public SpineUpdateFluidInterfaceElement<SurfactantTransportInterfaceElement,
234  AxisymmetricDerivatives,ELEMENT>
235  {
236  public:
237 
239  FiniteElement* const &element_pt,
240  const int &face_index) :
242  AxisymmetricDerivatives,ELEMENT>(element_pt,face_index) {}
243  };
244 
245 
246 //Define the bounding element type for the axisymmetric surface
247 template<class ELEMENT>
251  {
252  public:
253 
257  };
258 
259 ///Specialise to the Axisymmetric geometry
260 template<class ELEMENT>
262  public ElasticUpdateFluidInterfaceElement<SurfactantTransportInterfaceElement,
263  AxisymmetricDerivatives,ELEMENT>
264  {
265  public:
266 
268  FiniteElement* const &element_pt,
269  const int &face_index) :
271  AxisymmetricDerivatives,ELEMENT>(element_pt,face_index) {}
272  };
273 
274 
275 //Define the bounding element type for the axisymmetric surface
276 template<class ELEMENT>
280  {
281  public:
282 
286  };
287 
288 
289  ///Specialise to surface geometry
290  template<class ELEMENT>
292  public SpineUpdateFluidInterfaceElement<SurfactantTransportInterfaceElement,
293  SurfaceDerivatives,ELEMENT>
294  {
295  public:
296 
298  FiniteElement* const &element_pt,
299  const int &face_index) :
301  SurfaceDerivatives,ELEMENT>(element_pt,face_index) {}
302  };
303 
304 
305 //Define the bounding element type for the 2D surface
306  template<class ELEMENT>
310  {
311  public:
312 
316  };
317 
318 
319 }
320 
321 #endif
322 
323 
324 
325 
326 
327 
SpineLineSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
Spine version of the LineFluidInterfaceBoundingElement.
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)
void output(FILE *file_pt)
Overload the C-style output function.
double peclet_s()
Return the surface peclect number.
double * Peclet_S_pt
Pointer to Surface Peclet number.
double *& peclet_s_pt()
Access function for pointer to the surface Peclet number.
This policy class is used to associate specific bounding elements with specific FluidInterface elemen...
void output(FILE *file_pt, const unsigned &n_plot)
C-style Output function.
Generic Spine node update interface template class that can be combined with a given surface equation...
double peclet_strouhal_s()
Return the surface peclect strouhal number.
double integrate_c()
Compute the concentration intergated over the surface area.
double interpolated_C(const Vector< double > &s)
Get the surfactant concentration.
double * Peclet_Strouhal_S_pt
Pointer to the surface Peclect Strouhal number.
ElasticAxisymmetricSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
void set_c_index(const Vector< unsigned > &c_index)
This policy class is used to allow additional values to be added to the nodes from new surface equati...
Pseudo-elasticity version of the PointFluidInterfaceBoundingElement.
void output(std::ostream &outfile)
Overload the output function.
double *& beta_pt()
Access function for pointer to the Elasticity number.
static double Default_Physical_Constant_Value
Default value of the physical constants.
void setup_equation_indices(SurfactantTransportInterfaceElement *const &element_pt, const unsigned &id)
Generic Elastic node update interface template class that can be combined with a given surface equati...
double * Beta_pt
Pointer to an Elasticity number.
SpineSurfaceSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
SpineAxisymmetricSurfactantTransportInterfaceElement(FiniteElement *const &element_pt, const int &face_index)
double *& peclet_strouhal_s_pt()
Access function for pointer to the surface Peclet x Strouhal number.
Spine version of the PointFluidInterfaceBoundingElement.
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...