89 for (
unsigned i = 0;
i < 2;
i++)
110 for (
unsigned i = 0;
i < 2;
i++)
118 for (
unsigned i = 0;
i < 2;
i++)
124 for (
unsigned i = 0;
i < 2;
i++)
157 outfile <<
"ZONE" << std::endl;
166 for (
unsigned i = 0;
i < 2;
i++)
187 for (
unsigned i = 0;
i < 2;
i++)
195 for (
unsigned i = 0;
i < 2;
i++)
201 for (
unsigned i = 0;
i < 2;
i++)
218 const unsigned&
nplot,
247 for (
unsigned i = 0;
i < 2;
i++)
273 const unsigned&
nplot,
303 for (
unsigned i = 0;
i < 2;
i++)
329 const unsigned&
nplot,
357 for (
unsigned i = 0;
i < 2;
i++)
360 interpolated_u[
i] = 0.0;
370 for (
unsigned i = 0;
i < 2;
i++)
376 for (
unsigned i = 0;
i < 2;
i++)
378 outfile << interpolated_u[
i] <<
" ";
395 const unsigned&
nplot)
454 outfile << 0 <<
" " << 1 <<
" ";
471 //==============================================================
472 void PolarNavierStokesEquations::output(std::ostream &outfile,
473 const unsigned &nplot)
476 //Vector of local coordinates
479 // Tecplot header info
480 outfile << tecplot_zone_string(nplot);
482 // Loop over plot points
483 unsigned num_plot_points=nplot_points(nplot);
484 for (unsigned iplot=0;iplot<num_plot_points;iplot++)
487 // Get local coordinates of plot point
488 get_s_plot(iplot,nplot,s);
490 //Work out global physical coordinate
491 const double Alpha = alpha();
492 double r = interpolated_x(s,0);
493 double phi = interpolated_x(s,1);
494 double theta = Alpha*phi;
497 outfile << r*cos(theta) << " " << r*sin(theta) << " ";
500 outfile << interpolated_u_pnst(s,0)*cos(theta) -
501 interpolated_u_pnst(s,1)*sin(theta)
503 outfile << interpolated_u_pnst(s,0)*sin(theta) +
504 interpolated_u_pnst(s,1)*cos(theta)
508 outfile << interpolated_p_pnst(s) << " ";
510 // Radial and Azimuthal velocities
511 outfile << interpolated_u_pnst(s,0) << " " << interpolated_u_pnst(s,1) << "
514 // I need to add exact pressure, radial velocity and radial velocity
516 // Plus the error from these
518 double mu=(1./(sin(m)-m*cos(m)));
519 double exact_u=(mu/r)*(cos(m*phi)-cos(m));
520 double exact_p=(2.*mu)*((cos(m*phi)/(r*r))-cos(m));
521 double exact_dudr=-(exact_u/r);
522 double exact_dudphi=-mu*m*sin(m*phi)/r;
524 // If we don't have Stokes flow then we need to overwrite the Stokes
526 // reading in the correct similarity solution from file
527 const double Re = re();
530 double similarity_solution,dsimilarity_solution;
531 get_similarity_solution(theta,Alpha,similarity_solution,dsimilarity_solution);
532 double A = Global_Physical_Variables::P2/Alpha;
534 exact_u = similarity_solution/(r*Alpha);
535 exact_p = 2.*(exact_u/r)-(A/(2.*Alpha*Alpha))*((1./(r*r))-1.);
536 exact_dudr = -(exact_u/r);
537 exact_dudphi = dsimilarity_solution/(r*Alpha);
540 // exact pressure and error
541 outfile << exact_p << " " << (interpolated_p_pnst(s)-exact_p) << " ";
543 // r and theta for better plotting
544 outfile << r << " " << phi << " ";
546 // exact and oomph du/dr and du/dphi?
547 outfile << exact_u << " " << (interpolated_u_pnst(s,0)-exact_u) << " ";
548 outfile << exact_dudr << " " << (interpolated_dudx_pnst(s,0,0)-exact_dudr)
549 << " "; outfile << exact_dudphi << " " <<
550 (interpolated_dudx_pnst(s,0,1)-exact_dudphi) << " ";
552 outfile << std::endl;
554 outfile << std::endl;
580 for (
unsigned i = 0;
i < 2;
i++)
587 for (
unsigned i = 0;
i < 2;
i++)
608 const unsigned&
nplot)
647 for (
unsigned i = 0;
i < 2;
i++)
652 for (
unsigned j = 0;
j < 2;
j++)
654 interpolated_dudx(
i,
j) = 0.0;
664 for (
unsigned i = 0;
i < 2;
i++)
670 for (
unsigned j = 0;
j < 2;
j++)
679 for (
unsigned i = 0;
i < 2;
i++)
682 for (
unsigned k = 0;
k < 2;
k++)
690 for (
unsigned i = 0;
i < 2;
i++)
696 for (
unsigned i = 0;
i < 2;
i++)
705 for (
unsigned i = 0;
i < 2;
i++)
736 for (
unsigned i = 0;
i < 2;
i++)
754 for (
unsigned i = 0;
i < 2;
i++)
756 for (
unsigned j = 0;
j < 2;
j++)
785 for (
unsigned i = 0;
i < 2;
i++)
788 for (
unsigned j = 0;
j < 2;
j++)
807 for (
unsigned i = 0;
i < 2;
i++)
809 for (
unsigned j = 0;
j < 2;
j++)
851 for (
unsigned i = 0;
i < 2;
i++)
863 for (
unsigned i = 0;
i < 2;
i++)
865 interpolated_u[
i] = 0.0;
867 for (
unsigned j = 0;
j < 2;
j++)
869 interpolated_dudx(
i,
j) = 0.0;
878 for (
unsigned i = 0;
i < 2;
i++)
886 for (
unsigned j = 0;
j < 2;
j++)
900 0.5 * (interpolated_dudx(1, 0) - (interpolated_u[1] /
interpolated_x[0]) +
938 for (
unsigned i = 0;
i < 2;
i++)
950 for (
unsigned i = 0;
i < 2;
i++)
952 interpolated_u[
i] = 0.0;
954 for (
unsigned j = 0;
j < 2;
j++)
956 interpolated_dudx(
i,
j) = 0.0;
965 for (
unsigned i = 0;
i < 2;
i++)
973 for (
unsigned j = 0;
j < 2;
j++)
987 0.5 * (interpolated_dudx(1, 0) - (interpolated_u[1] /
interpolated_x[0]) +
1021 for (
unsigned i = 0;
i < 2;
i++)
1034 for (
unsigned i = 0;
i < 2;
i++)
1063 for (
unsigned i = 0;
i < 2;
i++)
1114 for (
unsigned i = 0;
i < 2;
i++)
1133 const double Re =
re();
1160 double interpolated_p = 0.0;
1168 for (
unsigned i = 0;
i < 2;
i++)
1172 interpolated_u[
i] = 0.0;
1174 for (
unsigned j = 0;
j < 2;
j++)
1176 interpolated_dudx(
i,
j) = 0.0;
1190 for (
unsigned i = 0;
i < 2;
i++)
1200 for (
unsigned j = 0;
j < 2;
j++)
1225 ((1. /
Alpha) * interpolated_dudx(1, 1) + interpolated_u[0])) *
1230 (interpolated_p - (1. +
Gamma[
i]) * interpolated_dudx(0, 0)) *
1237 Gamma[
i] * interpolated_dudx(1, 0)) *
1244 (interpolated_u[0] * interpolated_dudx(0, 0) +
1246 interpolated_dudx(0, 1) -
1283 (
psif[
l2] * interpolated_dudx(0, 0) +
1321 interpolated_dudx(0, 1) -
1360 interpolated_dudx(0, 1) -
1367 (interpolated_dudx(1, 0) +
1385 (interpolated_u[0] * interpolated_dudx(1, 0) +
1387 interpolated_dudx(1, 1) +
1423 (
psif[
l2] * interpolated_dudx(1, 0) +
1457 interpolated_dudx(1, 1) +
1508 (interpolated_dudx(0, 0) + (interpolated_u[0] /
interpolated_x[0]) +
1561 2, 2, 2, 2, 2, 2, 2, 2, 2};
1567 const unsigned int&
n)
const
1586 for (
unsigned i = 0;
i < 2;
i++)
1598 for (
unsigned j = 0;
j <
nval;
j++)
1612 3, 2, 3, 2, 2, 2, 3, 2, 3};
1631 for (
unsigned i = 0;
i < 2;
i++)
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned nnode() const
Return the number of nodes.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
unsigned ninternal_data() const
Return the number of internal data objects.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
An OomphLibError object which should be thrown when an run-time error is encountered....
virtual unsigned required_nvalue(const unsigned &n) const
Number of values (pinned or dofs) required at local node n.
void get_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs of pointers to data objects and unsigned integers that index th...
static const unsigned Initial_Nvalue[]
Static array of ints to hold required number of variables at nodes.
double dissipation() const
Return integral of dissipation over element.
virtual void pshape_pnst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
const double & re() const
Reynolds number.
double kin_energy() const
Get integral of kinetic energy over element.
static double Default_Physical_Constant_Value
Static default value for the physical constants (all initialised to zero)
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
virtual int p_local_eqn(const unsigned &n)=0
Access function for the local equation number information for the pressure. p_local_eqn[n] = local eq...
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all are initialised to one)
virtual double p_pnst(const unsigned &n_p) const =0
Pressure at local pressure "node" n_p Uses suitably interpolated value for hanging nodes.
void get_traction(const Vector< double > &s, const Vector< double > &N, Vector< double > &traction)
Compute traction (on the viscous scale) at local coordinate s for outer unit normal N.
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Strain-rate tensor: Now returns polar strain.
void output(std::ostream &outfile)
Output functionget_vels(const Vector<double>& x_to_get, Vector<double>& vels): x,y,...
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact solution specified via function pointer at a given number of plot points....
const double & alpha() const
Alpha.
virtual double dshape_and_dtest_eulerian_at_knot_pnst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and derivatives w.r.t. global coords at ipt-th integration point Return J...
static Vector< double > Default_Gravity_vector
Static default value for the gravity vector.
static int Pressure_not_stored_at_node
Static "magic" number that indicates that the pressure is not stored at a node.
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: x,y,[z],u,v,[w] in tecplot format. nplot points in each coordinate direction at time...
void strain_rate_by_r(const Vector< double > &s, DenseMatrix< double > &strain_rate) const
Function to return polar strain multiplied by r.
virtual unsigned u_index_pnst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
void full_output(std::ostream &outfile)
Full output function: x,y,[z],u,v,[w],p,du/dt,dv/dt,[dw/dt],dissipation in tecplot format....
void interpolated_u_pnst(const Vector< double > &s, Vector< double > &veloc) const
Compute vector of FE interpolated velocity u at local coordinate s.
double du_dt_pnst(const unsigned &n, const unsigned &i) const
i-th component of du/dt at local node n. Uses suitably interpolated value for hanging nodes.
virtual void fill_in_generic_residual_contribution(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Compute the residuals for the Navier–Stokes equations; flag=1(or 0): do (or don't) compute the Jacobi...
double pressure_integral() const
Integral of pressure over element.
virtual double u_pnst(const unsigned &n, const unsigned &i) const =0
Velocity i at local node n. Uses suitably interpolated value for hanging nodes.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Validate against exact solution at given time Solution is provided via function pointer....
virtual unsigned npres_pnst() const =0
Function to return number of pressure degrees of freedom.
double interpolated_p_pnst(const Vector< double > &s) const
Return FE interpolated pressure at local coordinate s.
void get_load_data(std::set< std::pair< Data *, unsigned > > &paired_load_data)
Add to the set paired_load_data pairs of pointers to data objects and unsigned integers that index th...
static const unsigned Pconv[]
Static array of ints to hold conversion from pressure node numbers to actual node numbers.
static const unsigned Initial_Nvalue[]
Static array of ints to hold number of variables at node.
unsigned npres_pnst() const
Return number of pressure values.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).