31 #include "navier_stokes.h"
34 #include "meshes/tube_mesh.h"
38 using namespace oomph;
50 GeomObject(3,3), Radius(radius) { }
56 void position (
const Vector<double>& xi, Vector<double>& r)
const
58 r[0] = xi[2]*Radius*cos(xi[1]);
60 r[2] = -xi[2]*Radius*sin(xi[1]);
67 const Vector<double>& xi, Vector<double>& r)
const
93 template<
class ELEMENT>
101 const double& max_error_target);
107 void actions_before_newton_solve();
113 RefineableNavierStokesEquations<3>::
114 pin_redundant_nodal_pressures(mesh_pt()->element_pt());
124 return dynamic_cast<RefineableTubeMesh<ELEMENT>*
>(Problem::mesh_pt());
143 template<
class ELEMENT>
145 const double& min_error_target,
146 const double& max_error_target)
158 const double pi = MathematicalConstants::Pi;
162 Vector<double> centreline_limits(2);
163 centreline_limits[0] = 0.0;
164 centreline_limits[1] = pi;
169 Vector<double> theta_positions(4);
170 theta_positions[0] = -0.75*pi;
171 theta_positions[1] = -0.25*pi;
172 theta_positions[2] = 0.25*pi;
173 theta_positions[3] = 0.75*pi;
177 Vector<double> radial_frac(4,0.5);
183 Problem::mesh_pt()=
new RefineableTubeMesh<ELEMENT>(
Volume_pt,
190 Z2ErrorEstimator* error_estimator_pt=
new Z2ErrorEstimator;
191 mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
194 mesh_pt()->max_permitted_error()=max_error_target;
195 mesh_pt()->min_permitted_error()=min_error_target;
202 ELEMENT::Gamma[0] = 0.0;
203 ELEMENT::Gamma[1] = 0.0;
204 ELEMENT::Gamma[2] = 0.0;
207 unsigned num_bound =
mesh_pt()->nboundary();
208 for(
unsigned ibound=0;ibound<num_bound;ibound++)
210 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
211 for (
unsigned inod=0;inod<num_nod;inod++)
216 if((ibound==0) || (ibound==1))
218 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
219 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
220 mesh_pt()->boundary_node_pt(ibound,inod)->pin(2);
227 unsigned n_element =
mesh_pt()->nelement();
228 for(
unsigned i=0;i<n_element;i++)
231 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(i));
238 RefineableNavierStokesEquations<3>::
239 pin_redundant_nodal_pressures(
mesh_pt()->element_pt());
242 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
250 template<
class ELEMENT>
257 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
258 for (
unsigned inod=0;inod<num_nod;inod++)
261 double x=mesh_pt()->boundary_node_pt(ibound,inod)->x(0);
262 double z=mesh_pt()->boundary_node_pt(ibound,inod)->x(2);
264 double r=sqrt(x*x+z*z);
267 mesh_pt()->boundary_node_pt(ibound,inod)->
268 set_value(1,(1.0-pow(r,10.0)));
277 template<
class ELEMENT>
291 sprintf(filename,
"%s/soln_Re%g.dat",Doc_info.directory().c_str(),
293 some_file.open(filename);
294 mesh_pt()->output(some_file,npts);
310 int main(
int argc,
char* argv[])
315 unsigned max_adapt=1;
316 double max_error_target=0.02 , min_error_target=0.002;
326 doc_info.set_directory(
"RESLT_TH");
333 problem(doc_info,min_error_target,max_error_target);
335 cout <<
" Doing Taylor-Hood elements " << std::endl;
337 for(
unsigned i=0;i<2;i++)
340 problem.newton_solve(max_adapt);
354 doc_info.set_directory(
"RESLT_CR");
361 problem(doc_info,min_error_target,max_error_target);
363 cout <<
" Doing Crouzeix-Raviart elements " << std::endl;
365 for(
unsigned i=0;i<2;i++)
368 problem.newton_solve(max_adapt);
double Radius
Storage for the radius of the tube.
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)
MyCylinder(const double &radius)
Constructor that takes the radius of the tube as its argument.
virtual ~MyCylinder()
Destructor.
void position(const Vector< double > &xi, Vector< double > &r) const
Lagrangian coordinate xi.
Entry flow problem in tapered tube domain.
~SteadyTubeProblem()
Destructor (empty)
DocInfo Doc_info
Doc info object.
SteadyTubeProblem(DocInfo &doc_info, const double &min_error_target, const double &max_error_target)
Constructor: Pass DocInfo object and target errors.
void actions_before_newton_solve()
Update the problem specs before solve.
RefineableTubeMesh< ELEMENT > * mesh_pt()
Overload generic access function by one that returns a pointer to the specific mesh.
void doc_solution()
Doc the solution.
void actions_after_adapt()
After adaptation: Pin redudant pressure dofs.
GeomObject * Volume_pt
Pointer to GeomObject that specifies the domain volume.
int main(int argc, char *argv[])
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
Namespace for physical parameters.
double Re
Reynolds number.