31 #include "navier_stokes.h"
34 #include "meshes/tube_mesh.h"
38 using namespace oomph;
51 const double& pitch) :
52 GeomObject(3,3),Radius(radius),
Delta(delta),P(pitch)
55 Pi = MathematicalConstants::Pi;
62 void position (
const Vector<double>& xi, Vector<double>& r)
const
64 r[0] = (1.0/
Delta)*cos(xi[0]) + xi[2]*Radius*cos(xi[0])*cos(xi[1]);
65 r[1] = (1.0/
Delta)*sin(xi[0]) + xi[2]*Radius*sin(xi[0])*cos(xi[1]);
66 r[2] = P*xi[0]/(2.0*Pi) - xi[2]*Radius*sin(xi[1]);
73 const Vector<double>& xi, Vector<double>& r)
const
101 template<
class ELEMENT>
109 const double& max_error_target);
115 void actions_before_newton_solve();
121 RefineableNavierStokesEquations<3>::
122 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
132 return dynamic_cast<RefineableTubeMesh<ELEMENT>*
>(Problem::mesh_pt());
154 template<
class ELEMENT>
156 const double& min_error_target,
157 const double& max_error_target)
162 Max_residuals = 100.0;
175 const double pi = MathematicalConstants::Pi;
179 Vector<double> centreline_limits(2);
180 centreline_limits[0] = 0.0;
181 centreline_limits[1] = pi;
184 Vector<double> theta_positions(4);
185 theta_positions[0] = -0.75*pi;
186 theta_positions[1] = -0.25*pi;
187 theta_positions[2] = 0.25*pi;
188 theta_positions[3] = 0.75*pi;
191 Vector<double> radial_frac(4,0.5);
198 new RefineableTubeMesh<ELEMENT>(
Wall_pt,
205 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
206 mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
209 mesh_pt()->max_permitted_error()=max_error_target;
210 mesh_pt()->min_permitted_error()=min_error_target;
217 ELEMENT::Gamma[0] = 0.0;
218 ELEMENT::Gamma[1] = 0.0;
219 ELEMENT::Gamma[2] = 0.0;
221 unsigned num_bound =
mesh_pt()->nboundary();
222 for(
unsigned ibound=0;ibound<num_bound;ibound++)
224 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
225 for (
unsigned inod=0;inod<num_nod;inod++)
230 if((ibound==0) || (ibound==1))
232 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
233 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
234 mesh_pt()->boundary_node_pt(ibound,inod)->pin(2);
248 unsigned n_element =
mesh_pt()->nelement();
249 for(
unsigned i=0;i<n_element;i++)
252 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(i));
259 RefineableNavierStokesEquations<3>::
260 pin_redundant_nodal_pressures(
mesh_pt()->element_pt());
263 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
271 template<
class ELEMENT>
278 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
279 for (
unsigned inod=0;inod<num_nod;inod++)
282 double x=mesh_pt()->boundary_node_pt(ibound,inod)->x(0) -
284 double z=mesh_pt()->boundary_node_pt(ibound,inod)->x(2);
285 double r=sqrt(x*x+z*z);
288 mesh_pt()->boundary_node_pt(ibound,inod)->
289 set_value(1,(1.0-pow(r,2.0)));
298 template<
class ELEMENT>
312 sprintf(filename,
"%s/soln_Re%g.dat",Doc_info.directory().c_str(),
314 some_file.open(filename);
315 mesh_pt()->output(some_file,npts);
333 int main(
int argc,
char* argv[])
337 CommandLineArgs::setup(argc,argv);
344 double max_error_target,min_error_target;
348 if (CommandLineArgs::Argc==1)
354 max_error_target=0.005;
355 min_error_target=0.0005;
366 max_error_target=0.02;
367 min_error_target=0.002;
379 doc_info.set_directory(
"RESLT_TH");
386 problem(doc_info,min_error_target,max_error_target);
388 cout <<
" Doing Taylor-Hood elements " << std::endl;
391 problem.newton_solve(max_adapt);
400 doc_info.set_directory(
"RESLT_CR");
407 problem(doc_info,min_error_target,max_error_target);
409 cout <<
" Doing Crouzeix-Raviart elements " << std::endl;
412 problem.newton_solve(max_adapt);
The arguemts are the radius of the tube, its curvature in the x,y plane and the pitch of the helix.
MyHelicalCylinder(const double &radius, const double &delta, const double &pitch)
Constructor.
virtual ~MyHelicalCylinder()
Destructor.
void position(const Vector< double > &xi, Vector< double > &r) const
Lagrangian coordinate xi.
void position(const unsigned &t, const Vector< double > &xi, Vector< double > &r) const
Return the position of the tube as a function of time (doesn't move as a function of time)
Entry flow problem in tapered tube domain.
DocInfo Doc_info
Doc info object.
GeomObject * Wall_pt
Pointer to GeomObject that specifies the domain boundary.
void actions_before_newton_solve()
Update the problem specs before solve.
void actions_after_adapt()
After adaptation: Pin redudant pressure dofs.
RefineableTubeMesh< ELEMENT > * mesh_pt()
Overload generic access function by one that returns a pointer to the specific mesh.
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.
void doc_solution()
Doc the solution.
int main(int argc, char *argv[])
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
Namespace for physical parameters.
double Re
Reynolds number.
double Delta
The desired curvature of the pipe.