48 unsigned n_node = this->nnode();
60 for(
unsigned l=0;l<n_node;l++)
62 C += this->nodal_value(l,this->
C_index[l])*psi(l);
74 TimeStepper* time_stepper_pt= this->node_pt(l)->time_stepper_pt();
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++)
86 dcdt += time_stepper_pt->weight(1,t)*this->nodal_value(t,l,this->
C_index[l]);
100 const unsigned n_node = this->nnode();
107 for(
unsigned l=0;l<n_node;l++)
109 C += this->nodal_value(l,this->
C_index[l])*psi(l);
113 double Beta = this->
beta();
115 return (1.0 - Beta*(C-1.0));
123 Vector<double> &residuals, DenseMatrix<double> &jacobian,
124 const unsigned &flag,
const Shape &psif,
const DShape &dpsifds,
125 const DShape &dpsifdS,
const DShape &dpsifdS_div,
126 const Vector<double> &s,
127 const Vector<double> &interpolated_x,
const Vector<double> &interpolated_n,
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();
150 const unsigned n_dim = this->node_pt(0)->ndim();
152 Vector<double> mesh_velocity(n_dim,0.0);
153 Vector<double> interpolated_grad_C(n_dim,0.0);
154 double interpolated_div_u = 0.0;
157 for(
unsigned l=0;l<n_node;l++)
159 const double psi = psif(l);
160 const double C_ = this->nodal_value(l,this->
C_index[l]);
162 interpolated_C += C_*psi;
165 for(
unsigned j=0;j<n_dim;j++)
167 const double u_ = this->nodal_value(l,u_index[j]);
168 interpolated_u[j] += u_*psi;
169 mesh_velocity[j] += this->dnodal_position_dt(l,j)*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++)
187 local_eqn = this->nodal_local_eqn(l,this->
C_index[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++)
213 TimeStepper* time_stepper_pt=this->node_pt(l2)->time_stepper_pt();
216 local_unknown =this->nodal_local_eqn(l2,this->
C_index[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++)
244 local_unknown = this->nodal_local_eqn(l2,u_index[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++)
266 local_unknown = this->nodal_local_eqn(l2,this->
C_index[l2]);
267 if(local_unknown >= 0)
269 const double psi_ = psif(l2);
270 for(
unsigned i=0;i<n_dim;i++)
273 local_eqn = this->nodal_local_eqn(l,u_index[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();
296 const unsigned n_dim = this->nodal_dimension();
300 Vector<double> s(el_dim);
301 Vector<double> n(n_dim);
302 Vector<double>
u(n_velocity);
305 outfile << this->tecplot_zone_string(n_plot);
308 unsigned num_plot_points=this->nplot_points(n_plot);
309 for (
unsigned iplot=0;iplot<num_plot_points;iplot++)
312 this->get_s_plot(iplot,n_plot,s);
314 this->outer_unit_normal(s,n);
317 for(
unsigned i=0;i<n_velocity;i++)
323 for(
unsigned i=0;i<n_dim;i++)
329 for(
unsigned i=0;i<n_dim;i++) outfile << this->interpolated_x(s,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();
353 const unsigned n_dim = this->nodal_dimension();
357 DShape dpsifds(n_node,el_dim);
358 DShape dpsifdS(n_node,n_dim);
359 DShape dpsifdS_div(n_node,n_dim);
362 unsigned n_intpt = this->integral_pt()->nweight();
365 Vector<double> s(el_dim);
371 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
374 for(
unsigned i=0;i<el_dim;i++) {s[i] = this->integral_pt()->knot(ipt,i);}
377 double W = this->integral_pt()->weight(ipt);
380 this->dshape_local_at_knot(ipt,psif,dpsifds);
382 Vector<double> interpolated_x(n_dim,0.0);
383 DenseMatrix<double> interpolated_t(el_dim,n_dim,0.0);
384 double interpolated_c = 0.0;
387 for(
unsigned l=0;l<n_node;l++)
389 const double psi_ = psif(l);
390 interpolated_c += this->nodal_value(l,this->
C_index[l])*psi_;
392 for(
unsigned i=0;i<n_dim;i++)
395 interpolated_x[i] += this->nodal_position(l,i)*psi_;
398 for(
unsigned j=0;j<el_dim;j++)
400 interpolated_t(j,i) += this->nodal_position(l,i)*dpsifds(l,j);
413 mass += interpolated_c*W*J;
double peclet_s()
Return the surface peclect number.
double u(const unsigned &j, const unsigned &i)
Return the i-th velocity component at local node j.
double integrate_c()
Compute the concentration intergated over the surface area.
double interpolated_C(const Vector< double > &s)
Get the surfactant concentration.
double beta()
Return the Elasticity number.
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.
static double Default_Physical_Constant_Value
Default value of the physical constants.
double interpolated_u(const Vector< double > &s, const unsigned &i)
Calculate the i-th velocity component at the local coordinate s.
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.
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...