41 #include "navier_stokes.h" 42 #include "fluid_interface.h" 45 #include "meshes/single_layer_cubic_spine_mesh.h" 48 using namespace oomph;
70 double Ca = pow(Film_Thickness,3.0);
102 bool operator()(GeneralisedElement*
const &x, GeneralisedElement*
const &y)
105 FiniteElement* cast_x =
dynamic_cast<FiniteElement*
>(x);
106 FiniteElement* cast_y =
dynamic_cast<FiniteElement*
>(y);
108 if((cast_x ==0) || (cast_y==0)) {
return 0;}
110 {
return (cast_x->node_pt(0)->x(1)< cast_y->node_pt(0)->x(1));}
123 template<
class ELEMENT>
129 const unsigned &n_theta,
130 const double &r_min,
const double &r_max,
132 const double &theta_min,
const double &theta_max,
133 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper):
137 SingleLayerCubicSpineMesh<ELEMENT>(n_theta,n_y,n_r,r_max,l_y,theta_max,
142 unsigned n_node = this->nnode();
145 for (
unsigned n=0;n<n_node;n++)
148 Node* nod_pt=this->node_pt(n);
149 SpineNode* spine_node_pt=
dynamic_cast<SpineNode*
>(nod_pt);
151 double x_old=nod_pt->x(0);
152 double y_old=nod_pt->x(1);
153 double z_old=nod_pt->x(2);
157 double r = r_min + (r_max-r_min)*z_old;
158 double theta = (theta_min + (theta_max-theta_min)*x_old);
162 if(spine_node_pt->spine_pt()->ngeom_parameter()==0)
166 spine_node_pt->spine_pt()->add_geom_parameter(theta);
171 nod_pt->x(0)=r*cos(theta);
172 nod_pt->x(2)=r*sin(theta);
183 double W = spine_node_pt->fraction();
185 double theta = spine_node_pt->spine_pt()->geom_parameter(0);
187 double H = spine_node_pt->h();
189 spine_node_pt->x(0) = (1.0-W*H)*cos(theta);
190 spine_node_pt->x(2) = (1.0-W*H)*sin(theta);
199 template<
class ELEMENT,
class TIMESTEPPER>
209 const unsigned &n_theta,
const double &r_min,
210 const double &r_max,
const double &l_y,
211 const double &theta_max);
220 void unsteady_run(
const unsigned& nstep);
223 void doc_solution(DocInfo& doc_info);
231 const unsigned n_interface_element = Surface_mesh_pt->nelement();
234 for(
unsigned e=0;e<n_interface_element;e++)
239 (Surface_mesh_pt->element_pt(e));
273 template<
class ELEMENT,
class TIMESTEPPER>
275 (
const unsigned &n_r,
const unsigned &n_y,
const unsigned &n_theta,
277 const double &r_max,
const double &l_y,
const double &theta_max)
278 : R_max(r_max), L_y(l_y)
287 add_time_stepper_pt(
new TIMESTEPPER);
291 (n_r,n_y,n_theta,r_min,r_max,l_y,0.0,theta_max,time_stepper_pt());
294 Document_node_pt = Bulk_mesh_pt->boundary_node_pt(5,0);
299 Surface_mesh_pt =
new Mesh;
303 for(
unsigned e1=0;e1<n_y;e1++)
305 for(
unsigned e2=0;e2<n_theta;e2++)
309 FiniteElement* bulk_element_pt =
310 Bulk_mesh_pt->finite_element_pt(n_theta*n_y*(n_r-1) + e2 + e1*n_theta);
313 FiniteElement* interface_element_pt =
317 this->Surface_mesh_pt->add_element_pt(interface_element_pt);
322 add_sub_mesh(Bulk_mesh_pt);
323 add_sub_mesh(Surface_mesh_pt);
329 unsigned long n_boundary_node = Bulk_mesh_pt->nboundary_node(0);
330 for(
unsigned long n=0;n<n_boundary_node;n++)
332 for(
unsigned i=0;i<3;i++)
334 Bulk_mesh_pt->boundary_node_pt(0,n)->pin(i);
339 for(
unsigned b=1;b<4;b+=2)
341 n_boundary_node = Bulk_mesh_pt->nboundary_node(b);
342 for(
unsigned long n=0;n<n_boundary_node;n++)
344 Bulk_mesh_pt->boundary_node_pt(b,n)->pin(1);
349 for(
unsigned b=4;b<5;b+=2)
351 n_boundary_node = Bulk_mesh_pt->nboundary_node(b);
352 for(
unsigned long n=0;n<n_boundary_node;n++)
354 Bulk_mesh_pt->boundary_node_pt(b,n)->pin(2);
359 for(
unsigned b=2;b<3;b++)
361 n_boundary_node = Bulk_mesh_pt->nboundary_node(b);
362 for(
unsigned long n=0;n<n_boundary_node;n++)
364 Bulk_mesh_pt->boundary_node_pt(b,n)->pin(0);
371 n_boundary_node = Bulk_mesh_pt->nboundary_node(b);
372 for(
unsigned long n=0;n<n_boundary_node;n++)
374 Bulk_mesh_pt->boundary_node_pt(b,n)->set_value(3,1.0);;
381 Data* external_pressure_data_pt =
new Data(1);
384 external_pressure_data_pt->set_value(0,1.31);
385 external_pressure_data_pt->pin(0);
390 unsigned n_bulk=Bulk_mesh_pt->nelement();
391 for(
unsigned e=0;e<n_bulk;e++)
394 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(Bulk_mesh_pt->element_pt(e));
405 unsigned long interface_element_pt_range =
406 Surface_mesh_pt->nelement();
407 for(
unsigned e=0;e<interface_element_pt_range;e++)
412 (Surface_mesh_pt->element_pt(e));
432 cout << assign_eqn_numbers() << std::endl;
435 std::sort(mesh_pt()->element_pt().begin(),
436 mesh_pt()->element_pt().end(),
446 template<
class ELEMENT,
class TIMESTEPPER>
457 cout <<
"Time is now " << time_pt()->time() << std::endl;
460 Trace_file << time_pt()->time();
461 Trace_file <<
" " << Document_node_pt->x(0) <<
" " 462 << this->compute_total_mass()
473 sprintf(filename,
"%s/surface%i.dat",doc_info.directory().c_str(),
475 some_file.open(filename);
476 Surface_mesh_pt->output(some_file,npts);
487 template<
class ELEMENT,
class TIMESTEPPER>
492 Problem::Max_residuals=500.0;
496 unsigned Nspine = Bulk_mesh_pt->nspine();
497 for(
unsigned i=0;i<Nspine;i++)
499 double y_value = Bulk_mesh_pt->boundary_node_pt(0,i)->x(1);
501 Bulk_mesh_pt->spine_pt(i)->height() =
507 Bulk_mesh_pt->node_update();
513 doc_info.set_directory(
"RESLT");
518 sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
519 Trace_file.open(filename);
521 Trace_file <<
"VARIABLES=\"time\",";
522 Trace_file <<
"\"h<sub>left</sub>\",\"h<sub>right</sub>\"";
529 assign_initial_values_impulsive(dt);
532 doc_solution(doc_info);
535 for(
unsigned t=1;t<=nstep;t++)
537 cout <<
"TIMESTEP " << t << std::endl;
540 unsteady_newton_solve(dt);
544 doc_solution(doc_info);
557 int main(
int argc,
char *argv[])
572 double r_min = r_max - h;
574 const double pi = MathematicalConstants::Pi;
578 double l_y = pi/alpha;
580 double theta_max = 0.5*pi;
585 unsigned n_theta = 4;
595 problem(n_r,n_y,n_theta,r_min,r_max,l_y,theta_max);
double Peclet_S
Surface Peclet number.
double Peclet_St_S
Sufrace Peclet number multiplied by Strouhal number.
virtual void spine_node_update(SpineNode *spine_node_pt)
InterfaceProblem(const unsigned &n_r, const unsigned &n_y, const unsigned &n_theta, const double &r_min, const double &r_max, const double &l_y, const double &theta_max)
Problem constructor.
Specialise to surface geometry.
void set_external_pressure_data(Data *external_pressure_data_pt)
Set the Data that contains the single pressure value that specifies the "external pressure" for the i...
double *& peclet_s_pt()
Access function for pointer to the surface Peclet number.
ofstream Trace_file
Trace file.
double ReSt
Womersley = Reynolds times Strouhal.
double integrate_c()
Compute the concentration intergated over the surface area.
AnnularSpineMesh< ELEMENT > * Bulk_mesh_pt
Pointer to bulk mesh.
double Re
Reynolds number.
double Epsilon
Free surface cosine deformation parameter.
void actions_before_newton_convergence_check()
double R_max
Axial lengths of domain.
double *& beta_pt()
Access function for pointer to the Elasticity number.
Mesh * Surface_mesh_pt
Pointer to the surface mes.
double ReInvFr
Product of Reynolds and Froude number.
int main(int argc, char *argv[])
Vector< double > G(3)
Direction of gravity.
bool operator()(GeneralisedElement *const &x, GeneralisedElement *const &y) const
Comparison. Are the values identical or not?
Node * Document_node_pt
Pointer to a node for documentation purposes.
void unsteady_run(const unsigned &nstep)
Run an unsteady simulation with specified number of steps.
double Beta
Surface Elasticity number (weak case)
AnnularSpineMesh(const unsigned &n_r, const unsigned &n_y, const unsigned &n_theta, const double &r_min, const double &r_max, const double &l_y, const double &theta_min, const double &theta_max, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
void doc_solution(DocInfo &doc_info)
Doc the solution.
double *& peclet_strouhal_s_pt()
Access function for pointer to the surface Peclet x Strouhal number.
Function-type-object to perform comparison of elements in y-direction.
double Ca
Capillary number.
double Alpha
Wavelength of the domain.
double compute_total_mass()
Compute the total mass.
double *& ca_pt()
Pointer to the Capillary number.