37 #include "advection_diffusion.h" 38 #include "navier_stokes.h" 39 #include "multi_physics.h" 42 #include "meshes/rectangular_quadmesh.h" 45 using namespace oomph;
87 template<
class ELEMENT>
100 void actions_before_newton_solve();
110 return dynamic_cast<RectangularQuadMesh<ELEMENT>*
>(
122 RefineableNavierStokesEquations<2>::
123 unpin_all_pressure_dofs(mesh_pt()->element_pt());
127 fix_pressure(0,0,0.0);
132 const double &pvalue)
135 dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e))->
136 fix_pressure(pdof,pvalue);
165 template<
class ELEMENT>
170 Doc_info.set_directory(
"RESLT");
185 RefineableRectangularQuadMesh<ELEMENT>* cast_mesh_pt =
186 new RefineableRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
189 Problem::mesh_pt() = cast_mesh_pt;
193 cast_mesh_pt->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
196 cast_mesh_pt->max_permitted_error()=0.5e-3;
197 cast_mesh_pt->min_permitted_error()=0.5e-4;
205 unsigned num_bound = mesh_pt()->nboundary();
206 for(
unsigned ibound=0;ibound<num_bound;ibound++)
213 if((ibound==1) || (ibound==3)) {val_max=1;}
216 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
217 for (
unsigned inod=0;inod<num_nod;inod++)
220 for(
unsigned j=0;j<val_max;j++)
222 mesh_pt()->boundary_node_pt(ibound,inod)->pin(j);
229 fix_pressure(0,0,0.0);
236 unsigned n_element = mesh_pt()->nelement();
237 for(
unsigned i=0;i<n_element;i++)
240 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
262 cout <<
"Number of equations: " << assign_eqn_numbers() << endl;
271 template<
class ELEMENT>
275 unsigned num_bound = mesh_pt()->nboundary();
276 for(
unsigned ibound=0;ibound<num_bound;ibound++)
279 unsigned num_nod=mesh_pt()->nboundary_node(ibound);
280 for(
unsigned inod=0;inod<num_nod;inod++)
283 Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
288 if((ibound==1) || (ibound==3)) {vel_max = 1;}
290 for(
unsigned j=0;j<vel_max;j++) {nod_pt->set_value(j,0.0);}
296 nod_pt->set_value(2,-0.5);
301 double x = nod_pt->x(0);
304 double value = sin(2.0*3.141592654*x/3.0);
305 nod_pt->set_value(1,value);
311 if(ibound==0) {nod_pt->set_value(2,0.5);}
322 template<
class ELEMENT>
334 sprintf(filename,
"%s/soln%i.dat",Doc_info.directory().c_str(),
336 some_file.open(filename);
337 mesh_pt()->output(some_file,npts);
361 problem.enable_imperfection();
364 problem.newton_solve(2);
367 problem.doc_solution();
374 problem.disable_imperfection();
375 problem.newton_solve(2);
376 problem.doc_solution();
~RefineableConvectionProblem()
Destructor. Empty.
void actions_after_adapt()
Actions after adaptation, Re-pin a single pressure degree of freedom.
double Peclet
Peclet number (identically one from our non-dimensionalisation)
void actions_after_newton_solve()
Update the problem after solve (empty)
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 doc_solution()
Doc the solution.
void actions_before_adapt()
Actions before adapt:(empty)
void actions_before_newton_solve()
Update the problem specs before solve:
RectangularQuadMesh< ELEMENT > * mesh_pt()
Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh...
Namespace for the physical parameters in the problem.
Vector< double > Direction_of_gravity(2)
Gravity vector.
RefineableConvectionProblem()
Constructor.
void enable_imperfection()
Set the boundary condition on the upper wall to be perturbed slightly to force the solution into the ...
double Inverse_Prandtl
1/Prandtl number
void disable_imperfection()
Set the boundary condition on the upper wall to be unperturbed.
double Rayleigh
Rayleigh number, set to be greater than the threshold for linear instability.