37 #include "navier_stokes.h" 40 #include "meshes/rectangular_quadmesh.h" 44 using namespace oomph;
61 template<
class ELEMENT>
82 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
83 for (
unsigned inod=0;inod<num_nod;inod++)
87 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,1.0);
90 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,0.0);
94 unsigned num_bound = mesh_pt()->nboundary();
95 for(
unsigned ibound=1;ibound<num_bound;ibound++)
97 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
98 for (
unsigned inod=0;inod<num_nod;inod++)
100 for (
unsigned i=0;i<2;i++)
102 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,0.0);
113 RefineableNavierStokesEquations<2>::
114 unpin_all_pressure_dofs(mesh_pt()->element_pt());
117 RefineableNavierStokesEquations<2>::
118 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
121 fix_pressure(0,0,0.0);
125 void doc_solution(DocInfo& doc_info);
132 const double &pvalue)
135 dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e))->
136 fix_pressure(pdof,pvalue);
147 template<
class ELEMENT>
167 new RefineableRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
170 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
171 dynamic_cast<RefineableRectangularQuadMesh<ELEMENT>*
>(mesh_pt())->
172 spatial_error_estimator_pt()=error_estimator_pt;
177 unsigned num_bound = mesh_pt()->nboundary();
178 for(
unsigned ibound=0;ibound<num_bound;ibound++)
180 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
181 for (
unsigned inod=0;inod<num_nod;inod++)
184 for (
unsigned i=0;i<2;i++)
186 mesh_pt()->boundary_node_pt(ibound,inod)->pin(i);
192 unsigned n_element = mesh_pt()->nelement();
197 for(
unsigned e=0;e<n_element;e++)
200 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
206 RefineableNavierStokesEquations<2>::
207 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
210 fix_pressure(0,0,0.0);
213 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
222 template<
class ELEMENT>
234 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
236 some_file.open(filename);
237 mesh_pt()->output(some_file,npts);
253 doc_info.set_directory(
"RESLT");
257 unsigned max_adapt=3;
266 problem.newton_solve(max_adapt);
283 problem.newton_solve(max_adapt);
~RefineableDrivenCavityProblem()
Destructor: Empty.
int main()
Driver for RefineableDrivenCavity test problem.
void actions_after_newton_solve()
Update the after solve (empty)
double Re
Reynolds number.
Namespace for physical parameters.
void doc_solution(DocInfo &doc_info)
Doc the solution.
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...