32#include "navier_stokes.h"
34#include "constitutive.h"
35#include "fluid_interface.h"
38#include "meshes/triangle_mesh.h"
52 public virtual PseudoSolidNodeUpdateElement<TCrouzeixRaviartElement<2>,
53 TPVDBubbleEnrichedElement<2,3> >
76 std::string
txt=
"VARIABLES=";
103 const unsigned &
nplot)
219 unsigned n_prev=
node_pt(0)->position_time_stepper_pt()->ntstorage();
239 <<
size() << std::endl;
255 :
public virtual SolidTElement<1,3>
269 :
public virtual SolidPointElement
350template<
class ELEMENT>
367 for (
unsigned j=0;
j<
n;
j++)
453 for(
unsigned i=0;
i<2;
i++)
496 const unsigned &
pdof,
574template<
class ELEMENT>
594 for(
unsigned i=0;
i<3;
i++)
624 Upper_wall_boundary_id);
636 Outflow_boundary_id);
648 Bottom_wall_boundary_id);
666 Interface_boundary_id);
730 Fluid_mesh_pt->max_permitted_error()=0.005;
731 Fluid_mesh_pt->min_permitted_error()=0.001;
732 Fluid_mesh_pt->max_element_size()=0.2;
733 Fluid_mesh_pt->min_element_size()=0.001;
738 Fluid_mesh_pt->min_element_size()=0.01;
742 this->Fluid_mesh_pt->output_boundaries(
"boundaries.dat");
743 this->Fluid_mesh_pt->output(
"mesh.dat");
746 complete_problem_setup();
749 Free_surface_mesh_pt=
new Mesh;
750 create_free_surface_elements();
774template<
class ELEMENT>
779 unsigned nb=Fluid_mesh_pt->nboundary();
780 for(
unsigned b=4;
b<
nb;
b++)
784 unsigned n_element = Fluid_mesh_pt->nboundary_element_in_region(
b,0);
792 Fluid_mesh_pt->boundary_element_in_region_pt(
b,0,
e));
795 int face_index = Fluid_mesh_pt->face_index_at_boundary_in_region(
b,0,
e);
803 Free_surface_mesh_pt->add_element_pt(
el_pt);
806 el_pt->set_boundary_number_in_bulk_mesh(
b);
824template<
class ELEMENT>
830 unsigned nbound=Fluid_mesh_pt->nboundary();
870 unsigned n_element = Fluid_mesh_pt->nelement();
895 n_element = Fluid_mesh_pt->nregion_element(1);
900 dynamic_cast<ELEMENT*
>(Fluid_mesh_pt->region_element_pt(1,
e));
916 nbound=this->Fluid_mesh_pt->nboundary();
920 unsigned num_nod=this->Fluid_mesh_pt->nboundary_node(
ibound);
927 unsigned n_prev=
nod_pt->time_stepper_pt()->nprev_values();
959 fix_pressure(0,0,0.0);
968template<
class ELEMENT>
973 cout <<
"Time is now " <<
time_pt()->time() << std::endl;
978 unsigned n_bound = Fluid_mesh_pt->nboundary_node(4);
981 Node*
nod_pt = Fluid_mesh_pt->boundary_node_pt(4,
n);
999 const unsigned npts = 5;
1032template<
class ELEMENT>
1040 unsigned nel=Fluid_mesh_pt->nelement();
1053 for (
unsigned e=0;
e<
nel;
e++)
1103 const double dt = 0.0025;
1122 problem.set_initial_condition();
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
ElasticRefineableTwoLayerMesh(const unsigned &nx, const unsigned &ny1, const unsigned &ny2, const double &lx, const double &h1, const double &h2, const bool &periodic_in_x, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in x-direction, number of elements in y-direction in bottom and ...
Problem class to simulate viscous drop propagating along 2D channel.
ELEMENT * Hijacked_element_pt
Pointer to hijacked element.
void doc_solution(const std::string &comment="")
Doc the solution.
Mesh * Free_surface_mesh_pt
Pointers to mesh of free surface elements.
void delete_free_surface_elements()
Delete free surface elements.
void actions_after_adapt()
Actions after adapt: Rebuild the mesh of free surface elements.
~TwoLayerInterfaceProblem()
Destructor.
void fix_pressure(const unsigned &e, const unsigned &pdof, const double &pvalue)
Fix pressure in element e at pressure dof pdof and set to pvalue.
void compute_error_estimate(double &max_err, double &min_err)
Compute the error estimates and assign to elements for plotting.
void actions_before_adapt()
Actions before adapt: Wipe the mesh of free surface elements.
void create_free_surface_elements()
Create free surface elements.
void complete_problem_setup()
Set boundary conditions and complete the build of all elements.
void actions_before_newton_solve()
Update the problem specs before solve.
void actions_after_newton_solve()
Update the after solve (empty)
TwoLayerInterfaceProblem()
Constructor.
void set_initial_condition()
Set the initial conditions.
Vector< TriangleMeshPolygon * > Drop_polygon_pt
Vector storing pointer to the drop polygons.
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
Pointer to Fluid_mesh.
@ Bottom_wall_boundary_id
void deform_interface(const double &epsilon, const unsigned &n_periods)
Function to deform the interface.
bool Use_volume_constraint
Bool to indicate if volume constraint is applied (only for steady run)
TriangleMeshPolygon * Outer_boundary_polyline_pt
Triangle mesh polygon for outer boundary.
Data * Drop_pressure_data_pt
Pointer to a global drop pressure datum.
double Initial_value_for_drop_pressure
Backed up drop pressure between adaptations.
Overload CrouzeixRaviart element to modify output.
void set_error(const double &error)
Set error value for post-processing.
MyCrouzeixRaviartElement()
Constructor initialise error.
double Error
Storage for elemental error estimate – used for post-processing.
void output(std::ostream &outfile, const unsigned &nplot)
Overload output function.
std::string variable_identifier()
Return variable identifier.
//////////////////////////////////////////////////////// ////////////////////////////////////////////...
double ReSt
Womersley number (Reynolds x Strouhal)
DocInfo Doc_info
Doc info.
ofstream Norm_file
File to document the norm of the solution (for validation purposes – triangle doesn't give fully repr...
ofstream Trace_file
Trace file.
Vector< double > G(2)
Direction of gravity.
double Length
Length of the channel.
double Density_Ratio
Ratio of density in upper fluid to density in lower fluid. Reynolds number etc. is based on density i...
double St
Strouhal number.
ConstitutiveLaw * Constitutive_law_pt
Constitutive law used to determine the mesh deformation.
double ReInvFr
Product of Reynolds number and inverse of Froude number.
double Nu
Pseudo-solid Poisson ratio.
double Viscosity_Ratio
Ratio of viscosity in upper fluid to viscosity in lower fluid. Reynolds number etc....
double Re
Reynolds number.
double Ca
Capillary number.
int main(int argc, char **argv)
Driver code for moving block problem.