31 #include "navier_stokes.h"
34 #include "meshes/tube_mesh.h"
38 using namespace oomph;
51 GeomObject(3,3), Radius(radius),
Delta(delta) { }
57 void position (
const Vector<double>& xi, Vector<double>& r)
const
59 r[0] = (1.0/
Delta)*cos(xi[0]) + xi[2]*Radius*cos(xi[0])*cos(xi[1]);
60 r[1] = (1.0/
Delta)*sin(xi[0]) + xi[2]*Radius*sin(xi[0])*cos(xi[1]);
61 r[2] = -xi[2]*Radius*sin(xi[1]);
68 const Vector<double>& xi, Vector<double>& r)
const
98 template<
class ELEMENT>
106 const double& max_error_target);
112 void actions_before_newton_solve();
118 RefineableNavierStokesEquations<3>::
119 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
129 return dynamic_cast<RefineableTubeMesh<ELEMENT>*
>(Problem::mesh_pt());
148 template<
class ELEMENT>
150 const double& min_error_target,
151 const double& max_error_target)
164 const double pi = MathematicalConstants::Pi;
167 Vector<double> centreline_limits(2);
168 centreline_limits[0] = 0.0;
169 centreline_limits[1] = pi;
174 Vector<double> theta_positions(4);
175 theta_positions[0] = -0.75*pi;
176 theta_positions[1] = -0.25*pi;
177 theta_positions[2] = 0.25*pi;
178 theta_positions[3] = 0.75*pi;
182 Vector<double> radial_frac(4,0.5);
188 Problem::mesh_pt()=
new RefineableTubeMesh<ELEMENT>(
Volume_pt,
195 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
196 mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
199 mesh_pt()->max_permitted_error()=max_error_target;
200 mesh_pt()->min_permitted_error()=min_error_target;
207 ELEMENT::Gamma[0] = 0.0;
208 ELEMENT::Gamma[1] = 0.0;
209 ELEMENT::Gamma[2] = 0.0;
212 unsigned num_bound =
mesh_pt()->nboundary();
213 for(
unsigned ibound=0;ibound<num_bound;ibound++)
215 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
216 for (
unsigned inod=0;inod<num_nod;inod++)
221 if((ibound==0) || (ibound==1))
223 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
224 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
225 mesh_pt()->boundary_node_pt(ibound,inod)->pin(2);
232 unsigned n_element =
mesh_pt()->nelement();
233 for(
unsigned i=0;i<n_element;i++)
236 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(i));
243 RefineableNavierStokesEquations<3>::
244 pin_redundant_nodal_pressures(
mesh_pt()->element_pt());
247 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
255 template<
class ELEMENT>
262 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
263 for (
unsigned inod=0;inod<num_nod;inod++)
266 double x=mesh_pt()->boundary_node_pt(ibound,inod)->x(0) -
268 double z=mesh_pt()->boundary_node_pt(ibound,inod)->x(2);
270 double r=sqrt(x*x+z*z);
273 mesh_pt()->boundary_node_pt(ibound,inod)->
274 set_value(1,(1.0-pow(r,2.0)));
283 template<
class ELEMENT>
297 sprintf(filename,
"%s/soln_Re%g.dat",Doc_info.directory().c_str(),
299 some_file.open(filename);
300 mesh_pt()->output(some_file,npts);
318 int main(
int argc,
char* argv[])
322 CommandLineArgs::setup(argc,argv);
329 double max_error_target,min_error_target;
333 if (CommandLineArgs::Argc==1)
339 max_error_target=0.001;
340 min_error_target=0.00001;
350 max_error_target=0.02;
351 min_error_target=0.002;
363 doc_info.set_directory(
"RESLT_TH");
370 problem(doc_info,min_error_target,max_error_target);
372 cout <<
" Doing Taylor-Hood elements " << std::endl;
375 problem.newton_solve(max_adapt);
384 doc_info.set_directory(
"RESLT_CR");
391 problem(doc_info,min_error_target,max_error_target);
393 cout <<
" Doing Crouzeix-Raviart elements " << std::endl;
396 problem.newton_solve(max_adapt);
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)
MyCurvedCylinder(const double &radius, const double &delta)
Constructor that takes the radius and curvature of the tube as its arguments.
void position(const Vector< double > &xi, Vector< double > &r) const
Lagrangian coordinate xi.
double Radius
Storage for the radius of the tube.
virtual ~MyCurvedCylinder()
Destructor.
Entry flow problem in tapered tube domain.
GeomObject * Volume_pt
Pointer to GeomObject that specifies the domain volume.
DocInfo Doc_info
Doc info object.
~SteadyCurvedTubeProblem()
Destructor (empty)
void actions_after_adapt()
After adaptation: Pin redudant pressure dofs.
void doc_solution()
Doc the solution.
void actions_before_newton_solve()
Update the problem specs before solve.
SteadyCurvedTubeProblem(DocInfo &doc_info, const double &min_error_target, const double &max_error_target)
Constructor: Pass DocInfo object and target errors.
RefineableTubeMesh< ELEMENT > * mesh_pt()
Overload generic access function by one that returns a pointer to the specific mesh.
int main(int argc, char *argv[])
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
Namespace for physical parameters.
double Re
Reynolds number.
double Delta
The desired curvature of the pipe.