44 unsigned n_node = this->
nnode();
56 for (
unsigned l = 0; l < n_node; l++)
68 const unsigned& l)
const
81 for (
unsigned t = 0;
t < n_time;
t++)
98 const unsigned n_node = this->
nnode();
105 for (
unsigned l = 0; l < n_node; l++)
111 double Beta = this->
beta();
113 return (1.0 - Beta * (C - 1.0));
124 const unsigned& flag,
128 const DShape& dpsifdS_div,
136 unsigned n_node = this->
nnode();
139 int local_eqn = 0, local_unknown = 0;
147 const double Pe_s = this->
peclet_s();
159 double interpolated_div_u = 0.0;
162 for (
unsigned l = 0; l < n_node; l++)
164 const double psi = psif(l);
170 for (
unsigned j = 0; j < n_dim; j++)
172 const double u_ = this->
nodal_value(l, u_index[j]);
175 interpolated_grad_C[j] += C_ * dpsifdS(l, j);
176 interpolated_div_u += u_ * dpsifdS_div(l, j);
181 double interpolated_advection_term =
interpolated_C * interpolated_div_u;
182 for (
unsigned i = 0;
i < n_dim;
i++)
184 interpolated_advection_term +=
190 for (
unsigned l = 0; l < n_node; l++)
199 residuals[local_eqn] += dCdt * psif(l) *
W * J;
202 residuals[local_eqn] += interpolated_advection_term * psif(l) *
W * J;
205 double diffusion_term = 0.0;
206 for (
unsigned i = 0;
i < n_dim;
i++)
208 diffusion_term += interpolated_grad_C[
i] * dpsifdS(l,
i);
210 residuals[local_eqn] += (1.0 / Pe_s) * diffusion_term *
W * J;
216 for (
unsigned l2 = 0; l2 < n_node; l2++)
224 if (local_unknown >= 0)
226 jacobian(local_eqn, local_unknown) +=
229 jacobian(local_eqn, local_unknown) +=
230 psif(l2) * interpolated_div_u * psif(l) *
W * J;
232 for (
unsigned i = 0;
i < n_dim;
i++)
234 jacobian(local_eqn, local_unknown) +=
239 for (
unsigned i = 0;
i < n_dim;
i++)
241 jacobian(local_eqn, local_unknown) +=
242 (1.0 / Pe_s) * dpsifdS(l2,
i) * dpsifdS(l,
i) *
W * J;
248 for (
unsigned i2 = 0; i2 < n_dim; i2++)
255 if (local_unknown >= 0)
258 jacobian(local_eqn, local_unknown) +=
260 psif(l2) * interpolated_grad_C[i2]) *
270 const double dsigma = this->
dsigma_dC(s);
271 const double Ca = this->
ca();
272 for (
unsigned l2 = 0; l2 < n_node; l2++)
275 if (local_unknown >= 0)
277 const double psi_ = psif(l2);
278 for (
unsigned i = 0;
i < n_dim;
i++)
284 jacobian(local_eqn, local_unknown) -=
285 (dsigma / Ca) * psi_ * dpsifdS_div(l,
i) * J *
W;
299 const unsigned& n_plot)
301 outfile.precision(16);
303 const unsigned el_dim = this->
dim();
317 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
325 for (
unsigned i = 0;
i < n_velocity;
i++)
331 for (
unsigned i = 0;
i < n_dim;
i++)
337 for (
unsigned i = 0;
i < n_dim;
i++)
339 for (
unsigned i = 0;
i < n_dim;
i++) outfile <<
u[
i] <<
" ";
341 outfile << 0.0 <<
" ";
345 outfile <<
sigma(
s) <<
" ";
346 for (
unsigned i = 0;
i < n_dim;
i++)
348 outfile <<
u[
i] - u_n * n[
i] <<
" ";
350 outfile << std::endl;
352 outfile << std::endl;
361 unsigned n_node = this->
nnode();
363 const unsigned el_dim = this->
dim();
368 DShape dpsifds(n_node, el_dim);
369 DShape dpsifdS(n_node, n_dim);
370 DShape dpsifdS_div(n_node, n_dim);
382 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
385 for (
unsigned i = 0;
i < el_dim;
i++)
398 double interpolated_c = 0.0;
401 for (
unsigned l = 0; l < n_node; l++)
403 const double psi_ = psif(l);
406 for (
unsigned i = 0;
i < n_dim;
i++)
412 for (
unsigned j = 0; j < el_dim; j++)
421 psif, dpsifds, interpolated_t,
interpolated_x, dpsifdS, dpsifdS_div);
423 mass += interpolated_c *
W * J;
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
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...
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Return the geometric shape function and its derivative w.r.t. the local coordinates at the ipt-th int...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
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,...
double u(const unsigned &j, const unsigned &i)
Return the i-th velocity component at local node j.
Vector< unsigned > U_index_interface
Nodal index at which the i-th velocity component is stored.
double interpolated_u(const Vector< double > &s, const unsigned &i)
Calculate the i-th velocity component at the local coordinate s.
const double & ca() const
The value of the Capillary number.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
double sigma(const Vector< double > &s)
The surface tension function is linear in the concentration with constant of proportionality equal to...
Vector< unsigned > C_index
Index at which the surfactant concentration is stored at the nodes.
void output(std::ostream &outfile)
Overload the 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 integrate_c()
Compute the concentration intergated over the surface area.
double beta()
Return the Elasticity number.
double dcdt_surface(const unsigned &l) const
The time derivative of the surface concentration.
double interpolated_C(const Vector< double > &s)
Get the surfactant concentration.
double peclet_s()
Return the surface peclect number.
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.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
std::string type() const
Return string that indicates the type of the timestepper (e.g. "BDF", "Newmark", etc....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...