575 GeomObject* lower_wall_pt=
new StraightLine(-1.0);
576 GeomObject* upper_wall_pt=
new StraightLine( 1.0);
588 Bulk_mesh_pt =
new BrethertonSpineMesh<ELEMENT,
589 SpineLineFluidInterfaceElement<ELEMENT> >
590 (nx1,nx2,nx3,nh,nhalf,h,lower_wall_pt,upper_wall_pt,xi0,0.0,xi1,xi2);
593 mesh_pt()=Bulk_mesh_pt;
596 Control_element_pt=Bulk_mesh_pt->control_element_pt();
603 Bulk_mesh_pt->spine_pt(0)->spine_height_pt()->value_pt(0);
606 unsigned last_spine=Bulk_mesh_pt->nfree_surface_spines()-1;
608 Bulk_mesh_pt->spine_pt(last_spine)->spine_height_pt()->value_pt(0);
613 Bulk_mesh_pt->boundary_node_pt(ibound,0)->x_pt(0,1);
616 unsigned nnod=Bulk_mesh_pt->nboundary_node(ibound);
618 Bulk_mesh_pt->boundary_node_pt(ibound,nnod-1)->x_pt(0,1);
621 activate_inflow_dependency();
628 for(
unsigned ibound=0;ibound<=2;ibound++)
630 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
631 for (
unsigned inod=0;inod<num_nod;inod++)
633 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
634 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
639 for(
unsigned ibound=3;ibound<=5;ibound+=2)
641 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
642 for (
unsigned inod=0;inod<num_nod;inod++)
644 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
645 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
650 unsigned central_spine=(Bulk_mesh_pt->nfree_surface_spines()-1)/2;
651 Bulk_mesh_pt->spine_pt(central_spine)->spine_height_pt()->pin(0);
655 for (
unsigned ibound=0;ibound<=2;ibound+=2)
657 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
658 for (
unsigned inod=0;inod<num_nod;inod++)
661 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,-1.0);
662 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1, 0.0);
668 for (
unsigned ibound=3;ibound<=5;ibound+=2)
670 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
671 for (
unsigned inod=0;inod<num_nod;inod++)
674 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,-1.0);
675 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1, 0.0);
684 unsigned n_bulk=Bulk_mesh_pt->nbulk();
685 for(
unsigned i=0;i<n_bulk;i++)
688 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(Bulk_mesh_pt->
698 unsigned interface_element_pt_range = Bulk_mesh_pt->ninterface_element();
699 for(
unsigned i=0;i<interface_element_pt_range;i++)
702 SpineLineFluidInterfaceElement<ELEMENT>* el_pt =
703 dynamic_cast<SpineLineFluidInterfaceElement<ELEMENT>*
>
704 (Bulk_mesh_pt->interface_element_pt(i));
712 Bulk_mesh_pt->node_update();
715 cout <<
"Number of unknowns: " << assign_eqn_numbers() << std::endl;
777 unsigned last_spine=Bulk_mesh_pt->nfree_surface_spines()-1;
781 Trace_file <<
" " << Bulk_mesh_pt->spine_pt(0)->height();
782 Trace_file <<
" " << Bulk_mesh_pt->spine_pt(last_spine)->height();
784 Trace_file <<
" " << -Control_element_pt->interpolated_p_nst(s)*
787 Trace_file <<
" " << Control_element_pt->interpolated_u_nst(s,0);
788 Trace_file <<
" " << Control_element_pt->interpolated_u_nst(s,1);
789 Trace_file << std::endl;
793 snprintf(filename,
sizeof(filename),
"%s/soln%i.dat",doc_info.directory().c_str(),
795 some_file.open(filename);
796 Bulk_mesh_pt->output(some_file,npts);
801 snprintf(filename,
sizeof(filename),
"%s/boundaries%i.dat",doc_info.directory().c_str(),
803 some_file.open(filename);
804 Bulk_mesh_pt->output_boundaries(some_file);
820 Problem::Max_residuals=500.0;
824 doc_info.set_directory(
"RESLT");
830 snprintf(filename,
sizeof(filename),
"%s/trace.dat",doc_info.directory().c_str());
831 Trace_file.open(filename);
833 Trace_file <<
"VARIABLES=\"Ca\",";
834 Trace_file <<
"\"h<sub>bottom</sub>\",\"h<sub>too</sub>\",";
835 Trace_file <<
"\"h<sub>Bretherton</sub>\",\"p<sub>tip</sub>\",";
836 Trace_file <<
"\"p<sub>tip (Bretherton)</sub>\",\"u<sub>stag</sub>\",";
837 Trace_file <<
"\"v<sub>stag</sub>\"";
838 Trace_file <<
"\"<greek>a</greek><sub>bottom</sub>\",";
839 Trace_file <<
"\"<greek>a</greek><sub>top</sub>\"";
840 Trace_file << std::endl;
846 doc_solution(doc_info);
849 for (
unsigned step=1;step<=nsteps;step++)
851 cout << std::endl <<
"STEP " << step << std::endl;
857 double maxres = Problem::Max_residuals;
860 cout <<
"Checking max. res for Ca = "
864 DoubleVector residuals;
865 actions_before_newton_solve();
866 actions_before_newton_convergence_check();
867 get_residuals(residuals);
868 double max_res=residuals.max();
874 cout <<
". Too big!" << std::endl;
878 factor=1.0+(factor-1.0)/1.5;
879 cout <<
"New reduction factor: " << factor << std::endl;
888 cout <<
". OK" << std::endl << std::endl;
895 cout <<
"Solving for capillary number: "
901 doc_solution(doc_info);