57 const unsigned& nplot,
61 const unsigned n_node =
nnode();
79 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
88 for (
unsigned i = 0;
i < DIM;
i++)
94 for (
unsigned l = 0; l < n_node; l++)
101 for (
unsigned i = 0;
i < (2 * DIM);
i++)
107 interpolated_u[
i] = 0.0;
110 for (
unsigned l = 0; l < n_node; l++)
112 interpolated_u[
i] +=
nodal_value(
t, l, u_nodal_index) * psi[l];
117 for (
unsigned i = 0;
i < DIM;
i++)
123 for (
unsigned i = 0;
i < (2 * DIM);
i++)
125 outfile << interpolated_u[
i] <<
" ";
128 outfile << std::endl;
144 const unsigned& nplot)
156 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
162 for (
unsigned i = 0;
i < DIM;
i++)
168 for (
unsigned i = 0;
i < (4 * DIM);
i++)
174 for (
unsigned i = 0;
i < 2;
i++)
179 outfile << std::endl;
181 outfile << std::endl;
195 const unsigned& nplot)
207 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
213 for (
unsigned i = 0;
i < 2;
i++)
219 for (
unsigned i = 0;
i < (2 * DIM);
i++)
225 for (
unsigned i = 0;
i < 2;
i++)
230 fprintf(file_pt,
"\n");
233 fprintf(file_pt,
"\n");
251 const unsigned& real)
const
254 if ((strainrate.
ncol() != DIM) || (strainrate.
nrow() != DIM))
256 std::ostringstream error_message;
257 error_message <<
"The strain rate has incorrect dimensions "
258 << strainrate.
ncol() <<
" x " << strainrate.
nrow()
259 <<
" Not " << DIM << std::endl;
262 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
271 double cosomegat = 1.0 / sqrt(2.0);
272 double sinomegat = cosomegat;
275 unsigned n_node =
nnode();
279 DShape dpsifdx(n_node, DIM);
287 for (
unsigned i = 0;
i < DIM; ++
i)
290 for (
unsigned j = 0; j < DIM; ++j)
292 dudx[
i][j].real(0.0);
293 dudx[
i][j].imag(0.0);
298 unsigned n_veloc = 2 * DIM;
299 unsigned u_nodal_index[n_veloc];
300 for (
unsigned i = 0;
i < n_veloc; ++
i)
306 for (
unsigned l = 0; l < n_node; l++)
309 for (
unsigned i = 0;
i < DIM;
i++)
312 const std::complex<double> u_value(
317 for (
unsigned j = 0; j < DIM; j++)
319 dudx[
i][j] += u_value * dpsifdx(l, j);
337 for (
unsigned i = 0;
i < DIM; ++
i)
339 for (
unsigned j = 0; j < DIM; ++j)
342 dudx[
i][j].real() * cosomegat + dudx[
i][j].imag() * sinomegat;
349 for (
unsigned i = 0;
i < DIM;
i++)
352 for (
unsigned j = 0; j < DIM; j++)
354 strainrate(
i, j) = 0.5 * (real_dudx(
i, j) + real_dudx(j,
i));
376 const unsigned n_node =
nnode();
382 const unsigned n_veloc = 4 * DIM;
385 unsigned u_nodal_index[n_veloc];
386 for (
unsigned i = 0;
i < n_veloc; ++
i)
392 Shape psif(n_node), testf(n_node);
393 DShape dpsifdx(n_node, DIM), dtestfdx(n_node, DIM);
396 Shape psip(n_pres), testp(n_pres);
410 const double eval_real =
lambda();
411 const double eval_imag =
omega();
413 const std::complex<double> eigenvalue(eval_real, eval_imag);
419 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
422 for (
unsigned i = 0;
i < DIM;
i++)
433 ipt, psif, dpsifdx, testf, dtestfdx);
440 const double W = w * J;
453 for (
unsigned i = 0;
i < DIM; ++
i)
455 interpolated_u[
i].real(0.0);
456 interpolated_u[
i].imag(0.0);
457 interpolated_u_normalisation[
i].real(0.0);
458 interpolated_u_normalisation[
i].imag(0.0);
462 std::complex<double> interpolated_p(0.0, 0.0);
463 std::complex<double> interpolated_p_normalisation(0.0, 0.0);
468 for (
unsigned i = 0;
i < DIM; ++
i)
470 interpolated_dudx[
i].resize(DIM);
471 for (
unsigned j = 0; j < DIM; ++j)
473 interpolated_dudx[
i][j].real(0.0);
474 interpolated_dudx[
i][j].imag(0.0);
483 for (
unsigned l = 0; l < n_pres; l++)
486 const double psip_ = psip(l);
493 interpolated_p += p_value * psip_;
498 interpolated_p_normalisation += p_norm_value * psip_;
506 for (
unsigned l = 0; l < n_node; l++)
509 const double psif_ = psif(l);
512 for (
unsigned i = 0;
i < DIM;
i++)
518 for (
unsigned i = 0;
i < DIM;
i++)
521 const std::complex<double> u_value(
526 interpolated_u[
i] += u_value * psif_;
532 for (
unsigned j = 0; j < DIM; j++)
534 interpolated_dudx[
i][j] += u_value * dpsifdx(l, j);
538 const std::complex<double> normalisation_value(
541 interpolated_u_normalisation[
i] += normalisation_value * psif_;
585 for (
unsigned l = 0; l < n_node; l++)
588 for (
unsigned i = 0;
i < DIM;
i++)
592 std::complex<double> residual_contribution =
593 -scaled_re_st * eigenvalue * interpolated_u[
i] * testf[l] *
W;
595 residual_contribution += interpolated_p * dtestfdx(l,
i) *
W;
597 for (
unsigned k = 0; k < DIM; ++k)
599 residual_contribution -=
601 (interpolated_dudx[
i][k] +
Gamma[
i] * interpolated_dudx[k][
i]) *
606 for (
unsigned k = 0; k < DIM; ++k)
608 residual_contribution -=
610 (base_flow_u[k] * interpolated_dudx[
i][k] +
611 interpolated_u[k] * base_flow_dudx(
i, k)) *
623 residuals[local_eqn] += residual_contribution.real();
629 residuals[local_eqn] += residual_contribution.imag();
722 for (
unsigned l = 0; l < n_pres; l++)
725 std::complex<double> residual_contribution = interpolated_dudx[0][0];
726 for (
unsigned k = 1; k < DIM; ++k)
728 residual_contribution += interpolated_dudx[k][k];
735 residuals[local_eqn] += residual_contribution.real() * testp[l] *
W;
742 residuals[local_eqn] += residual_contribution.imag() * testp[l] *
W;
748 std::complex<double> residual_contribution =
749 interpolated_p_normalisation * interpolated_p;
750 for (
unsigned k = 0; k < DIM; ++k)
752 residual_contribution +=
753 interpolated_u_normalisation[k] * interpolated_u[k];
759 residuals[local_eqn] += residual_contribution.real() *
W;
765 residuals[local_eqn] += residual_contribution.imag() *
W;
786 8, 8, 8, 8, 8, 8, 8, 8, 8};
793 const unsigned& n)
const
812 12, 8, 12, 8, 8, 8, 12, 8, 12};
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned long nrow() const
Return the number of rows of the matrix.
unsigned long ncol() const
Return the number of columns of the matrix.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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")
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.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
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"...
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.
virtual unsigned u_index_linearised_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
virtual unsigned npres_linearised_nst() const =0
Return the number of pressure degrees of freedom associated with a single pressure component in the e...
const double & re() const
Reynolds number.
virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0
Access function for the local equation number information for the i-th component of the pressure....
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
void strain_rate(const Vector< double > &s, DenseMatrix< double > &strain_rate, const unsigned &real) const
Strain-rate tensor: where (in that order)
void output_veloc(std::ostream &outfile, const unsigned &nplot, const unsigned &t)
Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, in tecplot format. nplot points in each coordina...
virtual void pshape_linearised_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
virtual void get_base_flow_u(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
Calculate the velocity components of the base flow solution at a given time and Eulerian position.
virtual double p_linearised_nst(const unsigned &n_p, const unsigned &i) const =0
Return the i-th pressure value at local pressure "node" n_p. Uses suitably interpolated value for han...
static int Pressure_not_stored_at_node
Static "magic" number that indicates that the pressure is not stored at a node.
virtual double dshape_and_dtest_eulerian_at_knot_linearised_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and their derivatives w.r.t. global coordinates at the ipt-th integration...
void output(std::ostream &outfile)
Output function: r, z, U^C, U^S, V^C, V^S, W^C, W^S, P^C, P^S in tecplot format. Default number of pl...
int eigenvalue_local_eqn(const unsigned &i)
virtual void fill_in_generic_residual_contribution_linearised_nst(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...
const double & lambda() const
double interpolated_p_linearised_nst(const Vector< double > &s, const unsigned &i) const
Return the i-th component of the FE interpolated pressure p[i] at local coordinate s.
virtual void get_base_flow_dudx(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Calculate the derivatives of the velocity components of the base flow solution w.r....
static double Default_Physical_Constant_Value
Static default value for the physical constants (all initialised to zero)
const double & viscosity_ratio() const
Viscosity ratio for element: element's viscosity relative to the viscosity used in the definition of ...
double interpolated_u_linearised_nst(const Vector< double > &s, const unsigned &i) const
Compute the element's residual Vector and the jacobian matrix. Virtual function can be overloaded by ...
const double & omega() const
static double Default_Physical_Ratio_Value
Static default value for the physical ratios (all initialised to one)
const double & density_ratio() const
Density ratio for element: element's density relative to the viscosity used in the definition of the ...
static const unsigned Initial_Nvalue[]
Static array of ints to hold required number of variables at nodes.
virtual unsigned required_nvalue(const unsigned &n) const
Return number of values (pinned or dofs) required at local node n.
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.
An OomphLibError object which should be thrown when an run-time error is encountered....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
double & time()
Return current value of continous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...