48 unsigned n_node = this->
nnode();
60 for(
unsigned l=0;l<n_node;l++)
79 if (time_stepper_pt->
type()!=
"Steady")
82 const unsigned n_time = time_stepper_pt->
ntstorage();
84 for(
unsigned t=0;
t<n_time;
t++)
100 const unsigned n_node = this->
nnode();
107 for(
unsigned l=0;l<n_node;l++)
113 double Beta = this->
beta();
115 return (1.0 - Beta*(C-1.0));
124 const unsigned &flag,
const Shape &psif,
const DShape &dpsifds,
128 const double &
W,
const double &J)
131 unsigned n_node = this->
nnode();
134 int local_eqn = 0, local_unknown = 0;
142 const double Pe_s = this->
peclet_s();
154 double interpolated_div_u = 0.0;
157 for(
unsigned l=0;l<n_node;l++)
159 const double psi = psif(l);
162 interpolated_C += C_*psi;
165 for(
unsigned j=0;j<n_dim;j++)
168 interpolated_u[j] += u_*psi;
170 interpolated_grad_C[j] += C_*dpsifdS(l,j);
171 interpolated_div_u += u_*dpsifdS_div(l,j);
176 double interpolated_advection_term = interpolated_C*interpolated_div_u;
177 for(
unsigned i=0;
i<n_dim;
i++)
179 interpolated_advection_term += (interpolated_u[
i] - mesh_velocity[
i])*interpolated_grad_C[
i];
184 for(
unsigned l=0;l<n_node;l++)
193 residuals[local_eqn] += dCdt*psif(l)*W*J;
196 residuals[local_eqn] += interpolated_advection_term*psif(l)*W*J;
199 double diffusion_term = 0.0;
200 for(
unsigned i=0;
i<n_dim;
i++)
202 diffusion_term += interpolated_grad_C[
i]*dpsifdS(l,
i);
204 residuals[local_eqn] += (1.0/Pe_s)*diffusion_term*W*J;
210 for(
unsigned l2=0;l2<n_node;l2++)
218 if(local_unknown >=0)
220 jacobian(local_eqn,local_unknown) +=
221 time_stepper_pt->
weight(1,0)*psif(l2)*psif(l)*W*J;
223 jacobian(local_eqn,local_unknown) +=
224 psif(l2)*interpolated_div_u*psif(l)*W*J;
226 for(
unsigned i=0;
i<n_dim;
i++)
228 jacobian(local_eqn,local_unknown) +=
229 (interpolated_u[
i] - mesh_velocity[
i])*dpsifdS(l2,
i)*psif(l)*W*J;
232 for(
unsigned i=0;
i<n_dim;
i++)
234 jacobian(local_eqn,local_unknown) += (1.0/Pe_s)*dpsifdS(l2,
i)*dpsifdS(l,
i)*W*J;
240 for(
unsigned i2=0;i2<n_dim;i2++)
248 if(local_unknown >= 0)
251 jacobian(local_eqn,local_unknown) += (interpolated_C*dpsifdS_div(l2,i2) +
252 psif(l2)*interpolated_grad_C[i2])
262 const double dsigma = this->
dsigma_dC(s);
263 const double Ca = this->
ca();
264 for(
unsigned l2=0;l2<n_node;l2++)
267 if(local_unknown >= 0)
269 const double psi_ = psif(l2);
270 for(
unsigned i=0;
i<n_dim;
i++)
276 jacobian(local_eqn,local_unknown) -= (dsigma/Ca)*psi_*dpsifdS_div(l,i)*J*
W;
291 std::ostream &outfile,
const unsigned &n_plot)
293 outfile.precision(16);
295 const unsigned el_dim = this->
dim();
309 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
317 for(
unsigned i=0;
i<n_velocity;
i++)
323 for(
unsigned i=0;
i<n_dim;
i++)
330 for(
unsigned i=0;
i<n_dim;
i++) outfile << u[
i] <<
" ";
332 outfile << 0.0 <<
" ";
336 outfile <<
sigma(s) <<
" ";
337 for(
unsigned i=0;
i<n_dim;
i++)
338 {outfile << u[
i] - u_n*n[
i] <<
" ";}
339 outfile << std::endl;
341 outfile << std::endl;
350 unsigned n_node = this->
nnode();
352 const unsigned el_dim = this->
dim();
357 DShape dpsifds(n_node,el_dim);
358 DShape dpsifdS(n_node,n_dim);
359 DShape dpsifdS_div(n_node,n_dim);
371 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
384 double interpolated_c = 0.0;
387 for(
unsigned l=0;l<n_node;l++)
389 const double psi_ = psif(l);
392 for(
unsigned i=0;
i<n_dim;
i++)
398 for(
unsigned j=0;j<el_dim;j++)
413 mass += interpolated_c*W*J;
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 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...
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 ...
double peclet_s()
Return the surface peclect number.
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 double weight(const unsigned &i) const =0
Return weight of i-th integration point.
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction") ...
double u(const unsigned &j, const unsigned &i)
Return the i-th velocity component at local node j.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
double integrate_c()
Compute the concentration intergated over the surface area.
double interpolated_C(const Vector< double > &s)
Get the surfactant concentration.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double beta()
Return the Elasticity number.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
double dsigma_dC(const Vector< double > &s)
double dcdt_surface(const unsigned &l) const
The time derivative of the surface concentration.
Vector< unsigned > C_index
void output(std::ostream &outfile)
Overload the output function.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
static double Default_Physical_Constant_Value
Default value of the physical constants.
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...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
std::string type() const
Return string that indicates the type of the timestepper (e.g. "BDF", "Newmark", etc.)
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
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...
double interpolated_u(const Vector< double > &s, const unsigned &i)
Calculate the i-th velocity component at the local coordinate s.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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, derivatives, tangent vectors and position. All derivatives and tangent vectors should be formed with respect to the local coordinates.
const double & ca() const
The value of the Capillary number.
double sigma(const Vector< double > &s)
Vector< unsigned > U_index_interface
Nodal index at which the i-th velocity component is stored.
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
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...
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...
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...