35 #include "navier_stokes.h" 38 #include "meshes/tube_mesh.h" 42 using namespace oomph;
55 const double& pitch) :
56 GeomObject(3,3),Radius(radius),
Delta(delta),P(pitch)
59 Pi = MathematicalConstants::Pi;
66 void position (
const Vector<double>& xi, Vector<double>& r)
const 68 r[0] = (1.0/
Delta)*cos(xi[0]) + xi[2]*Radius*cos(xi[0])*cos(xi[1]);
69 r[1] = (1.0/
Delta)*sin(xi[0]) + xi[2]*Radius*sin(xi[0])*cos(xi[1]);
70 r[2] = P*xi[0]/(2.0*Pi) - xi[2]*Radius*sin(xi[1]);
77 const Vector<double>& xi, Vector<double>& r)
const 105 template<
class ELEMENT>
113 const double& max_error_target);
119 void actions_before_newton_solve();
125 RefineableNavierStokesEquations<3>::
126 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
136 return dynamic_cast<RefineableTubeMesh<ELEMENT>*
>(Problem::mesh_pt());
158 template<
class ELEMENT>
160 const double& min_error_target,
161 const double& max_error_target)
166 Max_residuals = 100.0;
179 const double pi = MathematicalConstants::Pi;
183 Vector<double> centreline_limits(2);
184 centreline_limits[0] = 0.0;
185 centreline_limits[1] = pi;
188 Vector<double> theta_positions(4);
189 theta_positions[0] = -0.75*pi;
190 theta_positions[1] = -0.25*pi;
191 theta_positions[2] = 0.25*pi;
192 theta_positions[3] = 0.75*pi;
195 Vector<double> radial_frac(4,0.5);
202 new RefineableTubeMesh<ELEMENT>(
Wall_pt,
209 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
210 mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
213 mesh_pt()->max_permitted_error()=max_error_target;
214 mesh_pt()->min_permitted_error()=min_error_target;
221 ELEMENT::Gamma[0] = 0.0;
222 ELEMENT::Gamma[1] = 0.0;
223 ELEMENT::Gamma[2] = 0.0;
225 unsigned num_bound =
mesh_pt()->nboundary();
226 for(
unsigned ibound=0;ibound<num_bound;ibound++)
228 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
229 for (
unsigned inod=0;inod<num_nod;inod++)
234 if((ibound==0) || (ibound==1))
236 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
237 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
238 mesh_pt()->boundary_node_pt(ibound,inod)->pin(2);
252 unsigned n_element =
mesh_pt()->nelement();
253 for(
unsigned i=0;i<n_element;i++)
256 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(i));
263 RefineableNavierStokesEquations<3>::
264 pin_redundant_nodal_pressures(
mesh_pt()->element_pt());
267 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
275 template<
class ELEMENT>
282 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
283 for (
unsigned inod=0;inod<num_nod;inod++)
286 double x=
mesh_pt()->boundary_node_pt(ibound,inod)->x(0) -
288 double z=
mesh_pt()->boundary_node_pt(ibound,inod)->x(2);
289 double r=sqrt(x*x+z*z);
292 mesh_pt()->boundary_node_pt(ibound,inod)->
293 set_value(1,(1.0-pow(r,2.0)));
302 template<
class ELEMENT>
316 sprintf(filename,
"%s/soln_Re%g.dat",
Doc_info.directory().c_str(),
318 some_file.open(filename);
319 mesh_pt()->output(some_file,npts);
337 int main(
int argc,
char* argv[])
341 CommandLineArgs::setup(argc,argv);
348 double max_error_target,min_error_target;
352 if (CommandLineArgs::Argc==1)
358 max_error_target=0.005;
359 min_error_target=0.0005;
370 max_error_target=0.02;
371 min_error_target=0.002;
383 doc_info.set_directory(
"RESLT_TH");
390 problem(doc_info,min_error_target,max_error_target);
392 cout <<
" Doing Taylor-Hood elements " << std::endl;
395 problem.newton_solve(max_adapt);
404 doc_info.set_directory(
"RESLT_CR");
411 problem(doc_info,min_error_target,max_error_target);
413 cout <<
" Doing Crouzeix-Raviart elements " << std::endl;
416 problem.newton_solve(max_adapt);
RefineableTubeMesh< ELEMENT > * mesh_pt()
Overload generic access function by one that returns a pointer to the specific mesh.
void position(const Vector< double > &xi, Vector< double > &r) const
Lagrangian coordinate xi.
GeomObject * Wall_pt
Pointer to GeomObject that specifies the domain boundary.
MyHelicalCylinder(const double &radius, const double &delta, const double &pitch)
Constructor.
int main(int argc, char *argv[])
DocInfo Doc_info
Doc info object.
double Re
Reynolds number.
Namespace for physical parameters.
void actions_after_adapt()
After adaptation: Pin redudant pressure dofs.
Entry flow problem in tapered tube domain.
void position(const unsigned &t, const Vector< double > &xi, Vector< double > &r) const
SteadyHelicalProblem(DocInfo &doc_info, const double &min_error_target, const double &max_error_target)
Constructor: Pass DocInfo object and target errors.
~SteadyHelicalProblem()
Destructor (empty)
int Alpha
Exponent for bluntness of velocity profile.
virtual ~MyHelicalCylinder()
Destructor.
double Delta
The desired curvature of the pipe.
void doc_solution()
Doc the solution.
void actions_before_newton_solve()
Update the problem specs before solve.