35 #include "navier_stokes.h" 38 #include "meshes/tube_mesh.h" 42 using namespace oomph;
55 GeomObject(3,3), Radius(radius),
Delta(delta) { }
61 void position (
const Vector<double>& xi, Vector<double>& r)
const 63 r[0] = (1.0/
Delta)*cos(xi[0]) + xi[2]*Radius*cos(xi[0])*cos(xi[1]);
64 r[1] = (1.0/
Delta)*sin(xi[0]) + xi[2]*Radius*sin(xi[0])*cos(xi[1]);
65 r[2] = -xi[2]*Radius*sin(xi[1]);
72 const Vector<double>& xi, Vector<double>& r)
const 102 template<
class ELEMENT>
110 const double& max_error_target);
116 void actions_before_newton_solve();
122 RefineableNavierStokesEquations<3>::
123 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
133 return dynamic_cast<RefineableTubeMesh<ELEMENT>*
>(Problem::mesh_pt());
152 template<
class ELEMENT>
154 const double& min_error_target,
155 const double& max_error_target)
168 const double pi = MathematicalConstants::Pi;
171 Vector<double> centreline_limits(2);
172 centreline_limits[0] = 0.0;
173 centreline_limits[1] = pi;
178 Vector<double> theta_positions(4);
179 theta_positions[0] = -0.75*pi;
180 theta_positions[1] = -0.25*pi;
181 theta_positions[2] = 0.25*pi;
182 theta_positions[3] = 0.75*pi;
186 Vector<double> radial_frac(4,0.5);
192 Problem::mesh_pt()=
new RefineableTubeMesh<ELEMENT>(
Volume_pt,
199 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
200 mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
203 mesh_pt()->max_permitted_error()=max_error_target;
204 mesh_pt()->min_permitted_error()=min_error_target;
211 ELEMENT::Gamma[0] = 0.0;
212 ELEMENT::Gamma[1] = 0.0;
213 ELEMENT::Gamma[2] = 0.0;
216 unsigned num_bound =
mesh_pt()->nboundary();
217 for(
unsigned ibound=0;ibound<num_bound;ibound++)
219 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
220 for (
unsigned inod=0;inod<num_nod;inod++)
225 if((ibound==0) || (ibound==1))
227 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
228 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
229 mesh_pt()->boundary_node_pt(ibound,inod)->pin(2);
236 unsigned n_element =
mesh_pt()->nelement();
237 for(
unsigned i=0;i<n_element;i++)
240 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(i));
247 RefineableNavierStokesEquations<3>::
248 pin_redundant_nodal_pressures(
mesh_pt()->element_pt());
251 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
259 template<
class ELEMENT>
266 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
267 for (
unsigned inod=0;inod<num_nod;inod++)
270 double x=
mesh_pt()->boundary_node_pt(ibound,inod)->x(0) -
272 double z=
mesh_pt()->boundary_node_pt(ibound,inod)->x(2);
274 double r=sqrt(x*x+z*z);
277 mesh_pt()->boundary_node_pt(ibound,inod)->
278 set_value(1,(1.0-pow(r,2.0)));
287 template<
class ELEMENT>
301 sprintf(filename,
"%s/soln_Re%g.dat",
Doc_info.directory().c_str(),
303 some_file.open(filename);
304 mesh_pt()->output(some_file,npts);
322 int main(
int argc,
char* argv[])
326 CommandLineArgs::setup(argc,argv);
333 double max_error_target,min_error_target;
337 if (CommandLineArgs::Argc==1)
343 max_error_target=0.001;
344 min_error_target=0.00001;
354 max_error_target=0.02;
355 min_error_target=0.002;
367 doc_info.set_directory(
"RESLT_TH");
374 problem(doc_info,min_error_target,max_error_target);
376 cout <<
" Doing Taylor-Hood elements " << std::endl;
379 problem.newton_solve(max_adapt);
388 doc_info.set_directory(
"RESLT_CR");
395 problem(doc_info,min_error_target,max_error_target);
397 cout <<
" Doing Crouzeix-Raviart elements " << std::endl;
400 problem.newton_solve(max_adapt);
void position(const Vector< double > &xi, Vector< double > &r) const
Lagrangian coordinate xi.
void actions_after_adapt()
After adaptation: Pin redudant pressure dofs.
DocInfo Doc_info
Doc info object.
MyCurvedCylinder(const double &radius, const double &delta)
virtual ~MyCurvedCylinder()
Destructor.
RefineableTubeMesh< ELEMENT > * mesh_pt()
Overload generic access function by one that returns a pointer to the specific mesh.
double Re
Reynolds number.
Namespace for physical parameters.
SteadyCurvedTubeProblem(DocInfo &doc_info, const double &min_error_target, const double &max_error_target)
Constructor: Pass DocInfo object and target errors.
~SteadyCurvedTubeProblem()
Destructor (empty)
void actions_before_newton_solve()
Update the problem specs before solve.
int main(int argc, char *argv[])
double Delta
The desired curvature of the pipe.
void position(const unsigned &t, const Vector< double > &xi, Vector< double > &r) const
GeomObject * Volume_pt
Pointer to GeomObject that specifies the domain volume.
Entry flow problem in tapered tube domain.
void doc_solution()
Doc the solution.
double Radius
Storage for the radius of the tube.