33 #include "navier_stokes.h"
36 #include "meshes/rectangular_quadmesh.h"
40 using namespace oomph;
57 template<
class ELEMENT>
78 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
79 for (
unsigned inod=0;inod<num_nod;inod++)
83 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,1.0);
86 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,0.0);
90 unsigned num_bound = mesh_pt()->nboundary();
91 for(
unsigned ibound=1;ibound<num_bound;ibound++)
93 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
94 for (
unsigned inod=0;inod<num_nod;inod++)
96 for (
unsigned i=0;i<2;i++)
98 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,0.0);
109 RefineableNavierStokesEquations<2>::
110 unpin_all_pressure_dofs(mesh_pt()->element_pt());
113 RefineableNavierStokesEquations<2>::
114 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
117 fix_pressure(0,0,0.0);
121 void doc_solution(DocInfo& doc_info);
128 const double &pvalue)
131 dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e))->
132 fix_pressure(pdof,pvalue);
143 template<
class ELEMENT>
163 new RefineableRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
166 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
167 dynamic_cast<RefineableRectangularQuadMesh<ELEMENT>*
>(mesh_pt())->
168 spatial_error_estimator_pt()=error_estimator_pt;
173 unsigned num_bound = mesh_pt()->nboundary();
174 for(
unsigned ibound=0;ibound<num_bound;ibound++)
176 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
177 for (
unsigned inod=0;inod<num_nod;inod++)
180 for (
unsigned i=0;i<2;i++)
182 mesh_pt()->boundary_node_pt(ibound,inod)->pin(i);
188 unsigned n_element = mesh_pt()->nelement();
193 for(
unsigned e=0;e<n_element;e++)
196 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
202 RefineableNavierStokesEquations<2>::
203 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
206 fix_pressure(0,0,0.0);
209 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
218 template<
class ELEMENT>
230 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
232 some_file.open(filename);
233 mesh_pt()->output(some_file,npts);
249 doc_info.set_directory(
"RESLT");
253 unsigned max_adapt=3;
262 problem.newton_solve(max_adapt);
279 problem.newton_solve(max_adapt);
int main()
Driver for RefineableDrivenCavity test problem.
Driven cavity problem in rectangular domain, templated by element type.
void doc_solution(DocInfo &doc_info)
Doc the solution.
void actions_after_newton_solve()
Update the after solve (empty)
~RefineableDrivenCavityProblem()
Destructor: Empty.
void actions_after_adapt()
After adaptation: Unpin pressure and pin redudant pressure dofs.
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.
RefineableDrivenCavityProblem()
Constructor.
void actions_before_newton_solve()
Update the problem specs before solve. (Re-)set velocity boundary conditions just to be on the safe s...
Namespace for physical parameters.
double Re
Reynolds number.